diff --git a/snapshots/master/demos/android/energy-monitor.apk b/snapshots/master/demos/android/energy-monitor.apk index a901fd182..fc966fd48 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 b2c4d1670..707343701 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_bg.wasm b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm index 375d50d92..499742d2e 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/energy-monitor/pkg/energy_monitor_bg.wasm b/snapshots/master/demos/energy-monitor/pkg/energy_monitor_bg.wasm index 8ea98b31f..14cc3fe92 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/gallery/pkg/cosmic/gallery.js b/snapshots/master/demos/gallery/pkg/cosmic/gallery.js index 7ce19ee06..da311dc34 100644 --- a/snapshots/master/demos/gallery/pkg/cosmic/gallery.js +++ b/snapshots/master/demos/gallery/pkg/cosmic/gallery.js @@ -1646,64 +1646,64 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper6900 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3299, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7243 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3495, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6902 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3299, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7245 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3495, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6903 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3299, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7246 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3495, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6904 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3299, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7247 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3495, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6905 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3299, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper7248 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3495, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10127 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper10469 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3736, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11355 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper11697 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3736, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11394 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11736 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3736, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11414 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11756 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3736, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11432 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11774 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3736, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11442 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11784 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3736, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11446 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11788 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3736, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11455 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11797 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3736, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11501 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11843 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3736, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11511 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_57); + imports.wbg.__wbindgen_closure_wrapper11853 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3736, __wbg_adapter_57); 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 3ac85c433..7423e3ab3 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/cupertino/gallery.js b/snapshots/master/demos/gallery/pkg/cupertino/gallery.js index 264d4a737..8794a8808 100644 --- a/snapshots/master/demos/gallery/pkg/cupertino/gallery.js +++ b/snapshots/master/demos/gallery/pkg/cupertino/gallery.js @@ -1646,64 +1646,64 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper6616 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3087, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6677 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3131, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6618 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3087, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6679 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3131, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6619 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3087, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6680 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3131, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6620 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3087, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6681 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3131, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6621 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 3087, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6682 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 3131, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9845 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9905 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3372, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11073 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper11133 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3372, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11112 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11172 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3372, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11132 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11192 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3372, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11150 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11210 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3372, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11160 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11220 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3372, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11164 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11224 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3372, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11173 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11233 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3372, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11219 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper11279 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3372, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11229 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_57); + imports.wbg.__wbindgen_closure_wrapper11289 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3372, __wbg_adapter_57); 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 d84bd5027..83ef62613 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/fluent/gallery.js b/snapshots/master/demos/gallery/pkg/fluent/gallery.js index 33360ca85..df85d532b 100644 --- a/snapshots/master/demos/gallery/pkg/fluent/gallery.js +++ b/snapshots/master/demos/gallery/pkg/fluent/gallery.js @@ -1646,64 +1646,64 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper5723 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2622, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6092 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2908, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5725 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2622, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6094 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2908, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5726 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2622, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6095 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2908, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5727 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2622, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6096 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2908, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5728 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2622, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper6097 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2908, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8947 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9316 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3149, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10175 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper10544 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3149, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10214 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper10583 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3149, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10234 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper10603 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3149, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10252 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper10621 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3149, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10262 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper10631 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3149, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10266 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper10635 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3149, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10275 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper10644 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3149, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10321 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper10690 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3149, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10331 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_57); + imports.wbg.__wbindgen_closure_wrapper10700 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3149, __wbg_adapter_57); 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 41fcfe9b3..c6150fc96 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/material/gallery.js b/snapshots/master/demos/gallery/pkg/material/gallery.js index 302809ca4..d698f667b 100644 --- a/snapshots/master/demos/gallery/pkg/material/gallery.js +++ b/snapshots/master/demos/gallery/pkg/material/gallery.js @@ -1646,64 +1646,64 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper5175 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2458, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5379 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2614, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5177 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2458, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5381 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2614, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5178 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2458, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5382 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2614, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5179 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2458, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5383 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2614, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5180 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2458, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5384 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2614, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8408 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper8612 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2855, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9636 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper9840 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2855, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9675 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9879 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2855, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9695 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9899 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2855, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9713 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9917 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2855, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9723 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9927 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2855, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9727 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9931 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2855, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9736 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9940 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2855, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9782 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper9986 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2855, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9792 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_57); + imports.wbg.__wbindgen_closure_wrapper9996 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2855, __wbg_adapter_57); 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 dcc1cc0f7..ed0b76032 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/imagefilter/pkg/imagefilter.js b/snapshots/master/demos/imagefilter/pkg/imagefilter.js index 52148dfda..c873b009b 100644 --- a/snapshots/master/demos/imagefilter/pkg/imagefilter.js +++ b/snapshots/master/demos/imagefilter/pkg/imagefilter.js @@ -1630,64 +1630,64 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper1286 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 278, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1295 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 291, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1288 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 278, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1297 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 291, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1289 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 278, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1298 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 291, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1290 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 278, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1299 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 291, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1291 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 278, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1300 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 291, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4651 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 537, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper4654 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 550, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5879 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 537, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper5882 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 550, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5918 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 537, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper5921 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 550, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5938 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 537, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper5941 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 550, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5956 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 537, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper5959 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 550, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5966 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 537, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper5969 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 550, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5970 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 537, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper5973 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 550, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5979 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 537, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper5982 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 550, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6025 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 537, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6028 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 550, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6035 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 537, __wbg_adapter_57); + imports.wbg.__wbindgen_closure_wrapper6038 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 550, __wbg_adapter_57); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm index f02a98ac8..2b9387b6c 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/memory/pkg/memory_bg.wasm b/snapshots/master/demos/memory/pkg/memory_bg.wasm index ec1e404d9..a3875de1d 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/plotter/pkg/plotter_bg.wasm b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm index b8102b5c7..5fb958534 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/printerdemo/pkg/printerdemo_lib.js b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js index 0179f07e9..da2aba1c5 100644 --- a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js +++ b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js @@ -1668,64 +1668,64 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4634 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2136, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper4630 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2146, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4636 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2136, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper4632 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2146, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4638 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2136, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper4634 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2146, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4640 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2136, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper4636 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2146, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4642 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2136, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper4638 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2146, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6051 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2614, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6047 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2624, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6053 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2614, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6049 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2624, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6056 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2614, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6052 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2624, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6058 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2614, __wbg_adapter_44); + imports.wbg.__wbindgen_closure_wrapper6054 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2624, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6062 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2614, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6058 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2624, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6064 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2614, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6060 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2624, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6066 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2614, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6062 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2624, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6071 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2614, __wbg_adapter_53); + imports.wbg.__wbindgen_closure_wrapper6067 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2624, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6080 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2614, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6076 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2624, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6753 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2659, __wbg_adapter_58); + imports.wbg.__wbindgen_closure_wrapper6749 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2669, __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 3a9dee5c9..0ccf74abf 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_old/pkg/printerdemo_old.js b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js index 64270e094..fd53bc3cd 100644 --- a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js +++ b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js @@ -1629,64 +1629,64 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper1934 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 641, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1945 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 656, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1936 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 641, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1947 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 656, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1937 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 641, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1948 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 656, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1938 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 641, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1949 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 656, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1939 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 641, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper1950 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 656, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5359 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper5367 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 906, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6587 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper6595 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 906, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6626 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6634 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 906, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6646 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6654 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 906, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6664 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6672 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 906, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6674 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6682 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 906, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6678 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6686 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 906, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6687 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6695 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 906, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6733 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6741 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 906, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6743 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_57); + imports.wbg.__wbindgen_closure_wrapper6751 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 906, __wbg_adapter_57); 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 207591035..2a278c565 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/slide_puzzle/pkg/slide_puzzle_bg.wasm b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle_bg.wasm index 0fbeba942..e77eb5694 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/todo-mvc/pkg/todo_lib_mvc.js b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js index 3bf85ef9c..5ad5fbf37 100644 --- a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js +++ b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js @@ -1684,64 +1684,64 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5251 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2264, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5327 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2312, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5253 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2264, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5329 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2312, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5255 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2264, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5331 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2312, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5257 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2264, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5333 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2312, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5259 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 2264, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper5335 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 2312, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6668 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2742, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6744 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2790, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6670 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2742, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6746 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2790, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6673 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2742, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6749 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2790, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6675 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2742, __wbg_adapter_44); + imports.wbg.__wbindgen_closure_wrapper6751 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2790, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6679 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2742, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6755 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2790, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6681 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2742, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6757 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2790, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6683 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2742, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6759 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2790, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6688 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2742, __wbg_adapter_53); + imports.wbg.__wbindgen_closure_wrapper6764 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2790, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6697 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2742, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper6773 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2790, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7370 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 2787, __wbg_adapter_58); + imports.wbg.__wbindgen_closure_wrapper7446 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 2835, __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 989c1e95b..cb93422c5 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/pkg/todo_lib.js b/snapshots/master/demos/todo/pkg/todo_lib.js index 296aaa6fe..08c599237 100644 --- a/snapshots/master/demos/todo/pkg/todo_lib.js +++ b/snapshots/master/demos/todo/pkg/todo_lib.js @@ -1668,64 +1668,64 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2480 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 980, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper2468 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 989, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2482 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 980, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper2470 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 989, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2484 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 980, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper2472 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 989, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2486 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 980, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper2474 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 989, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper2488 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 980, __wbg_adapter_26); + imports.wbg.__wbindgen_closure_wrapper2476 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 989, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3896 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1458, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper3884 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1467, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3898 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1458, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper3886 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1467, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3901 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1458, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper3889 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1467, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3903 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1458, __wbg_adapter_44); + imports.wbg.__wbindgen_closure_wrapper3891 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1467, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3907 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1458, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper3895 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1467, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3909 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1458, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper3897 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1467, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3911 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1458, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper3899 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1467, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3916 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1458, __wbg_adapter_53); + imports.wbg.__wbindgen_closure_wrapper3904 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1467, __wbg_adapter_53); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3925 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1458, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper3913 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1467, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4598 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1503, __wbg_adapter_58); + imports.wbg.__wbindgen_closure_wrapper4586 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1512, __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 57b606c15..0e9fa3ac4 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/weather-demo/pkg/weather_demo_bg.wasm b/snapshots/master/demos/weather-demo/pkg/weather_demo_bg.wasm index d8c4efe24..527dcd22d 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/docs/cpp/_sources/api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.rst.txt b/snapshots/master/docs/cpp/_sources/api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.rst.txt index 4528802e5..571b6efcb 100644 --- a/snapshots/master/docs/cpp/_sources/api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.rst.txt +++ b/snapshots/master/docs/cpp/_sources/api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.rst.txt @@ -173,4 +173,9 @@ Program Listing for File slint_enums_internal.h Alternate, AlternateReverse, }; + enum class ScrollBarPolicy { + AsNeeded, + AlwaysOff, + AlwaysOn, + }; } diff --git a/snapshots/master/docs/cpp/_sources/api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.rst.txt b/snapshots/master/docs/cpp/_sources/api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.rst.txt index 2856fa089..8ddf7e430 100644 --- a/snapshots/master/docs/cpp/_sources/api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.rst.txt +++ b/snapshots/master/docs/cpp/_sources/api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.rst.txt @@ -213,6 +213,8 @@ Program Listing for File slint_qt_internal.h Property native_padding_bottom; Property enabled; Property has_focus; + Property vertical_bar_policy; + Property horizontal_bar_policy; Property data; SlintTypeErasedWidgetPtr widget_ptr; Property animation_tracker; diff --git a/snapshots/master/docs/cpp/api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.html b/snapshots/master/docs/cpp/api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.html index 41b7ba736..97e24e675 100644 --- a/snapshots/master/docs/cpp/api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.html +++ b/snapshots/master/docs/cpp/api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.html @@ -579,6 +579,11 @@ Alternate, AlternateReverse, }; +enum class ScrollBarPolicy { + AsNeeded, + AlwaysOff, + AlwaysOn, +}; } diff --git a/snapshots/master/docs/cpp/api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.html b/snapshots/master/docs/cpp/api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.html index 0417628a2..55ed28c58 100644 --- a/snapshots/master/docs/cpp/api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.html +++ b/snapshots/master/docs/cpp/api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.html @@ -619,6 +619,8 @@ Property<LogicalLength> native_padding_bottom; Property<bool> enabled; Property<bool> has_focus; + Property<ScrollBarPolicy> vertical_bar_policy; + Property<ScrollBarPolicy> horizontal_bar_policy; Property<NativeSliderData> data; SlintTypeErasedWidgetPtr widget_ptr; Property<int32_t> animation_tracker; diff --git a/snapshots/master/docs/cpp/searchindex.js b/snapshots/master/docs/cpp/searchindex.js index 1d67ab8ba..ee0b92c6c 100644 --- a/snapshots/master/docs/cpp/searchindex.js +++ b/snapshots/master/docs/cpp/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["api/classslint_1_1Brush", "api/classslint_1_1Color", "api/classslint_1_1ComponentHandle", "api/classslint_1_1ComponentWeakHandle", "api/classslint_1_1FilterModel", "api/classslint_1_1MapModel", "api/classslint_1_1Model", "api/classslint_1_1ReverseModel", "api/classslint_1_1SortModel", "api/classslint_1_1VectorModel", "api/classslint_1_1Window", "api/classslint_1_1interpreter_1_1ComponentCompiler", "api/classslint_1_1interpreter_1_1ComponentDefinition", "api/classslint_1_1interpreter_1_1ComponentInstance", "api/classslint_1_1interpreter_1_1Value", "api/classslint_1_1platform_1_1AbstractRenderer", "api/classslint_1_1platform_1_1NativeWindowHandle", "api/classslint_1_1platform_1_1Platform", "api/classslint_1_1platform_1_1Platform_1_1Task", "api/classslint_1_1platform_1_1SkiaRenderer", "api/classslint_1_1platform_1_1SoftwareRenderer", "api/classslint_1_1platform_1_1WindowAdapter", "api/classslint_1_1testing_1_1ElementHandle", "api/define_slint__generated__public_8h_1a059d07f7089fb5d27b24d13e381db0a7", "api/define_slint__generated__public_8h_1a24b3d3a9cd474a66ac86ee4ee9315ce9", "api/define_slint__generated__public_8h_1a45557b46bf1159e97c4ace494d67a53f", "api/define_slint__generated__public_8h_1a498ec177f96b7bce248660a6dd795d8d", "api/define_slint__generated__public_8h_1a5484a031a9ff5f3bbb6de5464f4090a4", "api/define_slint__generated__public_8h_1a56612ce4cec4904836a5caf33bedba79", "api/define_slint__generated__public_8h_1a6b7f049a8c7176edc87c4cffddfc1bbd", "api/define_slint__generated__public_8h_1a7cafd723338e5b25a8d69039ce408cf9", "api/define_slint__generated__public_8h_1a84ab6227b0f7c83d1d55702c8c406ee0", "api/define_slint__generated__public_8h_1a88f96ba89b5ee3c3cdf05743aaa4aa2a", "api/define_slint__generated__public_8h_1a9aa08b9d77373aeed64c2f2507e28552", "api/define_slint__generated__public_8h_1aac4320248b71bd21ac65d833974b5cb5", "api/define_slint__generated__public_8h_1aba0d27c0c821a27a3726baa609646ea9", "api/define_slint__generated__public_8h_1acf6e80daf6c7c50227d002546f0025e3", "api/define_slint__generated__public_8h_1acf78b72a3c7b65dfc2d13f4e698cc01a", "api/define_slint__generated__public_8h_1aeb2b5fc045f08ccf894bd47b2696b853", "api/define_slint__generated__public_8h_1af7931a7cf2a1073d5f0174b38af28364", "api/define_slint__tests__helpers_8h_1af0a649b4b7b90dc4c9e531d459371b95", "api/dir__home_runner_work_slint_slint_api", "api/dir__home_runner_work_slint_slint_api_cpp", "api/dir__home_runner_work_slint_slint_api_cpp_include", "api/dir_cppdocs", "api/dir_cppdocs_generated_include", "api/enum_namespaceslint_1_1interpreter_1a6221319f778c7369e1b76672690926e0", "api/enum_namespaceslint_1_1interpreter_1ad2ba3b4dd1434535294d334a9daf502d", "api/enum_namespaceslint_1_1testing_1a4de74a3a436a7a3fd9a228930f69274d", "api/enum_namespaceslint_1a435dcad112c13fd7fefb2de66e83d1b1", "api/enum_namespaceslint_1a88e5489a21965b1a271bf90ee12f1c6e", "api/enum_namespaceslint_1a8bec56d112d5490780fa52c77326d290", "api/enum_namespaceslint_1a90c0ddbfdc375daafbcf91361293538b", "api/enum_namespaceslint_1aa9bda1bcc95bc66d8afd7b1a4aa8c4af", "api/enum_namespaceslint_1abb2b0aa4769a501e7cdeaccae964a64c", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_color.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_config.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_image.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_point.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_size.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_string.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_window.h", "api/file_cppdocs_generated_include_slint_brush_internal.h", "api/file_cppdocs_generated_include_slint_builtin_structs.h", "api/file_cppdocs_generated_include_slint_builtin_structs_internal.h", "api/file_cppdocs_generated_include_slint_color_internal.h", "api/file_cppdocs_generated_include_slint_enums.h", "api/file_cppdocs_generated_include_slint_enums_internal.h", "api/file_cppdocs_generated_include_slint_generated_public.h", "api/file_cppdocs_generated_include_slint_image_internal.h", "api/file_cppdocs_generated_include_slint_internal.h", "api/file_cppdocs_generated_include_slint_interpreter_generated_public.h", "api/file_cppdocs_generated_include_slint_interpreter_internal.h", "api/file_cppdocs_generated_include_slint_pathdata_internal.h", "api/file_cppdocs_generated_include_slint_platform_internal.h", "api/file_cppdocs_generated_include_slint_properties_internal.h", "api/file_cppdocs_generated_include_slint_qt_internal.h", "api/file_cppdocs_generated_include_slint_sharedvector_internal.h", "api/file_cppdocs_generated_include_slint_string_internal.h", "api/file_cppdocs_generated_include_slint_testing_internal.h", "api/file_cppdocs_generated_include_slint_timer_internal.h", "api/function_namespaceslint_1_1platform_1a4c4cb5b3db64f28314951c81c7f69658", "api/function_namespaceslint_1_1platform_1a71af3a3240e18b74b5e0c3b646db90c3", "api/function_namespaceslint_1_1platform_1a78d943b2302a68af7e187ea4154d4a64", "api/function_namespaceslint_1_1testing_1afcc3fa8289264ede59668796cf0341b4", "api/function_namespaceslint_1a14298dd1f4c7ab8c553e047e3704d6d0", "api/function_namespaceslint_1a4067c90b05ef4cb20e055117b0263430", "api/function_namespaceslint_1a9ade5df8e39fbec7d2af3c0dd3bd4d9c", "api/function_namespaceslint_1ad900fe1e670815101871442dc17aa74b", "api/function_namespaceslint_1aefd8612f7c509003040eddfaf7a38505", "api/library_root", "api/namespace_slint", "api/namespace_slint__interpreter", "api/namespace_slint__platform", "api/namespace_slint__platform__key_codes", "api/namespace_slint__testing", "api/page_deprecated", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_color.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_config.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_image.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_point.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_size.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_string.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_window.h", "api/program_listing_file_cppdocs_generated_include_slint_brush_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs.h", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_color_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_enums.h", "api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_generated_public.h", "api/program_listing_file_cppdocs_generated_include_slint_image_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_generated_public.h", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_pathdata_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_platform_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_properties_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_sharedvector_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_string_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_testing_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_timer_internal.h", "api/structslint_1_1HsvaColor", "api/structslint_1_1Image", "api/structslint_1_1LogicalPosition", "api/structslint_1_1LogicalSize", "api/structslint_1_1PhysicalPosition", "api/structslint_1_1PhysicalSize", "api/structslint_1_1Point", "api/structslint_1_1Rgb8Pixel", "api/structslint_1_1Rgba8Pixel", "api/structslint_1_1RgbaColor", "api/structslint_1_1SharedPixelBuffer", "api/structslint_1_1SharedString", "api/structslint_1_1SharedVector", "api/structslint_1_1Size", "api/structslint_1_1StandardListViewItem", "api/structslint_1_1Timer", "api/structslint_1_1interpreter_1_1Diagnostic", "api/structslint_1_1interpreter_1_1PropertyDescriptor", "api/structslint_1_1interpreter_1_1Struct", "api/structslint_1_1interpreter_1_1Struct_1_1iterator", "api/structslint_1_1platform_1_1Rgb565Pixel", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion_1_1Rect", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties_1_1LayoutConstraints", "api/unabridged_orphan", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a00330cf08e78888ec33cb4aad7695f2c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a037e34a7a75bd9b8fc07b0f5039302df", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a0456177e3225079f495df1a40eb25de6", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a04fed87f00ef9e12e82613c4855af333", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1375031be6c0b8c45d9df956037df69d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a13c2d54873316cd42061a8b65db36361", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a16fb91042adacd1de93bcf8a108cca8b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1907927aae2e873492ea4d266d6e9009", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a20afa8a531fee6e8d2503f3670d29b76", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a293f7e38adb43a8f5434e8e900678652", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a427463ae65210afe9d5a966d00a8b4f6", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a472bf83dfe8bd88399ff9e0a6c36d950", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a4c83e50d2ba5a7d2f9399053f84e064f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a569d5973c36441dd8fb3c88a61c48b7d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a597926fdfddd8a0e466a3f82b7ce2fcd", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5a2a920d1055575213a0959dc16a3661", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5e01d967f144985e037cd53181559909", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a65876fa90448017ac586c13a47ce604b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6b813cb686d89e8e8d3891259b7115d9", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6e73cc7ade6d8452c8c2047ec00964bb", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a72a98f7ac7b1893a25fb20f78dd42675", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a73b54ab296bc68ad7fd177222471679f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a799426f66be94c7aeab5798ece7ff2bf", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7d33f3bd6fbde5f7556df7c2996ab0ed", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7f6e9766b89ac25f49671e6a606109ba", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a851d09118169ae64d44c1ce04cc3d39d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8551fc7e5309b803a5324347445c6d0e", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8bd8df35acb6a08504e955d18b85b4fe", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8c063c4c238f189edd899b96c42f509b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8d46c4e5ef87c72b2c3fd3a0d34c0bef", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a986ca27ff73d68aaa7bacb4d5c509fba", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a9cd8a0d139cafb40c54c9613d8a23bb3", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa329a177650db85052f4a4ce45abf32d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa46f7e2b5c3f817227683cf5c2d8b92a", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa68b696b0425e397cb24edae6528a68c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aae06cbdc02fdffe6a787214d25e0ed19", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab59f14f7e68c980b6db14852df2c5262", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab78ea33dc3464497974100b841eeec4c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aba893f8091b3e8be97636d2144047818", "api/variable_namespaceslint_1_1platform_1_1key__codes_1abf6255bec49fffb7c7228476877932b7", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ac32910f77f4588aa03446574e7e6b48b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1acab5a3836aa794489b91f3cc06a1e4ad", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad2e7bbf67cfcea73f242d193bb541e42", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3a76f93967bed6e0bf1055d2fb5f97b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3ba1170ea89d2feaebadff11cf01871", "api/variable_namespaceslint_1_1platform_1_1key__codes_1add3be02945fa6ebc94a99e2fc2d7ba20", "api/variable_namespaceslint_1_1platform_1_1key__codes_1addf9890750954a90f025235fdd82e9b4", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ade29cc46911c0d95f1a0601870117c8a", "api/variable_namespaceslint_1_1platform_1_1key__codes_1adf1a443c827c42391ffbb0cbbf1da3f8", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ae75e3231824370890cc26cda0fe07a75", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af56ac133d6d5242fb4f547d5546cb42f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af674468525494d802b017d421f0432e7", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af883c4301b011c64a67d98c7369d674e", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aff5729be964f23fc970f5f80217f5bec", "cmake", "cmake_reference", "generated_code", "genindex", "getting_started", "index", "mcu/esp-idf/troubleshoot", "mcu/esp_idf", "mcu/generic", "mcu/intro", "mcu/stm32", "mcu/stm32/generic", "overview", "types"], "filenames": ["api/classslint_1_1Brush.rst", "api/classslint_1_1Color.rst", "api/classslint_1_1ComponentHandle.rst", "api/classslint_1_1ComponentWeakHandle.rst", "api/classslint_1_1FilterModel.rst", "api/classslint_1_1MapModel.rst", "api/classslint_1_1Model.rst", "api/classslint_1_1ReverseModel.rst", "api/classslint_1_1SortModel.rst", "api/classslint_1_1VectorModel.rst", "api/classslint_1_1Window.rst", "api/classslint_1_1interpreter_1_1ComponentCompiler.rst", "api/classslint_1_1interpreter_1_1ComponentDefinition.rst", "api/classslint_1_1interpreter_1_1ComponentInstance.rst", "api/classslint_1_1interpreter_1_1Value.rst", "api/classslint_1_1platform_1_1AbstractRenderer.rst", "api/classslint_1_1platform_1_1NativeWindowHandle.rst", "api/classslint_1_1platform_1_1Platform.rst", "api/classslint_1_1platform_1_1Platform_1_1Task.rst", "api/classslint_1_1platform_1_1SkiaRenderer.rst", "api/classslint_1_1platform_1_1SoftwareRenderer.rst", "api/classslint_1_1platform_1_1WindowAdapter.rst", "api/classslint_1_1testing_1_1ElementHandle.rst", "api/define_slint__generated__public_8h_1a059d07f7089fb5d27b24d13e381db0a7.rst", "api/define_slint__generated__public_8h_1a24b3d3a9cd474a66ac86ee4ee9315ce9.rst", "api/define_slint__generated__public_8h_1a45557b46bf1159e97c4ace494d67a53f.rst", "api/define_slint__generated__public_8h_1a498ec177f96b7bce248660a6dd795d8d.rst", "api/define_slint__generated__public_8h_1a5484a031a9ff5f3bbb6de5464f4090a4.rst", "api/define_slint__generated__public_8h_1a56612ce4cec4904836a5caf33bedba79.rst", "api/define_slint__generated__public_8h_1a6b7f049a8c7176edc87c4cffddfc1bbd.rst", "api/define_slint__generated__public_8h_1a7cafd723338e5b25a8d69039ce408cf9.rst", "api/define_slint__generated__public_8h_1a84ab6227b0f7c83d1d55702c8c406ee0.rst", "api/define_slint__generated__public_8h_1a88f96ba89b5ee3c3cdf05743aaa4aa2a.rst", "api/define_slint__generated__public_8h_1a9aa08b9d77373aeed64c2f2507e28552.rst", "api/define_slint__generated__public_8h_1aac4320248b71bd21ac65d833974b5cb5.rst", "api/define_slint__generated__public_8h_1aba0d27c0c821a27a3726baa609646ea9.rst", "api/define_slint__generated__public_8h_1acf6e80daf6c7c50227d002546f0025e3.rst", "api/define_slint__generated__public_8h_1acf78b72a3c7b65dfc2d13f4e698cc01a.rst", "api/define_slint__generated__public_8h_1aeb2b5fc045f08ccf894bd47b2696b853.rst", "api/define_slint__generated__public_8h_1af7931a7cf2a1073d5f0174b38af28364.rst", "api/define_slint__tests__helpers_8h_1af0a649b4b7b90dc4c9e531d459371b95.rst", "api/dir__home_runner_work_slint_slint_api.rst", "api/dir__home_runner_work_slint_slint_api_cpp.rst", "api/dir__home_runner_work_slint_slint_api_cpp_include.rst", "api/dir_cppdocs.rst", "api/dir_cppdocs_generated_include.rst", "api/enum_namespaceslint_1_1interpreter_1a6221319f778c7369e1b76672690926e0.rst", "api/enum_namespaceslint_1_1interpreter_1ad2ba3b4dd1434535294d334a9daf502d.rst", "api/enum_namespaceslint_1_1testing_1a4de74a3a436a7a3fd9a228930f69274d.rst", "api/enum_namespaceslint_1a435dcad112c13fd7fefb2de66e83d1b1.rst", "api/enum_namespaceslint_1a88e5489a21965b1a271bf90ee12f1c6e.rst", "api/enum_namespaceslint_1a8bec56d112d5490780fa52c77326d290.rst", "api/enum_namespaceslint_1a90c0ddbfdc375daafbcf91361293538b.rst", "api/enum_namespaceslint_1aa9bda1bcc95bc66d8afd7b1a4aa8c4af.rst", "api/enum_namespaceslint_1abb2b0aa4769a501e7cdeaccae964a64c.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_color.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_config.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_image.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_point.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_size.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_string.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_window.h.rst", "api/file_cppdocs_generated_include_slint_brush_internal.h.rst", "api/file_cppdocs_generated_include_slint_builtin_structs.h.rst", "api/file_cppdocs_generated_include_slint_builtin_structs_internal.h.rst", "api/file_cppdocs_generated_include_slint_color_internal.h.rst", "api/file_cppdocs_generated_include_slint_enums.h.rst", "api/file_cppdocs_generated_include_slint_enums_internal.h.rst", "api/file_cppdocs_generated_include_slint_generated_public.h.rst", "api/file_cppdocs_generated_include_slint_image_internal.h.rst", "api/file_cppdocs_generated_include_slint_internal.h.rst", "api/file_cppdocs_generated_include_slint_interpreter_generated_public.h.rst", "api/file_cppdocs_generated_include_slint_interpreter_internal.h.rst", "api/file_cppdocs_generated_include_slint_pathdata_internal.h.rst", "api/file_cppdocs_generated_include_slint_platform_internal.h.rst", "api/file_cppdocs_generated_include_slint_properties_internal.h.rst", "api/file_cppdocs_generated_include_slint_qt_internal.h.rst", "api/file_cppdocs_generated_include_slint_sharedvector_internal.h.rst", "api/file_cppdocs_generated_include_slint_string_internal.h.rst", "api/file_cppdocs_generated_include_slint_testing_internal.h.rst", "api/file_cppdocs_generated_include_slint_timer_internal.h.rst", "api/function_namespaceslint_1_1platform_1a4c4cb5b3db64f28314951c81c7f69658.rst", "api/function_namespaceslint_1_1platform_1a71af3a3240e18b74b5e0c3b646db90c3.rst", "api/function_namespaceslint_1_1platform_1a78d943b2302a68af7e187ea4154d4a64.rst", "api/function_namespaceslint_1_1testing_1afcc3fa8289264ede59668796cf0341b4.rst", "api/function_namespaceslint_1a14298dd1f4c7ab8c553e047e3704d6d0.rst", "api/function_namespaceslint_1a4067c90b05ef4cb20e055117b0263430.rst", "api/function_namespaceslint_1a9ade5df8e39fbec7d2af3c0dd3bd4d9c.rst", "api/function_namespaceslint_1ad900fe1e670815101871442dc17aa74b.rst", "api/function_namespaceslint_1aefd8612f7c509003040eddfaf7a38505.rst", "api/library_root.rst", "api/namespace_slint.rst", "api/namespace_slint__interpreter.rst", "api/namespace_slint__platform.rst", "api/namespace_slint__platform__key_codes.rst", "api/namespace_slint__testing.rst", "api/page_deprecated.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_color.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_config.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_image.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_point.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_size.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_string.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_window.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_brush_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_color_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_enums.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_generated_public.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_image_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_generated_public.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_pathdata_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_platform_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_properties_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_sharedvector_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_string_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_testing_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_timer_internal.h.rst", "api/structslint_1_1HsvaColor.rst", "api/structslint_1_1Image.rst", "api/structslint_1_1LogicalPosition.rst", "api/structslint_1_1LogicalSize.rst", "api/structslint_1_1PhysicalPosition.rst", "api/structslint_1_1PhysicalSize.rst", "api/structslint_1_1Point.rst", "api/structslint_1_1Rgb8Pixel.rst", "api/structslint_1_1Rgba8Pixel.rst", "api/structslint_1_1RgbaColor.rst", "api/structslint_1_1SharedPixelBuffer.rst", "api/structslint_1_1SharedString.rst", "api/structslint_1_1SharedVector.rst", "api/structslint_1_1Size.rst", "api/structslint_1_1StandardListViewItem.rst", "api/structslint_1_1Timer.rst", "api/structslint_1_1interpreter_1_1Diagnostic.rst", "api/structslint_1_1interpreter_1_1PropertyDescriptor.rst", "api/structslint_1_1interpreter_1_1Struct.rst", "api/structslint_1_1interpreter_1_1Struct_1_1iterator.rst", "api/structslint_1_1platform_1_1Rgb565Pixel.rst", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion.rst", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion_1_1Rect.rst", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties.rst", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties_1_1LayoutConstraints.rst", "api/unabridged_orphan.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a00330cf08e78888ec33cb4aad7695f2c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a037e34a7a75bd9b8fc07b0f5039302df.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a0456177e3225079f495df1a40eb25de6.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a04fed87f00ef9e12e82613c4855af333.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1375031be6c0b8c45d9df956037df69d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a13c2d54873316cd42061a8b65db36361.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a16fb91042adacd1de93bcf8a108cca8b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1907927aae2e873492ea4d266d6e9009.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a20afa8a531fee6e8d2503f3670d29b76.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a293f7e38adb43a8f5434e8e900678652.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a427463ae65210afe9d5a966d00a8b4f6.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a472bf83dfe8bd88399ff9e0a6c36d950.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a4c83e50d2ba5a7d2f9399053f84e064f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a569d5973c36441dd8fb3c88a61c48b7d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a597926fdfddd8a0e466a3f82b7ce2fcd.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5a2a920d1055575213a0959dc16a3661.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5e01d967f144985e037cd53181559909.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a65876fa90448017ac586c13a47ce604b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6b813cb686d89e8e8d3891259b7115d9.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6e73cc7ade6d8452c8c2047ec00964bb.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a72a98f7ac7b1893a25fb20f78dd42675.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a73b54ab296bc68ad7fd177222471679f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a799426f66be94c7aeab5798ece7ff2bf.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7d33f3bd6fbde5f7556df7c2996ab0ed.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7f6e9766b89ac25f49671e6a606109ba.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a851d09118169ae64d44c1ce04cc3d39d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8551fc7e5309b803a5324347445c6d0e.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8bd8df35acb6a08504e955d18b85b4fe.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8c063c4c238f189edd899b96c42f509b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8d46c4e5ef87c72b2c3fd3a0d34c0bef.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a986ca27ff73d68aaa7bacb4d5c509fba.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a9cd8a0d139cafb40c54c9613d8a23bb3.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa329a177650db85052f4a4ce45abf32d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa46f7e2b5c3f817227683cf5c2d8b92a.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa68b696b0425e397cb24edae6528a68c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aae06cbdc02fdffe6a787214d25e0ed19.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab59f14f7e68c980b6db14852df2c5262.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab78ea33dc3464497974100b841eeec4c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aba893f8091b3e8be97636d2144047818.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1abf6255bec49fffb7c7228476877932b7.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ac32910f77f4588aa03446574e7e6b48b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1acab5a3836aa794489b91f3cc06a1e4ad.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad2e7bbf67cfcea73f242d193bb541e42.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3a76f93967bed6e0bf1055d2fb5f97b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3ba1170ea89d2feaebadff11cf01871.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1add3be02945fa6ebc94a99e2fc2d7ba20.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1addf9890750954a90f025235fdd82e9b4.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ade29cc46911c0d95f1a0601870117c8a.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1adf1a443c827c42391ffbb0cbbf1da3f8.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ae75e3231824370890cc26cda0fe07a75.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af56ac133d6d5242fb4f547d5546cb42f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af674468525494d802b017d421f0432e7.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af883c4301b011c64a67d98c7369d674e.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aff5729be964f23fc970f5f80217f5bec.rst", "cmake.md", "cmake_reference.md", "generated_code.md", "genindex.rst", "getting_started.md", "index.rst", "mcu/esp-idf/troubleshoot.md", "mcu/esp_idf.md", "mcu/generic.md", "mcu/intro.md", "mcu/stm32.md", "mcu/stm32/generic.md", "overview.md", "types.md"], "titles": ["Class Brush", "Class Color", "Template Class ComponentHandle", "Template Class ComponentWeakHandle", "Template Class FilterModel", "Template Class MapModel", "Template Class Model", "Template Class ReverseModel", "Template Class SortModel", "Template Class VectorModel", "Class Window", "Class ComponentCompiler", "Class ComponentDefinition", "Class ComponentInstance", "Class Value", "Class AbstractRenderer", "Class NativeWindowHandle", "Class Platform", "Class Platform::Task", "Class SkiaRenderer", "Class SoftwareRenderer", "Class WindowAdapter", "Class ElementHandle", "Define SLINT_FEATURE_BACKEND_QT", "Define SLINT_FEATURE_GETTEXT", "Define SLINT_FEATURE_INTERPRETER", "Define SLINT_VERSION_PATCH", "Define SLINT_FEATURE_BACKEND_LINUXKMS", "Define SLINT_FEATURE_EXPERIMENTAL", "Define SLINT_VERSION_STRING", "Define SLINT_FEATURE_RENDERER_FEMTOVG", "Define SLINT_FEATURE_RENDERER_SKIA", "Define SLINT_FEATURE_SYSTEM_TESTING", "Define SLINT_FEATURE_ACCESSIBILITY", "Define SLINT_FEATURE_RENDERER_SOFTWARE", "Define SLINT_VERSION_MINOR", "Define SLINT_FEATURE_FREESTANDING", "Define SLINT_FEATURE_TESTING", "Define SLINT_VERSION_MAJOR", "Define SLINT_FEATURE_BACKEND_WINIT", "Define assert_eq", "Directory api", "Directory cpp", "Directory include", "Directory cppdocs", "Directory generated_include", "Enum ValueType", "Enum DiagnosticLevel", "Enum AccessibleRole", "Enum SetRenderingNotifierError", "Enum PointerEventButton", "Enum EventLoopMode", "Enum GraphicsAPI", "Enum RenderingState", "Enum CloseRequestResponse", "File slint-interpreter.h", "File slint-platform.h", "File slint-testing.h", "File slint.h", "File slint_brush.h", "File slint_callbacks.h", "File slint_color.h", "File slint_config.h", "File slint_image.h", "File slint_interpreter.h", "File slint_pathdata.h", "File slint_point.h", "File slint_properties.h", "File slint_sharedvector.h", "File slint_size.h", "File slint_string.h", "File slint_tests_helpers.h", "File slint_timer.h", "File slint_window.h", "File slint_brush_internal.h", "File slint_builtin_structs.h", "File slint_builtin_structs_internal.h", "File slint_color_internal.h", "File slint_enums.h", "File slint_enums_internal.h", "File slint_generated_public.h", "File slint_image_internal.h", "File slint_internal.h", "File slint_interpreter_generated_public.h", "File slint_interpreter_internal.h", "File slint_pathdata_internal.h", "File slint_platform_internal.h", "File slint_properties_internal.h", "File slint_qt_internal.h", "File slint_sharedvector_internal.h", "File slint_string_internal.h", "File slint_testing_internal.h", "File slint_timer_internal.h", "Function slint::platform::duration_until_next_timer_update", "Function slint::platform::update_timers_and_animations", "Function slint::platform::set_platform", "Function slint::testing::init", "Function slint::quit_event_loop", "Template Function slint::invoke_from_event_loop", "Template Function slint::blocking_invoke_from_event_loop", "Function slint::run_event_loop", "Function slint::update_all_translations", "C++ API Reference", "Namespace slint", "Namespace slint::interpreter", "Namespace slint::platform", "Namespace slint::platform::key_codes", "Namespace slint::testing", "Deprecated List", "Program Listing for File slint-interpreter.h", "Program Listing for File slint-platform.h", "Program Listing for File slint-testing.h", "Program Listing for File slint.h", "Program Listing for File slint_brush.h", "Program Listing for File slint_callbacks.h", "Program Listing for File slint_color.h", "Program Listing for File slint_config.h", "Program Listing for File slint_image.h", "Program Listing for File slint_interpreter.h", "Program Listing for File slint_pathdata.h", "Program Listing for File slint_point.h", "Program Listing for File slint_properties.h", "Program Listing for File slint_sharedvector.h", "Program Listing for File slint_size.h", "Program Listing for File slint_string.h", "Program Listing for File slint_tests_helpers.h", "Program Listing for File slint_timer.h", "Program Listing for File slint_window.h", "Program Listing for File slint_brush_internal.h", "Program Listing for File slint_builtin_structs.h", "Program Listing for File slint_builtin_structs_internal.h", "Program Listing for File slint_color_internal.h", "Program Listing for File slint_enums.h", "Program Listing for File slint_enums_internal.h", "Program Listing for File slint_generated_public.h", "Program Listing for File slint_image_internal.h", "Program Listing for File slint_internal.h", "Program Listing for File slint_interpreter_generated_public.h", "Program Listing for File slint_interpreter_internal.h", "Program Listing for File slint_pathdata_internal.h", "Program Listing for File slint_platform_internal.h", "Program Listing for File slint_properties_internal.h", "Program Listing for File slint_qt_internal.h", "Program Listing for File slint_sharedvector_internal.h", "Program Listing for File slint_string_internal.h", "Program Listing for File slint_testing_internal.h", "Program Listing for File slint_timer_internal.h", "Struct HsvaColor", "Struct Image", "Struct LogicalPosition", "Struct LogicalSize", "Struct PhysicalPosition", "Struct PhysicalSize", "Template Struct Point", "Struct Rgb8Pixel", "Struct Rgba8Pixel", "Template Struct RgbaColor", "Template Struct SharedPixelBuffer", "Struct SharedString", "Template Struct SharedVector", "Template Struct Size", "Struct StandardListViewItem", "Struct Timer", "Struct Diagnostic", "Struct PropertyDescriptor", "Struct Struct", "Struct Struct::iterator", "Struct Rgb565Pixel", "Struct SoftwareRenderer::PhysicalRegion", "Struct PhysicalRegion::Rect", "Struct WindowAdapter::WindowProperties", "Struct WindowProperties::LayoutConstraints", "Full API", "Variable slint::platform::key_codes::F24", "Variable slint::platform::key_codes::F1", "Variable slint::platform::key_codes::CapsLock", "Variable slint::platform::key_codes::Space", "Variable slint::platform::key_codes::Menu", "Variable slint::platform::key_codes::LeftArrow", "Variable slint::platform::key_codes::MetaR", "Variable slint::platform::key_codes::Pause", "Variable slint::platform::key_codes::F4", "Variable slint::platform::key_codes::F12", "Variable slint::platform::key_codes::Insert", "Variable slint::platform::key_codes::DownArrow", "Variable slint::platform::key_codes::AltGr", "Variable slint::platform::key_codes::Alt", "Variable slint::platform::key_codes::F23", "Variable slint::platform::key_codes::Stop", "Variable slint::platform::key_codes::F19", "Variable slint::platform::key_codes::ScrollLock", "Variable slint::platform::key_codes::F13", "Variable slint::platform::key_codes::F15", "Variable slint::platform::key_codes::F14", "Variable slint::platform::key_codes::Backspace", "Variable slint::platform::key_codes::F5", "Variable slint::platform::key_codes::F6", "Variable slint::platform::key_codes::Meta", "Variable slint::platform::key_codes::F9", "Variable slint::platform::key_codes::F20", "Variable slint::platform::key_codes::UpArrow", "Variable slint::platform::key_codes::F10", "Variable slint::platform::key_codes::F2", "Variable slint::platform::key_codes::F8", "Variable slint::platform::key_codes::F18", "Variable slint::platform::key_codes::PageDown", "Variable slint::platform::key_codes::F11", "Variable slint::platform::key_codes::F3", "Variable slint::platform::key_codes::Control", "Variable slint::platform::key_codes::F16", "Variable slint::platform::key_codes::ControlR", "Variable slint::platform::key_codes::Return", "Variable slint::platform::key_codes::F7", "Variable slint::platform::key_codes::Backtab", "Variable slint::platform::key_codes::Home", "Variable slint::platform::key_codes::RightArrow", "Variable slint::platform::key_codes::Escape", "Variable slint::platform::key_codes::SysReq", "Variable slint::platform::key_codes::F21", "Variable slint::platform::key_codes::F17", "Variable slint::platform::key_codes::PageUp", "Variable slint::platform::key_codes::Tab", "Variable slint::platform::key_codes::End", "Variable slint::platform::key_codes::ShiftR", "Variable slint::platform::key_codes::Delete", "Variable slint::platform::key_codes::Shift", "Variable slint::platform::key_codes::F22", "Set Up Development Environment", "CMake Reference", "Generated Code", "Index (C++)", "Getting Started", "Slint C++ documentation", "Troubleshooting", "Espressif\u2019s IoT Development Framework", "Generic MCU Environment Setup", "Introduction", "STMicroelectronics\u2019 STM32Cube Ecosystem", "Generic Instructions for Slint on STM32 MCUs", "Overview", "Type Mappings"], "terms": {"defin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 109, 110, 112, 115, 116, 117, 122, 125, 127, 134, 135, 136, 138, 139, 142, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 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, 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, 229, 233, 234, 240], "file": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 104, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 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, 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, 231, 232, 233, 234, 235, 238, 239, 240], "slint_brush": [0, 43, 61, 70, 74, 82, 102, 136, 172], "h": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 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, 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, 231, 234, 238], "i": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 46, 48, 49, 50, 51, 52, 53, 54, 97, 98, 99, 100, 101, 103, 104, 105, 107, 109, 110, 112, 113, 118, 120, 122, 123, 129, 130, 132, 133, 142, 144, 148, 153, 156, 157, 158, 159, 160, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 227, 228, 229, 231, 232, 233, 235, 236, 237, 239, 240], "us": [0, 1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 17, 20, 21, 22, 26, 29, 35, 38, 46, 48, 50, 51, 52, 53, 98, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 117, 119, 120, 121, 123, 125, 126, 127, 128, 130, 133, 135, 136, 138, 140, 141, 142, 148, 153, 157, 158, 159, 160, 162, 164, 165, 166, 168, 170, 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, 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, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240], "declar": [0, 13, 14, 109, 142, 164, 229, 231, 239, 240], "how": [0, 20, 103, 157, 227, 231, 232, 233, 234, 236, 238, 239], "fill": [0, 20, 133, 136], "outlin": [0, 238], "shape": [0, 148], "rectangl": [0, 20, 110, 136, 168, 169], "path": [0, 11, 41, 42, 43, 44, 45, 109, 117, 127, 135, 136, 138, 140, 148, 163, 227, 228, 235, 238], "text": [0, 10, 17, 22, 48, 110, 127, 129, 130, 132, 133, 136, 142, 161, 231, 232, 233, 234, 238], "A": [0, 3, 6, 9, 13, 14, 17, 18, 20, 22, 40, 46, 50, 105, 112, 114, 125, 127, 148, 149, 150, 151, 152, 158, 162, 165, 166, 167, 168, 169, 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, 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, 231, 235, 237, 240], "either": [0, 13, 14, 21, 22, 163, 165, 166, 227, 233, 237, 239], "solid": 0, "color": [0, 46, 61, 102, 103, 113, 115, 121, 128, 131, 135, 136, 141, 142, 147, 156, 167, 231, 232, 239, 240], "linear": [0, 136], "gradient": [0, 113], "public": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 46, 109, 110, 111, 112, 113, 115, 117, 119, 120, 123, 127, 128, 135, 139, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 229, 233, 240], "function": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 51, 104, 106, 109, 112, 125, 127, 138, 148, 149, 150, 151, 152, 153, 156, 157, 158, 159, 160, 162, 165, 166, 167, 168, 169, 170, 172, 228, 229, 231, 238, 239], "inlin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 93, 94, 95, 96, 97, 100, 101, 109, 110, 111, 112, 113, 115, 117, 121, 124, 125, 127, 136, 142, 148, 149, 150, 151, 152, 156, 157, 158, 159, 162, 165, 166, 167, 168, 170, 229], "construct": [0, 1, 3, 4, 5, 7, 8, 9, 11, 12, 14, 19, 20, 21, 22, 109, 148, 149, 151, 156, 157, 158, 159, 162, 165, 166, 167], "new": [0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 16, 17, 19, 20, 21, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 109, 111, 112, 114, 121, 122, 126, 127, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 156, 157, 158, 159, 165, 166, 229, 231, 234, 238, 239], "transpar": [0, 1], "const": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 108, 109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 134, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 148, 149, 150, 151, 152, 153, 156, 157, 158, 159, 160, 162, 165, 166, 167, 168, 170, 229, 234, 240], "return": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21, 22, 54, 78, 93, 97, 99, 102, 106, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 153, 157, 158, 159, 160, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 229, 231, 238], "If": [0, 4, 6, 7, 8, 9, 10, 17, 21, 22, 102, 148, 156, 158, 162, 165, 166, 170, 171, 227, 228, 229, 233, 234, 235, 237], "thi": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 46, 48, 49, 50, 52, 53, 54, 94, 97, 98, 99, 100, 101, 103, 104, 105, 106, 107, 109, 110, 112, 113, 115, 121, 122, 124, 125, 127, 128, 129, 130, 132, 133, 135, 139, 142, 148, 156, 157, 158, 159, 162, 165, 166, 168, 169, 170, 171, 227, 228, 229, 231, 232, 233, 234, 235, 236, 238, 239, 240], "first": [0, 7, 13, 20, 113, 122, 157, 158, 159, 227, 231, 233, 239], "stop": [0, 22, 78, 102, 106, 113, 126, 132, 162], "brighter": [0, 1, 113, 115], "float": [0, 1, 10, 22, 46, 109, 111, 112, 113, 115, 120, 121, 123, 125, 127, 128, 130, 131, 135, 136, 139, 140, 141, 142, 147, 149, 150, 156, 240], "factor": [0, 1, 10, 21, 113, 115, 127, 131, 240], "version": [0, 1, 26, 29, 35, 38, 98, 99, 227, 231, 235, 238], "ha": [0, 1, 4, 5, 6, 8, 10, 13, 14, 21, 53, 109, 148, 158, 159, 162, 167, 231, 234, 239], "bright": [0, 1, 234], "increas": [0, 1, 22, 110], "specifi": [0, 1, 5, 8, 9, 10, 11, 12, 13, 17, 19, 21, 98, 99, 158, 162, 165, 227, 228], "done": [0, 1, 52, 227, 235], "call": [0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 17, 18, 19, 20, 21, 22, 51, 94, 95, 96, 97, 98, 99, 105, 109, 110, 112, 114, 127, 148, 162, 165, 166, 228, 229, 231, 233, 238], "all": [0, 5, 7, 8, 9, 12, 14, 20, 22, 51, 100, 101, 102, 103, 112, 157, 159, 165, 168, 227, 228, 229, 233, 234, 235, 238, 239, 240], "darker": [0, 1, 113, 115], "decreas": [0, 1, 22, 228], "transparent": [0, 1, 113, 115], "opac": [0, 1, 136], "with_alpha": [0, 1, 113, 115], "alpha": [0, 1, 113, 115, 131, 147, 148, 155, 156, 240], "relat": 0, "": [0, 1, 4, 5, 8, 9, 10, 13, 19, 20, 22, 48, 105, 107, 109, 113, 115, 123, 124, 127, 131, 148, 150, 152, 158, 159, 164, 165, 166, 227, 228, 229, 231, 232, 233, 235, 236, 238, 239], "set": [0, 1, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 20, 21, 22, 49, 98, 100, 105, 112, 121, 148, 165, 170, 171, 228, 229, 231, 233, 234, 235, 238, 239], "friend": [0, 1, 4, 5, 7, 8, 14, 109, 110, 112, 113, 115, 117, 119, 121, 122, 124, 127, 129, 130, 134, 136, 148, 158, 159, 165, 166, 167], "struct": [0, 1, 4, 5, 7, 8, 14, 20, 21, 46, 55, 56, 61, 63, 66, 68, 69, 70, 72, 75, 80, 83, 103, 104, 105, 106, 109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 126, 128, 129, 130, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 240], "private_api": [0, 1, 2, 4, 5, 7, 8, 109, 110, 111, 112, 113, 114, 115, 117, 119, 121, 124, 125, 127, 136, 142], "properti": [0, 10, 12, 13, 14, 21, 22, 48, 98, 99, 109, 112, 113, 115, 121, 136, 138, 142, 148, 164, 170, 227, 228, 229, 231, 232, 237, 238, 239, 240], "bool": [0, 1, 4, 8, 10, 13, 14, 21, 22, 46, 109, 110, 111, 112, 113, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 145, 146, 148, 153, 157, 158, 159, 160, 162, 165, 166, 167, 170, 229, 240], "oper": [0, 1, 2, 6, 10, 12, 14, 16, 17, 18, 19, 20, 109, 110, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 126, 127, 128, 129, 130, 131, 134, 135, 136, 139, 141, 142, 144, 148, 153, 157, 158, 159, 160, 162, 165, 166, 167, 227], "b": [0, 14, 40, 109, 110, 112, 113, 117, 119, 122, 124, 125, 134, 136, 138, 148, 154, 155, 158, 159, 165, 166, 167], "true": [0, 1, 4, 10, 13, 14, 21, 22, 101, 109, 110, 111, 112, 121, 125, 127, 128, 135, 139, 148, 153, 158, 159, 160, 162, 165, 166, 167, 170, 234], "equal": [0, 14, 112, 122, 153, 157, 158, 159, 160, 165, 228], "hold": [0, 13, 14, 21, 159, 165, 166, 239], "must": [0, 10, 13, 17, 20, 21, 22, 95, 99, 107, 127, 148, 157, 229, 235], "also": [0, 4, 5, 6, 7, 8, 9, 10, 14, 46, 98, 99, 158, 159, 228, 229, 231, 232], "ident": [0, 167], "fals": [0, 1, 10, 13, 21, 22, 109, 110, 111, 112, 122, 127, 128, 135, 139, 148, 153, 158, 159, 160, 162, 165, 166, 170, 233], "differ": [0, 10, 13, 14, 17, 20, 46, 48, 49, 50, 53, 99, 105, 148, 227, 232, 233, 235, 237, 239], "what": [0, 17, 111, 136, 235], "thei": [0, 153, 156, 157, 160], "respect": [0, 235], "ar": [0, 10, 11, 13, 14, 16, 20, 21, 49, 51, 93, 95, 100, 101, 102, 103, 106, 109, 112, 120, 123, 148, 153, 156, 157, 159, 160, 163, 165, 167, 227, 228, 229, 231, 233, 234, 236, 239, 240], "otherwis": [0, 1, 3, 13, 14, 21, 22, 99, 110, 148, 153, 158, 159, 160, 162, 165, 166, 170], "listview": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 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, 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, 229, 230, 232, 239], "slint_color": [1, 43, 59, 67, 77, 82, 102, 113, 136, 147, 156, 172], "repres": [1, 10, 13, 14, 20, 21, 46, 48, 153, 154, 155, 160, 161, 165, 168, 170, 171, 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, 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, 240], "slint": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 46, 47, 48, 49, 50, 51, 52, 53, 54, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 108, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 149, 150, 151, 152, 157, 158, 159, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 228, 229, 231, 234, 236, 237, 240], "run": [1, 13, 17, 18, 21, 51, 98, 99, 102, 109, 110, 126, 158, 159, 162, 227, 228, 229, 231, 233, 234, 235, 237, 238, 240], "time": [1, 21, 102, 158, 159, 162, 227, 228, 231, 233, 238, 240], "8": [1, 115, 138, 142, 158, 167, 240], "bit": [1, 167, 240], "channel": [1, 148, 233], "red": [1, 110, 115, 131, 148, 154, 155, 156, 167], "green": [1, 110, 115, 131, 148, 154, 155, 156, 167], "blue": [1, 110, 115, 131, 148, 154, 155, 156, 167, 231, 232], "default": [1, 3, 4, 6, 7, 8, 9, 10, 17, 21, 22, 46, 54, 100, 109, 110, 111, 112, 113, 115, 116, 117, 119, 120, 123, 126, 127, 129, 130, 133, 134, 135, 136, 139, 144, 148, 149, 151, 153, 157, 158, 159, 160, 162, 165, 166, 167, 170, 171, 227, 228, 233, 234, 235, 240], "entir": [1, 240], "rgbacolor": [1, 61, 102, 103, 115], "uint8_t": [1, 47, 49, 52, 53, 54, 109, 110, 111, 112, 115, 117, 122, 124, 127, 130, 131, 134, 135, 136, 137, 138, 140, 142, 143, 145, 146, 154, 155, 156, 167], "col": [1, 115, 131, 156], "from": [1, 3, 9, 11, 12, 13, 14, 16, 17, 18, 21, 97, 98, 99, 100, 105, 110, 112, 120, 122, 123, 127, 129, 130, 132, 133, 136, 141, 148, 156, 157, 158, 164, 165, 166, 167, 228, 229, 231, 232, 234, 237, 238, 239], "given": [1, 4, 5, 7, 8, 9, 13, 16, 17, 19, 22, 110, 150, 152, 156, 157, 158, 159, 162, 165, 228], "uint32_t": [1, 16, 20, 110, 112, 115, 117, 123, 127, 135, 136, 140, 142, 148, 152, 157], "as_argb_encod": [1, 115], "encod": [1, 20, 158, 167, 240], "to_argb_uint": [1, 115], "convert": [1, 5, 10, 22, 106, 149, 150, 151, 152, 158, 165, 167, 228, 233, 240], "an": [1, 3, 4, 5, 7, 8, 10, 12, 13, 14, 16, 17, 18, 20, 22, 46, 47, 48, 95, 98, 105, 112, 136, 148, 154, 155, 157, 158, 161, 163, 165, 167, 168, 169, 227, 228, 229, 231, 232, 233, 234, 235, 236, 238, 239, 240], "easi": [1, 239], "destructur": [1, 165, 166], "to_argb_float": [1, 115], "hsvacolor": [1, 61, 102, 103, 115], "to_hsva": [1, 115], "hsv": [1, 115, 147], "space": [1, 78, 102, 106, 112, 132, 136, 147], "u8": [1, 132, 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, 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], "rang": [1, 56, 110, 156, 157, 159, 165], "0": [1, 6, 13, 14, 17, 21, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 150, 152, 154, 155, 156, 162, 167, 227, 228, 229, 231, 238], "255": [1, 115, 142, 154, 155, 156, 167], "multipli": [1, 148, 240], "valu": [1, 4, 5, 7, 8, 9, 10, 13, 17, 20, 21, 22, 26, 35, 38, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 99, 102, 104, 109, 111, 112, 113, 115, 121, 122, 127, 136, 138, 140, 141, 142, 147, 148, 154, 155, 156, 159, 165, 166, 167, 170, 171, 228, 229, 233, 234, 239, 240], "1": [1, 13, 26, 29, 35, 38, 109, 110, 112, 113, 115, 122, 134, 135, 136, 137, 138, 142, 147, 148, 156, 163, 227, 228, 231, 235], "The": [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 20, 21, 22, 46, 47, 48, 49, 50, 51, 52, 53, 54, 98, 99, 100, 101, 102, 103, 104, 105, 106, 113, 120, 123, 147, 148, 153, 156, 157, 158, 159, 160, 161, 163, 164, 165, 166, 167, 168, 169, 227, 228, 229, 231, 234, 238, 239, 240], "result": [1, 22, 99, 109, 111, 112, 113, 114, 115, 117, 121, 128, 135, 136, 139, 158, 167, 228], "back": [1, 9, 50, 53, 97, 132, 227, 229, 234], "rgb": [1, 20, 135, 148, 154], "unchang": 1, "so": [1, 7, 10, 20, 112, 136, 165, 166, 167, 168, 227, 228, 231], "exampl": [1, 5, 10, 13, 26, 29, 35, 38, 50, 53, 98, 99, 101, 105, 106, 109, 112, 148, 156, 157, 158, 227, 228, 234, 235, 237, 238, 239, 240], "2": [1, 13, 26, 29, 35, 38, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 136, 142, 148, 227, 228, 231, 232], "20": [1, 142, 227, 235, 236], "5": [1, 26, 29, 35, 38, 110, 135, 138, 142, 158, 167], "50": [1, 142], "divid": [1, 236], "3": [1, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 136, 142, 148, 227, 231, 235, 237], "30": [1, 142], "obtain": [1, 148], "mix": [1, 115], "other": [1, 3, 10, 12, 14, 16, 17, 18, 46, 50, 53, 96, 98, 105, 109, 110, 112, 115, 117, 120, 122, 123, 124, 125, 127, 128, 131, 132, 135, 136, 137, 138, 139, 141, 153, 157, 158, 159, 160, 165, 166, 227, 236], "clamp": 1, "between": [1, 10, 20, 21, 147, 148, 154, 155, 156, 167, 233, 234, 235, 237], "appli": [1, 4, 5, 8, 20, 48, 114, 133, 239], "while": [1, 10, 11, 99, 227], "static": [1, 16, 22, 109, 110, 111, 112, 113, 115, 117, 119, 121, 122, 124, 126, 127, 128, 135, 136, 139, 142, 148, 158, 162, 234, 235], "from_argb_encod": [1, 113, 115], "argb_encod": [1, 115], "integ": [1, 158, 240], "0xaarrggbb": 1, "from_argb_uint8": [1, 115], "paramet": [1, 5, 10, 13, 20, 51, 53, 100, 156, 229, 231, 239], "from_rgb_uint8": [1, 115], "have": [1, 10, 19, 20, 21, 22, 110, 112, 136, 148, 157, 165, 170, 171, 227, 229, 232, 233, 234, 235, 239], "from_argb_float": [1, 115], "from_rgb_float": [1, 115], "from_hsva": [1, 115], "v": [1, 14, 17, 21, 109, 112, 115, 121, 125, 131, 234, 237, 238], "compon": [1, 2, 3, 10, 11, 12, 13, 22, 109, 111, 115, 125, 127, 136, 147, 156, 167, 228, 229, 231, 232, 234, 238, 239], "hue": [1, 115, 147], "expect": [1, 233], "360": [1, 147], "lineargradientbrush": [1, 113, 115, 128], "lh": [1, 110, 115, 167], "rh": [1, 110, 115, 167], "same": [1, 14, 20, 110, 148, 159, 165, 166, 229, 240], "individu": 1, "std": [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21, 22, 93, 95, 98, 99, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 125, 126, 127, 130, 132, 142, 148, 158, 159, 162, 165, 166, 170, 171, 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, 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, 229, 234, 238, 239, 240], "ostream": [1, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 115, 124, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 158], "stream": [1, 115, 124, 158], "write": [1, 158, 231, 235], "refer": [1, 3, 10, 13, 21, 110, 148, 157, 158, 159, 165, 166, 227, 229, 234, 235, 237, 238, 240], "typenam": [2, 3, 4, 5, 6, 7, 8, 9, 20, 22, 109, 110, 111, 112, 114, 115, 117, 120, 121, 122, 123, 125, 127, 135, 136, 138, 143, 144, 153, 156, 157, 159, 160, 165, 229], "t": [2, 3, 13, 17, 22, 48, 109, 111, 112, 115, 120, 121, 122, 123, 125, 136, 138, 143, 144, 153, 156, 159, 160, 229, 233, 235, 239], "handl": [2, 3, 12, 16, 17, 20, 21, 22, 112, 121, 127, 136, 140, 141, 231, 235, 239], "like": [2, 13, 20, 48, 99, 168, 227, 229, 231, 234, 235], "share": [2, 10, 12, 148, 157, 158, 159, 235], "pointer": [2, 10, 16, 50, 110, 133, 148, 157, 158, 159, 229, 239], "gener": [2, 122, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 228, 231, 236, 237, 239, 240], "code": [2, 10, 11, 14, 98, 104, 109, 112, 148, 164, 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, 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, 228, 231, 232, 237, 238, 239, 240], "In": [2, 13, 15, 21, 112, 227, 232, 238], "order": [2, 8, 13, 100, 112, 136, 162, 165, 166, 233, 240], "get": [2, 109, 112, 121, 167, 227, 235, 237, 238, 239], "creat": [2, 10, 12, 13, 14, 16, 17, 19, 53, 95, 98, 99, 104, 109, 112, 115, 127, 148, 156, 158, 159, 165, 166, 228, 229, 231, 232, 233, 234, 238, 239], "where": [2, 15, 163, 235, 239], "name": [2, 12, 13, 22, 109, 138, 164, 165, 166, 227, 228, 229, 231, 238, 240], "give": 2, "you": [2, 10, 12, 13, 14, 19, 21, 26, 29, 35, 38, 98, 102, 104, 105, 107, 148, 157, 165, 166, 227, 228, 229, 231, 232, 233, 234, 235, 238, 239], "vtabl": [2, 13, 82, 109, 111, 112, 127, 135, 136, 138, 141, 142], "vrc": [2, 109, 111, 112, 127, 135, 136, 138], "itemtreevt": [2, 109, 112, 127, 136, 138], "inner": [2, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 127, 138], "intern": [2, 14, 15, 16, 20, 46, 98, 109, 125, 142, 157], "constructor": [2, 14, 16, 17, 18, 19, 109, 136, 148, 157, 158, 165, 167, 229], "arrow": 2, "implement": [2, 4, 6, 7, 8, 9, 10, 14, 15, 17, 20, 21, 105, 112, 156, 165, 166, 227, 229], "semant": 2, "derefer": [2, 158, 165, 166], "into_dyn": [2, 111, 112, 127], "weak": [3, 127], "can": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 20, 21, 22, 95, 96, 98, 102, 104, 105, 106, 112, 136, 148, 157, 159, 162, 165, 166, 168, 170, 171, 227, 228, 229, 231, 232, 235, 239, 240], "componenthandl": [3, 12, 22, 58, 102, 103, 109, 111, 112, 229, 239], "null": [3, 13, 158, 162, 234], "lock": [3, 98, 112, 127], "alwai": [3, 20, 158, 240], "empti": [3, 9, 12, 13, 14, 112, 122, 124, 127, 136, 157, 158, 159, 165], "copi": [3, 12, 14, 17, 109, 133, 148, 157, 158, 159, 165, 166, 231, 238], "option": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 21, 22, 55, 57, 58, 93, 107, 109, 110, 111, 112, 117, 127, 136, 148, 165, 170, 171, 227, 228, 235, 238, 239], "strong": [3, 10, 13], "point": [3, 11, 66, 102, 103, 104, 105, 110, 119, 120, 127, 136, 139, 149, 151, 158, 159, 165, 166, 231, 239, 240], "still": [3, 13, 20, 22, 107, 112, 229], "referenc": [3, 10, 14, 19, 158, 165, 166], "ani": [3, 10, 11, 13, 16, 17, 18, 21, 22, 96, 98, 148, 227, 228, 232, 236, 240], "model": [4, 5, 7, 8, 9, 14, 46, 58, 102, 103, 109, 112, 137, 138, 229, 239], "modeldata": [4, 6, 7, 8, 9, 112], "act": [4, 5, 7, 8, 12, 17], "adapt": [4, 5, 7, 8, 21, 53, 227], "sourc": [4, 5, 7, 8, 112, 136, 148, 163, 228, 231, 234, 237, 238, 239], "filter": [4, 5, 8], "each": [4, 5, 8, 20, 22, 94, 106, 229, 236, 240], "row": [4, 5, 6, 7, 8, 9, 109, 112, 138], "accept": [4, 14, 22, 133, 136, 229, 233], "e": [4, 22, 122, 227, 231], "visibl": [4, 10, 17, 21, 22, 110, 112, 116, 228], "shared_ptr": [4, 5, 7, 8, 14, 109, 112, 121, 229, 239], "source_model": [4, 5, 7, 8, 112], "filter_fn": [4, 112], "provid": [4, 5, 6, 7, 8, 10, 16, 17, 19, 20, 21, 22, 48, 53, 54, 98, 158, 165, 166, 170, 228, 229, 231, 232, 234, 235, 236, 237, 239], "limit": [4, 112, 229], "view": [4, 5, 6, 7, 8, 20, 21, 110, 112, 124, 158, 165, 166, 168, 169], "expos": [4, 5, 165, 166, 227, 229, 231], "virtual": [4, 5, 6, 7, 8, 9, 17, 19, 20, 21, 110, 112, 142], "size_t": [4, 5, 6, 7, 8, 9, 20, 109, 110, 112, 113, 119, 122, 124, 127, 158, 159], "row_count": [4, 5, 6, 7, 8, 9, 109, 112, 138], "overrid": [4, 5, 7, 8, 9, 21, 109, 110, 112], "amount": [4, 5, 6, 7, 8, 9, 17, 20, 234], "row_data": [4, 5, 6, 7, 8, 9, 109, 112, 138], "data": [4, 5, 6, 7, 8, 9, 16, 109, 110, 111, 112, 113, 117, 119, 121, 124, 126, 127, 135, 136, 140, 142, 148, 157, 158, 159, 229, 232, 239, 240], "particular": [4, 5, 6, 7, 8, 9, 227, 235], "should": [4, 5, 6, 7, 8, 9, 10, 13, 14, 17, 18, 21, 94, 96, 112, 121, 127, 170, 171, 227, 228, 234, 235], "void": [4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18, 19, 20, 21, 22, 46, 94, 95, 96, 97, 98, 100, 101, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 125, 126, 127, 131, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 159, 162, 165, 229, 234, 238], "set_row_data": [4, 6, 7, 8, 9, 109, 112, 138], "onli": [4, 5, 6, 7, 8, 9, 13, 14, 17, 18, 20, 21, 95, 98, 101, 104, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 148, 158, 159, 227, 228, 229, 233], "cannot": [4, 6, 7, 8, 9, 122, 148, 159, 162], "support": [4, 6, 7, 8, 9, 17, 49, 105, 112, 122, 227, 234, 235, 236, 238], "chang": [4, 5, 6, 7, 8, 9, 10, 20, 21, 101, 107, 142, 159, 165, 166, 231, 234, 239], "ok": [4, 6, 7, 8, 9, 112, 133], "do": [4, 6, 7, 8, 9, 13, 17, 20, 21, 104, 110, 112, 125, 148, 168, 227, 229], "noth": [4, 6, 7, 8, 9, 17, 21, 162], "print": [4, 6, 7, 8, 9], "warn": [4, 6, 7, 8, 9, 11, 47, 109, 118, 125, 137, 163], "stderr": [4, 6, 7, 8, 9], "updat": [4, 6, 7, 8, 9, 21, 112, 165], "row_chang": [4, 6, 7, 8, 9, 109, 112], "reset": [4, 5, 6, 8, 109, 112, 133], "re": [4, 5, 8, 10, 13, 15, 17, 20, 21, 26, 29, 35, 38, 101, 105, 162, 165, 166, 227, 229, 233, 234, 235], "state": [4, 5, 8, 10, 21, 53, 112, 127, 232], "extern": [4, 5, 8, 131, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146, 157, 227, 234, 238], "int": [4, 8, 13, 14, 16, 46, 98, 99, 109, 110, 112, 113, 121, 125, 136, 140, 141, 142, 144, 148, 229, 231, 240], "unfiltered_row": [4, 112], "filtered_row": [4, 112], "index": [4, 6, 8, 9, 109, 111, 112, 122, 135, 136, 142, 159], "correspond": [4, 8, 17, 21, 46, 231], "filtermodelinn": [4, 112], "sourcemodeldata": [5, 6, 112], "mappedmodeldata": [5, 6, 112], "map": [5, 228, 229, 234, 235, 237, 239], "allow": [5, 10, 54, 104, 229, 233, 239], "transform": [5, 13, 110, 229], "fly": [5, 11], "two": [5, 20, 21, 153, 157, 160, 231], "underli": [5, 9, 14, 22, 148, 158, 159], "permit": 5, "itself": [5, 13, 158], "For": [5, 13, 26, 29, 35, 38, 46, 50, 148, 156, 158, 227, 229, 231, 232, 234, 235, 237, 240], "number": [5, 14, 16, 20, 46, 109, 125, 133, 137, 158, 159, 163, 239], "string": [5, 11, 12, 13, 14, 29, 46, 98, 101, 136, 137, 140, 158, 229, 239, 240], "to_str": [5, 13, 14, 109], "lambda": 5, "express": [5, 46], "map_fn": [5, 112], "alter": 5, "mapmodelinn": [5, 112], "filtermodel": [6, 58, 102, 103, 112], "mapmodel": [6, 58, 102, 103, 112], "reversemodel": [6, 58, 102, 103, 112], "sortmodel": [6, 58, 102, 103, 112], "vectormodel": [6, 58, 102, 103, 112, 229], "repetit": [6, 229, 239], "element": [6, 8, 10, 14, 21, 22, 48, 111, 119, 136, 139, 145, 148, 159, 170, 229, 231, 232, 239], "languag": [6, 101, 112, 227, 229, 231, 234, 235, 237, 238, 239], "subclass": [6, 15, 21, 105, 239], "delet": [6, 10, 16, 17, 18, 19, 20, 78, 102, 106, 109, 110, 112, 114, 121, 126, 127, 132, 142, 148, 162, 165, 166], "protect": [6, 112], "notifi": [6, 49, 98, 109, 138], "specif": [6, 10, 21, 52, 232, 234, 240], "wa": [6, 10, 13, 14, 20, 21, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 53, 110, 112, 127, 148, 162, 231, 233], "row_ad": [6, 109, 112], "count": [6, 10, 109, 110, 112, 119, 126, 136, 138, 139, 157, 240], "were": [6, 11, 20, 21], "ad": [6, 238], "row_remov": [6, 109, 112], "remov": [6, 9, 159, 234], "been": [6, 21, 22, 53, 162, 165, 234], "everyth": [6, 16], "need": [6, 17, 18, 20, 21, 53, 102, 104, 115, 122, 227, 229, 231, 233, 234, 235, 238, 239], "reload": 6, "reserv": [7, 112], "mean": [7, 100, 109], "last": [7, 10, 11, 20, 21, 51, 100, 122, 158, 159], "second": [7, 20, 239], "revers": [7, 133], "reversemodelinn": [7, 112], "sort": [8, 112], "pair": [8, 109, 130, 165, 166], "comp": [8, 112], "unsorted_row": [8, 112], "sorted_row_index": [8, 112], "sortmodelinn": [8, 112], "sharedvector": [9, 11, 12, 14, 22, 68, 102, 103, 109, 110, 111, 112, 113, 117, 119, 122, 128, 135, 136, 138, 139, 140, 143, 145], "vector": [9, 11, 12, 14, 58, 112, 159, 163, 164, 229, 234], "arrai": [9, 14, 46, 109, 112, 157, 229], "push_back": [9, 112, 113, 122, 159], "append": [9, 158, 159], "eras": [9, 112], "insert": [9, 78, 102, 106, 112, 132, 227], "clear": [9, 11, 112, 122, 159], "set_vector": [9, 112], "replac": [9, 229, 238], "slint_window": [10, 43, 58, 82, 102, 112, 172], "toward": [10, 229], "system": [10, 13, 16, 17, 21, 100, 105, 148, 227, 228, 229, 232, 234, 235, 236, 237, 239], "render": [10, 15, 17, 19, 20, 21, 49, 52, 53, 94, 100, 105, 110, 136, 148, 157, 168, 227, 228, 229, 234, 235, 237, 238], "scene": [10, 19, 20, 53, 105], "It": [10, 12, 14, 17, 20, 21, 48, 51, 54, 148, 157, 158, 159, 164, 165, 166, 168, 170, 171, 227, 231, 232, 234, 237, 239], "api": [10, 13, 21, 42, 43, 52, 98, 103, 105, 107, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 129, 130, 132, 133, 227, 229, 231, 232, 234, 235, 237, 239], "control": [10, 13, 78, 97, 102, 106, 130, 132, 227, 233], "aspect": [10, 13, 163, 227], "posit": [10, 13, 21, 22, 110, 113, 127, 128, 136, 140, 149, 151], "screen": [10, 13, 16, 20, 21, 48, 96, 100, 110, 140, 148, 168, 229, 234, 237, 238], "destroi": [10, 11, 12, 14, 16, 53, 158, 159, 165, 166], "instanc": [10, 11, 12, 13, 17, 104, 109, 112, 148, 156, 158, 165, 229, 238, 239], "explicitli": [10, 149, 150, 151, 152], "one": [10, 13, 14, 15, 48, 98, 105, 112, 127, 148, 158, 165, 166, 227, 228, 229, 239], "becom": [10, 21, 112, 165, 166], "hidden": [10, 13, 21, 54], "show": [10, 13, 21, 104, 109, 127, 227, 229, 231, 234], "addit": [10, 227, 234, 235], "associ": [10, 13, 20, 21, 229, 231], "maintain": 10, "hide": [10, 13, 21, 109, 122, 127, 229], "make": [10, 158, 159, 162, 165, 166, 227, 233, 235, 238, 239], "invis": 10, "again": [10, 21], "drop": [10, 109, 122, 136, 138, 140], "anymor": [10, 22, 96, 148], "when": [10, 11, 12, 17, 19, 20, 21, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 49, 51, 53, 54, 100, 101, 105, 109, 127, 148, 158, 159, 162, 165, 166, 227, 228, 229, 235, 236], "is_vis": [10, 127, 138], "even": [10, 51, 239], "previous": [10, 20, 162], "user": [10, 21, 54, 100, 229, 232, 239, 240], "minim": [10, 21, 127, 158, 170, 231], "templat": [10, 13, 20, 22, 58, 61, 63, 66, 68, 69, 102, 103, 109, 110, 111, 112, 113, 114, 115, 117, 120, 121, 122, 123, 125, 126, 127, 135, 136, 138, 143, 144, 149, 150, 151, 152, 162, 165, 229, 237, 239], "invoc": [10, 13, 20, 22, 98, 99, 109, 111, 112, 126, 127, 148, 162], "renderingst": [10, 80, 102, 103, 127, 134, 136], "graphicsapi": [10, 80, 102, 103, 127, 134, 136], "f": [10, 13, 98, 99, 109, 112, 114, 115, 121, 126, 127, 162], "setrenderingnotifiererror": [10, 80, 102, 103, 127, 134, 136], "set_rendering_notifi": [10, 53, 127, 148], "callback": [10, 12, 13, 20, 21, 22, 53, 54, 97, 109, 110, 114, 126, 127, 136, 138, 141, 146, 148, 162, 229, 231, 237, 239], "regist": [10, 13, 49, 95, 112, 229], "invok": [10, 12, 13, 17, 18, 20, 21, 22, 98, 109, 110, 162, 227, 238], "dure": [10, 11, 148, 227], "phase": 10, "custom": [10, 105, 229], "top": [10, 117, 133, 135, 148], "below": [10, 237], "callabl": [10, 22], "argument": [10, 11, 13, 112, 136, 148, 227, 228, 229], "On": [10, 112, 231, 234], "success": [10, 238], "without": [10, 46, 105, 148, 165, 227, 235], "error": [10, 11, 47, 49, 112, 136, 137, 163], "on_close_request": [10, 54, 127], "tri": [10, 54], "close": [10, 21, 51, 54, 100, 133, 139, 231], "closerequestrespons": [10, 80, 102, 103, 127, 134, 136], "request_redraw": [10, 21, 110, 127, 140], "issu": [10, 233], "request": [10, 13, 21, 54], "redraw": [10, 20], "content": [10, 148, 159, 161, 229, 233, 234, 238], "physicalposit": [10, 20, 21, 66, 102, 103, 110, 120, 127, 168, 169], "physic": [10, 20, 21, 151, 152, 228, 240], "coordin": [10, 20, 21, 119, 148, 149, 151, 153, 240], "includ": [10, 11, 16, 21, 42, 46, 98, 99, 102, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172, 227, 228, 229, 231, 234, 237, 238], "frame": [10, 20, 21], "present": [10, 21, 22, 53, 102], "set_posit": [10, 21, 110, 127, 140], "logicalposit": [10, 22, 66, 102, 103, 111, 120, 127, 136, 151, 240], "po": [10, 110, 127, 136], "note": [10, 13, 14, 16, 21, 110, 112, 165, 166, 227, 229, 231, 235, 240], "some": [10, 11, 125, 136, 231, 234], "wayland": [10, 16, 227], "avail": [10, 13, 101, 103, 109, 148, 227, 229, 233, 234, 239], "physicals": [10, 19, 20, 21, 69, 102, 103, 110, 123, 127, 168, 169, 234], "size": [10, 19, 20, 21, 22, 69, 102, 103, 109, 110, 111, 112, 113, 117, 122, 123, 124, 127, 135, 136, 140, 143, 148, 150, 152, 157, 158, 159, 168, 169, 170, 171, 227, 234, 238, 240], "exclud": [10, 21, 158, 227], "set_siz": [10, 21, 110, 127, 140], "logicals": [10, 21, 22, 69, 102, 103, 110, 111, 123, 127, 136, 152, 170, 171], "resiz": [10, 21, 112, 127, 136, 170, 171], "logic": [10, 13, 21, 112, 149, 150, 228, 229, 232, 240], "pixel": [10, 20, 21, 110, 117, 133, 135, 148, 149, 150, 151, 152, 154, 155, 157, 167, 228, 233, 235, 240], "scale_factor": [10, 127, 136], "scale": [10, 21, 148], "is_fullscreen": [10, 21, 108, 110, 127, 170], "current": [10, 11, 53, 142, 148], "fullscreen": [10, 21, 108, 110, 127, 170], "set_fullscreen": [10, 127], "unset": [10, 21, 170, 171], "displai": [10, 16, 20, 53, 105, 110, 140, 148, 232, 233, 234, 235, 237], "is_maxim": [10, 21, 110, 127, 170], "maxim": [10, 21, 127, 170], "set_maxim": [10, 127], "unmaxim": 10, "is_minim": [10, 21, 110, 127, 170], "set_minim": [10, 127], "unminimz": 10, "dispatch_key_press_ev": [10, 106, 127, 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, 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], "sharedstr": [10, 11, 12, 13, 14, 17, 21, 22, 70, 102, 103, 106, 109, 110, 111, 112, 117, 119, 124, 125, 127, 129, 130, 135, 136, 137, 138, 139, 140, 142, 144, 145, 148, 161, 163, 164, 170, 229, 239, 240], "dispatch": 10, "kei": [10, 106, 109, 165, 166, 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, 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], "press": [10, 125, 127, 136, 142], "event": [10, 13, 17, 18, 21, 50, 51, 94, 97, 98, 99, 100, 110, 119, 127, 136, 139, 140, 229, 231, 234, 238, 239], "your": [10, 14, 20, 21, 105, 148, 227, 228, 229, 231, 233, 234, 235, 237, 238, 239], "own": [10, 105, 110, 227, 229, 236, 239], "backend": [10, 13, 49, 96, 105, 136, 142, 235], "want": [10, 104, 148, 165, 166, 227, 228, 231], "forward": [10, 21, 50, 109, 112, 127, 132, 235], "input": [10, 13, 21, 94, 100, 229, 235, 237], "unicod": 10, "represent": [10, 12, 29, 158], "dispatch_key_press_repeat_ev": [10, 127], "auto": [10, 13, 20, 22, 98, 99, 109, 110, 111, 112, 117, 121, 122, 124, 127, 129, 130, 132, 133, 158, 165, 166, 168, 227, 229, 231, 234, 238], "repeat": [10, 112, 126, 130, 133, 136, 146, 162], "dispatch_key_release_ev": [10, 106, 127], "releas": [10, 53, 110, 127, 136, 142, 227, 231, 238], "dispatch_pointer_press_ev": [10, 127], "pointereventbutton": [10, 78, 102, 103, 127, 130, 132, 133, 136], "button": [10, 22, 48, 50, 127, 130, 132, 136], "mous": [10, 13, 50], "rel": [10, 11, 162, 240], "dispatch_pointer_release_ev": [10, 127], "dispatch_pointer_exit_ev": [10, 127], "exit": [10, 17, 127, 136], "trigger": [10, 97, 239], "dispatch_pointer_move_ev": [10, 127], "move": [10, 14, 16, 17, 18, 109, 110, 111, 112, 114, 121, 122, 126, 127, 133, 136, 158, 159, 165, 166], "dispatch_pointer_scroll_ev": [10, 127], "delta_x": [10, 127, 130, 136], "delta_i": [10, 127, 130, 136], "scroll": 10, "wheel": [10, 127, 136], "delta": 10, "x": [10, 20, 110, 111, 112, 120, 125, 127, 135, 136, 139, 153, 227, 229, 231, 232, 240], "y": [10, 110, 111, 112, 120, 125, 127, 135, 136, 139, 153, 231, 232, 240], "direct": [10, 14, 21, 136], "dispatch_resize_ev": [10, 21, 127], "after": [10, 11, 20, 21, 97, 162], "send": [10, 17, 21], "ensur": [10, 16, 227], "width": [10, 20, 21, 110, 111, 112, 117, 123, 127, 130, 135, 136, 142, 148, 157, 160, 231, 232, 238], "height": [10, 21, 110, 111, 112, 117, 123, 127, 135, 136, 142, 148, 157, 160, 231, 232, 238], "root": [10, 145, 229], "properli": 10, "dispatch_scale_factor_change_ev": [10, 21, 127], "happen": 10, "resolut": 10, "select": [10, 17, 227, 234, 235, 237, 238], "platform": [10, 15, 16, 19, 20, 21, 43, 78, 96, 102, 103, 108, 127, 132, 167, 168, 169, 170, 171, 172, 234, 235, 237, 238], "right": [10, 20, 50, 117, 132, 133, 135, 148, 234], "initi": [10, 19, 21, 53, 97, 110, 157, 159, 165, 234, 238], "creation": 10, "dispatch_window_active_changed_ev": [10, 127], "activ": [10, 109, 127, 162], "de": [10, 13, 14, 165, 166, 229], "gain": 10, "focu": 10, "lose": 10, "dispatch_close_requested_ev": [10, 21, 127], "effect": 10, "depend": [10, 112, 141, 227, 234, 235], "has_active_anim": [10, 21, 127], "anim": [10, 21, 94, 121], "interpret": [11, 12, 13, 14, 43, 46, 47, 64, 83, 102, 103, 115, 118, 137, 138, 163, 164, 165, 166, 172], "entri": [11, 103, 104, 105, 165, 166, 239], "load": [11, 102, 103, 104, 148, 228, 239], "compil": [11, 12, 13, 17, 101, 104, 109, 112, 138, 228, 229, 231, 232, 234, 236, 238, 240], "them": [11, 20, 22, 104, 165, 168, 169, 227, 233, 238, 239], "build_from_sourc": [11, 12, 104, 109], "set_include_path": [11, 109], "look": [11, 231, 233, 234, 235], "up": [11, 20, 98, 133, 228, 231, 234, 239], "import": [11, 105, 148, 228, 234, 238], "set_styl": [11, 109], "string_view": [11, 12, 13, 22, 57, 59, 63, 65, 67, 70, 109, 111, 113, 117, 119, 121, 124, 158, 165, 166, 240], "style": [11, 109, 138], "widget": [11, 48, 234, 237, 238], "set_translation_domain": [11, 109], "domain": [11, 109, 112, 136], "translat": [11, 101, 112, 231, 239, 240], "include_path": [11, 109], "configur": [11, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 227, 228, 233, 234, 235, 237], "diagnost": [11, 47, 83, 102, 104, 109, 112, 137, 138], "produc": [11, 165], "build_from_path": [11, 12, 104, 109], "componentdefinit": [11, 13, 55, 102, 104, 109, 164, 239], "source_cod": [11, 109, 138], "collect": [11, 98], "retriev": [11, 237], "previou": [11, 20, 112, 229], "comput": 11, "self": [11, 109, 110, 162], "markup": [12, 227, 229, 235, 240], "componentcompil": [12, 55, 102, 104, 109, 138, 163, 239], "And": 12, "instanti": [12, 229, 234, 238, 239], "factori": [12, 17], "ve": [12, 229], "finish": [12, 99], "safe": [12, 98, 158], "assign": [12, 14, 148, 158, 159, 165, 166], "componentinst": [12, 55, 102, 104, 109, 138, 239], "propertydescriptor": [12, 83, 102, 104, 109, 137, 138], "describ": [12, 20, 21, 47, 48, 49, 50, 52, 53, 54, 148, 163, 164, 170, 171, 232], "list": [12, 48, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 172], "read": [12, 99, 112, 165, 227, 231], "written": [12, 165, 232], "set_properti": [12, 13, 109, 228], "get_properti": [12, 13, 109], "set_callback": [12, 13, 109], "global": [12, 13, 101, 109, 138, 227, 228, 239], "export": [12, 13, 22, 229, 231, 232, 234, 238, 239, 240], "singleton": [12, 13, 239], "global_properti": [12, 109], "global_nam": [12, 109, 138], "descriptor": 12, "publicli": 12, "exist": [12, 13, 15, 22, 112, 148, 157, 158, 165, 227, 228], "under": [12, 158, 234], "global_callback": [12, 109], "global_funct": [12, 109], "privat": [13, 109, 110, 111, 112, 113, 114, 115, 117, 119, 121, 122, 124, 126, 127, 128, 135, 139, 228, 229, 231, 238], "dyn": [13, 109, 136], "access": [13, 14, 21, 22, 48, 52, 96, 102, 165, 166, 170, 229, 239], "put": [13, 228], "mark": [13, 231], "window": [13, 16, 17, 19, 20, 21, 49, 51, 53, 54, 73, 95, 96, 100, 102, 103, 105, 106, 109, 110, 112, 125, 127, 140, 148, 170, 171, 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, 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, 231, 232, 234, 238, 240], "shown": [13, 21, 54, 98, 170, 239], "react": [13, 100, 229, 239], "draw": [13, 148, 234], "touch": [13, 234, 235, 237, 238], "necessari": [13, 16, 100, 227], "spin": [13, 17, 229, 231], "loop": [13, 17, 18, 21, 51, 94, 97, 98, 99, 100, 110, 229, 231, 234, 238], "run_event_loop": [13, 17, 51, 58, 97, 102, 103, 109, 110, 112, 140, 229], "receiv": [13, 21, 98, 100], "further": [13, 229], "integr": [13, 103, 157, 227, 232, 235, 237, 238, 239], "conveni": [13, 14, 158, 162, 165, 166, 227, 229, 231, 235], "follow": [13, 98, 99, 102, 148, 227, 228, 229, 231, 233, 234, 235, 237, 238, 239, 240], "qwidget": [13, 109, 142], "qt": [13, 142, 227], "graphic": [13, 52, 53, 232], "mai": [13, 20, 21, 49, 148, 168, 233, 234], "nullptr": [13, 109, 110, 112, 121, 142], "runtim": [13, 17, 101, 104, 110, 165, 227], "hello": [13, 229, 231, 232, 234, 235, 238], "we": [13, 110, 112, 115, 122, 136, 227, 229, 231, 233, 235, 237], "world": [13, 231, 232, 234, 235, 238], "correctli": 13, "could": [13, 233, 235], "becaus": [13, 110, 122, 148, 231], "proper": 13, "behind": 13, "span": [13, 20, 58, 63, 109, 110, 112, 117, 136], "arg": [13, 109, 114, 122, 136, 138, 141, 159, 165, 229], "imagin": 13, "contain": [13, 14, 20, 21, 46, 106, 125, 133, 157, 158, 159, 170, 228, 229, 231, 239], "foo": [13, 14, 22, 109, 240], "Then": [13, 14, 96, 227], "42": [13, 14, 142, 158], "don": [13, 109, 136, 233], "match": [13, 22, 112, 227, 234, 237, 238], "which": [13, 20, 21, 100, 104, 112, 120, 123, 162, 165, 166, 227, 228, 229, 232, 235, 239], "did": 13, "handler": [13, 94, 229], "functor": [13, 98, 99, 112, 229], "take": [13, 109, 148, 228, 229], "slice": [13, 109, 111, 112, 117, 122, 124, 135, 136, 138, 140, 144, 145, 148], "cout": 13, "to_numb": [13, 14, 109], "n": [13, 112, 124, 125, 136, 144, 158], "sinc": [13, 17, 20, 227], "captur": 13, "set_global_properti": [13, 109, 239], "prop_nam": [13, 109], "within": [13, 14, 22, 98, 102, 163, 227], "main": [13, 97, 98, 99, 100, 127, 228, 229, 231, 234, 238], "theglob": 13, "doe": [13, 16, 21, 22, 49, 162, 165], "correct": [13, 227], "get_global_properti": [13, 109, 239], "set_global_callback": [13, 109, 239], "preview": [13, 22, 232], "pure": 13, "to_uppercas": [13, 229], "arg1": 13, "begin": [13, 20, 109, 110, 112, 113, 117, 122, 124, 133, 136, 148, 157, 158, 159, 165, 166, 229], "end": [13, 20, 78, 102, 106, 109, 110, 112, 113, 117, 122, 124, 132, 133, 136, 157, 158, 159, 165, 166, 227, 229, 233], "toupper": [13, 229], "invoke_glob": [13, 109], "callable_nam": [13, 109, 138], "definit": [13, 109, 172], "dynam": [14, 102, 239], "type": [14, 18, 22, 46, 50, 54, 102, 103, 104, 105, 109, 113, 115, 117, 119, 120, 123, 125, 128, 131, 135, 136, 139, 148, 157, 158, 164, 166, 169, 171, 229, 234, 235, 237, 239], "overload": [14, 21, 112], "to_xxx": 14, "possibl": [14, 158, 227, 239], "queri": [14, 21, 22], "c": [14, 17, 20, 103, 112, 127, 131, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 165, 166, 168, 227, 228, 229, 231, 234, 235, 236, 237, 238, 239, 240], "store": [14, 17, 113, 147, 156, 157], "sometyp": 14, "object": [14, 22, 46, 148, 240], "liter": 14, "bar": [14, 22, 48, 240], "my_prop": 14, "Such": 14, "doubl": [14, 20, 22, 109, 124, 125, 136, 138, 144, 158, 237], "some_valu": 14, "check": [14, 22, 111, 136, 142, 165, 166, 227, 231, 232, 234, 235, 237], "string_valu": 14, "do_someth": [14, 99], "extract": [14, 165, 166, 237, 238], "valuetyp": [14, 83, 102, 104, 109, 137, 138, 164], "alia": [14, 133, 231], "enum": [14, 17, 20, 110, 112, 117, 128, 130, 132, 133, 134, 135, 136, 137, 139, 146, 148, 172], "to_bool": [14, 109], "to_arrai": [14, 109], "serial": 14, "brush": [14, 21, 46, 59, 102, 103, 109, 110, 113, 115, 121, 128, 136, 137, 138, 140, 141, 142, 170, 240], "to_brush": [14, 109], "to_struct": [14, 109, 165], "imag": [14, 46, 63, 102, 103, 109, 117, 135, 136, 137, 138, 142, 157, 228, 235, 238, 240], "to_imag": [14, 109], "str": [14, 109, 112, 117, 124, 125, 138, 158, 229], "boolean": 14, "m": [14, 109, 112, 136, 235], "struc": [14, 109, 138], "img": [14, 109, 117, 138], "variant": [14, 20, 46], "vale": 14, "skiarender": [15, 21, 56, 102, 105, 110, 127], "softwarerender": [15, 21, 56, 102, 105, 110, 127, 169], "interfac": [15, 105, 227, 229, 232, 239], "windowadapt": [15, 17, 20, 56, 102, 105, 108, 110, 171], "intend": [15, 22], "place": [15, 238], "requir": [15, 109, 110, 111, 112, 127, 227, 228, 233, 234, 238, 239], "opaqu": [16, 109, 112, 124], "low": [16, 52], "level": [16, 52, 137, 163], "exchang": [16, 110], "messag": [16, 21, 98, 99, 112, 137, 163], "connect": [16, 110, 140, 234], "server": 16, "kind": [16, 109, 130, 136, 239], "ownership": [16, 109, 110], "caller": 16, "respons": [16, 148], "suppli": [16, 229], "valid": [16, 22, 112, 136, 148, 158], "throughout": 16, "lifetim": 16, "from_x11_xcb": [16, 110], "visual_id": [16, 110, 140], "xcb_connection_t": [16, 110], "xcb_window_t": [16, 110], "xcb_visualid_t": [16, 110], "xcb": 16, "from_x11_xlib": [16, 110], "unsign": [16, 109, 110, 111, 117, 124, 125, 140, 142, 148], "long": [16, 22, 110, 112, 140, 158, 229, 239], "xlib": 16, "visualid": [16, 110], "from_wayland": [16, 110], "wl_surfac": [16, 110], "surfac": [16, 110, 140], "wl_displai": [16, 110], "from_appkit": [16, 110], "nsview": [16, 110], "nswindow": [16, 110], "from_win32": [16, 110], "hwnd": [16, 21, 110, 140], "hinstanc": [16, 110], "task": [17, 50, 56, 102, 105, 110, 234], "set_platform": [17, 56, 102, 105, 110], "befor": [17, 21, 94, 95, 96, 165, 166], "subsequ": 17, "create_window_adapt": [17, 21, 110], "clipboard": [17, 110, 136, 140], "clipboard_text": [17, 110, 140], "set_clipboard_text": [17, 110, 140], "enumer": [17, 20, 46, 47, 48, 49, 50, 51, 52, 53, 54, 148], "defaultclipboard": [17, 110, 136], "action": [17, 22, 54, 111, 133, 136], "ctrl": 17, "secondari": 17, "x11": [17, 227], "selectionclipboard": [17, 110, 136], "primari": [17, 103, 142, 239], "unique_ptr": [17, 95, 110, 142], "chrono": [17, 58, 72, 93, 110, 112, 126, 162], "millisecond": [17, 93, 110, 126, 162, 240], "duration_since_start": [17, 110, 140], "start": [17, 20, 98, 99, 102, 126, 133, 136, 158, 162, 163, 227, 229, 234, 235, 237, 238], "applic": [17, 49, 95, 105, 148, 227, 228, 231, 232, 233, 237, 239], "slint_feature_freestand": [17, 80, 102, 110, 112, 117, 127, 134], "doesn": [17, 109, 112], "nullopt": [17, 21, 22, 110, 111, 112, 148], "quit_event_loop": [17, 51, 58, 102, 103, 110, 112, 140], "thread": [17, 18, 98, 99, 127], "enter": [17, 100], "run_in_event_loop": [17, 18, 110], "invoke_from_event_loop": [17, 58, 99, 102, 103, 112, 127, 140], "pass": [17, 18, 20, 21, 97, 148, 158, 159, 227, 228, 235], "reimplement": [17, 21], "longer": [17, 18], "onc": [17, 18, 95, 97, 98, 109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 229, 231, 235, 239], "abstractrender": [19, 20, 21, 56, 102, 105, 110], "skia": 19, "nativ": [19, 21, 232], "non": [19, 46, 106], "zero": 19, "explicit": [19, 20, 21, 109, 110, 111, 117, 120, 121, 122, 123, 124, 127, 142, 149, 150, 151, 152, 159, 167], "nativewindowhandl": [19, 56, 102, 105, 110], "window_handl": [19, 110, 112, 125, 127, 136], "initial_s": [19, 110], "windowhandl": 19, "physicalregion": [20, 56, 102, 105, 110, 136, 140], "rect": [20, 56, 102, 105, 110, 111, 112, 135, 136, 168], "softwar": [20, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 228, 235, 237, 238], "To": [20, 107, 227, 235, 237, 239], "buffer": [20, 21, 53, 110, 117, 135, 140, 148, 157, 234, 237], "repaintbuffertyp": [20, 110], "part": [20, 158], "speed": [20, 228], "paint": 20, "newbuff": [20, 110], "full": 20, "redrawn": 20, "No": [20, 133], "attempt": 20, "partial": [20, 168], "made": [20, 159, 228, 233], "reusedbuff": [20, 110], "assum": [20, 98, 148, 158, 228, 229], "everi": [20, 162, 229], "swappedbuff": [20, 110], "drawn": [20, 148], "swap": [20, 53, 110, 121, 122, 124], "renderingrot": [20, 110], "rotat": [20, 110, 112, 136, 140], "set_rendering_rot": [20, 110], "norot": [20, 110], "rotate90": [20, 110], "90": [20, 110, 142], "left": [20, 21, 50, 117, 132, 133, 135, 148, 170, 171], "rotate180": [20, 110], "180": [20, 110, 142], "upsid": 20, "down": [20, 133], "rotate270": [20, 110], "buffer_typ": [20, 110], "strategi": 20, "rgb8pixel": [20, 80, 102, 103, 110, 117, 134, 135, 140, 148, 167], "pixel_strid": [20, 110, 140], "least": [20, 158, 227, 229, 234, 235, 239], "larg": 20, "stride": 20, "line": [20, 110, 125, 133, 137, 163, 227, 232, 235], "rgb565pixel": [20, 56, 102, 105, 110, 234], "565": 20, "render_by_lin": [20, 110], "process_line_callback": [20, 110], "cach": [20, 112, 227, 228], "dirti": [20, 112, 141], "region": [20, 140, 168], "consid": [20, 157], "signatur": 20, "render_fn": [20, 110], "third": 20, "fourth": 20, "free": [20, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 140, 158], "flush": 20, "typic": [20, 21, 50, 105, 148, 163, 165, 166, 233, 236, 238], "compos": [20, 168, 232], "multipl": [20, 49, 168, 227, 228, 229], "sub": [20, 168, 227, 229, 236, 239], "bounding_box_s": [20, 110, 168], "bound": [20, 168], "box": [20, 109, 138, 168, 234, 235], "bounding_box_origin": [20, 110, 168], "origin": [20, 110, 112, 117, 135, 148, 149, 151, 168, 169], "overlap": [20, 168], "over": [20, 165, 168, 169], "someth": [20, 22, 46, 168, 229], "member": [20, 21, 108, 136, 147, 153, 154, 155, 156, 160, 161, 163, 164, 167, 168, 169, 170, 171, 229, 240], "windowproperti": [21, 56, 102, 105, 108, 110, 140], "layoutconstraint": [21, 56, 102, 105, 110, 170], "base": [21, 22, 46, 102, 111, 136, 234, 238], "layer": [21, 136], "win32": [21, 231], "wayland_surface_t": 21, "establish": 21, "link": [21, 112, 231, 238], "both": [21, 165, 166, 227], "about": [21, 53, 125, 227, 228, 231, 234, 235, 237], "being": [21, 115, 148], "etc": [21, 22, 239], "dispatch_mouse_press_ev": 21, "via": [21, 148, 229, 237, 238], "set_vis": [21, 110, 140], "update_window_properti": [21, 110, 140, 170], "deleg": 21, "bi": 21, "protocol": [21, 165, 166], "incomplet": 21, "experi": [21, 238], "unexpect": 21, "behavior": [21, 100, 148], "intent": 21, "develop": [21, 26, 29, 35, 38, 235, 236], "fulfil": 21, "method": [21, 148, 162], "mywindowadapt": 21, "m_render": 21, "nativehandl": 21, "m_native_window": 21, "refresh": 21, "els": [21, 109, 110, 111, 112, 116, 117, 122, 125, 127, 234], "repaint_callback": 21, "asynchron": 21, "would": [21, 110, 122, 227], "update_timers_and_anim": [21, 56, 102, 105, 110], "schedul": [21, 97], "next": [21, 93, 109, 162, 165, 166, 227, 231, 232], "good": 21, "initialis": [21, 228], "detect": [21, 165, 227], "repaint": 21, "manag": 21, "instead": [21, 108, 162, 170, 227, 231, 235, 239], "iter": [21, 22, 55, 94, 102, 104, 109, 138, 165], "sent": [21, 53], "actual": [21, 229, 239], "propag": 21, "titl": [21, 110, 130, 136, 142, 170], "layout": [21, 110, 112, 135, 136, 148, 170, 171], "constraint": [21, 53, 136, 170, 171], "case": [21, 112, 113, 128, 135, 139, 148, 231, 240], "getter": [21, 170, 229, 239], "background": [21, 110, 136, 142, 170], "deprec": [21, 102, 110, 112, 170, 172], "layout_constraint": [21, 110, 170, 171], "min": [21, 110, 112, 136, 140, 170, 171], "minimum": [21, 22, 142, 170, 171], "abl": [21, 170, 171, 238], "smaller": [21, 170, 171], "than": [21, 99, 158, 170, 171, 228, 239], "max": [21, 110, 112, 136, 140, 170, 171], "maximum": [21, 22, 142, 170, 171], "larger": [21, 170, 171], "prefer": [21, 110, 112, 136, 140, 170, 171, 231], "test": [22, 43, 48, 71, 78, 102, 103, 109, 125, 132, 133, 172, 234], "purpos": [22, 112, 229], "is_valid": [22, 111], "id": [22, 111, 126, 136, 146, 148], "qualifi": 22, "none": [22, 48, 50, 119, 132, 133, 139, 235, 238], "consist": 22, "surround": 22, "well": [22, 158, 165, 166, 234, 236, 238], "local": [22, 112], "separ": [22, 228], "colon": 22, "pushbutton": 22, "zwj": 22, "app": [22, 229, 234, 238], "mybutton": 22, "known": [22, 148], "type_nam": [22, 111, 145], "buttonbas": 22, "inherit": [22, 102, 229, 231, 232, 234, 238], "accessiblerol": [22, 78, 102, 107, 111, 132, 133, 136], "accessible_rol": [22, 111, 136], "role": [22, 48, 136], "locat": [22, 163, 238], "checkbox": [22, 48, 132], "accessible_label": [22, 111], "label": [22, 111, 136, 145, 231], "accessible_valu": [22, 111], "accessible_placeholder_text": [22, 111], "placehold": 22, "accessible_descript": [22, 111], "descript": [22, 102, 111, 136, 163, 235], "accessible_value_maximum": [22, 111], "accessible_value_minimum": [22, 111], "accessible_value_step": [22, 111], "step": [22, 227, 231], "accessible_check": [22, 111], "checkabl": [22, 111, 136, 142], "set_accessible_valu": [22, 111], "invoke_accessible_increment_act": [22, 111], "increment": [22, 111, 136], "invoke_accessible_decrement_act": [22, 111], "decrement": [22, 111, 136], "invoke_accessible_default_act": [22, 111], "absolute_posit": [22, 111], "absolut": [22, 228], "visitor": [22, 111, 112, 136, 145], "r": [22, 109, 110, 111, 112, 114, 121, 129, 130, 132, 133, 134, 140, 142, 154, 155, 167, 234], "invoke_result_t": [22, 99, 109, 111, 112, 121, 127], "visit_el": [22, 111], "visit": [22, 112, 165], "continu": [22, 112, 229], "until": [22, 51, 93, 99, 109, 162, 165, 231], "convers": [22, 148, 158], "never": [22, 162], "convertt": 22, "eh": 22, "make_opt": 22, "find_by_accessible_label": [22, 111], "find": [22, 112, 227], "find_by_element_id": [22, 111], "element_id": [22, 111, 145], "find_by_element_type_nam": [22, 111], "slint_generated_publ": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 45, 49, 52, 53, 54, 63, 70, 82, 102, 117, 136, 154, 155, 172], "macro": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 227], "flag": [23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 233], "enabl": [23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 107, 136, 142, 227, 234, 235, 238, 239], "expand": [26, 29, 35, 38, 120, 123], "numer": [26, 35, 38], "patch": [26, 112], "against": [26, 29, 35, 38, 148, 227], "minor": [35, 112], "major": [38, 112], "slint_tests_help": [40, 43, 57, 102, 172], "home": [41, 42, 43, 78, 102, 106, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 132, 172], "runner": [41, 42, 43, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 172], "work": [41, 42, 43, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 148, 172, 227, 231], "cpp": [41, 43, 105, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 129, 130, 132, 133, 172, 227, 228, 231, 234, 237, 238], "parent": [42, 43, 45, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 112, 127, 136, 231, 232], "slint_callback": [43, 82, 87, 102, 136, 172], "slint_config": [43, 82, 102, 136, 172], "slint_imag": [43, 68, 69, 70, 80, 81, 82, 102, 136, 148, 157, 172], "slint_interpret": [43, 55, 102, 172], "slint_pathdata": [43, 82, 85, 102, 136, 172], "slint_point": [43, 58, 82, 102, 112, 136, 149, 151, 153, 172], "slint_properti": [43, 61, 76, 82, 87, 102, 115, 136, 172], "slint_sharedvector": [43, 58, 63, 82, 89, 102, 117, 136, 159, 172], "slint_siz": [43, 58, 63, 102, 112, 117, 150, 152, 160, 172], "slint_str": [43, 59, 63, 80, 82, 90, 102, 113, 117, 134, 136, 158, 172], "slint_tim": [43, 82, 92, 102, 136, 162, 172], "generated_includ": [44, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "cppdoc": [45, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "slint_brush_intern": [45, 59, 79, 102, 113, 172], "slint_builtin_struct": [45, 76, 102, 130, 161, 172], "slint_builtin_structs_intern": [45, 67, 75, 79, 82, 102, 121, 136, 172], "slint_color_intern": [45, 61, 79, 102, 115, 172], "slint_enum": [45, 48, 50, 79, 102, 133, 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, 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], "slint_enums_intern": [45, 74, 76, 77, 78, 81, 82, 85, 102, 128, 130, 131, 135, 136, 139, 172], "slint_image_intern": [45, 63, 79, 86, 102, 117, 140, 172], "slint_intern": [45, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 70, 72, 73, 76, 79, 80, 84, 86, 88, 102, 112, 127, 138, 140, 142, 172], "slint_interpreter_generated_publ": [45, 46, 47, 84, 102, 138, 163, 164, 172], "slint_interpreter_intern": [45, 55, 82, 83, 102, 109, 172], "slint_pathdata_intern": [45, 65, 79, 102, 119, 172], "slint_platform_intern": [45, 58, 81, 82, 102, 112, 172], "slint_properties_intern": [45, 60, 67, 102, 114, 121, 172], "slint_qt_intern": [45, 58, 82, 102, 112, 172], "slint_sharedvector_intern": [45, 68, 102, 122, 172], "slint_string_intern": [45, 70, 102, 124, 172], "slint_testing_intern": [45, 57, 102, 111, 172], "slint_timer_intern": [45, 72, 102, 126, 172], "class": [46, 47, 48, 49, 50, 51, 52, 53, 54, 109, 110, 111, 112, 113, 115, 117, 122, 127, 128, 130, 132, 133, 134, 135, 136, 137, 139, 141, 146, 148, 158, 159, 165, 166, 168, 170, 172, 228, 229, 231, 238, 239, 240], "int8_t": [46, 137], "unit": [46, 240], "length": [46, 228, 240], "angl": [46, 113, 240], "solidcolor": [46, 113, 128], "sever": 47, "belong": 47, "context": [48, 53, 112, 136, 148], "assist": 48, "technologi": 48, "reader": 48, "isn": 48, "behav": 48, "combobox": [48, 132, 142], "slider": [48, 132], "spinbox": [48, 132], "tab": [48, 78, 102, 106, 132], "tablist": [48, 132], "similar": [48, 159, 228, 229, 239], "automat": [48, 158, 239, 240], "tabl": [48, 132, 237, 240], "tree": [48, 105, 132, 238], "treeview": 48, "Not": [48, 122], "yet": [48, 53, 107, 122, 162, 165], "progressind": [48, 132], "textinput": [48, 132, 136], "edit": [48, 136, 142, 229, 232, 234], "switch": [48, 113, 128, 132, 135, 139], "listitem": [48, 132], "item": [48, 53, 111, 112, 127, 136, 142, 145, 161], "scenario": 49, "occur": 49, "unsupport": [49, 134], "alreadyset": [49, 134], "There": 49, "alreadi": [49, 110, 157, 227, 235], "pencil": 50, "middl": [50, 132], "mani": [50, 112, 235], "center": [50, 133, 234, 238], "mode": [51, 100, 112, 126, 146, 162], "determin": [51, 100, 227], "quit": [51, 100, 234], "quitonlastwindowclos": [51, 100, 112], "rununtilquit": [51, 112], "keep": [51, 142, 229, 239], "nativeopengl": [52, 134], "opengl": [52, 53, 148], "renderingsetup": [53, 134], "beforerend": [53, 134], "afterrend": [53, 134], "gl": 53, "renderingteardown": [53, 134], "resourc": [53, 148], "due": [53, 233], "whether": [54, 110, 227], "hidewindow": [54, 134], "keepwindowshown": [54, 134], "reject": [54, 133], "kept": 54, "directori": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 227, 228, 233, 238], "program": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 172, 227, 228, 231], "cassert": [56, 110], "cstdint": [56, 62, 66, 69, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 110, 116, 120, 123, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "util": [56, 110, 227], "duration_until_next_timer_upd": [56, 102, 105, 110], "type_trait": [57, 111], "elementhandl": [57, 102, 107, 111, 145], "init": [57, 102, 107, 111, 112, 121, 136], "algorithm": [58, 68, 112, 122], "concept": [58, 112], "memori": [58, 67, 68, 112, 121, 122, 148, 158, 231, 239], "componentweakhandl": [58, 98, 102, 103, 112], "eventloopmod": [58, 100, 102, 103, 112], "blocking_invoke_from_event_loop": [58, 98, 102, 103, 112], "update_all_transl": [58, 102, 103, 112], "tupl": [60, 112, 114, 130, 240], "stdint": [61, 115], "sharedpixelbuff": [63, 102, 103, 117, 135, 148], "initializer_list": [65, 68, 109, 119, 122, 159, 165], "atom": [68, 122], "iostream": [71, 125, 127], "assert_eq": [71, 102, 125], "timer": [72, 93, 94, 102, 103, 126], "cstdarg": [74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "cstdlib": [74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "standardlistviewitem": [75, 102, 103, 129, 130, 142], "key_cod": [78, 102, 105, 132], "alt": [78, 102, 106, 130, 132], "altgr": [78, 102, 106, 132], "backspac": [78, 102, 106, 132], "backtab": [78, 102, 106, 132], "capslock": [78, 102, 106, 132], "controlr": [78, 102, 106, 132], "downarrow": [78, 102, 106, 132], "escap": [78, 102, 106, 132], "f1": [78, 102, 106, 132], "f10": [78, 102, 106, 132], "f11": [78, 102, 106, 132], "f12": [78, 102, 106, 132], "f13": [78, 102, 106, 132], "f14": [78, 102, 106, 132], "f15": [78, 102, 106, 132], "f16": [78, 102, 106, 132], "f17": [78, 102, 106, 132], "f18": [78, 102, 106, 132], "f19": [78, 102, 106, 132], "f2": [78, 102, 106, 132], "f20": [78, 102, 106, 132], "f21": [78, 102, 106, 132], "f22": [78, 102, 106, 132], "f23": [78, 102, 106, 132], "f24": [78, 102, 106, 132], "f3": [78, 102, 106, 132], "f4": [78, 102, 106, 132], "f5": [78, 102, 106, 132, 237], "f6": [78, 102, 106, 132], "f7": [78, 102, 106, 132], "f8": [78, 102, 106, 132], "f9": [78, 102, 106, 132], "leftarrow": [78, 102, 106, 132], "menu": [78, 102, 106, 132], "meta": [78, 102, 106, 130, 132], "metar": [78, 102, 106, 132], "pagedown": [78, 102, 106, 132], "pageup": [78, 102, 106, 132], "paus": [78, 102, 106, 132], "rightarrow": [78, 102, 106, 132], "scrolllock": [78, 102, 106, 132], "shift": [78, 102, 106, 130, 132, 167], "shiftr": [78, 102, 106, 132], "sysreq": [78, 102, 106, 132], "uparrow": [78, 102, 106, 132], "rgba8pixel": [80, 102, 103, 117, 134, 135, 148], "slint_feature_access": [80, 102, 134], "slint_feature_backend_linuxkm": [80, 102, 134], "slint_feature_backend_qt": [80, 102, 109, 134], "slint_feature_backend_winit": [80, 102, 134, 227], "slint_feature_experiment": [80, 102, 107, 110, 111, 134], "slint_feature_gettext": [80, 101, 102, 112, 134], "slint_feature_interpret": [80, 102, 109, 134], "slint_feature_renderer_femtovg": [80, 102, 134, 227], "slint_feature_renderer_skia": [80, 102, 110, 134, 227], "slint_feature_renderer_softwar": [80, 102, 110, 134], "slint_feature_system_test": [80, 102, 134], "slint_feature_test": [80, 102, 107, 111, 134], "slint_version_major": [80, 102, 134], "slint_version_minor": [80, 102, 134], "slint_version_patch": [80, 102, 134], "slint_version_str": [80, 102, 134], "diagnosticlevel": [83, 102, 104, 137, 163], "durat": [93, 126, 136, 146, 148, 162, 240], "pend": [93, 98, 99], "advanc": [94, 165, 166], "process": [94, 107, 227], "futur": [96, 234], "appear": 96, "termin": [97, 158, 234], "meant": [97, 106], "ui": [97, 98, 99, 104, 105, 107, 227, 228, 231, 232, 234, 237, 238], "immedi": 97, "add": [98, 122, 165, 227, 233, 234, 238], "queue": 98, "wake": 98, "woken": 98, "queu": 98, "statu": [98, 110], "network": 98, "my_application_ui": [98, 99, 231], "argc": [98, 99, 231], "char": [98, 99, 109, 111, 112, 115, 124, 125, 136, 144, 148, 158, 231, 240], "argv": [98, 99, 231], "networkstatusui": 98, "set_status_label": [98, 99], "weak_ui_handl": 98, "network_thread": 98, "read_message_blocking_from_network": 98, "see": [98, 103, 112, 157, 227, 233, 234, 237, 238], "block": [98, 99], "just": [99, 109, 112], "But": 99, "execut": [99, 227], "deadlock": 99, "forev": 99, "anoth": [99, 105, 148], "myapplicationui": 99, "worker_thread": 99, "get_messag": 99, "By": [100, 172, 227, 228, 234], "forc": 101, "tr": 101, "evalu": [101, 121], "my_ui": 101, "languageset": 101, "on_french_select": 101, "setenv": 101, "lang": 101, "l": [101, 112], "section": [102, 227, 229, 231, 232, 233, 236, 239], "header": [102, 118, 229, 231, 238], "choos": [102, 227, 238], "slintnamespac": 102, "interpreterstruct": 102, "diagnosticstruct": 102, "propertydescriptorstruct": 102, "structstruct": 102, "iteratorclass": 102, "componentcompilerclass": 102, "componentdefinitionclass": 102, "componentinstanceclass": 102, "valueenum": 102, "diagnosticlevelenum": 102, "valuetypenamespac": 102, "platformstruct": 102, "rgb565pixelclass": 102, "abstractrendererclass": 102, "nativewindowhandleclass": 102, "platformclass": 102, "taskclass": 102, "skiarendererclass": 102, "softwarerendererstruct": 102, "physicalregionstruct": 102, "rectclass": 102, "windowadapterstruct": 102, "windowpropertiesstruct": 102, "layoutconstraintsnamespac": 102, "testingclass": 102, "elementhandleenum": 102, "accessiblerolestruct": 102, "hsvacolorstruct": 102, "imagestruct": 102, "logicalpositionstruct": 102, "logicalsizestruct": 102, "physicalpositionstruct": 102, "physicalsizetempl": 102, "pointstruct": 102, "rgb8pixelstruct": 102, "rgba8pixeltempl": 102, "rgbacolortempl": 102, "sharedpixelbufferstruct": 102, "sharedstringtempl": 102, "sharedvectortempl": 102, "sizestruct": 102, "standardlistviewitemstruct": 102, "timerclass": 102, "brushclass": 102, "colortempl": 102, "componenthandletempl": 102, "componentweakhandletempl": 102, "filtermodeltempl": 102, "mapmodeltempl": 102, "modeltempl": 102, "reversemodeltempl": 102, "sortmodeltempl": 102, "vectormodelclass": 102, "windowenum": 102, "closerequestresponseenum": 102, "eventloopmodeenum": 102, "graphicsapienum": 102, "pointereventbuttonenum": 102, "renderingstateenum": 102, "apidirectori": 102, "cppdirectori": 102, "includefil": 102, "hfile": 102, "hdirectori": 102, "cppdocsdirectori": 102, "generated_includefil": 102, "detail": [102, 232, 234, 235, 237], "document": [102, 103, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 229, 234, 235, 236, 237], "nest": 102, "relationship": 102, "deriv": [102, 105], "overview": [103, 236], "design": [103, 232, 240], "its": [104, 157, 163], "pre": [104, 148, 227, 228, 234, 235, 237], "normal": [104, 133, 156], "wai": [104, 148, 227, 228, 232, 239], "come": [105, 227, 232, 235, 239], "built": [105, 227, 231, 239], "modul": [105, 107, 227, 237], "interact": [105, 136, 227, 232, 239], "environ": [105, 233, 234, 236], "microcontrol": [105, 236], "embed": [105, 227, 232], "plugin": 105, "found": [105, 228, 231], "repositori": 105, "http": [105, 112, 227, 231, 234, 238], "github": [105, 227, 231, 234, 238], "com": [105, 112, 227, 231, 238], "master": 105, "platform_n": 105, "platform_qt": 105, "blob": 105, "esp": [105, 233, 234, 236], "idf": [105, 234, 236], "src": [105, 129, 130, 132, 133, 234], "constant": [106, 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, 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], "special": [106, 112, 156], "printabl": 106, "experiment": [107, 227], "subject": 107, "stabil": 107, "ON": [107, 227, 235], "cmake": [107, 227, 231, 232, 233, 235, 236, 237, 238, 239], "page": 108, "copyright": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "sixtyfp": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "gmbh": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "info": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "dev": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "spdx": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "licens": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "identifi": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "gpl": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "OR": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "licenseref": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "royalti": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "pragma": [109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "ifndef": [109, 110, 112, 127], "ifdef": [109, 110, 111, 112], "endif": [109, 110, 111, 112, 115, 116, 117, 122, 127, 135, 138, 139, 227, 231, 234], "namespac": [109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172, 228, 235, 239], "cbindgen_priv": [109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146], "stai": 109, "eraseditemtreebox": [109, 138], "slint_interpreter_struct_new": [109, 138], "slint_interpreter_struct_clon": [109, 138], "slint_interpreter_struct_destructor": [109, 138], "inputiter": [109, 165], "doxygen": [109, 110, 112, 115, 116, 117, 122, 127], "understand": 109, "wizardri": 109, "enable_if_t": [109, 121], "is_convert": 109, "decltyp": [109, 112, 121], "declval": 109, "set_field": [109, 165], "fixm": [109, 112, 115], "probabl": 109, "miss": 109, "lot": 109, "value_typ": [109, 165, 166], "structiteratoropaqu": [109, 138], "k": [109, 138], "believ": 109, "suppos": [109, 231], "slint_interpreter_struct_make_it": [109, 138], "get_field": [109, 165], "structopaqu": [109, 138], "slint_interpreter_value_new": [109, 138], "slint_interpreter_value_clon": [109, 138], "slint_interpreter_value_destructor": [109, 138], "to_int": 109, "to_float": 109, "slint_interpreter_value_to_numb": [109, 138], "slint_interpreter_value_to_str": [109, 138], "slint_interpreter_value_to_bool": [109, 138], "slint_interpreter_value_to_brush": [109, 138], "opaque_struct": 109, "slint_interpreter_value_to_struct": [109, 138], "slint_interpreter_value_to_imag": [109, 138], "reinterpret_cast": [109, 110, 111, 112, 114, 117, 121, 122, 124, 126, 127, 144], "slint_interpreter_value_new_doubl": [109, 138], "static_cast": [109, 110, 112, 148], "slint_interpreter_value_new_str": [109, 138], "slint_interpreter_value_new_bool": [109, 138], "slint_interpreter_value_new_brush": [109, 138], "slint_interpreter_value_new_struct": [109, 138], "slint_interpreter_value_new_imag": [109, 138], "slint_interpreter_value_typ": [109, 138], "slint_interpreter_value_eq": [109, 138], "avoid": [109, 115, 125], "turn": [109, 227], "slint_interpreter_value_new_array_model": [109, 138], "slint_interpreter_value_to_arrai": [109, 138], "modeladaptorvt": [109, 138], "vref": [109, 112, 127, 135, 136, 138], "modelwrapp": 109, "modelchangelisten": [109, 112], "modelnotifyopaqu": [109, 138], "rust": [109, 110, 112, 234, 235], "slint_interpreter_model_notify_destructor": [109, 138], "slint_interpreter_model_notify_row_ad": [109, 138], "slint_interpreter_model_notify_row_chang": [109, 138], "slint_interpreter_model_notify_row_remov": [109, 138], "slint_interpreter_model_notify_reset": [109, 138], "wrapper": 109, "make_shar": [109, 112, 121], "slint_interpreter_model_notify_new": [109, 138], "attach_p": [109, 112], "uintptr_t": [109, 110, 135, 136, 137, 138, 139, 140, 141, 143, 144, 145, 146, 163], "has_valu": [109, 110, 111, 112], "rval": 109, "get_notifi": [109, 138], "vrefmut": [109, 112, 135, 136, 138], "vt": 109, "slint_interpreter_value_new_model": [109, 138], "name_view": 109, "const_cast": [109, 111, 112, 117, 121, 122, 124, 127, 144], "field_val": 109, "slint_interpreter_struct_get_field": [109, 138], "slint_interpreter_struct_set_field": [109, 138], "name_slic": 109, "nextval_inn": 109, "slint_interpreter_struct_iterator_next": [109, 138], "ptr": [109, 112, 122, 135, 136, 143, 144], "len": [109, 112, 122, 127, 136, 144], "slint_interpreter_struct_iterator_destructor": [109, 138], "fact": 109, "assert_main_thread": [109, 110, 112, 127], "slint_interpreter_component_instance_show": [109, 138], "windowadapterrcopaqu": [109, 110, 112, 127, 136, 138, 140], "win_ptr": 109, "slint_interpreter_component_instance_window": [109, 138], "wid": 109, "slint_qt_get_widget": [109, 142], "windowadapterrc": [109, 127, 136, 142], "slint_interpreter_component_instance_set_properti": [109, 138], "string_to_slic": [109, 124], "prop_inn": 109, "slint_interpreter_component_instance_get_properti": [109, 138], "args_view": 109, "rval_inn": 109, "slint_interpreter_component_instance_invok": [109, 138], "is_convertible_v": [109, 127], "actual_cb": [109, 127], "slint_interpreter_component_instance_set_callback": [109, 138], "slint_interpreter_component_instance_set_global_properti": [109, 138], "slint_interpreter_component_instance_get_global_properti": [109, 138], "slint_interpreter_component_instance_set_global_callback": [109, 138], "slint_interpreter_component_instance_invoke_glob": [109, 138], "componentdefinitionopaqu": [109, 138], "slint_interpreter_component_definition_clon": [109, 138], "slint_interpreter_component_definition_destructor": [109, 138], "union": [109, 111, 128, 135, 136, 139], "ci": 109, "u": [109, 110, 112, 136], "slint_interpreter_component_instance_cr": [109, 138], "prop": [109, 138], "slint_interpreter_component_definition_properti": [109, 138], "slint_interpreter_component_definition_callback": [109, 138], "slint_interpreter_component_definition_funct": [109, 138], "slint_interpreter_component_definition_nam": [109, 138], "slint_interpreter_component_definition_glob": [109, 138], "slint_interpreter_component_definition_global_properti": [109, 138], "slint_interpreter_component_definition_global_callback": [109, 138], "slint_interpreter_component_definition_global_funct": [109, 138], "slint_interpreter_component_instance_component_definit": [109, 138], "componentcompileropaqu": [109, 138], "slint_interpreter_component_compiler_new": [109, 138], "slint_interpreter_component_compiler_destructor": [109, 138], "slint_interpreter_component_compiler_set_include_path": [109, 138], "slint_interpreter_component_compiler_set_styl": [109, 138], "slint_interpreter_component_compiler_get_styl": [109, 138], "slint_interpreter_component_compiler_set_translation_domain": [109, 138], "slint_interpreter_component_compiler_get_include_path": [109, 138], "slint_interpreter_component_compiler_get_diagnost": [109, 138], "slint_interpreter_component_compiler_build_from_sourc": [109, 138], "slint_interpreter_component_compiler_build_from_path": [109, 138], "send_keyboard_string_sequ": [109, 125, 136], "__apple__": [110, 112], "_win32": [110, 112, 116], "_win64": [110, 112, 116], "__objc__": 110, "typedef": [110, 165, 166], "objc_object": 110, "rendererptr": [110, 140], "renderer_handl": 110, "was_initi": 110, "slint_window_adapter_new": [110, 140], "intsiz": [110, 135, 136, 140], "p": [110, 112, 120, 127, 140, 149, 151], "point2d": [110, 120, 136, 140], "int32_t": [110, 120, 121, 130, 135, 136, 140, 141, 142, 151], "out": [110, 131, 136, 138, 139, 140, 141, 144, 145, 159, 229, 231, 232, 234, 235, 237], "slint_window_properties_get_titl": [110, 140], "slint_window_properties_get_background": [110, 140], "renam": [110, 118], "slint_window_properties_get_fullscreen": [110, 140], "slint_window_properties_get_minim": [110, 140], "slint_window_properties_get_maxim": [110, 140], "lc": 110, "slint_window_properties_get_layout_constraint": [110, 140], "has_min": [110, 140], "has_max": [110, 140], "abort": [110, 112, 125, 127, 133], "platformtaskopaqu": [110, 140], "_0": [110, 112, 113, 121, 127, 128, 135, 136, 138, 139, 140, 141], "slint_platform_task_drop": [110, 140], "assert": 110, "form": [110, 229, 239], "slint_platform_task_run": [110, 140], "slint_platform_regist": [110, 140], "w": [110, 112], "maybe_unus": [110, 112], "uint64_t": [110, 112, 121, 125, 126, 130, 135, 136, 138, 140, 141, 146], "out_text": 110, "maybe_clipboard": 110, "uint16_t": [110, 135, 136, 140, 167, 234], "g": [110, 134, 154, 155, 167, 227], "6": [110, 135, 138, 142, 167, 227], "constexpr": [110, 111, 112, 123, 125, 132, 136, 142, 144, 150, 152, 167, 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, 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], "4": [110, 112, 135, 136, 138, 142, 237], "mutabl": [110, 112, 121], "softwarerendereropaqu": [110, 140], "slint_software_renderer_handl": [110, 140], "intrect": [110, 135, 136, 140], "slint_software_renderer_region_to_rect": [110, 140], "__cpp_lib_rang": 110, "202110l": 110, "dr20": 110, "p2415r2": 110, "owning_view": 110, "view_interfac": 110, "slint_software_renderer_drop": [110, 140], "slint_software_renderer_new": [110, 140], "slint_software_renderer_render_rgb8": [110, 140], "slint_software_renderer_render_rgb565": [110, 140], "slint_software_renderer_render_by_line_rgb565": [110, 140], "process_line_callback_ptr": 110, "line_start": 110, "line_end": 110, "render_fn_data": 110, "line_span": 110, "270": [110, 142], "slint_software_renderer_set_rendering_rot": [110, 140], "cpprawhandleopaqu": [110, 140], "slint_raw_window_handle_drop": [110, 140], "slint_new_raw_window_handle_x11_xcb": [110, 140], "slint_new_raw_window_handle_x11_xlib": [110, 140], "slint_new_raw_window_handle_wayland": [110, 140], "slint_new_raw_window_handle_appkit": [110, 140], "slint_new_raw_window_handle_win32": [110, 140], "skiarendereropaqu": [110, 140], "slint_skia_renderer_handl": [110, 140], "slint_skia_renderer_drop": [110, 140], "slint_skia_renderer_new": [110, 140], "slint_skia_renderer_rend": [110, 140], "slint_platform_update_timers_and_anim": [110, 140], "val": [110, 136, 138, 141], "slint_platform_duration_until_next_timer_upd": [110, 140], "numeric_limit": [110, 112], "slint_testing_init_backend": [111, 145], "is_constructible_v": 111, "is_default_constructible_v": 111, "is_void_v": [111, 112], "slint_testing_element_visit_el": [111, 145], "visitorandresult": 111, "visitor_and_result": 111, "user_data": [111, 114, 121, 127, 136, 138, 140, 141, 145, 146], "label_view": 111, "slint_testing_element_find_by_accessible_label": [111, 145], "element_id_view": 111, "slint_testing_element_find_by_element_id": [111, 145], "element_type_name_view": 111, "slint_testing_element_find_by_element_type_nam": [111, 145], "upgrade_item_weak": [111, 112], "slint_testing_element_id": [111, 145], "slint_testing_element_type_nam": [111, 145], "slint_testing_element_bas": [111, 145], "element_index": [111, 145], "item_tre": [111, 112, 136], "borrow": [111, 148], "get_accessible_string_properti": 111, "accessiblestringproperti": [111, 136], "placeholdertext": [111, 136], "valuemaximum": [111, 136], "slint_string_to_float": [111, 140], "valueminimum": [111, 136], "valuestep": [111, 136], "setvaluehelp": 111, "accessibilityact": [111, 136], "set_valu": [111, 136], "setvalue_bodi": [111, 136], "tag": [111, 112, 113, 117, 119, 127, 128, 135, 136, 139], "setvalu": [111, 136], "accessibility_act": [111, 136], "increaseactionhelp": 111, "decreaseactionhelp": 111, "defaultactionhelp": 111, "item_geometri": [111, 136], "logicalrect": [111, 136], "logicalpoint": [111, 136], "ab": 111, "slint_item_absolute_posit": [111, 136], "accessible_string_properti": [111, 136], "__gnuc__": [112, 116], "__clang__": 112, "17": [112, 142, 165, 166], "condition": 112, "care": [112, 228], "gcc": 112, "ignor": [112, 126, 133], "winvalid": 112, "offsetof": 112, "mutex": 112, "condition_vari": 112, "bring": 112, "structur": [112, 153, 160, 164, 165, 228], "scope": [112, 229, 239], "itemtreeref": [112, 136], "indexrang": [112, 136], "itemref": 112, "itemvt": [112, 136, 142], "itemvisitorrefmut": 112, "itemvisitorvt": [112, 136], "itemtreenod": [112, 136], "itemarrayentri": 112, "voffset": [112, 136], "allowpin": [112, 136], "itemarrai": [112, 127], "make_item_nod": 112, "child_count": 112, "child_index": 112, "parent_index": [112, 136], "item_array_index": [112, 136], "is_access": [112, 136], "item_bodi": [112, 136], "make_dyn_nod": 112, "offset": 112, "dynamictree_bodi": [112, 136], "dynamictre": [112, 136], "get_item_ref": [112, 136], "item_tree_arrai": [112, 136], "item_arrai": [112, 136], "convert_anonymous_rect": 112, "alphabet": [112, 240], "dealloc": [112, 135, 136], "__cpp_sized_dealloc": 112, "align_val_t": 112, "align": [112, 136, 143, 234, 238], "elif": [112, 116], "mac_os_x_version_min_requir": 112, "mac_os_x_version_10_14": 112, "drop_in_plac": [112, 135, 136], "sizeof": [112, 122, 144, 234], "alignof": [112, 122], "cross": [112, 235, 236], "dll": [112, 231], "reloc": 112, "doc": 112, "microsoft": 112, "en": 112, "rule": 112, "dllimport": [112, 116], "dllexport": 112, "msvc": [112, 227], "160": [112, 142], "address": 112, "seek": 112, "That": [112, 231], "resolv": 112, "stub": 112, "librari": [112, 159, 227, 228, 231, 232, 235, 238], "slint_get_item_vt": 112, "vtablenam": 112, "slint_get_": [112, 136, 142], "itemrc": [112, 127, 136], "itemweak": [112, 136, 145], "item_weak": 112, "item_tree_strong": 112, "debug": [112, 237], "slint_debug": [112, 140], "vweak": [112, 136], "layoutinfo": [112, 136], "merg": [112, 136], "duplic": [112, 142], "max_perc": [112, 136], "min_perc": [112, 136], "stretch": [112, 133, 136], "easingcurv": [112, 136], "cubicbezi": [112, 136], "cubic_bezi": [112, 136], "register_item_tre": 112, "maybe_window": 112, "window_ptr": 112, "slint_register_item_tre": [112, 136], "solve_box_layout": 112, "boxlayoutdata": [112, 136], "repeater_index": [112, 136], "ri": 112, "slint_solve_box_layout": [112, 136], "solve_grid_layout": 112, "gridlayoutdata": [112, 136], "slint_solve_grid_layout": [112, 136], "grid_layout_info": 112, "gridlayoutcelldata": [112, 136], "cell": [112, 136], "pad": [112, 122, 136], "slint_grid_layout_info": [112, 136], "box_layout_info": 112, "boxlayoutcelldata": [112, 136], "layoutalign": [112, 133, 136, 142], "slint_box_layout_info": [112, 136], "box_layout_info_ortho": 112, "slint_box_layout_info_ortho": [112, 136], "layout_cache_access": 112, "idx": 112, "modelp": 112, "weak_ptr": 112, "access_array_index": 112, "row_data_track": 112, "model_length": 112, "track_row_count_chang": 112, "cerr": [112, 125, 127], "endl": [112, 125, 127], "peer": 112, "model_row_count_dirty_properti": 112, "track_row_data_chang": 112, "lower_bound": 112, "tracked_row": 112, "model_row_data_dirty_properti": 112, "binary_search": 112, "mark_dirti": [112, 121], "for_each_p": 112, "remove_if": 112, "pp": 112, "arraymodel": 112, "our": [112, 229, 231, 232, 237, 238], "uintmodel": 112, "d": [112, 121, 136, 231], "target_model": 112, "filtered_rows_dirti": 112, "added_accepted_row": 112, "insertion_point": 112, "accepted_row": 112, "existing_row": 112, "existing_row_index": 112, "distanc": [112, 122], "is_contain": 112, "accepted_updated_row": 112, "mapped_row_start": 112, "mapped_row_end": 112, "mapped_removed_len": 112, "mapped_removed_index": 112, "update_map": 112, "source_data": 112, "first_inserted_row": 112, "sorted_rows_dirti": 112, "adjust": [112, 234, 238], "indic": 112, "sorted_row": 112, "inserted_valu": 112, "sorted_elem": 112, "changed_row": 112, "removed_row_it": 112, "removed_row": 112, "changed_valu": 112, "inserted_row": 112, "first_removed_row": 112, "ensure_sort": 112, "lhs_index": 112, "rhs_index": 112, "lhs_elem": 112, "rhs_elem": 112, "old_row_count": 112, "repeaterinn": 112, "clean": 112, "repeatedinstancewithst": 112, "is_dirti": [112, 121], "update_data": 112, "set_model_bind": 112, "bind": [112, 114, 121, 136, 141, 232], "set_bind": [112, 121], "ensure_upd": 112, "tracker": 112, "ensure_updated_listview": 112, "viewport_width": [112, 136], "viewport_height": [112, 136], "viewport_i": [112, 136], "listview_width": 112, "listview_height": 112, "todo": 112, "try": 112, "alloc": [112, 233, 234], "compute_layout_listview": 112, "traversalord": [112, 136], "backtofront": [112, 136], "ref": 112, "item_at": 112, "visit_children_item": [112, 136], "static_vt": [112, 127], "instance_at": 112, "index_rang": 112, "listview_layout": 112, "model_set_row_data": 112, "plural": [112, 136], "slint_transl": [112, 136], "slint_translations_mark_dirti": [112, 136], "flickabl": [112, 136], "slint_flickable_data_init": [112, 136], "slint_flickable_data_fre": [112, 136], "nativestylemetr": [112, 142], "slint_native_style_metrics_init": [112, 142], "slint_native_style_metrics_deinit": [112, 142], "nativepalett": [112, 142], "slint_native_palette_init": [112, 142], "slint_native_palette_deinit": [112, 142], "mismatch": 112, "versioncheckhelp": 112, "slint_run_event_loop": [112, 140], "slint_quit_event_loop": [112, 140], "slint_post_ev": [112, 140], "mtx": 112, "cv": 112, "unique_lock": 112, "notify_on": 112, "wait": [112, 133], "clang": [112, 127], "format": [112, 127, 135, 136, 148, 158], "off": [112, 127, 227, 235], "gradientstop": [113, 115, 128], "firststop": 113, "stopcount": 113, "make_linear_gradi": 113, "fake": 113, "stopsbegin": 113, "stopsend": 113, "radialgradientbrush": [113, 128], "make_circle_gradi": 113, "lineargradi": [113, 128], "radialgradi": [113, 128], "nodiscard": [113, 115, 117], "solid_color": [113, 128], "break": [113, 128, 135, 139], "linear_gradi": [113, 128], "radial_gradi": [113, 128], "slint_color_bright": [113, 115, 131], "slint_color_dark": [113, 115, 131], "slint_color_transparent": [113, 115, 131], "slint_color_with_alpha": [113, 115, 131], "set_animated_valu": [113, 115, 121], "new_valu": [113, 115, 121], "propertyanim": [113, 115, 121, 136, 141], "animation_data": [113, 115, 121, 136, 141], "slint_property_set_animated_value_brush": [113, 136, 141], "ret": [114, 115, 136, 141], "slint_callback_init": [114, 136, 141], "slint_callback_drop": [114, 136, 141], "set_handl": 114, "slint_callback_set_handl": [114, 136, 141], "slint_callback_cal": [114, 136, 141], "callbackopaqu": [114, 136, 141], "0x1": 114, "callbacksignaturehelp": 114, "callbackhelp": [114, 136, 142], "satur": [115, 147], "16": [115, 142, 227], "0xff": 115, "24": [115, 142], "slint_color_from_hsva": [115, 131], "slint_color_to_hsva": [115, 131], "cast": [115, 125], "argb": 115, "slint_color_mix": [115, 131], "slint_property_set_animated_value_color": [115, 136, 141], "uintptr_max": 116, "0xffffffff": 116, "slint_target_32": [116, 138], "0xffffffffffffffffu": 116, "slint_target_64": [116, 138], "_msc_ver": 116, "slint_dll_import": [116, 136, 142], "__declspec": 116, "__attribute__": 116, "m_width": 117, "m_height": 117, "m_data": 117, "cbegin": [117, 122, 157, 159], "cend": [117, 122, 157, 159], "borrowedopengltextureorigin": [117, 135, 148], "topleft": [117, 135, 148], "bottomleft": [117, 135, 148], "imageinner_non": [117, 135], "load_from_path": [117, 148], "file_path": [117, 148], "slint_image_load_from_path": [117, 135], "create_from_borrowed_gl_2d_rgba_textur": [117, 148], "texture_id": [117, 135, 148], "origin_priv": 117, "imageinner_borrowedopengltextur": [117, 135], "borrowedopengltextur": [117, 135], "imageinner_embeddedimag": [117, 135], "imagecachekei": [117, 135], "invalid": [117, 135, 148, 165, 166], "sharedimagebuff": [117, 135], "rgb8": [117, 135], "rgba8": [117, 135], "slint_image_s": [117, 135], "slint_image_path": [117, 135], "set_nine_slice_edg": [117, 148], "short": [117, 148], "bottom": [117, 133, 135, 148], "slint_image_set_nine_slice_edg": [117, 135], "to_rgb8": [117, 148], "slint_image_to_rgb8": [117, 135], "to_rgba8": [117, 148], "slint_image_to_rgba8": [117, 135], "to_rgba8_premultipli": [117, 148], "slint_image_to_rgba8_premultipli": [117, 135], "slint_image_compare_equ": [117, 135], "imageinn": [117, 135], "load_image_from_embedded_data": 117, "extens": [117, 232, 237, 238], "slint_image_load_from_embedded_data": [117, 135], "image_from_embedded_textur": 117, "statictextur": [117, 135], "textur": [117, 135, 148], "slint_image_from_embedded_textur": [117, 135], "pathev": [119, 133, 139], "patharcto": [119, 139], "pathcubicto": [119, 139], "pathel": [119, 139], "pathlineto": [119, 139], "pathmoveto": [119, 139], "pathquadraticto": [119, 139], "pathdata": [119, 136, 139], "firstel": 119, "elements_from_arrai": 119, "firstev": 119, "event_count": [119, 139], "firstcoordin": 119, "coordinate_count": [119, 139], "events_from_arrai": 119, "command": [119, 139, 227, 231, 232, 233, 234, 235, 237, 238, 239], "tmp": 119, "slint_new_path_el": [119, 139], "slint_new_path_ev": [119, 139], "euclid": [120, 123], "crate": [120, 123], "binari": [120, 123, 228, 231, 234, 238], "compat": [120, 123], "changetrack": [121, 136, 141], "stateinfo": [121, 130], "slint_property_set_animated_binding_help": 121, "propertyhandleopaqu": [121, 136, 141], "drop_user_data": [121, 136, 138, 140, 141, 146], "transition_data": [121, 136, 141], "slint_property_set_animated_binding_int": [121, 136, 141], "slint_property_set_animated_binding_float": [121, 136, 141], "slint_property_set_animated_binding_color": [121, 136, 141], "slint_property_set_animated_binding_brush": [121, 136, 141], "slint_property_init": [121, 136, 141], "slint_property_drop": [121, 136, 141], "implicit": [121, 158, 159], "0b10": 121, "slint_property_set_chang": [121, 136, 141], "slint_property_upd": [121, 136, 141], "slint_property_set_bind": [121, 136, 141], "set_animated_bind": 121, "tran": 121, "set_animated_binding_for_transit": 121, "userdata": 121, "instant": 121, "slint_property_is_dirti": [121, 136, 141], "slint_property_mark_dirti": [121, 136, 141], "link_two_wai": 121, "p1": 121, "p2": 121, "common_properti": 121, "twowaybind": 121, "del_fn": 121, "call_fn": 121, "intercept_fn": 121, "intercept_binding_fn": 121, "slint_property_set_binding_intern": [121, 136, 141], "set_state_bind": 121, "slint_property_set_animated_value_int": [121, 136, 141], "slint_property_set_animated_value_float": [121, 136, 141], "slint_property_set_state_bind": [121, 136, 141], "propertytrack": 121, "slint_property_tracker_init": [121, 136, 141], "slint_property_tracker_drop": [121, 136, 141], "slint_property_tracker_is_dirti": [121, 136, 141], "is_same_v": 121, "slint_property_tracker_evalu": [121, 136, 141], "evaluate_as_dependency_root": 121, "slint_property_tracker_evaluate_as_dependency_root": [121, 136, 141], "propertytrackeropaqu": [121, 136, 141], "slint_change_tracker_construct": [121, 136, 141], "slint_change_tracker_drop": [121, 136, 141], "fneval": 121, "fnnotifi": 121, "fn_eval": 121, "fn_notifi": 121, "data_ptr": 121, "slint_change_tracker_init": [121, 136, 141], "sharedvectorhead": 122, "slint_shared_vector_empti": [122, 136, 143], "with_capac": 122, "new_data": 122, "input_it": 122, "inputit": [122, 159], "uninitialized_copi": 122, "capac": [122, 159], "refcount": 122, "detach": 122, "expected_capac": 122, "new_arrai": 122, "old_data": 122, "slint_shared_vector_fre": [122, 136, 143], "mem": 122, "slint_shared_vector_alloc": [122, 136, 143], "unfortun": 122, "cbindgen": [122, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "understood": 122, "intptr_t": [122, 136], "static_assert": 122, "size2d": [123, 135, 136], "slint_shared_string_from_byt": [124, 136, 144], "char8_t": [124, 158], "u8string_view": [124, 132, 158, 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, 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], "slint_shared_string_clon": [124, 136, 144], "slint_shared_string_drop": [124, 136, 144], "slint_shared_string_byt": [124, 136, 144], "starts_with": [124, 158], "prefix": [124, 158, 165, 166, 227], "substr": 124, "ends_with": [124, 158], "self_view": 124, "compar": [124, 125, 153, 157, 159, 160, 165, 166], "npo": 124, "from_numb": [124, 158], "shared_str": [124, 158], "a2": 124, "slint_shared_string_append": [124, 136, 144], "slint_shared_string_from_numb": [124, 136, 144], "mock_elapsed_tim": 125, "int64_t": [125, 240], "time_in_m": [125, 136], "slint_mock_elapsed_tim": [125, 136], "get_mocked_tim": 125, "slint_get_mocked_tim": [125, 136], "send_mouse_click": 125, "slint_send_mouse_click": [125, 136], "send_keyboard_char": 125, "slint_send_keyboard_char": [125, 136], "assert_eq_impl": 125, "__file__": 125, "__line__": 125, "equality_comparable_with": 125, "a_str": 125, "b_str": 125, "nok": 125, "is_integral_v": 125, "common": [125, 229, 231, 239], "sign": [125, 228, 240], "common_type_t": 125, "is_floating_point_v": 125, "depsilon": 125, "000001": 125, "small": 125, "fab": 125, "fail": 125, "cspell": 126, "singleshot": [126, 146], "timermod": [126, 146, 162], "interv": [126, 162], "slint_timer_start": [126, 146], "slint_timer_destroi": [126, 146], "slint_timer_stop": [126, 146], "restart": [126, 162], "slint_timer_restart": [126, 146], "slint_timer_run": [126, 146], "slint_timer_interv": [126, 136, 146], "single_shot": [126, 162], "slint_timer_singleshot": [126, 146], "ndebug": 127, "main_thread_id": 127, "this_thread": 127, "get_id": 127, "most": [127, 148, 227, 235], "itemtreerc": [127, 136, 145], "adopted_inn": 127, "slint_windowrc_clon": [127, 136], "slint_windowrc_init": [127, 140], "slint_windowrc_drop": [127, 136], "slint_windowrc_show": [127, 136], "slint_windowrc_hid": [127, 136], "slint_windowrc_is_vis": [127, 136], "slint_windowrc_get_scale_factor": [127, 136], "set_scale_factor": 127, "slint_windowrc_set_scale_factor": [127, 136], "colorschem": [127, 133, 136, 142], "color_schem": [127, 142], "slint_windowrc_color_schem": [127, 136], "text_input_focus": 127, "slint_windowrc_get_text_input_focus": [127, 136], "set_text_input_focus": 127, "slint_windowrc_set_text_input_focus": [127, 136], "unregister_item_tre": 127, "slint_unregister_item_tre": [127, 136], "set_focus_item": 127, "component_rc": 127, "item_index": [127, 136], "set_focu": [127, 136], "item_rc": 127, "slint_windowrc_set_focus_item": [127, 136], "set_compon": 127, "itemtreeweak": [127, 136], "item_tree_rc": [127, 136], "slint_windowrc_set_compon": [127, 136], "posgett": 127, "show_popup": 127, "parent_compon": 127, "close_on_click": [127, 136], "parent_item": [127, 136], "popup": [127, 136], "popup_dyn": 127, "slint_windowrc_show_popup": [127, 136], "close_popup": 127, "slint_windowrc_close_popup": [127, 136], "graphics_api": [127, 136], "err": 127, "slint_windowrc_set_rendering_notifi": [127, 136], "slint_windowrc_on_close_request": [127, 136], "slint_windowrc_request_redraw": [127, 136], "slint_windowrc_posit": [127, 136], "set_logical_posit": 127, "slint_windowrc_set_logical_posit": [127, 136], "set_physical_posit": 127, "slint_windowrc_set_physical_posit": [127, 136], "slint_windowrc_s": [127, 136], "set_logical_s": 127, "slint_windowrc_set_logical_s": [127, 136], "set_physical_s": 127, "slint_windowrc_set_physical_s": [127, 136], "dispatch_pointer_ev": 127, "mouseev": [127, 136], "slint_windowrc_dispatch_pointer_ev": [127, 136], "register_font_from_path": 127, "maybe_err": 127, "slint_register_font_from_path": [127, 140], "register_font_from_data": 127, "slint_register_font_from_data": [127, 140], "register_bitmap_font": 127, "bitmapfont": [127, 136, 140], "font": [127, 228, 234, 235, 238, 240], "slint_register_bitmap_font": [127, 140], "default_font_s": [127, 136, 142], "slint_windowrc_default_font_s": [127, 136], "windowrc": 127, "slint_windowrc_is_fullscreen": [127, 136], "slint_windowrc_set_fullscreen": [127, 136], "slint_windowrc_is_maxim": [127, 136], "slint_windowrc_set_maxim": [127, 136], "slint_windowrc_is_minim": [127, 136], "slint_windowrc_set_minim": [127, 136], "slint_windowrc_dispatch_key_ev": [127, 136], "keyeventtyp": [127, 130, 136], "keypress": [127, 136], "keyreleas": [127, 136], "pressed_bodi": [127, 136], "click_count": [127, 136], "released_bodi": [127, 136], "moved_bodi": [127, 136], "wheel_bodi": [127, 136], "windowev": [127, 136], "resized_bodi": [127, 136], "slint_windowrc_dispatch_ev": [127, 136], "scale_factor_chang": [127, 136], "scalefactorchanged_bodi": [127, 136], "scalefactorchang": [127, 136], "window_active_chang": [127, 136], "windowactivechanged_bodi": [127, 136], "windowactivechang": [127, 136], "closerequest": [127, 136], "slint_windowrc_has_active_anim": [127, 140], "26": [128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "solidcolor_bodi": 128, "lineargradient_bodi": 128, "radialgradient_bodi": 128, "issolidcolor": 128, "islineargradi": 128, "isradialgradi": 128, "xtask": [129, 130, 132, 133], "keyboardmodifi": 130, "pointerev": [130, 136], "pointereventkind": [130, 133], "modifi": [130, 238], "pointerscrollev": [130, 136], "keyev": [130, 136], "event_typ": [130, 136], "replacement_rang": 130, "preedit_text": [130, 136], "preedit_select": [130, 136], "cursor_posit": 130, "anchor_posit": 130, "tablecolumn": [130, 142], "min_width": 130, "horizontal_stretch": 130, "sortord": [130, 133], "sort_ord": 130, "current_st": 130, "previous_st": 130, "change_tim": 130, "fontmetr": [130, 136], "ascent": [130, 136], "descent": [130, 136], "x_height": [130, 136], "cap_height": [130, 136], "col1": 131, "col2": 131, "u0008": [132, 194], "u0009": [132, 221], "u000a": [132, 211], "u001b": [132, 216], "u0019": [132, 213], "u007f": [132, 224], "u0010": [132, 225], "u0011": [132, 208], "u0012": [132, 186], "u0013": [132, 185], "u0014": [132, 175], "u0015": [132, 223], "u0016": [132, 210], "u0017": [132, 197], "u0018": [132, 179], "u0020": [132, 176], "uf700": [132, 200], "uf701": [132, 184], "uf702": [132, 178], "uf703": [132, 215], "uf704": [132, 174], "uf705": [132, 202], "uf706": [132, 207], "uf707": [132, 181], "uf708": [132, 195], "uf709": [132, 196], "uf70a": [132, 212], "uf70b": [132, 203], "uf70c": [132, 198], "uf70d": [132, 201], "uf70": [132, 206], "uf70f": [132, 182], "uf710": [132, 191], "uf711": [132, 193], "uf712": [132, 192], "uf713": [132, 209], "uf714": [132, 219], "uf715": [132, 204], "uf716": [132, 189], "uf717": [132, 199], "uf718": [132, 218], "uf719": [132, 226], "uf71a": [132, 187], "uf71b": [132, 173], "uf727": [132, 183], "uf729": [132, 214], "uf72b": [132, 222], "uf72c": [132, 220], "uf72d": [132, 205], "uf72f": [132, 190], "uf730": [132, 180], "uf731": [132, 217], "uf734": [132, 188], "uf735": [132, 177], "texthorizontalalign": [133, 136], "textverticalalign": [133, 136], "textwrap": [133, 136], "nowrap": 133, "wordwrap": 133, "charwrap": 133, "textoverflow": [133, 136], "clip": [133, 136], "elid": 133, "textstrokestyl": [133, 136], "outsid": 133, "eventresult": [133, 136], "fillrul": [133, 136], "nonzero": 133, "evenodd": 133, "standardbuttonkind": [133, 142], "cancel": [133, 136], "help": [133, 227, 239], "ye": 133, "retri": 133, "dialogbuttonrol": [133, 136], "mousecursor": [133, 136], "progress": [133, 142], "crosshair": 133, "nodrop": 133, "notallow": 133, "grab": [133, 136], "colres": 133, "rowres": 133, "nresiz": 133, "eres": 133, "sresiz": 133, "wresiz": 133, "neres": 133, "nwresiz": 133, "seres": 133, "swresiz": 133, "ewres": 133, "nsresiz": 133, "neswres": 133, "nwseres": 133, "imagefit": [133, 136], "cover": [133, 231], "preserv": 133, "imagehorizontalalign": [133, 136], "imageverticalalign": [133, 136], "imagerend": [133, 136], "smooth": 133, "imagetil": [133, 136], "round": 133, "inputtyp": [133, 136, 142], "password": 133, "decim": 133, "spacebetween": 133, "spacearound": 133, "quadrat": 133, "cubic": 133, "endopen": 133, "endclos": 133, "unsort": 133, "ascend": 133, "descend": 133, "orient": [133, 136, 142, 238], "horizont": [133, 234, 238], "vertic": [133, 148], "unknown": [133, 227], "dark": 133, "light": 133, "animationdirect": [133, 136], "altern": [133, 227, 234], "alternaterevers": 133, "9": [134, 142, 148], "parsedsvg": 135, "htmlimag": 135, "ninesliceimag": 135, "pixelformat": 135, "rgba": [135, 148, 155], "rgbapremultipli": 135, "alphamap": 135, "cachedpath": 135, "last_modifi": 135, "slint_target_wasm": [135, 139], "url": [135, 228], "embeddeddata": 135, "path_bodi": 135, "url_bodi": 135, "embeddeddata_bodi": 135, "embedded_data": 135, "isinvalid": 135, "ispath": 135, "isurl": 135, "isembeddeddata": 135, "rgba8premultipli": 135, "rgb8_bodi": 135, "rgba8_bodi": 135, "rgba8premultiplied_bodi": 135, "rgba8_premultipli": 135, "isrgb8": 135, "isrgba8": 135, "isrgba8premultipli": 135, "opaqueimagevt": 135, "cache_kei": 135, "original_s": 135, "imageinner_svg": 135, "imageinner_statictextur": 135, "imageinner_htmlimag": 135, "imageinner_backendstorag": 135, "imageinner_nineslic": 135, "7": [135, 142], "imageinner_embeddedimage_bodi": 135, "imageinner_svg_bodi": 135, "imageinner_statictextures_bodi": 135, "imageinner_htmlimage_bodi": 135, "imageinner_backendstorage_bodi": 135, "imageinner_borrowedopengltexture_bodi": 135, "imageinner_nineslice_bodi": 135, "embedded_imag": 135, "svg": 135, "static_textur": 135, "html_imag": 135, "backend_storag": 135, "borrowed_open_gl_textur": 135, "nine_slic": 135, "isimageinner_non": 135, "isimageinner_embeddedimag": 135, "isimageinner_svg": 135, "isimageinner_statictextur": 135, "isimageinner_htmlimag": 135, "isimageinner_backendstorag": 135, "isimageinner_borrowedopengltextur": 135, "isimageinner_nineslic": 135, "image1": 135, "image2": 135, "logicallength": [136, 142], "physical_region_max_s": 136, "delegatefocu": 136, "focusev": 136, "focusin": 136, "focusout": 136, "windowreceivedfocu": 136, "windowlostfocu": 136, "focuseventresult": 136, "focusaccept": 136, "focusignor": 136, "inputeventresult": 136, "eventaccept": 136, "eventignor": 136, "grabmous": 136, "keyeventresult": 136, "updatecomposit": 136, "commitcomposit": 136, "renderingresult": 136, "continuerenderingchildren": 136, "continuerenderingwithoutchildren": 136, "fronttoback": 136, "undoitemkind": 136, "textinsert": 136, "textremov": 136, "flickabledata": 136, "itemrendererref": 136, "physicalpx": 136, "visitchildrenresult": 136, "visitchildrenresult_continu": 136, "uint64_max": 136, "inputeventfilterresult": 136, "forwardev": 136, "forwardandignor": 136, "forwardandinterceptgrab": 136, "intercept": 136, "delayforward": 136, "delayforwarding_bodi": 136, "delay_forward": 136, "pin": [136, 142], "my_item": 136, "cached_rendering_data_offset": 136, "layout_info": 136, "window_adapt": [136, 142], "input_event_filter_before_children": 136, "self_rc": 136, "input_ev": 136, "focus_ev": 136, "key_ev": 136, "visit_item": 136, "children_count": 136, "children_index": 136, "dynamic_tre": 136, "replaceselectedtext": 136, "replaceselectedtext_bodi": 136, "replace_selected_text": 136, "supportedaccessibilityact": 136, "supportedaccessibilityaction_default": 136, "supportedaccessibilityaction_decr": 136, "supportedaccessibilityaction_incr": 136, "supportedaccessibilityaction_replaceselectedtext": 136, "supportedaccessibilityaction_setvalu": 136, "get_subtree_rang": 136, "get_subtre": 136, "subindex": 136, "get_item_tre": 136, "parent_nod": 136, "embed_compon": 136, "parent_item_tree_index": 136, "subtree_index": 136, "supported_accessibility_act": 136, "item_element_info": 136, "do_creat": 136, "_1": [136, 139, 140, 141], "itemtreerefpin": 136, "flickabledatabox": 136, "preeditselect": 136, "cachedrenderingdata": [136, 142], "cache_index": 136, "cache_gener": 136, "undoitem": 136, "cursor": 136, "anchor": 136, "font_famili": 136, "font_siz": 136, "font_weight": 136, "font_ital": 136, "selection_foreground_color": 136, "selection_background_color": 136, "horizontal_align": 136, "vertical_align": 136, "wrap": [136, 229, 239], "input_typ": [136, 142], "letter_spac": 136, "cursor_position_byte_offset": 136, "anchor_position_byte_offset": 136, "text_cursor_width": [136, 142], "cursor_vis": 136, "has_focu": [136, 142], "cursor_position_chang": 136, "single_lin": 136, "read_onli": 136, "cached_rendering_data": [136, 142], "preferred_x_po": 136, "undo_item": 136, "redo_item": 136, "col_or_row": 136, "easeinelast": 136, "easeoutelast": 136, "easeinoutelast": 136, "easeinbounc": 136, "easeoutbounc": 136, "easeinoutbounc": 136, "cubicbezier_bodi": 136, "delai": [136, 146], "iteration_count": 136, "eas": 136, "pointerpress": 136, "pointerreleas": 136, "pointermov": 136, "pointerscrol": 136, "pointerexit": 136, "keypressrep": 136, "pointerpressed_bodi": 136, "pointerreleased_bodi": 136, "pointermoved_bodi": 136, "pointerscrolled_bodi": 136, "keypressed_bodi": 136, "keypressrepeated_bodi": 136, "keyreleased_bodi": 136, "pointer_press": 136, "pointer_releas": 136, "pointer_mov": 136, "pointer_scrol": 136, "key_press": 136, "key_press_rep": 136, "key_releas": 136, "destructor": [136, 162, 229], "thankfulli": 136, "charactermapentri": 136, "code_point": 136, "glyph_index": 136, "bitmapglyph": 136, "int16_t": 136, "x_advanc": 136, "pixel_s": 136, "glyph_data": 136, "family_nam": 136, "character_map": 136, "units_per_em": 136, "glyph": [136, 228], "weight": 136, "ital": 136, "box2d": 136, "basicborderrectangl": 136, "border_width": 136, "border_radiu": 136, "border_color": 136, "borderrectangl": 136, "border_top_left_radiu": 136, "border_top_right_radiu": 136, "border_bottom_left_radiu": 136, "border_bottom_right_radiu": 136, "imageitem": 136, "image_fit": 136, "image_rend": 136, "clippedimag": 136, "source_clip_x": 136, "source_clip_i": 136, "source_clip_width": 136, "source_clip_height": 136, "horizontal_til": 136, "vertical_til": 136, "toucharea": 136, "has_hov": [136, 142], "pressed_x": [136, 142], "pressed_i": [136, 142], "mouse_x": 136, "mouse_i": 136, "mouse_cursor": 136, "click": [136, 142, 227], "double_click": 136, "pointer_ev": 136, "scroll_ev": 136, "focusscop": 136, "focus_changed_ev": 136, "swipegesturehandl": 136, "handle_swipe_left": 136, "handle_swipe_right": 136, "handle_swipe_up": 136, "handle_swipe_down": 136, "swipe": 136, "pressed_posit": 136, "current_posit": 136, "viewport_x": 136, "flick": 136, "simpletext": 136, "complextext": 136, "overflow": [136, 234], "stroke": 136, "stroke_width": 136, "stroke_styl": 136, "fill_rul": 136, "viewbox_x": 136, "viewbox_i": 136, "viewbox_width": 136, "viewbox_height": 136, "windowitem": 136, "no_fram": 136, "resize_border_width": 136, "always_on_top": 136, "icon": [136, 142], "default_font_famili": 136, "default_font_weight": 136, "boxshadow": 136, "offset_x": 136, "offset_i": 136, "blur": 136, "rotation_angl": 136, "rotation_origin_x": 136, "rotation_origin_i": 136, "cache_rendering_hint": 136, "sig": [136, 141], "slint_date_time_use_24_hour_format": 136, "slint_date_time_month_day_count": 136, "month": 136, "year": 136, "slint_date_time_month_offset": 136, "slint_date_time_format_d": 136, "dai": 136, "slint_date_time_date_now": 136, "slint_date_time_parse_d": 136, "date": 136, "slint_visit_item_tre": 136, "visit_dynam": 136, "dyn_index": 136, "self_compon": 136, "self_index": 136, "slint_textinput_set_selection_offset": 136, "text_input": 136, "slint_textinput_select_al": 136, "slint_textinput_clear_select": 136, "slint_textinput_cut": 136, "slint_textinput_copi": 136, "slint_textinput_past": 136, "slint_cpp_text_item_fontmetr": 136, "slint_reorder_dialog_button_layout": 136, "pointer_to_valu": [136, 141], "intercept_set": [136, 141], "intercept_set_bind": [136, 141], "new_bind": [136, 141], "start_inst": [136, 141], "ct": [136, 141], "eval_fn": [136, 141], "notify_fn": [136, 141], "slint_animation_tick": [136, 141], "ss": [136, 144], "byte": [136, 144, 158, 233], "self_": [136, 142, 144], "sequenc": 136, "to_transl": 136, "target": [136, 140, 148, 227, 228, 231, 234, 235, 236, 238], "focus_item": 136, "rendering_st": 136, "slint_decl_item": [136, 142], "itemnam": [136, 142], "undef": [136, 142], "source_fil": [137, 163], "column": [137, 163], "property_nam": [137, 138, 164, 229], "property_typ": [137, 164], "12": [138, 142], "dynamiccomponentvrc": 138, "double_": 138, "stru": [138, 165, 166], "inst": 138, "def": 138, "component_definition_ptr": 138, "translation_domain": 138, "style_out": 138, "out_diag": 138, "radius_x": 139, "radius_i": 139, "x_rotat": 139, "large_arc": 139, "sweep": 139, "control_1_x": 139, "control_1_i": 139, "control_2_x": 139, "control_2_i": 139, "control_x": 139, "control_i": 139, "moveto": 139, "lineto": 139, "arcto": 139, "cubicto": 139, "quadraticto": 139, "moveto_bodi": 139, "lineto_bodi": 139, "arcto_bodi": 139, "cubicto_bodi": 139, "quadraticto_bodi": 139, "move_to": 139, "line_to": 139, "arc_to": 139, "cubic_to": 139, "quadratic_to": 139, "ismoveto": 139, "islineto": 139, "isarcto": 139, "iscubicto": 139, "isquadraticto": 139, "isclos": 139, "elements_bodi": 139, "events_bodi": 139, "commands_bodi": 139, "isnon": 139, "isel": 139, "isev": 139, "iscommand": 139, "first_el": 139, "out_ev": 139, "out_coordin": 139, "first_ev": 139, "first_coordin": 139, "layoutconstraintsreprc": 140, "windowadapteruserdata": 140, "_a": 140, "_b": 140, "platformuserdata": 140, "slint_ensure_backend": 140, "quit_on_last_window_clos": 140, "win": 140, "error_str": 140, "font_data": 140, "wp": 140, "get_renderer_ref": 140, "window_factori": 140, "buffer_ag": 140, "buffer_len": 140, "process_line_fn": 140, "_hinstanc": 140, "ns_view": 140, "_ns_window": 140, "handle_opaqu": 140, "malloc": 140, "propertyhandl": 141, "dep_nod": 141, "hack": 142, "alert": 142, "qt_widget": 142, "sync": 142, "slinttypeerasedwidget": 142, "slinttypeerasedwidgetptr": 142, "layout_spac": 142, "layout_pad": 142, "window_background": 142, "default_text_color": 142, "textedit_background": 142, "textedit_text_color": 142, "textedit_background_dis": 142, "textedit_text_color_dis": 142, "placeholder_color": 142, "placeholder_color_dis": 142, "dark_color_schem": 142, "tab_bar_align": 142, "style_change_listen": 142, "foreground": 142, "alternate_background": 142, "alternate_foreground": 142, "accent_background": 142, "accent_foreground": 142, "control_background": 142, "control_foreground": 142, "selection_background": 142, "selection_foreground": 142, "border": 142, "qstyle_standardpixmap": 142, "qaccessible_ev": 142, "qaccessible_rol": 142, "qaccessible_text": 142, "qt_keyboardmodifi": 142, "qt_alignmentflag": 142, "qt_textflag": 142, "qt_kei": 142, "qt_cursorshap": 142, "qt_fillrul": 142, "nativebutton": 142, "colorize_icon": 142, "standard_button_kind": 142, "is_standard_button": 142, "widget_ptr": 142, "animation_track": 142, "nativespinboxdata": 142, "active_control": 142, "nativespinbox": 142, "step_siz": 142, "nativecheckbox": 142, "toggl": [142, 227], "nativesliderdata": 142, "pressed_v": 142, "nativeslid": 142, "nativeprogressind": 142, "indetermin": 142, "nativegroupbox": 142, "native_padding_left": 142, "native_padding_right": 142, "native_padding_top": 142, "native_padding_bottom": 142, "nativelineedit": 142, "nativescrollview": 142, "horizontal_max": 142, "horizontal_page_s": 142, "horizontal_valu": 142, "vertical_max": 142, "vertical_page_s": 142, "vertical_valu": 142, "nativestandardlistviewitem": 142, "is_select": 142, "nativetableheadersect": 142, "nativecombobox": 142, "is_open": 142, "current_valu": 142, "nativecomboboxpopup": 142, "nativetabwidget": 142, "content_min_height": 142, "content_min_width": 142, "tabbar_preferred_height": 142, "tabbar_preferred_width": 142, "current_index": 142, "current_focus": 142, "content_x": 142, "content_i": 142, "content_height": 142, "content_width": 142, "tabbar_x": 142, "tabbar_i": 142, "tabbar_height": 142, "tabbar_width": 142, "nativetab": 142, "tab_index": 142, "num_tab": 142, "qstyle_standardpixmap_sp_titlebarmenubutton": 142, "qstyle_standardpixmap_sp_titlebarminbutton": 142, "qstyle_standardpixmap_sp_titlebarmaxbutton": 142, "qstyle_standardpixmap_sp_titlebarclosebutton": 142, "qstyle_standardpixmap_sp_titlebarnormalbutton": 142, "qstyle_standardpixmap_sp_titlebarshadebutton": 142, "qstyle_standardpixmap_sp_titlebarunshadebutton": 142, "qstyle_standardpixmap_sp_titlebarcontexthelpbutton": 142, "qstyle_standardpixmap_sp_dockwidgetclosebutton": 142, "qstyle_standardpixmap_sp_messageboxinform": 142, "qstyle_standardpixmap_sp_messageboxwarn": 142, "10": 142, "qstyle_standardpixmap_sp_messageboxcrit": 142, "11": 142, "qstyle_standardpixmap_sp_messageboxquest": 142, "qstyle_standardpixmap_sp_desktopicon": 142, "13": 142, "qstyle_standardpixmap_sp_trashicon": 142, "14": 142, "qstyle_standardpixmap_sp_computericon": 142, "15": 142, "qstyle_standardpixmap_sp_drivefdicon": 142, "qstyle_standardpixmap_sp_drivehdicon": 142, "qstyle_standardpixmap_sp_drivecdicon": 142, "18": 142, "qstyle_standardpixmap_sp_drivedvdicon": 142, "19": 142, "qstyle_standardpixmap_sp_driveneticon": 142, "qstyle_standardpixmap_sp_diropenicon": 142, "21": [142, 227, 231, 235, 237], "qstyle_standardpixmap_sp_dirclosedicon": 142, "22": 142, "qstyle_standardpixmap_sp_dirlinkicon": 142, "23": 142, "qstyle_standardpixmap_sp_dirlinkopenicon": 142, "qstyle_standardpixmap_sp_fileicon": 142, "25": 142, "qstyle_standardpixmap_sp_filelinkicon": 142, "qstyle_standardpixmap_sp_toolbarhorizontalextensionbutton": 142, "27": 142, "qstyle_standardpixmap_sp_toolbarverticalextensionbutton": 142, "28": 142, "qstyle_standardpixmap_sp_filedialogstart": 142, "29": 142, "qstyle_standardpixmap_sp_filedialogend": 142, "qstyle_standardpixmap_sp_filedialogtopar": 142, "31": 142, "qstyle_standardpixmap_sp_filedialognewfold": 142, "32": 142, "qstyle_standardpixmap_sp_filedialogdetailedview": 142, "33": 142, "qstyle_standardpixmap_sp_filedialoginfoview": 142, "34": 142, "qstyle_standardpixmap_sp_filedialogcontentsview": 142, "35": 142, "qstyle_standardpixmap_sp_filedialoglistview": 142, "36": 142, "qstyle_standardpixmap_sp_filedialogback": 142, "37": 142, "qstyle_standardpixmap_sp_diricon": 142, "38": 142, "qstyle_standardpixmap_sp_dialogokbutton": 142, "39": 142, "qstyle_standardpixmap_sp_dialogcancelbutton": 142, "40": 142, "qstyle_standardpixmap_sp_dialoghelpbutton": 142, "41": 142, "qstyle_standardpixmap_sp_dialogopenbutton": 142, "qstyle_standardpixmap_sp_dialogsavebutton": 142, "43": 142, "qstyle_standardpixmap_sp_dialogclosebutton": 142, "44": 142, "qstyle_standardpixmap_sp_dialogapplybutton": 142, "45": 142, "qstyle_standardpixmap_sp_dialogresetbutton": 142, "46": 142, "qstyle_standardpixmap_sp_dialogdiscardbutton": 142, "47": 142, "qstyle_standardpixmap_sp_dialogyesbutton": 142, "48": 142, "qstyle_standardpixmap_sp_dialognobutton": 142, "49": 142, "qstyle_standardpixmap_sp_arrowup": 142, "qstyle_standardpixmap_sp_arrowdown": 142, "51": 142, "qstyle_standardpixmap_sp_arrowleft": 142, "52": 142, "qstyle_standardpixmap_sp_arrowright": 142, "53": 142, "qstyle_standardpixmap_sp_arrowback": 142, "54": 142, "qstyle_standardpixmap_sp_arrowforward": 142, "55": 142, "qstyle_standardpixmap_sp_dirhomeicon": 142, "56": 142, "qstyle_standardpixmap_sp_commandlink": 142, "57": 142, "qstyle_standardpixmap_sp_vistashield": 142, "58": 142, "qstyle_standardpixmap_sp_browserreload": 142, "59": 142, "qstyle_standardpixmap_sp_browserstop": 142, "60": 142, "qstyle_standardpixmap_sp_mediaplai": 142, "61": 142, "qstyle_standardpixmap_sp_mediastop": 142, "62": 142, "qstyle_standardpixmap_sp_mediapaus": 142, "63": 142, "qstyle_standardpixmap_sp_mediaskipforward": 142, "64": [142, 227, 240], "qstyle_standardpixmap_sp_mediaskipbackward": 142, "65": 142, "qstyle_standardpixmap_sp_mediaseekforward": 142, "66": 142, "qstyle_standardpixmap_sp_mediaseekbackward": 142, "67": 142, "qstyle_standardpixmap_sp_mediavolum": 142, "68": 142, "qstyle_standardpixmap_sp_mediavolumemut": 142, "69": 142, "qstyle_standardpixmap_sp_lineeditclearbutton": 142, "70": 142, "qstyle_standardpixmap_sp_dialogyestoallbutton": 142, "71": 142, "qstyle_standardpixmap_sp_dialognotoallbutton": 142, "72": 142, "qstyle_standardpixmap_sp_dialogsaveallbutton": 142, "73": 142, "qstyle_standardpixmap_sp_dialogabortbutton": 142, "74": 142, "qstyle_standardpixmap_sp_dialogretrybutton": 142, "75": 142, "qstyle_standardpixmap_sp_dialogignorebutton": 142, "76": 142, "qstyle_standardpixmap_sp_restoredefaultsbutton": 142, "77": [142, 227, 235], "qstyle_standardpixmap_sp_custombas": 142, "4026531840": 142, "qaccessible_event_soundplai": 142, "qaccessible_event_alert": 142, "qaccessible_event_foregroundchang": 142, "qaccessible_event_menustart": 142, "qaccessible_event_menuend": 142, "qaccessible_event_popupmenustart": 142, "qaccessible_event_popupmenuend": 142, "qaccessible_event_contexthelpstart": 142, "qaccessible_event_contexthelpend": 142, "qaccessible_event_dragdropstart": 142, "qaccessible_event_dragdropend": 142, "qaccessible_event_dialogstart": 142, "qaccessible_event_dialogend": 142, "qaccessible_event_scrollingstart": 142, "qaccessible_event_scrollingend": 142, "qaccessible_event_menucommand": 142, "qaccessible_event_actionchang": 142, "257": 142, "qaccessible_event_activedescendantchang": 142, "258": 142, "qaccessible_event_attributechang": 142, "259": 142, "qaccessible_event_documentcontentchang": 142, "260": 142, "qaccessible_event_documentloadcomplet": 142, "261": 142, "qaccessible_event_documentloadstop": 142, "262": 142, "qaccessible_event_documentreload": 142, "263": 142, "qaccessible_event_hyperlinkendindexchang": 142, "264": 142, "qaccessible_event_hyperlinknumberofanchorschang": 142, "265": 142, "qaccessible_event_hyperlinkselectedlinkchang": 142, "266": 142, "qaccessible_event_hypertextlinkactiv": 142, "267": 142, "qaccessible_event_hypertextlinkselect": 142, "268": 142, "qaccessible_event_hyperlinkstartindexchang": 142, "269": 142, "qaccessible_event_hypertextchang": 142, "qaccessible_event_hypertextnlinkschang": 142, "271": 142, "qaccessible_event_objectattributechang": 142, "272": 142, "qaccessible_event_pagechang": 142, "273": 142, "qaccessible_event_sectionchang": 142, "274": 142, "qaccessible_event_tablecaptionchang": 142, "275": 142, "qaccessible_event_tablecolumndescriptionchang": 142, "276": 142, "qaccessible_event_tablecolumnheaderchang": 142, "277": 142, "qaccessible_event_tablemodelchang": 142, "278": 142, "qaccessible_event_tablerowdescriptionchang": 142, "279": 142, "qaccessible_event_tablerowheaderchang": 142, "280": 142, "qaccessible_event_tablesummarychang": 142, "281": 142, "qaccessible_event_textattributechang": 142, "282": 142, "qaccessible_event_textcaretmov": 142, "283": 142, "qaccessible_event_textcolumnchang": 142, "285": 142, "qaccessible_event_textinsert": 142, "286": 142, "qaccessible_event_textremov": 142, "287": 142, "qaccessible_event_textupd": 142, "288": 142, "qaccessible_event_textselectionchang": 142, "289": 142, "qaccessible_event_visibledatachang": 142, "290": 142, "qaccessible_event_objectcr": 142, "32768": 142, "qaccessible_event_objectdestroi": 142, "32769": 142, "qaccessible_event_objectshow": 142, "32770": 142, "qaccessible_event_objecthid": 142, "32771": 142, "qaccessible_event_objectreord": 142, "32772": 142, "qaccessible_event_focu": 142, "32773": 142, "qaccessible_event_select": 142, "32774": 142, "qaccessible_event_selectionadd": 142, "32775": 142, "qaccessible_event_selectionremov": 142, "32776": 142, "qaccessible_event_selectionwithin": 142, "32777": 142, "qaccessible_event_statechang": 142, "32778": 142, "qaccessible_event_locationchang": 142, "32779": 142, "qaccessible_event_namechang": 142, "32780": 142, "qaccessible_event_descriptionchang": 142, "32781": 142, "qaccessible_event_valuechang": 142, "32782": 142, "qaccessible_event_parentchang": 142, "32783": 142, "qaccessible_event_helpchang": 142, "32928": 142, "qaccessible_event_defaultactionchang": 142, "32944": 142, "qaccessible_event_acceleratorchang": 142, "32960": 142, "qaccessible_event_invalidev": 142, "32961": 142, "qaccessible_role_norol": 142, "qaccessible_role_titlebar": 142, "qaccessible_role_menubar": 142, "qaccessible_role_scrollbar": 142, "qaccessible_role_grip": 142, "qaccessible_role_sound": 142, "qaccessible_role_cursor": 142, "qaccessible_role_caret": 142, "qaccessible_role_alertmessag": 142, "qaccessible_role_window": 142, "qaccessible_role_cli": 142, "qaccessible_role_popupmenu": 142, "qaccessible_role_menuitem": 142, "qaccessible_role_tooltip": 142, "qaccessible_role_appl": 142, "qaccessible_role_docu": 142, "qaccessible_role_pan": 142, "qaccessible_role_chart": 142, "qaccessible_role_dialog": 142, "qaccessible_role_bord": 142, "qaccessible_role_group": 142, "qaccessible_role_separ": 142, "qaccessible_role_toolbar": 142, "qaccessible_role_statusbar": 142, "qaccessible_role_t": 142, "qaccessible_role_columnhead": 142, "qaccessible_role_rowhead": 142, "qaccessible_role_column": 142, "qaccessible_role_row": 142, "qaccessible_role_cel": 142, "qaccessible_role_link": 142, "qaccessible_role_helpballoon": 142, "qaccessible_role_assist": 142, "qaccessible_role_list": 142, "qaccessible_role_listitem": 142, "qaccessible_role_tre": 142, "qaccessible_role_treeitem": 142, "qaccessible_role_pagetab": 142, "qaccessible_role_propertypag": 142, "qaccessible_role_ind": 142, "qaccessible_role_graph": 142, "qaccessible_role_statictext": 142, "qaccessible_role_editabletext": 142, "qaccessible_role_button": 142, "qaccessible_role_pushbutton": 142, "qaccessible_role_checkbox": 142, "qaccessible_role_radiobutton": 142, "qaccessible_role_combobox": 142, "qaccessible_role_progressbar": 142, "qaccessible_role_di": 142, "qaccessible_role_hotkeyfield": 142, "qaccessible_role_slid": 142, "qaccessible_role_spinbox": 142, "qaccessible_role_canva": 142, "qaccessible_role_anim": 142, "qaccessible_role_equ": 142, "qaccessible_role_buttondropdown": 142, "qaccessible_role_buttonmenu": 142, "qaccessible_role_buttondropgrid": 142, "qaccessible_role_whitespac": 142, "qaccessible_role_pagetablist": 142, "qaccessible_role_clock": 142, "qaccessible_role_splitt": 142, "qaccessible_role_layeredpan": 142, "128": 142, "qaccessible_role_termin": 142, "129": 142, "qaccessible_role_desktop": 142, "130": 142, "qaccessible_role_paragraph": 142, "131": 142, "qaccessible_role_webdocu": 142, "132": 142, "qaccessible_role_sect": 142, "133": 142, "qaccessible_role_notif": 142, "134": 142, "qaccessible_role_colorchoos": 142, "1028": 142, "qaccessible_role_foot": 142, "1038": 142, "qaccessible_role_form": 142, "1040": 142, "qaccessible_role_head": 142, "1044": 142, "qaccessible_role_not": 142, "1051": 142, "qaccessible_role_complementarycont": 142, "1068": 142, "qaccessible_role_userrol": 142, "65535": 142, "qaccessible_text_nam": 142, "qaccessible_text_descript": 142, "qaccessible_text_valu": 142, "qaccessible_text_help": 142, "qaccessible_text_acceler": 142, "qaccessible_text_debugdescript": 142, "qaccessible_text_usertext": 142, "qt_keyboardmodifier_nomodifi": 142, "qt_keyboardmodifier_shiftmodifi": 142, "33554432": 142, "qt_keyboardmodifier_controlmodifi": 142, "67108864": 142, "qt_keyboardmodifier_altmodifi": 142, "134217728": 142, "qt_keyboardmodifier_metamodifi": 142, "268435456": 142, "qt_keyboardmodifier_keypadmodifi": 142, "536870912": 142, "qt_keyboardmodifier_groupswitchmodifi": 142, "1073741824": 142, "qt_keyboardmodifier_keyboardmodifiermask": 142, "4261412864": 142, "qt_alignmentflag_alignleft": 142, "qt_alignmentflag_alignlead": 142, "qt_alignmentflag_alignright": 142, "qt_alignmentflag_aligntrail": 142, "qt_alignmentflag_alignhcent": 142, "qt_alignmentflag_alignjustifi": 142, "qt_alignmentflag_alignabsolut": 142, "qt_alignmentflag_alignhorizontal_mask": 142, "qt_alignmentflag_aligntop": 142, "qt_alignmentflag_alignbottom": 142, "qt_alignmentflag_alignvcent": 142, "qt_alignmentflag_alignbaselin": 142, "256": 142, "qt_alignmentflag_alignvertical_mask": 142, "480": 142, "qt_alignmentflag_aligncent": 142, "qt_textflag_textsinglelin": 142, "qt_textflag_textdontclip": 142, "512": 142, "qt_textflag_textexpandtab": 142, "1024": 142, "qt_textflag_textshowmnemon": 142, "2048": 142, "qt_textflag_textwordwrap": 142, "4096": 142, "qt_textflag_textwrapanywher": 142, "8192": [142, 234], "qt_textflag_textdontprint": 142, "16384": 142, "qt_textflag_textincludetrailingspac": 142, "qt_textflag_texthidemnemon": 142, "qt_textflag_textjustificationforc": 142, "65536": 142, "qt_textflag_textforcelefttoright": 142, "131072": 142, "qt_textflag_textforcerighttoleft": 142, "262144": 142, "qt_textflag_textlongestvari": 142, "524288": 142, "qt_textflag_textbypassshap": 142, "1048576": 142, "qt_key_key_escap": 142, "16777216": 142, "qt_key_key_tab": 142, "16777217": 142, "qt_key_key_backtab": 142, "16777218": 142, "qt_key_key_backspac": 142, "16777219": 142, "qt_key_key_return": 142, "16777220": 142, "qt_key_key_ent": 142, "16777221": 142, "qt_key_key_insert": 142, "16777222": 142, "qt_key_key_delet": 142, "16777223": 142, "qt_key_key_paus": 142, "16777224": 142, "qt_key_key_print": 142, "16777225": 142, "qt_key_key_sysreq": 142, "16777226": 142, "qt_key_key_clear": 142, "16777227": 142, "qt_key_key_hom": 142, "16777232": 142, "qt_key_key_end": 142, "16777233": 142, "qt_key_key_left": 142, "16777234": 142, "qt_key_key_up": 142, "16777235": 142, "qt_key_key_right": 142, "16777236": 142, "qt_key_key_down": 142, "16777237": 142, "qt_key_key_pageup": 142, "16777238": 142, "qt_key_key_pagedown": 142, "16777239": 142, "qt_key_key_shift": 142, "16777248": 142, "qt_key_key_control": 142, "16777249": 142, "qt_key_key_meta": 142, "16777250": 142, "qt_key_key_alt": 142, "16777251": 142, "qt_key_key_capslock": 142, "16777252": 142, "qt_key_key_numlock": 142, "16777253": 142, "qt_key_key_scrolllock": 142, "16777254": 142, "qt_key_key_f1": 142, "16777264": 142, "qt_key_key_f2": 142, "16777265": 142, "qt_key_key_f3": 142, "16777266": 142, "qt_key_key_f4": 142, "16777267": 142, "qt_key_key_f5": 142, "16777268": 142, "qt_key_key_f6": 142, "16777269": 142, "qt_key_key_f7": 142, "16777270": 142, "qt_key_key_f8": 142, "16777271": 142, "qt_key_key_f9": 142, "16777272": 142, "qt_key_key_f10": 142, "16777273": 142, "qt_key_key_f11": 142, "16777274": 142, "qt_key_key_f12": 142, "16777275": 142, "qt_key_key_f13": 142, "16777276": 142, "qt_key_key_f14": 142, "16777277": 142, "qt_key_key_f15": 142, "16777278": 142, "qt_key_key_f16": 142, "16777279": 142, "qt_key_key_f17": 142, "16777280": 142, "qt_key_key_f18": 142, "16777281": 142, "qt_key_key_f19": 142, "16777282": 142, "qt_key_key_f20": 142, "16777283": 142, "qt_key_key_f21": 142, "16777284": 142, "qt_key_key_f22": 142, "16777285": 142, "qt_key_key_f23": 142, "16777286": 142, "qt_key_key_f24": 142, "16777287": 142, "qt_key_key_f25": 142, "16777288": 142, "qt_key_key_f26": 142, "16777289": 142, "qt_key_key_f27": 142, "16777290": 142, "qt_key_key_f28": 142, "16777291": 142, "qt_key_key_f29": 142, "16777292": 142, "qt_key_key_f30": 142, "16777293": 142, "qt_key_key_f31": 142, "16777294": 142, "qt_key_key_f32": 142, "16777295": 142, "qt_key_key_f33": 142, "16777296": 142, "qt_key_key_f34": 142, "16777297": 142, "qt_key_key_f35": 142, "16777298": 142, "qt_key_key_super_l": 142, "16777299": 142, "qt_key_key_super_r": 142, "16777300": 142, "qt_key_key_menu": 142, "16777301": 142, "qt_key_key_hyper_l": 142, "16777302": 142, "qt_key_key_hyper_r": 142, "16777303": 142, "qt_key_key_help": 142, "16777304": 142, "qt_key_key_direction_l": 142, "16777305": 142, "qt_key_key_direction_r": 142, "16777312": 142, "qt_key_key_spac": 142, "qt_key_key_ani": 142, "qt_key_key_exclam": 142, "qt_key_key_quotedbl": 142, "qt_key_key_numbersign": 142, "qt_key_key_dollar": 142, "qt_key_key_perc": 142, "qt_key_key_ampersand": 142, "qt_key_key_apostroph": 142, "qt_key_key_parenleft": 142, "qt_key_key_parenright": 142, "qt_key_key_asterisk": 142, "qt_key_key_plu": 142, "qt_key_key_comma": 142, "qt_key_key_minu": 142, "qt_key_key_period": 142, "qt_key_key_slash": 142, "qt_key_key_0": 142, "qt_key_key_1": 142, "qt_key_key_2": 142, "qt_key_key_3": 142, "qt_key_key_4": 142, "qt_key_key_5": 142, "qt_key_key_6": 142, "qt_key_key_7": 142, "qt_key_key_8": 142, "qt_key_key_9": 142, "qt_key_key_colon": 142, "qt_key_key_semicolon": 142, "qt_key_key_less": 142, "qt_key_key_equ": 142, "qt_key_key_great": 142, "qt_key_key_quest": 142, "qt_key_key_at": 142, "qt_key_key_a": 142, "qt_key_key_b": 142, "qt_key_key_c": 142, "qt_key_key_d": 142, "qt_key_key_": 142, "qt_key_key_f": 142, "qt_key_key_g": 142, "qt_key_key_h": 142, "qt_key_key_i": 142, "qt_key_key_j": 142, "qt_key_key_k": 142, "qt_key_key_l": 142, "qt_key_key_m": 142, "qt_key_key_n": 142, "78": 142, "qt_key_key_o": 142, "79": 142, "qt_key_key_p": 142, "80": 142, "qt_key_key_q": 142, "81": 142, "qt_key_key_r": 142, "82": 142, "83": 142, "qt_key_key_t": 142, "84": 142, "qt_key_key_u": 142, "85": 142, "qt_key_key_v": 142, "86": 142, "qt_key_key_w": 142, "87": 142, "qt_key_key_x": 142, "88": 142, "89": 142, "qt_key_key_z": 142, "qt_key_key_bracketleft": 142, "91": 142, "qt_key_key_backslash": 142, "92": 142, "qt_key_key_bracketright": 142, "93": 142, "qt_key_key_asciicircum": 142, "94": 142, "qt_key_key_underscor": 142, "95": 142, "qt_key_key_quoteleft": 142, "96": 142, "qt_key_key_braceleft": 142, "123": 142, "qt_key_key_bar": 142, "124": 142, "qt_key_key_braceright": 142, "125": 142, "qt_key_key_asciitild": 142, "126": 142, "qt_key_key_nobreakspac": 142, "qt_key_key_exclamdown": 142, "161": 142, "162": 142, "qt_key_key_sterl": 142, "163": 142, "qt_key_key_curr": 142, "164": 142, "qt_key_key_yen": 142, "165": 142, "qt_key_key_brokenbar": 142, "166": 142, "qt_key_key_sect": 142, "167": 142, "qt_key_key_diaeresi": 142, "168": 142, "qt_key_key_copyright": 142, "169": 142, "qt_key_key_ordfeminin": 142, "170": 142, "qt_key_key_guillemotleft": 142, "171": 142, "qt_key_key_notsign": 142, "172": 142, "qt_key_key_hyphen": 142, "173": 142, "qt_key_key_regist": 142, "174": 142, "qt_key_key_macron": 142, "175": 142, "qt_key_key_degre": 142, "176": 142, "qt_key_key_plusminu": 142, "177": 142, "qt_key_key_twosuperior": 142, "178": 142, "qt_key_key_threesuperior": 142, "179": 142, "qt_key_key_acut": 142, "qt_key_key_mu": 142, "181": 142, "qt_key_key_paragraph": 142, "182": 142, "qt_key_key_periodcent": 142, "183": 142, "qt_key_key_cedilla": 142, "184": 142, "qt_key_key_onesuperior": 142, "185": 142, "qt_key_key_masculin": 142, "186": 142, "qt_key_key_guillemotright": 142, "187": 142, "qt_key_key_onequart": 142, "188": 142, "qt_key_key_onehalf": 142, "189": 142, "qt_key_key_threequart": 142, "190": 142, "qt_key_key_questiondown": 142, "191": 142, "qt_key_key_agrav": 142, "192": 142, "qt_key_key_aacut": 142, "193": 142, "qt_key_key_acircumflex": 142, "194": 142, "qt_key_key_atild": 142, "195": 142, "qt_key_key_adiaeresi": 142, "196": 142, "qt_key_key_ar": 142, "197": 142, "198": 142, "qt_key_key_ccedilla": 142, "199": 142, "qt_key_key_egrav": 142, "200": [142, 148], "qt_key_key_eacut": 142, "201": 142, "qt_key_key_ecircumflex": 142, "202": 142, "qt_key_key_ediaeresi": 142, "203": 142, "qt_key_key_igrav": 142, "204": 142, "qt_key_key_iacut": 142, "205": 142, "qt_key_key_icircumflex": 142, "206": 142, "qt_key_key_idiaeresi": 142, "207": 142, "qt_key_key_eth": 142, "208": 142, "qt_key_key_ntild": 142, "209": 142, "qt_key_key_ograv": 142, "210": 142, "qt_key_key_oacut": 142, "211": 142, "qt_key_key_ocircumflex": 142, "212": 142, "qt_key_key_otild": 142, "213": 142, "qt_key_key_odiaeresi": 142, "214": 142, "qt_key_key_multipli": 142, "215": 142, "qt_key_key_oobliqu": 142, "216": 142, "qt_key_key_ugrav": 142, "217": 142, "qt_key_key_uacut": 142, "218": 142, "qt_key_key_ucircumflex": 142, "219": 142, "qt_key_key_udiaeresi": 142, "220": 142, "qt_key_key_yacut": 142, "221": 142, "qt_key_key_thorn": 142, "222": 142, "qt_key_key_ssharp": 142, "223": 142, "qt_key_key_divis": 142, "247": 142, "qt_key_key_ydiaeresi": 142, "qt_key_key_altgr": 142, "16781571": 142, "qt_key_key_multi_kei": 142, "16781600": 142, "qt_key_key_codeinput": 142, "16781623": 142, "qt_key_key_singlecandid": 142, "16781628": 142, "qt_key_key_multiplecandid": 142, "16781629": 142, "qt_key_key_previouscandid": 142, "16781630": 142, "qt_key_key_mode_switch": 142, "16781694": 142, "qt_key_key_kanji": 142, "16781601": 142, "qt_key_key_muhenkan": 142, "16781602": 142, "qt_key_key_henkan": 142, "16781603": 142, "qt_key_key_romaji": 142, "16781604": 142, "qt_key_key_hiragana": 142, "16781605": 142, "qt_key_key_katakana": 142, "16781606": 142, "qt_key_key_hiragana_katakana": 142, "16781607": 142, "qt_key_key_zenkaku": 142, "16781608": 142, "qt_key_key_hankaku": 142, "16781609": 142, "qt_key_key_zenkaku_hankaku": 142, "16781610": 142, "qt_key_key_touroku": 142, "16781611": 142, "qt_key_key_massyo": 142, "16781612": 142, "qt_key_key_kana_lock": 142, "16781613": 142, "qt_key_key_kana_shift": 142, "16781614": 142, "qt_key_key_eisu_shift": 142, "16781615": 142, "qt_key_key_eisu_toggl": 142, "16781616": 142, "qt_key_key_hangul": 142, "16781617": 142, "qt_key_key_hangul_start": 142, "16781618": 142, "qt_key_key_hangul_end": 142, "16781619": 142, "qt_key_key_hangul_hanja": 142, "16781620": 142, "qt_key_key_hangul_jamo": 142, "16781621": 142, "qt_key_key_hangul_romaja": 142, "16781622": 142, "qt_key_key_hangul_jeonja": 142, "16781624": 142, "qt_key_key_hangul_banja": 142, "16781625": 142, "qt_key_key_hangul_prehanja": 142, "16781626": 142, "qt_key_key_hangul_posthanja": 142, "16781627": 142, "qt_key_key_hangul_speci": 142, "16781631": 142, "qt_key_key_dead_grav": 142, "16781904": 142, "qt_key_key_dead_acut": 142, "16781905": 142, "qt_key_key_dead_circumflex": 142, "16781906": 142, "qt_key_key_dead_tild": 142, "16781907": 142, "qt_key_key_dead_macron": 142, "16781908": 142, "qt_key_key_dead_brev": 142, "16781909": 142, "qt_key_key_dead_abovedot": 142, "16781910": 142, "qt_key_key_dead_diaeresi": 142, "16781911": 142, "qt_key_key_dead_abov": 142, "16781912": 142, "qt_key_key_dead_doubleacut": 142, "16781913": 142, "qt_key_key_dead_caron": 142, "16781914": 142, "qt_key_key_dead_cedilla": 142, "16781915": 142, "qt_key_key_dead_ogonek": 142, "16781916": 142, "qt_key_key_dead_iota": 142, "16781917": 142, "qt_key_key_dead_voiced_sound": 142, "16781918": 142, "qt_key_key_dead_semivoiced_sound": 142, "16781919": 142, "qt_key_key_dead_belowdot": 142, "16781920": 142, "qt_key_key_dead_hook": 142, "16781921": 142, "qt_key_key_dead_horn": 142, "16781922": 142, "qt_key_key_dead_strok": 142, "16781923": 142, "qt_key_key_dead_abovecomma": 142, "16781924": 142, "qt_key_key_dead_abovereversedcomma": 142, "16781925": 142, "qt_key_key_dead_doublegrav": 142, "16781926": 142, "qt_key_key_dead_belowr": 142, "16781927": 142, "qt_key_key_dead_belowmacron": 142, "16781928": 142, "qt_key_key_dead_belowcircumflex": 142, "16781929": 142, "qt_key_key_dead_belowtild": 142, "16781930": 142, "qt_key_key_dead_belowbrev": 142, "16781931": 142, "qt_key_key_dead_belowdiaeresi": 142, "16781932": 142, "qt_key_key_dead_invertedbrev": 142, "16781933": 142, "qt_key_key_dead_belowcomma": 142, "16781934": 142, "qt_key_key_dead_curr": 142, "16781935": 142, "qt_key_key_dead_a": 142, "16781952": 142, "16781953": 142, "qt_key_key_dead_": 142, "16781954": 142, "16781955": 142, "qt_key_key_dead_i": 142, "16781956": 142, "16781957": 142, "qt_key_key_dead_o": 142, "16781958": 142, "16781959": 142, "qt_key_key_dead_u": 142, "16781960": 142, "16781961": 142, "qt_key_key_dead_small_schwa": 142, "16781962": 142, "qt_key_key_dead_capital_schwa": 142, "16781963": 142, "qt_key_key_dead_greek": 142, "16781964": 142, "qt_key_key_dead_lowlin": 142, "16781968": 142, "qt_key_key_dead_aboveverticallin": 142, "16781969": 142, "qt_key_key_dead_belowverticallin": 142, "16781970": 142, "qt_key_key_dead_longsolidusoverlai": 142, "16781971": 142, "qt_key_key_back": 142, "16777313": 142, "qt_key_key_forward": 142, "16777314": 142, "qt_key_key_stop": 142, "16777315": 142, "qt_key_key_refresh": 142, "16777316": 142, "qt_key_key_volumedown": 142, "16777328": 142, "qt_key_key_volumemut": 142, "16777329": 142, "qt_key_key_volumeup": 142, "16777330": 142, "qt_key_key_bassboost": 142, "16777331": 142, "qt_key_key_bassup": 142, "16777332": 142, "qt_key_key_bassdown": 142, "16777333": 142, "qt_key_key_trebleup": 142, "16777334": 142, "qt_key_key_trebledown": 142, "16777335": 142, "qt_key_key_mediaplai": 142, "16777344": 142, "qt_key_key_mediastop": 142, "16777345": 142, "qt_key_key_mediaprevi": 142, "16777346": 142, "qt_key_key_medianext": 142, "16777347": 142, "qt_key_key_mediarecord": 142, "16777348": 142, "qt_key_key_mediapaus": 142, "16777349": 142, "qt_key_key_mediatoggleplaypaus": 142, "16777350": 142, "qt_key_key_homepag": 142, "16777360": 142, "qt_key_key_favorit": 142, "16777361": 142, "qt_key_key_search": 142, "16777362": 142, "qt_key_key_standbi": 142, "16777363": 142, "qt_key_key_openurl": 142, "16777364": 142, "qt_key_key_launchmail": 142, "16777376": 142, "qt_key_key_launchmedia": 142, "16777377": 142, "qt_key_key_launch0": 142, "16777378": 142, "qt_key_key_launch1": 142, "16777379": 142, "qt_key_key_launch2": 142, "16777380": 142, "qt_key_key_launch3": 142, "16777381": 142, "qt_key_key_launch4": 142, "16777382": 142, "qt_key_key_launch5": 142, "16777383": 142, "qt_key_key_launch6": 142, "16777384": 142, "qt_key_key_launch7": 142, "16777385": 142, "qt_key_key_launch8": 142, "16777386": 142, "qt_key_key_launch9": 142, "16777387": 142, "qt_key_key_launcha": 142, "16777388": 142, "qt_key_key_launchb": 142, "16777389": 142, "qt_key_key_launchc": 142, "16777390": 142, "qt_key_key_launchd": 142, "16777391": 142, "qt_key_key_launch": 142, "16777392": 142, "qt_key_key_launchf": 142, "16777393": 142, "qt_key_key_monbrightnessup": 142, "16777394": 142, "qt_key_key_monbrightnessdown": 142, "16777395": 142, "qt_key_key_keyboardlightonoff": 142, "16777396": 142, "qt_key_key_keyboardbrightnessup": 142, "16777397": 142, "qt_key_key_keyboardbrightnessdown": 142, "16777398": 142, "qt_key_key_poweroff": 142, "16777399": 142, "qt_key_key_wakeup": 142, "16777400": 142, "qt_key_key_eject": 142, "16777401": 142, "qt_key_key_screensav": 142, "16777402": 142, "qt_key_key_www": 142, "16777403": 142, "qt_key_key_memo": 142, "16777404": 142, "qt_key_key_lightbulb": 142, "16777405": 142, "qt_key_key_shop": 142, "16777406": 142, "qt_key_key_histori": 142, "16777407": 142, "qt_key_key_addfavorit": 142, "16777408": 142, "qt_key_key_hotlink": 142, "16777409": 142, "qt_key_key_brightnessadjust": 142, "16777410": 142, "qt_key_key_fin": 142, "16777411": 142, "qt_key_key_commun": 142, "16777412": 142, "qt_key_key_audiorewind": 142, "16777413": 142, "qt_key_key_backforward": 142, "16777414": 142, "qt_key_key_applicationleft": 142, "16777415": 142, "qt_key_key_applicationright": 142, "16777416": 142, "qt_key_key_book": 142, "16777417": 142, "qt_key_key_cd": 142, "16777418": 142, "qt_key_key_calcul": 142, "16777419": 142, "qt_key_key_todolist": 142, "16777420": 142, "qt_key_key_cleargrab": 142, "16777421": 142, "qt_key_key_clos": 142, "16777422": 142, "qt_key_key_copi": 142, "16777423": 142, "qt_key_key_cut": 142, "16777424": 142, "qt_key_key_displai": 142, "16777425": 142, "qt_key_key_do": 142, "16777426": 142, "qt_key_key_docu": 142, "16777427": 142, "qt_key_key_excel": 142, "16777428": 142, "qt_key_key_explor": 142, "16777429": 142, "qt_key_key_gam": 142, "16777430": 142, "qt_key_key_go": 142, "16777431": 142, "qt_key_key_itouch": 142, "16777432": 142, "qt_key_key_logoff": 142, "16777433": 142, "qt_key_key_market": 142, "16777434": 142, "qt_key_key_meet": 142, "16777435": 142, "qt_key_key_menukb": 142, "16777436": 142, "qt_key_key_menupb": 142, "16777437": 142, "qt_key_key_mysit": 142, "16777438": 142, "qt_key_key_new": 142, "16777439": 142, "qt_key_key_officehom": 142, "16777440": 142, "qt_key_key_opt": 142, "16777441": 142, "qt_key_key_past": 142, "16777442": 142, "qt_key_key_phon": 142, "16777443": 142, "qt_key_key_calendar": 142, "16777444": 142, "qt_key_key_repli": 142, "16777445": 142, "qt_key_key_reload": 142, "16777446": 142, "qt_key_key_rotatewindow": 142, "16777447": 142, "qt_key_key_rotationpb": 142, "16777448": 142, "qt_key_key_rotationkb": 142, "16777449": 142, "qt_key_key_sav": 142, "16777450": 142, "qt_key_key_send": 142, "16777451": 142, "qt_key_key_spel": 142, "16777452": 142, "qt_key_key_splitscreen": 142, "16777453": 142, "qt_key_key_support": 142, "16777454": 142, "qt_key_key_taskpan": 142, "16777455": 142, "qt_key_key_termin": 142, "16777456": 142, "qt_key_key_tool": 142, "16777457": 142, "qt_key_key_travel": 142, "16777458": 142, "qt_key_key_video": 142, "16777459": 142, "qt_key_key_word": 142, "16777460": 142, "qt_key_key_xf": 142, "16777461": 142, "qt_key_key_zoomin": 142, "16777462": 142, "qt_key_key_zoomout": 142, "16777463": 142, "qt_key_key_awai": 142, "16777464": 142, "qt_key_key_messeng": 142, "16777465": 142, "qt_key_key_webcam": 142, "16777466": 142, "qt_key_key_mailforward": 142, "16777467": 142, "qt_key_key_pictur": 142, "16777468": 142, "qt_key_key_mus": 142, "16777469": 142, "qt_key_key_batteri": 142, "16777470": 142, "qt_key_key_bluetooth": 142, "16777471": 142, "qt_key_key_wlan": 142, "16777472": 142, "qt_key_key_uwb": 142, "16777473": 142, "qt_key_key_audioforward": 142, "16777474": 142, "qt_key_key_audiorepeat": 142, "16777475": 142, "qt_key_key_audiorandomplai": 142, "16777476": 142, "qt_key_key_subtitl": 142, "16777477": 142, "qt_key_key_audiocycletrack": 142, "16777478": 142, "qt_key_key_tim": 142, "16777479": 142, "qt_key_key_hibern": 142, "16777480": 142, "qt_key_key_view": 142, "16777481": 142, "qt_key_key_topmenu": 142, "16777482": 142, "qt_key_key_powerdown": 142, "16777483": 142, "qt_key_key_suspend": 142, "16777484": 142, "qt_key_key_contrastadjust": 142, "16777485": 142, "qt_key_key_launchg": 142, "16777486": 142, "qt_key_key_launchh": 142, "16777487": 142, "qt_key_key_touchpadtoggl": 142, "16777488": 142, "qt_key_key_touchpadon": 142, "16777489": 142, "qt_key_key_touchpadoff": 142, "16777490": 142, "qt_key_key_micmut": 142, "16777491": 142, "16777492": 142, "qt_key_key_green": 142, "16777493": 142, "qt_key_key_yellow": 142, "16777494": 142, "qt_key_key_blu": 142, "16777495": 142, "qt_key_key_channelup": 142, "16777496": 142, "qt_key_key_channeldown": 142, "16777497": 142, "qt_key_key_guid": 142, "16777498": 142, "qt_key_key_info": 142, "16777499": 142, "qt_key_key_set": 142, "16777500": 142, "qt_key_key_micvolumeup": 142, "16777501": 142, "qt_key_key_micvolumedown": 142, "16777502": 142, "16777504": 142, "qt_key_key_open": 142, "16777505": 142, "qt_key_key_find": 142, "16777506": 142, "qt_key_key_undo": 142, "16777507": 142, "qt_key_key_redo": 142, "16777508": 142, "qt_key_key_medialast": 142, "16842751": 142, "qt_key_key_select": 142, "16842752": 142, "qt_key_key_y": 142, "16842753": 142, "qt_key_key_no": 142, "16842754": 142, "qt_key_key_cancel": 142, "16908289": 142, "16908290": 142, "qt_key_key_execut": 142, "16908291": 142, "qt_key_key_sleep": 142, "16908292": 142, "qt_key_key_plai": 142, "16908293": 142, "qt_key_key_zoom": 142, "16908294": 142, "qt_key_key_exit": 142, "16908298": 142, "qt_key_key_context1": 142, "17825792": 142, "qt_key_key_context2": 142, "17825793": 142, "qt_key_key_context3": 142, "17825794": 142, "qt_key_key_context4": 142, "17825795": 142, "qt_key_key_cal": 142, "17825796": 142, "qt_key_key_hangup": 142, "17825797": 142, "qt_key_key_flip": 142, "17825798": 142, "qt_key_key_togglecallhangup": 142, "17825799": 142, "qt_key_key_voicedi": 142, "17825800": 142, "qt_key_key_lastnumberredi": 142, "17825801": 142, "qt_key_key_camera": 142, "17825824": 142, "qt_key_key_camerafocu": 142, "17825825": 142, "qt_key_key_unknown": 142, "33554431": 142, "qt_cursorshape_arrowcursor": 142, "qt_cursorshape_uparrowcursor": 142, "qt_cursorshape_crosscursor": 142, "qt_cursorshape_waitcursor": 142, "qt_cursorshape_ibeamcursor": 142, "qt_cursorshape_sizevercursor": 142, "qt_cursorshape_sizehorcursor": 142, "qt_cursorshape_sizebdiagcursor": 142, "qt_cursorshape_sizefdiagcursor": 142, "qt_cursorshape_sizeallcursor": 142, "qt_cursorshape_blankcursor": 142, "qt_cursorshape_splitvcursor": 142, "qt_cursorshape_splithcursor": 142, "qt_cursorshape_pointinghandcursor": 142, "qt_cursorshape_forbiddencursor": 142, "qt_cursorshape_whatsthiscursor": 142, "qt_cursorshape_busycursor": 142, "qt_cursorshape_openhandcursor": 142, "qt_cursorshape_closedhandcursor": 142, "qt_cursorshape_dragcopycursor": 142, "qt_cursorshape_dragmovecursor": 142, "qt_cursorshape_draglinkcursor": 142, "qt_cursorshape_lastcursor": 142, "qt_cursorshape_bitmapcursor": 142, "qt_cursorshape_customcursor": 142, "qt_fillrule_oddevenfil": 142, "qt_fillrule_windingfil": 142, "degre": [147, 240], "disk": [148, 228], "effici": [148, 158, 227, 232, 235], "dimens": 148, "afterward": 148, "320x200": 148, "pixel_buff": 148, "320": 148, "low_level_rend": 148, "through": [148, 231, 232], "the_width": 148, "the_height": 148, "the_data": 148, "raw_data": 148, "bgr_data": 148, "flip": 148, "nine": 148, "edg": 148, "corner": 148, "distort": 148, "cut": 148, "remain": [148, 159, 228], "bindabl": 148, "gl_texture_2d": 148, "gl_rgba": 148, "safeti": 148, "unsaf": 148, "lead": 148, "undefin": 148, "driver": [148, 235, 238], "consequ": 148, "dimension": [153, 160], "precis": [156, 240], "thu": [156, 228], "cheap": [157, 159], "contigu": 157, "might": [157, 227, 228], "past": [157, 158, 159], "around": 158, "clone": 158, "hood": 158, "utf": [158, 240], "charact": 158, "raw": [158, 228], "suitabl": 158, "comparison": [158, 159], "scheme": 158, "fraction": 158, "str2": 158, "100": [158, 234], "lexicograph": 158, "less": [158, 239], "greater": [158, 228], "concaten": 158, "primarili": 159, "dereferenc": [159, 165, 166], "th": 159, "unaffect": 159, "standardlistview": 161, "standardtableview": 161, "singl": [162, 228], "shot": 162, "equival": 162, "fire": 162, "calcul": 162, "along": [163, 227], "simpl": [164, 231], "introduc": 165, "keyword": 165, "anonym": [165, 240], "notat": 165, "lst": 165, "field": [165, 166, 229, 233, 240], "sure": [165, 166, 227, 233, 235, 238], "retain": [165, 166], "syntax": [165, 166, 232], "go": [165, 166], "field_nam": [165, 166], "field_valu": [165, 166], "16bit": 167, "subdirectori": 172, "variabl": [172, 227, 228, 233, 234, 235], "mit": [227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "2019": 227, "newer": [227, 235, 237], "autom": [227, 235], "offer": [227, 235], "linkag": [227, 235], "recommend": [227, 235], "ninja": [227, 235], "track": [227, 233, 235], "gninja": [227, 235], "cmake_gener": [227, 235], "download": [227, 237, 238], "linux": [227, 234], "x86": 227, "architectur": 227, "flexibl": [227, 239], "open": [227, 234, 237, 238], "latest": [227, 231, 238], "asset": 227, "xxx": 227, "x86_64": 227, "tar": [227, 238], "gz": [227, 238], "win64": 227, "ex": 227, "unpack": 227, "archiv": [227, 237], "cmake_prefix_path": [227, 238], "dcmake_prefix_path": 227, "find_packag": [227, 231, 238], "cmakelist": [227, 231, 234, 238], "txt": [227, 231, 234, 238], "lib": 227, "ld_library_path": 227, "learn": [227, 231, 232, 234, 235, 237], "guid": [227, 231, 234, 235], "rustc": [227, 235], "cargo": [227, 232, 233, 235], "project": [227, 231, 233, 234, 237, 238], "fetchcont": [227, 231], "snippet": [227, 238], "fetchcontent_declar": [227, 231], "git_repositori": [227, 231], "git": [227, 231], "upgrad": [227, 231], "git_tag": [227, 231], "source_subdir": [227, 231], "fetchcontent_makeavail": [227, 231], "regular": 227, "choic": 227, "optim": [227, 228, 239], "stack": [227, 233, 234], "winit": 227, "slint_feature_": 227, "setup": 227, "dslint_feature_backend_winit": 227, "dslint_feature_backend_winit_wayland": 227, "gui": [227, 234], "ccmake": 227, "more": [227, 229, 231, 232, 234, 235, 237, 239], "discov": 227, "disabl": [227, 235], "slint_enabled_featur": 227, "slint_disabled_featur": 227, "get_target_properti": 227, "backend_winit": 227, "in_list": 227, "similarli": 227, "processor": [227, 235], "corros": 227, "certain": 227, "furthermor": 227, "slint_library_cargo_flag": 227, "encapsul": 227, "abstract": [227, 229, 239], "inform": [227, 239], "slint_feature_backend_": 227, "stabl": [227, 228, 233], "ones": 227, "readi": 227, "upstream": 227, "yocto": 227, "sdk": [227, 236], "suffici": 227, "pleas": 227, "consult": 227, "now": 227, "toolchain": [227, 233, 234, 235, 236], "rustup": 227, "iconfigur": 227, "drust_cargo_target": [227, 235], "arm64": 227, "board": [227, 234, 237, 238], "targ": 227, "aarch64": 227, "gnu": 227, "cortexa53": 227, "crypto": 227, "poki": 227, "cd": [227, 234], "project_root": 227, "mkdir": 227, "dcmake_install_prefix": 227, "library_path": 228, "name1": 228, "lib1": 228, "name2": 228, "lib2": 228, "compilation_unit": 228, "num": 228, "tell": 228, "builtin": 228, "target_sourc": 228, "build": [228, 229, 231, 232, 234, 235, 236, 237, 238], "extend": 228, "the_window": 228, "thewindow": 228, "output": 228, "mycomponentlib": 228, "redirect": 228, "add_execut": [228, 231], "my_appl": [228, 231], "target_link_librari": [228, 231, 238], "customcompon": 228, "inclus": 228, "busi": [228, 232], "compier": 228, "These": [228, 229], "parallel": 228, "overal": 228, "howev": [228, 239], "split": 228, "across": 228, "abil": 228, "perform": [228, 239], "minimis": 228, "anywher": 228, "emb": [228, 235, 238], "slint_embed_resourc": [228, 238], "default_slint_embed_resourc": 228, "devic": [228, 232, 234, 237, 240], "ratio": [228, 240], "px": 228, "phx": 228, "desir": 228, "slint_scale_factor": 228, "shall": 228, "combin": 228, "dialog": 229, "get_": 229, "setter": [229, 239], "set_": 229, "invoke_": 229, "callback_nam": 229, "on_": 229, "function_nam": 229, "smart": [229, 239], "aliv": [229, 239], "complex": [229, 239], "yourself": 229, "let": 229, "samplecompon": 229, "counter": 229, "dash": 229, "underscor": 229, "user_nam": 229, "mayb": 229, "here": [229, 232, 233], "mainwindow": 229, "get_count": 229, "set_count": 229, "get_user_nam": 229, "set_user_nam": 229, "invoke_hello": 229, "on_hello": 229, "callback_handl": 229, "invoke_do_someth": 229, "omit": 229, "togeth": 229, "on_to_uppercas": 229, "per": 229, "slint_target_sourc": [231, 234, 238, 239], "cmake_minimum_requir": 231, "cxx": [231, 238], "three": [231, 236], "packag": [231, 234], "approach": [231, 239], "add_custom_command": 231, "post_build": 231, "cmake_command": 231, "target_runtime_dl": 231, "target_file_dir": 231, "command_expand_list": 231, "helloworld": [231, 232], "400px": [231, 232], "my_label": 231, "200px": [231, 232], "hello_world": [231, 234], "set_my_label": 231, "depth": 231, "walk": 231, "game": 231, "Of": 231, "cours": 231, "recip": 231, "toolkit": 232, "fluid": 232, "desktop": 232, "power": 232, "placement": 232, "flow": 232, "familiar": 232, "hierarchi": 232, "obligatori": 232, "visual": [232, 237], "studio": [232, 237], "featur": 232, "highlight": 232, "live": 232, "quick": 232, "cycl": 232, "viewer": 232, "tool": [232, 237, 238], "instal": [232, 234, 235, 237, 238], "awar": 233, "solv": 233, "z": 233, "nightli": 233, "solut": 233, "rustup_toolchain": 233, "toml": 233, "One": 233, "reason": [233, 234], "enough": 233, "ram": [233, 234, 238], "heap": 233, "big": 233, "8kib": 233, "invert": 233, "incompat": 233, "rgb565": 233, "littl": 233, "endian": 233, "esp32": [233, 234], "often": 233, "esp_lcd": 233, "accordingli": 233, "therefor": 233, "color_swap_16": [233, 234], "slintplatformconfigur": [233, 234, 238], "compiler_builtin": 233, "4c2482f45199cb1e": 233, "cgu": 233, "05": 233, "__udivdi3": 233, "0x0": 233, "libgcc": 233, "_udivdi3": 233, "o": 233, "wl": 233, "linker": 233, "target_link_opt": 233, "component_lib": [233, 234], "s3": 234, "prompt": 234, "instruct": [234, 235, 237], "maco": 234, "fall": 234, "io": 234, "book": 234, "html": 234, "soc": 234, "xtensa": 234, "risc": 234, "bare": 234, "bone": 234, "py": 234, "chipset": 234, "esp32s3": 234, "stdio": [234, 238], "esp_err": 234, "bsp": [234, 238], "bsp_lcd_draw_buff_s": 234, "draw_buf_s": 234, "bsp_lcd_h_re": 234, "config_bsp_lcd_draw_buf_height": 234, "app_main": 234, "esp_lcd_panel_io_handle_t": 234, "io_handl": 234, "esp_lcd_panel_handle_t": 234, "panel_handl": 234, "bsp_display_config_t": 234, "bsp_disp_cfg": 234, "max_transfer_sz": 234, "bsp_display_new": 234, "bsp_display_backlight_on": 234, "esp_lcd_touch_handle_t": 234, "touch_handl": 234, "bsp_touch_config_t": 234, "bsp_touch_cfg": 234, "bsp_touch_new": 234, "bsp_lcd_v_re": 234, "slint_esp_init": 234, "buffer1": 234, "appwindow": [234, 238], "verticalbox": [234, 238], "aboutslint": [234, 238], "18px": [234, 238], "idf_component_regist": 234, "include_dir": 234, "editor": 234, "menuconfig": 234, "config": 234, "tweak": 234, "spi": 234, "psram": 234, "q": 234, "save": 234, "sdkconfig": 234, "flash": [234, 237], "config_main_task_stack_s": 234, "monitor": 234, "observ": 234, "congratul": 234, "studi": [234, 235, 237], "aim": [235, 236], "those": 235, "dslint_feature_freestand": 235, "standard": 235, "dbuild_shared_lib": 235, "dslint_feature_renderer_softwar": 235, "ddefault_slint_embed_resourc": 235, "arm": [235, 237], "cortex": 235, "complet": [235, 238], "thumbv7em": [235, 238], "eabihf": [235, 238], "mcu": [236, 237], "highli": 236, "customiz": 236, "vendor": 236, "espressif": 236, "iot": 236, "framework": 236, "stm32": [236, 237], "stmicroelectron": 236, "stm32cube": [236, 238], "ecosystem": 236, "stm": 237, "bsp_t": 237, "bsp_lcd": 237, "hal_ltdc": 237, "stm32cubeclt": 237, "discoveri": 237, "kit": 237, "skeleton": [237, 238], "sampl": 237, "usag": 237, "basic": 237, "stm32h747i": 237, "disco": 237, "dual": 237, "core": 237, "m7": 237, "m4": 237, "lcd": 237, "zip": 237, "stm32h735g": 237, "dk": 237, "folder": 237, "preset": 237, "palett": 237, "panel": 237, "hit": 237, "rough": 238, "cube": 238, "stm32cubemx": 238, "peripher": 238, "prerequisit": 238, "ltdc": 238, "fmc": 238, "framebuff": 238, "web": 238, "browser": 238, "navig": 238, "appmain": 238, "set_target_properti": 238, "bsp_name": 238, "concret": 238, "stm32h735g_discoveri": 238, "target_compile_definit": 238, "slint_stm32_bsp_nam": 238, "bsp_lcd_initex": 238, "bsp_ts_init": 238, "slint_stm32_init": 238, "final": 238, "stm32h735g_discovery_lcd": 238, "stm32h735g_discovery_t": 238, "lcd_orientation_landscap": 238, "lcd_pixel_format_rgb565": 238, "lcd_default_width": 238, "lcd_default_height": 238, "error_handl": 238, "bsp_lcd_displayon": 238, "bsp_lcd_setactivelay": 238, "ts_init_t": 238, "ht": 238, "ts_swap_xi": 238, "accuraci": 238, "touchscreen": 238, "app_window": 238, "explain": 239, "veri": 239, "ahead": 239, "smallest": 239, "footprint": 239, "best": 239, "price": 239, "opportun": 239, "popul": 239, "slower": 239, "With": 239, "polymorph": 239, "commonli": 239, "consum": 239, "invoke_global_callback": 239, "summar": 240, "easili": 240, "physical_length": 240, "At": 240, "camelcas": 240, "mystruct": 240, "camel": 240, "myenum": 240, "beta": 240, "gamma": 240, "omicron": 240, "betagamma": 240}, "objects": {"": [[33, 0, 1, "c.SLINT_FEATURE_ACCESSIBILITY", "SLINT_FEATURE_ACCESSIBILITY"], [27, 0, 1, "c.SLINT_FEATURE_BACKEND_LINUXKMS", "SLINT_FEATURE_BACKEND_LINUXKMS"], [23, 0, 1, "c.SLINT_FEATURE_BACKEND_QT", "SLINT_FEATURE_BACKEND_QT"], [39, 0, 1, "c.SLINT_FEATURE_BACKEND_WINIT", "SLINT_FEATURE_BACKEND_WINIT"], [28, 0, 1, "c.SLINT_FEATURE_EXPERIMENTAL", "SLINT_FEATURE_EXPERIMENTAL"], [36, 0, 1, "c.SLINT_FEATURE_FREESTANDING", "SLINT_FEATURE_FREESTANDING"], [24, 0, 1, "c.SLINT_FEATURE_GETTEXT", "SLINT_FEATURE_GETTEXT"], [25, 0, 1, "c.SLINT_FEATURE_INTERPRETER", "SLINT_FEATURE_INTERPRETER"], [30, 0, 1, "c.SLINT_FEATURE_RENDERER_FEMTOVG", "SLINT_FEATURE_RENDERER_FEMTOVG"], [31, 0, 1, "c.SLINT_FEATURE_RENDERER_SKIA", "SLINT_FEATURE_RENDERER_SKIA"], [34, 0, 1, "c.SLINT_FEATURE_RENDERER_SOFTWARE", "SLINT_FEATURE_RENDERER_SOFTWARE"], [32, 0, 1, "c.SLINT_FEATURE_SYSTEM_TESTING", "SLINT_FEATURE_SYSTEM_TESTING"], [37, 0, 1, "c.SLINT_FEATURE_TESTING", "SLINT_FEATURE_TESTING"], [38, 0, 1, "c.SLINT_VERSION_MAJOR", "SLINT_VERSION_MAJOR"], [35, 0, 1, "c.SLINT_VERSION_MINOR", "SLINT_VERSION_MINOR"], [26, 0, 1, "c.SLINT_VERSION_PATCH", "SLINT_VERSION_PATCH"], [29, 0, 1, "c.SLINT_VERSION_STRING", "SLINT_VERSION_STRING"], [40, 0, 1, "c.assert_eq", "assert_eq"], [0, 1, 1, "_CPPv4N5slint5BrushE", "slint::Brush"], [0, 2, 1, "_CPPv4N5slint5Brush5BrushERK5Color", "slint::Brush::Brush"], [0, 2, 1, "_CPPv4N5slint5Brush5BrushEv", "slint::Brush::Brush"], [0, 3, 1, "_CPPv4N5slint5Brush5BrushERK5Color", "slint::Brush::Brush::color"], [0, 2, 1, "_CPPv4NK5slint5Brush8brighterEf", "slint::Brush::brighter"], [0, 3, 1, "_CPPv4NK5slint5Brush8brighterEf", "slint::Brush::brighter::factor"], [0, 2, 1, "_CPPv4NK5slint5Brush5colorEv", "slint::Brush::color"], [0, 2, 1, "_CPPv4NK5slint5Brush6darkerEf", "slint::Brush::darker"], [0, 3, 1, "_CPPv4NK5slint5Brush6darkerEf", "slint::Brush::darker::factor"], [0, 2, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!="], [0, 3, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!=::a"], [0, 3, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!=::b"], [0, 2, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator=="], [0, 3, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator==::a"], [0, 3, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator==::b"], [0, 2, 1, "_CPPv4NK5slint5Brush14transparentizeEf", "slint::Brush::transparentize"], [0, 3, 1, "_CPPv4NK5slint5Brush14transparentizeEf", "slint::Brush::transparentize::factor"], [0, 2, 1, "_CPPv4NK5slint5Brush10with_alphaEf", "slint::Brush::with_alpha"], [0, 3, 1, "_CPPv4NK5slint5Brush10with_alphaEf", "slint::Brush::with_alpha::alpha"], [54, 4, 1, "_CPPv4N5slint20CloseRequestResponseE", "slint::CloseRequestResponse"], [54, 5, 1, "_CPPv4N5slint20CloseRequestResponse10HideWindowE", "slint::CloseRequestResponse::HideWindow"], [54, 5, 1, "_CPPv4N5slint20CloseRequestResponse15KeepWindowShownE", "slint::CloseRequestResponse::KeepWindowShown"], [1, 1, 1, "_CPPv4N5slint5ColorE", "slint::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE", "slint::Color::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE", "slint::Color::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorEv", "slint::Color::Color"], [1, 3, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE", "slint::Color::Color::col"], [1, 3, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE", "slint::Color::Color::col"], [1, 2, 1, "_CPPv4NK5slint5Color5alphaEv", "slint::Color::alpha"], [1, 2, 1, "_CPPv4NK5slint5Color15as_argb_encodedEv", "slint::Color::as_argb_encoded"], [1, 2, 1, "_CPPv4NK5slint5Color4blueEv", "slint::Color::blue"], [1, 2, 1, "_CPPv4NK5slint5Color8brighterEf", "slint::Color::brighter"], [1, 3, 1, "_CPPv4NK5slint5Color8brighterEf", "slint::Color::brighter::factor"], [1, 2, 1, "_CPPv4NK5slint5Color6darkerEf", "slint::Color::darker"], [1, 3, 1, "_CPPv4NK5slint5Color6darkerEf", "slint::Color::darker::factor"], [1, 2, 1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t", "slint::Color::from_argb_encoded"], [1, 3, 1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t", "slint::Color::from_argb_encoded::argb_encoded"], [1, 2, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::alpha"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::blue"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::green"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::red"], [1, 2, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::alpha"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::blue"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::green"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::red"], [1, 2, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::a"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::h"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::s"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::v"], [1, 2, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::blue"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::green"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::red"], [1, 2, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::blue"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::green"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::red"], [1, 2, 1, "_CPPv4NK5slint5Color5greenEv", "slint::Color::green"], [1, 2, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix"], [1, 3, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix::factor"], [1, 3, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix::other"], [1, 2, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<"], [1, 3, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<::color"], [1, 3, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<::stream"], [1, 2, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator=="], [1, 3, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator==::lhs"], [1, 3, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator==::rhs"], [1, 2, 1, "_CPPv4NK5slint5Color3redEv", "slint::Color::red"], [1, 2, 1, "_CPPv4NK5slint5Color13to_argb_floatEv", "slint::Color::to_argb_float"], [1, 2, 1, "_CPPv4NK5slint5Color12to_argb_uintEv", "slint::Color::to_argb_uint"], [1, 2, 1, "_CPPv4NK5slint5Color7to_hsvaEv", "slint::Color::to_hsva"], [1, 2, 1, "_CPPv4NK5slint5Color14transparentizeEf", "slint::Color::transparentize"], [1, 3, 1, "_CPPv4NK5slint5Color14transparentizeEf", "slint::Color::transparentize::factor"], [1, 2, 1, "_CPPv4NK5slint5Color10with_alphaEf", "slint::Color::with_alpha"], [1, 3, 1, "_CPPv4NK5slint5Color10with_alphaEf", "slint::Color::with_alpha::alpha"], [2, 1, 1, "_CPPv4I0EN5slint15ComponentHandleE", "slint::ComponentHandle"], [2, 2, 1, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE", "slint::ComponentHandle::ComponentHandle"], [2, 3, 1, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE", "slint::ComponentHandle::ComponentHandle::inner"], [2, 6, 1, "_CPPv4I0EN5slint15ComponentHandleE", "slint::ComponentHandle::T"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandle8into_dynEv", "slint::ComponentHandle::into_dyn"], [2, 2, 1, "_CPPv4N5slint15ComponentHandlemlEv", "slint::ComponentHandle::operator*"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandlemlEv", "slint::ComponentHandle::operator*"], [2, 2, 1, "_CPPv4N5slint15ComponentHandleptEv", "slint::ComponentHandle::operator->"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandleptEv", "slint::ComponentHandle::operator->"], [3, 1, 1, "_CPPv4I0EN5slint19ComponentWeakHandleE", "slint::ComponentWeakHandle"], [3, 2, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE", "slint::ComponentWeakHandle::ComponentWeakHandle"], [3, 2, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleEv", "slint::ComponentWeakHandle::ComponentWeakHandle"], [3, 3, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE", "slint::ComponentWeakHandle::ComponentWeakHandle::other"], [3, 6, 1, "_CPPv4I0EN5slint19ComponentWeakHandleE", "slint::ComponentWeakHandle::T"], [3, 2, 1, "_CPPv4NK5slint19ComponentWeakHandle4lockEv", "slint::ComponentWeakHandle::lock"], [51, 4, 1, "_CPPv4N5slint13EventLoopModeE", "slint::EventLoopMode"], [51, 5, 1, "_CPPv4N5slint13EventLoopMode22QuitOnLastWindowClosedE", "slint::EventLoopMode::QuitOnLastWindowClosed"], [51, 5, 1, "_CPPv4N5slint13EventLoopMode12RunUntilQuitE", "slint::EventLoopMode::RunUntilQuit"], [4, 1, 1, "_CPPv4I0EN5slint11FilterModelE", "slint::FilterModel"], [4, 2, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel"], [4, 3, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel::filter_fn"], [4, 3, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel::source_model"], [4, 6, 1, "_CPPv4I0EN5slint11FilterModelE", "slint::FilterModel::ModelData"], [4, 2, 1, "_CPPv4N5slint11FilterModel5resetEv", "slint::FilterModel::reset"], [4, 2, 1, "_CPPv4NK5slint11FilterModel9row_countEv", "slint::FilterModel::row_count"], [4, 2, 1, "_CPPv4NK5slint11FilterModel8row_dataE6size_t", "slint::FilterModel::row_data"], [4, 3, 1, "_CPPv4NK5slint11FilterModel8row_dataE6size_t", "slint::FilterModel::row_data::i"], [4, 2, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data"], [4, 3, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data::i"], [4, 3, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data::value"], [4, 2, 1, "_CPPv4NK5slint11FilterModel12source_modelEv", "slint::FilterModel::source_model"], [4, 2, 1, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi", "slint::FilterModel::unfiltered_row"], [4, 3, 1, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi", "slint::FilterModel::unfiltered_row::filtered_row"], [52, 4, 1, "_CPPv4N5slint11GraphicsAPIE", "slint::GraphicsAPI"], [52, 5, 1, "_CPPv4N5slint11GraphicsAPI12NativeOpenGLE", "slint::GraphicsAPI::NativeOpenGL"], [147, 1, 1, "_CPPv4N5slint9HsvaColorE", "slint::HsvaColor"], [147, 7, 1, "_CPPv4N5slint9HsvaColor5alphaE", "slint::HsvaColor::alpha"], [147, 7, 1, "_CPPv4N5slint9HsvaColor3hueE", "slint::HsvaColor::hue"], [147, 7, 1, "_CPPv4N5slint9HsvaColor10saturationE", "slint::HsvaColor::saturation"], [147, 7, 1, "_CPPv4N5slint9HsvaColor5valueE", "slint::HsvaColor::value"], [148, 1, 1, "_CPPv4N5slint5ImageE", "slint::Image"], [148, 4, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOriginE", "slint::Image::BorrowedOpenGLTextureOrigin"], [148, 5, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin10BottomLeftE", "slint::Image::BorrowedOpenGLTextureOrigin::BottomLeft"], [148, 5, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin7TopLeftE", "slint::Image::BorrowedOpenGLTextureOrigin::TopLeft"], [148, 2, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE", "slint::Image::Image"], [148, 2, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE", "slint::Image::Image"], [148, 2, 1, "_CPPv4N5slint5Image5ImageEv", "slint::Image::Image"], [148, 3, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE", "slint::Image::Image::buffer"], [148, 3, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE", "slint::Image::Image::buffer"], [148, 2, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::origin"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::size"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::texture_id"], [148, 2, 1, "_CPPv4N5slint5Image14load_from_pathERK12SharedString", "slint::Image::load_from_path"], [148, 3, 1, "_CPPv4N5slint5Image14load_from_pathERK12SharedString", "slint::Image::load_from_path::file_path"], [148, 2, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!="], [148, 3, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!=::a"], [148, 3, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!=::b"], [148, 2, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator=="], [148, 3, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator==::a"], [148, 3, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator==::b"], [148, 2, 1, "_CPPv4NK5slint5Image4pathEv", "slint::Image::path"], [148, 2, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::bottom"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::left"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::right"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::top"], [148, 2, 1, "_CPPv4NK5slint5Image4sizeEv", "slint::Image::size"], [148, 2, 1, "_CPPv4NK5slint5Image7to_rgb8Ev", "slint::Image::to_rgb8"], [148, 2, 1, "_CPPv4NK5slint5Image8to_rgba8Ev", "slint::Image::to_rgba8"], [148, 2, 1, "_CPPv4NK5slint5Image22to_rgba8_premultipliedEv", "slint::Image::to_rgba8_premultiplied"], [149, 1, 1, "_CPPv4N5slint15LogicalPositionE", "slint::LogicalPosition"], [149, 2, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE", "slint::LogicalPosition::LogicalPosition"], [149, 2, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEv", "slint::LogicalPosition::LogicalPosition"], [149, 3, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE", "slint::LogicalPosition::LogicalPosition::p"], [150, 1, 1, "_CPPv4N5slint11LogicalSizeE", "slint::LogicalSize"], [150, 2, 1, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE", "slint::LogicalSize::LogicalSize"], [150, 3, 1, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE", "slint::LogicalSize::LogicalSize::s"], [5, 1, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel"], [5, 2, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel"], [5, 3, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel::map_fn"], [5, 3, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel::source_model"], [5, 6, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel::MappedModelData"], [5, 6, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel::SourceModelData"], [5, 2, 1, "_CPPv4N5slint8MapModel5resetEv", "slint::MapModel::reset"], [5, 2, 1, "_CPPv4NK5slint8MapModel9row_countEv", "slint::MapModel::row_count"], [5, 2, 1, "_CPPv4NK5slint8MapModel8row_dataE6size_t", "slint::MapModel::row_data"], [5, 3, 1, "_CPPv4NK5slint8MapModel8row_dataE6size_t", "slint::MapModel::row_data::i"], [5, 2, 1, "_CPPv4NK5slint8MapModel12source_modelEv", "slint::MapModel::source_model"], [6, 1, 1, "_CPPv4I0EN5slint5ModelE", "slint::Model"], [6, 2, 1, "_CPPv4N5slint5Model5ModelERK5Model", "slint::Model::Model"], [6, 2, 1, "_CPPv4N5slint5Model5ModelEv", "slint::Model::Model"], [6, 6, 1, "_CPPv4I0EN5slint5ModelE", "slint::Model::ModelData"], [6, 2, 1, "_CPPv4N5slint5ModelaSERK5Model", "slint::Model::operator="], [6, 2, 1, "_CPPv4N5slint5Model5resetEv", "slint::Model::reset"], [6, 2, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added"], [6, 3, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added::count"], [6, 3, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added::index"], [6, 2, 1, "_CPPv4N5slint5Model11row_changedE6size_t", "slint::Model::row_changed"], [6, 3, 1, "_CPPv4N5slint5Model11row_changedE6size_t", "slint::Model::row_changed::row"], [6, 2, 1, "_CPPv4NK5slint5Model9row_countEv", "slint::Model::row_count"], [6, 2, 1, "_CPPv4NK5slint5Model8row_dataE6size_t", "slint::Model::row_data"], [6, 3, 1, "_CPPv4NK5slint5Model8row_dataE6size_t", "slint::Model::row_data::i"], [6, 2, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed"], [6, 3, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed::count"], [6, 3, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed::index"], [6, 2, 1, "_CPPv4N5slint5Model12set_row_dataE6size_tRK9ModelData", "slint::Model::set_row_data"], [6, 2, 1, "_CPPv4N5slint5ModelD0Ev", "slint::Model::~Model"], [151, 1, 1, "_CPPv4N5slint16PhysicalPositionE", "slint::PhysicalPosition"], [151, 2, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE", "slint::PhysicalPosition::PhysicalPosition"], [151, 2, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEv", "slint::PhysicalPosition::PhysicalPosition"], [151, 3, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE", "slint::PhysicalPosition::PhysicalPosition::p"], [152, 1, 1, "_CPPv4N5slint12PhysicalSizeE", "slint::PhysicalSize"], [152, 2, 1, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE", "slint::PhysicalSize::PhysicalSize"], [152, 3, 1, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE", "slint::PhysicalSize::PhysicalSize::s"], [153, 1, 1, "_CPPv4I0EN5slint5PointE", "slint::Point"], [153, 6, 1, "_CPPv4I0EN5slint5PointE", "slint::Point::T"], [153, 2, 1, "_CPPv4NK5slint5PointeqERK5Point", "slint::Point::operator=="], [153, 3, 1, "_CPPv4NK5slint5PointeqERK5Point", "slint::Point::operator==::other"], [153, 7, 1, "_CPPv4N5slint5Point1xE", "slint::Point::x"], [153, 7, 1, "_CPPv4N5slint5Point1yE", "slint::Point::y"], [50, 4, 1, "_CPPv4N5slint18PointerEventButtonE", "slint::PointerEventButton"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton4BackE", "slint::PointerEventButton::Back"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton7ForwardE", "slint::PointerEventButton::Forward"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton4LeftE", "slint::PointerEventButton::Left"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton6MiddleE", "slint::PointerEventButton::Middle"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton5OtherE", "slint::PointerEventButton::Other"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton5RightE", "slint::PointerEventButton::Right"], [53, 4, 1, "_CPPv4N5slint14RenderingStateE", "slint::RenderingState"], [53, 5, 1, "_CPPv4N5slint14RenderingState14AfterRenderingE", "slint::RenderingState::AfterRendering"], [53, 5, 1, "_CPPv4N5slint14RenderingState15BeforeRenderingE", "slint::RenderingState::BeforeRendering"], [53, 5, 1, "_CPPv4N5slint14RenderingState14RenderingSetupE", "slint::RenderingState::RenderingSetup"], [53, 5, 1, "_CPPv4N5slint14RenderingState17RenderingTeardownE", "slint::RenderingState::RenderingTeardown"], [7, 1, 1, "_CPPv4I0EN5slint12ReverseModelE", "slint::ReverseModel"], [7, 6, 1, "_CPPv4I0EN5slint12ReverseModelE", "slint::ReverseModel::ModelData"], [7, 2, 1, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE", "slint::ReverseModel::ReverseModel"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE", "slint::ReverseModel::ReverseModel::source_model"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel9row_countEv", "slint::ReverseModel::row_count"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t", "slint::ReverseModel::row_data"], [7, 3, 1, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t", "slint::ReverseModel::row_data::i"], [7, 2, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data::i"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data::value"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel12source_modelEv", "slint::ReverseModel::source_model"], [154, 1, 1, "_CPPv4N5slint9Rgb8PixelE", "slint::Rgb8Pixel"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1bE", "slint::Rgb8Pixel::b"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1gE", "slint::Rgb8Pixel::g"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1rE", "slint::Rgb8Pixel::r"], [155, 1, 1, "_CPPv4N5slint10Rgba8PixelE", "slint::Rgba8Pixel"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1aE", "slint::Rgba8Pixel::a"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1bE", "slint::Rgba8Pixel::b"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1gE", "slint::Rgba8Pixel::g"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1rE", "slint::Rgba8Pixel::r"], [156, 1, 1, "_CPPv4I0EN5slint9RgbaColorE", "slint::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::col"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::color"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::color"], [156, 6, 1, "_CPPv4I0EN5slint9RgbaColorE", "slint::RgbaColor::T"], [156, 7, 1, "_CPPv4N5slint9RgbaColor5alphaE", "slint::RgbaColor::alpha"], [156, 7, 1, "_CPPv4N5slint9RgbaColor4blueE", "slint::RgbaColor::blue"], [156, 7, 1, "_CPPv4N5slint9RgbaColor5greenE", "slint::RgbaColor::green"], [156, 7, 1, "_CPPv4N5slint9RgbaColor3redE", "slint::RgbaColor::red"], [49, 4, 1, "_CPPv4N5slint25SetRenderingNotifierErrorE", "slint::SetRenderingNotifierError"], [49, 5, 1, "_CPPv4N5slint25SetRenderingNotifierError10AlreadySetE", "slint::SetRenderingNotifierError::AlreadySet"], [49, 5, 1, "_CPPv4N5slint25SetRenderingNotifierError11UnsupportedE", "slint::SetRenderingNotifierError::Unsupported"], [157, 1, 1, "_CPPv4I0EN5slint17SharedPixelBufferE", "slint::SharedPixelBuffer"], [157, 6, 1, "_CPPv4I0EN5slint17SharedPixelBufferE", "slint::SharedPixelBuffer::Pixel"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferEv", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::data"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer::height"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::height"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer::width"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::width"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer5beginEv", "slint::SharedPixelBuffer::begin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer5beginEv", "slint::SharedPixelBuffer::begin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer6cbeginEv", "slint::SharedPixelBuffer::cbegin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer4cendEv", "slint::SharedPixelBuffer::cend"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer3endEv", "slint::SharedPixelBuffer::end"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer3endEv", "slint::SharedPixelBuffer::end"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer6heightEv", "slint::SharedPixelBuffer::height"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer", "slint::SharedPixelBuffer::operator=="], [157, 3, 1, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer", "slint::SharedPixelBuffer::operator==::other"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer5widthEv", "slint::SharedPixelBuffer::width"], [158, 1, 1, "_CPPv4N5slint12SharedStringE", "slint::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEPKDu", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEPKc", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEv", "slint::SharedString::SharedString"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString", "slint::SharedString::SharedString::other"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringEPKDu", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringEPKc", "slint::SharedString::SharedString::s"], [158, 2, 1, "_CPPv4NK5slint12SharedString5beginEv", "slint::SharedString::begin"], [158, 2, 1, "_CPPv4NK5slint12SharedString4dataEv", "slint::SharedString::data"], [158, 2, 1, "_CPPv4NK5slint12SharedString5emptyEv", "slint::SharedString::empty"], [158, 2, 1, "_CPPv4NK5slint12SharedString3endEv", "slint::SharedString::end"], [158, 2, 1, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE", "slint::SharedString::ends_with"], [158, 3, 1, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE", "slint::SharedString::ends_with::prefix"], [158, 2, 1, "_CPPv4N5slint12SharedString11from_numberEd", "slint::SharedString::from_number"], [158, 3, 1, "_CPPv4N5slint12SharedString11from_numberEd", "slint::SharedString::from_number::n"], [158, 2, 1, "_CPPv4NK5slint12SharedStringcvNSt11string_viewEEv", "slint::SharedString::operator std::string_view"], [158, 2, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!="], [158, 3, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!=::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+"], [158, 2, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+::b"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringpLENSt11string_viewE", "slint::SharedString::operator+="], [158, 3, 1, "_CPPv4N5slint12SharedStringpLENSt11string_viewE", "slint::SharedString::operator+=::other"], [158, 2, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<"], [158, 3, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<"], [158, 3, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<::shared_string"], [158, 3, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<::stream"], [158, 2, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<="], [158, 3, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<=::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringaSENSt11string_viewE", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSEPKc", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSERK12SharedString", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSERR12SharedString", "slint::SharedString::operator="], [158, 3, 1, "_CPPv4N5slint12SharedStringaSERK12SharedString", "slint::SharedString::operator=::other"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSERR12SharedString", "slint::SharedString::operator=::other"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSENSt11string_viewE", "slint::SharedString::operator=::s"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSEPKc", "slint::SharedString::operator=::s"], [158, 2, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator=="], [158, 3, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator==::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator==::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>"], [158, 3, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>="], [158, 3, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>=::b"], [158, 2, 1, "_CPPv4NK5slint12SharedString4sizeEv", "slint::SharedString::size"], [158, 2, 1, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE", "slint::SharedString::starts_with"], [158, 3, 1, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE", "slint::SharedString::starts_with::prefix"], [158, 2, 1, "_CPPv4N5slint12SharedStringD0Ev", "slint::SharedString::~SharedString"], [159, 1, 1, "_CPPv4I0EN5slint12SharedVectorE", "slint::SharedVector"], [159, 2, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorEv", "slint::SharedVector::SharedVector"], [159, 6, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::InputIt"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE", "slint::SharedVector::SharedVector::args"], [159, 3, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::first"], [159, 3, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::last"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector", "slint::SharedVector::SharedVector::other"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t", "slint::SharedVector::SharedVector::size"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector::size"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector::value"], [159, 6, 1, "_CPPv4I0EN5slint12SharedVectorE", "slint::SharedVector::T"], [159, 2, 1, "_CPPv4NK5slint12SharedVector2atENSt6size_tE", "slint::SharedVector::at"], [159, 3, 1, "_CPPv4NK5slint12SharedVector2atENSt6size_tE", "slint::SharedVector::at::index"], [159, 2, 1, "_CPPv4N5slint12SharedVector5beginEv", "slint::SharedVector::begin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector5beginEv", "slint::SharedVector::begin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector6cbeginEv", "slint::SharedVector::cbegin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector4cendEv", "slint::SharedVector::cend"], [159, 2, 1, "_CPPv4N5slint12SharedVector5clearEv", "slint::SharedVector::clear"], [159, 2, 1, "_CPPv4NK5slint12SharedVector5emptyEv", "slint::SharedVector::empty"], [159, 2, 1, "_CPPv4N5slint12SharedVector3endEv", "slint::SharedVector::end"], [159, 2, 1, "_CPPv4NK5slint12SharedVector3endEv", "slint::SharedVector::end"], [159, 2, 1, "_CPPv4N5slint12SharedVectoraSERK12SharedVector", "slint::SharedVector::operator="], [159, 2, 1, "_CPPv4N5slint12SharedVectoraSERR12SharedVector", "slint::SharedVector::operator="], [159, 3, 1, "_CPPv4N5slint12SharedVectoraSERK12SharedVector", "slint::SharedVector::operator=::other"], [159, 3, 1, "_CPPv4N5slint12SharedVectoraSERR12SharedVector", "slint::SharedVector::operator=::other"], [159, 2, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator=="], [159, 3, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator==::a"], [159, 3, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator==::b"], [159, 2, 1, "_CPPv4N5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]"], [159, 2, 1, "_CPPv4NK5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]"], [159, 3, 1, "_CPPv4N5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]::index"], [159, 3, 1, "_CPPv4NK5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]::index"], [159, 2, 1, "_CPPv4N5slint12SharedVector9push_backERK1T", "slint::SharedVector::push_back"], [159, 2, 1, "_CPPv4N5slint12SharedVector9push_backERR1T", "slint::SharedVector::push_back"], [159, 3, 1, "_CPPv4N5slint12SharedVector9push_backERK1T", "slint::SharedVector::push_back::value"], [159, 3, 1, "_CPPv4N5slint12SharedVector9push_backERR1T", "slint::SharedVector::push_back::value"], [159, 2, 1, "_CPPv4NK5slint12SharedVector4sizeEv", "slint::SharedVector::size"], [159, 2, 1, "_CPPv4N5slint12SharedVectorD0Ev", "slint::SharedVector::~SharedVector"], [160, 1, 1, "_CPPv4I0EN5slint4SizeE", "slint::Size"], [160, 6, 1, "_CPPv4I0EN5slint4SizeE", "slint::Size::T"], [160, 7, 1, "_CPPv4N5slint4Size6heightE", "slint::Size::height"], [160, 2, 1, "_CPPv4NK5slint4SizeeqERK4Size", "slint::Size::operator=="], [160, 3, 1, "_CPPv4NK5slint4SizeeqERK4Size", "slint::Size::operator==::other"], [160, 7, 1, "_CPPv4N5slint4Size5widthE", "slint::Size::width"], [8, 1, 1, "_CPPv4I0EN5slint9SortModelE", "slint::SortModel"], [8, 6, 1, "_CPPv4I0EN5slint9SortModelE", "slint::SortModel::ModelData"], [8, 2, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel"], [8, 3, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel::comp"], [8, 3, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel::source_model"], [8, 2, 1, "_CPPv4N5slint9SortModel5resetEv", "slint::SortModel::reset"], [8, 2, 1, "_CPPv4NK5slint9SortModel9row_countEv", "slint::SortModel::row_count"], [8, 2, 1, "_CPPv4NK5slint9SortModel8row_dataE6size_t", "slint::SortModel::row_data"], [8, 3, 1, "_CPPv4NK5slint9SortModel8row_dataE6size_t", "slint::SortModel::row_data::i"], [8, 2, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data"], [8, 3, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data::i"], [8, 3, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data::value"], [8, 2, 1, "_CPPv4NK5slint9SortModel12source_modelEv", "slint::SortModel::source_model"], [8, 2, 1, "_CPPv4NK5slint9SortModel12unsorted_rowEi", "slint::SortModel::unsorted_row"], [8, 3, 1, "_CPPv4NK5slint9SortModel12unsorted_rowEi", "slint::SortModel::unsorted_row::sorted_row_index"], [161, 1, 1, "_CPPv4N5slint20StandardListViewItemE", "slint::StandardListViewItem"], [161, 7, 1, "_CPPv4N5slint20StandardListViewItem4textE", "slint::StandardListViewItem::text"], [162, 1, 1, "_CPPv4N5slint5TimerE", "slint::Timer"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer"], [162, 2, 1, "_CPPv4N5slint5Timer5TimerERK5Timer", "slint::Timer::Timer"], [162, 2, 1, "_CPPv4N5slint5Timer5TimerEv", "slint::Timer::Timer"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::interval"], [162, 2, 1, "_CPPv4NK5slint5Timer8intervalEv", "slint::Timer::interval"], [162, 2, 1, "_CPPv4N5slint5TimeraSERK5Timer", "slint::Timer::operator="], [162, 2, 1, "_CPPv4N5slint5Timer7restartEv", "slint::Timer::restart"], [162, 2, 1, "_CPPv4NK5slint5Timer7runningEv", "slint::Timer::running"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::duration"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::interval"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::mode"], [162, 2, 1, "_CPPv4N5slint5Timer4stopEv", "slint::Timer::stop"], [162, 2, 1, "_CPPv4N5slint5TimerD0Ev", "slint::Timer::~Timer"], [9, 1, 1, "_CPPv4I0EN5slint11VectorModelE", "slint::VectorModel"], [9, 6, 1, "_CPPv4I0EN5slint11VectorModelE", "slint::VectorModel::ModelData"], [9, 2, 1, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE", "slint::VectorModel::VectorModel"], [9, 2, 1, "_CPPv4N5slint11VectorModel11VectorModelEv", "slint::VectorModel::VectorModel"], [9, 3, 1, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE", "slint::VectorModel::VectorModel::array"], [9, 2, 1, "_CPPv4N5slint11VectorModel5clearEv", "slint::VectorModel::clear"], [9, 2, 1, "_CPPv4N5slint11VectorModel5eraseE6size_t", "slint::VectorModel::erase"], [9, 3, 1, "_CPPv4N5slint11VectorModel5eraseE6size_t", "slint::VectorModel::erase::index"], [9, 2, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert"], [9, 3, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert::index"], [9, 3, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert::value"], [9, 2, 1, "_CPPv4N5slint11VectorModel9push_backERK9ModelData", "slint::VectorModel::push_back"], [9, 3, 1, "_CPPv4N5slint11VectorModel9push_backERK9ModelData", "slint::VectorModel::push_back::value"], [9, 2, 1, "_CPPv4NK5slint11VectorModel9row_countEv", "slint::VectorModel::row_count"], [9, 2, 1, "_CPPv4NK5slint11VectorModel8row_dataE6size_t", "slint::VectorModel::row_data"], [9, 3, 1, "_CPPv4NK5slint11VectorModel8row_dataE6size_t", "slint::VectorModel::row_data::i"], [9, 2, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data"], [9, 3, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data::i"], [9, 3, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data::value"], [9, 2, 1, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE", "slint::VectorModel::set_vector"], [9, 3, 1, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE", "slint::VectorModel::set_vector::array"], [10, 1, 1, "_CPPv4N5slint6WindowE", "slint::Window"], [10, 2, 1, "_CPPv4N5slint6Window6WindowERK6Window", "slint::Window::Window"], [10, 2, 1, "_CPPv4N5slint6Window6WindowERR6Window", "slint::Window::Window"], [10, 3, 1, "_CPPv4N5slint6Window6WindowERK6Window", "slint::Window::Window::other"], [10, 3, 1, "_CPPv4N5slint6Window6WindowERR6Window", "slint::Window::Window::other"], [10, 2, 1, "_CPPv4N5slint6Window30dispatch_close_requested_eventEv", "slint::Window::dispatch_close_requested_event"], [10, 2, 1, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString", "slint::Window::dispatch_key_press_event"], [10, 3, 1, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString", "slint::Window::dispatch_key_press_event::text"], [10, 2, 1, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString", "slint::Window::dispatch_key_press_repeat_event"], [10, 3, 1, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString", "slint::Window::dispatch_key_press_repeat_event::text"], [10, 2, 1, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString", "slint::Window::dispatch_key_release_event"], [10, 3, 1, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString", "slint::Window::dispatch_key_release_event::text"], [10, 2, 1, "_CPPv4N5slint6Window27dispatch_pointer_exit_eventEv", "slint::Window::dispatch_pointer_exit_event"], [10, 2, 1, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition", "slint::Window::dispatch_pointer_move_event"], [10, 3, 1, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition", "slint::Window::dispatch_pointer_move_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event"], [10, 3, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event::button"], [10, 3, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event"], [10, 3, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event::button"], [10, 3, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::delta_x"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::delta_y"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE", "slint::Window::dispatch_resize_event"], [10, 3, 1, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE", "slint::Window::dispatch_resize_event::s"], [10, 2, 1, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf", "slint::Window::dispatch_scale_factor_change_event"], [10, 3, 1, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf", "slint::Window::dispatch_scale_factor_change_event::factor"], [10, 2, 1, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb", "slint::Window::dispatch_window_active_changed_event"], [10, 3, 1, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb", "slint::Window::dispatch_window_active_changed_event::active"], [10, 2, 1, "_CPPv4NK5slint6Window21has_active_animationsEv", "slint::Window::has_active_animations"], [10, 2, 1, "_CPPv4N5slint6Window4hideEv", "slint::Window::hide"], [10, 2, 1, "_CPPv4NK5slint6Window13is_fullscreenEv", "slint::Window::is_fullscreen"], [10, 2, 1, "_CPPv4NK5slint6Window12is_maximizedEv", "slint::Window::is_maximized"], [10, 2, 1, "_CPPv4NK5slint6Window12is_minimizedEv", "slint::Window::is_minimized"], [10, 2, 1, "_CPPv4NK5slint6Window10is_visibleEv", "slint::Window::is_visible"], [10, 2, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested"], [10, 6, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested::F"], [10, 3, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested::callback"], [10, 2, 1, "_CPPv4N5slint6WindowaSERK6Window", "slint::Window::operator="], [10, 2, 1, "_CPPv4N5slint6WindowaSERR6Window", "slint::Window::operator="], [10, 3, 1, "_CPPv4N5slint6WindowaSERK6Window", "slint::Window::operator=::other"], [10, 3, 1, "_CPPv4N5slint6WindowaSERR6Window", "slint::Window::operator=::other"], [10, 2, 1, "_CPPv4NK5slint6Window8positionEv", "slint::Window::position"], [10, 2, 1, "_CPPv4NK5slint6Window14request_redrawEv", "slint::Window::request_redraw"], [10, 2, 1, "_CPPv4NK5slint6Window12scale_factorEv", "slint::Window::scale_factor"], [10, 2, 1, "_CPPv4N5slint6Window14set_fullscreenEb", "slint::Window::set_fullscreen"], [10, 3, 1, "_CPPv4N5slint6Window14set_fullscreenEb", "slint::Window::set_fullscreen::fullscreen"], [10, 2, 1, "_CPPv4N5slint6Window13set_maximizedEb", "slint::Window::set_maximized"], [10, 3, 1, "_CPPv4N5slint6Window13set_maximizedEb", "slint::Window::set_maximized::maximized"], [10, 2, 1, "_CPPv4N5slint6Window13set_minimizedEb", "slint::Window::set_minimized"], [10, 3, 1, "_CPPv4N5slint6Window13set_minimizedEb", "slint::Window::set_minimized::minimized"], [10, 2, 1, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE", "slint::Window::set_position"], [10, 2, 1, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE", "slint::Window::set_position"], [10, 3, 1, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE", "slint::Window::set_position::pos"], [10, 3, 1, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE", "slint::Window::set_position::pos"], [10, 2, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier"], [10, 6, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier::F"], [10, 3, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier::callback"], [10, 2, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE", "slint::Window::set_size"], [10, 2, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE", "slint::Window::set_size"], [10, 3, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE", "slint::Window::set_size::size"], [10, 3, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE", "slint::Window::set_size::size"], [10, 2, 1, "_CPPv4N5slint6Window4showEv", "slint::Window::show"], [10, 2, 1, "_CPPv4NK5slint6Window4sizeEv", "slint::Window::size"], [10, 2, 1, "_CPPv4N5slint6WindowD0Ev", "slint::Window::~Window"], [99, 2, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop"], [99, 6, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop::Functor"], [99, 3, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop::f"], [11, 1, 1, "_CPPv4N5slint11interpreter17ComponentCompilerE", "slint::interpreter::ComponentCompiler"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17ComponentCompilerEv", "slint::interpreter::ComponentCompiler::ComponentCompiler"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_path"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_path::path"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source::path"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source::source_code"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler11diagnosticsEv", "slint::interpreter::ComponentCompiler::diagnostics"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler13include_pathsEv", "slint::interpreter::ComponentCompiler::include_paths"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE", "slint::interpreter::ComponentCompiler::set_include_paths"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE", "slint::interpreter::ComponentCompiler::set_include_paths::paths"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_style"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_style::style"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_translation_domain"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_translation_domain::domain"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler5styleEv", "slint::interpreter::ComponentCompiler::style"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompilerD0Ev", "slint::interpreter::ComponentCompiler::~ComponentCompiler"], [12, 1, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionE", "slint::interpreter::ComponentDefinition"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::ComponentDefinition"], [12, 3, 1, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::ComponentDefinition::other"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition9callbacksEv", "slint::interpreter::ComponentDefinition::callbacks"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition6createEv", "slint::interpreter::ComponentDefinition::create"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition9functionsEv", "slint::interpreter::ComponentDefinition::functions"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_callbacks"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_callbacks::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_functions"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_functions::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_properties"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_properties::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition7globalsEv", "slint::interpreter::ComponentDefinition::globals"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition4nameEv", "slint::interpreter::ComponentDefinition::name"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::operator="], [12, 3, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::operator=::other"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition10propertiesEv", "slint::interpreter::ComponentDefinition::properties"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionD0Ev", "slint::interpreter::ComponentDefinition::~ComponentDefinition"], [13, 1, 1, "_CPPv4N5slint11interpreter17ComponentInstanceE", "slint::interpreter::ComponentInstance"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance10definitionEv", "slint::interpreter::ComponentInstance::definition"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property::global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property::prop_name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE", "slint::interpreter::ComponentInstance::get_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE", "slint::interpreter::ComponentInstance::get_property::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance4hideEv", "slint::interpreter::ComponentInstance::hide"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke::args"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::args"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::callable_name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::global"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance7qwidgetEv", "slint::interpreter::ComponentInstance::qwidget"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance3runEv", "slint::interpreter::ComponentInstance::run"], [13, 2, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback"], [13, 6, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::F"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::callback"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::name"], [13, 2, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback"], [13, 6, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::F"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::callback"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::global"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::prop_name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::value"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property::name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property::value"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance4showEv", "slint::interpreter::ComponentInstance::show"], [13, 2, 1, "_CPPv4N5slint11interpreter17ComponentInstance6windowEv", "slint::interpreter::ComponentInstance::window"], [163, 1, 1, "_CPPv4N5slint11interpreter10DiagnosticE", "slint::interpreter::Diagnostic"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic6columnE", "slint::interpreter::Diagnostic::column"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic5levelE", "slint::interpreter::Diagnostic::level"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic4lineE", "slint::interpreter::Diagnostic::line"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic7messageE", "slint::interpreter::Diagnostic::message"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic11source_fileE", "slint::interpreter::Diagnostic::source_file"], [47, 4, 1, "_CPPv4N5slint11interpreter15DiagnosticLevelE", "slint::interpreter::DiagnosticLevel"], [47, 5, 1, "_CPPv4N5slint11interpreter15DiagnosticLevel5ErrorE", "slint::interpreter::DiagnosticLevel::Error"], [47, 5, 1, "_CPPv4N5slint11interpreter15DiagnosticLevel7WarningE", "slint::interpreter::DiagnosticLevel::Warning"], [164, 1, 1, "_CPPv4N5slint11interpreter18PropertyDescriptorE", "slint::interpreter::PropertyDescriptor"], [164, 7, 1, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_nameE", "slint::interpreter::PropertyDescriptor::property_name"], [164, 7, 1, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_typeE", "slint::interpreter::PropertyDescriptor::property_type"], [165, 1, 1, "_CPPv4N5slint11interpreter6StructE", "slint::interpreter::Struct"], [165, 2, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructEv", "slint::interpreter::Struct::Struct"], [165, 6, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::InputIterator"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE", "slint::interpreter::Struct::Struct::args"], [165, 3, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::end"], [165, 3, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::it"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct", "slint::interpreter::Struct::Struct::other"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct", "slint::interpreter::Struct::Struct::other"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct5beginEv", "slint::interpreter::Struct::begin"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct3endEv", "slint::interpreter::Struct::end"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE", "slint::interpreter::Struct::get_field"], [165, 3, 1, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE", "slint::interpreter::Struct::get_field::name"], [165, 1, 1, "_CPPv4N5slint11interpreter6Struct8iteratorE", "slint::interpreter::Struct::iterator"], [166, 1, 1, "_CPPv4N5slint11interpreter6Struct8iteratorE", "slint::interpreter::Struct::iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator", "slint::interpreter::Struct::iterator::iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator", "slint::interpreter::Struct::iterator::iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator::other"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::a"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::a"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::b"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::b"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv", "slint::interpreter::Struct::iterator::operator*"], [166, 2, 1, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv", "slint::interpreter::Struct::iterator::operator*"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorppEv", "slint::interpreter::Struct::iterator::operator++"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorppEv", "slint::interpreter::Struct::iterator::operator++"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator", "slint::interpreter::Struct::iterator::operator="], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator", "slint::interpreter::Struct::iterator::operator="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator=::other"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator=::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator=="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator=="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::a"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::a"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::b"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::b"], [165, 8, 1, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE", "slint::interpreter::Struct::iterator::value_type"], [166, 8, 1, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE", "slint::interpreter::Struct::iterator::value_type"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev", "slint::interpreter::Struct::iterator::~iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev", "slint::interpreter::Struct::iterator::~iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6StructaSERK6Struct", "slint::interpreter::Struct::operator="], [165, 2, 1, "_CPPv4N5slint11interpreter6StructaSERR6Struct", "slint::interpreter::Struct::operator="], [165, 3, 1, "_CPPv4N5slint11interpreter6StructaSERK6Struct", "slint::interpreter::Struct::operator=::other"], [165, 3, 1, "_CPPv4N5slint11interpreter6StructaSERR6Struct", "slint::interpreter::Struct::operator=::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field::name"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field::value"], [165, 2, 1, "_CPPv4N5slint11interpreter6StructD0Ev", "slint::interpreter::Struct::~Struct"], [14, 1, 1, "_CPPv4N5slint11interpreter5ValueE", "slint::interpreter::Value"], [14, 8, 1, "_CPPv4N5slint11interpreter5Value4TypeE", "slint::interpreter::Value::Type"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Image", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Value", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERR5Value", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEb", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEd", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEi", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEv", "slint::interpreter::Value::Value"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEb", "slint::interpreter::Value::Value::b"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE", "slint::interpreter::Value::Value::brush"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Image", "slint::interpreter::Value::Value::img"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE", "slint::interpreter::Value::Value::m"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Value", "slint::interpreter::Value::Value::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERR5Value", "slint::interpreter::Value::Value::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString", "slint::interpreter::Value::Value::str"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct", "slint::interpreter::Value::Value::struc"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE", "slint::interpreter::Value::Value::v"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEd", "slint::interpreter::Value::Value::value"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEi", "slint::interpreter::Value::Value::value"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueaSERK5Value", "slint::interpreter::Value::operator="], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueaSERR5Value", "slint::interpreter::Value::operator="], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueaSERK5Value", "slint::interpreter::Value::operator=::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueaSERR5Value", "slint::interpreter::Value::operator=::other"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator=="], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator==::a"], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator==::b"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_arrayEv", "slint::interpreter::Value::to_array"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value7to_boolEv", "slint::interpreter::Value::to_bool"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_brushEv", "slint::interpreter::Value::to_brush"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_imageEv", "slint::interpreter::Value::to_image"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_numberEv", "slint::interpreter::Value::to_number"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_stringEv", "slint::interpreter::Value::to_string"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_structEv", "slint::interpreter::Value::to_struct"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value4typeEv", "slint::interpreter::Value::type"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueD0Ev", "slint::interpreter::Value::~Value"], [46, 4, 1, "_CPPv4N5slint11interpreter9ValueTypeE", "slint::interpreter::ValueType"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType4BoolE", "slint::interpreter::ValueType::Bool"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5BrushE", "slint::interpreter::ValueType::Brush"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5ImageE", "slint::interpreter::ValueType::Image"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5ModelE", "slint::interpreter::ValueType::Model"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6NumberE", "slint::interpreter::ValueType::Number"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5OtherE", "slint::interpreter::ValueType::Other"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6StringE", "slint::interpreter::ValueType::String"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6StructE", "slint::interpreter::ValueType::Struct"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType4VoidE", "slint::interpreter::ValueType::Void"], [98, 2, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop"], [98, 6, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop::Functor"], [98, 3, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop::f"], [15, 1, 1, "_CPPv4N5slint8platform16AbstractRendererE", "slint::platform::AbstractRenderer"], [16, 1, 1, "_CPPv4N5slint8platform18NativeWindowHandleE", "slint::platform::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERK18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleEv", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle::other"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit::nsview"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit::nswindow"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland::display"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland::surface"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32::hinstance"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32::hwnd"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::connection"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::screen"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::visual_id"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::window"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::display"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::screen"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::visual_id"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::window"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERK18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator="], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator="], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator=::other"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleD0Ev", "slint::platform::NativeWindowHandle::~NativeWindowHandle"], [17, 1, 1, "_CPPv4N5slint8platform8PlatformE", "slint::platform::Platform"], [17, 4, 1, "_CPPv4N5slint8platform8Platform9ClipboardE", "slint::platform::Platform::Clipboard"], [17, 5, 1, "_CPPv4N5slint8platform8Platform9Clipboard16DefaultClipboardE", "slint::platform::Platform::Clipboard::DefaultClipboard"], [17, 5, 1, "_CPPv4N5slint8platform8Platform9Clipboard18SelectionClipboardE", "slint::platform::Platform::Clipboard::SelectionClipboard"], [17, 2, 1, "_CPPv4N5slint8platform8Platform8PlatformERK8Platform", "slint::platform::Platform::Platform"], [17, 2, 1, "_CPPv4N5slint8platform8Platform8PlatformEv", "slint::platform::Platform::Platform"], [17, 1, 1, "_CPPv4N5slint8platform8Platform4TaskE", "slint::platform::Platform::Task"], [18, 1, 1, "_CPPv4N5slint8platform8Platform4TaskE", "slint::platform::Platform::Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task", "slint::platform::Platform::Task::Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task", "slint::platform::Platform::Task::Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task"], [17, 3, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task::other"], [18, 3, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task::other"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task", "slint::platform::Platform::Task::operator="], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator="], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task", "slint::platform::Platform::Task::operator="], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator="], [17, 3, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator=::other"], [18, 3, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator=::other"], [17, 2, 1, "_CPPv4NO5slint8platform8Platform4Task3runEv", "slint::platform::Platform::Task::run"], [18, 2, 1, "_CPPv4NO5slint8platform8Platform4Task3runEv", "slint::platform::Platform::Task::run"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskD0Ev", "slint::platform::Platform::Task::~Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskD0Ev", "slint::platform::Platform::Task::~Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform14clipboard_textE9Clipboard", "slint::platform::Platform::clipboard_text"], [17, 2, 1, "_CPPv4N5slint8platform8Platform21create_window_adapterEv", "slint::platform::Platform::create_window_adapter"], [17, 2, 1, "_CPPv4N5slint8platform8Platform20duration_since_startEv", "slint::platform::Platform::duration_since_start"], [17, 2, 1, "_CPPv4N5slint8platform8PlatformaSERK8Platform", "slint::platform::Platform::operator="], [17, 2, 1, "_CPPv4N5slint8platform8Platform15quit_event_loopEv", "slint::platform::Platform::quit_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform14run_event_loopEv", "slint::platform::Platform::run_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform17run_in_event_loopE4Task", "slint::platform::Platform::run_in_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform18set_clipboard_textERK12SharedString9Clipboard", "slint::platform::Platform::set_clipboard_text"], [17, 2, 1, "_CPPv4N5slint8platform8PlatformD0Ev", "slint::platform::Platform::~Platform"], [167, 1, 1, "_CPPv4N5slint8platform11Rgb565PixelE", "slint::platform::Rgb565Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel", "slint::platform::Rgb565Pixel::Rgb565Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelEv", "slint::platform::Rgb565Pixel::Rgb565Pixel"], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel", "slint::platform::Rgb565Pixel::Rgb565Pixel::pixel"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1bE", "slint::platform::Rgb565Pixel::b"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel4blueEv", "slint::platform::Rgb565Pixel::blue"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1gE", "slint::platform::Rgb565Pixel::g"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel5greenEv", "slint::platform::Rgb565Pixel::green"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixelcv9Rgb8PixelEv", "slint::platform::Rgb565Pixel::operator Rgb8Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator=="], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator==::lhs"], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator==::rhs"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1rE", "slint::platform::Rgb565Pixel::r"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel3redEv", "slint::platform::Rgb565Pixel::red"], [19, 1, 1, "_CPPv4N5slint8platform12SkiaRendererE", "slint::platform::SkiaRenderer"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK12SkiaRenderer", "slint::platform::SkiaRenderer::SkiaRenderer"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer"], [19, 3, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer::initial_size"], [19, 3, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer::window_handle"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRendereraSERK12SkiaRenderer", "slint::platform::SkiaRenderer::operator="], [19, 2, 1, "_CPPv4NK5slint8platform12SkiaRenderer6renderEv", "slint::platform::SkiaRenderer::render"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRendererD0Ev", "slint::platform::SkiaRenderer::~SkiaRenderer"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRendererE", "slint::platform::SoftwareRenderer"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE", "slint::platform::SoftwareRenderer::PhysicalRegion"], [168, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE", "slint::platform::SoftwareRenderer::PhysicalRegion"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [168, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [169, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [20, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [168, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [169, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [20, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [168, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [169, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_origin"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_origin"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_size"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_size"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv", "slint::platform::SoftwareRenderer::PhysicalRegion::rectangles"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv", "slint::platform::SoftwareRenderer::PhysicalRegion::rectangles"], [20, 4, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotationE", "slint::platform::SoftwareRenderer::RenderingRotation"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation10NoRotationE", "slint::platform::SoftwareRenderer::RenderingRotation::NoRotation"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate180E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate180"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate270E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate270"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation8Rotate90E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate90"], [20, 4, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferTypeE", "slint::platform::SoftwareRenderer::RepaintBufferType"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType9NewBufferE", "slint::platform::SoftwareRenderer::RepaintBufferType::NewBuffer"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType12ReusedBufferE", "slint::platform::SoftwareRenderer::RepaintBufferType::ReusedBuffer"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType14SwappedBuffersE", "slint::platform::SoftwareRenderer::RepaintBufferType::SwappedBuffers"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType", "slint::platform::SoftwareRenderer::SoftwareRenderer"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererERK16SoftwareRenderer", "slint::platform::SoftwareRenderer::SoftwareRenderer"], [20, 3, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType", "slint::platform::SoftwareRenderer::SoftwareRenderer::buffer_type"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRendereraSERK16SoftwareRenderer", "slint::platform::SoftwareRenderer::operator="], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render::buffer"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render::buffer"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render::pixel_stride"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render::pixel_stride"], [20, 2, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line"], [20, 6, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line::Callback"], [20, 3, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line::process_line_callback"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation", "slint::platform::SoftwareRenderer::set_rendering_rotation"], [20, 3, 1, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation", "slint::platform::SoftwareRenderer::set_rendering_rotation::rotation"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRendererD0Ev", "slint::platform::SoftwareRenderer::~SoftwareRenderer"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapterE", "slint::platform::WindowAdapter"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter13WindowAdapterEv", "slint::platform::WindowAdapter::WindowAdapter"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE", "slint::platform::WindowAdapter::WindowProperties"], [170, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE", "slint::platform::WindowAdapter::WindowProperties"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [170, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [171, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv", "slint::platform::WindowAdapter::WindowProperties::background"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv", "slint::platform::WindowAdapter::WindowProperties::background"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::fullscreen"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::fullscreen"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::is_fullscreen"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::is_fullscreen"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv", "slint::platform::WindowAdapter::WindowProperties::is_maximized"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv", "slint::platform::WindowAdapter::WindowProperties::is_maximized"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv", "slint::platform::WindowAdapter::WindowProperties::is_minimized"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv", "slint::platform::WindowAdapter::WindowProperties::is_minimized"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv", "slint::platform::WindowAdapter::WindowProperties::layout_constraints"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv", "slint::platform::WindowAdapter::WindowProperties::layout_constraints"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv", "slint::platform::WindowAdapter::WindowProperties::title"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv", "slint::platform::WindowAdapter::WindowProperties::title"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8positionEv", "slint::platform::WindowAdapter::position"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8rendererEv", "slint::platform::WindowAdapter::renderer"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter14request_redrawEv", "slint::platform::WindowAdapter::request_redraw"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter12set_positionEN5slint16PhysicalPositionE", "slint::platform::WindowAdapter::set_position"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8set_sizeEN5slint12PhysicalSizeE", "slint::platform::WindowAdapter::set_size"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter11set_visibleEb", "slint::platform::WindowAdapter::set_visible"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter4sizeEv", "slint::platform::WindowAdapter::size"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter24update_window_propertiesERK16WindowProperties", "slint::platform::WindowAdapter::update_window_properties"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter6windowEv", "slint::platform::WindowAdapter::window"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter6windowEv", "slint::platform::WindowAdapter::window"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapterD0Ev", "slint::platform::WindowAdapter::~WindowAdapter"], [93, 2, 1, "_CPPv4N5slint8platform32duration_until_next_timer_updateEv", "slint::platform::duration_until_next_timer_update"], [95, 2, 1, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE", "slint::platform::set_platform"], [95, 3, 1, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE", "slint::platform::set_platform::platform"], [94, 2, 1, "_CPPv4N5slint8platform28update_timers_and_animationsEv", "slint::platform::update_timers_and_animations"], [97, 2, 1, "_CPPv4N5slint15quit_event_loopEv", "slint::quit_event_loop"], [100, 2, 1, "_CPPv4N5slint14run_event_loopE13EventLoopMode", "slint::run_event_loop"], [100, 3, 1, "_CPPv4N5slint14run_event_loopE13EventLoopMode", "slint::run_event_loop::mode"], [48, 4, 1, "_CPPv4N5slint7testing14AccessibleRoleE", "slint::testing::AccessibleRole"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6ButtonE", "slint::testing::AccessibleRole::Button"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole8CheckboxE", "slint::testing::AccessibleRole::Checkbox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole8ComboboxE", "slint::testing::AccessibleRole::Combobox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4ListE", "slint::testing::AccessibleRole::List"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole8ListItemE", "slint::testing::AccessibleRole::ListItem"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4NoneE", "slint::testing::AccessibleRole::None"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole17ProgressIndicatorE", "slint::testing::AccessibleRole::ProgressIndicator"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6SliderE", "slint::testing::AccessibleRole::Slider"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole7SpinboxE", "slint::testing::AccessibleRole::Spinbox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6SwitchE", "slint::testing::AccessibleRole::Switch"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole3TabE", "slint::testing::AccessibleRole::Tab"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole7TabListE", "slint::testing::AccessibleRole::TabList"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole5TableE", "slint::testing::AccessibleRole::Table"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4TextE", "slint::testing::AccessibleRole::Text"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole9TextInputE", "slint::testing::AccessibleRole::TextInput"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4TreeE", "slint::testing::AccessibleRole::Tree"], [22, 1, 1, "_CPPv4N5slint7testing13ElementHandleE", "slint::testing::ElementHandle"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle17absolute_positionEv", "slint::testing::ElementHandle::absolute_position"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle20accessible_checkableEv", "slint::testing::ElementHandle::accessible_checkable"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle18accessible_checkedEv", "slint::testing::ElementHandle::accessible_checked"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle22accessible_descriptionEv", "slint::testing::ElementHandle::accessible_description"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle16accessible_labelEv", "slint::testing::ElementHandle::accessible_label"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle27accessible_placeholder_textEv", "slint::testing::ElementHandle::accessible_placeholder_text"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle15accessible_roleEv", "slint::testing::ElementHandle::accessible_role"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle16accessible_valueEv", "slint::testing::ElementHandle::accessible_value"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_maximumEv", "slint::testing::ElementHandle::accessible_value_maximum"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_minimumEv", "slint::testing::ElementHandle::accessible_value_minimum"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle21accessible_value_stepEv", "slint::testing::ElementHandle::accessible_value_step"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle5basesEv", "slint::testing::ElementHandle::bases"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::label"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::element_id"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::type_name"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle2idEv", "slint::testing::ElementHandle::id"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_decrement_actionEv", "slint::testing::ElementHandle::invoke_accessible_decrement_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle32invoke_accessible_default_actionEv", "slint::testing::ElementHandle::invoke_accessible_default_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_increment_actionEv", "slint::testing::ElementHandle::invoke_accessible_increment_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle8is_validEv", "slint::testing::ElementHandle::is_valid"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString", "slint::testing::ElementHandle::set_accessible_value"], [22, 3, 1, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString", "slint::testing::ElementHandle::set_accessible_value::value"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle4sizeEv", "slint::testing::ElementHandle::size"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle9type_nameEv", "slint::testing::ElementHandle::type_name"], [22, 2, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::R"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::T"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::Visitor"], [22, 3, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::component"], [22, 3, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::visitor"], [96, 2, 1, "_CPPv4N5slint7testing4initEv", "slint::testing::init"], [101, 2, 1, "_CPPv4N5slint23update_all_translationsEv", "slint::update_all_translations"]]}, "objtypes": {"0": "c:macro", "1": "cpp:class", "2": "cpp:function", "3": "cpp:functionParam", "4": "cpp:enum", "5": "cpp:enumerator", "6": "cpp:templateParam", "7": "cpp:member", "8": "cpp:type"}, "objnames": {"0": ["c", "macro", "C macro"], "1": ["cpp", "class", "C++ class"], "2": ["cpp", "function", "C++ function"], "3": ["cpp", "functionParam", "C++ function parameter"], "4": ["cpp", "enum", "C++ enum"], "5": ["cpp", "enumerator", "C++ enumerator"], "6": ["cpp", "templateParam", "C++ template parameter"], "7": ["cpp", "member", "C++ member"], "8": ["cpp", "type", "C++ type"]}, "titleterms": {"class": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 55, 56, 57, 58, 59, 61, 63, 66, 68, 69, 70, 72, 73, 75, 80, 83, 102, 103, 104, 105, 107], "brush": 0, "document": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 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, 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, 232], "color": [1, 233], "templat": [2, 3, 4, 5, 6, 7, 8, 9, 98, 99, 153, 156, 157, 159, 160, 231], "componenthandl": 2, "componentweakhandl": 3, "filtermodel": 4, "inherit": [4, 5, 6, 7, 8, 9, 13, 15, 19, 20, 149, 150, 151, 152], "relationship": [4, 5, 6, 7, 8, 9, 13, 15, 17, 18, 19, 20, 21, 149, 150, 151, 152, 165, 166, 168, 169, 170, 171], "base": [4, 5, 7, 8, 9, 13, 19, 20, 149, 150, 151, 152], "type": [4, 5, 6, 7, 8, 9, 13, 15, 17, 19, 20, 21, 149, 150, 151, 152, 165, 168, 170, 240], "mapmodel": 5, "model": 6, "deriv": [6, 15], "reversemodel": 7, "sortmodel": 8, "vectormodel": 9, "window": 10, "componentcompil": 11, "componentdefinit": 12, "componentinst": 13, "valu": 14, "abstractrender": 15, "nativewindowhandl": 16, "platform": [17, 18, 56, 93, 94, 95, 105, 106, 110, 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, 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], "nest": [17, 18, 20, 21, 165, 166, 168, 169, 170, 171], "task": 18, "skiarender": 19, "softwarerender": [20, 168], "windowadapt": [21, 170], "exampl": [21, 229], "elementhandl": 22, "defin": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 71, 80, 102], "slint_feature_backend_qt": 23, "slint_feature_gettext": 24, "slint_feature_interpret": 25, "slint_version_patch": 26, "slint_feature_backend_linuxkm": 27, "slint_feature_experiment": 28, "slint_version_str": 29, "slint_feature_renderer_femtovg": 30, "slint_feature_renderer_skia": 31, "slint_feature_system_test": 32, "slint_feature_access": 33, "slint_feature_renderer_softwar": 34, "slint_version_minor": 35, "slint_feature_freestand": 36, "slint_feature_test": 37, "slint_version_major": 38, "slint_feature_backend_winit": 39, "assert_eq": 40, "directori": [41, 42, 43, 44, 45, 172], "api": [41, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 102, 172], "subdirectori": [41, 42, 44], "cpp": [42, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "includ": [43, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "file": [43, 45, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "cppdoc": [44, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "generated_includ": [45, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "enum": [46, 47, 48, 49, 50, 51, 52, 53, 54, 58, 78, 80, 83, 102, 103, 104, 107, 240], "valuetyp": 46, "diagnosticlevel": 47, "accessiblerol": 48, "setrenderingnotifiererror": 49, "pointereventbutton": 50, "eventloopmod": 51, "graphicsapi": 52, "renderingst": 53, "closerequestrespons": 54, "slint": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 93, 94, 95, 96, 97, 98, 99, 100, 101, 103, 104, 105, 106, 107, 109, 110, 111, 112, 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, 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, 232, 233, 235, 238, 239], "interpret": [55, 104, 109, 239], "h": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "definit": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 233], "home": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 214], "runner": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "work": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "By": [55, 57, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92], "namespac": [55, 56, 57, 58, 59, 60, 61, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 103, 104, 105, 106, 107], "function": [56, 57, 58, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 105, 107], "test": [57, 96, 107, 111], "slint_brush": [59, 113], "slint_callback": [60, 114], "slint_color": [61, 115], "slint_config": [62, 116], "slint_imag": [63, 117], "slint_interpret": [64, 118], "slint_pathdata": [65, 119], "slint_point": [66, 120], "slint_properti": [67, 121], "slint_sharedvector": [68, 122], "slint_siz": [69, 123], "slint_str": [70, 124], "slint_tests_help": [71, 125], "slint_tim": [72, 126], "slint_window": [73, 127], "slint_brush_intern": [74, 128], "slint_builtin_struct": [75, 129], "slint_builtin_structs_intern": [76, 130], "slint_color_intern": [77, 131], "slint_enum": [78, 132], "variabl": [78, 102, 106, 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, 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], "slint_enums_intern": [79, 133], "slint_generated_publ": [80, 134], "slint_image_intern": [81, 135], "slint_intern": [82, 136], "slint_interpreter_generated_publ": [83, 137], "slint_interpreter_intern": [84, 138], "slint_pathdata_intern": [85, 139], "slint_platform_intern": [86, 140], "slint_properties_intern": [87, 141], "slint_qt_intern": [88, 142], "slint_sharedvector_intern": [89, 143], "slint_string_intern": [90, 144], "slint_testing_intern": [91, 145], "slint_timer_intern": [92, 146], "duration_until_next_timer_upd": 93, "update_timers_and_anim": 94, "set_platform": 95, "init": 96, "quit_event_loop": 97, "invoke_from_event_loop": 98, "blocking_invoke_from_event_loop": 99, "run_event_loop": 100, "update_all_transl": 101, "c": [102, 230, 232], "refer": [102, 228], "page": [102, 172], "hierarchi": 102, "full": [102, 172], "struct": [102, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171], "detail": [103, 104, 105, 106, 107], "descript": [103, 104, 105, 106, 107], "key_cod": [106, 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, 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], "deprec": 108, "list": [108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "program": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "hsvacolor": 147, "imag": 148, "logicalposit": 149, "logicals": 150, "physicalposit": 151, "physicals": 152, "point": 153, "rgb8pixel": 154, "rgba8pixel": 155, "rgbacolor": 156, "sharedpixelbuff": 157, "sharedstr": 158, "sharedvector": 159, "size": 160, "standardlistviewitem": 161, "timer": 162, "diagnost": 163, "propertydescriptor": 164, "iter": 166, "rgb565pixel": 167, "physicalregion": [168, 169], "rect": 169, "windowproperti": [170, 171], "layoutconstraint": 171, "f24": 173, "f1": 174, "capslock": 175, "space": 176, "menu": 177, "leftarrow": 178, "metar": 179, "paus": 180, "f4": 181, "f12": 182, "insert": 183, "downarrow": 184, "altgr": 185, "alt": 186, "f23": 187, "stop": 188, "f19": 189, "scrolllock": 190, "f13": 191, "f15": 192, "f14": 193, "backspac": 194, "f5": 195, "f6": 196, "meta": 197, "f9": 198, "f20": 199, "uparrow": 200, "f10": 201, "f2": 202, "f8": 203, "f18": 204, "pagedown": 205, "f11": 206, "f3": 207, "control": 208, "f16": 209, "controlr": 210, "return": 211, "f7": 212, "backtab": 213, "rightarrow": 215, "escap": 216, "sysreq": 217, "f21": 218, "f17": 219, "pageup": 220, "tab": 221, "end": 222, "shiftr": 223, "delet": 224, "shift": 225, "f22": 226, "set": 227, "up": 227, "develop": [227, 232, 234], "environ": [227, 235], "prerequisit": [227, 234, 235, 237], "instal": 227, "binari": 227, "packag": 227, "build": [227, 233], "from": 227, "sourc": 227, "featur": 227, "rust": [227, 233], "flag": 227, "backend": 227, "cross": 227, "compil": [227, 233, 235, 239], "cmake": 228, "slint_target_sourc": 228, "resourc": 228, "embed": 228, "scale": 228, "factor": 228, "microcontrol": 228, "gener": [229, 235, 238], "code": 229, "global": 229, "singleton": 229, "index": 230, "get": 231, "start": 231, "tutori": 231, "The": [232, 233], "markup": 232, "languag": 232, "architectur": 232, "troubleshoot": 233, "error": 233, "dure": 233, "devic": 233, "crash": 233, "boot": 233, "enter": 233, "loop": 233, "wrong": 233, "shown": 233, "about": 233, "multipl": 233, "symbol": 233, "when": 233, "link": 233, "espressif": 234, "": 234, "iot": 234, "framework": 234, "first": [234, 237], "step": [234, 235, 237], "next": [234, 235, 237], "mcu": [235, 238], "setup": 235, "introduct": 236, "stmicroelectron": 237, "stm32cube": 237, "ecosystem": 237, "instruct": 238, "stm32": 238, "overview": 239, "design": 239, "run": 239, "time": 239, "map": 240, "structur": 240}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 58}, "alltitles": {"Class Brush": [[0, "class-brush"]], "Class Documentation": [[0, "class-documentation"], [1, "class-documentation"], [2, "class-documentation"], [3, "class-documentation"], [4, "class-documentation"], [5, "class-documentation"], [6, "class-documentation"], [7, "class-documentation"], [8, "class-documentation"], [9, "class-documentation"], [10, "class-documentation"], [11, "class-documentation"], [12, "class-documentation"], [13, "class-documentation"], [14, "class-documentation"], [15, "class-documentation"], [16, "class-documentation"], [17, "class-documentation"], [18, "class-documentation"], [19, "class-documentation"], [20, "class-documentation"], [21, "class-documentation"], [22, "class-documentation"]], "Class Color": [[1, "class-color"]], "Template Class ComponentHandle": [[2, "template-class-componenthandle"]], "Template Class ComponentWeakHandle": [[3, "template-class-componentweakhandle"]], "Template Class FilterModel": [[4, "template-class-filtermodel"]], "Inheritance Relationships": [[4, "inheritance-relationships"], [5, "inheritance-relationships"], [6, "inheritance-relationships"], [7, "inheritance-relationships"], [8, "inheritance-relationships"], [9, "inheritance-relationships"], [13, "inheritance-relationships"], [15, "inheritance-relationships"], [19, "inheritance-relationships"], [20, "inheritance-relationships"], [149, "inheritance-relationships"], [150, "inheritance-relationships"], [151, "inheritance-relationships"], [152, "inheritance-relationships"]], "Base Type": [[4, "base-type"], [5, "base-type"], [7, "base-type"], [8, "base-type"], [9, "base-type"], [13, "base-type"], [19, "base-type"], [20, "base-type"], [149, "base-type"], [150, "base-type"], [151, "base-type"], [152, "base-type"]], "Template Class MapModel": [[5, "template-class-mapmodel"]], "Template Class Model": [[6, "template-class-model"]], "Derived Types": [[6, "derived-types"], [15, "derived-types"]], "Template Class ReverseModel": [[7, "template-class-reversemodel"]], "Template Class SortModel": [[8, "template-class-sortmodel"]], "Template Class VectorModel": [[9, "template-class-vectormodel"]], "Class Window": [[10, "class-window"]], "Class ComponentCompiler": [[11, "class-componentcompiler"]], "Class ComponentDefinition": [[12, "class-componentdefinition"]], "Class ComponentInstance": [[13, "class-componentinstance"]], "Class Value": [[14, "class-value"]], "Class AbstractRenderer": [[15, "class-abstractrenderer"]], "Class NativeWindowHandle": [[16, "class-nativewindowhandle"]], "Class Platform": [[17, "class-platform"]], "Nested Relationships": [[17, "nested-relationships"], [18, "nested-relationships"], [20, "nested-relationships"], [21, "nested-relationships"], [165, "nested-relationships"], [166, "nested-relationships"], [168, "nested-relationships"], [169, "nested-relationships"], [170, "nested-relationships"], [171, "nested-relationships"]], "Nested Types": [[17, "nested-types"], [20, "nested-types"], [21, "nested-types"], [165, "nested-types"], [168, "nested-types"], [170, "nested-types"]], "Class Platform::Task": [[18, "class-platform-task"]], "Class SkiaRenderer": [[19, "class-skiarenderer"]], "Class SoftwareRenderer": [[20, "class-softwarerenderer"]], "Class WindowAdapter": [[21, "class-windowadapter"]], "Example": [[21, "classslint_1_1platform_1_1WindowAdapter_1autotoc_md0"], [229, "example"]], "Class ElementHandle": [[22, "class-elementhandle"]], "Define SLINT_FEATURE_BACKEND_QT": [[23, "define-slint-feature-backend-qt"]], "Define Documentation": [[23, "define-documentation"], [24, "define-documentation"], [25, "define-documentation"], [26, "define-documentation"], [27, "define-documentation"], [28, "define-documentation"], [29, "define-documentation"], [30, "define-documentation"], [31, "define-documentation"], [32, "define-documentation"], [33, "define-documentation"], [34, "define-documentation"], [35, "define-documentation"], [36, "define-documentation"], [37, "define-documentation"], [38, "define-documentation"], [39, "define-documentation"], [40, "define-documentation"]], "Define SLINT_FEATURE_GETTEXT": [[24, "define-slint-feature-gettext"]], "Define SLINT_FEATURE_INTERPRETER": [[25, "define-slint-feature-interpreter"]], "Define SLINT_VERSION_PATCH": [[26, "define-slint-version-patch"]], "Define SLINT_FEATURE_BACKEND_LINUXKMS": [[27, "define-slint-feature-backend-linuxkms"]], "Define SLINT_FEATURE_EXPERIMENTAL": [[28, "define-slint-feature-experimental"]], "Define SLINT_VERSION_STRING": [[29, "define-slint-version-string"]], "Define SLINT_FEATURE_RENDERER_FEMTOVG": [[30, "define-slint-feature-renderer-femtovg"]], "Define SLINT_FEATURE_RENDERER_SKIA": [[31, "define-slint-feature-renderer-skia"]], "Define SLINT_FEATURE_SYSTEM_TESTING": [[32, "define-slint-feature-system-testing"]], "Define SLINT_FEATURE_ACCESSIBILITY": [[33, "define-slint-feature-accessibility"]], "Define SLINT_FEATURE_RENDERER_SOFTWARE": [[34, "define-slint-feature-renderer-software"]], "Define SLINT_VERSION_MINOR": [[35, "define-slint-version-minor"]], "Define SLINT_FEATURE_FREESTANDING": [[36, "define-slint-feature-freestanding"]], "Define SLINT_FEATURE_TESTING": [[37, "define-slint-feature-testing"]], "Define SLINT_VERSION_MAJOR": [[38, "define-slint-version-major"]], "Define SLINT_FEATURE_BACKEND_WINIT": [[39, "define-slint-feature-backend-winit"]], "Define assert_eq": [[40, "define-assert-eq"]], "Directory api": [[41, "directory-api"]], "Subdirectories": [[41, "subdirectories"], [42, "subdirectories"], [44, "subdirectories"]], "Directory cpp": [[42, "directory-cpp"]], "Directory include": [[43, "directory-include"]], "Files": [[43, "files"], [45, "files"], [172, "files"]], "Directory cppdocs": [[44, "directory-cppdocs"]], "Directory generated_include": [[45, "directory-generated-include"]], "Enum ValueType": [[46, "enum-valuetype"]], "Enum Documentation": [[46, "enum-documentation"], [47, "enum-documentation"], [48, "enum-documentation"], [49, "enum-documentation"], [50, "enum-documentation"], [51, "enum-documentation"], [52, "enum-documentation"], [53, "enum-documentation"], [54, "enum-documentation"]], "Enum DiagnosticLevel": [[47, "enum-diagnosticlevel"]], "Enum AccessibleRole": [[48, "enum-accessiblerole"]], "Enum SetRenderingNotifierError": [[49, "enum-setrenderingnotifiererror"]], "Enum PointerEventButton": [[50, "enum-pointereventbutton"]], "Enum EventLoopMode": [[51, "enum-eventloopmode"]], "Enum GraphicsAPI": [[52, "enum-graphicsapi"]], "Enum RenderingState": [[53, "enum-renderingstate"]], "Enum CloseRequestResponse": [[54, "enum-closerequestresponse"]], "File slint-interpreter.h": [[55, "file-slint-interpreter-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-interpreter.h)": [[55, "definition-home-runner-work-slint-slint-api-cpp-include-slint-interpreter-h"]], "Includes": [[55, "includes"], [56, "includes"], [57, "includes"], [58, "includes"], [59, "includes"], [60, "includes"], [61, "includes"], [62, "includes"], [63, "includes"], [64, "includes"], [65, "includes"], [66, "includes"], [67, "includes"], [68, "includes"], [69, "includes"], [70, "includes"], [71, "includes"], [72, "includes"], [73, "includes"], [74, "includes"], [76, "includes"], [77, "includes"], [79, "includes"], [80, "includes"], [81, "includes"], [82, "includes"], [83, "includes"], [84, "includes"], [85, "includes"], [86, "includes"], [87, "includes"], [88, "includes"], [89, "includes"], [90, "includes"], [91, "includes"], [92, "includes"]], "Included By": [[55, "included-by"], [57, "included-by"], [59, "included-by"], [60, "included-by"], [61, "included-by"], [62, "included-by"], [63, "included-by"], [65, "included-by"], [66, "included-by"], [67, "included-by"], [68, "included-by"], [69, "included-by"], [70, "included-by"], [72, "included-by"], [73, "included-by"], [74, "included-by"], [75, "included-by"], [76, "included-by"], [77, "included-by"], [78, "included-by"], [79, "included-by"], [80, "included-by"], [81, "included-by"], [82, "included-by"], [83, "included-by"], [85, "included-by"], [86, "included-by"], [87, "included-by"], [88, "included-by"], [89, "included-by"], [90, "included-by"], [91, "included-by"], [92, "included-by"]], "Namespaces": [[55, "namespaces"], [56, "namespaces"], [57, "namespaces"], [58, "namespaces"], [59, "namespaces"], [60, "namespaces"], [61, "namespaces"], [63, "namespaces"], [65, "namespaces"], [66, "namespaces"], [67, "namespaces"], [68, "namespaces"], [69, "namespaces"], [70, "namespaces"], [71, "namespaces"], [72, "namespaces"], [73, "namespaces"], [74, "namespaces"], [75, "namespaces"], [76, "namespaces"], [77, "namespaces"], [78, "namespaces"], [79, "namespaces"], [80, "namespaces"], [81, "namespaces"], [82, "namespaces"], [83, "namespaces"], [84, "namespaces"], [85, "namespaces"], [86, "namespaces"], [87, "namespaces"], [88, "namespaces"], [89, "namespaces"], [90, "namespaces"], [91, "namespaces"], [92, "namespaces"], [102, "namespaces"], [103, "namespaces"], [105, "namespaces"]], "Classes": [[55, "classes"], [56, "classes"], [57, "classes"], [58, "classes"], [59, "classes"], [61, "classes"], [63, "classes"], [66, "classes"], [68, "classes"], [69, "classes"], [70, "classes"], [72, "classes"], [73, "classes"], [75, "classes"], [80, "classes"], [83, "classes"], [103, "classes"], [104, "classes"], [105, "classes"], [107, "classes"]], "File slint-platform.h": [[56, "file-slint-platform-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-platform.h)": [[56, "definition-home-runner-work-slint-slint-api-cpp-include-slint-platform-h"]], "Functions": [[56, "functions"], [57, "functions"], [58, "functions"], [102, "functions"], [103, "functions"], [105, "functions"], [107, "functions"]], "File slint-testing.h": [[57, "file-slint-testing-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-testing.h)": [[57, "definition-home-runner-work-slint-slint-api-cpp-include-slint-testing-h"]], "File slint.h": [[58, "file-slint-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint.h)": [[58, "definition-home-runner-work-slint-slint-api-cpp-include-slint-h"]], "Enums": [[58, "enums"], [78, "enums"], [80, "enums"], [83, "enums"], [102, "enums"], [103, "enums"], [104, "enums"], [107, "enums"], [240, "enums"]], "File slint_brush.h": [[59, "file-slint-brush-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_brush.h)": [[59, "definition-home-runner-work-slint-slint-api-cpp-include-slint-brush-h"]], "File slint_callbacks.h": [[60, "file-slint-callbacks-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_callbacks.h)": [[60, "definition-home-runner-work-slint-slint-api-cpp-include-slint-callbacks-h"]], "File slint_color.h": [[61, "file-slint-color-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_color.h)": [[61, "definition-home-runner-work-slint-slint-api-cpp-include-slint-color-h"]], "File slint_config.h": [[62, "file-slint-config-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_config.h)": [[62, "definition-home-runner-work-slint-slint-api-cpp-include-slint-config-h"]], "File slint_image.h": [[63, "file-slint-image-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_image.h)": [[63, "definition-home-runner-work-slint-slint-api-cpp-include-slint-image-h"]], "File slint_interpreter.h": [[64, "file-slint-interpreter-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_interpreter.h)": [[64, "definition-home-runner-work-slint-slint-api-cpp-include-slint-interpreter-h"]], "File slint_pathdata.h": [[65, "file-slint-pathdata-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_pathdata.h)": [[65, "definition-home-runner-work-slint-slint-api-cpp-include-slint-pathdata-h"]], "File slint_point.h": [[66, "file-slint-point-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_point.h)": [[66, "definition-home-runner-work-slint-slint-api-cpp-include-slint-point-h"]], "File slint_properties.h": [[67, "file-slint-properties-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_properties.h)": [[67, "definition-home-runner-work-slint-slint-api-cpp-include-slint-properties-h"]], "File slint_sharedvector.h": [[68, "file-slint-sharedvector-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_sharedvector.h)": [[68, "definition-home-runner-work-slint-slint-api-cpp-include-slint-sharedvector-h"]], "File slint_size.h": [[69, "file-slint-size-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_size.h)": [[69, "definition-home-runner-work-slint-slint-api-cpp-include-slint-size-h"]], "File slint_string.h": [[70, "file-slint-string-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_string.h)": [[70, "definition-home-runner-work-slint-slint-api-cpp-include-slint-string-h"]], "File slint_tests_helpers.h": [[71, "file-slint-tests-helpers-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_tests_helpers.h)": [[71, "definition-home-runner-work-slint-slint-api-cpp-include-slint-tests-helpers-h"]], "Defines": [[71, "defines"], [80, "defines"], [102, "defines"]], "File slint_timer.h": [[72, "file-slint-timer-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_timer.h)": [[72, "definition-home-runner-work-slint-slint-api-cpp-include-slint-timer-h"]], "File slint_window.h": [[73, "file-slint-window-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_window.h)": [[73, "definition-home-runner-work-slint-slint-api-cpp-include-slint-window-h"]], "File slint_brush_internal.h": [[74, "file-slint-brush-internal-h"]], "Definition (cppdocs/generated_include/slint_brush_internal.h)": [[74, "definition-cppdocs-generated-include-slint-brush-internal-h"]], "File slint_builtin_structs.h": [[75, "file-slint-builtin-structs-h"]], "Definition (cppdocs/generated_include/slint_builtin_structs.h)": [[75, "definition-cppdocs-generated-include-slint-builtin-structs-h"]], "File slint_builtin_structs_internal.h": [[76, "file-slint-builtin-structs-internal-h"]], "Definition (cppdocs/generated_include/slint_builtin_structs_internal.h)": [[76, "definition-cppdocs-generated-include-slint-builtin-structs-internal-h"]], "File slint_color_internal.h": [[77, "file-slint-color-internal-h"]], "Definition (cppdocs/generated_include/slint_color_internal.h)": [[77, "definition-cppdocs-generated-include-slint-color-internal-h"]], "File slint_enums.h": [[78, "file-slint-enums-h"]], "Definition (cppdocs/generated_include/slint_enums.h)": [[78, "definition-cppdocs-generated-include-slint-enums-h"]], "Variables": [[78, "variables"], [102, "variables"], [106, "variables"]], "File slint_enums_internal.h": [[79, "file-slint-enums-internal-h"]], "Definition (cppdocs/generated_include/slint_enums_internal.h)": [[79, "definition-cppdocs-generated-include-slint-enums-internal-h"]], "File slint_generated_public.h": [[80, "file-slint-generated-public-h"]], "Definition (cppdocs/generated_include/slint_generated_public.h)": [[80, "definition-cppdocs-generated-include-slint-generated-public-h"]], "File slint_image_internal.h": [[81, "file-slint-image-internal-h"]], "Definition (cppdocs/generated_include/slint_image_internal.h)": [[81, "definition-cppdocs-generated-include-slint-image-internal-h"]], "File slint_internal.h": [[82, "file-slint-internal-h"]], "Definition (cppdocs/generated_include/slint_internal.h)": [[82, "definition-cppdocs-generated-include-slint-internal-h"]], "File slint_interpreter_generated_public.h": [[83, "file-slint-interpreter-generated-public-h"]], "Definition (cppdocs/generated_include/slint_interpreter_generated_public.h)": [[83, "definition-cppdocs-generated-include-slint-interpreter-generated-public-h"]], "File slint_interpreter_internal.h": [[84, "file-slint-interpreter-internal-h"]], "Definition (cppdocs/generated_include/slint_interpreter_internal.h)": [[84, "definition-cppdocs-generated-include-slint-interpreter-internal-h"]], "File slint_pathdata_internal.h": [[85, "file-slint-pathdata-internal-h"]], "Definition (cppdocs/generated_include/slint_pathdata_internal.h)": [[85, "definition-cppdocs-generated-include-slint-pathdata-internal-h"]], "File slint_platform_internal.h": [[86, "file-slint-platform-internal-h"]], "Definition (cppdocs/generated_include/slint_platform_internal.h)": [[86, "definition-cppdocs-generated-include-slint-platform-internal-h"]], "File slint_properties_internal.h": [[87, "file-slint-properties-internal-h"]], "Definition (cppdocs/generated_include/slint_properties_internal.h)": [[87, "definition-cppdocs-generated-include-slint-properties-internal-h"]], "File slint_qt_internal.h": [[88, "file-slint-qt-internal-h"]], "Definition (cppdocs/generated_include/slint_qt_internal.h)": [[88, "definition-cppdocs-generated-include-slint-qt-internal-h"]], "File slint_sharedvector_internal.h": [[89, "file-slint-sharedvector-internal-h"]], "Definition (cppdocs/generated_include/slint_sharedvector_internal.h)": [[89, "definition-cppdocs-generated-include-slint-sharedvector-internal-h"]], "File slint_string_internal.h": [[90, "file-slint-string-internal-h"]], "Definition (cppdocs/generated_include/slint_string_internal.h)": [[90, "definition-cppdocs-generated-include-slint-string-internal-h"]], "File slint_testing_internal.h": [[91, "file-slint-testing-internal-h"]], "Definition (cppdocs/generated_include/slint_testing_internal.h)": [[91, "definition-cppdocs-generated-include-slint-testing-internal-h"]], "File slint_timer_internal.h": [[92, "file-slint-timer-internal-h"]], "Definition (cppdocs/generated_include/slint_timer_internal.h)": [[92, "definition-cppdocs-generated-include-slint-timer-internal-h"]], "Function slint::platform::duration_until_next_timer_update": [[93, "function-slint-platform-duration-until-next-timer-update"]], "Function Documentation": [[93, "function-documentation"], [94, "function-documentation"], [95, "function-documentation"], [96, "function-documentation"], [97, "function-documentation"], [98, "function-documentation"], [99, "function-documentation"], [100, "function-documentation"], [101, "function-documentation"]], "Function slint::platform::update_timers_and_animations": [[94, "function-slint-platform-update-timers-and-animations"]], "Function slint::platform::set_platform": [[95, "function-slint-platform-set-platform"]], "Function slint::testing::init": [[96, "function-slint-testing-init"]], "Function slint::quit_event_loop": [[97, "function-slint-quit-event-loop"]], "Template Function slint::invoke_from_event_loop": [[98, "template-function-slint-invoke-from-event-loop"]], "Template Function slint::blocking_invoke_from_event_loop": [[99, "template-function-slint-blocking-invoke-from-event-loop"]], "Function slint::run_event_loop": [[100, "function-slint-run-event-loop"]], "Function slint::update_all_translations": [[101, "function-slint-update-all-translations"]], "C++ API Reference": [[102, "c-api-reference"]], "Page Hierarchy": [[102, "page-hierarchy"]], "Class Hierarchy": [[102, "class-hierarchy"]], "File Hierarchy": [[102, "file-hierarchy"]], "Full API": [[102, "full-api"], [172, "full-api"]], "Classes and Structs": [[102, "classes-and-structs"]], "Namespace slint": [[103, "namespace-slint"]], "Detailed Description": [[103, "detailed-description"], [104, "detailed-description"], [105, "detailed-description"], [106, "detailed-description"], [107, "detailed-description"]], "Namespace slint::interpreter": [[104, "namespace-slint-interpreter"]], "Namespace slint::platform": [[105, "namespace-slint-platform"]], "Namespace slint::platform::key_codes": [[106, "namespace-slint-platform-key-codes"]], "Namespace slint::testing": [[107, "namespace-slint-testing"]], "Deprecated List": [[108, "deprecated-list"]], "Program Listing for File slint-interpreter.h": [[109, "program-listing-for-file-slint-interpreter-h"]], "Program Listing for File slint-platform.h": [[110, "program-listing-for-file-slint-platform-h"]], "Program Listing for File slint-testing.h": [[111, "program-listing-for-file-slint-testing-h"]], "Program Listing for File slint.h": [[112, "program-listing-for-file-slint-h"]], "Program Listing for File slint_brush.h": [[113, "program-listing-for-file-slint-brush-h"]], "Program Listing for File slint_callbacks.h": [[114, "program-listing-for-file-slint-callbacks-h"]], "Program Listing for File slint_color.h": [[115, "program-listing-for-file-slint-color-h"]], "Program Listing for File slint_config.h": [[116, "program-listing-for-file-slint-config-h"]], "Program Listing for File slint_image.h": [[117, "program-listing-for-file-slint-image-h"]], "Program Listing for File slint_interpreter.h": [[118, "program-listing-for-file-slint-interpreter-h"]], "Program Listing for File slint_pathdata.h": [[119, "program-listing-for-file-slint-pathdata-h"]], "Program Listing for File slint_point.h": [[120, "program-listing-for-file-slint-point-h"]], "Program Listing for File slint_properties.h": [[121, "program-listing-for-file-slint-properties-h"]], "Program Listing for File slint_sharedvector.h": [[122, "program-listing-for-file-slint-sharedvector-h"]], "Program Listing for File slint_size.h": [[123, "program-listing-for-file-slint-size-h"]], "Program Listing for File slint_string.h": [[124, "program-listing-for-file-slint-string-h"]], "Program Listing for File slint_tests_helpers.h": [[125, "program-listing-for-file-slint-tests-helpers-h"]], "Program Listing for File slint_timer.h": [[126, "program-listing-for-file-slint-timer-h"]], "Program Listing for File slint_window.h": [[127, "program-listing-for-file-slint-window-h"]], "Program Listing for File slint_brush_internal.h": [[128, "program-listing-for-file-slint-brush-internal-h"]], "Program Listing for File slint_builtin_structs.h": [[129, "program-listing-for-file-slint-builtin-structs-h"]], "Program Listing for File slint_builtin_structs_internal.h": [[130, "program-listing-for-file-slint-builtin-structs-internal-h"]], "Program Listing for File slint_color_internal.h": [[131, "program-listing-for-file-slint-color-internal-h"]], "Program Listing for File slint_enums.h": [[132, "program-listing-for-file-slint-enums-h"]], "Program Listing for File slint_enums_internal.h": [[133, "program-listing-for-file-slint-enums-internal-h"]], "Program Listing for File slint_generated_public.h": [[134, "program-listing-for-file-slint-generated-public-h"]], "Program Listing for File slint_image_internal.h": [[135, "program-listing-for-file-slint-image-internal-h"]], "Program Listing for File slint_internal.h": [[136, "program-listing-for-file-slint-internal-h"]], "Program Listing for File slint_interpreter_generated_public.h": [[137, "program-listing-for-file-slint-interpreter-generated-public-h"]], "Program Listing for File slint_interpreter_internal.h": [[138, "program-listing-for-file-slint-interpreter-internal-h"]], "Program Listing for File slint_pathdata_internal.h": [[139, "program-listing-for-file-slint-pathdata-internal-h"]], "Program Listing for File slint_platform_internal.h": [[140, "program-listing-for-file-slint-platform-internal-h"]], "Program Listing for File slint_properties_internal.h": [[141, "program-listing-for-file-slint-properties-internal-h"]], "Program Listing for File slint_qt_internal.h": [[142, "program-listing-for-file-slint-qt-internal-h"]], "Program Listing for File slint_sharedvector_internal.h": [[143, "program-listing-for-file-slint-sharedvector-internal-h"]], "Program Listing for File slint_string_internal.h": [[144, "program-listing-for-file-slint-string-internal-h"]], "Program Listing for File slint_testing_internal.h": [[145, "program-listing-for-file-slint-testing-internal-h"]], "Program Listing for File slint_timer_internal.h": [[146, "program-listing-for-file-slint-timer-internal-h"]], "Struct HsvaColor": [[147, "struct-hsvacolor"]], "Struct Documentation": [[147, "struct-documentation"], [148, "struct-documentation"], [149, "struct-documentation"], [150, "struct-documentation"], [151, "struct-documentation"], [152, "struct-documentation"], [153, "struct-documentation"], [154, "struct-documentation"], [155, "struct-documentation"], [156, "struct-documentation"], [157, "struct-documentation"], [158, "struct-documentation"], [159, "struct-documentation"], [160, "struct-documentation"], [161, "struct-documentation"], [162, "struct-documentation"], [163, "struct-documentation"], [164, "struct-documentation"], [165, "struct-documentation"], [166, "struct-documentation"], [167, "struct-documentation"], [168, "struct-documentation"], [169, "struct-documentation"], [170, "struct-documentation"], [171, "struct-documentation"]], "Struct Image": [[148, "struct-image"]], "Struct LogicalPosition": [[149, "struct-logicalposition"]], "Struct LogicalSize": [[150, "struct-logicalsize"]], "Struct PhysicalPosition": [[151, "struct-physicalposition"]], "Struct PhysicalSize": [[152, "struct-physicalsize"]], "Template Struct Point": [[153, "template-struct-point"]], "Struct Rgb8Pixel": [[154, "struct-rgb8pixel"]], "Struct Rgba8Pixel": [[155, "struct-rgba8pixel"]], "Template Struct RgbaColor": [[156, "template-struct-rgbacolor"]], "Template Struct SharedPixelBuffer": [[157, "template-struct-sharedpixelbuffer"]], "Struct SharedString": [[158, "struct-sharedstring"]], "Template Struct SharedVector": [[159, "template-struct-sharedvector"]], "Template Struct Size": [[160, "template-struct-size"]], "Struct StandardListViewItem": [[161, "struct-standardlistviewitem"]], "Struct Timer": [[162, "struct-timer"]], "Struct Diagnostic": [[163, "struct-diagnostic"]], "Struct PropertyDescriptor": [[164, "struct-propertydescriptor"]], "Struct Struct": [[165, "struct-struct"]], "Struct Struct::iterator": [[166, "struct-struct-iterator"]], "Struct Rgb565Pixel": [[167, "struct-rgb565pixel"]], "Struct SoftwareRenderer::PhysicalRegion": [[168, "struct-softwarerenderer-physicalregion"]], "Struct PhysicalRegion::Rect": [[169, "struct-physicalregion-rect"]], "Struct WindowAdapter::WindowProperties": [[170, "struct-windowadapter-windowproperties"]], "Struct WindowProperties::LayoutConstraints": [[171, "struct-windowproperties-layoutconstraints"]], "Directories": [[172, "directories"]], "Pages": [[172, "pages"]], "Variable slint::platform::key_codes::F24": [[173, "variable-slint-platform-key-codes-f24"]], "Variable Documentation": [[173, "variable-documentation"], [174, "variable-documentation"], [175, "variable-documentation"], [176, "variable-documentation"], [177, "variable-documentation"], [178, "variable-documentation"], [179, "variable-documentation"], [180, "variable-documentation"], [181, "variable-documentation"], [182, "variable-documentation"], [183, "variable-documentation"], [184, "variable-documentation"], [185, "variable-documentation"], [186, "variable-documentation"], [187, "variable-documentation"], [188, "variable-documentation"], [189, "variable-documentation"], [190, "variable-documentation"], [191, "variable-documentation"], [192, "variable-documentation"], [193, "variable-documentation"], [194, "variable-documentation"], [195, "variable-documentation"], [196, "variable-documentation"], [197, "variable-documentation"], [198, "variable-documentation"], [199, "variable-documentation"], [200, "variable-documentation"], [201, "variable-documentation"], [202, "variable-documentation"], [203, "variable-documentation"], [204, "variable-documentation"], [205, "variable-documentation"], [206, "variable-documentation"], [207, "variable-documentation"], [208, "variable-documentation"], [209, "variable-documentation"], [210, "variable-documentation"], [211, "variable-documentation"], [212, "variable-documentation"], [213, "variable-documentation"], [214, "variable-documentation"], [215, "variable-documentation"], [216, "variable-documentation"], [217, "variable-documentation"], [218, "variable-documentation"], [219, "variable-documentation"], [220, "variable-documentation"], [221, "variable-documentation"], [222, "variable-documentation"], [223, "variable-documentation"], [224, "variable-documentation"], [225, "variable-documentation"], [226, "variable-documentation"]], "Variable slint::platform::key_codes::F1": [[174, "variable-slint-platform-key-codes-f1"]], "Variable slint::platform::key_codes::CapsLock": [[175, "variable-slint-platform-key-codes-capslock"]], "Variable slint::platform::key_codes::Space": [[176, "variable-slint-platform-key-codes-space"]], "Variable slint::platform::key_codes::Menu": [[177, "variable-slint-platform-key-codes-menu"]], "Variable slint::platform::key_codes::LeftArrow": [[178, "variable-slint-platform-key-codes-leftarrow"]], "Variable slint::platform::key_codes::MetaR": [[179, "variable-slint-platform-key-codes-metar"]], "Variable slint::platform::key_codes::Pause": [[180, "variable-slint-platform-key-codes-pause"]], "Variable slint::platform::key_codes::F4": [[181, "variable-slint-platform-key-codes-f4"]], "Variable slint::platform::key_codes::F12": [[182, "variable-slint-platform-key-codes-f12"]], "Variable slint::platform::key_codes::Insert": [[183, "variable-slint-platform-key-codes-insert"]], "Variable slint::platform::key_codes::DownArrow": [[184, "variable-slint-platform-key-codes-downarrow"]], "Variable slint::platform::key_codes::AltGr": [[185, "variable-slint-platform-key-codes-altgr"]], "Variable slint::platform::key_codes::Alt": [[186, "variable-slint-platform-key-codes-alt"]], "Variable slint::platform::key_codes::F23": [[187, "variable-slint-platform-key-codes-f23"]], "Variable slint::platform::key_codes::Stop": [[188, "variable-slint-platform-key-codes-stop"]], "Variable slint::platform::key_codes::F19": [[189, "variable-slint-platform-key-codes-f19"]], "Variable slint::platform::key_codes::ScrollLock": [[190, "variable-slint-platform-key-codes-scrolllock"]], "Variable slint::platform::key_codes::F13": [[191, "variable-slint-platform-key-codes-f13"]], "Variable slint::platform::key_codes::F15": [[192, "variable-slint-platform-key-codes-f15"]], "Variable slint::platform::key_codes::F14": [[193, "variable-slint-platform-key-codes-f14"]], "Variable slint::platform::key_codes::Backspace": [[194, "variable-slint-platform-key-codes-backspace"]], "Variable slint::platform::key_codes::F5": [[195, "variable-slint-platform-key-codes-f5"]], "Variable slint::platform::key_codes::F6": [[196, "variable-slint-platform-key-codes-f6"]], "Variable slint::platform::key_codes::Meta": [[197, "variable-slint-platform-key-codes-meta"]], "Variable slint::platform::key_codes::F9": [[198, "variable-slint-platform-key-codes-f9"]], "Variable slint::platform::key_codes::F20": [[199, "variable-slint-platform-key-codes-f20"]], "Variable slint::platform::key_codes::UpArrow": [[200, "variable-slint-platform-key-codes-uparrow"]], "Variable slint::platform::key_codes::F10": [[201, "variable-slint-platform-key-codes-f10"]], "Variable slint::platform::key_codes::F2": [[202, "variable-slint-platform-key-codes-f2"]], "Variable slint::platform::key_codes::F8": [[203, "variable-slint-platform-key-codes-f8"]], "Variable slint::platform::key_codes::F18": [[204, "variable-slint-platform-key-codes-f18"]], "Variable slint::platform::key_codes::PageDown": [[205, "variable-slint-platform-key-codes-pagedown"]], "Variable slint::platform::key_codes::F11": [[206, "variable-slint-platform-key-codes-f11"]], "Variable slint::platform::key_codes::F3": [[207, "variable-slint-platform-key-codes-f3"]], "Variable slint::platform::key_codes::Control": [[208, "variable-slint-platform-key-codes-control"]], "Variable slint::platform::key_codes::F16": [[209, "variable-slint-platform-key-codes-f16"]], "Variable slint::platform::key_codes::ControlR": [[210, "variable-slint-platform-key-codes-controlr"]], "Variable slint::platform::key_codes::Return": [[211, "variable-slint-platform-key-codes-return"]], "Variable slint::platform::key_codes::F7": [[212, "variable-slint-platform-key-codes-f7"]], "Variable slint::platform::key_codes::Backtab": [[213, "variable-slint-platform-key-codes-backtab"]], "Variable slint::platform::key_codes::Home": [[214, "variable-slint-platform-key-codes-home"]], "Variable slint::platform::key_codes::RightArrow": [[215, "variable-slint-platform-key-codes-rightarrow"]], "Variable slint::platform::key_codes::Escape": [[216, "variable-slint-platform-key-codes-escape"]], "Variable slint::platform::key_codes::SysReq": [[217, "variable-slint-platform-key-codes-sysreq"]], "Variable slint::platform::key_codes::F21": [[218, "variable-slint-platform-key-codes-f21"]], "Variable slint::platform::key_codes::F17": [[219, "variable-slint-platform-key-codes-f17"]], "Variable slint::platform::key_codes::PageUp": [[220, "variable-slint-platform-key-codes-pageup"]], "Variable slint::platform::key_codes::Tab": [[221, "variable-slint-platform-key-codes-tab"]], "Variable slint::platform::key_codes::End": [[222, "variable-slint-platform-key-codes-end"]], "Variable slint::platform::key_codes::ShiftR": [[223, "variable-slint-platform-key-codes-shiftr"]], "Variable slint::platform::key_codes::Delete": [[224, "variable-slint-platform-key-codes-delete"]], "Variable slint::platform::key_codes::Shift": [[225, "variable-slint-platform-key-codes-shift"]], "Variable slint::platform::key_codes::F22": [[226, "variable-slint-platform-key-codes-f22"]], "Set Up Development Environment": [[227, "set-up-development-environment"]], "Prerequisites": [[227, "prerequisites"], [234, "prerequisites"], [235, "prerequisites"], [237, "prerequisites"]], "Install Slint": [[227, "install-slint"]], "Install Binary Packages": [[227, "install-binary-packages"]], "Build From Sources": [[227, "build-from-sources"]], "Features": [[227, "features"]], "Rust Flags": [[227, "rust-flags"]], "Platform Backends": [[227, "platform-backends"]], "Cross-compiling": [[227, "cross-compiling"]], "CMake Reference": [[228, "cmake-reference"]], "slint_target_sources": [[228, "slint-target-sources"]], "Resource Embedding": [[228, "resource-embedding"]], "Scale Factor for Microcontrollers": [[228, "scale-factor-for-microcontrollers"]], "Generated Code": [[229, "generated-code"]], "Global Singletons": [[229, "global-singletons"]], "Index (C++)": [[230, "index-c"]], "Getting Started": [[231, "getting-started"]], "Tutorial": [[231, "tutorial"]], "Template": [[231, "template"]], "Slint C++ documentation": [[232, "slint-c-documentation"]], "The .slint Markup Language": [[232, "the-slint-markup-language"]], "Architecture": [[232, "architecture"]], "Developing": [[232, "developing"]], "Troubleshooting": [[233, "troubleshooting"]], "Rust Compilation Error During Slint Build": [[233, "rust-compilation-error-during-slint-build"]], "The device crashes at boot or enter a boot loop": [[233, "the-device-crashes-at-boot-or-enter-a-boot-loop"]], "Wrong colors shown": [[233, "wrong-colors-shown"]], "Errors about multiple symbol definitions when linking": [[233, "errors-about-multiple-symbol-definitions-when-linking"]], "Espressif\u2019s IoT Development Framework": [[234, "espressif-s-iot-development-framework"]], "First Steps": [[234, "first-steps"], [237, "first-steps"]], "Next Steps": [[234, "next-steps"], [235, "next-steps"], [237, "next-steps"]], "Generic MCU Environment Setup": [[235, "generic-mcu-environment-setup"]], "Compiling Slint": [[235, "compiling-slint"]], "Introduction": [[236, "introduction"]], "STMicroelectronics\u2019 STM32Cube Ecosystem": [[237, "stmicroelectronics-stm32cube-ecosystem"]], "Generic Instructions for Slint on STM32 MCUs": [[238, "generic-instructions-for-slint-on-stm32-mcus"]], "Overview": [[239, "overview"]], "Compiled .slint Designs": [[239, "compiled-slint-designs"]], "Run-Time Interpreted .slint Designs": [[239, "run-time-interpreted-slint-designs"]], "Type Mappings": [[240, "type-mappings"]], "Structures": [[240, "structures"]]}, "indexentries": {"brush (c++ class)": [[0, "_CPPv4N5slint5BrushE"]], "brush::brush (c++ function)": [[0, "_CPPv4N5slint5Brush5BrushERK5Color"], [0, "_CPPv4N5slint5Brush5BrushEv"]], "brush::brighter (c++ function)": [[0, "_CPPv4NK5slint5Brush8brighterEf"]], "brush::color (c++ function)": [[0, "_CPPv4NK5slint5Brush5colorEv"]], "brush::darker (c++ function)": [[0, "_CPPv4NK5slint5Brush6darkerEf"]], "brush::operator!= (c++ function)": [[0, "_CPPv4N5slint5BrushneERK5BrushRK5Brush"]], "brush::operator== (c++ function)": [[0, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush"]], "brush::transparentize (c++ function)": [[0, "_CPPv4NK5slint5Brush14transparentizeEf"]], "brush::with_alpha (c++ function)": [[0, "_CPPv4NK5slint5Brush10with_alphaEf"]], "color (c++ class)": [[1, "_CPPv4N5slint5ColorE"]], "color::color (c++ function)": [[1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE"], [1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE"], [1, "_CPPv4N5slint5Color5ColorEv"]], "color::alpha (c++ function)": [[1, "_CPPv4NK5slint5Color5alphaEv"]], "color::as_argb_encoded (c++ function)": [[1, "_CPPv4NK5slint5Color15as_argb_encodedEv"]], "color::blue (c++ function)": [[1, "_CPPv4NK5slint5Color4blueEv"]], "color::brighter (c++ function)": [[1, "_CPPv4NK5slint5Color8brighterEf"]], "color::darker (c++ function)": [[1, "_CPPv4NK5slint5Color6darkerEf"]], "color::from_argb_encoded (c++ function)": [[1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t"]], "color::from_argb_float (c++ function)": [[1, "_CPPv4N5slint5Color15from_argb_floatEffff"]], "color::from_argb_uint8 (c++ function)": [[1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t"]], "color::from_hsva (c++ function)": [[1, "_CPPv4N5slint5Color9from_hsvaEffff"]], "color::from_rgb_float (c++ function)": [[1, "_CPPv4N5slint5Color14from_rgb_floatEfff"]], "color::from_rgb_uint8 (c++ function)": [[1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t"]], "color::green (c++ function)": [[1, "_CPPv4NK5slint5Color5greenEv"]], "color::mix (c++ function)": [[1, "_CPPv4NK5slint5Color3mixERK5Colorf"]], "color::operator<< (c++ function)": [[1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color"]], "color::operator== (c++ function)": [[1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color"]], "color::red (c++ function)": [[1, "_CPPv4NK5slint5Color3redEv"]], "color::to_argb_float (c++ function)": [[1, "_CPPv4NK5slint5Color13to_argb_floatEv"]], "color::to_argb_uint (c++ function)": [[1, "_CPPv4NK5slint5Color12to_argb_uintEv"]], "color::to_hsva (c++ function)": [[1, "_CPPv4NK5slint5Color7to_hsvaEv"]], "color::transparentize (c++ function)": [[1, "_CPPv4NK5slint5Color14transparentizeEf"]], "color::with_alpha (c++ function)": [[1, "_CPPv4NK5slint5Color10with_alphaEf"]], "componenthandle (c++ class)": [[2, "_CPPv4I0EN5slint15ComponentHandleE"]], "componenthandle::componenthandle (c++ function)": [[2, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE"]], "componenthandle::into_dyn (c++ function)": [[2, "_CPPv4NK5slint15ComponentHandle8into_dynEv"]], "componenthandle::operator* (c++ function)": [[2, "_CPPv4N5slint15ComponentHandlemlEv"], [2, "_CPPv4NK5slint15ComponentHandlemlEv"]], "componenthandle::operator-> (c++ function)": [[2, "_CPPv4N5slint15ComponentHandleptEv"], [2, "_CPPv4NK5slint15ComponentHandleptEv"]], "componentweakhandle (c++ class)": [[3, "_CPPv4I0EN5slint19ComponentWeakHandleE"]], "componentweakhandle::componentweakhandle (c++ function)": [[3, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE"], [3, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleEv"]], "componentweakhandle::lock (c++ function)": [[3, "_CPPv4NK5slint19ComponentWeakHandle4lockEv"]], "filtermodel (c++ class)": [[4, "_CPPv4I0EN5slint11FilterModelE"]], "filtermodel::filtermodel (c++ function)": [[4, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE"]], "filtermodel::reset (c++ function)": [[4, "_CPPv4N5slint11FilterModel5resetEv"]], "filtermodel::row_count (c++ function)": [[4, "_CPPv4NK5slint11FilterModel9row_countEv"]], "filtermodel::row_data (c++ function)": [[4, "_CPPv4NK5slint11FilterModel8row_dataE6size_t"]], "filtermodel::set_row_data (c++ function)": [[4, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData"]], "filtermodel::source_model (c++ function)": [[4, "_CPPv4NK5slint11FilterModel12source_modelEv"]], "filtermodel::unfiltered_row (c++ function)": [[4, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi"]], "mapmodel (c++ class)": [[5, "_CPPv4I00EN5slint8MapModelE"]], "mapmodel::mapmodel (c++ function)": [[5, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE"]], "mapmodel::reset (c++ function)": [[5, "_CPPv4N5slint8MapModel5resetEv"]], "mapmodel::row_count (c++ function)": [[5, "_CPPv4NK5slint8MapModel9row_countEv"]], "mapmodel::row_data (c++ function)": [[5, "_CPPv4NK5slint8MapModel8row_dataE6size_t"]], "mapmodel::source_model (c++ function)": [[5, "_CPPv4NK5slint8MapModel12source_modelEv"]], "model (c++ class)": [[6, "_CPPv4I0EN5slint5ModelE"]], "model::model (c++ function)": [[6, "_CPPv4N5slint5Model5ModelERK5Model"], [6, "_CPPv4N5slint5Model5ModelEv"]], "model::operator= (c++ function)": [[6, "_CPPv4N5slint5ModelaSERK5Model"]], "model::reset (c++ function)": [[6, "_CPPv4N5slint5Model5resetEv"]], "model::row_added (c++ function)": [[6, "_CPPv4N5slint5Model9row_addedE6size_t6size_t"]], "model::row_changed (c++ function)": [[6, "_CPPv4N5slint5Model11row_changedE6size_t"]], "model::row_count (c++ function)": [[6, "_CPPv4NK5slint5Model9row_countEv"]], "model::row_data (c++ function)": [[6, "_CPPv4NK5slint5Model8row_dataE6size_t"]], "model::row_removed (c++ function)": [[6, "_CPPv4N5slint5Model11row_removedE6size_t6size_t"]], "model::set_row_data (c++ function)": [[6, "_CPPv4N5slint5Model12set_row_dataE6size_tRK9ModelData"]], "model::~model (c++ function)": [[6, "_CPPv4N5slint5ModelD0Ev"]], "reversemodel (c++ class)": [[7, "_CPPv4I0EN5slint12ReverseModelE"]], "reversemodel::reversemodel (c++ function)": [[7, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE"]], "reversemodel::row_count (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel9row_countEv"]], "reversemodel::row_data (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t"]], "reversemodel::set_row_data (c++ function)": [[7, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData"]], "reversemodel::source_model (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel12source_modelEv"]], "sortmodel (c++ class)": [[8, "_CPPv4I0EN5slint9SortModelE"]], "sortmodel::sortmodel (c++ function)": [[8, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE"]], "sortmodel::reset (c++ function)": [[8, "_CPPv4N5slint9SortModel5resetEv"]], "sortmodel::row_count (c++ function)": [[8, "_CPPv4NK5slint9SortModel9row_countEv"]], "sortmodel::row_data (c++ function)": [[8, "_CPPv4NK5slint9SortModel8row_dataE6size_t"]], "sortmodel::set_row_data (c++ function)": [[8, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData"]], "sortmodel::source_model (c++ function)": [[8, "_CPPv4NK5slint9SortModel12source_modelEv"]], "sortmodel::unsorted_row (c++ function)": [[8, "_CPPv4NK5slint9SortModel12unsorted_rowEi"]], "vectormodel (c++ class)": [[9, "_CPPv4I0EN5slint11VectorModelE"]], "vectormodel::vectormodel (c++ function)": [[9, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE"], [9, "_CPPv4N5slint11VectorModel11VectorModelEv"]], "vectormodel::clear (c++ function)": [[9, "_CPPv4N5slint11VectorModel5clearEv"]], "vectormodel::erase (c++ function)": [[9, "_CPPv4N5slint11VectorModel5eraseE6size_t"]], "vectormodel::insert (c++ function)": [[9, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData"]], "vectormodel::push_back (c++ function)": [[9, "_CPPv4N5slint11VectorModel9push_backERK9ModelData"]], "vectormodel::row_count (c++ function)": [[9, "_CPPv4NK5slint11VectorModel9row_countEv"]], "vectormodel::row_data (c++ function)": [[9, "_CPPv4NK5slint11VectorModel8row_dataE6size_t"]], "vectormodel::set_row_data (c++ function)": [[9, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData"]], "vectormodel::set_vector (c++ function)": [[9, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE"]], "window (c++ class)": [[10, "_CPPv4N5slint6WindowE"]], "window::window (c++ function)": [[10, "_CPPv4N5slint6Window6WindowERK6Window"], [10, "_CPPv4N5slint6Window6WindowERR6Window"]], "window::dispatch_close_requested_event (c++ function)": [[10, "_CPPv4N5slint6Window30dispatch_close_requested_eventEv"]], "window::dispatch_key_press_event (c++ function)": [[10, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString"]], "window::dispatch_key_press_repeat_event (c++ function)": [[10, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString"]], "window::dispatch_key_release_event (c++ function)": [[10, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString"]], "window::dispatch_pointer_exit_event (c++ function)": [[10, "_CPPv4N5slint6Window27dispatch_pointer_exit_eventEv"]], "window::dispatch_pointer_move_event (c++ function)": [[10, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition"]], "window::dispatch_pointer_press_event (c++ function)": [[10, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton"]], "window::dispatch_pointer_release_event (c++ function)": [[10, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton"]], "window::dispatch_pointer_scroll_event (c++ function)": [[10, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff"]], "window::dispatch_resize_event (c++ function)": [[10, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE"]], "window::dispatch_scale_factor_change_event (c++ function)": [[10, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf"]], "window::dispatch_window_active_changed_event (c++ function)": [[10, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb"]], "window::has_active_animations (c++ function)": [[10, "_CPPv4NK5slint6Window21has_active_animationsEv"]], "window::hide (c++ function)": [[10, "_CPPv4N5slint6Window4hideEv"]], "window::is_fullscreen (c++ function)": [[10, "_CPPv4NK5slint6Window13is_fullscreenEv"]], "window::is_maximized (c++ function)": [[10, "_CPPv4NK5slint6Window12is_maximizedEv"]], "window::is_minimized (c++ function)": [[10, "_CPPv4NK5slint6Window12is_minimizedEv"]], "window::is_visible (c++ function)": [[10, "_CPPv4NK5slint6Window10is_visibleEv"]], "window::on_close_requested (c++ function)": [[10, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F"]], "window::operator= (c++ function)": [[10, "_CPPv4N5slint6WindowaSERK6Window"], [10, "_CPPv4N5slint6WindowaSERR6Window"]], "window::position (c++ function)": [[10, "_CPPv4NK5slint6Window8positionEv"]], "window::request_redraw (c++ function)": [[10, "_CPPv4NK5slint6Window14request_redrawEv"]], "window::scale_factor (c++ function)": [[10, "_CPPv4NK5slint6Window12scale_factorEv"]], "window::set_fullscreen (c++ function)": [[10, "_CPPv4N5slint6Window14set_fullscreenEb"]], "window::set_maximized (c++ function)": [[10, "_CPPv4N5slint6Window13set_maximizedEb"]], "window::set_minimized (c++ function)": [[10, "_CPPv4N5slint6Window13set_minimizedEb"]], "window::set_position (c++ function)": [[10, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE"], [10, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE"]], "window::set_rendering_notifier (c++ function)": [[10, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F"]], "window::set_size (c++ function)": [[10, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE"], [10, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE"]], "window::show (c++ function)": [[10, "_CPPv4N5slint6Window4showEv"]], "window::size (c++ function)": [[10, "_CPPv4NK5slint6Window4sizeEv"]], "window::~window (c++ function)": [[10, "_CPPv4N5slint6WindowD0Ev"]], "componentcompiler (c++ class)": [[11, "_CPPv4N5slint11interpreter17ComponentCompilerE"]], "componentcompiler::componentcompiler (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17ComponentCompilerEv"]], "componentcompiler::build_from_path (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE"]], "componentcompiler::build_from_source (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE"]], "componentcompiler::diagnostics (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler11diagnosticsEv"]], "componentcompiler::include_paths (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler13include_pathsEv"]], "componentcompiler::set_include_paths (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE"]], "componentcompiler::set_style (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE"]], "componentcompiler::set_translation_domain (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE"]], "componentcompiler::style (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler5styleEv"]], "componentcompiler::~componentcompiler (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompilerD0Ev"]], "componentdefinition (c++ class)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionE"]], "componentdefinition::componentdefinition (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition"]], "componentdefinition::callbacks (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition9callbacksEv"]], "componentdefinition::create (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition6createEv"]], "componentdefinition::functions (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition9functionsEv"]], "componentdefinition::global_callbacks (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE"]], "componentdefinition::global_functions (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE"]], "componentdefinition::global_properties (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE"]], "componentdefinition::globals (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition7globalsEv"]], "componentdefinition::name (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition4nameEv"]], "componentdefinition::operator= (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition"]], "componentdefinition::properties (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition10propertiesEv"]], "componentdefinition::~componentdefinition (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionD0Ev"]], "componentinstance (c++ class)": [[13, "_CPPv4N5slint11interpreter17ComponentInstanceE"]], "componentinstance::definition (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance10definitionEv"]], "componentinstance::get_global_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE"]], "componentinstance::get_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE"]], "componentinstance::hide (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance4hideEv"]], "componentinstance::invoke (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE"]], "componentinstance::invoke_global (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE"]], "componentinstance::qwidget (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance7qwidgetEv"]], "componentinstance::run (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance3runEv"]], "componentinstance::set_callback (c++ function)": [[13, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F"]], "componentinstance::set_global_callback (c++ function)": [[13, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F"]], "componentinstance::set_global_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value"]], "componentinstance::set_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value"]], "componentinstance::show (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance4showEv"]], "componentinstance::window (c++ function)": [[13, "_CPPv4N5slint11interpreter17ComponentInstance6windowEv"]], "value (c++ class)": [[14, "_CPPv4N5slint11interpreter5ValueE"]], "value::type (c++ type)": [[14, "_CPPv4N5slint11interpreter5Value4TypeE"]], "value::value (c++ function)": [[14, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK5Image"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK5Value"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct"], [14, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERR5Value"], [14, "_CPPv4N5slint11interpreter5Value5ValueEb"], [14, "_CPPv4N5slint11interpreter5Value5ValueEd"], [14, "_CPPv4N5slint11interpreter5Value5ValueEi"], [14, "_CPPv4N5slint11interpreter5Value5ValueEv"]], "value::operator= (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueaSERK5Value"], [14, "_CPPv4N5slint11interpreter5ValueaSERR5Value"]], "value::operator== (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value"]], "value::to_array (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_arrayEv"]], "value::to_bool (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value7to_boolEv"]], "value::to_brush (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_brushEv"]], "value::to_image (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_imageEv"]], "value::to_number (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_numberEv"]], "value::to_string (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_stringEv"]], "value::to_struct (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_structEv"]], "value::type (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value4typeEv"]], "value::~value (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueD0Ev"]], "platform::abstractrenderer (c++ class)": [[15, "_CPPv4N5slint8platform16AbstractRendererE"]], "platform::nativewindowhandle (c++ class)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleE"]], "platform::nativewindowhandle::nativewindowhandle (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERK18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleEv"]], "platform::nativewindowhandle::from_appkit (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow"]], "platform::nativewindowhandle::from_wayland (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display"]], "platform::nativewindowhandle::from_win32 (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv"]], "platform::nativewindowhandle::from_x11_xcb (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti"]], "platform::nativewindowhandle::from_x11_xlib (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi"]], "platform::nativewindowhandle::operator= (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleaSERK18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle"]], "platform::nativewindowhandle::~nativewindowhandle (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleD0Ev"]], "platform::platform (c++ class)": [[17, "_CPPv4N5slint8platform8PlatformE"]], "platform::platform::clipboard (c++ enum)": [[17, "_CPPv4N5slint8platform8Platform9ClipboardE"]], "platform::platform::clipboard::defaultclipboard (c++ enumerator)": [[17, "_CPPv4N5slint8platform8Platform9Clipboard16DefaultClipboardE"]], "platform::platform::clipboard::selectionclipboard (c++ enumerator)": [[17, "_CPPv4N5slint8platform8Platform9Clipboard18SelectionClipboardE"]], "platform::platform::platform (c++ function)": [[17, "_CPPv4N5slint8platform8Platform8PlatformERK8Platform"], [17, "_CPPv4N5slint8platform8Platform8PlatformEv"]], "platform::platform::task (c++ class)": [[17, "_CPPv4N5slint8platform8Platform4TaskE"], [18, "_CPPv4N5slint8platform8Platform4TaskE"]], "platform::platform::task::task (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task"], [17, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task"], [18, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task"], [18, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task"]], "platform::platform::task::operator= (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task"], [17, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task"], [18, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task"], [18, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task"]], "platform::platform::task::run (c++ function)": [[17, "_CPPv4NO5slint8platform8Platform4Task3runEv"], [18, "_CPPv4NO5slint8platform8Platform4Task3runEv"]], "platform::platform::task::~task (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4TaskD0Ev"], [18, "_CPPv4N5slint8platform8Platform4TaskD0Ev"]], "platform::platform::clipboard_text (c++ function)": [[17, "_CPPv4N5slint8platform8Platform14clipboard_textE9Clipboard"]], "platform::platform::create_window_adapter (c++ function)": [[17, "_CPPv4N5slint8platform8Platform21create_window_adapterEv"]], "platform::platform::duration_since_start (c++ function)": [[17, "_CPPv4N5slint8platform8Platform20duration_since_startEv"]], "platform::platform::operator= (c++ function)": [[17, "_CPPv4N5slint8platform8PlatformaSERK8Platform"]], "platform::platform::quit_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform15quit_event_loopEv"]], "platform::platform::run_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform14run_event_loopEv"]], "platform::platform::run_in_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform17run_in_event_loopE4Task"]], "platform::platform::set_clipboard_text (c++ function)": [[17, "_CPPv4N5slint8platform8Platform18set_clipboard_textERK12SharedString9Clipboard"]], "platform::platform::~platform (c++ function)": [[17, "_CPPv4N5slint8platform8PlatformD0Ev"]], "platform::skiarenderer (c++ class)": [[19, "_CPPv4N5slint8platform12SkiaRendererE"]], "platform::skiarenderer::skiarenderer (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK12SkiaRenderer"], [19, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize"]], "platform::skiarenderer::operator= (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRendereraSERK12SkiaRenderer"]], "platform::skiarenderer::render (c++ function)": [[19, "_CPPv4NK5slint8platform12SkiaRenderer6renderEv"]], "platform::skiarenderer::~skiarenderer (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRendererD0Ev"]], "platform::softwarerenderer (c++ class)": [[20, "_CPPv4N5slint8platform16SoftwareRendererE"]], "platform::softwarerenderer::physicalregion (c++ struct)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE"]], "platform::softwarerenderer::physicalregion::rect (c++ struct)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"]], "platform::softwarerenderer::physicalregion::rect::origin (c++ member)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"]], "platform::softwarerenderer::physicalregion::rect::size (c++ member)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"]], "platform::softwarerenderer::physicalregion::bounding_box_origin (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv"]], "platform::softwarerenderer::physicalregion::bounding_box_size (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv"]], "platform::softwarerenderer::physicalregion::rectangles (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv"]], "platform::softwarerenderer::renderingrotation (c++ enum)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotationE"]], "platform::softwarerenderer::renderingrotation::norotation (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation10NoRotationE"]], "platform::softwarerenderer::renderingrotation::rotate180 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate180E"]], "platform::softwarerenderer::renderingrotation::rotate270 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate270E"]], "platform::softwarerenderer::renderingrotation::rotate90 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation8Rotate90E"]], "platform::softwarerenderer::repaintbuffertype (c++ enum)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferTypeE"]], "platform::softwarerenderer::repaintbuffertype::newbuffer (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType9NewBufferE"]], "platform::softwarerenderer::repaintbuffertype::reusedbuffer (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType12ReusedBufferE"]], "platform::softwarerenderer::repaintbuffertype::swappedbuffers (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType14SwappedBuffersE"]], "platform::softwarerenderer::softwarerenderer (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType"], [20, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererERK16SoftwareRenderer"]], "platform::softwarerenderer::operator= (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRendereraSERK16SoftwareRenderer"]], "platform::softwarerenderer::render (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE"], [20, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE"]], "platform::softwarerenderer::render_by_line (c++ function)": [[20, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback"]], "platform::softwarerenderer::set_rendering_rotation (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation"]], "platform::softwarerenderer::~softwarerenderer (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRendererD0Ev"]], "platform::windowadapter (c++ class)": [[21, "_CPPv4N5slint8platform13WindowAdapterE"]], "platform::windowadapter::windowadapter (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter13WindowAdapterEv"]], "platform::windowadapter::windowproperties (c++ struct)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE"]], "platform::windowadapter::windowproperties::layoutconstraints (c++ struct)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"]], "platform::windowadapter::windowproperties::layoutconstraints::max (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"]], "platform::windowadapter::windowproperties::layoutconstraints::min (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"]], "platform::windowadapter::windowproperties::layoutconstraints::preferred (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"]], "platform::windowadapter::windowproperties::background (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv"]], "platform::windowadapter::windowproperties::fullscreen (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv"]], "platform::windowadapter::windowproperties::is_fullscreen (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv"]], "platform::windowadapter::windowproperties::is_maximized (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv"]], "platform::windowadapter::windowproperties::is_minimized (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv"]], "platform::windowadapter::windowproperties::layout_constraints (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv"]], "platform::windowadapter::windowproperties::title (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv"]], "platform::windowadapter::position (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8positionEv"]], "platform::windowadapter::renderer (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8rendererEv"]], "platform::windowadapter::request_redraw (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter14request_redrawEv"]], "platform::windowadapter::set_position (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter12set_positionEN5slint16PhysicalPositionE"]], "platform::windowadapter::set_size (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8set_sizeEN5slint12PhysicalSizeE"]], "platform::windowadapter::set_visible (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter11set_visibleEb"]], "platform::windowadapter::size (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter4sizeEv"]], "platform::windowadapter::update_window_properties (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter24update_window_propertiesERK16WindowProperties"]], "platform::windowadapter::window (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter6windowEv"], [21, "_CPPv4NK5slint8platform13WindowAdapter6windowEv"]], "platform::windowadapter::~windowadapter (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapterD0Ev"]], "testing::elementhandle (c++ class)": [[22, "_CPPv4N5slint7testing13ElementHandleE"]], "testing::elementhandle::absolute_position (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle17absolute_positionEv"]], "testing::elementhandle::accessible_checkable (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle20accessible_checkableEv"]], "testing::elementhandle::accessible_checked (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle18accessible_checkedEv"]], "testing::elementhandle::accessible_description (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle22accessible_descriptionEv"]], "testing::elementhandle::accessible_label (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle16accessible_labelEv"]], "testing::elementhandle::accessible_placeholder_text (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle27accessible_placeholder_textEv"]], "testing::elementhandle::accessible_role (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle15accessible_roleEv"]], "testing::elementhandle::accessible_value (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle16accessible_valueEv"]], "testing::elementhandle::accessible_value_maximum (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_maximumEv"]], "testing::elementhandle::accessible_value_minimum (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_minimumEv"]], "testing::elementhandle::accessible_value_step (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle21accessible_value_stepEv"]], "testing::elementhandle::bases (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle5basesEv"]], "testing::elementhandle::find_by_accessible_label (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::find_by_element_id (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::find_by_element_type_name (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::id (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle2idEv"]], "testing::elementhandle::invoke_accessible_decrement_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_decrement_actionEv"]], "testing::elementhandle::invoke_accessible_default_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle32invoke_accessible_default_actionEv"]], "testing::elementhandle::invoke_accessible_increment_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_increment_actionEv"]], "testing::elementhandle::is_valid (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle8is_validEv"]], "testing::elementhandle::set_accessible_value (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString"]], "testing::elementhandle::size (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle4sizeEv"]], "testing::elementhandle::type_name (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle9type_nameEv"]], "testing::elementhandle::visit_elements (c++ function)": [[22, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor"]], "slint_feature_backend_qt (c macro)": [[23, "c.SLINT_FEATURE_BACKEND_QT"]], "slint_feature_gettext (c macro)": [[24, "c.SLINT_FEATURE_GETTEXT"]], "slint_feature_interpreter (c macro)": [[25, "c.SLINT_FEATURE_INTERPRETER"]], "slint_version_patch (c macro)": [[26, "c.SLINT_VERSION_PATCH"]], "slint_feature_backend_linuxkms (c macro)": [[27, "c.SLINT_FEATURE_BACKEND_LINUXKMS"]], "slint_feature_experimental (c macro)": [[28, "c.SLINT_FEATURE_EXPERIMENTAL"]], "slint_version_string (c macro)": [[29, "c.SLINT_VERSION_STRING"]], "slint_feature_renderer_femtovg (c macro)": [[30, "c.SLINT_FEATURE_RENDERER_FEMTOVG"]], "slint_feature_renderer_skia (c macro)": [[31, "c.SLINT_FEATURE_RENDERER_SKIA"]], "slint_feature_system_testing (c macro)": [[32, "c.SLINT_FEATURE_SYSTEM_TESTING"]], "slint_feature_accessibility (c macro)": [[33, "c.SLINT_FEATURE_ACCESSIBILITY"]], "slint_feature_renderer_software (c macro)": [[34, "c.SLINT_FEATURE_RENDERER_SOFTWARE"]], "slint_version_minor (c macro)": [[35, "c.SLINT_VERSION_MINOR"]], "slint_feature_freestanding (c macro)": [[36, "c.SLINT_FEATURE_FREESTANDING"]], "slint_feature_testing (c macro)": [[37, "c.SLINT_FEATURE_TESTING"]], "slint_version_major (c macro)": [[38, "c.SLINT_VERSION_MAJOR"]], "slint_feature_backend_winit (c macro)": [[39, "c.SLINT_FEATURE_BACKEND_WINIT"]], "assert_eq (c macro)": [[40, "c.assert_eq"]], "valuetype (c++ enum)": [[46, "_CPPv4N5slint11interpreter9ValueTypeE"]], "valuetype::bool (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType4BoolE"]], "valuetype::brush (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5BrushE"]], "valuetype::image (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5ImageE"]], "valuetype::model (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5ModelE"]], "valuetype::number (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6NumberE"]], "valuetype::other (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5OtherE"]], "valuetype::string (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6StringE"]], "valuetype::struct (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6StructE"]], "valuetype::void (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType4VoidE"]], "diagnosticlevel (c++ enum)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevelE"]], "diagnosticlevel::error (c++ enumerator)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevel5ErrorE"]], "diagnosticlevel::warning (c++ enumerator)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevel7WarningE"]], "testing::accessiblerole (c++ enum)": [[48, "_CPPv4N5slint7testing14AccessibleRoleE"]], "testing::accessiblerole::button (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6ButtonE"]], "testing::accessiblerole::checkbox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8CheckboxE"]], "testing::accessiblerole::combobox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8ComboboxE"]], "testing::accessiblerole::list (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4ListE"]], "testing::accessiblerole::listitem (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8ListItemE"]], "testing::accessiblerole::none (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4NoneE"]], "testing::accessiblerole::progressindicator (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole17ProgressIndicatorE"]], "testing::accessiblerole::slider (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6SliderE"]], "testing::accessiblerole::spinbox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole7SpinboxE"]], "testing::accessiblerole::switch (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6SwitchE"]], "testing::accessiblerole::tab (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole3TabE"]], "testing::accessiblerole::tablist (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole7TabListE"]], "testing::accessiblerole::table (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole5TableE"]], "testing::accessiblerole::text (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4TextE"]], "testing::accessiblerole::textinput (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole9TextInputE"]], "testing::accessiblerole::tree (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4TreeE"]], "setrenderingnotifiererror (c++ enum)": [[49, "_CPPv4N5slint25SetRenderingNotifierErrorE"]], "setrenderingnotifiererror::alreadyset (c++ enumerator)": [[49, "_CPPv4N5slint25SetRenderingNotifierError10AlreadySetE"]], "setrenderingnotifiererror::unsupported (c++ enumerator)": [[49, "_CPPv4N5slint25SetRenderingNotifierError11UnsupportedE"]], "pointereventbutton (c++ enum)": [[50, "_CPPv4N5slint18PointerEventButtonE"]], "pointereventbutton::back (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton4BackE"]], "pointereventbutton::forward (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton7ForwardE"]], "pointereventbutton::left (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton4LeftE"]], "pointereventbutton::middle (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton6MiddleE"]], "pointereventbutton::other (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton5OtherE"]], "pointereventbutton::right (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton5RightE"]], "eventloopmode (c++ enum)": [[51, "_CPPv4N5slint13EventLoopModeE"]], "eventloopmode::quitonlastwindowclosed (c++ enumerator)": [[51, "_CPPv4N5slint13EventLoopMode22QuitOnLastWindowClosedE"]], "eventloopmode::rununtilquit (c++ enumerator)": [[51, "_CPPv4N5slint13EventLoopMode12RunUntilQuitE"]], "graphicsapi (c++ enum)": [[52, "_CPPv4N5slint11GraphicsAPIE"]], "graphicsapi::nativeopengl (c++ enumerator)": [[52, "_CPPv4N5slint11GraphicsAPI12NativeOpenGLE"]], "renderingstate (c++ enum)": [[53, "_CPPv4N5slint14RenderingStateE"]], "renderingstate::afterrendering (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState14AfterRenderingE"]], "renderingstate::beforerendering (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState15BeforeRenderingE"]], "renderingstate::renderingsetup (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState14RenderingSetupE"]], "renderingstate::renderingteardown (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState17RenderingTeardownE"]], "closerequestresponse (c++ enum)": [[54, "_CPPv4N5slint20CloseRequestResponseE"]], "closerequestresponse::hidewindow (c++ enumerator)": [[54, "_CPPv4N5slint20CloseRequestResponse10HideWindowE"]], "closerequestresponse::keepwindowshown (c++ enumerator)": [[54, "_CPPv4N5slint20CloseRequestResponse15KeepWindowShownE"]], "platform::duration_until_next_timer_update (c++ function)": [[93, "_CPPv4N5slint8platform32duration_until_next_timer_updateEv"]], "platform::update_timers_and_animations (c++ function)": [[94, "_CPPv4N5slint8platform28update_timers_and_animationsEv"]], "platform::set_platform (c++ function)": [[95, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE"]], "testing::init (c++ function)": [[96, "_CPPv4N5slint7testing4initEv"]], "quit_event_loop (c++ function)": [[97, "_CPPv4N5slint15quit_event_loopEv"]], "invoke_from_event_loop (c++ function)": [[98, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor"]], "blocking_invoke_from_event_loop (c++ function)": [[99, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor"]], "run_event_loop (c++ function)": [[100, "_CPPv4N5slint14run_event_loopE13EventLoopMode"]], "update_all_translations (c++ function)": [[101, "_CPPv4N5slint23update_all_translationsEv"]], "hsvacolor (c++ struct)": [[147, "_CPPv4N5slint9HsvaColorE"]], "hsvacolor::alpha (c++ member)": [[147, "_CPPv4N5slint9HsvaColor5alphaE"]], "hsvacolor::hue (c++ member)": [[147, "_CPPv4N5slint9HsvaColor3hueE"]], "hsvacolor::saturation (c++ member)": [[147, "_CPPv4N5slint9HsvaColor10saturationE"]], "hsvacolor::value (c++ member)": [[147, "_CPPv4N5slint9HsvaColor5valueE"]], "image (c++ struct)": [[148, "_CPPv4N5slint5ImageE"]], "image::borrowedopengltextureorigin (c++ enum)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOriginE"]], "image::borrowedopengltextureorigin::bottomleft (c++ enumerator)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin10BottomLeftE"]], "image::borrowedopengltextureorigin::topleft (c++ enumerator)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin7TopLeftE"]], "image::image (c++ function)": [[148, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE"], [148, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE"], [148, "_CPPv4N5slint5Image5ImageEv"]], "image::create_from_borrowed_gl_2d_rgba_texture (c++ function)": [[148, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin"]], "image::load_from_path (c++ function)": [[148, "_CPPv4N5slint5Image14load_from_pathERK12SharedString"]], "image::operator!= (c++ function)": [[148, "_CPPv4N5slint5ImageneERK5ImageRK5Image"]], "image::operator== (c++ function)": [[148, "_CPPv4N5slint5ImageeqERK5ImageRK5Image"]], "image::path (c++ function)": [[148, "_CPPv4NK5slint5Image4pathEv"]], "image::set_nine_slice_edges (c++ function)": [[148, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt"]], "image::size (c++ function)": [[148, "_CPPv4NK5slint5Image4sizeEv"]], "image::to_rgb8 (c++ function)": [[148, "_CPPv4NK5slint5Image7to_rgb8Ev"]], "image::to_rgba8 (c++ function)": [[148, "_CPPv4NK5slint5Image8to_rgba8Ev"]], "image::to_rgba8_premultiplied (c++ function)": [[148, "_CPPv4NK5slint5Image22to_rgba8_premultipliedEv"]], "logicalposition (c++ struct)": [[149, "_CPPv4N5slint15LogicalPositionE"]], "logicalposition::logicalposition (c++ function)": [[149, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE"], [149, "_CPPv4N5slint15LogicalPosition15LogicalPositionEv"]], "logicalsize (c++ struct)": [[150, "_CPPv4N5slint11LogicalSizeE"]], "logicalsize::logicalsize (c++ function)": [[150, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE"]], "physicalposition (c++ struct)": [[151, "_CPPv4N5slint16PhysicalPositionE"]], "physicalposition::physicalposition (c++ function)": [[151, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE"], [151, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEv"]], "physicalsize (c++ struct)": [[152, "_CPPv4N5slint12PhysicalSizeE"]], "physicalsize::physicalsize (c++ function)": [[152, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE"]], "point (c++ struct)": [[153, "_CPPv4I0EN5slint5PointE"]], "point::operator== (c++ function)": [[153, "_CPPv4NK5slint5PointeqERK5Point"]], "point::x (c++ member)": [[153, "_CPPv4N5slint5Point1xE"]], "point::y (c++ member)": [[153, "_CPPv4N5slint5Point1yE"]], "rgb8pixel (c++ struct)": [[154, "_CPPv4N5slint9Rgb8PixelE"]], "rgb8pixel::b (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1bE"]], "rgb8pixel::g (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1gE"]], "rgb8pixel::r (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1rE"]], "rgba8pixel (c++ struct)": [[155, "_CPPv4N5slint10Rgba8PixelE"]], "rgba8pixel::a (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1aE"]], "rgba8pixel::b (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1bE"]], "rgba8pixel::g (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1gE"]], "rgba8pixel::r (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1rE"]], "rgbacolor (c++ struct)": [[156, "_CPPv4I0EN5slint9RgbaColorE"]], "rgbacolor::rgbacolor (c++ function)": [[156, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color"]], "rgbacolor::alpha (c++ member)": [[156, "_CPPv4N5slint9RgbaColor5alphaE"]], "rgbacolor::blue (c++ member)": [[156, "_CPPv4N5slint9RgbaColor4blueE"]], "rgbacolor::green (c++ member)": [[156, "_CPPv4N5slint9RgbaColor5greenE"]], "rgbacolor::red (c++ member)": [[156, "_CPPv4N5slint9RgbaColor3redE"]], "sharedpixelbuffer (c++ struct)": [[157, "_CPPv4I0EN5slint17SharedPixelBufferE"]], "sharedpixelbuffer::sharedpixelbuffer (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t"], [157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel"], [157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferEv"]], "sharedpixelbuffer::begin (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer5beginEv"], [157, "_CPPv4NK5slint17SharedPixelBuffer5beginEv"]], "sharedpixelbuffer::cbegin (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer6cbeginEv"]], "sharedpixelbuffer::cend (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer4cendEv"]], "sharedpixelbuffer::end (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer3endEv"], [157, "_CPPv4NK5slint17SharedPixelBuffer3endEv"]], "sharedpixelbuffer::height (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer6heightEv"]], "sharedpixelbuffer::operator== (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer"]], "sharedpixelbuffer::width (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer5widthEv"]], "sharedstring (c++ struct)": [[158, "_CPPv4N5slint12SharedStringE"]], "sharedstring::sharedstring (c++ function)": [[158, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE"], [158, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE"], [158, "_CPPv4N5slint12SharedString12SharedStringEPKDu"], [158, "_CPPv4N5slint12SharedString12SharedStringEPKc"], [158, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString"], [158, "_CPPv4N5slint12SharedString12SharedStringEv"]], "sharedstring::begin (c++ function)": [[158, "_CPPv4NK5slint12SharedString5beginEv"]], "sharedstring::data (c++ function)": [[158, "_CPPv4NK5slint12SharedString4dataEv"]], "sharedstring::empty (c++ function)": [[158, "_CPPv4NK5slint12SharedString5emptyEv"]], "sharedstring::end (c++ function)": [[158, "_CPPv4NK5slint12SharedString3endEv"]], "sharedstring::ends_with (c++ function)": [[158, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE"]], "sharedstring::from_number (c++ function)": [[158, "_CPPv4N5slint12SharedString11from_numberEd"]], "sharedstring::operator std::string_view (c++ function)": [[158, "_CPPv4NK5slint12SharedStringcvNSt11string_viewEEv"]], "sharedstring::operator!= (c++ function)": [[158, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString"]], "sharedstring::operator+ (c++ function)": [[158, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE"], [158, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE"]], "sharedstring::operator+= (c++ function)": [[158, "_CPPv4N5slint12SharedStringpLENSt11string_viewE"]], "sharedstring::operator< (c++ function)": [[158, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString"]], "sharedstring::operator<< (c++ function)": [[158, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString"]], "sharedstring::operator<= (c++ function)": [[158, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString"]], "sharedstring::operator= (c++ function)": [[158, "_CPPv4N5slint12SharedStringaSENSt11string_viewE"], [158, "_CPPv4N5slint12SharedStringaSEPKc"], [158, "_CPPv4N5slint12SharedStringaSERK12SharedString"], [158, "_CPPv4N5slint12SharedStringaSERR12SharedString"]], "sharedstring::operator== (c++ function)": [[158, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString"]], "sharedstring::operator> (c++ function)": [[158, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString"]], "sharedstring::operator>= (c++ function)": [[158, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString"]], "sharedstring::size (c++ function)": [[158, "_CPPv4NK5slint12SharedString4sizeEv"]], "sharedstring::starts_with (c++ function)": [[158, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE"]], "sharedstring::~sharedstring (c++ function)": [[158, "_CPPv4N5slint12SharedStringD0Ev"]], "sharedvector (c++ struct)": [[159, "_CPPv4I0EN5slint12SharedVectorE"]], "sharedvector::sharedvector (c++ function)": [[159, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt"], [159, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t"], [159, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T"], [159, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE"], [159, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector"], [159, "_CPPv4N5slint12SharedVector12SharedVectorEv"]], "sharedvector::at (c++ function)": [[159, "_CPPv4NK5slint12SharedVector2atENSt6size_tE"]], "sharedvector::begin (c++ function)": [[159, "_CPPv4N5slint12SharedVector5beginEv"], [159, "_CPPv4NK5slint12SharedVector5beginEv"]], "sharedvector::cbegin (c++ function)": [[159, "_CPPv4NK5slint12SharedVector6cbeginEv"]], "sharedvector::cend (c++ function)": [[159, "_CPPv4NK5slint12SharedVector4cendEv"]], "sharedvector::clear (c++ function)": [[159, "_CPPv4N5slint12SharedVector5clearEv"]], "sharedvector::empty (c++ function)": [[159, "_CPPv4NK5slint12SharedVector5emptyEv"]], "sharedvector::end (c++ function)": [[159, "_CPPv4N5slint12SharedVector3endEv"], [159, "_CPPv4NK5slint12SharedVector3endEv"]], "sharedvector::operator= (c++ function)": [[159, "_CPPv4N5slint12SharedVectoraSERK12SharedVector"], [159, "_CPPv4N5slint12SharedVectoraSERR12SharedVector"]], "sharedvector::operator== (c++ function)": [[159, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector"]], "sharedvector::operator[] (c++ function)": [[159, "_CPPv4N5slint12SharedVectorixENSt6size_tE"], [159, "_CPPv4NK5slint12SharedVectorixENSt6size_tE"]], "sharedvector::push_back (c++ function)": [[159, "_CPPv4N5slint12SharedVector9push_backERK1T"], [159, "_CPPv4N5slint12SharedVector9push_backERR1T"]], "sharedvector::size (c++ function)": [[159, "_CPPv4NK5slint12SharedVector4sizeEv"]], "sharedvector::~sharedvector (c++ function)": [[159, "_CPPv4N5slint12SharedVectorD0Ev"]], "size (c++ struct)": [[160, "_CPPv4I0EN5slint4SizeE"]], "size::height (c++ member)": [[160, "_CPPv4N5slint4Size6heightE"]], "size::operator== (c++ function)": [[160, "_CPPv4NK5slint4SizeeqERK4Size"]], "size::width (c++ member)": [[160, "_CPPv4N5slint4Size5widthE"]], "standardlistviewitem (c++ struct)": [[161, "_CPPv4N5slint20StandardListViewItemE"]], "standardlistviewitem::text (c++ member)": [[161, "_CPPv4N5slint20StandardListViewItem4textE"]], "timer (c++ struct)": [[162, "_CPPv4N5slint5TimerE"]], "timer::timer (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F"], [162, "_CPPv4N5slint5Timer5TimerERK5Timer"], [162, "_CPPv4N5slint5Timer5TimerEv"]], "timer::interval (c++ function)": [[162, "_CPPv4NK5slint5Timer8intervalEv"]], "timer::operator= (c++ function)": [[162, "_CPPv4N5slint5TimeraSERK5Timer"]], "timer::restart (c++ function)": [[162, "_CPPv4N5slint5Timer7restartEv"]], "timer::running (c++ function)": [[162, "_CPPv4NK5slint5Timer7runningEv"]], "timer::single_shot (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F"]], "timer::start (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F"]], "timer::stop (c++ function)": [[162, "_CPPv4N5slint5Timer4stopEv"]], "timer::~timer (c++ function)": [[162, "_CPPv4N5slint5TimerD0Ev"]], "diagnostic (c++ struct)": [[163, "_CPPv4N5slint11interpreter10DiagnosticE"]], "diagnostic::column (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic6columnE"]], "diagnostic::level (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic5levelE"]], "diagnostic::line (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic4lineE"]], "diagnostic::message (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic7messageE"]], "diagnostic::source_file (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic11source_fileE"]], "propertydescriptor (c++ struct)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptorE"]], "propertydescriptor::property_name (c++ member)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_nameE"]], "propertydescriptor::property_type (c++ member)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_typeE"]], "struct (c++ struct)": [[165, "_CPPv4N5slint11interpreter6StructE"]], "struct::struct (c++ function)": [[165, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator"], [165, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE"], [165, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct"], [165, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct"], [165, "_CPPv4N5slint11interpreter6Struct6StructEv"]], "struct::begin (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct5beginEv"]], "struct::end (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct3endEv"]], "struct::get_field (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE"]], "struct::iterator (c++ struct)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorE"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorE"]], "struct::iterator::iterator (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator"], [165, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator"]], "struct::iterator::operator!= (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator"]], "struct::iterator::operator* (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv"], [166, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv"]], "struct::iterator::operator++ (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorppEv"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorppEv"]], "struct::iterator::operator= (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator"], [165, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator"]], "struct::iterator::operator== (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator"]], "struct::iterator::value_type (c++ type)": [[165, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE"], [166, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE"]], "struct::iterator::~iterator (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev"]], "struct::operator= (c++ function)": [[165, "_CPPv4N5slint11interpreter6StructaSERK6Struct"], [165, "_CPPv4N5slint11interpreter6StructaSERR6Struct"]], "struct::set_field (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value"]], "struct::~struct (c++ function)": [[165, "_CPPv4N5slint11interpreter6StructD0Ev"]], "platform::rgb565pixel (c++ struct)": [[167, "_CPPv4N5slint8platform11Rgb565PixelE"]], "platform::rgb565pixel::rgb565pixel (c++ function)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel"], [167, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelEv"]], "platform::rgb565pixel::b (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1bE"]], "platform::rgb565pixel::blue (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel4blueEv"]], "platform::rgb565pixel::g (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1gE"]], "platform::rgb565pixel::green (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel5greenEv"]], "platform::rgb565pixel::operator rgb8pixel (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixelcv9Rgb8PixelEv"]], "platform::rgb565pixel::operator== (c++ function)": [[167, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel"]], "platform::rgb565pixel::r (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1rE"]], "platform::rgb565pixel::red (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel3redEv"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["api/classslint_1_1Brush", "api/classslint_1_1Color", "api/classslint_1_1ComponentHandle", "api/classslint_1_1ComponentWeakHandle", "api/classslint_1_1FilterModel", "api/classslint_1_1MapModel", "api/classslint_1_1Model", "api/classslint_1_1ReverseModel", "api/classslint_1_1SortModel", "api/classslint_1_1VectorModel", "api/classslint_1_1Window", "api/classslint_1_1interpreter_1_1ComponentCompiler", "api/classslint_1_1interpreter_1_1ComponentDefinition", "api/classslint_1_1interpreter_1_1ComponentInstance", "api/classslint_1_1interpreter_1_1Value", "api/classslint_1_1platform_1_1AbstractRenderer", "api/classslint_1_1platform_1_1NativeWindowHandle", "api/classslint_1_1platform_1_1Platform", "api/classslint_1_1platform_1_1Platform_1_1Task", "api/classslint_1_1platform_1_1SkiaRenderer", "api/classslint_1_1platform_1_1SoftwareRenderer", "api/classslint_1_1platform_1_1WindowAdapter", "api/classslint_1_1testing_1_1ElementHandle", "api/define_slint__generated__public_8h_1a059d07f7089fb5d27b24d13e381db0a7", "api/define_slint__generated__public_8h_1a24b3d3a9cd474a66ac86ee4ee9315ce9", "api/define_slint__generated__public_8h_1a45557b46bf1159e97c4ace494d67a53f", "api/define_slint__generated__public_8h_1a498ec177f96b7bce248660a6dd795d8d", "api/define_slint__generated__public_8h_1a5484a031a9ff5f3bbb6de5464f4090a4", "api/define_slint__generated__public_8h_1a56612ce4cec4904836a5caf33bedba79", "api/define_slint__generated__public_8h_1a6b7f049a8c7176edc87c4cffddfc1bbd", "api/define_slint__generated__public_8h_1a7cafd723338e5b25a8d69039ce408cf9", "api/define_slint__generated__public_8h_1a84ab6227b0f7c83d1d55702c8c406ee0", "api/define_slint__generated__public_8h_1a88f96ba89b5ee3c3cdf05743aaa4aa2a", "api/define_slint__generated__public_8h_1a9aa08b9d77373aeed64c2f2507e28552", "api/define_slint__generated__public_8h_1aac4320248b71bd21ac65d833974b5cb5", "api/define_slint__generated__public_8h_1aba0d27c0c821a27a3726baa609646ea9", "api/define_slint__generated__public_8h_1acf6e80daf6c7c50227d002546f0025e3", "api/define_slint__generated__public_8h_1acf78b72a3c7b65dfc2d13f4e698cc01a", "api/define_slint__generated__public_8h_1aeb2b5fc045f08ccf894bd47b2696b853", "api/define_slint__generated__public_8h_1af7931a7cf2a1073d5f0174b38af28364", "api/define_slint__tests__helpers_8h_1af0a649b4b7b90dc4c9e531d459371b95", "api/dir__home_runner_work_slint_slint_api", "api/dir__home_runner_work_slint_slint_api_cpp", "api/dir__home_runner_work_slint_slint_api_cpp_include", "api/dir_cppdocs", "api/dir_cppdocs_generated_include", "api/enum_namespaceslint_1_1interpreter_1a6221319f778c7369e1b76672690926e0", "api/enum_namespaceslint_1_1interpreter_1ad2ba3b4dd1434535294d334a9daf502d", "api/enum_namespaceslint_1_1testing_1a4de74a3a436a7a3fd9a228930f69274d", "api/enum_namespaceslint_1a435dcad112c13fd7fefb2de66e83d1b1", "api/enum_namespaceslint_1a88e5489a21965b1a271bf90ee12f1c6e", "api/enum_namespaceslint_1a8bec56d112d5490780fa52c77326d290", "api/enum_namespaceslint_1a90c0ddbfdc375daafbcf91361293538b", "api/enum_namespaceslint_1aa9bda1bcc95bc66d8afd7b1a4aa8c4af", "api/enum_namespaceslint_1abb2b0aa4769a501e7cdeaccae964a64c", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_color.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_config.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_image.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_point.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_size.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_string.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_window.h", "api/file_cppdocs_generated_include_slint_brush_internal.h", "api/file_cppdocs_generated_include_slint_builtin_structs.h", "api/file_cppdocs_generated_include_slint_builtin_structs_internal.h", "api/file_cppdocs_generated_include_slint_color_internal.h", "api/file_cppdocs_generated_include_slint_enums.h", "api/file_cppdocs_generated_include_slint_enums_internal.h", "api/file_cppdocs_generated_include_slint_generated_public.h", "api/file_cppdocs_generated_include_slint_image_internal.h", "api/file_cppdocs_generated_include_slint_internal.h", "api/file_cppdocs_generated_include_slint_interpreter_generated_public.h", "api/file_cppdocs_generated_include_slint_interpreter_internal.h", "api/file_cppdocs_generated_include_slint_pathdata_internal.h", "api/file_cppdocs_generated_include_slint_platform_internal.h", "api/file_cppdocs_generated_include_slint_properties_internal.h", "api/file_cppdocs_generated_include_slint_qt_internal.h", "api/file_cppdocs_generated_include_slint_sharedvector_internal.h", "api/file_cppdocs_generated_include_slint_string_internal.h", "api/file_cppdocs_generated_include_slint_testing_internal.h", "api/file_cppdocs_generated_include_slint_timer_internal.h", "api/function_namespaceslint_1_1platform_1a4c4cb5b3db64f28314951c81c7f69658", "api/function_namespaceslint_1_1platform_1a71af3a3240e18b74b5e0c3b646db90c3", "api/function_namespaceslint_1_1platform_1a78d943b2302a68af7e187ea4154d4a64", "api/function_namespaceslint_1_1testing_1afcc3fa8289264ede59668796cf0341b4", "api/function_namespaceslint_1a14298dd1f4c7ab8c553e047e3704d6d0", "api/function_namespaceslint_1a4067c90b05ef4cb20e055117b0263430", "api/function_namespaceslint_1a9ade5df8e39fbec7d2af3c0dd3bd4d9c", "api/function_namespaceslint_1ad900fe1e670815101871442dc17aa74b", "api/function_namespaceslint_1aefd8612f7c509003040eddfaf7a38505", "api/library_root", "api/namespace_slint", "api/namespace_slint__interpreter", "api/namespace_slint__platform", "api/namespace_slint__platform__key_codes", "api/namespace_slint__testing", "api/page_deprecated", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_color.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_config.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_image.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_point.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_size.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_string.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_window.h", "api/program_listing_file_cppdocs_generated_include_slint_brush_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs.h", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_color_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_enums.h", "api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_generated_public.h", "api/program_listing_file_cppdocs_generated_include_slint_image_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_generated_public.h", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_pathdata_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_platform_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_properties_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_sharedvector_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_string_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_testing_internal.h", "api/program_listing_file_cppdocs_generated_include_slint_timer_internal.h", "api/structslint_1_1HsvaColor", "api/structslint_1_1Image", "api/structslint_1_1LogicalPosition", "api/structslint_1_1LogicalSize", "api/structslint_1_1PhysicalPosition", "api/structslint_1_1PhysicalSize", "api/structslint_1_1Point", "api/structslint_1_1Rgb8Pixel", "api/structslint_1_1Rgba8Pixel", "api/structslint_1_1RgbaColor", "api/structslint_1_1SharedPixelBuffer", "api/structslint_1_1SharedString", "api/structslint_1_1SharedVector", "api/structslint_1_1Size", "api/structslint_1_1StandardListViewItem", "api/structslint_1_1Timer", "api/structslint_1_1interpreter_1_1Diagnostic", "api/structslint_1_1interpreter_1_1PropertyDescriptor", "api/structslint_1_1interpreter_1_1Struct", "api/structslint_1_1interpreter_1_1Struct_1_1iterator", "api/structslint_1_1platform_1_1Rgb565Pixel", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion_1_1Rect", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties_1_1LayoutConstraints", "api/unabridged_orphan", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a00330cf08e78888ec33cb4aad7695f2c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a037e34a7a75bd9b8fc07b0f5039302df", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a0456177e3225079f495df1a40eb25de6", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a04fed87f00ef9e12e82613c4855af333", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1375031be6c0b8c45d9df956037df69d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a13c2d54873316cd42061a8b65db36361", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a16fb91042adacd1de93bcf8a108cca8b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1907927aae2e873492ea4d266d6e9009", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a20afa8a531fee6e8d2503f3670d29b76", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a293f7e38adb43a8f5434e8e900678652", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a427463ae65210afe9d5a966d00a8b4f6", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a472bf83dfe8bd88399ff9e0a6c36d950", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a4c83e50d2ba5a7d2f9399053f84e064f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a569d5973c36441dd8fb3c88a61c48b7d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a597926fdfddd8a0e466a3f82b7ce2fcd", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5a2a920d1055575213a0959dc16a3661", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5e01d967f144985e037cd53181559909", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a65876fa90448017ac586c13a47ce604b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6b813cb686d89e8e8d3891259b7115d9", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6e73cc7ade6d8452c8c2047ec00964bb", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a72a98f7ac7b1893a25fb20f78dd42675", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a73b54ab296bc68ad7fd177222471679f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a799426f66be94c7aeab5798ece7ff2bf", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7d33f3bd6fbde5f7556df7c2996ab0ed", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7f6e9766b89ac25f49671e6a606109ba", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a851d09118169ae64d44c1ce04cc3d39d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8551fc7e5309b803a5324347445c6d0e", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8bd8df35acb6a08504e955d18b85b4fe", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8c063c4c238f189edd899b96c42f509b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8d46c4e5ef87c72b2c3fd3a0d34c0bef", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a986ca27ff73d68aaa7bacb4d5c509fba", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a9cd8a0d139cafb40c54c9613d8a23bb3", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa329a177650db85052f4a4ce45abf32d", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa46f7e2b5c3f817227683cf5c2d8b92a", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa68b696b0425e397cb24edae6528a68c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aae06cbdc02fdffe6a787214d25e0ed19", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab59f14f7e68c980b6db14852df2c5262", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab78ea33dc3464497974100b841eeec4c", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aba893f8091b3e8be97636d2144047818", "api/variable_namespaceslint_1_1platform_1_1key__codes_1abf6255bec49fffb7c7228476877932b7", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ac32910f77f4588aa03446574e7e6b48b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1acab5a3836aa794489b91f3cc06a1e4ad", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad2e7bbf67cfcea73f242d193bb541e42", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3a76f93967bed6e0bf1055d2fb5f97b", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3ba1170ea89d2feaebadff11cf01871", "api/variable_namespaceslint_1_1platform_1_1key__codes_1add3be02945fa6ebc94a99e2fc2d7ba20", "api/variable_namespaceslint_1_1platform_1_1key__codes_1addf9890750954a90f025235fdd82e9b4", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ade29cc46911c0d95f1a0601870117c8a", "api/variable_namespaceslint_1_1platform_1_1key__codes_1adf1a443c827c42391ffbb0cbbf1da3f8", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ae75e3231824370890cc26cda0fe07a75", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af56ac133d6d5242fb4f547d5546cb42f", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af674468525494d802b017d421f0432e7", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af883c4301b011c64a67d98c7369d674e", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aff5729be964f23fc970f5f80217f5bec", "cmake", "cmake_reference", "generated_code", "genindex", "getting_started", "index", "mcu/esp-idf/troubleshoot", "mcu/esp_idf", "mcu/generic", "mcu/intro", "mcu/stm32", "mcu/stm32/generic", "overview", "types"], "filenames": ["api/classslint_1_1Brush.rst", "api/classslint_1_1Color.rst", "api/classslint_1_1ComponentHandle.rst", "api/classslint_1_1ComponentWeakHandle.rst", "api/classslint_1_1FilterModel.rst", "api/classslint_1_1MapModel.rst", "api/classslint_1_1Model.rst", "api/classslint_1_1ReverseModel.rst", "api/classslint_1_1SortModel.rst", "api/classslint_1_1VectorModel.rst", "api/classslint_1_1Window.rst", "api/classslint_1_1interpreter_1_1ComponentCompiler.rst", "api/classslint_1_1interpreter_1_1ComponentDefinition.rst", "api/classslint_1_1interpreter_1_1ComponentInstance.rst", "api/classslint_1_1interpreter_1_1Value.rst", "api/classslint_1_1platform_1_1AbstractRenderer.rst", "api/classslint_1_1platform_1_1NativeWindowHandle.rst", "api/classslint_1_1platform_1_1Platform.rst", "api/classslint_1_1platform_1_1Platform_1_1Task.rst", "api/classslint_1_1platform_1_1SkiaRenderer.rst", "api/classslint_1_1platform_1_1SoftwareRenderer.rst", "api/classslint_1_1platform_1_1WindowAdapter.rst", "api/classslint_1_1testing_1_1ElementHandle.rst", "api/define_slint__generated__public_8h_1a059d07f7089fb5d27b24d13e381db0a7.rst", "api/define_slint__generated__public_8h_1a24b3d3a9cd474a66ac86ee4ee9315ce9.rst", "api/define_slint__generated__public_8h_1a45557b46bf1159e97c4ace494d67a53f.rst", "api/define_slint__generated__public_8h_1a498ec177f96b7bce248660a6dd795d8d.rst", "api/define_slint__generated__public_8h_1a5484a031a9ff5f3bbb6de5464f4090a4.rst", "api/define_slint__generated__public_8h_1a56612ce4cec4904836a5caf33bedba79.rst", "api/define_slint__generated__public_8h_1a6b7f049a8c7176edc87c4cffddfc1bbd.rst", "api/define_slint__generated__public_8h_1a7cafd723338e5b25a8d69039ce408cf9.rst", "api/define_slint__generated__public_8h_1a84ab6227b0f7c83d1d55702c8c406ee0.rst", "api/define_slint__generated__public_8h_1a88f96ba89b5ee3c3cdf05743aaa4aa2a.rst", "api/define_slint__generated__public_8h_1a9aa08b9d77373aeed64c2f2507e28552.rst", "api/define_slint__generated__public_8h_1aac4320248b71bd21ac65d833974b5cb5.rst", "api/define_slint__generated__public_8h_1aba0d27c0c821a27a3726baa609646ea9.rst", "api/define_slint__generated__public_8h_1acf6e80daf6c7c50227d002546f0025e3.rst", "api/define_slint__generated__public_8h_1acf78b72a3c7b65dfc2d13f4e698cc01a.rst", "api/define_slint__generated__public_8h_1aeb2b5fc045f08ccf894bd47b2696b853.rst", "api/define_slint__generated__public_8h_1af7931a7cf2a1073d5f0174b38af28364.rst", "api/define_slint__tests__helpers_8h_1af0a649b4b7b90dc4c9e531d459371b95.rst", "api/dir__home_runner_work_slint_slint_api.rst", "api/dir__home_runner_work_slint_slint_api_cpp.rst", "api/dir__home_runner_work_slint_slint_api_cpp_include.rst", "api/dir_cppdocs.rst", "api/dir_cppdocs_generated_include.rst", "api/enum_namespaceslint_1_1interpreter_1a6221319f778c7369e1b76672690926e0.rst", "api/enum_namespaceslint_1_1interpreter_1ad2ba3b4dd1434535294d334a9daf502d.rst", "api/enum_namespaceslint_1_1testing_1a4de74a3a436a7a3fd9a228930f69274d.rst", "api/enum_namespaceslint_1a435dcad112c13fd7fefb2de66e83d1b1.rst", "api/enum_namespaceslint_1a88e5489a21965b1a271bf90ee12f1c6e.rst", "api/enum_namespaceslint_1a8bec56d112d5490780fa52c77326d290.rst", "api/enum_namespaceslint_1a90c0ddbfdc375daafbcf91361293538b.rst", "api/enum_namespaceslint_1aa9bda1bcc95bc66d8afd7b1a4aa8c4af.rst", "api/enum_namespaceslint_1abb2b0aa4769a501e7cdeaccae964a64c.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_color.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_config.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_image.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_point.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_size.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_string.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h.rst", "api/file__home_runner_work_slint_slint_api_cpp_include_slint_window.h.rst", "api/file_cppdocs_generated_include_slint_brush_internal.h.rst", "api/file_cppdocs_generated_include_slint_builtin_structs.h.rst", "api/file_cppdocs_generated_include_slint_builtin_structs_internal.h.rst", "api/file_cppdocs_generated_include_slint_color_internal.h.rst", "api/file_cppdocs_generated_include_slint_enums.h.rst", "api/file_cppdocs_generated_include_slint_enums_internal.h.rst", "api/file_cppdocs_generated_include_slint_generated_public.h.rst", "api/file_cppdocs_generated_include_slint_image_internal.h.rst", "api/file_cppdocs_generated_include_slint_internal.h.rst", "api/file_cppdocs_generated_include_slint_interpreter_generated_public.h.rst", "api/file_cppdocs_generated_include_slint_interpreter_internal.h.rst", "api/file_cppdocs_generated_include_slint_pathdata_internal.h.rst", "api/file_cppdocs_generated_include_slint_platform_internal.h.rst", "api/file_cppdocs_generated_include_slint_properties_internal.h.rst", "api/file_cppdocs_generated_include_slint_qt_internal.h.rst", "api/file_cppdocs_generated_include_slint_sharedvector_internal.h.rst", "api/file_cppdocs_generated_include_slint_string_internal.h.rst", "api/file_cppdocs_generated_include_slint_testing_internal.h.rst", "api/file_cppdocs_generated_include_slint_timer_internal.h.rst", "api/function_namespaceslint_1_1platform_1a4c4cb5b3db64f28314951c81c7f69658.rst", "api/function_namespaceslint_1_1platform_1a71af3a3240e18b74b5e0c3b646db90c3.rst", "api/function_namespaceslint_1_1platform_1a78d943b2302a68af7e187ea4154d4a64.rst", "api/function_namespaceslint_1_1testing_1afcc3fa8289264ede59668796cf0341b4.rst", "api/function_namespaceslint_1a14298dd1f4c7ab8c553e047e3704d6d0.rst", "api/function_namespaceslint_1a4067c90b05ef4cb20e055117b0263430.rst", "api/function_namespaceslint_1a9ade5df8e39fbec7d2af3c0dd3bd4d9c.rst", "api/function_namespaceslint_1ad900fe1e670815101871442dc17aa74b.rst", "api/function_namespaceslint_1aefd8612f7c509003040eddfaf7a38505.rst", "api/library_root.rst", "api/namespace_slint.rst", "api/namespace_slint__interpreter.rst", "api/namespace_slint__platform.rst", "api/namespace_slint__platform__key_codes.rst", "api/namespace_slint__testing.rst", "api/page_deprecated.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-interpreter.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-platform.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint-testing.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_brush.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_callbacks.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_color.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_config.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_image.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_interpreter.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_pathdata.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_point.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_properties.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_sharedvector.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_size.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_string.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_tests_helpers.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_timer.h.rst", "api/program_listing_file__home_runner_work_slint_slint_api_cpp_include_slint_window.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_brush_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_builtin_structs_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_color_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_enums.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_enums_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_generated_public.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_image_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_generated_public.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_interpreter_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_pathdata_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_platform_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_properties_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_qt_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_sharedvector_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_string_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_testing_internal.h.rst", "api/program_listing_file_cppdocs_generated_include_slint_timer_internal.h.rst", "api/structslint_1_1HsvaColor.rst", "api/structslint_1_1Image.rst", "api/structslint_1_1LogicalPosition.rst", "api/structslint_1_1LogicalSize.rst", "api/structslint_1_1PhysicalPosition.rst", "api/structslint_1_1PhysicalSize.rst", "api/structslint_1_1Point.rst", "api/structslint_1_1Rgb8Pixel.rst", "api/structslint_1_1Rgba8Pixel.rst", "api/structslint_1_1RgbaColor.rst", "api/structslint_1_1SharedPixelBuffer.rst", "api/structslint_1_1SharedString.rst", "api/structslint_1_1SharedVector.rst", "api/structslint_1_1Size.rst", "api/structslint_1_1StandardListViewItem.rst", "api/structslint_1_1Timer.rst", "api/structslint_1_1interpreter_1_1Diagnostic.rst", "api/structslint_1_1interpreter_1_1PropertyDescriptor.rst", "api/structslint_1_1interpreter_1_1Struct.rst", "api/structslint_1_1interpreter_1_1Struct_1_1iterator.rst", "api/structslint_1_1platform_1_1Rgb565Pixel.rst", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion.rst", "api/structslint_1_1platform_1_1SoftwareRenderer_1_1PhysicalRegion_1_1Rect.rst", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties.rst", "api/structslint_1_1platform_1_1WindowAdapter_1_1WindowProperties_1_1LayoutConstraints.rst", "api/unabridged_orphan.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a00330cf08e78888ec33cb4aad7695f2c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a037e34a7a75bd9b8fc07b0f5039302df.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a0456177e3225079f495df1a40eb25de6.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a04fed87f00ef9e12e82613c4855af333.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1375031be6c0b8c45d9df956037df69d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a13c2d54873316cd42061a8b65db36361.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a16fb91042adacd1de93bcf8a108cca8b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a1907927aae2e873492ea4d266d6e9009.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a20afa8a531fee6e8d2503f3670d29b76.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a293f7e38adb43a8f5434e8e900678652.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a427463ae65210afe9d5a966d00a8b4f6.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a472bf83dfe8bd88399ff9e0a6c36d950.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a4c83e50d2ba5a7d2f9399053f84e064f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a569d5973c36441dd8fb3c88a61c48b7d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a597926fdfddd8a0e466a3f82b7ce2fcd.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5a2a920d1055575213a0959dc16a3661.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a5e01d967f144985e037cd53181559909.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a65876fa90448017ac586c13a47ce604b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6b813cb686d89e8e8d3891259b7115d9.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a6e73cc7ade6d8452c8c2047ec00964bb.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a72a98f7ac7b1893a25fb20f78dd42675.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a73b54ab296bc68ad7fd177222471679f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a799426f66be94c7aeab5798ece7ff2bf.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7d33f3bd6fbde5f7556df7c2996ab0ed.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a7f6e9766b89ac25f49671e6a606109ba.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a851d09118169ae64d44c1ce04cc3d39d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8551fc7e5309b803a5324347445c6d0e.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8bd8df35acb6a08504e955d18b85b4fe.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8c063c4c238f189edd899b96c42f509b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a8d46c4e5ef87c72b2c3fd3a0d34c0bef.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a986ca27ff73d68aaa7bacb4d5c509fba.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1a9cd8a0d139cafb40c54c9613d8a23bb3.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa329a177650db85052f4a4ce45abf32d.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa46f7e2b5c3f817227683cf5c2d8b92a.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aa68b696b0425e397cb24edae6528a68c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aae06cbdc02fdffe6a787214d25e0ed19.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab59f14f7e68c980b6db14852df2c5262.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ab78ea33dc3464497974100b841eeec4c.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aba893f8091b3e8be97636d2144047818.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1abf6255bec49fffb7c7228476877932b7.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ac32910f77f4588aa03446574e7e6b48b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1acab5a3836aa794489b91f3cc06a1e4ad.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad2e7bbf67cfcea73f242d193bb541e42.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3a76f93967bed6e0bf1055d2fb5f97b.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ad3ba1170ea89d2feaebadff11cf01871.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1add3be02945fa6ebc94a99e2fc2d7ba20.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1addf9890750954a90f025235fdd82e9b4.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ade29cc46911c0d95f1a0601870117c8a.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1adf1a443c827c42391ffbb0cbbf1da3f8.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1ae75e3231824370890cc26cda0fe07a75.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af56ac133d6d5242fb4f547d5546cb42f.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af674468525494d802b017d421f0432e7.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1af883c4301b011c64a67d98c7369d674e.rst", "api/variable_namespaceslint_1_1platform_1_1key__codes_1aff5729be964f23fc970f5f80217f5bec.rst", "cmake.md", "cmake_reference.md", "generated_code.md", "genindex.rst", "getting_started.md", "index.rst", "mcu/esp-idf/troubleshoot.md", "mcu/esp_idf.md", "mcu/generic.md", "mcu/intro.md", "mcu/stm32.md", "mcu/stm32/generic.md", "overview.md", "types.md"], "titles": ["Class Brush", "Class Color", "Template Class ComponentHandle", "Template Class ComponentWeakHandle", "Template Class FilterModel", "Template Class MapModel", "Template Class Model", "Template Class ReverseModel", "Template Class SortModel", "Template Class VectorModel", "Class Window", "Class ComponentCompiler", "Class ComponentDefinition", "Class ComponentInstance", "Class Value", "Class AbstractRenderer", "Class NativeWindowHandle", "Class Platform", "Class Platform::Task", "Class SkiaRenderer", "Class SoftwareRenderer", "Class WindowAdapter", "Class ElementHandle", "Define SLINT_FEATURE_BACKEND_QT", "Define SLINT_FEATURE_GETTEXT", "Define SLINT_FEATURE_INTERPRETER", "Define SLINT_VERSION_PATCH", "Define SLINT_FEATURE_BACKEND_LINUXKMS", "Define SLINT_FEATURE_EXPERIMENTAL", "Define SLINT_VERSION_STRING", "Define SLINT_FEATURE_RENDERER_FEMTOVG", "Define SLINT_FEATURE_RENDERER_SKIA", "Define SLINT_FEATURE_SYSTEM_TESTING", "Define SLINT_FEATURE_ACCESSIBILITY", "Define SLINT_FEATURE_RENDERER_SOFTWARE", "Define SLINT_VERSION_MINOR", "Define SLINT_FEATURE_FREESTANDING", "Define SLINT_FEATURE_TESTING", "Define SLINT_VERSION_MAJOR", "Define SLINT_FEATURE_BACKEND_WINIT", "Define assert_eq", "Directory api", "Directory cpp", "Directory include", "Directory cppdocs", "Directory generated_include", "Enum ValueType", "Enum DiagnosticLevel", "Enum AccessibleRole", "Enum SetRenderingNotifierError", "Enum PointerEventButton", "Enum EventLoopMode", "Enum GraphicsAPI", "Enum RenderingState", "Enum CloseRequestResponse", "File slint-interpreter.h", "File slint-platform.h", "File slint-testing.h", "File slint.h", "File slint_brush.h", "File slint_callbacks.h", "File slint_color.h", "File slint_config.h", "File slint_image.h", "File slint_interpreter.h", "File slint_pathdata.h", "File slint_point.h", "File slint_properties.h", "File slint_sharedvector.h", "File slint_size.h", "File slint_string.h", "File slint_tests_helpers.h", "File slint_timer.h", "File slint_window.h", "File slint_brush_internal.h", "File slint_builtin_structs.h", "File slint_builtin_structs_internal.h", "File slint_color_internal.h", "File slint_enums.h", "File slint_enums_internal.h", "File slint_generated_public.h", "File slint_image_internal.h", "File slint_internal.h", "File slint_interpreter_generated_public.h", "File slint_interpreter_internal.h", "File slint_pathdata_internal.h", "File slint_platform_internal.h", "File slint_properties_internal.h", "File slint_qt_internal.h", "File slint_sharedvector_internal.h", "File slint_string_internal.h", "File slint_testing_internal.h", "File slint_timer_internal.h", "Function slint::platform::duration_until_next_timer_update", "Function slint::platform::update_timers_and_animations", "Function slint::platform::set_platform", "Function slint::testing::init", "Function slint::quit_event_loop", "Template Function slint::invoke_from_event_loop", "Template Function slint::blocking_invoke_from_event_loop", "Function slint::run_event_loop", "Function slint::update_all_translations", "C++ API Reference", "Namespace slint", "Namespace slint::interpreter", "Namespace slint::platform", "Namespace slint::platform::key_codes", "Namespace slint::testing", "Deprecated List", "Program Listing for File slint-interpreter.h", "Program Listing for File slint-platform.h", "Program Listing for File slint-testing.h", "Program Listing for File slint.h", "Program Listing for File slint_brush.h", "Program Listing for File slint_callbacks.h", "Program Listing for File slint_color.h", "Program Listing for File slint_config.h", "Program Listing for File slint_image.h", "Program Listing for File slint_interpreter.h", "Program Listing for File slint_pathdata.h", "Program Listing for File slint_point.h", "Program Listing for File slint_properties.h", "Program Listing for File slint_sharedvector.h", "Program Listing for File slint_size.h", "Program Listing for File slint_string.h", "Program Listing for File slint_tests_helpers.h", "Program Listing for File slint_timer.h", "Program Listing for File slint_window.h", "Program Listing for File slint_brush_internal.h", "Program Listing for File slint_builtin_structs.h", "Program Listing for File slint_builtin_structs_internal.h", "Program Listing for File slint_color_internal.h", "Program Listing for File slint_enums.h", "Program Listing for File slint_enums_internal.h", "Program Listing for File slint_generated_public.h", "Program Listing for File slint_image_internal.h", "Program Listing for File slint_internal.h", "Program Listing for File slint_interpreter_generated_public.h", "Program Listing for File slint_interpreter_internal.h", "Program Listing for File slint_pathdata_internal.h", "Program Listing for File slint_platform_internal.h", "Program Listing for File slint_properties_internal.h", "Program Listing for File slint_qt_internal.h", "Program Listing for File slint_sharedvector_internal.h", "Program Listing for File slint_string_internal.h", "Program Listing for File slint_testing_internal.h", "Program Listing for File slint_timer_internal.h", "Struct HsvaColor", "Struct Image", "Struct LogicalPosition", "Struct LogicalSize", "Struct PhysicalPosition", "Struct PhysicalSize", "Template Struct Point", "Struct Rgb8Pixel", "Struct Rgba8Pixel", "Template Struct RgbaColor", "Template Struct SharedPixelBuffer", "Struct SharedString", "Template Struct SharedVector", "Template Struct Size", "Struct StandardListViewItem", "Struct Timer", "Struct Diagnostic", "Struct PropertyDescriptor", "Struct Struct", "Struct Struct::iterator", "Struct Rgb565Pixel", "Struct SoftwareRenderer::PhysicalRegion", "Struct PhysicalRegion::Rect", "Struct WindowAdapter::WindowProperties", "Struct WindowProperties::LayoutConstraints", "Full API", "Variable slint::platform::key_codes::F24", "Variable slint::platform::key_codes::F1", "Variable slint::platform::key_codes::CapsLock", "Variable slint::platform::key_codes::Space", "Variable slint::platform::key_codes::Menu", "Variable slint::platform::key_codes::LeftArrow", "Variable slint::platform::key_codes::MetaR", "Variable slint::platform::key_codes::Pause", "Variable slint::platform::key_codes::F4", "Variable slint::platform::key_codes::F12", "Variable slint::platform::key_codes::Insert", "Variable slint::platform::key_codes::DownArrow", "Variable slint::platform::key_codes::AltGr", "Variable slint::platform::key_codes::Alt", "Variable slint::platform::key_codes::F23", "Variable slint::platform::key_codes::Stop", "Variable slint::platform::key_codes::F19", "Variable slint::platform::key_codes::ScrollLock", "Variable slint::platform::key_codes::F13", "Variable slint::platform::key_codes::F15", "Variable slint::platform::key_codes::F14", "Variable slint::platform::key_codes::Backspace", "Variable slint::platform::key_codes::F5", "Variable slint::platform::key_codes::F6", "Variable slint::platform::key_codes::Meta", "Variable slint::platform::key_codes::F9", "Variable slint::platform::key_codes::F20", "Variable slint::platform::key_codes::UpArrow", "Variable slint::platform::key_codes::F10", "Variable slint::platform::key_codes::F2", "Variable slint::platform::key_codes::F8", "Variable slint::platform::key_codes::F18", "Variable slint::platform::key_codes::PageDown", "Variable slint::platform::key_codes::F11", "Variable slint::platform::key_codes::F3", "Variable slint::platform::key_codes::Control", "Variable slint::platform::key_codes::F16", "Variable slint::platform::key_codes::ControlR", "Variable slint::platform::key_codes::Return", "Variable slint::platform::key_codes::F7", "Variable slint::platform::key_codes::Backtab", "Variable slint::platform::key_codes::Home", "Variable slint::platform::key_codes::RightArrow", "Variable slint::platform::key_codes::Escape", "Variable slint::platform::key_codes::SysReq", "Variable slint::platform::key_codes::F21", "Variable slint::platform::key_codes::F17", "Variable slint::platform::key_codes::PageUp", "Variable slint::platform::key_codes::Tab", "Variable slint::platform::key_codes::End", "Variable slint::platform::key_codes::ShiftR", "Variable slint::platform::key_codes::Delete", "Variable slint::platform::key_codes::Shift", "Variable slint::platform::key_codes::F22", "Set Up Development Environment", "CMake Reference", "Generated Code", "Index (C++)", "Getting Started", "Slint C++ documentation", "Troubleshooting", "Espressif\u2019s IoT Development Framework", "Generic MCU Environment Setup", "Introduction", "STMicroelectronics\u2019 STM32Cube Ecosystem", "Generic Instructions for Slint on STM32 MCUs", "Overview", "Type Mappings"], "terms": {"defin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 109, 110, 112, 115, 116, 117, 122, 125, 127, 134, 135, 136, 138, 139, 142, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 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, 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, 229, 233, 234, 240], "file": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 104, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 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, 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, 231, 232, 233, 234, 235, 238, 239, 240], "slint_brush": [0, 43, 61, 70, 74, 82, 102, 136, 172], "h": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 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, 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, 231, 234, 238], "i": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 46, 48, 49, 50, 51, 52, 53, 54, 97, 98, 99, 100, 101, 103, 104, 105, 107, 109, 110, 112, 113, 118, 120, 122, 123, 129, 130, 132, 133, 142, 144, 148, 153, 156, 157, 158, 159, 160, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 227, 228, 229, 231, 232, 233, 235, 236, 237, 239, 240], "us": [0, 1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 17, 20, 21, 22, 26, 29, 35, 38, 46, 48, 50, 51, 52, 53, 98, 101, 102, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 117, 119, 120, 121, 123, 125, 126, 127, 128, 130, 133, 135, 136, 138, 140, 141, 142, 148, 153, 157, 158, 159, 160, 162, 164, 165, 166, 168, 170, 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, 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, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240], "declar": [0, 13, 14, 109, 142, 164, 229, 231, 239, 240], "how": [0, 20, 103, 157, 227, 231, 232, 233, 234, 236, 238, 239], "fill": [0, 20, 133, 136], "outlin": [0, 238], "shape": [0, 148], "rectangl": [0, 20, 110, 136, 168, 169], "path": [0, 11, 41, 42, 43, 44, 45, 109, 117, 127, 135, 136, 138, 140, 148, 163, 227, 228, 235, 238], "text": [0, 10, 17, 22, 48, 110, 127, 129, 130, 132, 133, 136, 142, 161, 231, 232, 233, 234, 238], "A": [0, 3, 6, 9, 13, 14, 17, 18, 20, 22, 40, 46, 50, 105, 112, 114, 125, 127, 148, 149, 150, 151, 152, 158, 162, 165, 166, 167, 168, 169, 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, 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, 231, 235, 237, 240], "either": [0, 13, 14, 21, 22, 163, 165, 166, 227, 233, 237, 239], "solid": 0, "color": [0, 46, 61, 102, 103, 113, 115, 121, 128, 131, 135, 136, 141, 142, 147, 156, 167, 231, 232, 239, 240], "linear": [0, 136], "gradient": [0, 113], "public": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 46, 109, 110, 111, 112, 113, 115, 117, 119, 120, 123, 127, 128, 135, 139, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 229, 233, 240], "function": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 51, 104, 106, 109, 112, 125, 127, 138, 148, 149, 150, 151, 152, 153, 156, 157, 158, 159, 160, 162, 165, 166, 167, 168, 169, 170, 172, 228, 229, 231, 238, 239], "inlin": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 93, 94, 95, 96, 97, 100, 101, 109, 110, 111, 112, 113, 115, 117, 121, 124, 125, 127, 136, 142, 148, 149, 150, 151, 152, 156, 157, 158, 159, 162, 165, 166, 167, 168, 170, 229], "construct": [0, 1, 3, 4, 5, 7, 8, 9, 11, 12, 14, 19, 20, 21, 22, 109, 148, 149, 151, 156, 157, 158, 159, 162, 165, 166, 167], "new": [0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 16, 17, 19, 20, 21, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 109, 111, 112, 114, 121, 122, 126, 127, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 156, 157, 158, 159, 165, 166, 229, 231, 234, 238, 239], "transpar": [0, 1], "const": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 108, 109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 134, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 148, 149, 150, 151, 152, 153, 156, 157, 158, 159, 160, 162, 165, 166, 167, 168, 170, 229, 234, 240], "return": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21, 22, 54, 78, 93, 97, 99, 102, 106, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 153, 157, 158, 159, 160, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 229, 231, 238], "If": [0, 4, 6, 7, 8, 9, 10, 17, 21, 22, 102, 148, 156, 158, 162, 165, 166, 170, 171, 227, 228, 229, 233, 234, 235, 237], "thi": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 46, 48, 49, 50, 52, 53, 54, 94, 97, 98, 99, 100, 101, 103, 104, 105, 106, 107, 109, 110, 112, 113, 115, 121, 122, 124, 125, 127, 128, 129, 130, 132, 133, 135, 139, 142, 148, 156, 157, 158, 159, 162, 165, 166, 168, 169, 170, 171, 227, 228, 229, 231, 232, 233, 234, 235, 236, 238, 239, 240], "first": [0, 7, 13, 20, 113, 122, 157, 158, 159, 227, 231, 233, 239], "stop": [0, 22, 78, 102, 106, 113, 126, 132, 162], "brighter": [0, 1, 113, 115], "float": [0, 1, 10, 22, 46, 109, 111, 112, 113, 115, 120, 121, 123, 125, 127, 128, 130, 131, 135, 136, 139, 140, 141, 142, 147, 149, 150, 156, 240], "factor": [0, 1, 10, 21, 113, 115, 127, 131, 240], "version": [0, 1, 26, 29, 35, 38, 98, 99, 227, 231, 235, 238], "ha": [0, 1, 4, 5, 6, 8, 10, 13, 14, 21, 53, 109, 148, 158, 159, 162, 167, 231, 234, 239], "bright": [0, 1, 234], "increas": [0, 1, 22, 110], "specifi": [0, 1, 5, 8, 9, 10, 11, 12, 13, 17, 19, 21, 98, 99, 158, 162, 165, 227, 228], "done": [0, 1, 52, 227, 235], "call": [0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 17, 18, 19, 20, 21, 22, 51, 94, 95, 96, 97, 98, 99, 105, 109, 110, 112, 114, 127, 148, 162, 165, 166, 228, 229, 231, 233, 238], "all": [0, 5, 7, 8, 9, 12, 14, 20, 22, 51, 100, 101, 102, 103, 112, 157, 159, 165, 168, 227, 228, 229, 233, 234, 235, 238, 239, 240], "darker": [0, 1, 113, 115], "decreas": [0, 1, 22, 228], "transparent": [0, 1, 113, 115], "opac": [0, 1, 136], "with_alpha": [0, 1, 113, 115], "alpha": [0, 1, 113, 115, 131, 147, 148, 155, 156, 240], "relat": 0, "": [0, 1, 4, 5, 8, 9, 10, 13, 19, 20, 22, 48, 105, 107, 109, 113, 115, 123, 124, 127, 131, 148, 150, 152, 158, 159, 164, 165, 166, 227, 228, 229, 231, 232, 233, 235, 236, 238, 239], "set": [0, 1, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 20, 21, 22, 49, 98, 100, 105, 112, 121, 148, 165, 170, 171, 228, 229, 231, 233, 234, 235, 238, 239], "friend": [0, 1, 4, 5, 7, 8, 14, 109, 110, 112, 113, 115, 117, 119, 121, 122, 124, 127, 129, 130, 134, 136, 148, 158, 159, 165, 166, 167], "struct": [0, 1, 4, 5, 7, 8, 14, 20, 21, 46, 55, 56, 61, 63, 66, 68, 69, 70, 72, 75, 80, 83, 103, 104, 105, 106, 109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 126, 128, 129, 130, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 240], "private_api": [0, 1, 2, 4, 5, 7, 8, 109, 110, 111, 112, 113, 114, 115, 117, 119, 121, 124, 125, 127, 136, 142], "properti": [0, 10, 12, 13, 14, 21, 22, 48, 98, 99, 109, 112, 113, 115, 121, 136, 138, 142, 148, 164, 170, 227, 228, 229, 231, 232, 237, 238, 239, 240], "bool": [0, 1, 4, 8, 10, 13, 14, 21, 22, 46, 109, 110, 111, 112, 113, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 145, 146, 148, 153, 157, 158, 159, 160, 162, 165, 166, 167, 170, 229, 240], "oper": [0, 1, 2, 6, 10, 12, 14, 16, 17, 18, 19, 20, 109, 110, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 126, 127, 128, 129, 130, 131, 134, 135, 136, 139, 141, 142, 144, 148, 153, 157, 158, 159, 160, 162, 165, 166, 167, 227], "b": [0, 14, 40, 109, 110, 112, 113, 117, 119, 122, 124, 125, 134, 136, 138, 148, 154, 155, 158, 159, 165, 166, 167], "true": [0, 1, 4, 10, 13, 14, 21, 22, 101, 109, 110, 111, 112, 121, 125, 127, 128, 135, 139, 148, 153, 158, 159, 160, 162, 165, 166, 167, 170, 234], "equal": [0, 14, 112, 122, 153, 157, 158, 159, 160, 165, 228], "hold": [0, 13, 14, 21, 159, 165, 166, 239], "must": [0, 10, 13, 17, 20, 21, 22, 95, 99, 107, 127, 148, 157, 229, 235], "also": [0, 4, 5, 6, 7, 8, 9, 10, 14, 46, 98, 99, 158, 159, 228, 229, 231, 232], "ident": [0, 167], "fals": [0, 1, 10, 13, 21, 22, 109, 110, 111, 112, 122, 127, 128, 135, 139, 148, 153, 158, 159, 160, 162, 165, 166, 170, 233], "differ": [0, 10, 13, 14, 17, 20, 46, 48, 49, 50, 53, 99, 105, 148, 227, 232, 233, 235, 237, 239], "what": [0, 17, 111, 136, 235], "thei": [0, 153, 156, 157, 160], "respect": [0, 235], "ar": [0, 10, 11, 13, 14, 16, 20, 21, 49, 51, 93, 95, 100, 101, 102, 103, 106, 109, 112, 120, 123, 148, 153, 156, 157, 159, 160, 163, 165, 167, 227, 228, 229, 231, 233, 234, 236, 239, 240], "otherwis": [0, 1, 3, 13, 14, 21, 22, 99, 110, 148, 153, 158, 159, 160, 162, 165, 166, 170], "listview": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 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, 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, 229, 230, 232, 239], "slint_color": [1, 43, 59, 67, 77, 82, 102, 113, 136, 147, 156, 172], "repres": [1, 10, 13, 14, 20, 21, 46, 48, 153, 154, 155, 160, 161, 165, 168, 170, 171, 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, 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, 240], "slint": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 46, 47, 48, 49, 50, 51, 52, 53, 54, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 108, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 149, 150, 151, 152, 157, 158, 159, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 228, 229, 231, 234, 236, 237, 240], "run": [1, 13, 17, 18, 21, 51, 98, 99, 102, 109, 110, 126, 158, 159, 162, 227, 228, 229, 231, 233, 234, 235, 237, 238, 240], "time": [1, 21, 102, 158, 159, 162, 227, 228, 231, 233, 238, 240], "8": [1, 115, 138, 142, 158, 167, 240], "bit": [1, 167, 240], "channel": [1, 148, 233], "red": [1, 110, 115, 131, 148, 154, 155, 156, 167], "green": [1, 110, 115, 131, 148, 154, 155, 156, 167], "blue": [1, 110, 115, 131, 148, 154, 155, 156, 167, 231, 232], "default": [1, 3, 4, 6, 7, 8, 9, 10, 17, 21, 22, 46, 54, 100, 109, 110, 111, 112, 113, 115, 116, 117, 119, 120, 123, 126, 127, 129, 130, 133, 134, 135, 136, 139, 144, 148, 149, 151, 153, 157, 158, 159, 160, 162, 165, 166, 167, 170, 171, 227, 228, 233, 234, 235, 240], "entir": [1, 240], "rgbacolor": [1, 61, 102, 103, 115], "uint8_t": [1, 47, 49, 52, 53, 54, 109, 110, 111, 112, 115, 117, 122, 124, 127, 130, 131, 134, 135, 136, 137, 138, 140, 142, 143, 145, 146, 154, 155, 156, 167], "col": [1, 115, 131, 156], "from": [1, 3, 9, 11, 12, 13, 14, 16, 17, 18, 21, 97, 98, 99, 100, 105, 110, 112, 120, 122, 123, 127, 129, 130, 132, 133, 136, 141, 148, 156, 157, 158, 164, 165, 166, 167, 228, 229, 231, 232, 234, 237, 238, 239], "given": [1, 4, 5, 7, 8, 9, 13, 16, 17, 19, 22, 110, 150, 152, 156, 157, 158, 159, 162, 165, 228], "uint32_t": [1, 16, 20, 110, 112, 115, 117, 123, 127, 135, 136, 140, 142, 148, 152, 157], "as_argb_encod": [1, 115], "encod": [1, 20, 158, 167, 240], "to_argb_uint": [1, 115], "convert": [1, 5, 10, 22, 106, 149, 150, 151, 152, 158, 165, 167, 228, 233, 240], "an": [1, 3, 4, 5, 7, 8, 10, 12, 13, 14, 16, 17, 18, 20, 22, 46, 47, 48, 95, 98, 105, 112, 136, 148, 154, 155, 157, 158, 161, 163, 165, 167, 168, 169, 227, 228, 229, 231, 232, 233, 234, 235, 236, 238, 239, 240], "easi": [1, 239], "destructur": [1, 165, 166], "to_argb_float": [1, 115], "hsvacolor": [1, 61, 102, 103, 115], "to_hsva": [1, 115], "hsv": [1, 115, 147], "space": [1, 78, 102, 106, 112, 132, 136, 147], "u8": [1, 132, 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, 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], "rang": [1, 56, 110, 156, 157, 159, 165], "0": [1, 6, 13, 14, 17, 21, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 150, 152, 154, 155, 156, 162, 167, 227, 228, 229, 231, 238], "255": [1, 115, 142, 154, 155, 156, 167], "multipli": [1, 148, 240], "valu": [1, 4, 5, 7, 8, 9, 10, 13, 17, 20, 21, 22, 26, 35, 38, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 99, 102, 104, 109, 111, 112, 113, 115, 121, 122, 127, 136, 138, 140, 141, 142, 147, 148, 154, 155, 156, 159, 165, 166, 167, 170, 171, 228, 229, 233, 234, 239, 240], "1": [1, 13, 26, 29, 35, 38, 109, 110, 112, 113, 115, 122, 134, 135, 136, 137, 138, 142, 147, 148, 156, 163, 227, 228, 231, 235], "The": [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 20, 21, 22, 46, 47, 48, 49, 50, 51, 52, 53, 54, 98, 99, 100, 101, 102, 103, 104, 105, 106, 113, 120, 123, 147, 148, 153, 156, 157, 158, 159, 160, 161, 163, 164, 165, 166, 167, 168, 169, 227, 228, 229, 231, 234, 238, 239, 240], "result": [1, 22, 99, 109, 111, 112, 113, 114, 115, 117, 121, 128, 135, 136, 139, 158, 167, 228], "back": [1, 9, 50, 53, 97, 132, 227, 229, 234], "rgb": [1, 20, 135, 148, 154], "unchang": 1, "so": [1, 7, 10, 20, 112, 136, 165, 166, 167, 168, 227, 228, 231], "exampl": [1, 5, 10, 13, 26, 29, 35, 38, 50, 53, 98, 99, 101, 105, 106, 109, 112, 148, 156, 157, 158, 227, 228, 234, 235, 237, 238, 239, 240], "2": [1, 13, 26, 29, 35, 38, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 136, 142, 148, 227, 228, 231, 232], "20": [1, 142, 227, 235, 236], "5": [1, 26, 29, 35, 38, 110, 135, 138, 142, 158, 167], "50": [1, 142], "divid": [1, 236], "3": [1, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 136, 142, 148, 227, 231, 235, 237], "30": [1, 142], "obtain": [1, 148], "mix": [1, 115], "other": [1, 3, 10, 12, 14, 16, 17, 18, 46, 50, 53, 96, 98, 105, 109, 110, 112, 115, 117, 120, 122, 123, 124, 125, 127, 128, 131, 132, 135, 136, 137, 138, 139, 141, 153, 157, 158, 159, 160, 165, 166, 227, 236], "clamp": 1, "between": [1, 10, 20, 21, 147, 148, 154, 155, 156, 167, 233, 234, 235, 237], "appli": [1, 4, 5, 8, 20, 48, 114, 133, 239], "while": [1, 10, 11, 99, 227], "static": [1, 16, 22, 109, 110, 111, 112, 113, 115, 117, 119, 121, 122, 124, 126, 127, 128, 135, 136, 139, 142, 148, 158, 162, 234, 235], "from_argb_encod": [1, 113, 115], "argb_encod": [1, 115], "integ": [1, 158, 240], "0xaarrggbb": 1, "from_argb_uint8": [1, 115], "paramet": [1, 5, 10, 13, 20, 51, 53, 100, 156, 229, 231, 239], "from_rgb_uint8": [1, 115], "have": [1, 10, 19, 20, 21, 22, 110, 112, 136, 148, 157, 165, 170, 171, 227, 229, 232, 233, 234, 235, 239], "from_argb_float": [1, 115], "from_rgb_float": [1, 115], "from_hsva": [1, 115], "v": [1, 14, 17, 21, 109, 112, 115, 121, 125, 131, 234, 237, 238], "compon": [1, 2, 3, 10, 11, 12, 13, 22, 109, 111, 115, 125, 127, 136, 147, 156, 167, 228, 229, 231, 232, 234, 238, 239], "hue": [1, 115, 147], "expect": [1, 233], "360": [1, 147], "lineargradientbrush": [1, 113, 115, 128], "lh": [1, 110, 115, 167], "rh": [1, 110, 115, 167], "same": [1, 14, 20, 110, 148, 159, 165, 166, 229, 240], "individu": 1, "std": [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 20, 21, 22, 93, 95, 98, 99, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 125, 126, 127, 130, 132, 142, 148, 158, 159, 162, 165, 166, 170, 171, 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, 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, 229, 234, 238, 239, 240], "ostream": [1, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 115, 124, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 158], "stream": [1, 115, 124, 158], "write": [1, 158, 231, 235], "refer": [1, 3, 10, 13, 21, 110, 148, 157, 158, 159, 165, 166, 227, 229, 234, 235, 237, 238, 240], "typenam": [2, 3, 4, 5, 6, 7, 8, 9, 20, 22, 109, 110, 111, 112, 114, 115, 117, 120, 121, 122, 123, 125, 127, 135, 136, 138, 143, 144, 153, 156, 157, 159, 160, 165, 229], "t": [2, 3, 13, 17, 22, 48, 109, 111, 112, 115, 120, 121, 122, 123, 125, 136, 138, 143, 144, 153, 156, 159, 160, 229, 233, 235, 239], "handl": [2, 3, 12, 16, 17, 20, 21, 22, 112, 121, 127, 136, 140, 141, 231, 235, 239], "like": [2, 13, 20, 48, 99, 168, 227, 229, 231, 234, 235], "share": [2, 10, 12, 148, 157, 158, 159, 235], "pointer": [2, 10, 16, 50, 110, 133, 148, 157, 158, 159, 229, 239], "gener": [2, 122, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 228, 231, 236, 237, 239, 240], "code": [2, 10, 11, 14, 98, 104, 109, 112, 148, 164, 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, 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, 228, 231, 232, 237, 238, 239, 240], "In": [2, 13, 15, 21, 112, 227, 232, 238], "order": [2, 8, 13, 100, 112, 136, 162, 165, 166, 233, 240], "get": [2, 109, 112, 121, 167, 227, 235, 237, 238, 239], "creat": [2, 10, 12, 13, 14, 16, 17, 19, 53, 95, 98, 99, 104, 109, 112, 115, 127, 148, 156, 158, 159, 165, 166, 228, 229, 231, 232, 233, 234, 238, 239], "where": [2, 15, 163, 235, 239], "name": [2, 12, 13, 22, 109, 138, 164, 165, 166, 227, 228, 229, 231, 238, 240], "give": 2, "you": [2, 10, 12, 13, 14, 19, 21, 26, 29, 35, 38, 98, 102, 104, 105, 107, 148, 157, 165, 166, 227, 228, 229, 231, 232, 233, 234, 235, 238, 239], "vtabl": [2, 13, 82, 109, 111, 112, 127, 135, 136, 138, 141, 142], "vrc": [2, 109, 111, 112, 127, 135, 136, 138], "itemtreevt": [2, 109, 112, 127, 136, 138], "inner": [2, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 127, 138], "intern": [2, 14, 15, 16, 20, 46, 98, 109, 125, 142, 157], "constructor": [2, 14, 16, 17, 18, 19, 109, 136, 148, 157, 158, 165, 167, 229], "arrow": 2, "implement": [2, 4, 6, 7, 8, 9, 10, 14, 15, 17, 20, 21, 105, 112, 156, 165, 166, 227, 229], "semant": 2, "derefer": [2, 158, 165, 166], "into_dyn": [2, 111, 112, 127], "weak": [3, 127], "can": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 20, 21, 22, 95, 96, 98, 102, 104, 105, 106, 112, 136, 148, 157, 159, 162, 165, 166, 168, 170, 171, 227, 228, 229, 231, 232, 235, 239, 240], "componenthandl": [3, 12, 22, 58, 102, 103, 109, 111, 112, 229, 239], "null": [3, 13, 158, 162, 234], "lock": [3, 98, 112, 127], "alwai": [3, 20, 158, 240], "empti": [3, 9, 12, 13, 14, 112, 122, 124, 127, 136, 157, 158, 159, 165], "copi": [3, 12, 14, 17, 109, 133, 148, 157, 158, 159, 165, 166, 231, 238], "option": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 21, 22, 55, 57, 58, 93, 107, 109, 110, 111, 112, 117, 127, 136, 148, 165, 170, 171, 227, 228, 235, 238, 239], "strong": [3, 10, 13], "point": [3, 11, 66, 102, 103, 104, 105, 110, 119, 120, 127, 136, 139, 149, 151, 158, 159, 165, 166, 231, 239, 240], "still": [3, 13, 20, 22, 107, 112, 229], "referenc": [3, 10, 14, 19, 158, 165, 166], "ani": [3, 10, 11, 13, 16, 17, 18, 21, 22, 96, 98, 148, 227, 228, 232, 236, 240], "model": [4, 5, 7, 8, 9, 14, 46, 58, 102, 103, 109, 112, 137, 138, 229, 239], "modeldata": [4, 6, 7, 8, 9, 112], "act": [4, 5, 7, 8, 12, 17], "adapt": [4, 5, 7, 8, 21, 53, 227], "sourc": [4, 5, 7, 8, 112, 136, 148, 163, 228, 231, 234, 237, 238, 239], "filter": [4, 5, 8], "each": [4, 5, 8, 20, 22, 94, 106, 229, 236, 240], "row": [4, 5, 6, 7, 8, 9, 109, 112, 138], "accept": [4, 14, 22, 133, 136, 229, 233], "e": [4, 22, 122, 227, 231], "visibl": [4, 10, 17, 21, 22, 110, 112, 116, 228], "shared_ptr": [4, 5, 7, 8, 14, 109, 112, 121, 229, 239], "source_model": [4, 5, 7, 8, 112], "filter_fn": [4, 112], "provid": [4, 5, 6, 7, 8, 10, 16, 17, 19, 20, 21, 22, 48, 53, 54, 98, 158, 165, 166, 170, 228, 229, 231, 232, 234, 235, 236, 237, 239], "limit": [4, 112, 229], "view": [4, 5, 6, 7, 8, 20, 21, 110, 112, 124, 158, 165, 166, 168, 169], "expos": [4, 5, 165, 166, 227, 229, 231], "virtual": [4, 5, 6, 7, 8, 9, 17, 19, 20, 21, 110, 112, 142], "size_t": [4, 5, 6, 7, 8, 9, 20, 109, 110, 112, 113, 119, 122, 124, 127, 158, 159], "row_count": [4, 5, 6, 7, 8, 9, 109, 112, 138], "overrid": [4, 5, 7, 8, 9, 21, 109, 110, 112], "amount": [4, 5, 6, 7, 8, 9, 17, 20, 234], "row_data": [4, 5, 6, 7, 8, 9, 109, 112, 138], "data": [4, 5, 6, 7, 8, 9, 16, 109, 110, 111, 112, 113, 117, 119, 121, 124, 126, 127, 135, 136, 140, 142, 148, 157, 158, 159, 229, 232, 239, 240], "particular": [4, 5, 6, 7, 8, 9, 227, 235], "should": [4, 5, 6, 7, 8, 9, 10, 13, 14, 17, 18, 21, 94, 96, 112, 121, 127, 170, 171, 227, 228, 234, 235], "void": [4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18, 19, 20, 21, 22, 46, 94, 95, 96, 97, 98, 100, 101, 109, 110, 111, 112, 113, 114, 115, 117, 121, 122, 124, 125, 126, 127, 131, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 159, 162, 165, 229, 234, 238], "set_row_data": [4, 6, 7, 8, 9, 109, 112, 138], "onli": [4, 5, 6, 7, 8, 9, 13, 14, 17, 18, 20, 21, 95, 98, 101, 104, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 148, 158, 159, 227, 228, 229, 233], "cannot": [4, 6, 7, 8, 9, 122, 148, 159, 162], "support": [4, 6, 7, 8, 9, 17, 49, 105, 112, 122, 227, 234, 235, 236, 238], "chang": [4, 5, 6, 7, 8, 9, 10, 20, 21, 101, 107, 142, 159, 165, 166, 231, 234, 239], "ok": [4, 6, 7, 8, 9, 112, 133], "do": [4, 6, 7, 8, 9, 13, 17, 20, 21, 104, 110, 112, 125, 148, 168, 227, 229], "noth": [4, 6, 7, 8, 9, 17, 21, 162], "print": [4, 6, 7, 8, 9], "warn": [4, 6, 7, 8, 9, 11, 47, 109, 118, 125, 137, 163], "stderr": [4, 6, 7, 8, 9], "updat": [4, 6, 7, 8, 9, 21, 112, 165], "row_chang": [4, 6, 7, 8, 9, 109, 112], "reset": [4, 5, 6, 8, 109, 112, 133], "re": [4, 5, 8, 10, 13, 15, 17, 20, 21, 26, 29, 35, 38, 101, 105, 162, 165, 166, 227, 229, 233, 234, 235], "state": [4, 5, 8, 10, 21, 53, 112, 127, 232], "extern": [4, 5, 8, 131, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146, 157, 227, 234, 238], "int": [4, 8, 13, 14, 16, 46, 98, 99, 109, 110, 112, 113, 121, 125, 136, 140, 141, 142, 144, 148, 229, 231, 240], "unfiltered_row": [4, 112], "filtered_row": [4, 112], "index": [4, 6, 8, 9, 109, 111, 112, 122, 135, 136, 142, 159], "correspond": [4, 8, 17, 21, 46, 231], "filtermodelinn": [4, 112], "sourcemodeldata": [5, 6, 112], "mappedmodeldata": [5, 6, 112], "map": [5, 228, 229, 234, 235, 237, 239], "allow": [5, 10, 54, 104, 229, 233, 239], "transform": [5, 13, 110, 229], "fly": [5, 11], "two": [5, 20, 21, 153, 157, 160, 231], "underli": [5, 9, 14, 22, 148, 158, 159], "permit": 5, "itself": [5, 13, 158], "For": [5, 13, 26, 29, 35, 38, 46, 50, 148, 156, 158, 227, 229, 231, 232, 234, 235, 237, 240], "number": [5, 14, 16, 20, 46, 109, 125, 133, 137, 158, 159, 163, 239], "string": [5, 11, 12, 13, 14, 29, 46, 98, 101, 136, 137, 140, 158, 229, 239, 240], "to_str": [5, 13, 14, 109], "lambda": 5, "express": [5, 46], "map_fn": [5, 112], "alter": 5, "mapmodelinn": [5, 112], "filtermodel": [6, 58, 102, 103, 112], "mapmodel": [6, 58, 102, 103, 112], "reversemodel": [6, 58, 102, 103, 112], "sortmodel": [6, 58, 102, 103, 112], "vectormodel": [6, 58, 102, 103, 112, 229], "repetit": [6, 229, 239], "element": [6, 8, 10, 14, 21, 22, 48, 111, 119, 136, 139, 145, 148, 159, 170, 229, 231, 232, 239], "languag": [6, 101, 112, 227, 229, 231, 234, 235, 237, 238, 239], "subclass": [6, 15, 21, 105, 239], "delet": [6, 10, 16, 17, 18, 19, 20, 78, 102, 106, 109, 110, 112, 114, 121, 126, 127, 132, 142, 148, 162, 165, 166], "protect": [6, 112], "notifi": [6, 49, 98, 109, 138], "specif": [6, 10, 21, 52, 232, 234, 240], "wa": [6, 10, 13, 14, 20, 21, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 53, 110, 112, 127, 148, 162, 231, 233], "row_ad": [6, 109, 112], "count": [6, 10, 109, 110, 112, 119, 126, 136, 138, 139, 157, 240], "were": [6, 11, 20, 21], "ad": [6, 238], "row_remov": [6, 109, 112], "remov": [6, 9, 159, 234], "been": [6, 21, 22, 53, 162, 165, 234], "everyth": [6, 16], "need": [6, 17, 18, 20, 21, 53, 102, 104, 115, 122, 227, 229, 231, 233, 234, 235, 238, 239], "reload": 6, "reserv": [7, 112], "mean": [7, 100, 109], "last": [7, 10, 11, 20, 21, 51, 100, 122, 158, 159], "second": [7, 20, 239], "revers": [7, 133], "reversemodelinn": [7, 112], "sort": [8, 112], "pair": [8, 109, 130, 165, 166], "comp": [8, 112], "unsorted_row": [8, 112], "sorted_row_index": [8, 112], "sortmodelinn": [8, 112], "sharedvector": [9, 11, 12, 14, 22, 68, 102, 103, 109, 110, 111, 112, 113, 117, 119, 122, 128, 135, 136, 138, 139, 140, 143, 145], "vector": [9, 11, 12, 14, 58, 112, 159, 163, 164, 229, 234], "arrai": [9, 14, 46, 109, 112, 157, 229], "push_back": [9, 112, 113, 122, 159], "append": [9, 158, 159], "eras": [9, 112], "insert": [9, 78, 102, 106, 112, 132, 227], "clear": [9, 11, 112, 122, 159], "set_vector": [9, 112], "replac": [9, 229, 238], "slint_window": [10, 43, 58, 82, 102, 112, 172], "toward": [10, 229], "system": [10, 13, 16, 17, 21, 100, 105, 148, 227, 228, 229, 232, 234, 235, 236, 237, 239], "render": [10, 15, 17, 19, 20, 21, 49, 52, 53, 94, 100, 105, 110, 136, 148, 157, 168, 227, 228, 229, 234, 235, 237, 238], "scene": [10, 19, 20, 53, 105], "It": [10, 12, 14, 17, 20, 21, 48, 51, 54, 148, 157, 158, 159, 164, 165, 166, 168, 170, 171, 227, 231, 232, 234, 237, 239], "api": [10, 13, 21, 42, 43, 52, 98, 103, 105, 107, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 129, 130, 132, 133, 227, 229, 231, 232, 234, 235, 237, 239], "control": [10, 13, 78, 97, 102, 106, 130, 132, 227, 233], "aspect": [10, 13, 163, 227], "posit": [10, 13, 21, 22, 110, 113, 127, 128, 136, 140, 149, 151], "screen": [10, 13, 16, 20, 21, 48, 96, 100, 110, 140, 148, 168, 229, 234, 237, 238], "destroi": [10, 11, 12, 14, 16, 53, 158, 159, 165, 166], "instanc": [10, 11, 12, 13, 17, 104, 109, 112, 148, 156, 158, 165, 229, 238, 239], "explicitli": [10, 149, 150, 151, 152], "one": [10, 13, 14, 15, 48, 98, 105, 112, 127, 148, 158, 165, 166, 227, 228, 229, 239], "becom": [10, 21, 112, 165, 166], "hidden": [10, 13, 21, 54], "show": [10, 13, 21, 104, 109, 127, 227, 229, 231, 234], "addit": [10, 227, 234, 235], "associ": [10, 13, 20, 21, 229, 231], "maintain": 10, "hide": [10, 13, 21, 109, 122, 127, 229], "make": [10, 158, 159, 162, 165, 166, 227, 233, 235, 238, 239], "invis": 10, "again": [10, 21], "drop": [10, 109, 122, 136, 138, 140], "anymor": [10, 22, 96, 148], "when": [10, 11, 12, 17, 19, 20, 21, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 49, 51, 53, 54, 100, 101, 105, 109, 127, 148, 158, 159, 162, 165, 166, 227, 228, 229, 235, 236], "is_vis": [10, 127, 138], "even": [10, 51, 239], "previous": [10, 20, 162], "user": [10, 21, 54, 100, 229, 232, 239, 240], "minim": [10, 21, 127, 158, 170, 231], "templat": [10, 13, 20, 22, 58, 61, 63, 66, 68, 69, 102, 103, 109, 110, 111, 112, 113, 114, 115, 117, 120, 121, 122, 123, 125, 126, 127, 135, 136, 138, 143, 144, 149, 150, 151, 152, 162, 165, 229, 237, 239], "invoc": [10, 13, 20, 22, 98, 99, 109, 111, 112, 126, 127, 148, 162], "renderingst": [10, 80, 102, 103, 127, 134, 136], "graphicsapi": [10, 80, 102, 103, 127, 134, 136], "f": [10, 13, 98, 99, 109, 112, 114, 115, 121, 126, 127, 162], "setrenderingnotifiererror": [10, 80, 102, 103, 127, 134, 136], "set_rendering_notifi": [10, 53, 127, 148], "callback": [10, 12, 13, 20, 21, 22, 53, 54, 97, 109, 110, 114, 126, 127, 136, 138, 141, 146, 148, 162, 229, 231, 237, 239], "regist": [10, 13, 49, 95, 112, 229], "invok": [10, 12, 13, 17, 18, 20, 21, 22, 98, 109, 110, 162, 227, 238], "dure": [10, 11, 148, 227], "phase": 10, "custom": [10, 105, 229], "top": [10, 117, 133, 135, 148], "below": [10, 237], "callabl": [10, 22], "argument": [10, 11, 13, 112, 136, 148, 227, 228, 229], "On": [10, 112, 231, 234], "success": [10, 238], "without": [10, 46, 105, 148, 165, 227, 235], "error": [10, 11, 47, 49, 112, 136, 137, 163], "on_close_request": [10, 54, 127], "tri": [10, 54], "close": [10, 21, 51, 54, 100, 133, 139, 231], "closerequestrespons": [10, 80, 102, 103, 127, 134, 136], "request_redraw": [10, 21, 110, 127, 140], "issu": [10, 233], "request": [10, 13, 21, 54], "redraw": [10, 20], "content": [10, 148, 159, 161, 229, 233, 234, 238], "physicalposit": [10, 20, 21, 66, 102, 103, 110, 120, 127, 168, 169], "physic": [10, 20, 21, 151, 152, 228, 240], "coordin": [10, 20, 21, 119, 148, 149, 151, 153, 240], "includ": [10, 11, 16, 21, 42, 46, 98, 99, 102, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172, 227, 228, 229, 231, 234, 237, 238], "frame": [10, 20, 21], "present": [10, 21, 22, 53, 102], "set_posit": [10, 21, 110, 127, 140], "logicalposit": [10, 22, 66, 102, 103, 111, 120, 127, 136, 151, 240], "po": [10, 110, 127, 136], "note": [10, 13, 14, 16, 21, 110, 112, 165, 166, 227, 229, 231, 235, 240], "some": [10, 11, 125, 136, 231, 234], "wayland": [10, 16, 227], "avail": [10, 13, 101, 103, 109, 148, 227, 229, 233, 234, 239], "physicals": [10, 19, 20, 21, 69, 102, 103, 110, 123, 127, 168, 169, 234], "size": [10, 19, 20, 21, 22, 69, 102, 103, 109, 110, 111, 112, 113, 117, 122, 123, 124, 127, 135, 136, 140, 143, 148, 150, 152, 157, 158, 159, 168, 169, 170, 171, 227, 234, 238, 240], "exclud": [10, 21, 158, 227], "set_siz": [10, 21, 110, 127, 140], "logicals": [10, 21, 22, 69, 102, 103, 110, 111, 123, 127, 136, 152, 170, 171], "resiz": [10, 21, 112, 127, 136, 170, 171], "logic": [10, 13, 21, 112, 149, 150, 228, 229, 232, 240], "pixel": [10, 20, 21, 110, 117, 133, 135, 148, 149, 150, 151, 152, 154, 155, 157, 167, 228, 233, 235, 240], "scale_factor": [10, 127, 136], "scale": [10, 21, 148], "is_fullscreen": [10, 21, 108, 110, 127, 170], "current": [10, 11, 53, 142, 148], "fullscreen": [10, 21, 108, 110, 127, 170], "set_fullscreen": [10, 127], "unset": [10, 21, 170, 171], "displai": [10, 16, 20, 53, 105, 110, 140, 148, 232, 233, 234, 235, 237], "is_maxim": [10, 21, 110, 127, 170], "maxim": [10, 21, 127, 170], "set_maxim": [10, 127], "unmaxim": 10, "is_minim": [10, 21, 110, 127, 170], "set_minim": [10, 127], "unminimz": 10, "dispatch_key_press_ev": [10, 106, 127, 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, 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], "sharedstr": [10, 11, 12, 13, 14, 17, 21, 22, 70, 102, 103, 106, 109, 110, 111, 112, 117, 119, 124, 125, 127, 129, 130, 135, 136, 137, 138, 139, 140, 142, 144, 145, 148, 161, 163, 164, 170, 229, 239, 240], "dispatch": 10, "kei": [10, 106, 109, 165, 166, 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, 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], "press": [10, 125, 127, 136, 142], "event": [10, 13, 17, 18, 21, 50, 51, 94, 97, 98, 99, 100, 110, 119, 127, 136, 139, 140, 229, 231, 234, 238, 239], "your": [10, 14, 20, 21, 105, 148, 227, 228, 229, 231, 233, 234, 235, 237, 238, 239], "own": [10, 105, 110, 227, 229, 236, 239], "backend": [10, 13, 49, 96, 105, 136, 142, 235], "want": [10, 104, 148, 165, 166, 227, 228, 231], "forward": [10, 21, 50, 109, 112, 127, 132, 235], "input": [10, 13, 21, 94, 100, 229, 235, 237], "unicod": 10, "represent": [10, 12, 29, 158], "dispatch_key_press_repeat_ev": [10, 127], "auto": [10, 13, 20, 22, 98, 99, 109, 110, 111, 112, 117, 121, 122, 124, 127, 129, 130, 132, 133, 158, 165, 166, 168, 227, 229, 231, 234, 238], "repeat": [10, 112, 126, 130, 133, 136, 146, 162], "dispatch_key_release_ev": [10, 106, 127], "releas": [10, 53, 110, 127, 136, 142, 227, 231, 238], "dispatch_pointer_press_ev": [10, 127], "pointereventbutton": [10, 78, 102, 103, 127, 130, 132, 133, 136], "button": [10, 22, 48, 50, 127, 130, 132, 136], "mous": [10, 13, 50], "rel": [10, 11, 162, 240], "dispatch_pointer_release_ev": [10, 127], "dispatch_pointer_exit_ev": [10, 127], "exit": [10, 17, 127, 136], "trigger": [10, 97, 239], "dispatch_pointer_move_ev": [10, 127], "move": [10, 14, 16, 17, 18, 109, 110, 111, 112, 114, 121, 122, 126, 127, 133, 136, 158, 159, 165, 166], "dispatch_pointer_scroll_ev": [10, 127], "delta_x": [10, 127, 130, 136], "delta_i": [10, 127, 130, 136], "scroll": 10, "wheel": [10, 127, 136], "delta": 10, "x": [10, 20, 110, 111, 112, 120, 125, 127, 135, 136, 139, 153, 227, 229, 231, 232, 240], "y": [10, 110, 111, 112, 120, 125, 127, 135, 136, 139, 153, 231, 232, 240], "direct": [10, 14, 21, 136], "dispatch_resize_ev": [10, 21, 127], "after": [10, 11, 20, 21, 97, 162], "send": [10, 17, 21], "ensur": [10, 16, 227], "width": [10, 20, 21, 110, 111, 112, 117, 123, 127, 130, 135, 136, 142, 148, 157, 160, 231, 232, 238], "height": [10, 21, 110, 111, 112, 117, 123, 127, 135, 136, 142, 148, 157, 160, 231, 232, 238], "root": [10, 145, 229], "properli": 10, "dispatch_scale_factor_change_ev": [10, 21, 127], "happen": 10, "resolut": 10, "select": [10, 17, 227, 234, 235, 237, 238], "platform": [10, 15, 16, 19, 20, 21, 43, 78, 96, 102, 103, 108, 127, 132, 167, 168, 169, 170, 171, 172, 234, 235, 237, 238], "right": [10, 20, 50, 117, 132, 133, 135, 148, 234], "initi": [10, 19, 21, 53, 97, 110, 157, 159, 165, 234, 238], "creation": 10, "dispatch_window_active_changed_ev": [10, 127], "activ": [10, 109, 127, 162], "de": [10, 13, 14, 165, 166, 229], "gain": 10, "focu": 10, "lose": 10, "dispatch_close_requested_ev": [10, 21, 127], "effect": 10, "depend": [10, 112, 141, 227, 234, 235], "has_active_anim": [10, 21, 127], "anim": [10, 21, 94, 121], "interpret": [11, 12, 13, 14, 43, 46, 47, 64, 83, 102, 103, 115, 118, 137, 138, 163, 164, 165, 166, 172], "entri": [11, 103, 104, 105, 165, 166, 239], "load": [11, 102, 103, 104, 148, 228, 239], "compil": [11, 12, 13, 17, 101, 104, 109, 112, 138, 228, 229, 231, 232, 234, 236, 238, 240], "them": [11, 20, 22, 104, 165, 168, 169, 227, 233, 238, 239], "build_from_sourc": [11, 12, 104, 109], "set_include_path": [11, 109], "look": [11, 231, 233, 234, 235], "up": [11, 20, 98, 133, 228, 231, 234, 239], "import": [11, 105, 148, 228, 234, 238], "set_styl": [11, 109], "string_view": [11, 12, 13, 22, 57, 59, 63, 65, 67, 70, 109, 111, 113, 117, 119, 121, 124, 158, 165, 166, 240], "style": [11, 109, 138], "widget": [11, 48, 234, 237, 238], "set_translation_domain": [11, 109], "domain": [11, 109, 112, 136], "translat": [11, 101, 112, 231, 239, 240], "include_path": [11, 109], "configur": [11, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 227, 228, 233, 234, 235, 237], "diagnost": [11, 47, 83, 102, 104, 109, 112, 137, 138], "produc": [11, 165], "build_from_path": [11, 12, 104, 109], "componentdefinit": [11, 13, 55, 102, 104, 109, 164, 239], "source_cod": [11, 109, 138], "collect": [11, 98], "retriev": [11, 237], "previou": [11, 20, 112, 229], "comput": 11, "self": [11, 109, 110, 162], "markup": [12, 227, 229, 235, 240], "componentcompil": [12, 55, 102, 104, 109, 138, 163, 239], "And": 12, "instanti": [12, 229, 234, 238, 239], "factori": [12, 17], "ve": [12, 229], "finish": [12, 99], "safe": [12, 98, 158], "assign": [12, 14, 148, 158, 159, 165, 166], "componentinst": [12, 55, 102, 104, 109, 138, 239], "propertydescriptor": [12, 83, 102, 104, 109, 137, 138], "describ": [12, 20, 21, 47, 48, 49, 50, 52, 53, 54, 148, 163, 164, 170, 171, 232], "list": [12, 48, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 172], "read": [12, 99, 112, 165, 227, 231], "written": [12, 165, 232], "set_properti": [12, 13, 109, 228], "get_properti": [12, 13, 109], "set_callback": [12, 13, 109], "global": [12, 13, 101, 109, 138, 227, 228, 239], "export": [12, 13, 22, 229, 231, 232, 234, 238, 239, 240], "singleton": [12, 13, 239], "global_properti": [12, 109], "global_nam": [12, 109, 138], "descriptor": 12, "publicli": 12, "exist": [12, 13, 15, 22, 112, 148, 157, 158, 165, 227, 228], "under": [12, 158, 234], "global_callback": [12, 109], "global_funct": [12, 109], "privat": [13, 109, 110, 111, 112, 113, 114, 115, 117, 119, 121, 122, 124, 126, 127, 128, 135, 139, 228, 229, 231, 238], "dyn": [13, 109, 136], "access": [13, 14, 21, 22, 48, 52, 96, 102, 165, 166, 170, 229, 239], "put": [13, 228], "mark": [13, 231], "window": [13, 16, 17, 19, 20, 21, 49, 51, 53, 54, 73, 95, 96, 100, 102, 103, 105, 106, 109, 110, 112, 125, 127, 140, 148, 170, 171, 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, 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, 231, 232, 234, 238, 240], "shown": [13, 21, 54, 98, 170, 239], "react": [13, 100, 229, 239], "draw": [13, 148, 234], "touch": [13, 234, 235, 237, 238], "necessari": [13, 16, 100, 227], "spin": [13, 17, 229, 231], "loop": [13, 17, 18, 21, 51, 94, 97, 98, 99, 100, 110, 229, 231, 234, 238], "run_event_loop": [13, 17, 51, 58, 97, 102, 103, 109, 110, 112, 140, 229], "receiv": [13, 21, 98, 100], "further": [13, 229], "integr": [13, 103, 157, 227, 232, 235, 237, 238, 239], "conveni": [13, 14, 158, 162, 165, 166, 227, 229, 231, 235], "follow": [13, 98, 99, 102, 148, 227, 228, 229, 231, 233, 234, 235, 237, 238, 239, 240], "qwidget": [13, 109, 142], "qt": [13, 142, 227], "graphic": [13, 52, 53, 232], "mai": [13, 20, 21, 49, 148, 168, 233, 234], "nullptr": [13, 109, 110, 112, 121, 142], "runtim": [13, 17, 101, 104, 110, 165, 227], "hello": [13, 229, 231, 232, 234, 235, 238], "we": [13, 110, 112, 115, 122, 136, 227, 229, 231, 233, 235, 237], "world": [13, 231, 232, 234, 235, 238], "correctli": 13, "could": [13, 233, 235], "becaus": [13, 110, 122, 148, 231], "proper": 13, "behind": 13, "span": [13, 20, 58, 63, 109, 110, 112, 117, 136], "arg": [13, 109, 114, 122, 136, 138, 141, 159, 165, 229], "imagin": 13, "contain": [13, 14, 20, 21, 46, 106, 125, 133, 157, 158, 159, 170, 228, 229, 231, 239], "foo": [13, 14, 22, 109, 240], "Then": [13, 14, 96, 227], "42": [13, 14, 142, 158], "don": [13, 109, 136, 233], "match": [13, 22, 112, 227, 234, 237, 238], "which": [13, 20, 21, 100, 104, 112, 120, 123, 162, 165, 166, 227, 228, 229, 232, 235, 239], "did": 13, "handler": [13, 94, 229], "functor": [13, 98, 99, 112, 229], "take": [13, 109, 148, 228, 229], "slice": [13, 109, 111, 112, 117, 122, 124, 135, 136, 138, 140, 144, 145, 148], "cout": 13, "to_numb": [13, 14, 109], "n": [13, 112, 124, 125, 136, 144, 158], "sinc": [13, 17, 20, 227], "captur": 13, "set_global_properti": [13, 109, 239], "prop_nam": [13, 109], "within": [13, 14, 22, 98, 102, 163, 227], "main": [13, 97, 98, 99, 100, 127, 228, 229, 231, 234, 238], "theglob": 13, "doe": [13, 16, 21, 22, 49, 162, 165], "correct": [13, 227], "get_global_properti": [13, 109, 239], "set_global_callback": [13, 109, 239], "preview": [13, 22, 232], "pure": 13, "to_uppercas": [13, 229], "arg1": 13, "begin": [13, 20, 109, 110, 112, 113, 117, 122, 124, 133, 136, 148, 157, 158, 159, 165, 166, 229], "end": [13, 20, 78, 102, 106, 109, 110, 112, 113, 117, 122, 124, 132, 133, 136, 157, 158, 159, 165, 166, 227, 229, 233], "toupper": [13, 229], "invoke_glob": [13, 109], "callable_nam": [13, 109, 138], "definit": [13, 109, 172], "dynam": [14, 102, 239], "type": [14, 18, 22, 46, 50, 54, 102, 103, 104, 105, 109, 113, 115, 117, 119, 120, 123, 125, 128, 131, 135, 136, 139, 148, 157, 158, 164, 166, 169, 171, 229, 234, 235, 237, 239], "overload": [14, 21, 112], "to_xxx": 14, "possibl": [14, 158, 227, 239], "queri": [14, 21, 22], "c": [14, 17, 20, 103, 112, 127, 131, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146, 148, 165, 166, 168, 227, 228, 229, 231, 234, 235, 236, 237, 238, 239, 240], "store": [14, 17, 113, 147, 156, 157], "sometyp": 14, "object": [14, 22, 46, 148, 240], "liter": 14, "bar": [14, 22, 48, 240], "my_prop": 14, "Such": 14, "doubl": [14, 20, 22, 109, 124, 125, 136, 138, 144, 158, 237], "some_valu": 14, "check": [14, 22, 111, 136, 142, 165, 166, 227, 231, 232, 234, 235, 237], "string_valu": 14, "do_someth": [14, 99], "extract": [14, 165, 166, 237, 238], "valuetyp": [14, 83, 102, 104, 109, 137, 138, 164], "alia": [14, 133, 231], "enum": [14, 17, 20, 110, 112, 117, 128, 130, 132, 133, 134, 135, 136, 137, 139, 146, 148, 172], "to_bool": [14, 109], "to_arrai": [14, 109], "serial": 14, "brush": [14, 21, 46, 59, 102, 103, 109, 110, 113, 115, 121, 128, 136, 137, 138, 140, 141, 142, 170, 240], "to_brush": [14, 109], "to_struct": [14, 109, 165], "imag": [14, 46, 63, 102, 103, 109, 117, 135, 136, 137, 138, 142, 157, 228, 235, 238, 240], "to_imag": [14, 109], "str": [14, 109, 112, 117, 124, 125, 138, 158, 229], "boolean": 14, "m": [14, 109, 112, 136, 235], "struc": [14, 109, 138], "img": [14, 109, 117, 138], "variant": [14, 20, 46], "vale": 14, "skiarender": [15, 21, 56, 102, 105, 110, 127], "softwarerender": [15, 21, 56, 102, 105, 110, 127, 169], "interfac": [15, 105, 227, 229, 232, 239], "windowadapt": [15, 17, 20, 56, 102, 105, 108, 110, 171], "intend": [15, 22], "place": [15, 238], "requir": [15, 109, 110, 111, 112, 127, 227, 228, 233, 234, 238, 239], "opaqu": [16, 109, 112, 124], "low": [16, 52], "level": [16, 52, 137, 163], "exchang": [16, 110], "messag": [16, 21, 98, 99, 112, 137, 163], "connect": [16, 110, 140, 234], "server": 16, "kind": [16, 109, 130, 136, 239], "ownership": [16, 109, 110], "caller": 16, "respons": [16, 148], "suppli": [16, 229], "valid": [16, 22, 112, 136, 148, 158], "throughout": 16, "lifetim": 16, "from_x11_xcb": [16, 110], "visual_id": [16, 110, 140], "xcb_connection_t": [16, 110], "xcb_window_t": [16, 110], "xcb_visualid_t": [16, 110], "xcb": 16, "from_x11_xlib": [16, 110], "unsign": [16, 109, 110, 111, 117, 124, 125, 140, 142, 148], "long": [16, 22, 110, 112, 140, 158, 229, 239], "xlib": 16, "visualid": [16, 110], "from_wayland": [16, 110], "wl_surfac": [16, 110], "surfac": [16, 110, 140], "wl_displai": [16, 110], "from_appkit": [16, 110], "nsview": [16, 110], "nswindow": [16, 110], "from_win32": [16, 110], "hwnd": [16, 21, 110, 140], "hinstanc": [16, 110], "task": [17, 50, 56, 102, 105, 110, 234], "set_platform": [17, 56, 102, 105, 110], "befor": [17, 21, 94, 95, 96, 165, 166], "subsequ": 17, "create_window_adapt": [17, 21, 110], "clipboard": [17, 110, 136, 140], "clipboard_text": [17, 110, 140], "set_clipboard_text": [17, 110, 140], "enumer": [17, 20, 46, 47, 48, 49, 50, 51, 52, 53, 54, 148], "defaultclipboard": [17, 110, 136], "action": [17, 22, 54, 111, 133, 136], "ctrl": 17, "secondari": 17, "x11": [17, 227], "selectionclipboard": [17, 110, 136], "primari": [17, 103, 142, 239], "unique_ptr": [17, 95, 110, 142], "chrono": [17, 58, 72, 93, 110, 112, 126, 162], "millisecond": [17, 93, 110, 126, 162, 240], "duration_since_start": [17, 110, 140], "start": [17, 20, 98, 99, 102, 126, 133, 136, 158, 162, 163, 227, 229, 234, 235, 237, 238], "applic": [17, 49, 95, 105, 148, 227, 228, 231, 232, 233, 237, 239], "slint_feature_freestand": [17, 80, 102, 110, 112, 117, 127, 134], "doesn": [17, 109, 112], "nullopt": [17, 21, 22, 110, 111, 112, 148], "quit_event_loop": [17, 51, 58, 102, 103, 110, 112, 140], "thread": [17, 18, 98, 99, 127], "enter": [17, 100], "run_in_event_loop": [17, 18, 110], "invoke_from_event_loop": [17, 58, 99, 102, 103, 112, 127, 140], "pass": [17, 18, 20, 21, 97, 148, 158, 159, 227, 228, 235], "reimplement": [17, 21], "longer": [17, 18], "onc": [17, 18, 95, 97, 98, 109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 229, 231, 235, 239], "abstractrender": [19, 20, 21, 56, 102, 105, 110], "skia": 19, "nativ": [19, 21, 232], "non": [19, 46, 106], "zero": 19, "explicit": [19, 20, 21, 109, 110, 111, 117, 120, 121, 122, 123, 124, 127, 142, 149, 150, 151, 152, 159, 167], "nativewindowhandl": [19, 56, 102, 105, 110], "window_handl": [19, 110, 112, 125, 127, 136], "initial_s": [19, 110], "windowhandl": 19, "physicalregion": [20, 56, 102, 105, 110, 136, 140], "rect": [20, 56, 102, 105, 110, 111, 112, 135, 136, 168], "softwar": [20, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 228, 235, 237, 238], "To": [20, 107, 227, 235, 237, 239], "buffer": [20, 21, 53, 110, 117, 135, 140, 148, 157, 234, 237], "repaintbuffertyp": [20, 110], "part": [20, 158], "speed": [20, 228], "paint": 20, "newbuff": [20, 110], "full": 20, "redrawn": 20, "No": [20, 133], "attempt": 20, "partial": [20, 168], "made": [20, 159, 228, 233], "reusedbuff": [20, 110], "assum": [20, 98, 148, 158, 228, 229], "everi": [20, 162, 229], "swappedbuff": [20, 110], "drawn": [20, 148], "swap": [20, 53, 110, 121, 122, 124], "renderingrot": [20, 110], "rotat": [20, 110, 112, 136, 140], "set_rendering_rot": [20, 110], "norot": [20, 110], "rotate90": [20, 110], "90": [20, 110, 142], "left": [20, 21, 50, 117, 132, 133, 135, 148, 170, 171], "rotate180": [20, 110], "180": [20, 110, 142], "upsid": 20, "down": [20, 133], "rotate270": [20, 110], "buffer_typ": [20, 110], "strategi": 20, "rgb8pixel": [20, 80, 102, 103, 110, 117, 134, 135, 140, 148, 167], "pixel_strid": [20, 110, 140], "least": [20, 158, 227, 229, 234, 235, 239], "larg": 20, "stride": 20, "line": [20, 110, 125, 133, 137, 163, 227, 232, 235], "rgb565pixel": [20, 56, 102, 105, 110, 234], "565": 20, "render_by_lin": [20, 110], "process_line_callback": [20, 110], "cach": [20, 112, 227, 228], "dirti": [20, 112, 141], "region": [20, 140, 168], "consid": [20, 157], "signatur": 20, "render_fn": [20, 110], "third": 20, "fourth": 20, "free": [20, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 140, 158], "flush": 20, "typic": [20, 21, 50, 105, 148, 163, 165, 166, 233, 236, 238], "compos": [20, 168, 232], "multipl": [20, 49, 168, 227, 228, 229], "sub": [20, 168, 227, 229, 236, 239], "bounding_box_s": [20, 110, 168], "bound": [20, 168], "box": [20, 109, 138, 168, 234, 235], "bounding_box_origin": [20, 110, 168], "origin": [20, 110, 112, 117, 135, 148, 149, 151, 168, 169], "overlap": [20, 168], "over": [20, 165, 168, 169], "someth": [20, 22, 46, 168, 229], "member": [20, 21, 108, 136, 147, 153, 154, 155, 156, 160, 161, 163, 164, 167, 168, 169, 170, 171, 229, 240], "windowproperti": [21, 56, 102, 105, 108, 110, 140], "layoutconstraint": [21, 56, 102, 105, 110, 170], "base": [21, 22, 46, 102, 111, 136, 234, 238], "layer": [21, 136], "win32": [21, 231], "wayland_surface_t": 21, "establish": 21, "link": [21, 112, 231, 238], "both": [21, 165, 166, 227], "about": [21, 53, 125, 227, 228, 231, 234, 235, 237], "being": [21, 115, 148], "etc": [21, 22, 239], "dispatch_mouse_press_ev": 21, "via": [21, 148, 229, 237, 238], "set_vis": [21, 110, 140], "update_window_properti": [21, 110, 140, 170], "deleg": 21, "bi": 21, "protocol": [21, 165, 166], "incomplet": 21, "experi": [21, 238], "unexpect": 21, "behavior": [21, 100, 148], "intent": 21, "develop": [21, 26, 29, 35, 38, 235, 236], "fulfil": 21, "method": [21, 148, 162], "mywindowadapt": 21, "m_render": 21, "nativehandl": 21, "m_native_window": 21, "refresh": 21, "els": [21, 109, 110, 111, 112, 116, 117, 122, 125, 127, 234], "repaint_callback": 21, "asynchron": 21, "would": [21, 110, 122, 227], "update_timers_and_anim": [21, 56, 102, 105, 110], "schedul": [21, 97], "next": [21, 93, 109, 162, 165, 166, 227, 231, 232], "good": 21, "initialis": [21, 228], "detect": [21, 165, 227], "repaint": 21, "manag": 21, "instead": [21, 108, 162, 170, 227, 231, 235, 239], "iter": [21, 22, 55, 94, 102, 104, 109, 138, 165], "sent": [21, 53], "actual": [21, 229, 239], "propag": 21, "titl": [21, 110, 130, 136, 142, 170], "layout": [21, 110, 112, 135, 136, 148, 170, 171], "constraint": [21, 53, 136, 170, 171], "case": [21, 112, 113, 128, 135, 139, 148, 231, 240], "getter": [21, 170, 229, 239], "background": [21, 110, 136, 142, 170], "deprec": [21, 102, 110, 112, 170, 172], "layout_constraint": [21, 110, 170, 171], "min": [21, 110, 112, 136, 140, 170, 171], "minimum": [21, 22, 142, 170, 171], "abl": [21, 170, 171, 238], "smaller": [21, 170, 171], "than": [21, 99, 158, 170, 171, 228, 239], "max": [21, 110, 112, 136, 140, 170, 171], "maximum": [21, 22, 142, 170, 171], "larger": [21, 170, 171], "prefer": [21, 110, 112, 136, 140, 170, 171, 231], "test": [22, 43, 48, 71, 78, 102, 103, 109, 125, 132, 133, 172, 234], "purpos": [22, 112, 229], "is_valid": [22, 111], "id": [22, 111, 126, 136, 146, 148], "qualifi": 22, "none": [22, 48, 50, 119, 132, 133, 139, 235, 238], "consist": 22, "surround": 22, "well": [22, 158, 165, 166, 234, 236, 238], "local": [22, 112], "separ": [22, 228], "colon": 22, "pushbutton": 22, "zwj": 22, "app": [22, 229, 234, 238], "mybutton": 22, "known": [22, 148], "type_nam": [22, 111, 145], "buttonbas": 22, "inherit": [22, 102, 229, 231, 232, 234, 238], "accessiblerol": [22, 78, 102, 107, 111, 132, 133, 136], "accessible_rol": [22, 111, 136], "role": [22, 48, 136], "locat": [22, 163, 238], "checkbox": [22, 48, 132], "accessible_label": [22, 111], "label": [22, 111, 136, 145, 231], "accessible_valu": [22, 111], "accessible_placeholder_text": [22, 111], "placehold": 22, "accessible_descript": [22, 111], "descript": [22, 102, 111, 136, 163, 235], "accessible_value_maximum": [22, 111], "accessible_value_minimum": [22, 111], "accessible_value_step": [22, 111], "step": [22, 227, 231], "accessible_check": [22, 111], "checkabl": [22, 111, 136, 142], "set_accessible_valu": [22, 111], "invoke_accessible_increment_act": [22, 111], "increment": [22, 111, 136], "invoke_accessible_decrement_act": [22, 111], "decrement": [22, 111, 136], "invoke_accessible_default_act": [22, 111], "absolute_posit": [22, 111], "absolut": [22, 228], "visitor": [22, 111, 112, 136, 145], "r": [22, 109, 110, 111, 112, 114, 121, 129, 130, 132, 133, 134, 140, 142, 154, 155, 167, 234], "invoke_result_t": [22, 99, 109, 111, 112, 121, 127], "visit_el": [22, 111], "visit": [22, 112, 165], "continu": [22, 112, 229], "until": [22, 51, 93, 99, 109, 162, 165, 231], "convers": [22, 148, 158], "never": [22, 162], "convertt": 22, "eh": 22, "make_opt": 22, "find_by_accessible_label": [22, 111], "find": [22, 112, 227], "find_by_element_id": [22, 111], "element_id": [22, 111, 145], "find_by_element_type_nam": [22, 111], "slint_generated_publ": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 45, 49, 52, 53, 54, 63, 70, 82, 102, 117, 136, 154, 155, 172], "macro": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 227], "flag": [23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 233], "enabl": [23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 107, 136, 142, 227, 234, 235, 238, 239], "expand": [26, 29, 35, 38, 120, 123], "numer": [26, 35, 38], "patch": [26, 112], "against": [26, 29, 35, 38, 148, 227], "minor": [35, 112], "major": [38, 112], "slint_tests_help": [40, 43, 57, 102, 172], "home": [41, 42, 43, 78, 102, 106, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 132, 172], "runner": [41, 42, 43, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 172], "work": [41, 42, 43, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 148, 172, 227, 231], "cpp": [41, 43, 105, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 129, 130, 132, 133, 172, 227, 228, 231, 234, 237, 238], "parent": [42, 43, 45, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 112, 127, 136, 231, 232], "slint_callback": [43, 82, 87, 102, 136, 172], "slint_config": [43, 82, 102, 136, 172], "slint_imag": [43, 68, 69, 70, 80, 81, 82, 102, 136, 148, 157, 172], "slint_interpret": [43, 55, 102, 172], "slint_pathdata": [43, 82, 85, 102, 136, 172], "slint_point": [43, 58, 82, 102, 112, 136, 149, 151, 153, 172], "slint_properti": [43, 61, 76, 82, 87, 102, 115, 136, 172], "slint_sharedvector": [43, 58, 63, 82, 89, 102, 117, 136, 159, 172], "slint_siz": [43, 58, 63, 102, 112, 117, 150, 152, 160, 172], "slint_str": [43, 59, 63, 80, 82, 90, 102, 113, 117, 134, 136, 158, 172], "slint_tim": [43, 82, 92, 102, 136, 162, 172], "generated_includ": [44, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "cppdoc": [45, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "slint_brush_intern": [45, 59, 79, 102, 113, 172], "slint_builtin_struct": [45, 76, 102, 130, 161, 172], "slint_builtin_structs_intern": [45, 67, 75, 79, 82, 102, 121, 136, 172], "slint_color_intern": [45, 61, 79, 102, 115, 172], "slint_enum": [45, 48, 50, 79, 102, 133, 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, 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], "slint_enums_intern": [45, 74, 76, 77, 78, 81, 82, 85, 102, 128, 130, 131, 135, 136, 139, 172], "slint_image_intern": [45, 63, 79, 86, 102, 117, 140, 172], "slint_intern": [45, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 70, 72, 73, 76, 79, 80, 84, 86, 88, 102, 112, 127, 138, 140, 142, 172], "slint_interpreter_generated_publ": [45, 46, 47, 84, 102, 138, 163, 164, 172], "slint_interpreter_intern": [45, 55, 82, 83, 102, 109, 172], "slint_pathdata_intern": [45, 65, 79, 102, 119, 172], "slint_platform_intern": [45, 58, 81, 82, 102, 112, 172], "slint_properties_intern": [45, 60, 67, 102, 114, 121, 172], "slint_qt_intern": [45, 58, 82, 102, 112, 172], "slint_sharedvector_intern": [45, 68, 102, 122, 172], "slint_string_intern": [45, 70, 102, 124, 172], "slint_testing_intern": [45, 57, 102, 111, 172], "slint_timer_intern": [45, 72, 102, 126, 172], "class": [46, 47, 48, 49, 50, 51, 52, 53, 54, 109, 110, 111, 112, 113, 115, 117, 122, 127, 128, 130, 132, 133, 134, 135, 136, 137, 139, 141, 146, 148, 158, 159, 165, 166, 168, 170, 172, 228, 229, 231, 238, 239, 240], "int8_t": [46, 137], "unit": [46, 240], "length": [46, 228, 240], "angl": [46, 113, 240], "solidcolor": [46, 113, 128], "sever": 47, "belong": 47, "context": [48, 53, 112, 136, 148], "assist": 48, "technologi": 48, "reader": 48, "isn": 48, "behav": 48, "combobox": [48, 132, 142], "slider": [48, 132], "spinbox": [48, 132], "tab": [48, 78, 102, 106, 132], "tablist": [48, 132], "similar": [48, 159, 228, 229, 239], "automat": [48, 158, 239, 240], "tabl": [48, 132, 237, 240], "tree": [48, 105, 132, 238], "treeview": 48, "Not": [48, 122], "yet": [48, 53, 107, 122, 162, 165], "progressind": [48, 132], "textinput": [48, 132, 136], "edit": [48, 136, 142, 229, 232, 234], "switch": [48, 113, 128, 132, 135, 139], "listitem": [48, 132], "item": [48, 53, 111, 112, 127, 136, 142, 145, 161], "scenario": 49, "occur": 49, "unsupport": [49, 134], "alreadyset": [49, 134], "There": 49, "alreadi": [49, 110, 157, 227, 235], "pencil": 50, "middl": [50, 132], "mani": [50, 112, 235], "center": [50, 133, 234, 238], "mode": [51, 100, 112, 126, 146, 162], "determin": [51, 100, 227], "quit": [51, 100, 234], "quitonlastwindowclos": [51, 100, 112], "rununtilquit": [51, 112], "keep": [51, 142, 229, 239], "nativeopengl": [52, 134], "opengl": [52, 53, 148], "renderingsetup": [53, 134], "beforerend": [53, 134], "afterrend": [53, 134], "gl": 53, "renderingteardown": [53, 134], "resourc": [53, 148], "due": [53, 233], "whether": [54, 110, 227], "hidewindow": [54, 134], "keepwindowshown": [54, 134], "reject": [54, 133], "kept": 54, "directori": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 227, 228, 233, 238], "program": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 172, 227, 228, 231], "cassert": [56, 110], "cstdint": [56, 62, 66, 69, 74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 110, 116, 120, 123, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "util": [56, 110, 227], "duration_until_next_timer_upd": [56, 102, 105, 110], "type_trait": [57, 111], "elementhandl": [57, 102, 107, 111, 145], "init": [57, 102, 107, 111, 112, 121, 136], "algorithm": [58, 68, 112, 122], "concept": [58, 112], "memori": [58, 67, 68, 112, 121, 122, 148, 158, 231, 239], "componentweakhandl": [58, 98, 102, 103, 112], "eventloopmod": [58, 100, 102, 103, 112], "blocking_invoke_from_event_loop": [58, 98, 102, 103, 112], "update_all_transl": [58, 102, 103, 112], "tupl": [60, 112, 114, 130, 240], "stdint": [61, 115], "sharedpixelbuff": [63, 102, 103, 117, 135, 148], "initializer_list": [65, 68, 109, 119, 122, 159, 165], "atom": [68, 122], "iostream": [71, 125, 127], "assert_eq": [71, 102, 125], "timer": [72, 93, 94, 102, 103, 126], "cstdarg": [74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "cstdlib": [74, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "standardlistviewitem": [75, 102, 103, 129, 130, 142], "key_cod": [78, 102, 105, 132], "alt": [78, 102, 106, 130, 132], "altgr": [78, 102, 106, 132], "backspac": [78, 102, 106, 132], "backtab": [78, 102, 106, 132], "capslock": [78, 102, 106, 132], "controlr": [78, 102, 106, 132], "downarrow": [78, 102, 106, 132], "escap": [78, 102, 106, 132], "f1": [78, 102, 106, 132], "f10": [78, 102, 106, 132], "f11": [78, 102, 106, 132], "f12": [78, 102, 106, 132], "f13": [78, 102, 106, 132], "f14": [78, 102, 106, 132], "f15": [78, 102, 106, 132], "f16": [78, 102, 106, 132], "f17": [78, 102, 106, 132], "f18": [78, 102, 106, 132], "f19": [78, 102, 106, 132], "f2": [78, 102, 106, 132], "f20": [78, 102, 106, 132], "f21": [78, 102, 106, 132], "f22": [78, 102, 106, 132], "f23": [78, 102, 106, 132], "f24": [78, 102, 106, 132], "f3": [78, 102, 106, 132], "f4": [78, 102, 106, 132], "f5": [78, 102, 106, 132, 237], "f6": [78, 102, 106, 132], "f7": [78, 102, 106, 132], "f8": [78, 102, 106, 132], "f9": [78, 102, 106, 132], "leftarrow": [78, 102, 106, 132], "menu": [78, 102, 106, 132], "meta": [78, 102, 106, 130, 132], "metar": [78, 102, 106, 132], "pagedown": [78, 102, 106, 132], "pageup": [78, 102, 106, 132], "paus": [78, 102, 106, 132], "rightarrow": [78, 102, 106, 132], "scrolllock": [78, 102, 106, 132], "shift": [78, 102, 106, 130, 132, 167], "shiftr": [78, 102, 106, 132], "sysreq": [78, 102, 106, 132], "uparrow": [78, 102, 106, 132], "rgba8pixel": [80, 102, 103, 117, 134, 135, 148], "slint_feature_access": [80, 102, 134], "slint_feature_backend_linuxkm": [80, 102, 134], "slint_feature_backend_qt": [80, 102, 109, 134], "slint_feature_backend_winit": [80, 102, 134, 227], "slint_feature_experiment": [80, 102, 107, 110, 111, 134], "slint_feature_gettext": [80, 101, 102, 112, 134], "slint_feature_interpret": [80, 102, 109, 134], "slint_feature_renderer_femtovg": [80, 102, 134, 227], "slint_feature_renderer_skia": [80, 102, 110, 134, 227], "slint_feature_renderer_softwar": [80, 102, 110, 134], "slint_feature_system_test": [80, 102, 134], "slint_feature_test": [80, 102, 107, 111, 134], "slint_version_major": [80, 102, 134], "slint_version_minor": [80, 102, 134], "slint_version_patch": [80, 102, 134], "slint_version_str": [80, 102, 134], "diagnosticlevel": [83, 102, 104, 137, 163], "durat": [93, 126, 136, 146, 148, 162, 240], "pend": [93, 98, 99], "advanc": [94, 165, 166], "process": [94, 107, 227], "futur": [96, 234], "appear": 96, "termin": [97, 158, 234], "meant": [97, 106], "ui": [97, 98, 99, 104, 105, 107, 227, 228, 231, 232, 234, 237, 238], "immedi": 97, "add": [98, 122, 165, 227, 233, 234, 238], "queue": 98, "wake": 98, "woken": 98, "queu": 98, "statu": [98, 110], "network": 98, "my_application_ui": [98, 99, 231], "argc": [98, 99, 231], "char": [98, 99, 109, 111, 112, 115, 124, 125, 136, 144, 148, 158, 231, 240], "argv": [98, 99, 231], "networkstatusui": 98, "set_status_label": [98, 99], "weak_ui_handl": 98, "network_thread": 98, "read_message_blocking_from_network": 98, "see": [98, 103, 112, 157, 227, 233, 234, 237, 238], "block": [98, 99], "just": [99, 109, 112], "But": 99, "execut": [99, 227], "deadlock": 99, "forev": 99, "anoth": [99, 105, 148], "myapplicationui": 99, "worker_thread": 99, "get_messag": 99, "By": [100, 172, 227, 228, 234], "forc": 101, "tr": 101, "evalu": [101, 121], "my_ui": 101, "languageset": 101, "on_french_select": 101, "setenv": 101, "lang": 101, "l": [101, 112], "section": [102, 227, 229, 231, 232, 233, 236, 239], "header": [102, 118, 229, 231, 238], "choos": [102, 227, 238], "slintnamespac": 102, "interpreterstruct": 102, "diagnosticstruct": 102, "propertydescriptorstruct": 102, "structstruct": 102, "iteratorclass": 102, "componentcompilerclass": 102, "componentdefinitionclass": 102, "componentinstanceclass": 102, "valueenum": 102, "diagnosticlevelenum": 102, "valuetypenamespac": 102, "platformstruct": 102, "rgb565pixelclass": 102, "abstractrendererclass": 102, "nativewindowhandleclass": 102, "platformclass": 102, "taskclass": 102, "skiarendererclass": 102, "softwarerendererstruct": 102, "physicalregionstruct": 102, "rectclass": 102, "windowadapterstruct": 102, "windowpropertiesstruct": 102, "layoutconstraintsnamespac": 102, "testingclass": 102, "elementhandleenum": 102, "accessiblerolestruct": 102, "hsvacolorstruct": 102, "imagestruct": 102, "logicalpositionstruct": 102, "logicalsizestruct": 102, "physicalpositionstruct": 102, "physicalsizetempl": 102, "pointstruct": 102, "rgb8pixelstruct": 102, "rgba8pixeltempl": 102, "rgbacolortempl": 102, "sharedpixelbufferstruct": 102, "sharedstringtempl": 102, "sharedvectortempl": 102, "sizestruct": 102, "standardlistviewitemstruct": 102, "timerclass": 102, "brushclass": 102, "colortempl": 102, "componenthandletempl": 102, "componentweakhandletempl": 102, "filtermodeltempl": 102, "mapmodeltempl": 102, "modeltempl": 102, "reversemodeltempl": 102, "sortmodeltempl": 102, "vectormodelclass": 102, "windowenum": 102, "closerequestresponseenum": 102, "eventloopmodeenum": 102, "graphicsapienum": 102, "pointereventbuttonenum": 102, "renderingstateenum": 102, "apidirectori": 102, "cppdirectori": 102, "includefil": 102, "hfile": 102, "hdirectori": 102, "cppdocsdirectori": 102, "generated_includefil": 102, "detail": [102, 232, 234, 235, 237], "document": [102, 103, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 227, 229, 234, 235, 236, 237], "nest": 102, "relationship": 102, "deriv": [102, 105], "overview": [103, 236], "design": [103, 232, 240], "its": [104, 157, 163], "pre": [104, 148, 227, 228, 234, 235, 237], "normal": [104, 133, 156], "wai": [104, 148, 227, 228, 232, 239], "come": [105, 227, 232, 235, 239], "built": [105, 227, 231, 239], "modul": [105, 107, 227, 237], "interact": [105, 136, 227, 232, 239], "environ": [105, 233, 234, 236], "microcontrol": [105, 236], "embed": [105, 227, 232], "plugin": 105, "found": [105, 228, 231], "repositori": 105, "http": [105, 112, 227, 231, 234, 238], "github": [105, 227, 231, 234, 238], "com": [105, 112, 227, 231, 238], "master": 105, "platform_n": 105, "platform_qt": 105, "blob": 105, "esp": [105, 233, 234, 236], "idf": [105, 234, 236], "src": [105, 129, 130, 132, 133, 234], "constant": [106, 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, 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], "special": [106, 112, 156], "printabl": 106, "experiment": [107, 227], "subject": 107, "stabil": 107, "ON": [107, 227, 235], "cmake": [107, 227, 231, 232, 233, 235, 236, 237, 238, 239], "page": 108, "copyright": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "sixtyfp": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "gmbh": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "info": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "dev": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "spdx": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "licens": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "identifi": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "gpl": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "OR": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "licenseref": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "royalti": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127], "pragma": [109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "ifndef": [109, 110, 112, 127], "ifdef": [109, 110, 111, 112], "endif": [109, 110, 111, 112, 115, 116, 117, 122, 127, 135, 138, 139, 227, 231, 234], "namespac": [109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172, 228, 235, 239], "cbindgen_priv": [109, 110, 111, 112, 113, 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 135, 136, 138, 139, 140, 141, 142, 143, 144, 145, 146], "stai": 109, "eraseditemtreebox": [109, 138], "slint_interpreter_struct_new": [109, 138], "slint_interpreter_struct_clon": [109, 138], "slint_interpreter_struct_destructor": [109, 138], "inputiter": [109, 165], "doxygen": [109, 110, 112, 115, 116, 117, 122, 127], "understand": 109, "wizardri": 109, "enable_if_t": [109, 121], "is_convert": 109, "decltyp": [109, 112, 121], "declval": 109, "set_field": [109, 165], "fixm": [109, 112, 115], "probabl": 109, "miss": 109, "lot": 109, "value_typ": [109, 165, 166], "structiteratoropaqu": [109, 138], "k": [109, 138], "believ": 109, "suppos": [109, 231], "slint_interpreter_struct_make_it": [109, 138], "get_field": [109, 165], "structopaqu": [109, 138], "slint_interpreter_value_new": [109, 138], "slint_interpreter_value_clon": [109, 138], "slint_interpreter_value_destructor": [109, 138], "to_int": 109, "to_float": 109, "slint_interpreter_value_to_numb": [109, 138], "slint_interpreter_value_to_str": [109, 138], "slint_interpreter_value_to_bool": [109, 138], "slint_interpreter_value_to_brush": [109, 138], "opaque_struct": 109, "slint_interpreter_value_to_struct": [109, 138], "slint_interpreter_value_to_imag": [109, 138], "reinterpret_cast": [109, 110, 111, 112, 114, 117, 121, 122, 124, 126, 127, 144], "slint_interpreter_value_new_doubl": [109, 138], "static_cast": [109, 110, 112, 148], "slint_interpreter_value_new_str": [109, 138], "slint_interpreter_value_new_bool": [109, 138], "slint_interpreter_value_new_brush": [109, 138], "slint_interpreter_value_new_struct": [109, 138], "slint_interpreter_value_new_imag": [109, 138], "slint_interpreter_value_typ": [109, 138], "slint_interpreter_value_eq": [109, 138], "avoid": [109, 115, 125], "turn": [109, 227], "slint_interpreter_value_new_array_model": [109, 138], "slint_interpreter_value_to_arrai": [109, 138], "modeladaptorvt": [109, 138], "vref": [109, 112, 127, 135, 136, 138], "modelwrapp": 109, "modelchangelisten": [109, 112], "modelnotifyopaqu": [109, 138], "rust": [109, 110, 112, 234, 235], "slint_interpreter_model_notify_destructor": [109, 138], "slint_interpreter_model_notify_row_ad": [109, 138], "slint_interpreter_model_notify_row_chang": [109, 138], "slint_interpreter_model_notify_row_remov": [109, 138], "slint_interpreter_model_notify_reset": [109, 138], "wrapper": 109, "make_shar": [109, 112, 121], "slint_interpreter_model_notify_new": [109, 138], "attach_p": [109, 112], "uintptr_t": [109, 110, 135, 136, 137, 138, 139, 140, 141, 143, 144, 145, 146, 163], "has_valu": [109, 110, 111, 112], "rval": 109, "get_notifi": [109, 138], "vrefmut": [109, 112, 135, 136, 138], "vt": 109, "slint_interpreter_value_new_model": [109, 138], "name_view": 109, "const_cast": [109, 111, 112, 117, 121, 122, 124, 127, 144], "field_val": 109, "slint_interpreter_struct_get_field": [109, 138], "slint_interpreter_struct_set_field": [109, 138], "name_slic": 109, "nextval_inn": 109, "slint_interpreter_struct_iterator_next": [109, 138], "ptr": [109, 112, 122, 135, 136, 143, 144], "len": [109, 112, 122, 127, 136, 144], "slint_interpreter_struct_iterator_destructor": [109, 138], "fact": 109, "assert_main_thread": [109, 110, 112, 127], "slint_interpreter_component_instance_show": [109, 138], "windowadapterrcopaqu": [109, 110, 112, 127, 136, 138, 140], "win_ptr": 109, "slint_interpreter_component_instance_window": [109, 138], "wid": 109, "slint_qt_get_widget": [109, 142], "windowadapterrc": [109, 127, 136, 142], "slint_interpreter_component_instance_set_properti": [109, 138], "string_to_slic": [109, 124], "prop_inn": 109, "slint_interpreter_component_instance_get_properti": [109, 138], "args_view": 109, "rval_inn": 109, "slint_interpreter_component_instance_invok": [109, 138], "is_convertible_v": [109, 127], "actual_cb": [109, 127], "slint_interpreter_component_instance_set_callback": [109, 138], "slint_interpreter_component_instance_set_global_properti": [109, 138], "slint_interpreter_component_instance_get_global_properti": [109, 138], "slint_interpreter_component_instance_set_global_callback": [109, 138], "slint_interpreter_component_instance_invoke_glob": [109, 138], "componentdefinitionopaqu": [109, 138], "slint_interpreter_component_definition_clon": [109, 138], "slint_interpreter_component_definition_destructor": [109, 138], "union": [109, 111, 128, 135, 136, 139], "ci": 109, "u": [109, 110, 112, 136], "slint_interpreter_component_instance_cr": [109, 138], "prop": [109, 138], "slint_interpreter_component_definition_properti": [109, 138], "slint_interpreter_component_definition_callback": [109, 138], "slint_interpreter_component_definition_funct": [109, 138], "slint_interpreter_component_definition_nam": [109, 138], "slint_interpreter_component_definition_glob": [109, 138], "slint_interpreter_component_definition_global_properti": [109, 138], "slint_interpreter_component_definition_global_callback": [109, 138], "slint_interpreter_component_definition_global_funct": [109, 138], "slint_interpreter_component_instance_component_definit": [109, 138], "componentcompileropaqu": [109, 138], "slint_interpreter_component_compiler_new": [109, 138], "slint_interpreter_component_compiler_destructor": [109, 138], "slint_interpreter_component_compiler_set_include_path": [109, 138], "slint_interpreter_component_compiler_set_styl": [109, 138], "slint_interpreter_component_compiler_get_styl": [109, 138], "slint_interpreter_component_compiler_set_translation_domain": [109, 138], "slint_interpreter_component_compiler_get_include_path": [109, 138], "slint_interpreter_component_compiler_get_diagnost": [109, 138], "slint_interpreter_component_compiler_build_from_sourc": [109, 138], "slint_interpreter_component_compiler_build_from_path": [109, 138], "send_keyboard_string_sequ": [109, 125, 136], "__apple__": [110, 112], "_win32": [110, 112, 116], "_win64": [110, 112, 116], "__objc__": 110, "typedef": [110, 165, 166], "objc_object": 110, "rendererptr": [110, 140], "renderer_handl": 110, "was_initi": 110, "slint_window_adapter_new": [110, 140], "intsiz": [110, 135, 136, 140], "p": [110, 112, 120, 127, 140, 149, 151], "point2d": [110, 120, 136, 140], "int32_t": [110, 120, 121, 130, 135, 136, 140, 141, 142, 151], "out": [110, 131, 136, 138, 139, 140, 141, 144, 145, 159, 229, 231, 232, 234, 235, 237], "slint_window_properties_get_titl": [110, 140], "slint_window_properties_get_background": [110, 140], "renam": [110, 118], "slint_window_properties_get_fullscreen": [110, 140], "slint_window_properties_get_minim": [110, 140], "slint_window_properties_get_maxim": [110, 140], "lc": 110, "slint_window_properties_get_layout_constraint": [110, 140], "has_min": [110, 140], "has_max": [110, 140], "abort": [110, 112, 125, 127, 133], "platformtaskopaqu": [110, 140], "_0": [110, 112, 113, 121, 127, 128, 135, 136, 138, 139, 140, 141], "slint_platform_task_drop": [110, 140], "assert": 110, "form": [110, 229, 239], "slint_platform_task_run": [110, 140], "slint_platform_regist": [110, 140], "w": [110, 112], "maybe_unus": [110, 112], "uint64_t": [110, 112, 121, 125, 126, 130, 135, 136, 138, 140, 141, 146], "out_text": 110, "maybe_clipboard": 110, "uint16_t": [110, 135, 136, 140, 167, 234], "g": [110, 134, 154, 155, 167, 227], "6": [110, 135, 138, 142, 167, 227], "constexpr": [110, 111, 112, 123, 125, 132, 136, 142, 144, 150, 152, 167, 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, 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], "4": [110, 112, 135, 136, 138, 142, 237], "mutabl": [110, 112, 121], "softwarerendereropaqu": [110, 140], "slint_software_renderer_handl": [110, 140], "intrect": [110, 135, 136, 140], "slint_software_renderer_region_to_rect": [110, 140], "__cpp_lib_rang": 110, "202110l": 110, "dr20": 110, "p2415r2": 110, "owning_view": 110, "view_interfac": 110, "slint_software_renderer_drop": [110, 140], "slint_software_renderer_new": [110, 140], "slint_software_renderer_render_rgb8": [110, 140], "slint_software_renderer_render_rgb565": [110, 140], "slint_software_renderer_render_by_line_rgb565": [110, 140], "process_line_callback_ptr": 110, "line_start": 110, "line_end": 110, "render_fn_data": 110, "line_span": 110, "270": [110, 142], "slint_software_renderer_set_rendering_rot": [110, 140], "cpprawhandleopaqu": [110, 140], "slint_raw_window_handle_drop": [110, 140], "slint_new_raw_window_handle_x11_xcb": [110, 140], "slint_new_raw_window_handle_x11_xlib": [110, 140], "slint_new_raw_window_handle_wayland": [110, 140], "slint_new_raw_window_handle_appkit": [110, 140], "slint_new_raw_window_handle_win32": [110, 140], "skiarendereropaqu": [110, 140], "slint_skia_renderer_handl": [110, 140], "slint_skia_renderer_drop": [110, 140], "slint_skia_renderer_new": [110, 140], "slint_skia_renderer_rend": [110, 140], "slint_platform_update_timers_and_anim": [110, 140], "val": [110, 136, 138, 141], "slint_platform_duration_until_next_timer_upd": [110, 140], "numeric_limit": [110, 112], "slint_testing_init_backend": [111, 145], "is_constructible_v": 111, "is_default_constructible_v": 111, "is_void_v": [111, 112], "slint_testing_element_visit_el": [111, 145], "visitorandresult": 111, "visitor_and_result": 111, "user_data": [111, 114, 121, 127, 136, 138, 140, 141, 145, 146], "label_view": 111, "slint_testing_element_find_by_accessible_label": [111, 145], "element_id_view": 111, "slint_testing_element_find_by_element_id": [111, 145], "element_type_name_view": 111, "slint_testing_element_find_by_element_type_nam": [111, 145], "upgrade_item_weak": [111, 112], "slint_testing_element_id": [111, 145], "slint_testing_element_type_nam": [111, 145], "slint_testing_element_bas": [111, 145], "element_index": [111, 145], "item_tre": [111, 112, 136], "borrow": [111, 148], "get_accessible_string_properti": 111, "accessiblestringproperti": [111, 136], "placeholdertext": [111, 136], "valuemaximum": [111, 136], "slint_string_to_float": [111, 140], "valueminimum": [111, 136], "valuestep": [111, 136], "setvaluehelp": 111, "accessibilityact": [111, 136], "set_valu": [111, 136], "setvalue_bodi": [111, 136], "tag": [111, 112, 113, 117, 119, 127, 128, 135, 136, 139], "setvalu": [111, 136], "accessibility_act": [111, 136], "increaseactionhelp": 111, "decreaseactionhelp": 111, "defaultactionhelp": 111, "item_geometri": [111, 136], "logicalrect": [111, 136], "logicalpoint": [111, 136], "ab": 111, "slint_item_absolute_posit": [111, 136], "accessible_string_properti": [111, 136], "__gnuc__": [112, 116], "__clang__": 112, "17": [112, 142, 165, 166], "condition": 112, "care": [112, 228], "gcc": 112, "ignor": [112, 126, 133], "winvalid": 112, "offsetof": 112, "mutex": 112, "condition_vari": 112, "bring": 112, "structur": [112, 153, 160, 164, 165, 228], "scope": [112, 229, 239], "itemtreeref": [112, 136], "indexrang": [112, 136], "itemref": 112, "itemvt": [112, 136, 142], "itemvisitorrefmut": 112, "itemvisitorvt": [112, 136], "itemtreenod": [112, 136], "itemarrayentri": 112, "voffset": [112, 136], "allowpin": [112, 136], "itemarrai": [112, 127], "make_item_nod": 112, "child_count": 112, "child_index": 112, "parent_index": [112, 136], "item_array_index": [112, 136], "is_access": [112, 136], "item_bodi": [112, 136], "make_dyn_nod": 112, "offset": 112, "dynamictree_bodi": [112, 136], "dynamictre": [112, 136], "get_item_ref": [112, 136], "item_tree_arrai": [112, 136], "item_arrai": [112, 136], "convert_anonymous_rect": 112, "alphabet": [112, 240], "dealloc": [112, 135, 136], "__cpp_sized_dealloc": 112, "align_val_t": 112, "align": [112, 136, 143, 234, 238], "elif": [112, 116], "mac_os_x_version_min_requir": 112, "mac_os_x_version_10_14": 112, "drop_in_plac": [112, 135, 136], "sizeof": [112, 122, 144, 234], "alignof": [112, 122], "cross": [112, 235, 236], "dll": [112, 231], "reloc": 112, "doc": 112, "microsoft": 112, "en": 112, "rule": 112, "dllimport": [112, 116], "dllexport": 112, "msvc": [112, 227], "160": [112, 142], "address": 112, "seek": 112, "That": [112, 231], "resolv": 112, "stub": 112, "librari": [112, 159, 227, 228, 231, 232, 235, 238], "slint_get_item_vt": 112, "vtablenam": 112, "slint_get_": [112, 136, 142], "itemrc": [112, 127, 136], "itemweak": [112, 136, 145], "item_weak": 112, "item_tree_strong": 112, "debug": [112, 237], "slint_debug": [112, 140], "vweak": [112, 136], "layoutinfo": [112, 136], "merg": [112, 136], "duplic": [112, 142], "max_perc": [112, 136], "min_perc": [112, 136], "stretch": [112, 133, 136], "easingcurv": [112, 136], "cubicbezi": [112, 136], "cubic_bezi": [112, 136], "register_item_tre": 112, "maybe_window": 112, "window_ptr": 112, "slint_register_item_tre": [112, 136], "solve_box_layout": 112, "boxlayoutdata": [112, 136], "repeater_index": [112, 136], "ri": 112, "slint_solve_box_layout": [112, 136], "solve_grid_layout": 112, "gridlayoutdata": [112, 136], "slint_solve_grid_layout": [112, 136], "grid_layout_info": 112, "gridlayoutcelldata": [112, 136], "cell": [112, 136], "pad": [112, 122, 136], "slint_grid_layout_info": [112, 136], "box_layout_info": 112, "boxlayoutcelldata": [112, 136], "layoutalign": [112, 133, 136, 142], "slint_box_layout_info": [112, 136], "box_layout_info_ortho": 112, "slint_box_layout_info_ortho": [112, 136], "layout_cache_access": 112, "idx": 112, "modelp": 112, "weak_ptr": 112, "access_array_index": 112, "row_data_track": 112, "model_length": 112, "track_row_count_chang": 112, "cerr": [112, 125, 127], "endl": [112, 125, 127], "peer": 112, "model_row_count_dirty_properti": 112, "track_row_data_chang": 112, "lower_bound": 112, "tracked_row": 112, "model_row_data_dirty_properti": 112, "binary_search": 112, "mark_dirti": [112, 121], "for_each_p": 112, "remove_if": 112, "pp": 112, "arraymodel": 112, "our": [112, 229, 231, 232, 237, 238], "uintmodel": 112, "d": [112, 121, 136, 231], "target_model": 112, "filtered_rows_dirti": 112, "added_accepted_row": 112, "insertion_point": 112, "accepted_row": 112, "existing_row": 112, "existing_row_index": 112, "distanc": [112, 122], "is_contain": 112, "accepted_updated_row": 112, "mapped_row_start": 112, "mapped_row_end": 112, "mapped_removed_len": 112, "mapped_removed_index": 112, "update_map": 112, "source_data": 112, "first_inserted_row": 112, "sorted_rows_dirti": 112, "adjust": [112, 234, 238], "indic": 112, "sorted_row": 112, "inserted_valu": 112, "sorted_elem": 112, "changed_row": 112, "removed_row_it": 112, "removed_row": 112, "changed_valu": 112, "inserted_row": 112, "first_removed_row": 112, "ensure_sort": 112, "lhs_index": 112, "rhs_index": 112, "lhs_elem": 112, "rhs_elem": 112, "old_row_count": 112, "repeaterinn": 112, "clean": 112, "repeatedinstancewithst": 112, "is_dirti": [112, 121], "update_data": 112, "set_model_bind": 112, "bind": [112, 114, 121, 136, 141, 232], "set_bind": [112, 121], "ensure_upd": 112, "tracker": 112, "ensure_updated_listview": 112, "viewport_width": [112, 136], "viewport_height": [112, 136], "viewport_i": [112, 136], "listview_width": 112, "listview_height": 112, "todo": 112, "try": 112, "alloc": [112, 233, 234], "compute_layout_listview": 112, "traversalord": [112, 136], "backtofront": [112, 136], "ref": 112, "item_at": 112, "visit_children_item": [112, 136], "static_vt": [112, 127], "instance_at": 112, "index_rang": 112, "listview_layout": 112, "model_set_row_data": 112, "plural": [112, 136], "slint_transl": [112, 136], "slint_translations_mark_dirti": [112, 136], "flickabl": [112, 136], "slint_flickable_data_init": [112, 136], "slint_flickable_data_fre": [112, 136], "nativestylemetr": [112, 142], "slint_native_style_metrics_init": [112, 142], "slint_native_style_metrics_deinit": [112, 142], "nativepalett": [112, 142], "slint_native_palette_init": [112, 142], "slint_native_palette_deinit": [112, 142], "mismatch": 112, "versioncheckhelp": 112, "slint_run_event_loop": [112, 140], "slint_quit_event_loop": [112, 140], "slint_post_ev": [112, 140], "mtx": 112, "cv": 112, "unique_lock": 112, "notify_on": 112, "wait": [112, 133], "clang": [112, 127], "format": [112, 127, 135, 136, 148, 158], "off": [112, 127, 227, 235], "gradientstop": [113, 115, 128], "firststop": 113, "stopcount": 113, "make_linear_gradi": 113, "fake": 113, "stopsbegin": 113, "stopsend": 113, "radialgradientbrush": [113, 128], "make_circle_gradi": 113, "lineargradi": [113, 128], "radialgradi": [113, 128], "nodiscard": [113, 115, 117], "solid_color": [113, 128], "break": [113, 128, 135, 139], "linear_gradi": [113, 128], "radial_gradi": [113, 128], "slint_color_bright": [113, 115, 131], "slint_color_dark": [113, 115, 131], "slint_color_transparent": [113, 115, 131], "slint_color_with_alpha": [113, 115, 131], "set_animated_valu": [113, 115, 121], "new_valu": [113, 115, 121], "propertyanim": [113, 115, 121, 136, 141], "animation_data": [113, 115, 121, 136, 141], "slint_property_set_animated_value_brush": [113, 136, 141], "ret": [114, 115, 136, 141], "slint_callback_init": [114, 136, 141], "slint_callback_drop": [114, 136, 141], "set_handl": 114, "slint_callback_set_handl": [114, 136, 141], "slint_callback_cal": [114, 136, 141], "callbackopaqu": [114, 136, 141], "0x1": 114, "callbacksignaturehelp": 114, "callbackhelp": [114, 136, 142], "satur": [115, 147], "16": [115, 142, 227], "0xff": 115, "24": [115, 142], "slint_color_from_hsva": [115, 131], "slint_color_to_hsva": [115, 131], "cast": [115, 125], "argb": 115, "slint_color_mix": [115, 131], "slint_property_set_animated_value_color": [115, 136, 141], "uintptr_max": 116, "0xffffffff": 116, "slint_target_32": [116, 138], "0xffffffffffffffffu": 116, "slint_target_64": [116, 138], "_msc_ver": 116, "slint_dll_import": [116, 136, 142], "__declspec": 116, "__attribute__": 116, "m_width": 117, "m_height": 117, "m_data": 117, "cbegin": [117, 122, 157, 159], "cend": [117, 122, 157, 159], "borrowedopengltextureorigin": [117, 135, 148], "topleft": [117, 135, 148], "bottomleft": [117, 135, 148], "imageinner_non": [117, 135], "load_from_path": [117, 148], "file_path": [117, 148], "slint_image_load_from_path": [117, 135], "create_from_borrowed_gl_2d_rgba_textur": [117, 148], "texture_id": [117, 135, 148], "origin_priv": 117, "imageinner_borrowedopengltextur": [117, 135], "borrowedopengltextur": [117, 135], "imageinner_embeddedimag": [117, 135], "imagecachekei": [117, 135], "invalid": [117, 135, 148, 165, 166], "sharedimagebuff": [117, 135], "rgb8": [117, 135], "rgba8": [117, 135], "slint_image_s": [117, 135], "slint_image_path": [117, 135], "set_nine_slice_edg": [117, 148], "short": [117, 148], "bottom": [117, 133, 135, 148], "slint_image_set_nine_slice_edg": [117, 135], "to_rgb8": [117, 148], "slint_image_to_rgb8": [117, 135], "to_rgba8": [117, 148], "slint_image_to_rgba8": [117, 135], "to_rgba8_premultipli": [117, 148], "slint_image_to_rgba8_premultipli": [117, 135], "slint_image_compare_equ": [117, 135], "imageinn": [117, 135], "load_image_from_embedded_data": 117, "extens": [117, 232, 237, 238], "slint_image_load_from_embedded_data": [117, 135], "image_from_embedded_textur": 117, "statictextur": [117, 135], "textur": [117, 135, 148], "slint_image_from_embedded_textur": [117, 135], "pathev": [119, 133, 139], "patharcto": [119, 139], "pathcubicto": [119, 139], "pathel": [119, 139], "pathlineto": [119, 139], "pathmoveto": [119, 139], "pathquadraticto": [119, 139], "pathdata": [119, 136, 139], "firstel": 119, "elements_from_arrai": 119, "firstev": 119, "event_count": [119, 139], "firstcoordin": 119, "coordinate_count": [119, 139], "events_from_arrai": 119, "command": [119, 139, 227, 231, 232, 233, 234, 235, 237, 238, 239], "tmp": 119, "slint_new_path_el": [119, 139], "slint_new_path_ev": [119, 139], "euclid": [120, 123], "crate": [120, 123], "binari": [120, 123, 228, 231, 234, 238], "compat": [120, 123], "changetrack": [121, 136, 141], "stateinfo": [121, 130], "slint_property_set_animated_binding_help": 121, "propertyhandleopaqu": [121, 136, 141], "drop_user_data": [121, 136, 138, 140, 141, 146], "transition_data": [121, 136, 141], "slint_property_set_animated_binding_int": [121, 136, 141], "slint_property_set_animated_binding_float": [121, 136, 141], "slint_property_set_animated_binding_color": [121, 136, 141], "slint_property_set_animated_binding_brush": [121, 136, 141], "slint_property_init": [121, 136, 141], "slint_property_drop": [121, 136, 141], "implicit": [121, 158, 159], "0b10": 121, "slint_property_set_chang": [121, 136, 141], "slint_property_upd": [121, 136, 141], "slint_property_set_bind": [121, 136, 141], "set_animated_bind": 121, "tran": 121, "set_animated_binding_for_transit": 121, "userdata": 121, "instant": 121, "slint_property_is_dirti": [121, 136, 141], "slint_property_mark_dirti": [121, 136, 141], "link_two_wai": 121, "p1": 121, "p2": 121, "common_properti": 121, "twowaybind": 121, "del_fn": 121, "call_fn": 121, "intercept_fn": 121, "intercept_binding_fn": 121, "slint_property_set_binding_intern": [121, 136, 141], "set_state_bind": 121, "slint_property_set_animated_value_int": [121, 136, 141], "slint_property_set_animated_value_float": [121, 136, 141], "slint_property_set_state_bind": [121, 136, 141], "propertytrack": 121, "slint_property_tracker_init": [121, 136, 141], "slint_property_tracker_drop": [121, 136, 141], "slint_property_tracker_is_dirti": [121, 136, 141], "is_same_v": 121, "slint_property_tracker_evalu": [121, 136, 141], "evaluate_as_dependency_root": 121, "slint_property_tracker_evaluate_as_dependency_root": [121, 136, 141], "propertytrackeropaqu": [121, 136, 141], "slint_change_tracker_construct": [121, 136, 141], "slint_change_tracker_drop": [121, 136, 141], "fneval": 121, "fnnotifi": 121, "fn_eval": 121, "fn_notifi": 121, "data_ptr": 121, "slint_change_tracker_init": [121, 136, 141], "sharedvectorhead": 122, "slint_shared_vector_empti": [122, 136, 143], "with_capac": 122, "new_data": 122, "input_it": 122, "inputit": [122, 159], "uninitialized_copi": 122, "capac": [122, 159], "refcount": 122, "detach": 122, "expected_capac": 122, "new_arrai": 122, "old_data": 122, "slint_shared_vector_fre": [122, 136, 143], "mem": 122, "slint_shared_vector_alloc": [122, 136, 143], "unfortun": 122, "cbindgen": [122, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "understood": 122, "intptr_t": [122, 136], "static_assert": 122, "size2d": [123, 135, 136], "slint_shared_string_from_byt": [124, 136, 144], "char8_t": [124, 158], "u8string_view": [124, 132, 158, 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, 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], "slint_shared_string_clon": [124, 136, 144], "slint_shared_string_drop": [124, 136, 144], "slint_shared_string_byt": [124, 136, 144], "starts_with": [124, 158], "prefix": [124, 158, 165, 166, 227], "substr": 124, "ends_with": [124, 158], "self_view": 124, "compar": [124, 125, 153, 157, 159, 160, 165, 166], "npo": 124, "from_numb": [124, 158], "shared_str": [124, 158], "a2": 124, "slint_shared_string_append": [124, 136, 144], "slint_shared_string_from_numb": [124, 136, 144], "mock_elapsed_tim": 125, "int64_t": [125, 240], "time_in_m": [125, 136], "slint_mock_elapsed_tim": [125, 136], "get_mocked_tim": 125, "slint_get_mocked_tim": [125, 136], "send_mouse_click": 125, "slint_send_mouse_click": [125, 136], "send_keyboard_char": 125, "slint_send_keyboard_char": [125, 136], "assert_eq_impl": 125, "__file__": 125, "__line__": 125, "equality_comparable_with": 125, "a_str": 125, "b_str": 125, "nok": 125, "is_integral_v": 125, "common": [125, 229, 231, 239], "sign": [125, 228, 240], "common_type_t": 125, "is_floating_point_v": 125, "depsilon": 125, "000001": 125, "small": 125, "fab": 125, "fail": 125, "cspell": 126, "singleshot": [126, 146], "timermod": [126, 146, 162], "interv": [126, 162], "slint_timer_start": [126, 146], "slint_timer_destroi": [126, 146], "slint_timer_stop": [126, 146], "restart": [126, 162], "slint_timer_restart": [126, 146], "slint_timer_run": [126, 146], "slint_timer_interv": [126, 136, 146], "single_shot": [126, 162], "slint_timer_singleshot": [126, 146], "ndebug": 127, "main_thread_id": 127, "this_thread": 127, "get_id": 127, "most": [127, 148, 227, 235], "itemtreerc": [127, 136, 145], "adopted_inn": 127, "slint_windowrc_clon": [127, 136], "slint_windowrc_init": [127, 140], "slint_windowrc_drop": [127, 136], "slint_windowrc_show": [127, 136], "slint_windowrc_hid": [127, 136], "slint_windowrc_is_vis": [127, 136], "slint_windowrc_get_scale_factor": [127, 136], "set_scale_factor": 127, "slint_windowrc_set_scale_factor": [127, 136], "colorschem": [127, 133, 136, 142], "color_schem": [127, 142], "slint_windowrc_color_schem": [127, 136], "text_input_focus": 127, "slint_windowrc_get_text_input_focus": [127, 136], "set_text_input_focus": 127, "slint_windowrc_set_text_input_focus": [127, 136], "unregister_item_tre": 127, "slint_unregister_item_tre": [127, 136], "set_focus_item": 127, "component_rc": 127, "item_index": [127, 136], "set_focu": [127, 136], "item_rc": 127, "slint_windowrc_set_focus_item": [127, 136], "set_compon": 127, "itemtreeweak": [127, 136], "item_tree_rc": [127, 136], "slint_windowrc_set_compon": [127, 136], "posgett": 127, "show_popup": 127, "parent_compon": 127, "close_on_click": [127, 136], "parent_item": [127, 136], "popup": [127, 136], "popup_dyn": 127, "slint_windowrc_show_popup": [127, 136], "close_popup": 127, "slint_windowrc_close_popup": [127, 136], "graphics_api": [127, 136], "err": 127, "slint_windowrc_set_rendering_notifi": [127, 136], "slint_windowrc_on_close_request": [127, 136], "slint_windowrc_request_redraw": [127, 136], "slint_windowrc_posit": [127, 136], "set_logical_posit": 127, "slint_windowrc_set_logical_posit": [127, 136], "set_physical_posit": 127, "slint_windowrc_set_physical_posit": [127, 136], "slint_windowrc_s": [127, 136], "set_logical_s": 127, "slint_windowrc_set_logical_s": [127, 136], "set_physical_s": 127, "slint_windowrc_set_physical_s": [127, 136], "dispatch_pointer_ev": 127, "mouseev": [127, 136], "slint_windowrc_dispatch_pointer_ev": [127, 136], "register_font_from_path": 127, "maybe_err": 127, "slint_register_font_from_path": [127, 140], "register_font_from_data": 127, "slint_register_font_from_data": [127, 140], "register_bitmap_font": 127, "bitmapfont": [127, 136, 140], "font": [127, 228, 234, 235, 238, 240], "slint_register_bitmap_font": [127, 140], "default_font_s": [127, 136, 142], "slint_windowrc_default_font_s": [127, 136], "windowrc": 127, "slint_windowrc_is_fullscreen": [127, 136], "slint_windowrc_set_fullscreen": [127, 136], "slint_windowrc_is_maxim": [127, 136], "slint_windowrc_set_maxim": [127, 136], "slint_windowrc_is_minim": [127, 136], "slint_windowrc_set_minim": [127, 136], "slint_windowrc_dispatch_key_ev": [127, 136], "keyeventtyp": [127, 130, 136], "keypress": [127, 136], "keyreleas": [127, 136], "pressed_bodi": [127, 136], "click_count": [127, 136], "released_bodi": [127, 136], "moved_bodi": [127, 136], "wheel_bodi": [127, 136], "windowev": [127, 136], "resized_bodi": [127, 136], "slint_windowrc_dispatch_ev": [127, 136], "scale_factor_chang": [127, 136], "scalefactorchanged_bodi": [127, 136], "scalefactorchang": [127, 136], "window_active_chang": [127, 136], "windowactivechanged_bodi": [127, 136], "windowactivechang": [127, 136], "closerequest": [127, 136], "slint_windowrc_has_active_anim": [127, 140], "26": [128, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "solidcolor_bodi": 128, "lineargradient_bodi": 128, "radialgradient_bodi": 128, "issolidcolor": 128, "islineargradi": 128, "isradialgradi": 128, "xtask": [129, 130, 132, 133], "keyboardmodifi": 130, "pointerev": [130, 136], "pointereventkind": [130, 133], "modifi": [130, 238], "pointerscrollev": [130, 136], "keyev": [130, 136], "event_typ": [130, 136], "replacement_rang": 130, "preedit_text": [130, 136], "preedit_select": [130, 136], "cursor_posit": 130, "anchor_posit": 130, "tablecolumn": [130, 142], "min_width": 130, "horizontal_stretch": 130, "sortord": [130, 133], "sort_ord": 130, "current_st": 130, "previous_st": 130, "change_tim": 130, "fontmetr": [130, 136], "ascent": [130, 136], "descent": [130, 136], "x_height": [130, 136], "cap_height": [130, 136], "col1": 131, "col2": 131, "u0008": [132, 194], "u0009": [132, 221], "u000a": [132, 211], "u001b": [132, 216], "u0019": [132, 213], "u007f": [132, 224], "u0010": [132, 225], "u0011": [132, 208], "u0012": [132, 186], "u0013": [132, 185], "u0014": [132, 175], "u0015": [132, 223], "u0016": [132, 210], "u0017": [132, 197], "u0018": [132, 179], "u0020": [132, 176], "uf700": [132, 200], "uf701": [132, 184], "uf702": [132, 178], "uf703": [132, 215], "uf704": [132, 174], "uf705": [132, 202], "uf706": [132, 207], "uf707": [132, 181], "uf708": [132, 195], "uf709": [132, 196], "uf70a": [132, 212], "uf70b": [132, 203], "uf70c": [132, 198], "uf70d": [132, 201], "uf70": [132, 206], "uf70f": [132, 182], "uf710": [132, 191], "uf711": [132, 193], "uf712": [132, 192], "uf713": [132, 209], "uf714": [132, 219], "uf715": [132, 204], "uf716": [132, 189], "uf717": [132, 199], "uf718": [132, 218], "uf719": [132, 226], "uf71a": [132, 187], "uf71b": [132, 173], "uf727": [132, 183], "uf729": [132, 214], "uf72b": [132, 222], "uf72c": [132, 220], "uf72d": [132, 205], "uf72f": [132, 190], "uf730": [132, 180], "uf731": [132, 217], "uf734": [132, 188], "uf735": [132, 177], "texthorizontalalign": [133, 136], "textverticalalign": [133, 136], "textwrap": [133, 136], "nowrap": 133, "wordwrap": 133, "charwrap": 133, "textoverflow": [133, 136], "clip": [133, 136], "elid": 133, "textstrokestyl": [133, 136], "outsid": 133, "eventresult": [133, 136], "fillrul": [133, 136], "nonzero": 133, "evenodd": 133, "standardbuttonkind": [133, 142], "cancel": [133, 136], "help": [133, 227, 239], "ye": 133, "retri": 133, "dialogbuttonrol": [133, 136], "mousecursor": [133, 136], "progress": [133, 142], "crosshair": 133, "nodrop": 133, "notallow": 133, "grab": [133, 136], "colres": 133, "rowres": 133, "nresiz": 133, "eres": 133, "sresiz": 133, "wresiz": 133, "neres": 133, "nwresiz": 133, "seres": 133, "swresiz": 133, "ewres": 133, "nsresiz": 133, "neswres": 133, "nwseres": 133, "imagefit": [133, 136], "cover": [133, 231], "preserv": 133, "imagehorizontalalign": [133, 136], "imageverticalalign": [133, 136], "imagerend": [133, 136], "smooth": 133, "imagetil": [133, 136], "round": 133, "inputtyp": [133, 136, 142], "password": 133, "decim": 133, "spacebetween": 133, "spacearound": 133, "quadrat": 133, "cubic": 133, "endopen": 133, "endclos": 133, "unsort": 133, "ascend": 133, "descend": 133, "orient": [133, 136, 142, 238], "horizont": [133, 234, 238], "vertic": [133, 148], "unknown": [133, 227], "dark": 133, "light": 133, "animationdirect": [133, 136], "altern": [133, 227, 234], "alternaterevers": 133, "scrollbarpolici": [133, 142], "asneed": 133, "alwaysoff": 133, "alwayson": 133, "9": [134, 142, 148], "parsedsvg": 135, "htmlimag": 135, "ninesliceimag": 135, "pixelformat": 135, "rgba": [135, 148, 155], "rgbapremultipli": 135, "alphamap": 135, "cachedpath": 135, "last_modifi": 135, "slint_target_wasm": [135, 139], "url": [135, 228], "embeddeddata": 135, "path_bodi": 135, "url_bodi": 135, "embeddeddata_bodi": 135, "embedded_data": 135, "isinvalid": 135, "ispath": 135, "isurl": 135, "isembeddeddata": 135, "rgba8premultipli": 135, "rgb8_bodi": 135, "rgba8_bodi": 135, "rgba8premultiplied_bodi": 135, "rgba8_premultipli": 135, "isrgb8": 135, "isrgba8": 135, "isrgba8premultipli": 135, "opaqueimagevt": 135, "cache_kei": 135, "original_s": 135, "imageinner_svg": 135, "imageinner_statictextur": 135, "imageinner_htmlimag": 135, "imageinner_backendstorag": 135, "imageinner_nineslic": 135, "7": [135, 142], "imageinner_embeddedimage_bodi": 135, "imageinner_svg_bodi": 135, "imageinner_statictextures_bodi": 135, "imageinner_htmlimage_bodi": 135, "imageinner_backendstorage_bodi": 135, "imageinner_borrowedopengltexture_bodi": 135, "imageinner_nineslice_bodi": 135, "embedded_imag": 135, "svg": 135, "static_textur": 135, "html_imag": 135, "backend_storag": 135, "borrowed_open_gl_textur": 135, "nine_slic": 135, "isimageinner_non": 135, "isimageinner_embeddedimag": 135, "isimageinner_svg": 135, "isimageinner_statictextur": 135, "isimageinner_htmlimag": 135, "isimageinner_backendstorag": 135, "isimageinner_borrowedopengltextur": 135, "isimageinner_nineslic": 135, "image1": 135, "image2": 135, "logicallength": [136, 142], "physical_region_max_s": 136, "delegatefocu": 136, "focusev": 136, "focusin": 136, "focusout": 136, "windowreceivedfocu": 136, "windowlostfocu": 136, "focuseventresult": 136, "focusaccept": 136, "focusignor": 136, "inputeventresult": 136, "eventaccept": 136, "eventignor": 136, "grabmous": 136, "keyeventresult": 136, "updatecomposit": 136, "commitcomposit": 136, "renderingresult": 136, "continuerenderingchildren": 136, "continuerenderingwithoutchildren": 136, "fronttoback": 136, "undoitemkind": 136, "textinsert": 136, "textremov": 136, "flickabledata": 136, "itemrendererref": 136, "physicalpx": 136, "visitchildrenresult": 136, "visitchildrenresult_continu": 136, "uint64_max": 136, "inputeventfilterresult": 136, "forwardev": 136, "forwardandignor": 136, "forwardandinterceptgrab": 136, "intercept": 136, "delayforward": 136, "delayforwarding_bodi": 136, "delay_forward": 136, "pin": [136, 142], "my_item": 136, "cached_rendering_data_offset": 136, "layout_info": 136, "window_adapt": [136, 142], "input_event_filter_before_children": 136, "self_rc": 136, "input_ev": 136, "focus_ev": 136, "key_ev": 136, "visit_item": 136, "children_count": 136, "children_index": 136, "dynamic_tre": 136, "replaceselectedtext": 136, "replaceselectedtext_bodi": 136, "replace_selected_text": 136, "supportedaccessibilityact": 136, "supportedaccessibilityaction_default": 136, "supportedaccessibilityaction_decr": 136, "supportedaccessibilityaction_incr": 136, "supportedaccessibilityaction_replaceselectedtext": 136, "supportedaccessibilityaction_setvalu": 136, "get_subtree_rang": 136, "get_subtre": 136, "subindex": 136, "get_item_tre": 136, "parent_nod": 136, "embed_compon": 136, "parent_item_tree_index": 136, "subtree_index": 136, "supported_accessibility_act": 136, "item_element_info": 136, "do_creat": 136, "_1": [136, 139, 140, 141], "itemtreerefpin": 136, "flickabledatabox": 136, "preeditselect": 136, "cachedrenderingdata": [136, 142], "cache_index": 136, "cache_gener": 136, "undoitem": 136, "cursor": 136, "anchor": 136, "font_famili": 136, "font_siz": 136, "font_weight": 136, "font_ital": 136, "selection_foreground_color": 136, "selection_background_color": 136, "horizontal_align": 136, "vertical_align": 136, "wrap": [136, 229, 239], "input_typ": [136, 142], "letter_spac": 136, "cursor_position_byte_offset": 136, "anchor_position_byte_offset": 136, "text_cursor_width": [136, 142], "cursor_vis": 136, "has_focu": [136, 142], "cursor_position_chang": 136, "single_lin": 136, "read_onli": 136, "cached_rendering_data": [136, 142], "preferred_x_po": 136, "undo_item": 136, "redo_item": 136, "col_or_row": 136, "easeinelast": 136, "easeoutelast": 136, "easeinoutelast": 136, "easeinbounc": 136, "easeoutbounc": 136, "easeinoutbounc": 136, "cubicbezier_bodi": 136, "delai": [136, 146], "iteration_count": 136, "eas": 136, "pointerpress": 136, "pointerreleas": 136, "pointermov": 136, "pointerscrol": 136, "pointerexit": 136, "keypressrep": 136, "pointerpressed_bodi": 136, "pointerreleased_bodi": 136, "pointermoved_bodi": 136, "pointerscrolled_bodi": 136, "keypressed_bodi": 136, "keypressrepeated_bodi": 136, "keyreleased_bodi": 136, "pointer_press": 136, "pointer_releas": 136, "pointer_mov": 136, "pointer_scrol": 136, "key_press": 136, "key_press_rep": 136, "key_releas": 136, "destructor": [136, 162, 229], "thankfulli": 136, "charactermapentri": 136, "code_point": 136, "glyph_index": 136, "bitmapglyph": 136, "int16_t": 136, "x_advanc": 136, "pixel_s": 136, "glyph_data": 136, "family_nam": 136, "character_map": 136, "units_per_em": 136, "glyph": [136, 228], "weight": 136, "ital": 136, "box2d": 136, "basicborderrectangl": 136, "border_width": 136, "border_radiu": 136, "border_color": 136, "borderrectangl": 136, "border_top_left_radiu": 136, "border_top_right_radiu": 136, "border_bottom_left_radiu": 136, "border_bottom_right_radiu": 136, "imageitem": 136, "image_fit": 136, "image_rend": 136, "clippedimag": 136, "source_clip_x": 136, "source_clip_i": 136, "source_clip_width": 136, "source_clip_height": 136, "horizontal_til": 136, "vertical_til": 136, "toucharea": 136, "has_hov": [136, 142], "pressed_x": [136, 142], "pressed_i": [136, 142], "mouse_x": 136, "mouse_i": 136, "mouse_cursor": 136, "click": [136, 142, 227], "double_click": 136, "pointer_ev": 136, "scroll_ev": 136, "focusscop": 136, "focus_changed_ev": 136, "swipegesturehandl": 136, "handle_swipe_left": 136, "handle_swipe_right": 136, "handle_swipe_up": 136, "handle_swipe_down": 136, "swipe": 136, "pressed_posit": 136, "current_posit": 136, "viewport_x": 136, "flick": 136, "simpletext": 136, "complextext": 136, "overflow": [136, 234], "stroke": 136, "stroke_width": 136, "stroke_styl": 136, "fill_rul": 136, "viewbox_x": 136, "viewbox_i": 136, "viewbox_width": 136, "viewbox_height": 136, "windowitem": 136, "no_fram": 136, "resize_border_width": 136, "always_on_top": 136, "icon": [136, 142], "default_font_famili": 136, "default_font_weight": 136, "boxshadow": 136, "offset_x": 136, "offset_i": 136, "blur": 136, "rotation_angl": 136, "rotation_origin_x": 136, "rotation_origin_i": 136, "cache_rendering_hint": 136, "sig": [136, 141], "slint_date_time_use_24_hour_format": 136, "slint_date_time_month_day_count": 136, "month": 136, "year": 136, "slint_date_time_month_offset": 136, "slint_date_time_format_d": 136, "dai": 136, "slint_date_time_date_now": 136, "slint_date_time_parse_d": 136, "date": 136, "slint_visit_item_tre": 136, "visit_dynam": 136, "dyn_index": 136, "self_compon": 136, "self_index": 136, "slint_textinput_set_selection_offset": 136, "text_input": 136, "slint_textinput_select_al": 136, "slint_textinput_clear_select": 136, "slint_textinput_cut": 136, "slint_textinput_copi": 136, "slint_textinput_past": 136, "slint_cpp_text_item_fontmetr": 136, "slint_reorder_dialog_button_layout": 136, "pointer_to_valu": [136, 141], "intercept_set": [136, 141], "intercept_set_bind": [136, 141], "new_bind": [136, 141], "start_inst": [136, 141], "ct": [136, 141], "eval_fn": [136, 141], "notify_fn": [136, 141], "slint_animation_tick": [136, 141], "ss": [136, 144], "byte": [136, 144, 158, 233], "self_": [136, 142, 144], "sequenc": 136, "to_transl": 136, "target": [136, 140, 148, 227, 228, 231, 234, 235, 236, 238], "focus_item": 136, "rendering_st": 136, "slint_decl_item": [136, 142], "itemnam": [136, 142], "undef": [136, 142], "source_fil": [137, 163], "column": [137, 163], "property_nam": [137, 138, 164, 229], "property_typ": [137, 164], "12": [138, 142], "dynamiccomponentvrc": 138, "double_": 138, "stru": [138, 165, 166], "inst": 138, "def": 138, "component_definition_ptr": 138, "translation_domain": 138, "style_out": 138, "out_diag": 138, "radius_x": 139, "radius_i": 139, "x_rotat": 139, "large_arc": 139, "sweep": 139, "control_1_x": 139, "control_1_i": 139, "control_2_x": 139, "control_2_i": 139, "control_x": 139, "control_i": 139, "moveto": 139, "lineto": 139, "arcto": 139, "cubicto": 139, "quadraticto": 139, "moveto_bodi": 139, "lineto_bodi": 139, "arcto_bodi": 139, "cubicto_bodi": 139, "quadraticto_bodi": 139, "move_to": 139, "line_to": 139, "arc_to": 139, "cubic_to": 139, "quadratic_to": 139, "ismoveto": 139, "islineto": 139, "isarcto": 139, "iscubicto": 139, "isquadraticto": 139, "isclos": 139, "elements_bodi": 139, "events_bodi": 139, "commands_bodi": 139, "isnon": 139, "isel": 139, "isev": 139, "iscommand": 139, "first_el": 139, "out_ev": 139, "out_coordin": 139, "first_ev": 139, "first_coordin": 139, "layoutconstraintsreprc": 140, "windowadapteruserdata": 140, "_a": 140, "_b": 140, "platformuserdata": 140, "slint_ensure_backend": 140, "quit_on_last_window_clos": 140, "win": 140, "error_str": 140, "font_data": 140, "wp": 140, "get_renderer_ref": 140, "window_factori": 140, "buffer_ag": 140, "buffer_len": 140, "process_line_fn": 140, "_hinstanc": 140, "ns_view": 140, "_ns_window": 140, "handle_opaqu": 140, "malloc": 140, "propertyhandl": 141, "dep_nod": 141, "hack": 142, "alert": 142, "qt_widget": 142, "sync": 142, "slinttypeerasedwidget": 142, "slinttypeerasedwidgetptr": 142, "layout_spac": 142, "layout_pad": 142, "window_background": 142, "default_text_color": 142, "textedit_background": 142, "textedit_text_color": 142, "textedit_background_dis": 142, "textedit_text_color_dis": 142, "placeholder_color": 142, "placeholder_color_dis": 142, "dark_color_schem": 142, "tab_bar_align": 142, "style_change_listen": 142, "foreground": 142, "alternate_background": 142, "alternate_foreground": 142, "accent_background": 142, "accent_foreground": 142, "control_background": 142, "control_foreground": 142, "selection_background": 142, "selection_foreground": 142, "border": 142, "qstyle_standardpixmap": 142, "qaccessible_ev": 142, "qaccessible_rol": 142, "qaccessible_text": 142, "qt_keyboardmodifi": 142, "qt_alignmentflag": 142, "qt_textflag": 142, "qt_kei": 142, "qt_cursorshap": 142, "qt_fillrul": 142, "nativebutton": 142, "colorize_icon": 142, "standard_button_kind": 142, "is_standard_button": 142, "widget_ptr": 142, "animation_track": 142, "nativespinboxdata": 142, "active_control": 142, "nativespinbox": 142, "step_siz": 142, "nativecheckbox": 142, "toggl": [142, 227], "nativesliderdata": 142, "pressed_v": 142, "nativeslid": 142, "nativeprogressind": 142, "indetermin": 142, "nativegroupbox": 142, "native_padding_left": 142, "native_padding_right": 142, "native_padding_top": 142, "native_padding_bottom": 142, "nativelineedit": 142, "nativescrollview": 142, "horizontal_max": 142, "horizontal_page_s": 142, "horizontal_valu": 142, "vertical_max": 142, "vertical_page_s": 142, "vertical_valu": 142, "vertical_bar_polici": 142, "horizontal_bar_polici": 142, "nativestandardlistviewitem": 142, "is_select": 142, "nativetableheadersect": 142, "nativecombobox": 142, "is_open": 142, "current_valu": 142, "nativecomboboxpopup": 142, "nativetabwidget": 142, "content_min_height": 142, "content_min_width": 142, "tabbar_preferred_height": 142, "tabbar_preferred_width": 142, "current_index": 142, "current_focus": 142, "content_x": 142, "content_i": 142, "content_height": 142, "content_width": 142, "tabbar_x": 142, "tabbar_i": 142, "tabbar_height": 142, "tabbar_width": 142, "nativetab": 142, "tab_index": 142, "num_tab": 142, "qstyle_standardpixmap_sp_titlebarmenubutton": 142, "qstyle_standardpixmap_sp_titlebarminbutton": 142, "qstyle_standardpixmap_sp_titlebarmaxbutton": 142, "qstyle_standardpixmap_sp_titlebarclosebutton": 142, "qstyle_standardpixmap_sp_titlebarnormalbutton": 142, "qstyle_standardpixmap_sp_titlebarshadebutton": 142, "qstyle_standardpixmap_sp_titlebarunshadebutton": 142, "qstyle_standardpixmap_sp_titlebarcontexthelpbutton": 142, "qstyle_standardpixmap_sp_dockwidgetclosebutton": 142, "qstyle_standardpixmap_sp_messageboxinform": 142, "qstyle_standardpixmap_sp_messageboxwarn": 142, "10": 142, "qstyle_standardpixmap_sp_messageboxcrit": 142, "11": 142, "qstyle_standardpixmap_sp_messageboxquest": 142, "qstyle_standardpixmap_sp_desktopicon": 142, "13": 142, "qstyle_standardpixmap_sp_trashicon": 142, "14": 142, "qstyle_standardpixmap_sp_computericon": 142, "15": 142, "qstyle_standardpixmap_sp_drivefdicon": 142, "qstyle_standardpixmap_sp_drivehdicon": 142, "qstyle_standardpixmap_sp_drivecdicon": 142, "18": 142, "qstyle_standardpixmap_sp_drivedvdicon": 142, "19": 142, "qstyle_standardpixmap_sp_driveneticon": 142, "qstyle_standardpixmap_sp_diropenicon": 142, "21": [142, 227, 231, 235, 237], "qstyle_standardpixmap_sp_dirclosedicon": 142, "22": 142, "qstyle_standardpixmap_sp_dirlinkicon": 142, "23": 142, "qstyle_standardpixmap_sp_dirlinkopenicon": 142, "qstyle_standardpixmap_sp_fileicon": 142, "25": 142, "qstyle_standardpixmap_sp_filelinkicon": 142, "qstyle_standardpixmap_sp_toolbarhorizontalextensionbutton": 142, "27": 142, "qstyle_standardpixmap_sp_toolbarverticalextensionbutton": 142, "28": 142, "qstyle_standardpixmap_sp_filedialogstart": 142, "29": 142, "qstyle_standardpixmap_sp_filedialogend": 142, "qstyle_standardpixmap_sp_filedialogtopar": 142, "31": 142, "qstyle_standardpixmap_sp_filedialognewfold": 142, "32": 142, "qstyle_standardpixmap_sp_filedialogdetailedview": 142, "33": 142, "qstyle_standardpixmap_sp_filedialoginfoview": 142, "34": 142, "qstyle_standardpixmap_sp_filedialogcontentsview": 142, "35": 142, "qstyle_standardpixmap_sp_filedialoglistview": 142, "36": 142, "qstyle_standardpixmap_sp_filedialogback": 142, "37": 142, "qstyle_standardpixmap_sp_diricon": 142, "38": 142, "qstyle_standardpixmap_sp_dialogokbutton": 142, "39": 142, "qstyle_standardpixmap_sp_dialogcancelbutton": 142, "40": 142, "qstyle_standardpixmap_sp_dialoghelpbutton": 142, "41": 142, "qstyle_standardpixmap_sp_dialogopenbutton": 142, "qstyle_standardpixmap_sp_dialogsavebutton": 142, "43": 142, "qstyle_standardpixmap_sp_dialogclosebutton": 142, "44": 142, "qstyle_standardpixmap_sp_dialogapplybutton": 142, "45": 142, "qstyle_standardpixmap_sp_dialogresetbutton": 142, "46": 142, "qstyle_standardpixmap_sp_dialogdiscardbutton": 142, "47": 142, "qstyle_standardpixmap_sp_dialogyesbutton": 142, "48": 142, "qstyle_standardpixmap_sp_dialognobutton": 142, "49": 142, "qstyle_standardpixmap_sp_arrowup": 142, "qstyle_standardpixmap_sp_arrowdown": 142, "51": 142, "qstyle_standardpixmap_sp_arrowleft": 142, "52": 142, "qstyle_standardpixmap_sp_arrowright": 142, "53": 142, "qstyle_standardpixmap_sp_arrowback": 142, "54": 142, "qstyle_standardpixmap_sp_arrowforward": 142, "55": 142, "qstyle_standardpixmap_sp_dirhomeicon": 142, "56": 142, "qstyle_standardpixmap_sp_commandlink": 142, "57": 142, "qstyle_standardpixmap_sp_vistashield": 142, "58": 142, "qstyle_standardpixmap_sp_browserreload": 142, "59": 142, "qstyle_standardpixmap_sp_browserstop": 142, "60": 142, "qstyle_standardpixmap_sp_mediaplai": 142, "61": 142, "qstyle_standardpixmap_sp_mediastop": 142, "62": 142, "qstyle_standardpixmap_sp_mediapaus": 142, "63": 142, "qstyle_standardpixmap_sp_mediaskipforward": 142, "64": [142, 227, 240], "qstyle_standardpixmap_sp_mediaskipbackward": 142, "65": 142, "qstyle_standardpixmap_sp_mediaseekforward": 142, "66": 142, "qstyle_standardpixmap_sp_mediaseekbackward": 142, "67": 142, "qstyle_standardpixmap_sp_mediavolum": 142, "68": 142, "qstyle_standardpixmap_sp_mediavolumemut": 142, "69": 142, "qstyle_standardpixmap_sp_lineeditclearbutton": 142, "70": 142, "qstyle_standardpixmap_sp_dialogyestoallbutton": 142, "71": 142, "qstyle_standardpixmap_sp_dialognotoallbutton": 142, "72": 142, "qstyle_standardpixmap_sp_dialogsaveallbutton": 142, "73": 142, "qstyle_standardpixmap_sp_dialogabortbutton": 142, "74": 142, "qstyle_standardpixmap_sp_dialogretrybutton": 142, "75": 142, "qstyle_standardpixmap_sp_dialogignorebutton": 142, "76": 142, "qstyle_standardpixmap_sp_restoredefaultsbutton": 142, "77": [142, 227, 235], "qstyle_standardpixmap_sp_custombas": 142, "4026531840": 142, "qaccessible_event_soundplai": 142, "qaccessible_event_alert": 142, "qaccessible_event_foregroundchang": 142, "qaccessible_event_menustart": 142, "qaccessible_event_menuend": 142, "qaccessible_event_popupmenustart": 142, "qaccessible_event_popupmenuend": 142, "qaccessible_event_contexthelpstart": 142, "qaccessible_event_contexthelpend": 142, "qaccessible_event_dragdropstart": 142, "qaccessible_event_dragdropend": 142, "qaccessible_event_dialogstart": 142, "qaccessible_event_dialogend": 142, "qaccessible_event_scrollingstart": 142, "qaccessible_event_scrollingend": 142, "qaccessible_event_menucommand": 142, "qaccessible_event_actionchang": 142, "257": 142, "qaccessible_event_activedescendantchang": 142, "258": 142, "qaccessible_event_attributechang": 142, "259": 142, "qaccessible_event_documentcontentchang": 142, "260": 142, "qaccessible_event_documentloadcomplet": 142, "261": 142, "qaccessible_event_documentloadstop": 142, "262": 142, "qaccessible_event_documentreload": 142, "263": 142, "qaccessible_event_hyperlinkendindexchang": 142, "264": 142, "qaccessible_event_hyperlinknumberofanchorschang": 142, "265": 142, "qaccessible_event_hyperlinkselectedlinkchang": 142, "266": 142, "qaccessible_event_hypertextlinkactiv": 142, "267": 142, "qaccessible_event_hypertextlinkselect": 142, "268": 142, "qaccessible_event_hyperlinkstartindexchang": 142, "269": 142, "qaccessible_event_hypertextchang": 142, "qaccessible_event_hypertextnlinkschang": 142, "271": 142, "qaccessible_event_objectattributechang": 142, "272": 142, "qaccessible_event_pagechang": 142, "273": 142, "qaccessible_event_sectionchang": 142, "274": 142, "qaccessible_event_tablecaptionchang": 142, "275": 142, "qaccessible_event_tablecolumndescriptionchang": 142, "276": 142, "qaccessible_event_tablecolumnheaderchang": 142, "277": 142, "qaccessible_event_tablemodelchang": 142, "278": 142, "qaccessible_event_tablerowdescriptionchang": 142, "279": 142, "qaccessible_event_tablerowheaderchang": 142, "280": 142, "qaccessible_event_tablesummarychang": 142, "281": 142, "qaccessible_event_textattributechang": 142, "282": 142, "qaccessible_event_textcaretmov": 142, "283": 142, "qaccessible_event_textcolumnchang": 142, "285": 142, "qaccessible_event_textinsert": 142, "286": 142, "qaccessible_event_textremov": 142, "287": 142, "qaccessible_event_textupd": 142, "288": 142, "qaccessible_event_textselectionchang": 142, "289": 142, "qaccessible_event_visibledatachang": 142, "290": 142, "qaccessible_event_objectcr": 142, "32768": 142, "qaccessible_event_objectdestroi": 142, "32769": 142, "qaccessible_event_objectshow": 142, "32770": 142, "qaccessible_event_objecthid": 142, "32771": 142, "qaccessible_event_objectreord": 142, "32772": 142, "qaccessible_event_focu": 142, "32773": 142, "qaccessible_event_select": 142, "32774": 142, "qaccessible_event_selectionadd": 142, "32775": 142, "qaccessible_event_selectionremov": 142, "32776": 142, "qaccessible_event_selectionwithin": 142, "32777": 142, "qaccessible_event_statechang": 142, "32778": 142, "qaccessible_event_locationchang": 142, "32779": 142, "qaccessible_event_namechang": 142, "32780": 142, "qaccessible_event_descriptionchang": 142, "32781": 142, "qaccessible_event_valuechang": 142, "32782": 142, "qaccessible_event_parentchang": 142, "32783": 142, "qaccessible_event_helpchang": 142, "32928": 142, "qaccessible_event_defaultactionchang": 142, "32944": 142, "qaccessible_event_acceleratorchang": 142, "32960": 142, "qaccessible_event_invalidev": 142, "32961": 142, "qaccessible_role_norol": 142, "qaccessible_role_titlebar": 142, "qaccessible_role_menubar": 142, "qaccessible_role_scrollbar": 142, "qaccessible_role_grip": 142, "qaccessible_role_sound": 142, "qaccessible_role_cursor": 142, "qaccessible_role_caret": 142, "qaccessible_role_alertmessag": 142, "qaccessible_role_window": 142, "qaccessible_role_cli": 142, "qaccessible_role_popupmenu": 142, "qaccessible_role_menuitem": 142, "qaccessible_role_tooltip": 142, "qaccessible_role_appl": 142, "qaccessible_role_docu": 142, "qaccessible_role_pan": 142, "qaccessible_role_chart": 142, "qaccessible_role_dialog": 142, "qaccessible_role_bord": 142, "qaccessible_role_group": 142, "qaccessible_role_separ": 142, "qaccessible_role_toolbar": 142, "qaccessible_role_statusbar": 142, "qaccessible_role_t": 142, "qaccessible_role_columnhead": 142, "qaccessible_role_rowhead": 142, "qaccessible_role_column": 142, "qaccessible_role_row": 142, "qaccessible_role_cel": 142, "qaccessible_role_link": 142, "qaccessible_role_helpballoon": 142, "qaccessible_role_assist": 142, "qaccessible_role_list": 142, "qaccessible_role_listitem": 142, "qaccessible_role_tre": 142, "qaccessible_role_treeitem": 142, "qaccessible_role_pagetab": 142, "qaccessible_role_propertypag": 142, "qaccessible_role_ind": 142, "qaccessible_role_graph": 142, "qaccessible_role_statictext": 142, "qaccessible_role_editabletext": 142, "qaccessible_role_button": 142, "qaccessible_role_pushbutton": 142, "qaccessible_role_checkbox": 142, "qaccessible_role_radiobutton": 142, "qaccessible_role_combobox": 142, "qaccessible_role_progressbar": 142, "qaccessible_role_di": 142, "qaccessible_role_hotkeyfield": 142, "qaccessible_role_slid": 142, "qaccessible_role_spinbox": 142, "qaccessible_role_canva": 142, "qaccessible_role_anim": 142, "qaccessible_role_equ": 142, "qaccessible_role_buttondropdown": 142, "qaccessible_role_buttonmenu": 142, "qaccessible_role_buttondropgrid": 142, "qaccessible_role_whitespac": 142, "qaccessible_role_pagetablist": 142, "qaccessible_role_clock": 142, "qaccessible_role_splitt": 142, "qaccessible_role_layeredpan": 142, "128": 142, "qaccessible_role_termin": 142, "129": 142, "qaccessible_role_desktop": 142, "130": 142, "qaccessible_role_paragraph": 142, "131": 142, "qaccessible_role_webdocu": 142, "132": 142, "qaccessible_role_sect": 142, "133": 142, "qaccessible_role_notif": 142, "134": 142, "qaccessible_role_colorchoos": 142, "1028": 142, "qaccessible_role_foot": 142, "1038": 142, "qaccessible_role_form": 142, "1040": 142, "qaccessible_role_head": 142, "1044": 142, "qaccessible_role_not": 142, "1051": 142, "qaccessible_role_complementarycont": 142, "1068": 142, "qaccessible_role_userrol": 142, "65535": 142, "qaccessible_text_nam": 142, "qaccessible_text_descript": 142, "qaccessible_text_valu": 142, "qaccessible_text_help": 142, "qaccessible_text_acceler": 142, "qaccessible_text_debugdescript": 142, "qaccessible_text_usertext": 142, "qt_keyboardmodifier_nomodifi": 142, "qt_keyboardmodifier_shiftmodifi": 142, "33554432": 142, "qt_keyboardmodifier_controlmodifi": 142, "67108864": 142, "qt_keyboardmodifier_altmodifi": 142, "134217728": 142, "qt_keyboardmodifier_metamodifi": 142, "268435456": 142, "qt_keyboardmodifier_keypadmodifi": 142, "536870912": 142, "qt_keyboardmodifier_groupswitchmodifi": 142, "1073741824": 142, "qt_keyboardmodifier_keyboardmodifiermask": 142, "4261412864": 142, "qt_alignmentflag_alignleft": 142, "qt_alignmentflag_alignlead": 142, "qt_alignmentflag_alignright": 142, "qt_alignmentflag_aligntrail": 142, "qt_alignmentflag_alignhcent": 142, "qt_alignmentflag_alignjustifi": 142, "qt_alignmentflag_alignabsolut": 142, "qt_alignmentflag_alignhorizontal_mask": 142, "qt_alignmentflag_aligntop": 142, "qt_alignmentflag_alignbottom": 142, "qt_alignmentflag_alignvcent": 142, "qt_alignmentflag_alignbaselin": 142, "256": 142, "qt_alignmentflag_alignvertical_mask": 142, "480": 142, "qt_alignmentflag_aligncent": 142, "qt_textflag_textsinglelin": 142, "qt_textflag_textdontclip": 142, "512": 142, "qt_textflag_textexpandtab": 142, "1024": 142, "qt_textflag_textshowmnemon": 142, "2048": 142, "qt_textflag_textwordwrap": 142, "4096": 142, "qt_textflag_textwrapanywher": 142, "8192": [142, 234], "qt_textflag_textdontprint": 142, "16384": 142, "qt_textflag_textincludetrailingspac": 142, "qt_textflag_texthidemnemon": 142, "qt_textflag_textjustificationforc": 142, "65536": 142, "qt_textflag_textforcelefttoright": 142, "131072": 142, "qt_textflag_textforcerighttoleft": 142, "262144": 142, "qt_textflag_textlongestvari": 142, "524288": 142, "qt_textflag_textbypassshap": 142, "1048576": 142, "qt_key_key_escap": 142, "16777216": 142, "qt_key_key_tab": 142, "16777217": 142, "qt_key_key_backtab": 142, "16777218": 142, "qt_key_key_backspac": 142, "16777219": 142, "qt_key_key_return": 142, "16777220": 142, "qt_key_key_ent": 142, "16777221": 142, "qt_key_key_insert": 142, "16777222": 142, "qt_key_key_delet": 142, "16777223": 142, "qt_key_key_paus": 142, "16777224": 142, "qt_key_key_print": 142, "16777225": 142, "qt_key_key_sysreq": 142, "16777226": 142, "qt_key_key_clear": 142, "16777227": 142, "qt_key_key_hom": 142, "16777232": 142, "qt_key_key_end": 142, "16777233": 142, "qt_key_key_left": 142, "16777234": 142, "qt_key_key_up": 142, "16777235": 142, "qt_key_key_right": 142, "16777236": 142, "qt_key_key_down": 142, "16777237": 142, "qt_key_key_pageup": 142, "16777238": 142, "qt_key_key_pagedown": 142, "16777239": 142, "qt_key_key_shift": 142, "16777248": 142, "qt_key_key_control": 142, "16777249": 142, "qt_key_key_meta": 142, "16777250": 142, "qt_key_key_alt": 142, "16777251": 142, "qt_key_key_capslock": 142, "16777252": 142, "qt_key_key_numlock": 142, "16777253": 142, "qt_key_key_scrolllock": 142, "16777254": 142, "qt_key_key_f1": 142, "16777264": 142, "qt_key_key_f2": 142, "16777265": 142, "qt_key_key_f3": 142, "16777266": 142, "qt_key_key_f4": 142, "16777267": 142, "qt_key_key_f5": 142, "16777268": 142, "qt_key_key_f6": 142, "16777269": 142, "qt_key_key_f7": 142, "16777270": 142, "qt_key_key_f8": 142, "16777271": 142, "qt_key_key_f9": 142, "16777272": 142, "qt_key_key_f10": 142, "16777273": 142, "qt_key_key_f11": 142, "16777274": 142, "qt_key_key_f12": 142, "16777275": 142, "qt_key_key_f13": 142, "16777276": 142, "qt_key_key_f14": 142, "16777277": 142, "qt_key_key_f15": 142, "16777278": 142, "qt_key_key_f16": 142, "16777279": 142, "qt_key_key_f17": 142, "16777280": 142, "qt_key_key_f18": 142, "16777281": 142, "qt_key_key_f19": 142, "16777282": 142, "qt_key_key_f20": 142, "16777283": 142, "qt_key_key_f21": 142, "16777284": 142, "qt_key_key_f22": 142, "16777285": 142, "qt_key_key_f23": 142, "16777286": 142, "qt_key_key_f24": 142, "16777287": 142, "qt_key_key_f25": 142, "16777288": 142, "qt_key_key_f26": 142, "16777289": 142, "qt_key_key_f27": 142, "16777290": 142, "qt_key_key_f28": 142, "16777291": 142, "qt_key_key_f29": 142, "16777292": 142, "qt_key_key_f30": 142, "16777293": 142, "qt_key_key_f31": 142, "16777294": 142, "qt_key_key_f32": 142, "16777295": 142, "qt_key_key_f33": 142, "16777296": 142, "qt_key_key_f34": 142, "16777297": 142, "qt_key_key_f35": 142, "16777298": 142, "qt_key_key_super_l": 142, "16777299": 142, "qt_key_key_super_r": 142, "16777300": 142, "qt_key_key_menu": 142, "16777301": 142, "qt_key_key_hyper_l": 142, "16777302": 142, "qt_key_key_hyper_r": 142, "16777303": 142, "qt_key_key_help": 142, "16777304": 142, "qt_key_key_direction_l": 142, "16777305": 142, "qt_key_key_direction_r": 142, "16777312": 142, "qt_key_key_spac": 142, "qt_key_key_ani": 142, "qt_key_key_exclam": 142, "qt_key_key_quotedbl": 142, "qt_key_key_numbersign": 142, "qt_key_key_dollar": 142, "qt_key_key_perc": 142, "qt_key_key_ampersand": 142, "qt_key_key_apostroph": 142, "qt_key_key_parenleft": 142, "qt_key_key_parenright": 142, "qt_key_key_asterisk": 142, "qt_key_key_plu": 142, "qt_key_key_comma": 142, "qt_key_key_minu": 142, "qt_key_key_period": 142, "qt_key_key_slash": 142, "qt_key_key_0": 142, "qt_key_key_1": 142, "qt_key_key_2": 142, "qt_key_key_3": 142, "qt_key_key_4": 142, "qt_key_key_5": 142, "qt_key_key_6": 142, "qt_key_key_7": 142, "qt_key_key_8": 142, "qt_key_key_9": 142, "qt_key_key_colon": 142, "qt_key_key_semicolon": 142, "qt_key_key_less": 142, "qt_key_key_equ": 142, "qt_key_key_great": 142, "qt_key_key_quest": 142, "qt_key_key_at": 142, "qt_key_key_a": 142, "qt_key_key_b": 142, "qt_key_key_c": 142, "qt_key_key_d": 142, "qt_key_key_": 142, "qt_key_key_f": 142, "qt_key_key_g": 142, "qt_key_key_h": 142, "qt_key_key_i": 142, "qt_key_key_j": 142, "qt_key_key_k": 142, "qt_key_key_l": 142, "qt_key_key_m": 142, "qt_key_key_n": 142, "78": 142, "qt_key_key_o": 142, "79": 142, "qt_key_key_p": 142, "80": 142, "qt_key_key_q": 142, "81": 142, "qt_key_key_r": 142, "82": 142, "83": 142, "qt_key_key_t": 142, "84": 142, "qt_key_key_u": 142, "85": 142, "qt_key_key_v": 142, "86": 142, "qt_key_key_w": 142, "87": 142, "qt_key_key_x": 142, "88": 142, "89": 142, "qt_key_key_z": 142, "qt_key_key_bracketleft": 142, "91": 142, "qt_key_key_backslash": 142, "92": 142, "qt_key_key_bracketright": 142, "93": 142, "qt_key_key_asciicircum": 142, "94": 142, "qt_key_key_underscor": 142, "95": 142, "qt_key_key_quoteleft": 142, "96": 142, "qt_key_key_braceleft": 142, "123": 142, "qt_key_key_bar": 142, "124": 142, "qt_key_key_braceright": 142, "125": 142, "qt_key_key_asciitild": 142, "126": 142, "qt_key_key_nobreakspac": 142, "qt_key_key_exclamdown": 142, "161": 142, "162": 142, "qt_key_key_sterl": 142, "163": 142, "qt_key_key_curr": 142, "164": 142, "qt_key_key_yen": 142, "165": 142, "qt_key_key_brokenbar": 142, "166": 142, "qt_key_key_sect": 142, "167": 142, "qt_key_key_diaeresi": 142, "168": 142, "qt_key_key_copyright": 142, "169": 142, "qt_key_key_ordfeminin": 142, "170": 142, "qt_key_key_guillemotleft": 142, "171": 142, "qt_key_key_notsign": 142, "172": 142, "qt_key_key_hyphen": 142, "173": 142, "qt_key_key_regist": 142, "174": 142, "qt_key_key_macron": 142, "175": 142, "qt_key_key_degre": 142, "176": 142, "qt_key_key_plusminu": 142, "177": 142, "qt_key_key_twosuperior": 142, "178": 142, "qt_key_key_threesuperior": 142, "179": 142, "qt_key_key_acut": 142, "qt_key_key_mu": 142, "181": 142, "qt_key_key_paragraph": 142, "182": 142, "qt_key_key_periodcent": 142, "183": 142, "qt_key_key_cedilla": 142, "184": 142, "qt_key_key_onesuperior": 142, "185": 142, "qt_key_key_masculin": 142, "186": 142, "qt_key_key_guillemotright": 142, "187": 142, "qt_key_key_onequart": 142, "188": 142, "qt_key_key_onehalf": 142, "189": 142, "qt_key_key_threequart": 142, "190": 142, "qt_key_key_questiondown": 142, "191": 142, "qt_key_key_agrav": 142, "192": 142, "qt_key_key_aacut": 142, "193": 142, "qt_key_key_acircumflex": 142, "194": 142, "qt_key_key_atild": 142, "195": 142, "qt_key_key_adiaeresi": 142, "196": 142, "qt_key_key_ar": 142, "197": 142, "198": 142, "qt_key_key_ccedilla": 142, "199": 142, "qt_key_key_egrav": 142, "200": [142, 148], "qt_key_key_eacut": 142, "201": 142, "qt_key_key_ecircumflex": 142, "202": 142, "qt_key_key_ediaeresi": 142, "203": 142, "qt_key_key_igrav": 142, "204": 142, "qt_key_key_iacut": 142, "205": 142, "qt_key_key_icircumflex": 142, "206": 142, "qt_key_key_idiaeresi": 142, "207": 142, "qt_key_key_eth": 142, "208": 142, "qt_key_key_ntild": 142, "209": 142, "qt_key_key_ograv": 142, "210": 142, "qt_key_key_oacut": 142, "211": 142, "qt_key_key_ocircumflex": 142, "212": 142, "qt_key_key_otild": 142, "213": 142, "qt_key_key_odiaeresi": 142, "214": 142, "qt_key_key_multipli": 142, "215": 142, "qt_key_key_oobliqu": 142, "216": 142, "qt_key_key_ugrav": 142, "217": 142, "qt_key_key_uacut": 142, "218": 142, "qt_key_key_ucircumflex": 142, "219": 142, "qt_key_key_udiaeresi": 142, "220": 142, "qt_key_key_yacut": 142, "221": 142, "qt_key_key_thorn": 142, "222": 142, "qt_key_key_ssharp": 142, "223": 142, "qt_key_key_divis": 142, "247": 142, "qt_key_key_ydiaeresi": 142, "qt_key_key_altgr": 142, "16781571": 142, "qt_key_key_multi_kei": 142, "16781600": 142, "qt_key_key_codeinput": 142, "16781623": 142, "qt_key_key_singlecandid": 142, "16781628": 142, "qt_key_key_multiplecandid": 142, "16781629": 142, "qt_key_key_previouscandid": 142, "16781630": 142, "qt_key_key_mode_switch": 142, "16781694": 142, "qt_key_key_kanji": 142, "16781601": 142, "qt_key_key_muhenkan": 142, "16781602": 142, "qt_key_key_henkan": 142, "16781603": 142, "qt_key_key_romaji": 142, "16781604": 142, "qt_key_key_hiragana": 142, "16781605": 142, "qt_key_key_katakana": 142, "16781606": 142, "qt_key_key_hiragana_katakana": 142, "16781607": 142, "qt_key_key_zenkaku": 142, "16781608": 142, "qt_key_key_hankaku": 142, "16781609": 142, "qt_key_key_zenkaku_hankaku": 142, "16781610": 142, "qt_key_key_touroku": 142, "16781611": 142, "qt_key_key_massyo": 142, "16781612": 142, "qt_key_key_kana_lock": 142, "16781613": 142, "qt_key_key_kana_shift": 142, "16781614": 142, "qt_key_key_eisu_shift": 142, "16781615": 142, "qt_key_key_eisu_toggl": 142, "16781616": 142, "qt_key_key_hangul": 142, "16781617": 142, "qt_key_key_hangul_start": 142, "16781618": 142, "qt_key_key_hangul_end": 142, "16781619": 142, "qt_key_key_hangul_hanja": 142, "16781620": 142, "qt_key_key_hangul_jamo": 142, "16781621": 142, "qt_key_key_hangul_romaja": 142, "16781622": 142, "qt_key_key_hangul_jeonja": 142, "16781624": 142, "qt_key_key_hangul_banja": 142, "16781625": 142, "qt_key_key_hangul_prehanja": 142, "16781626": 142, "qt_key_key_hangul_posthanja": 142, "16781627": 142, "qt_key_key_hangul_speci": 142, "16781631": 142, "qt_key_key_dead_grav": 142, "16781904": 142, "qt_key_key_dead_acut": 142, "16781905": 142, "qt_key_key_dead_circumflex": 142, "16781906": 142, "qt_key_key_dead_tild": 142, "16781907": 142, "qt_key_key_dead_macron": 142, "16781908": 142, "qt_key_key_dead_brev": 142, "16781909": 142, "qt_key_key_dead_abovedot": 142, "16781910": 142, "qt_key_key_dead_diaeresi": 142, "16781911": 142, "qt_key_key_dead_abov": 142, "16781912": 142, "qt_key_key_dead_doubleacut": 142, "16781913": 142, "qt_key_key_dead_caron": 142, "16781914": 142, "qt_key_key_dead_cedilla": 142, "16781915": 142, "qt_key_key_dead_ogonek": 142, "16781916": 142, "qt_key_key_dead_iota": 142, "16781917": 142, "qt_key_key_dead_voiced_sound": 142, "16781918": 142, "qt_key_key_dead_semivoiced_sound": 142, "16781919": 142, "qt_key_key_dead_belowdot": 142, "16781920": 142, "qt_key_key_dead_hook": 142, "16781921": 142, "qt_key_key_dead_horn": 142, "16781922": 142, "qt_key_key_dead_strok": 142, "16781923": 142, "qt_key_key_dead_abovecomma": 142, "16781924": 142, "qt_key_key_dead_abovereversedcomma": 142, "16781925": 142, "qt_key_key_dead_doublegrav": 142, "16781926": 142, "qt_key_key_dead_belowr": 142, "16781927": 142, "qt_key_key_dead_belowmacron": 142, "16781928": 142, "qt_key_key_dead_belowcircumflex": 142, "16781929": 142, "qt_key_key_dead_belowtild": 142, "16781930": 142, "qt_key_key_dead_belowbrev": 142, "16781931": 142, "qt_key_key_dead_belowdiaeresi": 142, "16781932": 142, "qt_key_key_dead_invertedbrev": 142, "16781933": 142, "qt_key_key_dead_belowcomma": 142, "16781934": 142, "qt_key_key_dead_curr": 142, "16781935": 142, "qt_key_key_dead_a": 142, "16781952": 142, "16781953": 142, "qt_key_key_dead_": 142, "16781954": 142, "16781955": 142, "qt_key_key_dead_i": 142, "16781956": 142, "16781957": 142, "qt_key_key_dead_o": 142, "16781958": 142, "16781959": 142, "qt_key_key_dead_u": 142, "16781960": 142, "16781961": 142, "qt_key_key_dead_small_schwa": 142, "16781962": 142, "qt_key_key_dead_capital_schwa": 142, "16781963": 142, "qt_key_key_dead_greek": 142, "16781964": 142, "qt_key_key_dead_lowlin": 142, "16781968": 142, "qt_key_key_dead_aboveverticallin": 142, "16781969": 142, "qt_key_key_dead_belowverticallin": 142, "16781970": 142, "qt_key_key_dead_longsolidusoverlai": 142, "16781971": 142, "qt_key_key_back": 142, "16777313": 142, "qt_key_key_forward": 142, "16777314": 142, "qt_key_key_stop": 142, "16777315": 142, "qt_key_key_refresh": 142, "16777316": 142, "qt_key_key_volumedown": 142, "16777328": 142, "qt_key_key_volumemut": 142, "16777329": 142, "qt_key_key_volumeup": 142, "16777330": 142, "qt_key_key_bassboost": 142, "16777331": 142, "qt_key_key_bassup": 142, "16777332": 142, "qt_key_key_bassdown": 142, "16777333": 142, "qt_key_key_trebleup": 142, "16777334": 142, "qt_key_key_trebledown": 142, "16777335": 142, "qt_key_key_mediaplai": 142, "16777344": 142, "qt_key_key_mediastop": 142, "16777345": 142, "qt_key_key_mediaprevi": 142, "16777346": 142, "qt_key_key_medianext": 142, "16777347": 142, "qt_key_key_mediarecord": 142, "16777348": 142, "qt_key_key_mediapaus": 142, "16777349": 142, "qt_key_key_mediatoggleplaypaus": 142, "16777350": 142, "qt_key_key_homepag": 142, "16777360": 142, "qt_key_key_favorit": 142, "16777361": 142, "qt_key_key_search": 142, "16777362": 142, "qt_key_key_standbi": 142, "16777363": 142, "qt_key_key_openurl": 142, "16777364": 142, "qt_key_key_launchmail": 142, "16777376": 142, "qt_key_key_launchmedia": 142, "16777377": 142, "qt_key_key_launch0": 142, "16777378": 142, "qt_key_key_launch1": 142, "16777379": 142, "qt_key_key_launch2": 142, "16777380": 142, "qt_key_key_launch3": 142, "16777381": 142, "qt_key_key_launch4": 142, "16777382": 142, "qt_key_key_launch5": 142, "16777383": 142, "qt_key_key_launch6": 142, "16777384": 142, "qt_key_key_launch7": 142, "16777385": 142, "qt_key_key_launch8": 142, "16777386": 142, "qt_key_key_launch9": 142, "16777387": 142, "qt_key_key_launcha": 142, "16777388": 142, "qt_key_key_launchb": 142, "16777389": 142, "qt_key_key_launchc": 142, "16777390": 142, "qt_key_key_launchd": 142, "16777391": 142, "qt_key_key_launch": 142, "16777392": 142, "qt_key_key_launchf": 142, "16777393": 142, "qt_key_key_monbrightnessup": 142, "16777394": 142, "qt_key_key_monbrightnessdown": 142, "16777395": 142, "qt_key_key_keyboardlightonoff": 142, "16777396": 142, "qt_key_key_keyboardbrightnessup": 142, "16777397": 142, "qt_key_key_keyboardbrightnessdown": 142, "16777398": 142, "qt_key_key_poweroff": 142, "16777399": 142, "qt_key_key_wakeup": 142, "16777400": 142, "qt_key_key_eject": 142, "16777401": 142, "qt_key_key_screensav": 142, "16777402": 142, "qt_key_key_www": 142, "16777403": 142, "qt_key_key_memo": 142, "16777404": 142, "qt_key_key_lightbulb": 142, "16777405": 142, "qt_key_key_shop": 142, "16777406": 142, "qt_key_key_histori": 142, "16777407": 142, "qt_key_key_addfavorit": 142, "16777408": 142, "qt_key_key_hotlink": 142, "16777409": 142, "qt_key_key_brightnessadjust": 142, "16777410": 142, "qt_key_key_fin": 142, "16777411": 142, "qt_key_key_commun": 142, "16777412": 142, "qt_key_key_audiorewind": 142, "16777413": 142, "qt_key_key_backforward": 142, "16777414": 142, "qt_key_key_applicationleft": 142, "16777415": 142, "qt_key_key_applicationright": 142, "16777416": 142, "qt_key_key_book": 142, "16777417": 142, "qt_key_key_cd": 142, "16777418": 142, "qt_key_key_calcul": 142, "16777419": 142, "qt_key_key_todolist": 142, "16777420": 142, "qt_key_key_cleargrab": 142, "16777421": 142, "qt_key_key_clos": 142, "16777422": 142, "qt_key_key_copi": 142, "16777423": 142, "qt_key_key_cut": 142, "16777424": 142, "qt_key_key_displai": 142, "16777425": 142, "qt_key_key_do": 142, "16777426": 142, "qt_key_key_docu": 142, "16777427": 142, "qt_key_key_excel": 142, "16777428": 142, "qt_key_key_explor": 142, "16777429": 142, "qt_key_key_gam": 142, "16777430": 142, "qt_key_key_go": 142, "16777431": 142, "qt_key_key_itouch": 142, "16777432": 142, "qt_key_key_logoff": 142, "16777433": 142, "qt_key_key_market": 142, "16777434": 142, "qt_key_key_meet": 142, "16777435": 142, "qt_key_key_menukb": 142, "16777436": 142, "qt_key_key_menupb": 142, "16777437": 142, "qt_key_key_mysit": 142, "16777438": 142, "qt_key_key_new": 142, "16777439": 142, "qt_key_key_officehom": 142, "16777440": 142, "qt_key_key_opt": 142, "16777441": 142, "qt_key_key_past": 142, "16777442": 142, "qt_key_key_phon": 142, "16777443": 142, "qt_key_key_calendar": 142, "16777444": 142, "qt_key_key_repli": 142, "16777445": 142, "qt_key_key_reload": 142, "16777446": 142, "qt_key_key_rotatewindow": 142, "16777447": 142, "qt_key_key_rotationpb": 142, "16777448": 142, "qt_key_key_rotationkb": 142, "16777449": 142, "qt_key_key_sav": 142, "16777450": 142, "qt_key_key_send": 142, "16777451": 142, "qt_key_key_spel": 142, "16777452": 142, "qt_key_key_splitscreen": 142, "16777453": 142, "qt_key_key_support": 142, "16777454": 142, "qt_key_key_taskpan": 142, "16777455": 142, "qt_key_key_termin": 142, "16777456": 142, "qt_key_key_tool": 142, "16777457": 142, "qt_key_key_travel": 142, "16777458": 142, "qt_key_key_video": 142, "16777459": 142, "qt_key_key_word": 142, "16777460": 142, "qt_key_key_xf": 142, "16777461": 142, "qt_key_key_zoomin": 142, "16777462": 142, "qt_key_key_zoomout": 142, "16777463": 142, "qt_key_key_awai": 142, "16777464": 142, "qt_key_key_messeng": 142, "16777465": 142, "qt_key_key_webcam": 142, "16777466": 142, "qt_key_key_mailforward": 142, "16777467": 142, "qt_key_key_pictur": 142, "16777468": 142, "qt_key_key_mus": 142, "16777469": 142, "qt_key_key_batteri": 142, "16777470": 142, "qt_key_key_bluetooth": 142, "16777471": 142, "qt_key_key_wlan": 142, "16777472": 142, "qt_key_key_uwb": 142, "16777473": 142, "qt_key_key_audioforward": 142, "16777474": 142, "qt_key_key_audiorepeat": 142, "16777475": 142, "qt_key_key_audiorandomplai": 142, "16777476": 142, "qt_key_key_subtitl": 142, "16777477": 142, "qt_key_key_audiocycletrack": 142, "16777478": 142, "qt_key_key_tim": 142, "16777479": 142, "qt_key_key_hibern": 142, "16777480": 142, "qt_key_key_view": 142, "16777481": 142, "qt_key_key_topmenu": 142, "16777482": 142, "qt_key_key_powerdown": 142, "16777483": 142, "qt_key_key_suspend": 142, "16777484": 142, "qt_key_key_contrastadjust": 142, "16777485": 142, "qt_key_key_launchg": 142, "16777486": 142, "qt_key_key_launchh": 142, "16777487": 142, "qt_key_key_touchpadtoggl": 142, "16777488": 142, "qt_key_key_touchpadon": 142, "16777489": 142, "qt_key_key_touchpadoff": 142, "16777490": 142, "qt_key_key_micmut": 142, "16777491": 142, "16777492": 142, "qt_key_key_green": 142, "16777493": 142, "qt_key_key_yellow": 142, "16777494": 142, "qt_key_key_blu": 142, "16777495": 142, "qt_key_key_channelup": 142, "16777496": 142, "qt_key_key_channeldown": 142, "16777497": 142, "qt_key_key_guid": 142, "16777498": 142, "qt_key_key_info": 142, "16777499": 142, "qt_key_key_set": 142, "16777500": 142, "qt_key_key_micvolumeup": 142, "16777501": 142, "qt_key_key_micvolumedown": 142, "16777502": 142, "16777504": 142, "qt_key_key_open": 142, "16777505": 142, "qt_key_key_find": 142, "16777506": 142, "qt_key_key_undo": 142, "16777507": 142, "qt_key_key_redo": 142, "16777508": 142, "qt_key_key_medialast": 142, "16842751": 142, "qt_key_key_select": 142, "16842752": 142, "qt_key_key_y": 142, "16842753": 142, "qt_key_key_no": 142, "16842754": 142, "qt_key_key_cancel": 142, "16908289": 142, "16908290": 142, "qt_key_key_execut": 142, "16908291": 142, "qt_key_key_sleep": 142, "16908292": 142, "qt_key_key_plai": 142, "16908293": 142, "qt_key_key_zoom": 142, "16908294": 142, "qt_key_key_exit": 142, "16908298": 142, "qt_key_key_context1": 142, "17825792": 142, "qt_key_key_context2": 142, "17825793": 142, "qt_key_key_context3": 142, "17825794": 142, "qt_key_key_context4": 142, "17825795": 142, "qt_key_key_cal": 142, "17825796": 142, "qt_key_key_hangup": 142, "17825797": 142, "qt_key_key_flip": 142, "17825798": 142, "qt_key_key_togglecallhangup": 142, "17825799": 142, "qt_key_key_voicedi": 142, "17825800": 142, "qt_key_key_lastnumberredi": 142, "17825801": 142, "qt_key_key_camera": 142, "17825824": 142, "qt_key_key_camerafocu": 142, "17825825": 142, "qt_key_key_unknown": 142, "33554431": 142, "qt_cursorshape_arrowcursor": 142, "qt_cursorshape_uparrowcursor": 142, "qt_cursorshape_crosscursor": 142, "qt_cursorshape_waitcursor": 142, "qt_cursorshape_ibeamcursor": 142, "qt_cursorshape_sizevercursor": 142, "qt_cursorshape_sizehorcursor": 142, "qt_cursorshape_sizebdiagcursor": 142, "qt_cursorshape_sizefdiagcursor": 142, "qt_cursorshape_sizeallcursor": 142, "qt_cursorshape_blankcursor": 142, "qt_cursorshape_splitvcursor": 142, "qt_cursorshape_splithcursor": 142, "qt_cursorshape_pointinghandcursor": 142, "qt_cursorshape_forbiddencursor": 142, "qt_cursorshape_whatsthiscursor": 142, "qt_cursorshape_busycursor": 142, "qt_cursorshape_openhandcursor": 142, "qt_cursorshape_closedhandcursor": 142, "qt_cursorshape_dragcopycursor": 142, "qt_cursorshape_dragmovecursor": 142, "qt_cursorshape_draglinkcursor": 142, "qt_cursorshape_lastcursor": 142, "qt_cursorshape_bitmapcursor": 142, "qt_cursorshape_customcursor": 142, "qt_fillrule_oddevenfil": 142, "qt_fillrule_windingfil": 142, "degre": [147, 240], "disk": [148, 228], "effici": [148, 158, 227, 232, 235], "dimens": 148, "afterward": 148, "320x200": 148, "pixel_buff": 148, "320": 148, "low_level_rend": 148, "through": [148, 231, 232], "the_width": 148, "the_height": 148, "the_data": 148, "raw_data": 148, "bgr_data": 148, "flip": 148, "nine": 148, "edg": 148, "corner": 148, "distort": 148, "cut": 148, "remain": [148, 159, 228], "bindabl": 148, "gl_texture_2d": 148, "gl_rgba": 148, "safeti": 148, "unsaf": 148, "lead": 148, "undefin": 148, "driver": [148, 235, 238], "consequ": 148, "dimension": [153, 160], "precis": [156, 240], "thu": [156, 228], "cheap": [157, 159], "contigu": 157, "might": [157, 227, 228], "past": [157, 158, 159], "around": 158, "clone": 158, "hood": 158, "utf": [158, 240], "charact": 158, "raw": [158, 228], "suitabl": 158, "comparison": [158, 159], "scheme": 158, "fraction": 158, "str2": 158, "100": [158, 234], "lexicograph": 158, "less": [158, 239], "greater": [158, 228], "concaten": 158, "primarili": 159, "dereferenc": [159, 165, 166], "th": 159, "unaffect": 159, "standardlistview": 161, "standardtableview": 161, "singl": [162, 228], "shot": 162, "equival": 162, "fire": 162, "calcul": 162, "along": [163, 227], "simpl": [164, 231], "introduc": 165, "keyword": 165, "anonym": [165, 240], "notat": 165, "lst": 165, "field": [165, 166, 229, 233, 240], "sure": [165, 166, 227, 233, 235, 238], "retain": [165, 166], "syntax": [165, 166, 232], "go": [165, 166], "field_nam": [165, 166], "field_valu": [165, 166], "16bit": 167, "subdirectori": 172, "variabl": [172, 227, 228, 233, 234, 235], "mit": [227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "2019": 227, "newer": [227, 235, 237], "autom": [227, 235], "offer": [227, 235], "linkag": [227, 235], "recommend": [227, 235], "ninja": [227, 235], "track": [227, 233, 235], "gninja": [227, 235], "cmake_gener": [227, 235], "download": [227, 237, 238], "linux": [227, 234], "x86": 227, "architectur": 227, "flexibl": [227, 239], "open": [227, 234, 237, 238], "latest": [227, 231, 238], "asset": 227, "xxx": 227, "x86_64": 227, "tar": [227, 238], "gz": [227, 238], "win64": 227, "ex": 227, "unpack": 227, "archiv": [227, 237], "cmake_prefix_path": [227, 238], "dcmake_prefix_path": 227, "find_packag": [227, 231, 238], "cmakelist": [227, 231, 234, 238], "txt": [227, 231, 234, 238], "lib": 227, "ld_library_path": 227, "learn": [227, 231, 232, 234, 235, 237], "guid": [227, 231, 234, 235], "rustc": [227, 235], "cargo": [227, 232, 233, 235], "project": [227, 231, 233, 234, 237, 238], "fetchcont": [227, 231], "snippet": [227, 238], "fetchcontent_declar": [227, 231], "git_repositori": [227, 231], "git": [227, 231], "upgrad": [227, 231], "git_tag": [227, 231], "source_subdir": [227, 231], "fetchcontent_makeavail": [227, 231], "regular": 227, "choic": 227, "optim": [227, 228, 239], "stack": [227, 233, 234], "winit": 227, "slint_feature_": 227, "setup": 227, "dslint_feature_backend_winit": 227, "dslint_feature_backend_winit_wayland": 227, "gui": [227, 234], "ccmake": 227, "more": [227, 229, 231, 232, 234, 235, 237, 239], "discov": 227, "disabl": [227, 235], "slint_enabled_featur": 227, "slint_disabled_featur": 227, "get_target_properti": 227, "backend_winit": 227, "in_list": 227, "similarli": 227, "processor": [227, 235], "corros": 227, "certain": 227, "furthermor": 227, "slint_library_cargo_flag": 227, "encapsul": 227, "abstract": [227, 229, 239], "inform": [227, 239], "slint_feature_backend_": 227, "stabl": [227, 228, 233], "ones": 227, "readi": 227, "upstream": 227, "yocto": 227, "sdk": [227, 236], "suffici": 227, "pleas": 227, "consult": 227, "now": 227, "toolchain": [227, 233, 234, 235, 236], "rustup": 227, "iconfigur": 227, "drust_cargo_target": [227, 235], "arm64": 227, "board": [227, 234, 237, 238], "targ": 227, "aarch64": 227, "gnu": 227, "cortexa53": 227, "crypto": 227, "poki": 227, "cd": [227, 234], "project_root": 227, "mkdir": 227, "dcmake_install_prefix": 227, "library_path": 228, "name1": 228, "lib1": 228, "name2": 228, "lib2": 228, "compilation_unit": 228, "num": 228, "tell": 228, "builtin": 228, "target_sourc": 228, "build": [228, 229, 231, 232, 234, 235, 236, 237, 238], "extend": 228, "the_window": 228, "thewindow": 228, "output": 228, "mycomponentlib": 228, "redirect": 228, "add_execut": [228, 231], "my_appl": [228, 231], "target_link_librari": [228, 231, 238], "customcompon": 228, "inclus": 228, "busi": [228, 232], "compier": 228, "These": [228, 229], "parallel": 228, "overal": 228, "howev": [228, 239], "split": 228, "across": 228, "abil": 228, "perform": [228, 239], "minimis": 228, "anywher": 228, "emb": [228, 235, 238], "slint_embed_resourc": [228, 238], "default_slint_embed_resourc": 228, "devic": [228, 232, 234, 237, 240], "ratio": [228, 240], "px": 228, "phx": 228, "desir": 228, "slint_scale_factor": 228, "shall": 228, "combin": 228, "dialog": 229, "get_": 229, "setter": [229, 239], "set_": 229, "invoke_": 229, "callback_nam": 229, "on_": 229, "function_nam": 229, "smart": [229, 239], "aliv": [229, 239], "complex": [229, 239], "yourself": 229, "let": 229, "samplecompon": 229, "counter": 229, "dash": 229, "underscor": 229, "user_nam": 229, "mayb": 229, "here": [229, 232, 233], "mainwindow": 229, "get_count": 229, "set_count": 229, "get_user_nam": 229, "set_user_nam": 229, "invoke_hello": 229, "on_hello": 229, "callback_handl": 229, "invoke_do_someth": 229, "omit": 229, "togeth": 229, "on_to_uppercas": 229, "per": 229, "slint_target_sourc": [231, 234, 238, 239], "cmake_minimum_requir": 231, "cxx": [231, 238], "three": [231, 236], "packag": [231, 234], "approach": [231, 239], "add_custom_command": 231, "post_build": 231, "cmake_command": 231, "target_runtime_dl": 231, "target_file_dir": 231, "command_expand_list": 231, "helloworld": [231, 232], "400px": [231, 232], "my_label": 231, "200px": [231, 232], "hello_world": [231, 234], "set_my_label": 231, "depth": 231, "walk": 231, "game": 231, "Of": 231, "cours": 231, "recip": 231, "toolkit": 232, "fluid": 232, "desktop": 232, "power": 232, "placement": 232, "flow": 232, "familiar": 232, "hierarchi": 232, "obligatori": 232, "visual": [232, 237], "studio": [232, 237], "featur": 232, "highlight": 232, "live": 232, "quick": 232, "cycl": 232, "viewer": 232, "tool": [232, 237, 238], "instal": [232, 234, 235, 237, 238], "awar": 233, "solv": 233, "z": 233, "nightli": 233, "solut": 233, "rustup_toolchain": 233, "toml": 233, "One": 233, "reason": [233, 234], "enough": 233, "ram": [233, 234, 238], "heap": 233, "big": 233, "8kib": 233, "invert": 233, "incompat": 233, "rgb565": 233, "littl": 233, "endian": 233, "esp32": [233, 234], "often": 233, "esp_lcd": 233, "accordingli": 233, "therefor": 233, "color_swap_16": [233, 234], "slintplatformconfigur": [233, 234, 238], "compiler_builtin": 233, "4c2482f45199cb1e": 233, "cgu": 233, "05": 233, "__udivdi3": 233, "0x0": 233, "libgcc": 233, "_udivdi3": 233, "o": 233, "wl": 233, "linker": 233, "target_link_opt": 233, "component_lib": [233, 234], "s3": 234, "prompt": 234, "instruct": [234, 235, 237], "maco": 234, "fall": 234, "io": 234, "book": 234, "html": 234, "soc": 234, "xtensa": 234, "risc": 234, "bare": 234, "bone": 234, "py": 234, "chipset": 234, "esp32s3": 234, "stdio": [234, 238], "esp_err": 234, "bsp": [234, 238], "bsp_lcd_draw_buff_s": 234, "draw_buf_s": 234, "bsp_lcd_h_re": 234, "config_bsp_lcd_draw_buf_height": 234, "app_main": 234, "esp_lcd_panel_io_handle_t": 234, "io_handl": 234, "esp_lcd_panel_handle_t": 234, "panel_handl": 234, "bsp_display_config_t": 234, "bsp_disp_cfg": 234, "max_transfer_sz": 234, "bsp_display_new": 234, "bsp_display_backlight_on": 234, "esp_lcd_touch_handle_t": 234, "touch_handl": 234, "bsp_touch_config_t": 234, "bsp_touch_cfg": 234, "bsp_touch_new": 234, "bsp_lcd_v_re": 234, "slint_esp_init": 234, "buffer1": 234, "appwindow": [234, 238], "verticalbox": [234, 238], "aboutslint": [234, 238], "18px": [234, 238], "idf_component_regist": 234, "include_dir": 234, "editor": 234, "menuconfig": 234, "config": 234, "tweak": 234, "spi": 234, "psram": 234, "q": 234, "save": 234, "sdkconfig": 234, "flash": [234, 237], "config_main_task_stack_s": 234, "monitor": 234, "observ": 234, "congratul": 234, "studi": [234, 235, 237], "aim": [235, 236], "those": 235, "dslint_feature_freestand": 235, "standard": 235, "dbuild_shared_lib": 235, "dslint_feature_renderer_softwar": 235, "ddefault_slint_embed_resourc": 235, "arm": [235, 237], "cortex": 235, "complet": [235, 238], "thumbv7em": [235, 238], "eabihf": [235, 238], "mcu": [236, 237], "highli": 236, "customiz": 236, "vendor": 236, "espressif": 236, "iot": 236, "framework": 236, "stm32": [236, 237], "stmicroelectron": 236, "stm32cube": [236, 238], "ecosystem": 236, "stm": 237, "bsp_t": 237, "bsp_lcd": 237, "hal_ltdc": 237, "stm32cubeclt": 237, "discoveri": 237, "kit": 237, "skeleton": [237, 238], "sampl": 237, "usag": 237, "basic": 237, "stm32h747i": 237, "disco": 237, "dual": 237, "core": 237, "m7": 237, "m4": 237, "lcd": 237, "zip": 237, "stm32h735g": 237, "dk": 237, "folder": 237, "preset": 237, "palett": 237, "panel": 237, "hit": 237, "rough": 238, "cube": 238, "stm32cubemx": 238, "peripher": 238, "prerequisit": 238, "ltdc": 238, "fmc": 238, "framebuff": 238, "web": 238, "browser": 238, "navig": 238, "appmain": 238, "set_target_properti": 238, "bsp_name": 238, "concret": 238, "stm32h735g_discoveri": 238, "target_compile_definit": 238, "slint_stm32_bsp_nam": 238, "bsp_lcd_initex": 238, "bsp_ts_init": 238, "slint_stm32_init": 238, "final": 238, "stm32h735g_discovery_lcd": 238, "stm32h735g_discovery_t": 238, "lcd_orientation_landscap": 238, "lcd_pixel_format_rgb565": 238, "lcd_default_width": 238, "lcd_default_height": 238, "error_handl": 238, "bsp_lcd_displayon": 238, "bsp_lcd_setactivelay": 238, "ts_init_t": 238, "ht": 238, "ts_swap_xi": 238, "accuraci": 238, "touchscreen": 238, "app_window": 238, "explain": 239, "veri": 239, "ahead": 239, "smallest": 239, "footprint": 239, "best": 239, "price": 239, "opportun": 239, "popul": 239, "slower": 239, "With": 239, "polymorph": 239, "commonli": 239, "consum": 239, "invoke_global_callback": 239, "summar": 240, "easili": 240, "physical_length": 240, "At": 240, "camelcas": 240, "mystruct": 240, "camel": 240, "myenum": 240, "beta": 240, "gamma": 240, "omicron": 240, "betagamma": 240}, "objects": {"": [[33, 0, 1, "c.SLINT_FEATURE_ACCESSIBILITY", "SLINT_FEATURE_ACCESSIBILITY"], [27, 0, 1, "c.SLINT_FEATURE_BACKEND_LINUXKMS", "SLINT_FEATURE_BACKEND_LINUXKMS"], [23, 0, 1, "c.SLINT_FEATURE_BACKEND_QT", "SLINT_FEATURE_BACKEND_QT"], [39, 0, 1, "c.SLINT_FEATURE_BACKEND_WINIT", "SLINT_FEATURE_BACKEND_WINIT"], [28, 0, 1, "c.SLINT_FEATURE_EXPERIMENTAL", "SLINT_FEATURE_EXPERIMENTAL"], [36, 0, 1, "c.SLINT_FEATURE_FREESTANDING", "SLINT_FEATURE_FREESTANDING"], [24, 0, 1, "c.SLINT_FEATURE_GETTEXT", "SLINT_FEATURE_GETTEXT"], [25, 0, 1, "c.SLINT_FEATURE_INTERPRETER", "SLINT_FEATURE_INTERPRETER"], [30, 0, 1, "c.SLINT_FEATURE_RENDERER_FEMTOVG", "SLINT_FEATURE_RENDERER_FEMTOVG"], [31, 0, 1, "c.SLINT_FEATURE_RENDERER_SKIA", "SLINT_FEATURE_RENDERER_SKIA"], [34, 0, 1, "c.SLINT_FEATURE_RENDERER_SOFTWARE", "SLINT_FEATURE_RENDERER_SOFTWARE"], [32, 0, 1, "c.SLINT_FEATURE_SYSTEM_TESTING", "SLINT_FEATURE_SYSTEM_TESTING"], [37, 0, 1, "c.SLINT_FEATURE_TESTING", "SLINT_FEATURE_TESTING"], [38, 0, 1, "c.SLINT_VERSION_MAJOR", "SLINT_VERSION_MAJOR"], [35, 0, 1, "c.SLINT_VERSION_MINOR", "SLINT_VERSION_MINOR"], [26, 0, 1, "c.SLINT_VERSION_PATCH", "SLINT_VERSION_PATCH"], [29, 0, 1, "c.SLINT_VERSION_STRING", "SLINT_VERSION_STRING"], [40, 0, 1, "c.assert_eq", "assert_eq"], [0, 1, 1, "_CPPv4N5slint5BrushE", "slint::Brush"], [0, 2, 1, "_CPPv4N5slint5Brush5BrushERK5Color", "slint::Brush::Brush"], [0, 2, 1, "_CPPv4N5slint5Brush5BrushEv", "slint::Brush::Brush"], [0, 3, 1, "_CPPv4N5slint5Brush5BrushERK5Color", "slint::Brush::Brush::color"], [0, 2, 1, "_CPPv4NK5slint5Brush8brighterEf", "slint::Brush::brighter"], [0, 3, 1, "_CPPv4NK5slint5Brush8brighterEf", "slint::Brush::brighter::factor"], [0, 2, 1, "_CPPv4NK5slint5Brush5colorEv", "slint::Brush::color"], [0, 2, 1, "_CPPv4NK5slint5Brush6darkerEf", "slint::Brush::darker"], [0, 3, 1, "_CPPv4NK5slint5Brush6darkerEf", "slint::Brush::darker::factor"], [0, 2, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!="], [0, 3, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!=::a"], [0, 3, 1, "_CPPv4N5slint5BrushneERK5BrushRK5Brush", "slint::Brush::operator!=::b"], [0, 2, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator=="], [0, 3, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator==::a"], [0, 3, 1, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush", "slint::Brush::operator==::b"], [0, 2, 1, "_CPPv4NK5slint5Brush14transparentizeEf", "slint::Brush::transparentize"], [0, 3, 1, "_CPPv4NK5slint5Brush14transparentizeEf", "slint::Brush::transparentize::factor"], [0, 2, 1, "_CPPv4NK5slint5Brush10with_alphaEf", "slint::Brush::with_alpha"], [0, 3, 1, "_CPPv4NK5slint5Brush10with_alphaEf", "slint::Brush::with_alpha::alpha"], [54, 4, 1, "_CPPv4N5slint20CloseRequestResponseE", "slint::CloseRequestResponse"], [54, 5, 1, "_CPPv4N5slint20CloseRequestResponse10HideWindowE", "slint::CloseRequestResponse::HideWindow"], [54, 5, 1, "_CPPv4N5slint20CloseRequestResponse15KeepWindowShownE", "slint::CloseRequestResponse::KeepWindowShown"], [1, 1, 1, "_CPPv4N5slint5ColorE", "slint::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE", "slint::Color::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE", "slint::Color::Color"], [1, 2, 1, "_CPPv4N5slint5Color5ColorEv", "slint::Color::Color"], [1, 3, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE", "slint::Color::Color::col"], [1, 3, 1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE", "slint::Color::Color::col"], [1, 2, 1, "_CPPv4NK5slint5Color5alphaEv", "slint::Color::alpha"], [1, 2, 1, "_CPPv4NK5slint5Color15as_argb_encodedEv", "slint::Color::as_argb_encoded"], [1, 2, 1, "_CPPv4NK5slint5Color4blueEv", "slint::Color::blue"], [1, 2, 1, "_CPPv4NK5slint5Color8brighterEf", "slint::Color::brighter"], [1, 3, 1, "_CPPv4NK5slint5Color8brighterEf", "slint::Color::brighter::factor"], [1, 2, 1, "_CPPv4NK5slint5Color6darkerEf", "slint::Color::darker"], [1, 3, 1, "_CPPv4NK5slint5Color6darkerEf", "slint::Color::darker::factor"], [1, 2, 1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t", "slint::Color::from_argb_encoded"], [1, 3, 1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t", "slint::Color::from_argb_encoded::argb_encoded"], [1, 2, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::alpha"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::blue"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::green"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_floatEffff", "slint::Color::from_argb_float::red"], [1, 2, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::alpha"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::blue"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::green"], [1, 3, 1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t", "slint::Color::from_argb_uint8::red"], [1, 2, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::a"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::h"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::s"], [1, 3, 1, "_CPPv4N5slint5Color9from_hsvaEffff", "slint::Color::from_hsva::v"], [1, 2, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::blue"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::green"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_floatEfff", "slint::Color::from_rgb_float::red"], [1, 2, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::blue"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::green"], [1, 3, 1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t", "slint::Color::from_rgb_uint8::red"], [1, 2, 1, "_CPPv4NK5slint5Color5greenEv", "slint::Color::green"], [1, 2, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix"], [1, 3, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix::factor"], [1, 3, 1, "_CPPv4NK5slint5Color3mixERK5Colorf", "slint::Color::mix::other"], [1, 2, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<"], [1, 3, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<::color"], [1, 3, 1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color", "slint::Color::operator<<::stream"], [1, 2, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator=="], [1, 3, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator==::lhs"], [1, 3, 1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color", "slint::Color::operator==::rhs"], [1, 2, 1, "_CPPv4NK5slint5Color3redEv", "slint::Color::red"], [1, 2, 1, "_CPPv4NK5slint5Color13to_argb_floatEv", "slint::Color::to_argb_float"], [1, 2, 1, "_CPPv4NK5slint5Color12to_argb_uintEv", "slint::Color::to_argb_uint"], [1, 2, 1, "_CPPv4NK5slint5Color7to_hsvaEv", "slint::Color::to_hsva"], [1, 2, 1, "_CPPv4NK5slint5Color14transparentizeEf", "slint::Color::transparentize"], [1, 3, 1, "_CPPv4NK5slint5Color14transparentizeEf", "slint::Color::transparentize::factor"], [1, 2, 1, "_CPPv4NK5slint5Color10with_alphaEf", "slint::Color::with_alpha"], [1, 3, 1, "_CPPv4NK5slint5Color10with_alphaEf", "slint::Color::with_alpha::alpha"], [2, 1, 1, "_CPPv4I0EN5slint15ComponentHandleE", "slint::ComponentHandle"], [2, 2, 1, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE", "slint::ComponentHandle::ComponentHandle"], [2, 3, 1, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE", "slint::ComponentHandle::ComponentHandle::inner"], [2, 6, 1, "_CPPv4I0EN5slint15ComponentHandleE", "slint::ComponentHandle::T"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandle8into_dynEv", "slint::ComponentHandle::into_dyn"], [2, 2, 1, "_CPPv4N5slint15ComponentHandlemlEv", "slint::ComponentHandle::operator*"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandlemlEv", "slint::ComponentHandle::operator*"], [2, 2, 1, "_CPPv4N5slint15ComponentHandleptEv", "slint::ComponentHandle::operator->"], [2, 2, 1, "_CPPv4NK5slint15ComponentHandleptEv", "slint::ComponentHandle::operator->"], [3, 1, 1, "_CPPv4I0EN5slint19ComponentWeakHandleE", "slint::ComponentWeakHandle"], [3, 2, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE", "slint::ComponentWeakHandle::ComponentWeakHandle"], [3, 2, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleEv", "slint::ComponentWeakHandle::ComponentWeakHandle"], [3, 3, 1, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE", "slint::ComponentWeakHandle::ComponentWeakHandle::other"], [3, 6, 1, "_CPPv4I0EN5slint19ComponentWeakHandleE", "slint::ComponentWeakHandle::T"], [3, 2, 1, "_CPPv4NK5slint19ComponentWeakHandle4lockEv", "slint::ComponentWeakHandle::lock"], [51, 4, 1, "_CPPv4N5slint13EventLoopModeE", "slint::EventLoopMode"], [51, 5, 1, "_CPPv4N5slint13EventLoopMode22QuitOnLastWindowClosedE", "slint::EventLoopMode::QuitOnLastWindowClosed"], [51, 5, 1, "_CPPv4N5slint13EventLoopMode12RunUntilQuitE", "slint::EventLoopMode::RunUntilQuit"], [4, 1, 1, "_CPPv4I0EN5slint11FilterModelE", "slint::FilterModel"], [4, 2, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel"], [4, 3, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel::filter_fn"], [4, 3, 1, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE", "slint::FilterModel::FilterModel::source_model"], [4, 6, 1, "_CPPv4I0EN5slint11FilterModelE", "slint::FilterModel::ModelData"], [4, 2, 1, "_CPPv4N5slint11FilterModel5resetEv", "slint::FilterModel::reset"], [4, 2, 1, "_CPPv4NK5slint11FilterModel9row_countEv", "slint::FilterModel::row_count"], [4, 2, 1, "_CPPv4NK5slint11FilterModel8row_dataE6size_t", "slint::FilterModel::row_data"], [4, 3, 1, "_CPPv4NK5slint11FilterModel8row_dataE6size_t", "slint::FilterModel::row_data::i"], [4, 2, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data"], [4, 3, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data::i"], [4, 3, 1, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData", "slint::FilterModel::set_row_data::value"], [4, 2, 1, "_CPPv4NK5slint11FilterModel12source_modelEv", "slint::FilterModel::source_model"], [4, 2, 1, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi", "slint::FilterModel::unfiltered_row"], [4, 3, 1, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi", "slint::FilterModel::unfiltered_row::filtered_row"], [52, 4, 1, "_CPPv4N5slint11GraphicsAPIE", "slint::GraphicsAPI"], [52, 5, 1, "_CPPv4N5slint11GraphicsAPI12NativeOpenGLE", "slint::GraphicsAPI::NativeOpenGL"], [147, 1, 1, "_CPPv4N5slint9HsvaColorE", "slint::HsvaColor"], [147, 7, 1, "_CPPv4N5slint9HsvaColor5alphaE", "slint::HsvaColor::alpha"], [147, 7, 1, "_CPPv4N5slint9HsvaColor3hueE", "slint::HsvaColor::hue"], [147, 7, 1, "_CPPv4N5slint9HsvaColor10saturationE", "slint::HsvaColor::saturation"], [147, 7, 1, "_CPPv4N5slint9HsvaColor5valueE", "slint::HsvaColor::value"], [148, 1, 1, "_CPPv4N5slint5ImageE", "slint::Image"], [148, 4, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOriginE", "slint::Image::BorrowedOpenGLTextureOrigin"], [148, 5, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin10BottomLeftE", "slint::Image::BorrowedOpenGLTextureOrigin::BottomLeft"], [148, 5, 1, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin7TopLeftE", "slint::Image::BorrowedOpenGLTextureOrigin::TopLeft"], [148, 2, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE", "slint::Image::Image"], [148, 2, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE", "slint::Image::Image"], [148, 2, 1, "_CPPv4N5slint5Image5ImageEv", "slint::Image::Image"], [148, 3, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE", "slint::Image::Image::buffer"], [148, 3, 1, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE", "slint::Image::Image::buffer"], [148, 2, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::origin"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::size"], [148, 3, 1, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin", "slint::Image::create_from_borrowed_gl_2d_rgba_texture::texture_id"], [148, 2, 1, "_CPPv4N5slint5Image14load_from_pathERK12SharedString", "slint::Image::load_from_path"], [148, 3, 1, "_CPPv4N5slint5Image14load_from_pathERK12SharedString", "slint::Image::load_from_path::file_path"], [148, 2, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!="], [148, 3, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!=::a"], [148, 3, 1, "_CPPv4N5slint5ImageneERK5ImageRK5Image", "slint::Image::operator!=::b"], [148, 2, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator=="], [148, 3, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator==::a"], [148, 3, 1, "_CPPv4N5slint5ImageeqERK5ImageRK5Image", "slint::Image::operator==::b"], [148, 2, 1, "_CPPv4NK5slint5Image4pathEv", "slint::Image::path"], [148, 2, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::bottom"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::left"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::right"], [148, 3, 1, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt", "slint::Image::set_nine_slice_edges::top"], [148, 2, 1, "_CPPv4NK5slint5Image4sizeEv", "slint::Image::size"], [148, 2, 1, "_CPPv4NK5slint5Image7to_rgb8Ev", "slint::Image::to_rgb8"], [148, 2, 1, "_CPPv4NK5slint5Image8to_rgba8Ev", "slint::Image::to_rgba8"], [148, 2, 1, "_CPPv4NK5slint5Image22to_rgba8_premultipliedEv", "slint::Image::to_rgba8_premultiplied"], [149, 1, 1, "_CPPv4N5slint15LogicalPositionE", "slint::LogicalPosition"], [149, 2, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE", "slint::LogicalPosition::LogicalPosition"], [149, 2, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEv", "slint::LogicalPosition::LogicalPosition"], [149, 3, 1, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE", "slint::LogicalPosition::LogicalPosition::p"], [150, 1, 1, "_CPPv4N5slint11LogicalSizeE", "slint::LogicalSize"], [150, 2, 1, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE", "slint::LogicalSize::LogicalSize"], [150, 3, 1, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE", "slint::LogicalSize::LogicalSize::s"], [5, 1, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel"], [5, 2, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel"], [5, 3, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel::map_fn"], [5, 3, 1, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE", "slint::MapModel::MapModel::source_model"], [5, 6, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel::MappedModelData"], [5, 6, 1, "_CPPv4I00EN5slint8MapModelE", "slint::MapModel::SourceModelData"], [5, 2, 1, "_CPPv4N5slint8MapModel5resetEv", "slint::MapModel::reset"], [5, 2, 1, "_CPPv4NK5slint8MapModel9row_countEv", "slint::MapModel::row_count"], [5, 2, 1, "_CPPv4NK5slint8MapModel8row_dataE6size_t", "slint::MapModel::row_data"], [5, 3, 1, "_CPPv4NK5slint8MapModel8row_dataE6size_t", "slint::MapModel::row_data::i"], [5, 2, 1, "_CPPv4NK5slint8MapModel12source_modelEv", "slint::MapModel::source_model"], [6, 1, 1, "_CPPv4I0EN5slint5ModelE", "slint::Model"], [6, 2, 1, "_CPPv4N5slint5Model5ModelERK5Model", "slint::Model::Model"], [6, 2, 1, "_CPPv4N5slint5Model5ModelEv", "slint::Model::Model"], [6, 6, 1, "_CPPv4I0EN5slint5ModelE", "slint::Model::ModelData"], [6, 2, 1, "_CPPv4N5slint5ModelaSERK5Model", "slint::Model::operator="], [6, 2, 1, "_CPPv4N5slint5Model5resetEv", "slint::Model::reset"], [6, 2, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added"], [6, 3, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added::count"], [6, 3, 1, "_CPPv4N5slint5Model9row_addedE6size_t6size_t", "slint::Model::row_added::index"], [6, 2, 1, "_CPPv4N5slint5Model11row_changedE6size_t", "slint::Model::row_changed"], [6, 3, 1, "_CPPv4N5slint5Model11row_changedE6size_t", "slint::Model::row_changed::row"], [6, 2, 1, "_CPPv4NK5slint5Model9row_countEv", "slint::Model::row_count"], [6, 2, 1, "_CPPv4NK5slint5Model8row_dataE6size_t", "slint::Model::row_data"], [6, 3, 1, "_CPPv4NK5slint5Model8row_dataE6size_t", "slint::Model::row_data::i"], [6, 2, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed"], [6, 3, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed::count"], [6, 3, 1, "_CPPv4N5slint5Model11row_removedE6size_t6size_t", "slint::Model::row_removed::index"], [6, 2, 1, "_CPPv4N5slint5Model12set_row_dataE6size_tRK9ModelData", "slint::Model::set_row_data"], [6, 2, 1, "_CPPv4N5slint5ModelD0Ev", "slint::Model::~Model"], [151, 1, 1, "_CPPv4N5slint16PhysicalPositionE", "slint::PhysicalPosition"], [151, 2, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE", "slint::PhysicalPosition::PhysicalPosition"], [151, 2, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEv", "slint::PhysicalPosition::PhysicalPosition"], [151, 3, 1, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE", "slint::PhysicalPosition::PhysicalPosition::p"], [152, 1, 1, "_CPPv4N5slint12PhysicalSizeE", "slint::PhysicalSize"], [152, 2, 1, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE", "slint::PhysicalSize::PhysicalSize"], [152, 3, 1, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE", "slint::PhysicalSize::PhysicalSize::s"], [153, 1, 1, "_CPPv4I0EN5slint5PointE", "slint::Point"], [153, 6, 1, "_CPPv4I0EN5slint5PointE", "slint::Point::T"], [153, 2, 1, "_CPPv4NK5slint5PointeqERK5Point", "slint::Point::operator=="], [153, 3, 1, "_CPPv4NK5slint5PointeqERK5Point", "slint::Point::operator==::other"], [153, 7, 1, "_CPPv4N5slint5Point1xE", "slint::Point::x"], [153, 7, 1, "_CPPv4N5slint5Point1yE", "slint::Point::y"], [50, 4, 1, "_CPPv4N5slint18PointerEventButtonE", "slint::PointerEventButton"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton4BackE", "slint::PointerEventButton::Back"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton7ForwardE", "slint::PointerEventButton::Forward"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton4LeftE", "slint::PointerEventButton::Left"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton6MiddleE", "slint::PointerEventButton::Middle"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton5OtherE", "slint::PointerEventButton::Other"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton5RightE", "slint::PointerEventButton::Right"], [53, 4, 1, "_CPPv4N5slint14RenderingStateE", "slint::RenderingState"], [53, 5, 1, "_CPPv4N5slint14RenderingState14AfterRenderingE", "slint::RenderingState::AfterRendering"], [53, 5, 1, "_CPPv4N5slint14RenderingState15BeforeRenderingE", "slint::RenderingState::BeforeRendering"], [53, 5, 1, "_CPPv4N5slint14RenderingState14RenderingSetupE", "slint::RenderingState::RenderingSetup"], [53, 5, 1, "_CPPv4N5slint14RenderingState17RenderingTeardownE", "slint::RenderingState::RenderingTeardown"], [7, 1, 1, "_CPPv4I0EN5slint12ReverseModelE", "slint::ReverseModel"], [7, 6, 1, "_CPPv4I0EN5slint12ReverseModelE", "slint::ReverseModel::ModelData"], [7, 2, 1, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE", "slint::ReverseModel::ReverseModel"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE", "slint::ReverseModel::ReverseModel::source_model"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel9row_countEv", "slint::ReverseModel::row_count"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t", "slint::ReverseModel::row_data"], [7, 3, 1, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t", "slint::ReverseModel::row_data::i"], [7, 2, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data::i"], [7, 3, 1, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData", "slint::ReverseModel::set_row_data::value"], [7, 2, 1, "_CPPv4NK5slint12ReverseModel12source_modelEv", "slint::ReverseModel::source_model"], [154, 1, 1, "_CPPv4N5slint9Rgb8PixelE", "slint::Rgb8Pixel"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1bE", "slint::Rgb8Pixel::b"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1gE", "slint::Rgb8Pixel::g"], [154, 7, 1, "_CPPv4N5slint9Rgb8Pixel1rE", "slint::Rgb8Pixel::r"], [155, 1, 1, "_CPPv4N5slint10Rgba8PixelE", "slint::Rgba8Pixel"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1aE", "slint::Rgba8Pixel::a"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1bE", "slint::Rgba8Pixel::b"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1gE", "slint::Rgba8Pixel::g"], [155, 7, 1, "_CPPv4N5slint10Rgba8Pixel1rE", "slint::Rgba8Pixel::r"], [156, 1, 1, "_CPPv4I0EN5slint9RgbaColorE", "slint::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 2, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::col"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::color"], [156, 3, 1, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color", "slint::RgbaColor::RgbaColor::color"], [156, 6, 1, "_CPPv4I0EN5slint9RgbaColorE", "slint::RgbaColor::T"], [156, 7, 1, "_CPPv4N5slint9RgbaColor5alphaE", "slint::RgbaColor::alpha"], [156, 7, 1, "_CPPv4N5slint9RgbaColor4blueE", "slint::RgbaColor::blue"], [156, 7, 1, "_CPPv4N5slint9RgbaColor5greenE", "slint::RgbaColor::green"], [156, 7, 1, "_CPPv4N5slint9RgbaColor3redE", "slint::RgbaColor::red"], [49, 4, 1, "_CPPv4N5slint25SetRenderingNotifierErrorE", "slint::SetRenderingNotifierError"], [49, 5, 1, "_CPPv4N5slint25SetRenderingNotifierError10AlreadySetE", "slint::SetRenderingNotifierError::AlreadySet"], [49, 5, 1, "_CPPv4N5slint25SetRenderingNotifierError11UnsupportedE", "slint::SetRenderingNotifierError::Unsupported"], [157, 1, 1, "_CPPv4I0EN5slint17SharedPixelBufferE", "slint::SharedPixelBuffer"], [157, 6, 1, "_CPPv4I0EN5slint17SharedPixelBufferE", "slint::SharedPixelBuffer::Pixel"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferEv", "slint::SharedPixelBuffer::SharedPixelBuffer"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::data"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer::height"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::height"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t", "slint::SharedPixelBuffer::SharedPixelBuffer::width"], [157, 3, 1, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel", "slint::SharedPixelBuffer::SharedPixelBuffer::width"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer5beginEv", "slint::SharedPixelBuffer::begin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer5beginEv", "slint::SharedPixelBuffer::begin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer6cbeginEv", "slint::SharedPixelBuffer::cbegin"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer4cendEv", "slint::SharedPixelBuffer::cend"], [157, 2, 1, "_CPPv4N5slint17SharedPixelBuffer3endEv", "slint::SharedPixelBuffer::end"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer3endEv", "slint::SharedPixelBuffer::end"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer6heightEv", "slint::SharedPixelBuffer::height"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer", "slint::SharedPixelBuffer::operator=="], [157, 3, 1, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer", "slint::SharedPixelBuffer::operator==::other"], [157, 2, 1, "_CPPv4NK5slint17SharedPixelBuffer5widthEv", "slint::SharedPixelBuffer::width"], [158, 1, 1, "_CPPv4N5slint12SharedStringE", "slint::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEPKDu", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEPKc", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString", "slint::SharedString::SharedString"], [158, 2, 1, "_CPPv4N5slint12SharedString12SharedStringEv", "slint::SharedString::SharedString"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString", "slint::SharedString::SharedString::other"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringEPKDu", "slint::SharedString::SharedString::s"], [158, 3, 1, "_CPPv4N5slint12SharedString12SharedStringEPKc", "slint::SharedString::SharedString::s"], [158, 2, 1, "_CPPv4NK5slint12SharedString5beginEv", "slint::SharedString::begin"], [158, 2, 1, "_CPPv4NK5slint12SharedString4dataEv", "slint::SharedString::data"], [158, 2, 1, "_CPPv4NK5slint12SharedString5emptyEv", "slint::SharedString::empty"], [158, 2, 1, "_CPPv4NK5slint12SharedString3endEv", "slint::SharedString::end"], [158, 2, 1, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE", "slint::SharedString::ends_with"], [158, 3, 1, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE", "slint::SharedString::ends_with::prefix"], [158, 2, 1, "_CPPv4N5slint12SharedString11from_numberEd", "slint::SharedString::from_number"], [158, 3, 1, "_CPPv4N5slint12SharedString11from_numberEd", "slint::SharedString::from_number::n"], [158, 2, 1, "_CPPv4NK5slint12SharedStringcvNSt11string_viewEEv", "slint::SharedString::operator std::string_view"], [158, 2, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!="], [158, 3, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString", "slint::SharedString::operator!=::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+"], [158, 2, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE", "slint::SharedString::operator+::b"], [158, 3, 1, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE", "slint::SharedString::operator+::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringpLENSt11string_viewE", "slint::SharedString::operator+="], [158, 3, 1, "_CPPv4N5slint12SharedStringpLENSt11string_viewE", "slint::SharedString::operator+=::other"], [158, 2, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<"], [158, 3, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString", "slint::SharedString::operator<::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<"], [158, 3, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<::shared_string"], [158, 3, 1, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString", "slint::SharedString::operator<<::stream"], [158, 2, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<="], [158, 3, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString", "slint::SharedString::operator<=::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringaSENSt11string_viewE", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSEPKc", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSERK12SharedString", "slint::SharedString::operator="], [158, 2, 1, "_CPPv4N5slint12SharedStringaSERR12SharedString", "slint::SharedString::operator="], [158, 3, 1, "_CPPv4N5slint12SharedStringaSERK12SharedString", "slint::SharedString::operator=::other"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSERR12SharedString", "slint::SharedString::operator=::other"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSENSt11string_viewE", "slint::SharedString::operator=::s"], [158, 3, 1, "_CPPv4N5slint12SharedStringaSEPKc", "slint::SharedString::operator=::s"], [158, 2, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator=="], [158, 3, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator==::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString", "slint::SharedString::operator==::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>"], [158, 3, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString", "slint::SharedString::operator>::b"], [158, 2, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>="], [158, 3, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>=::a"], [158, 3, 1, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString", "slint::SharedString::operator>=::b"], [158, 2, 1, "_CPPv4NK5slint12SharedString4sizeEv", "slint::SharedString::size"], [158, 2, 1, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE", "slint::SharedString::starts_with"], [158, 3, 1, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE", "slint::SharedString::starts_with::prefix"], [158, 2, 1, "_CPPv4N5slint12SharedStringD0Ev", "slint::SharedString::~SharedString"], [159, 1, 1, "_CPPv4I0EN5slint12SharedVectorE", "slint::SharedVector"], [159, 2, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector", "slint::SharedVector::SharedVector"], [159, 2, 1, "_CPPv4N5slint12SharedVector12SharedVectorEv", "slint::SharedVector::SharedVector"], [159, 6, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::InputIt"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE", "slint::SharedVector::SharedVector::args"], [159, 3, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::first"], [159, 3, 1, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt", "slint::SharedVector::SharedVector::last"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector", "slint::SharedVector::SharedVector::other"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t", "slint::SharedVector::SharedVector::size"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector::size"], [159, 3, 1, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T", "slint::SharedVector::SharedVector::value"], [159, 6, 1, "_CPPv4I0EN5slint12SharedVectorE", "slint::SharedVector::T"], [159, 2, 1, "_CPPv4NK5slint12SharedVector2atENSt6size_tE", "slint::SharedVector::at"], [159, 3, 1, "_CPPv4NK5slint12SharedVector2atENSt6size_tE", "slint::SharedVector::at::index"], [159, 2, 1, "_CPPv4N5slint12SharedVector5beginEv", "slint::SharedVector::begin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector5beginEv", "slint::SharedVector::begin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector6cbeginEv", "slint::SharedVector::cbegin"], [159, 2, 1, "_CPPv4NK5slint12SharedVector4cendEv", "slint::SharedVector::cend"], [159, 2, 1, "_CPPv4N5slint12SharedVector5clearEv", "slint::SharedVector::clear"], [159, 2, 1, "_CPPv4NK5slint12SharedVector5emptyEv", "slint::SharedVector::empty"], [159, 2, 1, "_CPPv4N5slint12SharedVector3endEv", "slint::SharedVector::end"], [159, 2, 1, "_CPPv4NK5slint12SharedVector3endEv", "slint::SharedVector::end"], [159, 2, 1, "_CPPv4N5slint12SharedVectoraSERK12SharedVector", "slint::SharedVector::operator="], [159, 2, 1, "_CPPv4N5slint12SharedVectoraSERR12SharedVector", "slint::SharedVector::operator="], [159, 3, 1, "_CPPv4N5slint12SharedVectoraSERK12SharedVector", "slint::SharedVector::operator=::other"], [159, 3, 1, "_CPPv4N5slint12SharedVectoraSERR12SharedVector", "slint::SharedVector::operator=::other"], [159, 2, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator=="], [159, 3, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator==::a"], [159, 3, 1, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector", "slint::SharedVector::operator==::b"], [159, 2, 1, "_CPPv4N5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]"], [159, 2, 1, "_CPPv4NK5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]"], [159, 3, 1, "_CPPv4N5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]::index"], [159, 3, 1, "_CPPv4NK5slint12SharedVectorixENSt6size_tE", "slint::SharedVector::operator[]::index"], [159, 2, 1, "_CPPv4N5slint12SharedVector9push_backERK1T", "slint::SharedVector::push_back"], [159, 2, 1, "_CPPv4N5slint12SharedVector9push_backERR1T", "slint::SharedVector::push_back"], [159, 3, 1, "_CPPv4N5slint12SharedVector9push_backERK1T", "slint::SharedVector::push_back::value"], [159, 3, 1, "_CPPv4N5slint12SharedVector9push_backERR1T", "slint::SharedVector::push_back::value"], [159, 2, 1, "_CPPv4NK5slint12SharedVector4sizeEv", "slint::SharedVector::size"], [159, 2, 1, "_CPPv4N5slint12SharedVectorD0Ev", "slint::SharedVector::~SharedVector"], [160, 1, 1, "_CPPv4I0EN5slint4SizeE", "slint::Size"], [160, 6, 1, "_CPPv4I0EN5slint4SizeE", "slint::Size::T"], [160, 7, 1, "_CPPv4N5slint4Size6heightE", "slint::Size::height"], [160, 2, 1, "_CPPv4NK5slint4SizeeqERK4Size", "slint::Size::operator=="], [160, 3, 1, "_CPPv4NK5slint4SizeeqERK4Size", "slint::Size::operator==::other"], [160, 7, 1, "_CPPv4N5slint4Size5widthE", "slint::Size::width"], [8, 1, 1, "_CPPv4I0EN5slint9SortModelE", "slint::SortModel"], [8, 6, 1, "_CPPv4I0EN5slint9SortModelE", "slint::SortModel::ModelData"], [8, 2, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel"], [8, 3, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel::comp"], [8, 3, 1, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE", "slint::SortModel::SortModel::source_model"], [8, 2, 1, "_CPPv4N5slint9SortModel5resetEv", "slint::SortModel::reset"], [8, 2, 1, "_CPPv4NK5slint9SortModel9row_countEv", "slint::SortModel::row_count"], [8, 2, 1, "_CPPv4NK5slint9SortModel8row_dataE6size_t", "slint::SortModel::row_data"], [8, 3, 1, "_CPPv4NK5slint9SortModel8row_dataE6size_t", "slint::SortModel::row_data::i"], [8, 2, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data"], [8, 3, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data::i"], [8, 3, 1, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData", "slint::SortModel::set_row_data::value"], [8, 2, 1, "_CPPv4NK5slint9SortModel12source_modelEv", "slint::SortModel::source_model"], [8, 2, 1, "_CPPv4NK5slint9SortModel12unsorted_rowEi", "slint::SortModel::unsorted_row"], [8, 3, 1, "_CPPv4NK5slint9SortModel12unsorted_rowEi", "slint::SortModel::unsorted_row::sorted_row_index"], [161, 1, 1, "_CPPv4N5slint20StandardListViewItemE", "slint::StandardListViewItem"], [161, 7, 1, "_CPPv4N5slint20StandardListViewItem4textE", "slint::StandardListViewItem::text"], [162, 1, 1, "_CPPv4N5slint5TimerE", "slint::Timer"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer"], [162, 2, 1, "_CPPv4N5slint5Timer5TimerERK5Timer", "slint::Timer::Timer"], [162, 2, 1, "_CPPv4N5slint5Timer5TimerEv", "slint::Timer::Timer"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F", "slint::Timer::Timer::interval"], [162, 2, 1, "_CPPv4NK5slint5Timer8intervalEv", "slint::Timer::interval"], [162, 2, 1, "_CPPv4N5slint5TimeraSERK5Timer", "slint::Timer::operator="], [162, 2, 1, "_CPPv4N5slint5Timer7restartEv", "slint::Timer::restart"], [162, 2, 1, "_CPPv4NK5slint5Timer7runningEv", "slint::Timer::running"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F", "slint::Timer::single_shot::duration"], [162, 2, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start"], [162, 6, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::F"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::callback"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::interval"], [162, 3, 1, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F", "slint::Timer::start::mode"], [162, 2, 1, "_CPPv4N5slint5Timer4stopEv", "slint::Timer::stop"], [162, 2, 1, "_CPPv4N5slint5TimerD0Ev", "slint::Timer::~Timer"], [9, 1, 1, "_CPPv4I0EN5slint11VectorModelE", "slint::VectorModel"], [9, 6, 1, "_CPPv4I0EN5slint11VectorModelE", "slint::VectorModel::ModelData"], [9, 2, 1, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE", "slint::VectorModel::VectorModel"], [9, 2, 1, "_CPPv4N5slint11VectorModel11VectorModelEv", "slint::VectorModel::VectorModel"], [9, 3, 1, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE", "slint::VectorModel::VectorModel::array"], [9, 2, 1, "_CPPv4N5slint11VectorModel5clearEv", "slint::VectorModel::clear"], [9, 2, 1, "_CPPv4N5slint11VectorModel5eraseE6size_t", "slint::VectorModel::erase"], [9, 3, 1, "_CPPv4N5slint11VectorModel5eraseE6size_t", "slint::VectorModel::erase::index"], [9, 2, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert"], [9, 3, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert::index"], [9, 3, 1, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData", "slint::VectorModel::insert::value"], [9, 2, 1, "_CPPv4N5slint11VectorModel9push_backERK9ModelData", "slint::VectorModel::push_back"], [9, 3, 1, "_CPPv4N5slint11VectorModel9push_backERK9ModelData", "slint::VectorModel::push_back::value"], [9, 2, 1, "_CPPv4NK5slint11VectorModel9row_countEv", "slint::VectorModel::row_count"], [9, 2, 1, "_CPPv4NK5slint11VectorModel8row_dataE6size_t", "slint::VectorModel::row_data"], [9, 3, 1, "_CPPv4NK5slint11VectorModel8row_dataE6size_t", "slint::VectorModel::row_data::i"], [9, 2, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data"], [9, 3, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data::i"], [9, 3, 1, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData", "slint::VectorModel::set_row_data::value"], [9, 2, 1, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE", "slint::VectorModel::set_vector"], [9, 3, 1, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE", "slint::VectorModel::set_vector::array"], [10, 1, 1, "_CPPv4N5slint6WindowE", "slint::Window"], [10, 2, 1, "_CPPv4N5slint6Window6WindowERK6Window", "slint::Window::Window"], [10, 2, 1, "_CPPv4N5slint6Window6WindowERR6Window", "slint::Window::Window"], [10, 3, 1, "_CPPv4N5slint6Window6WindowERK6Window", "slint::Window::Window::other"], [10, 3, 1, "_CPPv4N5slint6Window6WindowERR6Window", "slint::Window::Window::other"], [10, 2, 1, "_CPPv4N5slint6Window30dispatch_close_requested_eventEv", "slint::Window::dispatch_close_requested_event"], [10, 2, 1, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString", "slint::Window::dispatch_key_press_event"], [10, 3, 1, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString", "slint::Window::dispatch_key_press_event::text"], [10, 2, 1, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString", "slint::Window::dispatch_key_press_repeat_event"], [10, 3, 1, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString", "slint::Window::dispatch_key_press_repeat_event::text"], [10, 2, 1, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString", "slint::Window::dispatch_key_release_event"], [10, 3, 1, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString", "slint::Window::dispatch_key_release_event::text"], [10, 2, 1, "_CPPv4N5slint6Window27dispatch_pointer_exit_eventEv", "slint::Window::dispatch_pointer_exit_event"], [10, 2, 1, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition", "slint::Window::dispatch_pointer_move_event"], [10, 3, 1, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition", "slint::Window::dispatch_pointer_move_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event"], [10, 3, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event::button"], [10, 3, 1, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_press_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event"], [10, 3, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event::button"], [10, 3, 1, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton", "slint::Window::dispatch_pointer_release_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::delta_x"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::delta_y"], [10, 3, 1, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff", "slint::Window::dispatch_pointer_scroll_event::pos"], [10, 2, 1, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE", "slint::Window::dispatch_resize_event"], [10, 3, 1, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE", "slint::Window::dispatch_resize_event::s"], [10, 2, 1, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf", "slint::Window::dispatch_scale_factor_change_event"], [10, 3, 1, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf", "slint::Window::dispatch_scale_factor_change_event::factor"], [10, 2, 1, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb", "slint::Window::dispatch_window_active_changed_event"], [10, 3, 1, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb", "slint::Window::dispatch_window_active_changed_event::active"], [10, 2, 1, "_CPPv4NK5slint6Window21has_active_animationsEv", "slint::Window::has_active_animations"], [10, 2, 1, "_CPPv4N5slint6Window4hideEv", "slint::Window::hide"], [10, 2, 1, "_CPPv4NK5slint6Window13is_fullscreenEv", "slint::Window::is_fullscreen"], [10, 2, 1, "_CPPv4NK5slint6Window12is_maximizedEv", "slint::Window::is_maximized"], [10, 2, 1, "_CPPv4NK5slint6Window12is_minimizedEv", "slint::Window::is_minimized"], [10, 2, 1, "_CPPv4NK5slint6Window10is_visibleEv", "slint::Window::is_visible"], [10, 2, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested"], [10, 6, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested::F"], [10, 3, 1, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F", "slint::Window::on_close_requested::callback"], [10, 2, 1, "_CPPv4N5slint6WindowaSERK6Window", "slint::Window::operator="], [10, 2, 1, "_CPPv4N5slint6WindowaSERR6Window", "slint::Window::operator="], [10, 3, 1, "_CPPv4N5slint6WindowaSERK6Window", "slint::Window::operator=::other"], [10, 3, 1, "_CPPv4N5slint6WindowaSERR6Window", "slint::Window::operator=::other"], [10, 2, 1, "_CPPv4NK5slint6Window8positionEv", "slint::Window::position"], [10, 2, 1, "_CPPv4NK5slint6Window14request_redrawEv", "slint::Window::request_redraw"], [10, 2, 1, "_CPPv4NK5slint6Window12scale_factorEv", "slint::Window::scale_factor"], [10, 2, 1, "_CPPv4N5slint6Window14set_fullscreenEb", "slint::Window::set_fullscreen"], [10, 3, 1, "_CPPv4N5slint6Window14set_fullscreenEb", "slint::Window::set_fullscreen::fullscreen"], [10, 2, 1, "_CPPv4N5slint6Window13set_maximizedEb", "slint::Window::set_maximized"], [10, 3, 1, "_CPPv4N5slint6Window13set_maximizedEb", "slint::Window::set_maximized::maximized"], [10, 2, 1, "_CPPv4N5slint6Window13set_minimizedEb", "slint::Window::set_minimized"], [10, 3, 1, "_CPPv4N5slint6Window13set_minimizedEb", "slint::Window::set_minimized::minimized"], [10, 2, 1, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE", "slint::Window::set_position"], [10, 2, 1, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE", "slint::Window::set_position"], [10, 3, 1, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE", "slint::Window::set_position::pos"], [10, 3, 1, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE", "slint::Window::set_position::pos"], [10, 2, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier"], [10, 6, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier::F"], [10, 3, 1, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F", "slint::Window::set_rendering_notifier::callback"], [10, 2, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE", "slint::Window::set_size"], [10, 2, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE", "slint::Window::set_size"], [10, 3, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE", "slint::Window::set_size::size"], [10, 3, 1, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE", "slint::Window::set_size::size"], [10, 2, 1, "_CPPv4N5slint6Window4showEv", "slint::Window::show"], [10, 2, 1, "_CPPv4NK5slint6Window4sizeEv", "slint::Window::size"], [10, 2, 1, "_CPPv4N5slint6WindowD0Ev", "slint::Window::~Window"], [99, 2, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop"], [99, 6, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop::Functor"], [99, 3, 1, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor", "slint::blocking_invoke_from_event_loop::f"], [11, 1, 1, "_CPPv4N5slint11interpreter17ComponentCompilerE", "slint::interpreter::ComponentCompiler"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17ComponentCompilerEv", "slint::interpreter::ComponentCompiler::ComponentCompiler"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_path"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_path::path"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source::path"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentCompiler::build_from_source::source_code"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler11diagnosticsEv", "slint::interpreter::ComponentCompiler::diagnostics"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler13include_pathsEv", "slint::interpreter::ComponentCompiler::include_paths"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE", "slint::interpreter::ComponentCompiler::set_include_paths"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE", "slint::interpreter::ComponentCompiler::set_include_paths::paths"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_style"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_style::style"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_translation_domain"], [11, 3, 1, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE", "slint::interpreter::ComponentCompiler::set_translation_domain::domain"], [11, 2, 1, "_CPPv4NK5slint11interpreter17ComponentCompiler5styleEv", "slint::interpreter::ComponentCompiler::style"], [11, 2, 1, "_CPPv4N5slint11interpreter17ComponentCompilerD0Ev", "slint::interpreter::ComponentCompiler::~ComponentCompiler"], [12, 1, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionE", "slint::interpreter::ComponentDefinition"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::ComponentDefinition"], [12, 3, 1, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::ComponentDefinition::other"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition9callbacksEv", "slint::interpreter::ComponentDefinition::callbacks"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition6createEv", "slint::interpreter::ComponentDefinition::create"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition9functionsEv", "slint::interpreter::ComponentDefinition::functions"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_callbacks"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_callbacks::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_functions"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_functions::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_properties"], [12, 3, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE", "slint::interpreter::ComponentDefinition::global_properties::global_name"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition7globalsEv", "slint::interpreter::ComponentDefinition::globals"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition4nameEv", "slint::interpreter::ComponentDefinition::name"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::operator="], [12, 3, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition", "slint::interpreter::ComponentDefinition::operator=::other"], [12, 2, 1, "_CPPv4NK5slint11interpreter19ComponentDefinition10propertiesEv", "slint::interpreter::ComponentDefinition::properties"], [12, 2, 1, "_CPPv4N5slint11interpreter19ComponentDefinitionD0Ev", "slint::interpreter::ComponentDefinition::~ComponentDefinition"], [13, 1, 1, "_CPPv4N5slint11interpreter17ComponentInstanceE", "slint::interpreter::ComponentInstance"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance10definitionEv", "slint::interpreter::ComponentInstance::definition"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property::global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE", "slint::interpreter::ComponentInstance::get_global_property::prop_name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE", "slint::interpreter::ComponentInstance::get_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE", "slint::interpreter::ComponentInstance::get_property::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance4hideEv", "slint::interpreter::ComponentInstance::hide"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke::args"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::args"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::callable_name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE", "slint::interpreter::ComponentInstance::invoke_global::global"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance7qwidgetEv", "slint::interpreter::ComponentInstance::qwidget"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance3runEv", "slint::interpreter::ComponentInstance::run"], [13, 2, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback"], [13, 6, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::F"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::callback"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_callback::name"], [13, 2, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback"], [13, 6, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::F"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::callback"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::global"], [13, 3, 1, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F", "slint::interpreter::ComponentInstance::set_global_callback::name"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::global"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::prop_name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_global_property::value"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property::name"], [13, 3, 1, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value", "slint::interpreter::ComponentInstance::set_property::value"], [13, 2, 1, "_CPPv4NK5slint11interpreter17ComponentInstance4showEv", "slint::interpreter::ComponentInstance::show"], [13, 2, 1, "_CPPv4N5slint11interpreter17ComponentInstance6windowEv", "slint::interpreter::ComponentInstance::window"], [163, 1, 1, "_CPPv4N5slint11interpreter10DiagnosticE", "slint::interpreter::Diagnostic"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic6columnE", "slint::interpreter::Diagnostic::column"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic5levelE", "slint::interpreter::Diagnostic::level"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic4lineE", "slint::interpreter::Diagnostic::line"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic7messageE", "slint::interpreter::Diagnostic::message"], [163, 7, 1, "_CPPv4N5slint11interpreter10Diagnostic11source_fileE", "slint::interpreter::Diagnostic::source_file"], [47, 4, 1, "_CPPv4N5slint11interpreter15DiagnosticLevelE", "slint::interpreter::DiagnosticLevel"], [47, 5, 1, "_CPPv4N5slint11interpreter15DiagnosticLevel5ErrorE", "slint::interpreter::DiagnosticLevel::Error"], [47, 5, 1, "_CPPv4N5slint11interpreter15DiagnosticLevel7WarningE", "slint::interpreter::DiagnosticLevel::Warning"], [164, 1, 1, "_CPPv4N5slint11interpreter18PropertyDescriptorE", "slint::interpreter::PropertyDescriptor"], [164, 7, 1, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_nameE", "slint::interpreter::PropertyDescriptor::property_name"], [164, 7, 1, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_typeE", "slint::interpreter::PropertyDescriptor::property_type"], [165, 1, 1, "_CPPv4N5slint11interpreter6StructE", "slint::interpreter::Struct"], [165, 2, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct", "slint::interpreter::Struct::Struct"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct6StructEv", "slint::interpreter::Struct::Struct"], [165, 6, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::InputIterator"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE", "slint::interpreter::Struct::Struct::args"], [165, 3, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::end"], [165, 3, 1, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator", "slint::interpreter::Struct::Struct::it"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct", "slint::interpreter::Struct::Struct::other"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct", "slint::interpreter::Struct::Struct::other"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct5beginEv", "slint::interpreter::Struct::begin"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct3endEv", "slint::interpreter::Struct::end"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE", "slint::interpreter::Struct::get_field"], [165, 3, 1, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE", "slint::interpreter::Struct::get_field::name"], [165, 1, 1, "_CPPv4N5slint11interpreter6Struct8iteratorE", "slint::interpreter::Struct::iterator"], [166, 1, 1, "_CPPv4N5slint11interpreter6Struct8iteratorE", "slint::interpreter::Struct::iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator", "slint::interpreter::Struct::iterator::iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator", "slint::interpreter::Struct::iterator::iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator::other"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator", "slint::interpreter::Struct::iterator::iterator::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::a"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::a"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::b"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator!=::b"], [165, 2, 1, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv", "slint::interpreter::Struct::iterator::operator*"], [166, 2, 1, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv", "slint::interpreter::Struct::iterator::operator*"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorppEv", "slint::interpreter::Struct::iterator::operator++"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorppEv", "slint::interpreter::Struct::iterator::operator++"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator", "slint::interpreter::Struct::iterator::operator="], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator", "slint::interpreter::Struct::iterator::operator="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator=::other"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator", "slint::interpreter::Struct::iterator::operator=::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator=="], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator=="], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::a"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::a"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::b"], [166, 3, 1, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator", "slint::interpreter::Struct::iterator::operator==::b"], [165, 8, 1, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE", "slint::interpreter::Struct::iterator::value_type"], [166, 8, 1, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE", "slint::interpreter::Struct::iterator::value_type"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev", "slint::interpreter::Struct::iterator::~iterator"], [166, 2, 1, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev", "slint::interpreter::Struct::iterator::~iterator"], [165, 2, 1, "_CPPv4N5slint11interpreter6StructaSERK6Struct", "slint::interpreter::Struct::operator="], [165, 2, 1, "_CPPv4N5slint11interpreter6StructaSERR6Struct", "slint::interpreter::Struct::operator="], [165, 3, 1, "_CPPv4N5slint11interpreter6StructaSERK6Struct", "slint::interpreter::Struct::operator=::other"], [165, 3, 1, "_CPPv4N5slint11interpreter6StructaSERR6Struct", "slint::interpreter::Struct::operator=::other"], [165, 2, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field::name"], [165, 3, 1, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value", "slint::interpreter::Struct::set_field::value"], [165, 2, 1, "_CPPv4N5slint11interpreter6StructD0Ev", "slint::interpreter::Struct::~Struct"], [14, 1, 1, "_CPPv4N5slint11interpreter5ValueE", "slint::interpreter::Value"], [14, 8, 1, "_CPPv4N5slint11interpreter5Value4TypeE", "slint::interpreter::Value::Type"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Image", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Value", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueERR5Value", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEb", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEd", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEi", "slint::interpreter::Value::Value"], [14, 2, 1, "_CPPv4N5slint11interpreter5Value5ValueEv", "slint::interpreter::Value::Value"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEb", "slint::interpreter::Value::Value::b"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE", "slint::interpreter::Value::Value::brush"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Image", "slint::interpreter::Value::Value::img"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE", "slint::interpreter::Value::Value::m"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK5Value", "slint::interpreter::Value::Value::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERR5Value", "slint::interpreter::Value::Value::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString", "slint::interpreter::Value::Value::str"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct", "slint::interpreter::Value::Value::struc"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE", "slint::interpreter::Value::Value::v"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEd", "slint::interpreter::Value::Value::value"], [14, 3, 1, "_CPPv4N5slint11interpreter5Value5ValueEi", "slint::interpreter::Value::Value::value"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueaSERK5Value", "slint::interpreter::Value::operator="], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueaSERR5Value", "slint::interpreter::Value::operator="], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueaSERK5Value", "slint::interpreter::Value::operator=::other"], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueaSERR5Value", "slint::interpreter::Value::operator=::other"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator=="], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator==::a"], [14, 3, 1, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value", "slint::interpreter::Value::operator==::b"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_arrayEv", "slint::interpreter::Value::to_array"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value7to_boolEv", "slint::interpreter::Value::to_bool"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_brushEv", "slint::interpreter::Value::to_brush"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value8to_imageEv", "slint::interpreter::Value::to_image"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_numberEv", "slint::interpreter::Value::to_number"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_stringEv", "slint::interpreter::Value::to_string"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value9to_structEv", "slint::interpreter::Value::to_struct"], [14, 2, 1, "_CPPv4NK5slint11interpreter5Value4typeEv", "slint::interpreter::Value::type"], [14, 2, 1, "_CPPv4N5slint11interpreter5ValueD0Ev", "slint::interpreter::Value::~Value"], [46, 4, 1, "_CPPv4N5slint11interpreter9ValueTypeE", "slint::interpreter::ValueType"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType4BoolE", "slint::interpreter::ValueType::Bool"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5BrushE", "slint::interpreter::ValueType::Brush"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5ImageE", "slint::interpreter::ValueType::Image"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5ModelE", "slint::interpreter::ValueType::Model"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6NumberE", "slint::interpreter::ValueType::Number"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType5OtherE", "slint::interpreter::ValueType::Other"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6StringE", "slint::interpreter::ValueType::String"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType6StructE", "slint::interpreter::ValueType::Struct"], [46, 5, 1, "_CPPv4N5slint11interpreter9ValueType4VoidE", "slint::interpreter::ValueType::Void"], [98, 2, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop"], [98, 6, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop::Functor"], [98, 3, 1, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor", "slint::invoke_from_event_loop::f"], [15, 1, 1, "_CPPv4N5slint8platform16AbstractRendererE", "slint::platform::AbstractRenderer"], [16, 1, 1, "_CPPv4N5slint8platform18NativeWindowHandleE", "slint::platform::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERK18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleEv", "slint::platform::NativeWindowHandle::NativeWindowHandle"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::NativeWindowHandle::other"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit::nsview"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow", "slint::platform::NativeWindowHandle::from_appkit::nswindow"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland::display"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display", "slint::platform::NativeWindowHandle::from_wayland::surface"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32::hinstance"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv", "slint::platform::NativeWindowHandle::from_win32::hwnd"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::connection"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::screen"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::visual_id"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti", "slint::platform::NativeWindowHandle::from_x11_xcb::window"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::display"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::screen"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::visual_id"], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi", "slint::platform::NativeWindowHandle::from_x11_xlib::window"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERK18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator="], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator="], [16, 3, 1, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle", "slint::platform::NativeWindowHandle::operator=::other"], [16, 2, 1, "_CPPv4N5slint8platform18NativeWindowHandleD0Ev", "slint::platform::NativeWindowHandle::~NativeWindowHandle"], [17, 1, 1, "_CPPv4N5slint8platform8PlatformE", "slint::platform::Platform"], [17, 4, 1, "_CPPv4N5slint8platform8Platform9ClipboardE", "slint::platform::Platform::Clipboard"], [17, 5, 1, "_CPPv4N5slint8platform8Platform9Clipboard16DefaultClipboardE", "slint::platform::Platform::Clipboard::DefaultClipboard"], [17, 5, 1, "_CPPv4N5slint8platform8Platform9Clipboard18SelectionClipboardE", "slint::platform::Platform::Clipboard::SelectionClipboard"], [17, 2, 1, "_CPPv4N5slint8platform8Platform8PlatformERK8Platform", "slint::platform::Platform::Platform"], [17, 2, 1, "_CPPv4N5slint8platform8Platform8PlatformEv", "slint::platform::Platform::Platform"], [17, 1, 1, "_CPPv4N5slint8platform8Platform4TaskE", "slint::platform::Platform::Task"], [18, 1, 1, "_CPPv4N5slint8platform8Platform4TaskE", "slint::platform::Platform::Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task", "slint::platform::Platform::Task::Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task", "slint::platform::Platform::Task::Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task"], [17, 3, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task::other"], [18, 3, 1, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task", "slint::platform::Platform::Task::Task::other"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task", "slint::platform::Platform::Task::operator="], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator="], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task", "slint::platform::Platform::Task::operator="], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator="], [17, 3, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator=::other"], [18, 3, 1, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task", "slint::platform::Platform::Task::operator=::other"], [17, 2, 1, "_CPPv4NO5slint8platform8Platform4Task3runEv", "slint::platform::Platform::Task::run"], [18, 2, 1, "_CPPv4NO5slint8platform8Platform4Task3runEv", "slint::platform::Platform::Task::run"], [17, 2, 1, "_CPPv4N5slint8platform8Platform4TaskD0Ev", "slint::platform::Platform::Task::~Task"], [18, 2, 1, "_CPPv4N5slint8platform8Platform4TaskD0Ev", "slint::platform::Platform::Task::~Task"], [17, 2, 1, "_CPPv4N5slint8platform8Platform14clipboard_textE9Clipboard", "slint::platform::Platform::clipboard_text"], [17, 2, 1, "_CPPv4N5slint8platform8Platform21create_window_adapterEv", "slint::platform::Platform::create_window_adapter"], [17, 2, 1, "_CPPv4N5slint8platform8Platform20duration_since_startEv", "slint::platform::Platform::duration_since_start"], [17, 2, 1, "_CPPv4N5slint8platform8PlatformaSERK8Platform", "slint::platform::Platform::operator="], [17, 2, 1, "_CPPv4N5slint8platform8Platform15quit_event_loopEv", "slint::platform::Platform::quit_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform14run_event_loopEv", "slint::platform::Platform::run_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform17run_in_event_loopE4Task", "slint::platform::Platform::run_in_event_loop"], [17, 2, 1, "_CPPv4N5slint8platform8Platform18set_clipboard_textERK12SharedString9Clipboard", "slint::platform::Platform::set_clipboard_text"], [17, 2, 1, "_CPPv4N5slint8platform8PlatformD0Ev", "slint::platform::Platform::~Platform"], [167, 1, 1, "_CPPv4N5slint8platform11Rgb565PixelE", "slint::platform::Rgb565Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel", "slint::platform::Rgb565Pixel::Rgb565Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelEv", "slint::platform::Rgb565Pixel::Rgb565Pixel"], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel", "slint::platform::Rgb565Pixel::Rgb565Pixel::pixel"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1bE", "slint::platform::Rgb565Pixel::b"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel4blueEv", "slint::platform::Rgb565Pixel::blue"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1gE", "slint::platform::Rgb565Pixel::g"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel5greenEv", "slint::platform::Rgb565Pixel::green"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixelcv9Rgb8PixelEv", "slint::platform::Rgb565Pixel::operator Rgb8Pixel"], [167, 2, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator=="], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator==::lhs"], [167, 3, 1, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel", "slint::platform::Rgb565Pixel::operator==::rhs"], [167, 7, 1, "_CPPv4N5slint8platform11Rgb565Pixel1rE", "slint::platform::Rgb565Pixel::r"], [167, 2, 1, "_CPPv4NK5slint8platform11Rgb565Pixel3redEv", "slint::platform::Rgb565Pixel::red"], [19, 1, 1, "_CPPv4N5slint8platform12SkiaRendererE", "slint::platform::SkiaRenderer"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK12SkiaRenderer", "slint::platform::SkiaRenderer::SkiaRenderer"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer"], [19, 3, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer::initial_size"], [19, 3, 1, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize", "slint::platform::SkiaRenderer::SkiaRenderer::window_handle"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRendereraSERK12SkiaRenderer", "slint::platform::SkiaRenderer::operator="], [19, 2, 1, "_CPPv4NK5slint8platform12SkiaRenderer6renderEv", "slint::platform::SkiaRenderer::render"], [19, 2, 1, "_CPPv4N5slint8platform12SkiaRendererD0Ev", "slint::platform::SkiaRenderer::~SkiaRenderer"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRendererE", "slint::platform::SoftwareRenderer"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE", "slint::platform::SoftwareRenderer::PhysicalRegion"], [168, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE", "slint::platform::SoftwareRenderer::PhysicalRegion"], [20, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [168, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [169, 1, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect"], [20, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [168, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [169, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::origin"], [20, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [168, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [169, 7, 1, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE", "slint::platform::SoftwareRenderer::PhysicalRegion::Rect::size"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_origin"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_origin"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_size"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv", "slint::platform::SoftwareRenderer::PhysicalRegion::bounding_box_size"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv", "slint::platform::SoftwareRenderer::PhysicalRegion::rectangles"], [168, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv", "slint::platform::SoftwareRenderer::PhysicalRegion::rectangles"], [20, 4, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotationE", "slint::platform::SoftwareRenderer::RenderingRotation"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation10NoRotationE", "slint::platform::SoftwareRenderer::RenderingRotation::NoRotation"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate180E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate180"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate270E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate270"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation8Rotate90E", "slint::platform::SoftwareRenderer::RenderingRotation::Rotate90"], [20, 4, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferTypeE", "slint::platform::SoftwareRenderer::RepaintBufferType"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType9NewBufferE", "slint::platform::SoftwareRenderer::RepaintBufferType::NewBuffer"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType12ReusedBufferE", "slint::platform::SoftwareRenderer::RepaintBufferType::ReusedBuffer"], [20, 5, 1, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType14SwappedBuffersE", "slint::platform::SoftwareRenderer::RepaintBufferType::SwappedBuffers"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType", "slint::platform::SoftwareRenderer::SoftwareRenderer"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererERK16SoftwareRenderer", "slint::platform::SoftwareRenderer::SoftwareRenderer"], [20, 3, 1, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType", "slint::platform::SoftwareRenderer::SoftwareRenderer::buffer_type"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRendereraSERK16SoftwareRenderer", "slint::platform::SoftwareRenderer::operator="], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render"], [20, 2, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render::buffer"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render::buffer"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE", "slint::platform::SoftwareRenderer::render::pixel_stride"], [20, 3, 1, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE", "slint::platform::SoftwareRenderer::render::pixel_stride"], [20, 2, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line"], [20, 6, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line::Callback"], [20, 3, 1, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback", "slint::platform::SoftwareRenderer::render_by_line::process_line_callback"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation", "slint::platform::SoftwareRenderer::set_rendering_rotation"], [20, 3, 1, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation", "slint::platform::SoftwareRenderer::set_rendering_rotation::rotation"], [20, 2, 1, "_CPPv4N5slint8platform16SoftwareRendererD0Ev", "slint::platform::SoftwareRenderer::~SoftwareRenderer"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapterE", "slint::platform::WindowAdapter"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter13WindowAdapterEv", "slint::platform::WindowAdapter::WindowAdapter"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE", "slint::platform::WindowAdapter::WindowProperties"], [170, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE", "slint::platform::WindowAdapter::WindowProperties"], [21, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [170, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [171, 1, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::max"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::min"], [21, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [170, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [171, 7, 1, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE", "slint::platform::WindowAdapter::WindowProperties::LayoutConstraints::preferred"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv", "slint::platform::WindowAdapter::WindowProperties::background"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv", "slint::platform::WindowAdapter::WindowProperties::background"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::fullscreen"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::fullscreen"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::is_fullscreen"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv", "slint::platform::WindowAdapter::WindowProperties::is_fullscreen"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv", "slint::platform::WindowAdapter::WindowProperties::is_maximized"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv", "slint::platform::WindowAdapter::WindowProperties::is_maximized"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv", "slint::platform::WindowAdapter::WindowProperties::is_minimized"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv", "slint::platform::WindowAdapter::WindowProperties::is_minimized"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv", "slint::platform::WindowAdapter::WindowProperties::layout_constraints"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv", "slint::platform::WindowAdapter::WindowProperties::layout_constraints"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv", "slint::platform::WindowAdapter::WindowProperties::title"], [170, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv", "slint::platform::WindowAdapter::WindowProperties::title"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8positionEv", "slint::platform::WindowAdapter::position"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8rendererEv", "slint::platform::WindowAdapter::renderer"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter14request_redrawEv", "slint::platform::WindowAdapter::request_redraw"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter12set_positionEN5slint16PhysicalPositionE", "slint::platform::WindowAdapter::set_position"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter8set_sizeEN5slint12PhysicalSizeE", "slint::platform::WindowAdapter::set_size"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter11set_visibleEb", "slint::platform::WindowAdapter::set_visible"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter4sizeEv", "slint::platform::WindowAdapter::size"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter24update_window_propertiesERK16WindowProperties", "slint::platform::WindowAdapter::update_window_properties"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapter6windowEv", "slint::platform::WindowAdapter::window"], [21, 2, 1, "_CPPv4NK5slint8platform13WindowAdapter6windowEv", "slint::platform::WindowAdapter::window"], [21, 2, 1, "_CPPv4N5slint8platform13WindowAdapterD0Ev", "slint::platform::WindowAdapter::~WindowAdapter"], [93, 2, 1, "_CPPv4N5slint8platform32duration_until_next_timer_updateEv", "slint::platform::duration_until_next_timer_update"], [95, 2, 1, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE", "slint::platform::set_platform"], [95, 3, 1, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE", "slint::platform::set_platform::platform"], [94, 2, 1, "_CPPv4N5slint8platform28update_timers_and_animationsEv", "slint::platform::update_timers_and_animations"], [97, 2, 1, "_CPPv4N5slint15quit_event_loopEv", "slint::quit_event_loop"], [100, 2, 1, "_CPPv4N5slint14run_event_loopE13EventLoopMode", "slint::run_event_loop"], [100, 3, 1, "_CPPv4N5slint14run_event_loopE13EventLoopMode", "slint::run_event_loop::mode"], [48, 4, 1, "_CPPv4N5slint7testing14AccessibleRoleE", "slint::testing::AccessibleRole"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6ButtonE", "slint::testing::AccessibleRole::Button"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole8CheckboxE", "slint::testing::AccessibleRole::Checkbox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole8ComboboxE", "slint::testing::AccessibleRole::Combobox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4ListE", "slint::testing::AccessibleRole::List"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole8ListItemE", "slint::testing::AccessibleRole::ListItem"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4NoneE", "slint::testing::AccessibleRole::None"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole17ProgressIndicatorE", "slint::testing::AccessibleRole::ProgressIndicator"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6SliderE", "slint::testing::AccessibleRole::Slider"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole7SpinboxE", "slint::testing::AccessibleRole::Spinbox"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole6SwitchE", "slint::testing::AccessibleRole::Switch"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole3TabE", "slint::testing::AccessibleRole::Tab"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole7TabListE", "slint::testing::AccessibleRole::TabList"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole5TableE", "slint::testing::AccessibleRole::Table"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4TextE", "slint::testing::AccessibleRole::Text"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole9TextInputE", "slint::testing::AccessibleRole::TextInput"], [48, 5, 1, "_CPPv4N5slint7testing14AccessibleRole4TreeE", "slint::testing::AccessibleRole::Tree"], [22, 1, 1, "_CPPv4N5slint7testing13ElementHandleE", "slint::testing::ElementHandle"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle17absolute_positionEv", "slint::testing::ElementHandle::absolute_position"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle20accessible_checkableEv", "slint::testing::ElementHandle::accessible_checkable"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle18accessible_checkedEv", "slint::testing::ElementHandle::accessible_checked"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle22accessible_descriptionEv", "slint::testing::ElementHandle::accessible_description"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle16accessible_labelEv", "slint::testing::ElementHandle::accessible_label"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle27accessible_placeholder_textEv", "slint::testing::ElementHandle::accessible_placeholder_text"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle15accessible_roleEv", "slint::testing::ElementHandle::accessible_role"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle16accessible_valueEv", "slint::testing::ElementHandle::accessible_value"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_maximumEv", "slint::testing::ElementHandle::accessible_value_maximum"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_minimumEv", "slint::testing::ElementHandle::accessible_value_minimum"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle21accessible_value_stepEv", "slint::testing::ElementHandle::accessible_value_step"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle5basesEv", "slint::testing::ElementHandle::bases"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_accessible_label::label"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_id::element_id"], [22, 2, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name"], [22, 6, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::T"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::component"], [22, 3, 1, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE", "slint::testing::ElementHandle::find_by_element_type_name::type_name"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle2idEv", "slint::testing::ElementHandle::id"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_decrement_actionEv", "slint::testing::ElementHandle::invoke_accessible_decrement_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle32invoke_accessible_default_actionEv", "slint::testing::ElementHandle::invoke_accessible_default_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_increment_actionEv", "slint::testing::ElementHandle::invoke_accessible_increment_action"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle8is_validEv", "slint::testing::ElementHandle::is_valid"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString", "slint::testing::ElementHandle::set_accessible_value"], [22, 3, 1, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString", "slint::testing::ElementHandle::set_accessible_value::value"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle4sizeEv", "slint::testing::ElementHandle::size"], [22, 2, 1, "_CPPv4NK5slint7testing13ElementHandle9type_nameEv", "slint::testing::ElementHandle::type_name"], [22, 2, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::R"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::T"], [22, 6, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::Visitor"], [22, 3, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::component"], [22, 3, 1, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor", "slint::testing::ElementHandle::visit_elements::visitor"], [96, 2, 1, "_CPPv4N5slint7testing4initEv", "slint::testing::init"], [101, 2, 1, "_CPPv4N5slint23update_all_translationsEv", "slint::update_all_translations"]]}, "objtypes": {"0": "c:macro", "1": "cpp:class", "2": "cpp:function", "3": "cpp:functionParam", "4": "cpp:enum", "5": "cpp:enumerator", "6": "cpp:templateParam", "7": "cpp:member", "8": "cpp:type"}, "objnames": {"0": ["c", "macro", "C macro"], "1": ["cpp", "class", "C++ class"], "2": ["cpp", "function", "C++ function"], "3": ["cpp", "functionParam", "C++ function parameter"], "4": ["cpp", "enum", "C++ enum"], "5": ["cpp", "enumerator", "C++ enumerator"], "6": ["cpp", "templateParam", "C++ template parameter"], "7": ["cpp", "member", "C++ member"], "8": ["cpp", "type", "C++ type"]}, "titleterms": {"class": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 55, 56, 57, 58, 59, 61, 63, 66, 68, 69, 70, 72, 73, 75, 80, 83, 102, 103, 104, 105, 107], "brush": 0, "document": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 46, 47, 48, 49, 50, 51, 52, 53, 54, 93, 94, 95, 96, 97, 98, 99, 100, 101, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 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, 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, 232], "color": [1, 233], "templat": [2, 3, 4, 5, 6, 7, 8, 9, 98, 99, 153, 156, 157, 159, 160, 231], "componenthandl": 2, "componentweakhandl": 3, "filtermodel": 4, "inherit": [4, 5, 6, 7, 8, 9, 13, 15, 19, 20, 149, 150, 151, 152], "relationship": [4, 5, 6, 7, 8, 9, 13, 15, 17, 18, 19, 20, 21, 149, 150, 151, 152, 165, 166, 168, 169, 170, 171], "base": [4, 5, 7, 8, 9, 13, 19, 20, 149, 150, 151, 152], "type": [4, 5, 6, 7, 8, 9, 13, 15, 17, 19, 20, 21, 149, 150, 151, 152, 165, 168, 170, 240], "mapmodel": 5, "model": 6, "deriv": [6, 15], "reversemodel": 7, "sortmodel": 8, "vectormodel": 9, "window": 10, "componentcompil": 11, "componentdefinit": 12, "componentinst": 13, "valu": 14, "abstractrender": 15, "nativewindowhandl": 16, "platform": [17, 18, 56, 93, 94, 95, 105, 106, 110, 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, 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], "nest": [17, 18, 20, 21, 165, 166, 168, 169, 170, 171], "task": 18, "skiarender": 19, "softwarerender": [20, 168], "windowadapt": [21, 170], "exampl": [21, 229], "elementhandl": 22, "defin": [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 71, 80, 102], "slint_feature_backend_qt": 23, "slint_feature_gettext": 24, "slint_feature_interpret": 25, "slint_version_patch": 26, "slint_feature_backend_linuxkm": 27, "slint_feature_experiment": 28, "slint_version_str": 29, "slint_feature_renderer_femtovg": 30, "slint_feature_renderer_skia": 31, "slint_feature_system_test": 32, "slint_feature_access": 33, "slint_feature_renderer_softwar": 34, "slint_version_minor": 35, "slint_feature_freestand": 36, "slint_feature_test": 37, "slint_version_major": 38, "slint_feature_backend_winit": 39, "assert_eq": 40, "directori": [41, 42, 43, 44, 45, 172], "api": [41, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 102, 172], "subdirectori": [41, 42, 44], "cpp": [42, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "includ": [43, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "file": [43, 45, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 172], "cppdoc": [44, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "generated_includ": [45, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "enum": [46, 47, 48, 49, 50, 51, 52, 53, 54, 58, 78, 80, 83, 102, 103, 104, 107, 240], "valuetyp": 46, "diagnosticlevel": 47, "accessiblerol": 48, "setrenderingnotifiererror": 49, "pointereventbutton": 50, "eventloopmod": 51, "graphicsapi": 52, "renderingst": 53, "closerequestrespons": 54, "slint": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 93, 94, 95, 96, 97, 98, 99, 100, 101, 103, 104, 105, 106, 107, 109, 110, 111, 112, 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, 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, 232, 233, 235, 238, 239], "interpret": [55, 104, 109, 239], "h": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "definit": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 233], "home": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 214], "runner": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "work": [55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], "By": [55, 57, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92], "namespac": [55, 56, 57, 58, 59, 60, 61, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 102, 103, 104, 105, 106, 107], "function": [56, 57, 58, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 105, 107], "test": [57, 96, 107, 111], "slint_brush": [59, 113], "slint_callback": [60, 114], "slint_color": [61, 115], "slint_config": [62, 116], "slint_imag": [63, 117], "slint_interpret": [64, 118], "slint_pathdata": [65, 119], "slint_point": [66, 120], "slint_properti": [67, 121], "slint_sharedvector": [68, 122], "slint_siz": [69, 123], "slint_str": [70, 124], "slint_tests_help": [71, 125], "slint_tim": [72, 126], "slint_window": [73, 127], "slint_brush_intern": [74, 128], "slint_builtin_struct": [75, 129], "slint_builtin_structs_intern": [76, 130], "slint_color_intern": [77, 131], "slint_enum": [78, 132], "variabl": [78, 102, 106, 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, 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], "slint_enums_intern": [79, 133], "slint_generated_publ": [80, 134], "slint_image_intern": [81, 135], "slint_intern": [82, 136], "slint_interpreter_generated_publ": [83, 137], "slint_interpreter_intern": [84, 138], "slint_pathdata_intern": [85, 139], "slint_platform_intern": [86, 140], "slint_properties_intern": [87, 141], "slint_qt_intern": [88, 142], "slint_sharedvector_intern": [89, 143], "slint_string_intern": [90, 144], "slint_testing_intern": [91, 145], "slint_timer_intern": [92, 146], "duration_until_next_timer_upd": 93, "update_timers_and_anim": 94, "set_platform": 95, "init": 96, "quit_event_loop": 97, "invoke_from_event_loop": 98, "blocking_invoke_from_event_loop": 99, "run_event_loop": 100, "update_all_transl": 101, "c": [102, 230, 232], "refer": [102, 228], "page": [102, 172], "hierarchi": 102, "full": [102, 172], "struct": [102, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171], "detail": [103, 104, 105, 106, 107], "descript": [103, 104, 105, 106, 107], "key_cod": [106, 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, 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], "deprec": 108, "list": [108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "program": [109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146], "hsvacolor": 147, "imag": 148, "logicalposit": 149, "logicals": 150, "physicalposit": 151, "physicals": 152, "point": 153, "rgb8pixel": 154, "rgba8pixel": 155, "rgbacolor": 156, "sharedpixelbuff": 157, "sharedstr": 158, "sharedvector": 159, "size": 160, "standardlistviewitem": 161, "timer": 162, "diagnost": 163, "propertydescriptor": 164, "iter": 166, "rgb565pixel": 167, "physicalregion": [168, 169], "rect": 169, "windowproperti": [170, 171], "layoutconstraint": 171, "f24": 173, "f1": 174, "capslock": 175, "space": 176, "menu": 177, "leftarrow": 178, "metar": 179, "paus": 180, "f4": 181, "f12": 182, "insert": 183, "downarrow": 184, "altgr": 185, "alt": 186, "f23": 187, "stop": 188, "f19": 189, "scrolllock": 190, "f13": 191, "f15": 192, "f14": 193, "backspac": 194, "f5": 195, "f6": 196, "meta": 197, "f9": 198, "f20": 199, "uparrow": 200, "f10": 201, "f2": 202, "f8": 203, "f18": 204, "pagedown": 205, "f11": 206, "f3": 207, "control": 208, "f16": 209, "controlr": 210, "return": 211, "f7": 212, "backtab": 213, "rightarrow": 215, "escap": 216, "sysreq": 217, "f21": 218, "f17": 219, "pageup": 220, "tab": 221, "end": 222, "shiftr": 223, "delet": 224, "shift": 225, "f22": 226, "set": 227, "up": 227, "develop": [227, 232, 234], "environ": [227, 235], "prerequisit": [227, 234, 235, 237], "instal": 227, "binari": 227, "packag": 227, "build": [227, 233], "from": 227, "sourc": 227, "featur": 227, "rust": [227, 233], "flag": 227, "backend": 227, "cross": 227, "compil": [227, 233, 235, 239], "cmake": 228, "slint_target_sourc": 228, "resourc": 228, "embed": 228, "scale": 228, "factor": 228, "microcontrol": 228, "gener": [229, 235, 238], "code": 229, "global": 229, "singleton": 229, "index": 230, "get": 231, "start": 231, "tutori": 231, "The": [232, 233], "markup": 232, "languag": 232, "architectur": 232, "troubleshoot": 233, "error": 233, "dure": 233, "devic": 233, "crash": 233, "boot": 233, "enter": 233, "loop": 233, "wrong": 233, "shown": 233, "about": 233, "multipl": 233, "symbol": 233, "when": 233, "link": 233, "espressif": 234, "": 234, "iot": 234, "framework": 234, "first": [234, 237], "step": [234, 235, 237], "next": [234, 235, 237], "mcu": [235, 238], "setup": 235, "introduct": 236, "stmicroelectron": 237, "stm32cube": 237, "ecosystem": 237, "instruct": 238, "stm32": 238, "overview": 239, "design": 239, "run": 239, "time": 239, "map": 240, "structur": 240}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 58}, "alltitles": {"Class Brush": [[0, "class-brush"]], "Class Documentation": [[0, "class-documentation"], [1, "class-documentation"], [2, "class-documentation"], [3, "class-documentation"], [4, "class-documentation"], [5, "class-documentation"], [6, "class-documentation"], [7, "class-documentation"], [8, "class-documentation"], [9, "class-documentation"], [10, "class-documentation"], [11, "class-documentation"], [12, "class-documentation"], [13, "class-documentation"], [14, "class-documentation"], [15, "class-documentation"], [16, "class-documentation"], [17, "class-documentation"], [18, "class-documentation"], [19, "class-documentation"], [20, "class-documentation"], [21, "class-documentation"], [22, "class-documentation"]], "Class Color": [[1, "class-color"]], "Template Class ComponentHandle": [[2, "template-class-componenthandle"]], "Template Class ComponentWeakHandle": [[3, "template-class-componentweakhandle"]], "Template Class FilterModel": [[4, "template-class-filtermodel"]], "Inheritance Relationships": [[4, "inheritance-relationships"], [5, "inheritance-relationships"], [6, "inheritance-relationships"], [7, "inheritance-relationships"], [8, "inheritance-relationships"], [9, "inheritance-relationships"], [13, "inheritance-relationships"], [15, "inheritance-relationships"], [19, "inheritance-relationships"], [20, "inheritance-relationships"], [149, "inheritance-relationships"], [150, "inheritance-relationships"], [151, "inheritance-relationships"], [152, "inheritance-relationships"]], "Base Type": [[4, "base-type"], [5, "base-type"], [7, "base-type"], [8, "base-type"], [9, "base-type"], [13, "base-type"], [19, "base-type"], [20, "base-type"], [149, "base-type"], [150, "base-type"], [151, "base-type"], [152, "base-type"]], "Template Class MapModel": [[5, "template-class-mapmodel"]], "Template Class Model": [[6, "template-class-model"]], "Derived Types": [[6, "derived-types"], [15, "derived-types"]], "Template Class ReverseModel": [[7, "template-class-reversemodel"]], "Template Class SortModel": [[8, "template-class-sortmodel"]], "Template Class VectorModel": [[9, "template-class-vectormodel"]], "Class Window": [[10, "class-window"]], "Class ComponentCompiler": [[11, "class-componentcompiler"]], "Class ComponentDefinition": [[12, "class-componentdefinition"]], "Class ComponentInstance": [[13, "class-componentinstance"]], "Class Value": [[14, "class-value"]], "Class AbstractRenderer": [[15, "class-abstractrenderer"]], "Class NativeWindowHandle": [[16, "class-nativewindowhandle"]], "Class Platform": [[17, "class-platform"]], "Nested Relationships": [[17, "nested-relationships"], [18, "nested-relationships"], [20, "nested-relationships"], [21, "nested-relationships"], [165, "nested-relationships"], [166, "nested-relationships"], [168, "nested-relationships"], [169, "nested-relationships"], [170, "nested-relationships"], [171, "nested-relationships"]], "Nested Types": [[17, "nested-types"], [20, "nested-types"], [21, "nested-types"], [165, "nested-types"], [168, "nested-types"], [170, "nested-types"]], "Class Platform::Task": [[18, "class-platform-task"]], "Class SkiaRenderer": [[19, "class-skiarenderer"]], "Class SoftwareRenderer": [[20, "class-softwarerenderer"]], "Class WindowAdapter": [[21, "class-windowadapter"]], "Example": [[21, "classslint_1_1platform_1_1WindowAdapter_1autotoc_md0"], [229, "example"]], "Class ElementHandle": [[22, "class-elementhandle"]], "Define SLINT_FEATURE_BACKEND_QT": [[23, "define-slint-feature-backend-qt"]], "Define Documentation": [[23, "define-documentation"], [24, "define-documentation"], [25, "define-documentation"], [26, "define-documentation"], [27, "define-documentation"], [28, "define-documentation"], [29, "define-documentation"], [30, "define-documentation"], [31, "define-documentation"], [32, "define-documentation"], [33, "define-documentation"], [34, "define-documentation"], [35, "define-documentation"], [36, "define-documentation"], [37, "define-documentation"], [38, "define-documentation"], [39, "define-documentation"], [40, "define-documentation"]], "Define SLINT_FEATURE_GETTEXT": [[24, "define-slint-feature-gettext"]], "Define SLINT_FEATURE_INTERPRETER": [[25, "define-slint-feature-interpreter"]], "Define SLINT_VERSION_PATCH": [[26, "define-slint-version-patch"]], "Define SLINT_FEATURE_BACKEND_LINUXKMS": [[27, "define-slint-feature-backend-linuxkms"]], "Define SLINT_FEATURE_EXPERIMENTAL": [[28, "define-slint-feature-experimental"]], "Define SLINT_VERSION_STRING": [[29, "define-slint-version-string"]], "Define SLINT_FEATURE_RENDERER_FEMTOVG": [[30, "define-slint-feature-renderer-femtovg"]], "Define SLINT_FEATURE_RENDERER_SKIA": [[31, "define-slint-feature-renderer-skia"]], "Define SLINT_FEATURE_SYSTEM_TESTING": [[32, "define-slint-feature-system-testing"]], "Define SLINT_FEATURE_ACCESSIBILITY": [[33, "define-slint-feature-accessibility"]], "Define SLINT_FEATURE_RENDERER_SOFTWARE": [[34, "define-slint-feature-renderer-software"]], "Define SLINT_VERSION_MINOR": [[35, "define-slint-version-minor"]], "Define SLINT_FEATURE_FREESTANDING": [[36, "define-slint-feature-freestanding"]], "Define SLINT_FEATURE_TESTING": [[37, "define-slint-feature-testing"]], "Define SLINT_VERSION_MAJOR": [[38, "define-slint-version-major"]], "Define SLINT_FEATURE_BACKEND_WINIT": [[39, "define-slint-feature-backend-winit"]], "Define assert_eq": [[40, "define-assert-eq"]], "Directory api": [[41, "directory-api"]], "Subdirectories": [[41, "subdirectories"], [42, "subdirectories"], [44, "subdirectories"]], "Directory cpp": [[42, "directory-cpp"]], "Directory include": [[43, "directory-include"]], "Files": [[43, "files"], [45, "files"], [172, "files"]], "Directory cppdocs": [[44, "directory-cppdocs"]], "Directory generated_include": [[45, "directory-generated-include"]], "Enum ValueType": [[46, "enum-valuetype"]], "Enum Documentation": [[46, "enum-documentation"], [47, "enum-documentation"], [48, "enum-documentation"], [49, "enum-documentation"], [50, "enum-documentation"], [51, "enum-documentation"], [52, "enum-documentation"], [53, "enum-documentation"], [54, "enum-documentation"]], "Enum DiagnosticLevel": [[47, "enum-diagnosticlevel"]], "Enum AccessibleRole": [[48, "enum-accessiblerole"]], "Enum SetRenderingNotifierError": [[49, "enum-setrenderingnotifiererror"]], "Enum PointerEventButton": [[50, "enum-pointereventbutton"]], "Enum EventLoopMode": [[51, "enum-eventloopmode"]], "Enum GraphicsAPI": [[52, "enum-graphicsapi"]], "Enum RenderingState": [[53, "enum-renderingstate"]], "Enum CloseRequestResponse": [[54, "enum-closerequestresponse"]], "File slint-interpreter.h": [[55, "file-slint-interpreter-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-interpreter.h)": [[55, "definition-home-runner-work-slint-slint-api-cpp-include-slint-interpreter-h"]], "Includes": [[55, "includes"], [56, "includes"], [57, "includes"], [58, "includes"], [59, "includes"], [60, "includes"], [61, "includes"], [62, "includes"], [63, "includes"], [64, "includes"], [65, "includes"], [66, "includes"], [67, "includes"], [68, "includes"], [69, "includes"], [70, "includes"], [71, "includes"], [72, "includes"], [73, "includes"], [74, "includes"], [76, "includes"], [77, "includes"], [79, "includes"], [80, "includes"], [81, "includes"], [82, "includes"], [83, "includes"], [84, "includes"], [85, "includes"], [86, "includes"], [87, "includes"], [88, "includes"], [89, "includes"], [90, "includes"], [91, "includes"], [92, "includes"]], "Included By": [[55, "included-by"], [57, "included-by"], [59, "included-by"], [60, "included-by"], [61, "included-by"], [62, "included-by"], [63, "included-by"], [65, "included-by"], [66, "included-by"], [67, "included-by"], [68, "included-by"], [69, "included-by"], [70, "included-by"], [72, "included-by"], [73, "included-by"], [74, "included-by"], [75, "included-by"], [76, "included-by"], [77, "included-by"], [78, "included-by"], [79, "included-by"], [80, "included-by"], [81, "included-by"], [82, "included-by"], [83, "included-by"], [85, "included-by"], [86, "included-by"], [87, "included-by"], [88, "included-by"], [89, "included-by"], [90, "included-by"], [91, "included-by"], [92, "included-by"]], "Namespaces": [[55, "namespaces"], [56, "namespaces"], [57, "namespaces"], [58, "namespaces"], [59, "namespaces"], [60, "namespaces"], [61, "namespaces"], [63, "namespaces"], [65, "namespaces"], [66, "namespaces"], [67, "namespaces"], [68, "namespaces"], [69, "namespaces"], [70, "namespaces"], [71, "namespaces"], [72, "namespaces"], [73, "namespaces"], [74, "namespaces"], [75, "namespaces"], [76, "namespaces"], [77, "namespaces"], [78, "namespaces"], [79, "namespaces"], [80, "namespaces"], [81, "namespaces"], [82, "namespaces"], [83, "namespaces"], [84, "namespaces"], [85, "namespaces"], [86, "namespaces"], [87, "namespaces"], [88, "namespaces"], [89, "namespaces"], [90, "namespaces"], [91, "namespaces"], [92, "namespaces"], [102, "namespaces"], [103, "namespaces"], [105, "namespaces"]], "Classes": [[55, "classes"], [56, "classes"], [57, "classes"], [58, "classes"], [59, "classes"], [61, "classes"], [63, "classes"], [66, "classes"], [68, "classes"], [69, "classes"], [70, "classes"], [72, "classes"], [73, "classes"], [75, "classes"], [80, "classes"], [83, "classes"], [103, "classes"], [104, "classes"], [105, "classes"], [107, "classes"]], "File slint-platform.h": [[56, "file-slint-platform-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-platform.h)": [[56, "definition-home-runner-work-slint-slint-api-cpp-include-slint-platform-h"]], "Functions": [[56, "functions"], [57, "functions"], [58, "functions"], [102, "functions"], [103, "functions"], [105, "functions"], [107, "functions"]], "File slint-testing.h": [[57, "file-slint-testing-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint-testing.h)": [[57, "definition-home-runner-work-slint-slint-api-cpp-include-slint-testing-h"]], "File slint.h": [[58, "file-slint-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint.h)": [[58, "definition-home-runner-work-slint-slint-api-cpp-include-slint-h"]], "Enums": [[58, "enums"], [78, "enums"], [80, "enums"], [83, "enums"], [102, "enums"], [103, "enums"], [104, "enums"], [107, "enums"], [240, "enums"]], "File slint_brush.h": [[59, "file-slint-brush-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_brush.h)": [[59, "definition-home-runner-work-slint-slint-api-cpp-include-slint-brush-h"]], "File slint_callbacks.h": [[60, "file-slint-callbacks-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_callbacks.h)": [[60, "definition-home-runner-work-slint-slint-api-cpp-include-slint-callbacks-h"]], "File slint_color.h": [[61, "file-slint-color-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_color.h)": [[61, "definition-home-runner-work-slint-slint-api-cpp-include-slint-color-h"]], "File slint_config.h": [[62, "file-slint-config-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_config.h)": [[62, "definition-home-runner-work-slint-slint-api-cpp-include-slint-config-h"]], "File slint_image.h": [[63, "file-slint-image-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_image.h)": [[63, "definition-home-runner-work-slint-slint-api-cpp-include-slint-image-h"]], "File slint_interpreter.h": [[64, "file-slint-interpreter-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_interpreter.h)": [[64, "definition-home-runner-work-slint-slint-api-cpp-include-slint-interpreter-h"]], "File slint_pathdata.h": [[65, "file-slint-pathdata-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_pathdata.h)": [[65, "definition-home-runner-work-slint-slint-api-cpp-include-slint-pathdata-h"]], "File slint_point.h": [[66, "file-slint-point-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_point.h)": [[66, "definition-home-runner-work-slint-slint-api-cpp-include-slint-point-h"]], "File slint_properties.h": [[67, "file-slint-properties-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_properties.h)": [[67, "definition-home-runner-work-slint-slint-api-cpp-include-slint-properties-h"]], "File slint_sharedvector.h": [[68, "file-slint-sharedvector-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_sharedvector.h)": [[68, "definition-home-runner-work-slint-slint-api-cpp-include-slint-sharedvector-h"]], "File slint_size.h": [[69, "file-slint-size-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_size.h)": [[69, "definition-home-runner-work-slint-slint-api-cpp-include-slint-size-h"]], "File slint_string.h": [[70, "file-slint-string-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_string.h)": [[70, "definition-home-runner-work-slint-slint-api-cpp-include-slint-string-h"]], "File slint_tests_helpers.h": [[71, "file-slint-tests-helpers-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_tests_helpers.h)": [[71, "definition-home-runner-work-slint-slint-api-cpp-include-slint-tests-helpers-h"]], "Defines": [[71, "defines"], [80, "defines"], [102, "defines"]], "File slint_timer.h": [[72, "file-slint-timer-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_timer.h)": [[72, "definition-home-runner-work-slint-slint-api-cpp-include-slint-timer-h"]], "File slint_window.h": [[73, "file-slint-window-h"]], "Definition (/home/runner/work/slint/slint/api/cpp/include/slint_window.h)": [[73, "definition-home-runner-work-slint-slint-api-cpp-include-slint-window-h"]], "File slint_brush_internal.h": [[74, "file-slint-brush-internal-h"]], "Definition (cppdocs/generated_include/slint_brush_internal.h)": [[74, "definition-cppdocs-generated-include-slint-brush-internal-h"]], "File slint_builtin_structs.h": [[75, "file-slint-builtin-structs-h"]], "Definition (cppdocs/generated_include/slint_builtin_structs.h)": [[75, "definition-cppdocs-generated-include-slint-builtin-structs-h"]], "File slint_builtin_structs_internal.h": [[76, "file-slint-builtin-structs-internal-h"]], "Definition (cppdocs/generated_include/slint_builtin_structs_internal.h)": [[76, "definition-cppdocs-generated-include-slint-builtin-structs-internal-h"]], "File slint_color_internal.h": [[77, "file-slint-color-internal-h"]], "Definition (cppdocs/generated_include/slint_color_internal.h)": [[77, "definition-cppdocs-generated-include-slint-color-internal-h"]], "File slint_enums.h": [[78, "file-slint-enums-h"]], "Definition (cppdocs/generated_include/slint_enums.h)": [[78, "definition-cppdocs-generated-include-slint-enums-h"]], "Variables": [[78, "variables"], [102, "variables"], [106, "variables"]], "File slint_enums_internal.h": [[79, "file-slint-enums-internal-h"]], "Definition (cppdocs/generated_include/slint_enums_internal.h)": [[79, "definition-cppdocs-generated-include-slint-enums-internal-h"]], "File slint_generated_public.h": [[80, "file-slint-generated-public-h"]], "Definition (cppdocs/generated_include/slint_generated_public.h)": [[80, "definition-cppdocs-generated-include-slint-generated-public-h"]], "File slint_image_internal.h": [[81, "file-slint-image-internal-h"]], "Definition (cppdocs/generated_include/slint_image_internal.h)": [[81, "definition-cppdocs-generated-include-slint-image-internal-h"]], "File slint_internal.h": [[82, "file-slint-internal-h"]], "Definition (cppdocs/generated_include/slint_internal.h)": [[82, "definition-cppdocs-generated-include-slint-internal-h"]], "File slint_interpreter_generated_public.h": [[83, "file-slint-interpreter-generated-public-h"]], "Definition (cppdocs/generated_include/slint_interpreter_generated_public.h)": [[83, "definition-cppdocs-generated-include-slint-interpreter-generated-public-h"]], "File slint_interpreter_internal.h": [[84, "file-slint-interpreter-internal-h"]], "Definition (cppdocs/generated_include/slint_interpreter_internal.h)": [[84, "definition-cppdocs-generated-include-slint-interpreter-internal-h"]], "File slint_pathdata_internal.h": [[85, "file-slint-pathdata-internal-h"]], "Definition (cppdocs/generated_include/slint_pathdata_internal.h)": [[85, "definition-cppdocs-generated-include-slint-pathdata-internal-h"]], "File slint_platform_internal.h": [[86, "file-slint-platform-internal-h"]], "Definition (cppdocs/generated_include/slint_platform_internal.h)": [[86, "definition-cppdocs-generated-include-slint-platform-internal-h"]], "File slint_properties_internal.h": [[87, "file-slint-properties-internal-h"]], "Definition (cppdocs/generated_include/slint_properties_internal.h)": [[87, "definition-cppdocs-generated-include-slint-properties-internal-h"]], "File slint_qt_internal.h": [[88, "file-slint-qt-internal-h"]], "Definition (cppdocs/generated_include/slint_qt_internal.h)": [[88, "definition-cppdocs-generated-include-slint-qt-internal-h"]], "File slint_sharedvector_internal.h": [[89, "file-slint-sharedvector-internal-h"]], "Definition (cppdocs/generated_include/slint_sharedvector_internal.h)": [[89, "definition-cppdocs-generated-include-slint-sharedvector-internal-h"]], "File slint_string_internal.h": [[90, "file-slint-string-internal-h"]], "Definition (cppdocs/generated_include/slint_string_internal.h)": [[90, "definition-cppdocs-generated-include-slint-string-internal-h"]], "File slint_testing_internal.h": [[91, "file-slint-testing-internal-h"]], "Definition (cppdocs/generated_include/slint_testing_internal.h)": [[91, "definition-cppdocs-generated-include-slint-testing-internal-h"]], "File slint_timer_internal.h": [[92, "file-slint-timer-internal-h"]], "Definition (cppdocs/generated_include/slint_timer_internal.h)": [[92, "definition-cppdocs-generated-include-slint-timer-internal-h"]], "Function slint::platform::duration_until_next_timer_update": [[93, "function-slint-platform-duration-until-next-timer-update"]], "Function Documentation": [[93, "function-documentation"], [94, "function-documentation"], [95, "function-documentation"], [96, "function-documentation"], [97, "function-documentation"], [98, "function-documentation"], [99, "function-documentation"], [100, "function-documentation"], [101, "function-documentation"]], "Function slint::platform::update_timers_and_animations": [[94, "function-slint-platform-update-timers-and-animations"]], "Function slint::platform::set_platform": [[95, "function-slint-platform-set-platform"]], "Function slint::testing::init": [[96, "function-slint-testing-init"]], "Function slint::quit_event_loop": [[97, "function-slint-quit-event-loop"]], "Template Function slint::invoke_from_event_loop": [[98, "template-function-slint-invoke-from-event-loop"]], "Template Function slint::blocking_invoke_from_event_loop": [[99, "template-function-slint-blocking-invoke-from-event-loop"]], "Function slint::run_event_loop": [[100, "function-slint-run-event-loop"]], "Function slint::update_all_translations": [[101, "function-slint-update-all-translations"]], "C++ API Reference": [[102, "c-api-reference"]], "Page Hierarchy": [[102, "page-hierarchy"]], "Class Hierarchy": [[102, "class-hierarchy"]], "File Hierarchy": [[102, "file-hierarchy"]], "Full API": [[102, "full-api"], [172, "full-api"]], "Classes and Structs": [[102, "classes-and-structs"]], "Namespace slint": [[103, "namespace-slint"]], "Detailed Description": [[103, "detailed-description"], [104, "detailed-description"], [105, "detailed-description"], [106, "detailed-description"], [107, "detailed-description"]], "Namespace slint::interpreter": [[104, "namespace-slint-interpreter"]], "Namespace slint::platform": [[105, "namespace-slint-platform"]], "Namespace slint::platform::key_codes": [[106, "namespace-slint-platform-key-codes"]], "Namespace slint::testing": [[107, "namespace-slint-testing"]], "Deprecated List": [[108, "deprecated-list"]], "Program Listing for File slint-interpreter.h": [[109, "program-listing-for-file-slint-interpreter-h"]], "Program Listing for File slint-platform.h": [[110, "program-listing-for-file-slint-platform-h"]], "Program Listing for File slint-testing.h": [[111, "program-listing-for-file-slint-testing-h"]], "Program Listing for File slint.h": [[112, "program-listing-for-file-slint-h"]], "Program Listing for File slint_brush.h": [[113, "program-listing-for-file-slint-brush-h"]], "Program Listing for File slint_callbacks.h": [[114, "program-listing-for-file-slint-callbacks-h"]], "Program Listing for File slint_color.h": [[115, "program-listing-for-file-slint-color-h"]], "Program Listing for File slint_config.h": [[116, "program-listing-for-file-slint-config-h"]], "Program Listing for File slint_image.h": [[117, "program-listing-for-file-slint-image-h"]], "Program Listing for File slint_interpreter.h": [[118, "program-listing-for-file-slint-interpreter-h"]], "Program Listing for File slint_pathdata.h": [[119, "program-listing-for-file-slint-pathdata-h"]], "Program Listing for File slint_point.h": [[120, "program-listing-for-file-slint-point-h"]], "Program Listing for File slint_properties.h": [[121, "program-listing-for-file-slint-properties-h"]], "Program Listing for File slint_sharedvector.h": [[122, "program-listing-for-file-slint-sharedvector-h"]], "Program Listing for File slint_size.h": [[123, "program-listing-for-file-slint-size-h"]], "Program Listing for File slint_string.h": [[124, "program-listing-for-file-slint-string-h"]], "Program Listing for File slint_tests_helpers.h": [[125, "program-listing-for-file-slint-tests-helpers-h"]], "Program Listing for File slint_timer.h": [[126, "program-listing-for-file-slint-timer-h"]], "Program Listing for File slint_window.h": [[127, "program-listing-for-file-slint-window-h"]], "Program Listing for File slint_brush_internal.h": [[128, "program-listing-for-file-slint-brush-internal-h"]], "Program Listing for File slint_builtin_structs.h": [[129, "program-listing-for-file-slint-builtin-structs-h"]], "Program Listing for File slint_builtin_structs_internal.h": [[130, "program-listing-for-file-slint-builtin-structs-internal-h"]], "Program Listing for File slint_color_internal.h": [[131, "program-listing-for-file-slint-color-internal-h"]], "Program Listing for File slint_enums.h": [[132, "program-listing-for-file-slint-enums-h"]], "Program Listing for File slint_enums_internal.h": [[133, "program-listing-for-file-slint-enums-internal-h"]], "Program Listing for File slint_generated_public.h": [[134, "program-listing-for-file-slint-generated-public-h"]], "Program Listing for File slint_image_internal.h": [[135, "program-listing-for-file-slint-image-internal-h"]], "Program Listing for File slint_internal.h": [[136, "program-listing-for-file-slint-internal-h"]], "Program Listing for File slint_interpreter_generated_public.h": [[137, "program-listing-for-file-slint-interpreter-generated-public-h"]], "Program Listing for File slint_interpreter_internal.h": [[138, "program-listing-for-file-slint-interpreter-internal-h"]], "Program Listing for File slint_pathdata_internal.h": [[139, "program-listing-for-file-slint-pathdata-internal-h"]], "Program Listing for File slint_platform_internal.h": [[140, "program-listing-for-file-slint-platform-internal-h"]], "Program Listing for File slint_properties_internal.h": [[141, "program-listing-for-file-slint-properties-internal-h"]], "Program Listing for File slint_qt_internal.h": [[142, "program-listing-for-file-slint-qt-internal-h"]], "Program Listing for File slint_sharedvector_internal.h": [[143, "program-listing-for-file-slint-sharedvector-internal-h"]], "Program Listing for File slint_string_internal.h": [[144, "program-listing-for-file-slint-string-internal-h"]], "Program Listing for File slint_testing_internal.h": [[145, "program-listing-for-file-slint-testing-internal-h"]], "Program Listing for File slint_timer_internal.h": [[146, "program-listing-for-file-slint-timer-internal-h"]], "Struct HsvaColor": [[147, "struct-hsvacolor"]], "Struct Documentation": [[147, "struct-documentation"], [148, "struct-documentation"], [149, "struct-documentation"], [150, "struct-documentation"], [151, "struct-documentation"], [152, "struct-documentation"], [153, "struct-documentation"], [154, "struct-documentation"], [155, "struct-documentation"], [156, "struct-documentation"], [157, "struct-documentation"], [158, "struct-documentation"], [159, "struct-documentation"], [160, "struct-documentation"], [161, "struct-documentation"], [162, "struct-documentation"], [163, "struct-documentation"], [164, "struct-documentation"], [165, "struct-documentation"], [166, "struct-documentation"], [167, "struct-documentation"], [168, "struct-documentation"], [169, "struct-documentation"], [170, "struct-documentation"], [171, "struct-documentation"]], "Struct Image": [[148, "struct-image"]], "Struct LogicalPosition": [[149, "struct-logicalposition"]], "Struct LogicalSize": [[150, "struct-logicalsize"]], "Struct PhysicalPosition": [[151, "struct-physicalposition"]], "Struct PhysicalSize": [[152, "struct-physicalsize"]], "Template Struct Point": [[153, "template-struct-point"]], "Struct Rgb8Pixel": [[154, "struct-rgb8pixel"]], "Struct Rgba8Pixel": [[155, "struct-rgba8pixel"]], "Template Struct RgbaColor": [[156, "template-struct-rgbacolor"]], "Template Struct SharedPixelBuffer": [[157, "template-struct-sharedpixelbuffer"]], "Struct SharedString": [[158, "struct-sharedstring"]], "Template Struct SharedVector": [[159, "template-struct-sharedvector"]], "Template Struct Size": [[160, "template-struct-size"]], "Struct StandardListViewItem": [[161, "struct-standardlistviewitem"]], "Struct Timer": [[162, "struct-timer"]], "Struct Diagnostic": [[163, "struct-diagnostic"]], "Struct PropertyDescriptor": [[164, "struct-propertydescriptor"]], "Struct Struct": [[165, "struct-struct"]], "Struct Struct::iterator": [[166, "struct-struct-iterator"]], "Struct Rgb565Pixel": [[167, "struct-rgb565pixel"]], "Struct SoftwareRenderer::PhysicalRegion": [[168, "struct-softwarerenderer-physicalregion"]], "Struct PhysicalRegion::Rect": [[169, "struct-physicalregion-rect"]], "Struct WindowAdapter::WindowProperties": [[170, "struct-windowadapter-windowproperties"]], "Struct WindowProperties::LayoutConstraints": [[171, "struct-windowproperties-layoutconstraints"]], "Directories": [[172, "directories"]], "Pages": [[172, "pages"]], "Variable slint::platform::key_codes::F24": [[173, "variable-slint-platform-key-codes-f24"]], "Variable Documentation": [[173, "variable-documentation"], [174, "variable-documentation"], [175, "variable-documentation"], [176, "variable-documentation"], [177, "variable-documentation"], [178, "variable-documentation"], [179, "variable-documentation"], [180, "variable-documentation"], [181, "variable-documentation"], [182, "variable-documentation"], [183, "variable-documentation"], [184, "variable-documentation"], [185, "variable-documentation"], [186, "variable-documentation"], [187, "variable-documentation"], [188, "variable-documentation"], [189, "variable-documentation"], [190, "variable-documentation"], [191, "variable-documentation"], [192, "variable-documentation"], [193, "variable-documentation"], [194, "variable-documentation"], [195, "variable-documentation"], [196, "variable-documentation"], [197, "variable-documentation"], [198, "variable-documentation"], [199, "variable-documentation"], [200, "variable-documentation"], [201, "variable-documentation"], [202, "variable-documentation"], [203, "variable-documentation"], [204, "variable-documentation"], [205, "variable-documentation"], [206, "variable-documentation"], [207, "variable-documentation"], [208, "variable-documentation"], [209, "variable-documentation"], [210, "variable-documentation"], [211, "variable-documentation"], [212, "variable-documentation"], [213, "variable-documentation"], [214, "variable-documentation"], [215, "variable-documentation"], [216, "variable-documentation"], [217, "variable-documentation"], [218, "variable-documentation"], [219, "variable-documentation"], [220, "variable-documentation"], [221, "variable-documentation"], [222, "variable-documentation"], [223, "variable-documentation"], [224, "variable-documentation"], [225, "variable-documentation"], [226, "variable-documentation"]], "Variable slint::platform::key_codes::F1": [[174, "variable-slint-platform-key-codes-f1"]], "Variable slint::platform::key_codes::CapsLock": [[175, "variable-slint-platform-key-codes-capslock"]], "Variable slint::platform::key_codes::Space": [[176, "variable-slint-platform-key-codes-space"]], "Variable slint::platform::key_codes::Menu": [[177, "variable-slint-platform-key-codes-menu"]], "Variable slint::platform::key_codes::LeftArrow": [[178, "variable-slint-platform-key-codes-leftarrow"]], "Variable slint::platform::key_codes::MetaR": [[179, "variable-slint-platform-key-codes-metar"]], "Variable slint::platform::key_codes::Pause": [[180, "variable-slint-platform-key-codes-pause"]], "Variable slint::platform::key_codes::F4": [[181, "variable-slint-platform-key-codes-f4"]], "Variable slint::platform::key_codes::F12": [[182, "variable-slint-platform-key-codes-f12"]], "Variable slint::platform::key_codes::Insert": [[183, "variable-slint-platform-key-codes-insert"]], "Variable slint::platform::key_codes::DownArrow": [[184, "variable-slint-platform-key-codes-downarrow"]], "Variable slint::platform::key_codes::AltGr": [[185, "variable-slint-platform-key-codes-altgr"]], "Variable slint::platform::key_codes::Alt": [[186, "variable-slint-platform-key-codes-alt"]], "Variable slint::platform::key_codes::F23": [[187, "variable-slint-platform-key-codes-f23"]], "Variable slint::platform::key_codes::Stop": [[188, "variable-slint-platform-key-codes-stop"]], "Variable slint::platform::key_codes::F19": [[189, "variable-slint-platform-key-codes-f19"]], "Variable slint::platform::key_codes::ScrollLock": [[190, "variable-slint-platform-key-codes-scrolllock"]], "Variable slint::platform::key_codes::F13": [[191, "variable-slint-platform-key-codes-f13"]], "Variable slint::platform::key_codes::F15": [[192, "variable-slint-platform-key-codes-f15"]], "Variable slint::platform::key_codes::F14": [[193, "variable-slint-platform-key-codes-f14"]], "Variable slint::platform::key_codes::Backspace": [[194, "variable-slint-platform-key-codes-backspace"]], "Variable slint::platform::key_codes::F5": [[195, "variable-slint-platform-key-codes-f5"]], "Variable slint::platform::key_codes::F6": [[196, "variable-slint-platform-key-codes-f6"]], "Variable slint::platform::key_codes::Meta": [[197, "variable-slint-platform-key-codes-meta"]], "Variable slint::platform::key_codes::F9": [[198, "variable-slint-platform-key-codes-f9"]], "Variable slint::platform::key_codes::F20": [[199, "variable-slint-platform-key-codes-f20"]], "Variable slint::platform::key_codes::UpArrow": [[200, "variable-slint-platform-key-codes-uparrow"]], "Variable slint::platform::key_codes::F10": [[201, "variable-slint-platform-key-codes-f10"]], "Variable slint::platform::key_codes::F2": [[202, "variable-slint-platform-key-codes-f2"]], "Variable slint::platform::key_codes::F8": [[203, "variable-slint-platform-key-codes-f8"]], "Variable slint::platform::key_codes::F18": [[204, "variable-slint-platform-key-codes-f18"]], "Variable slint::platform::key_codes::PageDown": [[205, "variable-slint-platform-key-codes-pagedown"]], "Variable slint::platform::key_codes::F11": [[206, "variable-slint-platform-key-codes-f11"]], "Variable slint::platform::key_codes::F3": [[207, "variable-slint-platform-key-codes-f3"]], "Variable slint::platform::key_codes::Control": [[208, "variable-slint-platform-key-codes-control"]], "Variable slint::platform::key_codes::F16": [[209, "variable-slint-platform-key-codes-f16"]], "Variable slint::platform::key_codes::ControlR": [[210, "variable-slint-platform-key-codes-controlr"]], "Variable slint::platform::key_codes::Return": [[211, "variable-slint-platform-key-codes-return"]], "Variable slint::platform::key_codes::F7": [[212, "variable-slint-platform-key-codes-f7"]], "Variable slint::platform::key_codes::Backtab": [[213, "variable-slint-platform-key-codes-backtab"]], "Variable slint::platform::key_codes::Home": [[214, "variable-slint-platform-key-codes-home"]], "Variable slint::platform::key_codes::RightArrow": [[215, "variable-slint-platform-key-codes-rightarrow"]], "Variable slint::platform::key_codes::Escape": [[216, "variable-slint-platform-key-codes-escape"]], "Variable slint::platform::key_codes::SysReq": [[217, "variable-slint-platform-key-codes-sysreq"]], "Variable slint::platform::key_codes::F21": [[218, "variable-slint-platform-key-codes-f21"]], "Variable slint::platform::key_codes::F17": [[219, "variable-slint-platform-key-codes-f17"]], "Variable slint::platform::key_codes::PageUp": [[220, "variable-slint-platform-key-codes-pageup"]], "Variable slint::platform::key_codes::Tab": [[221, "variable-slint-platform-key-codes-tab"]], "Variable slint::platform::key_codes::End": [[222, "variable-slint-platform-key-codes-end"]], "Variable slint::platform::key_codes::ShiftR": [[223, "variable-slint-platform-key-codes-shiftr"]], "Variable slint::platform::key_codes::Delete": [[224, "variable-slint-platform-key-codes-delete"]], "Variable slint::platform::key_codes::Shift": [[225, "variable-slint-platform-key-codes-shift"]], "Variable slint::platform::key_codes::F22": [[226, "variable-slint-platform-key-codes-f22"]], "Set Up Development Environment": [[227, "set-up-development-environment"]], "Prerequisites": [[227, "prerequisites"], [234, "prerequisites"], [235, "prerequisites"], [237, "prerequisites"]], "Install Slint": [[227, "install-slint"]], "Install Binary Packages": [[227, "install-binary-packages"]], "Build From Sources": [[227, "build-from-sources"]], "Features": [[227, "features"]], "Rust Flags": [[227, "rust-flags"]], "Platform Backends": [[227, "platform-backends"]], "Cross-compiling": [[227, "cross-compiling"]], "CMake Reference": [[228, "cmake-reference"]], "slint_target_sources": [[228, "slint-target-sources"]], "Resource Embedding": [[228, "resource-embedding"]], "Scale Factor for Microcontrollers": [[228, "scale-factor-for-microcontrollers"]], "Generated Code": [[229, "generated-code"]], "Global Singletons": [[229, "global-singletons"]], "Index (C++)": [[230, "index-c"]], "Getting Started": [[231, "getting-started"]], "Tutorial": [[231, "tutorial"]], "Template": [[231, "template"]], "Slint C++ documentation": [[232, "slint-c-documentation"]], "The .slint Markup Language": [[232, "the-slint-markup-language"]], "Architecture": [[232, "architecture"]], "Developing": [[232, "developing"]], "Troubleshooting": [[233, "troubleshooting"]], "Rust Compilation Error During Slint Build": [[233, "rust-compilation-error-during-slint-build"]], "The device crashes at boot or enter a boot loop": [[233, "the-device-crashes-at-boot-or-enter-a-boot-loop"]], "Wrong colors shown": [[233, "wrong-colors-shown"]], "Errors about multiple symbol definitions when linking": [[233, "errors-about-multiple-symbol-definitions-when-linking"]], "Espressif\u2019s IoT Development Framework": [[234, "espressif-s-iot-development-framework"]], "First Steps": [[234, "first-steps"], [237, "first-steps"]], "Next Steps": [[234, "next-steps"], [235, "next-steps"], [237, "next-steps"]], "Generic MCU Environment Setup": [[235, "generic-mcu-environment-setup"]], "Compiling Slint": [[235, "compiling-slint"]], "Introduction": [[236, "introduction"]], "STMicroelectronics\u2019 STM32Cube Ecosystem": [[237, "stmicroelectronics-stm32cube-ecosystem"]], "Generic Instructions for Slint on STM32 MCUs": [[238, "generic-instructions-for-slint-on-stm32-mcus"]], "Overview": [[239, "overview"]], "Compiled .slint Designs": [[239, "compiled-slint-designs"]], "Run-Time Interpreted .slint Designs": [[239, "run-time-interpreted-slint-designs"]], "Type Mappings": [[240, "type-mappings"]], "Structures": [[240, "structures"]]}, "indexentries": {"brush (c++ class)": [[0, "_CPPv4N5slint5BrushE"]], "brush::brush (c++ function)": [[0, "_CPPv4N5slint5Brush5BrushERK5Color"], [0, "_CPPv4N5slint5Brush5BrushEv"]], "brush::brighter (c++ function)": [[0, "_CPPv4NK5slint5Brush8brighterEf"]], "brush::color (c++ function)": [[0, "_CPPv4NK5slint5Brush5colorEv"]], "brush::darker (c++ function)": [[0, "_CPPv4NK5slint5Brush6darkerEf"]], "brush::operator!= (c++ function)": [[0, "_CPPv4N5slint5BrushneERK5BrushRK5Brush"]], "brush::operator== (c++ function)": [[0, "_CPPv4N5slint5BrusheqERK5BrushRK5Brush"]], "brush::transparentize (c++ function)": [[0, "_CPPv4NK5slint5Brush14transparentizeEf"]], "brush::with_alpha (c++ function)": [[0, "_CPPv4NK5slint5Brush10with_alphaEf"]], "color (c++ class)": [[1, "_CPPv4N5slint5ColorE"]], "color::color (c++ function)": [[1, "_CPPv4N5slint5Color5ColorERK9RgbaColorI7uint8_tE"], [1, "_CPPv4N5slint5Color5ColorERK9RgbaColorIfE"], [1, "_CPPv4N5slint5Color5ColorEv"]], "color::alpha (c++ function)": [[1, "_CPPv4NK5slint5Color5alphaEv"]], "color::as_argb_encoded (c++ function)": [[1, "_CPPv4NK5slint5Color15as_argb_encodedEv"]], "color::blue (c++ function)": [[1, "_CPPv4NK5slint5Color4blueEv"]], "color::brighter (c++ function)": [[1, "_CPPv4NK5slint5Color8brighterEf"]], "color::darker (c++ function)": [[1, "_CPPv4NK5slint5Color6darkerEf"]], "color::from_argb_encoded (c++ function)": [[1, "_CPPv4N5slint5Color17from_argb_encodedE8uint32_t"]], "color::from_argb_float (c++ function)": [[1, "_CPPv4N5slint5Color15from_argb_floatEffff"]], "color::from_argb_uint8 (c++ function)": [[1, "_CPPv4N5slint5Color15from_argb_uint8E7uint8_t7uint8_t7uint8_t7uint8_t"]], "color::from_hsva (c++ function)": [[1, "_CPPv4N5slint5Color9from_hsvaEffff"]], "color::from_rgb_float (c++ function)": [[1, "_CPPv4N5slint5Color14from_rgb_floatEfff"]], "color::from_rgb_uint8 (c++ function)": [[1, "_CPPv4N5slint5Color14from_rgb_uint8E7uint8_t7uint8_t7uint8_t"]], "color::green (c++ function)": [[1, "_CPPv4NK5slint5Color5greenEv"]], "color::mix (c++ function)": [[1, "_CPPv4NK5slint5Color3mixERK5Colorf"]], "color::operator<< (c++ function)": [[1, "_CPPv4N5slint5ColorlsERNSt7ostreamERK5Color"]], "color::operator== (c++ function)": [[1, "_CPPv4N5slint5ColoreqERK5ColorRK5Color"]], "color::red (c++ function)": [[1, "_CPPv4NK5slint5Color3redEv"]], "color::to_argb_float (c++ function)": [[1, "_CPPv4NK5slint5Color13to_argb_floatEv"]], "color::to_argb_uint (c++ function)": [[1, "_CPPv4NK5slint5Color12to_argb_uintEv"]], "color::to_hsva (c++ function)": [[1, "_CPPv4NK5slint5Color7to_hsvaEv"]], "color::transparentize (c++ function)": [[1, "_CPPv4NK5slint5Color14transparentizeEf"]], "color::with_alpha (c++ function)": [[1, "_CPPv4NK5slint5Color10with_alphaEf"]], "componenthandle (c++ class)": [[2, "_CPPv4I0EN5slint15ComponentHandleE"]], "componenthandle::componenthandle (c++ function)": [[2, "_CPPv4N5slint15ComponentHandle15ComponentHandleERKN6vtable3VRcIN11private_api14ItemTreeVTableE1TEE"]], "componenthandle::into_dyn (c++ function)": [[2, "_CPPv4NK5slint15ComponentHandle8into_dynEv"]], "componenthandle::operator* (c++ function)": [[2, "_CPPv4N5slint15ComponentHandlemlEv"], [2, "_CPPv4NK5slint15ComponentHandlemlEv"]], "componenthandle::operator-> (c++ function)": [[2, "_CPPv4N5slint15ComponentHandleptEv"], [2, "_CPPv4NK5slint15ComponentHandleptEv"]], "componentweakhandle (c++ class)": [[3, "_CPPv4I0EN5slint19ComponentWeakHandleE"]], "componentweakhandle::componentweakhandle (c++ function)": [[3, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleERK15ComponentHandleI1TE"], [3, "_CPPv4N5slint19ComponentWeakHandle19ComponentWeakHandleEv"]], "componentweakhandle::lock (c++ function)": [[3, "_CPPv4NK5slint19ComponentWeakHandle4lockEv"]], "filtermodel (c++ class)": [[4, "_CPPv4I0EN5slint11FilterModelE"]], "filtermodel::filtermodel (c++ function)": [[4, "_CPPv4N5slint11FilterModel11FilterModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataEEE"]], "filtermodel::reset (c++ function)": [[4, "_CPPv4N5slint11FilterModel5resetEv"]], "filtermodel::row_count (c++ function)": [[4, "_CPPv4NK5slint11FilterModel9row_countEv"]], "filtermodel::row_data (c++ function)": [[4, "_CPPv4NK5slint11FilterModel8row_dataE6size_t"]], "filtermodel::set_row_data (c++ function)": [[4, "_CPPv4N5slint11FilterModel12set_row_dataE6size_tRK9ModelData"]], "filtermodel::source_model (c++ function)": [[4, "_CPPv4NK5slint11FilterModel12source_modelEv"]], "filtermodel::unfiltered_row (c++ function)": [[4, "_CPPv4NK5slint11FilterModel14unfiltered_rowEi"]], "mapmodel (c++ class)": [[5, "_CPPv4I00EN5slint8MapModelE"]], "mapmodel::mapmodel (c++ function)": [[5, "_CPPv4N5slint8MapModel8MapModelENSt10shared_ptrI5ModelI15SourceModelDataEEENSt8functionIF15MappedModelDataRK15SourceModelDataEEE"]], "mapmodel::reset (c++ function)": [[5, "_CPPv4N5slint8MapModel5resetEv"]], "mapmodel::row_count (c++ function)": [[5, "_CPPv4NK5slint8MapModel9row_countEv"]], "mapmodel::row_data (c++ function)": [[5, "_CPPv4NK5slint8MapModel8row_dataE6size_t"]], "mapmodel::source_model (c++ function)": [[5, "_CPPv4NK5slint8MapModel12source_modelEv"]], "model (c++ class)": [[6, "_CPPv4I0EN5slint5ModelE"]], "model::model (c++ function)": [[6, "_CPPv4N5slint5Model5ModelERK5Model"], [6, "_CPPv4N5slint5Model5ModelEv"]], "model::operator= (c++ function)": [[6, "_CPPv4N5slint5ModelaSERK5Model"]], "model::reset (c++ function)": [[6, "_CPPv4N5slint5Model5resetEv"]], "model::row_added (c++ function)": [[6, "_CPPv4N5slint5Model9row_addedE6size_t6size_t"]], "model::row_changed (c++ function)": [[6, "_CPPv4N5slint5Model11row_changedE6size_t"]], "model::row_count (c++ function)": [[6, "_CPPv4NK5slint5Model9row_countEv"]], "model::row_data (c++ function)": [[6, "_CPPv4NK5slint5Model8row_dataE6size_t"]], "model::row_removed (c++ function)": [[6, "_CPPv4N5slint5Model11row_removedE6size_t6size_t"]], "model::set_row_data (c++ function)": [[6, "_CPPv4N5slint5Model12set_row_dataE6size_tRK9ModelData"]], "model::~model (c++ function)": [[6, "_CPPv4N5slint5ModelD0Ev"]], "reversemodel (c++ class)": [[7, "_CPPv4I0EN5slint12ReverseModelE"]], "reversemodel::reversemodel (c++ function)": [[7, "_CPPv4N5slint12ReverseModel12ReverseModelENSt10shared_ptrI5ModelI9ModelDataEEE"]], "reversemodel::row_count (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel9row_countEv"]], "reversemodel::row_data (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel8row_dataE6size_t"]], "reversemodel::set_row_data (c++ function)": [[7, "_CPPv4N5slint12ReverseModel12set_row_dataE6size_tRK9ModelData"]], "reversemodel::source_model (c++ function)": [[7, "_CPPv4NK5slint12ReverseModel12source_modelEv"]], "sortmodel (c++ class)": [[8, "_CPPv4I0EN5slint9SortModelE"]], "sortmodel::sortmodel (c++ function)": [[8, "_CPPv4N5slint9SortModel9SortModelENSt10shared_ptrI5ModelI9ModelDataEEENSt8functionIFbRK9ModelDataRK9ModelDataEEE"]], "sortmodel::reset (c++ function)": [[8, "_CPPv4N5slint9SortModel5resetEv"]], "sortmodel::row_count (c++ function)": [[8, "_CPPv4NK5slint9SortModel9row_countEv"]], "sortmodel::row_data (c++ function)": [[8, "_CPPv4NK5slint9SortModel8row_dataE6size_t"]], "sortmodel::set_row_data (c++ function)": [[8, "_CPPv4N5slint9SortModel12set_row_dataE6size_tRK9ModelData"]], "sortmodel::source_model (c++ function)": [[8, "_CPPv4NK5slint9SortModel12source_modelEv"]], "sortmodel::unsorted_row (c++ function)": [[8, "_CPPv4NK5slint9SortModel12unsorted_rowEi"]], "vectormodel (c++ class)": [[9, "_CPPv4I0EN5slint11VectorModelE"]], "vectormodel::vectormodel (c++ function)": [[9, "_CPPv4N5slint11VectorModel11VectorModelENSt6vectorI9ModelDataEE"], [9, "_CPPv4N5slint11VectorModel11VectorModelEv"]], "vectormodel::clear (c++ function)": [[9, "_CPPv4N5slint11VectorModel5clearEv"]], "vectormodel::erase (c++ function)": [[9, "_CPPv4N5slint11VectorModel5eraseE6size_t"]], "vectormodel::insert (c++ function)": [[9, "_CPPv4N5slint11VectorModel6insertE6size_tRK9ModelData"]], "vectormodel::push_back (c++ function)": [[9, "_CPPv4N5slint11VectorModel9push_backERK9ModelData"]], "vectormodel::row_count (c++ function)": [[9, "_CPPv4NK5slint11VectorModel9row_countEv"]], "vectormodel::row_data (c++ function)": [[9, "_CPPv4NK5slint11VectorModel8row_dataE6size_t"]], "vectormodel::set_row_data (c++ function)": [[9, "_CPPv4N5slint11VectorModel12set_row_dataE6size_tRK9ModelData"]], "vectormodel::set_vector (c++ function)": [[9, "_CPPv4N5slint11VectorModel10set_vectorENSt6vectorI9ModelDataEE"]], "window (c++ class)": [[10, "_CPPv4N5slint6WindowE"]], "window::window (c++ function)": [[10, "_CPPv4N5slint6Window6WindowERK6Window"], [10, "_CPPv4N5slint6Window6WindowERR6Window"]], "window::dispatch_close_requested_event (c++ function)": [[10, "_CPPv4N5slint6Window30dispatch_close_requested_eventEv"]], "window::dispatch_key_press_event (c++ function)": [[10, "_CPPv4N5slint6Window24dispatch_key_press_eventERK12SharedString"]], "window::dispatch_key_press_repeat_event (c++ function)": [[10, "_CPPv4N5slint6Window31dispatch_key_press_repeat_eventERK12SharedString"]], "window::dispatch_key_release_event (c++ function)": [[10, "_CPPv4N5slint6Window26dispatch_key_release_eventERK12SharedString"]], "window::dispatch_pointer_exit_event (c++ function)": [[10, "_CPPv4N5slint6Window27dispatch_pointer_exit_eventEv"]], "window::dispatch_pointer_move_event (c++ function)": [[10, "_CPPv4N5slint6Window27dispatch_pointer_move_eventE15LogicalPosition"]], "window::dispatch_pointer_press_event (c++ function)": [[10, "_CPPv4N5slint6Window28dispatch_pointer_press_eventE15LogicalPosition18PointerEventButton"]], "window::dispatch_pointer_release_event (c++ function)": [[10, "_CPPv4N5slint6Window30dispatch_pointer_release_eventE15LogicalPosition18PointerEventButton"]], "window::dispatch_pointer_scroll_event (c++ function)": [[10, "_CPPv4N5slint6Window29dispatch_pointer_scroll_eventE15LogicalPositionff"]], "window::dispatch_resize_event (c++ function)": [[10, "_CPPv4N5slint6Window21dispatch_resize_eventEN5slint11LogicalSizeE"]], "window::dispatch_scale_factor_change_event (c++ function)": [[10, "_CPPv4N5slint6Window34dispatch_scale_factor_change_eventEf"]], "window::dispatch_window_active_changed_event (c++ function)": [[10, "_CPPv4N5slint6Window36dispatch_window_active_changed_eventEb"]], "window::has_active_animations (c++ function)": [[10, "_CPPv4NK5slint6Window21has_active_animationsEv"]], "window::hide (c++ function)": [[10, "_CPPv4N5slint6Window4hideEv"]], "window::is_fullscreen (c++ function)": [[10, "_CPPv4NK5slint6Window13is_fullscreenEv"]], "window::is_maximized (c++ function)": [[10, "_CPPv4NK5slint6Window12is_maximizedEv"]], "window::is_minimized (c++ function)": [[10, "_CPPv4NK5slint6Window12is_minimizedEv"]], "window::is_visible (c++ function)": [[10, "_CPPv4NK5slint6Window10is_visibleEv"]], "window::on_close_requested (c++ function)": [[10, "_CPPv4I_NSt9invocableEENK5slint6Window18on_close_requestedEvRR1F"]], "window::operator= (c++ function)": [[10, "_CPPv4N5slint6WindowaSERK6Window"], [10, "_CPPv4N5slint6WindowaSERR6Window"]], "window::position (c++ function)": [[10, "_CPPv4NK5slint6Window8positionEv"]], "window::request_redraw (c++ function)": [[10, "_CPPv4NK5slint6Window14request_redrawEv"]], "window::scale_factor (c++ function)": [[10, "_CPPv4NK5slint6Window12scale_factorEv"]], "window::set_fullscreen (c++ function)": [[10, "_CPPv4N5slint6Window14set_fullscreenEb"]], "window::set_maximized (c++ function)": [[10, "_CPPv4N5slint6Window13set_maximizedEb"]], "window::set_minimized (c++ function)": [[10, "_CPPv4N5slint6Window13set_minimizedEb"]], "window::set_position (c++ function)": [[10, "_CPPv4N5slint6Window12set_positionERKN5slint15LogicalPositionE"], [10, "_CPPv4N5slint6Window12set_positionERKN5slint16PhysicalPositionE"]], "window::set_rendering_notifier (c++ function)": [[10, "_CPPv4I_NSt9invocableI14RenderingState11GraphicsAPIEEENK5slint6Window22set_rendering_notifierENSt8optionalI25SetRenderingNotifierErrorEERR1F"]], "window::set_size (c++ function)": [[10, "_CPPv4N5slint6Window8set_sizeERKN5slint11LogicalSizeE"], [10, "_CPPv4N5slint6Window8set_sizeERKN5slint12PhysicalSizeE"]], "window::show (c++ function)": [[10, "_CPPv4N5slint6Window4showEv"]], "window::size (c++ function)": [[10, "_CPPv4NK5slint6Window4sizeEv"]], "window::~window (c++ function)": [[10, "_CPPv4N5slint6WindowD0Ev"]], "componentcompiler (c++ class)": [[11, "_CPPv4N5slint11interpreter17ComponentCompilerE"]], "componentcompiler::componentcompiler (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17ComponentCompilerEv"]], "componentcompiler::build_from_path (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler15build_from_pathENSt11string_viewE"]], "componentcompiler::build_from_source (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17build_from_sourceENSt11string_viewENSt11string_viewE"]], "componentcompiler::diagnostics (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler11diagnosticsEv"]], "componentcompiler::include_paths (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler13include_pathsEv"]], "componentcompiler::set_include_paths (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler17set_include_pathsERKN5slint12SharedVectorIN5slint12SharedStringEEE"]], "componentcompiler::set_style (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler9set_styleENSt11string_viewE"]], "componentcompiler::set_translation_domain (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompiler22set_translation_domainENSt11string_viewE"]], "componentcompiler::style (c++ function)": [[11, "_CPPv4NK5slint11interpreter17ComponentCompiler5styleEv"]], "componentcompiler::~componentcompiler (c++ function)": [[11, "_CPPv4N5slint11interpreter17ComponentCompilerD0Ev"]], "componentdefinition (c++ class)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionE"]], "componentdefinition::componentdefinition (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinition19ComponentDefinitionERK19ComponentDefinition"]], "componentdefinition::callbacks (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition9callbacksEv"]], "componentdefinition::create (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition6createEv"]], "componentdefinition::functions (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition9functionsEv"]], "componentdefinition::global_callbacks (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_callbacksENSt11string_viewE"]], "componentdefinition::global_functions (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition16global_functionsENSt11string_viewE"]], "componentdefinition::global_properties (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition17global_propertiesENSt11string_viewE"]], "componentdefinition::globals (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition7globalsEv"]], "componentdefinition::name (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition4nameEv"]], "componentdefinition::operator= (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionaSERK19ComponentDefinition"]], "componentdefinition::properties (c++ function)": [[12, "_CPPv4NK5slint11interpreter19ComponentDefinition10propertiesEv"]], "componentdefinition::~componentdefinition (c++ function)": [[12, "_CPPv4N5slint11interpreter19ComponentDefinitionD0Ev"]], "componentinstance (c++ class)": [[13, "_CPPv4N5slint11interpreter17ComponentInstanceE"]], "componentinstance::definition (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance10definitionEv"]], "componentinstance::get_global_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance19get_global_propertyENSt11string_viewENSt11string_viewE"]], "componentinstance::get_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance12get_propertyENSt11string_viewE"]], "componentinstance::hide (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance4hideEv"]], "componentinstance::invoke (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance6invokeENSt11string_viewENSt4spanIK5ValueEE"]], "componentinstance::invoke_global (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance13invoke_globalENSt11string_viewENSt11string_viewENSt4spanIK5ValueEE"]], "componentinstance::qwidget (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance7qwidgetEv"]], "componentinstance::run (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance3runEv"]], "componentinstance::set_callback (c++ function)": [[13, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance12set_callbackEbNSt11string_viewE1F"]], "componentinstance::set_global_callback (c++ function)": [[13, "_CPPv4I_NSt9invocableINSt4spanIK5ValueEEEEENK5slint11interpreter17ComponentInstance19set_global_callbackEbNSt11string_viewENSt11string_viewE1F"]], "componentinstance::set_global_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance19set_global_propertyENSt11string_viewENSt11string_viewERK5Value"]], "componentinstance::set_property (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance12set_propertyENSt11string_viewERK5Value"]], "componentinstance::show (c++ function)": [[13, "_CPPv4NK5slint11interpreter17ComponentInstance4showEv"]], "componentinstance::window (c++ function)": [[13, "_CPPv4N5slint11interpreter17ComponentInstance6windowEv"]], "value (c++ class)": [[14, "_CPPv4N5slint11interpreter5ValueE"]], "value::type (c++ type)": [[14, "_CPPv4N5slint11interpreter5Value4TypeE"]], "value::value (c++ function)": [[14, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedString"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK12SharedVectorI5ValueE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK5Image"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK5Value"], [14, "_CPPv4N5slint11interpreter5Value5ValueERK6Struct"], [14, "_CPPv4N5slint11interpreter5Value5ValueERKN5slint5BrushE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERKNSt10shared_ptrIN5slint5ModelI5ValueEEEE"], [14, "_CPPv4N5slint11interpreter5Value5ValueERR5Value"], [14, "_CPPv4N5slint11interpreter5Value5ValueEb"], [14, "_CPPv4N5slint11interpreter5Value5ValueEd"], [14, "_CPPv4N5slint11interpreter5Value5ValueEi"], [14, "_CPPv4N5slint11interpreter5Value5ValueEv"]], "value::operator= (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueaSERK5Value"], [14, "_CPPv4N5slint11interpreter5ValueaSERR5Value"]], "value::operator== (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueeqERK5ValueRK5Value"]], "value::to_array (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_arrayEv"]], "value::to_bool (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value7to_boolEv"]], "value::to_brush (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_brushEv"]], "value::to_image (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value8to_imageEv"]], "value::to_number (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_numberEv"]], "value::to_string (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_stringEv"]], "value::to_struct (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value9to_structEv"]], "value::type (c++ function)": [[14, "_CPPv4NK5slint11interpreter5Value4typeEv"]], "value::~value (c++ function)": [[14, "_CPPv4N5slint11interpreter5ValueD0Ev"]], "platform::abstractrenderer (c++ class)": [[15, "_CPPv4N5slint8platform16AbstractRendererE"]], "platform::nativewindowhandle (c++ class)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleE"]], "platform::nativewindowhandle::nativewindowhandle (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERK18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleERR18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandle18NativeWindowHandleEv"]], "platform::nativewindowhandle::from_appkit (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle11from_appkitEP6NSViewP8NSWindow"]], "platform::nativewindowhandle::from_wayland (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle12from_waylandEP10wl_surfaceP10wl_display"]], "platform::nativewindowhandle::from_win32 (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle10from_win32EPvPv"]], "platform::nativewindowhandle::from_x11_xcb (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle12from_x11_xcbE8uint32_t8uint32_tP16xcb_connection_ti"]], "platform::nativewindowhandle::from_x11_xlib (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandle13from_x11_xlibE8uint32_tmPvi"]], "platform::nativewindowhandle::operator= (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleaSERK18NativeWindowHandle"], [16, "_CPPv4N5slint8platform18NativeWindowHandleaSERR18NativeWindowHandle"]], "platform::nativewindowhandle::~nativewindowhandle (c++ function)": [[16, "_CPPv4N5slint8platform18NativeWindowHandleD0Ev"]], "platform::platform (c++ class)": [[17, "_CPPv4N5slint8platform8PlatformE"]], "platform::platform::clipboard (c++ enum)": [[17, "_CPPv4N5slint8platform8Platform9ClipboardE"]], "platform::platform::clipboard::defaultclipboard (c++ enumerator)": [[17, "_CPPv4N5slint8platform8Platform9Clipboard16DefaultClipboardE"]], "platform::platform::clipboard::selectionclipboard (c++ enumerator)": [[17, "_CPPv4N5slint8platform8Platform9Clipboard18SelectionClipboardE"]], "platform::platform::platform (c++ function)": [[17, "_CPPv4N5slint8platform8Platform8PlatformERK8Platform"], [17, "_CPPv4N5slint8platform8Platform8PlatformEv"]], "platform::platform::task (c++ class)": [[17, "_CPPv4N5slint8platform8Platform4TaskE"], [18, "_CPPv4N5slint8platform8Platform4TaskE"]], "platform::platform::task::task (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task"], [17, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task"], [18, "_CPPv4N5slint8platform8Platform4Task4TaskERK4Task"], [18, "_CPPv4N5slint8platform8Platform4Task4TaskERR4Task"]], "platform::platform::task::operator= (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task"], [17, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task"], [18, "_CPPv4N5slint8platform8Platform4TaskaSERK4Task"], [18, "_CPPv4N5slint8platform8Platform4TaskaSERR4Task"]], "platform::platform::task::run (c++ function)": [[17, "_CPPv4NO5slint8platform8Platform4Task3runEv"], [18, "_CPPv4NO5slint8platform8Platform4Task3runEv"]], "platform::platform::task::~task (c++ function)": [[17, "_CPPv4N5slint8platform8Platform4TaskD0Ev"], [18, "_CPPv4N5slint8platform8Platform4TaskD0Ev"]], "platform::platform::clipboard_text (c++ function)": [[17, "_CPPv4N5slint8platform8Platform14clipboard_textE9Clipboard"]], "platform::platform::create_window_adapter (c++ function)": [[17, "_CPPv4N5slint8platform8Platform21create_window_adapterEv"]], "platform::platform::duration_since_start (c++ function)": [[17, "_CPPv4N5slint8platform8Platform20duration_since_startEv"]], "platform::platform::operator= (c++ function)": [[17, "_CPPv4N5slint8platform8PlatformaSERK8Platform"]], "platform::platform::quit_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform15quit_event_loopEv"]], "platform::platform::run_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform14run_event_loopEv"]], "platform::platform::run_in_event_loop (c++ function)": [[17, "_CPPv4N5slint8platform8Platform17run_in_event_loopE4Task"]], "platform::platform::set_clipboard_text (c++ function)": [[17, "_CPPv4N5slint8platform8Platform18set_clipboard_textERK12SharedString9Clipboard"]], "platform::platform::~platform (c++ function)": [[17, "_CPPv4N5slint8platform8PlatformD0Ev"]], "platform::skiarenderer (c++ class)": [[19, "_CPPv4N5slint8platform12SkiaRendererE"]], "platform::skiarenderer::skiarenderer (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK12SkiaRenderer"], [19, "_CPPv4N5slint8platform12SkiaRenderer12SkiaRendererERK18NativeWindowHandle12PhysicalSize"]], "platform::skiarenderer::operator= (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRendereraSERK12SkiaRenderer"]], "platform::skiarenderer::render (c++ function)": [[19, "_CPPv4NK5slint8platform12SkiaRenderer6renderEv"]], "platform::skiarenderer::~skiarenderer (c++ function)": [[19, "_CPPv4N5slint8platform12SkiaRendererD0Ev"]], "platform::softwarerenderer (c++ class)": [[20, "_CPPv4N5slint8platform16SoftwareRendererE"]], "platform::softwarerenderer::physicalregion (c++ struct)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegionE"]], "platform::softwarerenderer::physicalregion::rect (c++ struct)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4RectE"]], "platform::softwarerenderer::physicalregion::rect::origin (c++ member)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect6originE"]], "platform::softwarerenderer::physicalregion::rect::size (c++ member)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"], [168, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"], [169, "_CPPv4N5slint8platform16SoftwareRenderer14PhysicalRegion4Rect4sizeE"]], "platform::softwarerenderer::physicalregion::bounding_box_origin (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion19bounding_box_originEv"]], "platform::softwarerenderer::physicalregion::bounding_box_size (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion17bounding_box_sizeEv"]], "platform::softwarerenderer::physicalregion::rectangles (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv"], [168, "_CPPv4NK5slint8platform16SoftwareRenderer14PhysicalRegion10rectanglesEv"]], "platform::softwarerenderer::renderingrotation (c++ enum)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotationE"]], "platform::softwarerenderer::renderingrotation::norotation (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation10NoRotationE"]], "platform::softwarerenderer::renderingrotation::rotate180 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate180E"]], "platform::softwarerenderer::renderingrotation::rotate270 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation9Rotate270E"]], "platform::softwarerenderer::renderingrotation::rotate90 (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RenderingRotation8Rotate90E"]], "platform::softwarerenderer::repaintbuffertype (c++ enum)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferTypeE"]], "platform::softwarerenderer::repaintbuffertype::newbuffer (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType9NewBufferE"]], "platform::softwarerenderer::repaintbuffertype::reusedbuffer (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType12ReusedBufferE"]], "platform::softwarerenderer::repaintbuffertype::swappedbuffers (c++ enumerator)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer17RepaintBufferType14SwappedBuffersE"]], "platform::softwarerenderer::softwarerenderer (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererE17RepaintBufferType"], [20, "_CPPv4N5slint8platform16SoftwareRenderer16SoftwareRendererERK16SoftwareRenderer"]], "platform::softwarerenderer::operator= (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRendereraSERK16SoftwareRenderer"]], "platform::softwarerenderer::render (c++ function)": [[20, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanI11Rgb565PixelEENSt6size_tE"], [20, "_CPPv4NK5slint8platform16SoftwareRenderer6renderENSt4spanIN5slint9Rgb8PixelEEENSt6size_tE"]], "platform::softwarerenderer::render_by_line (c++ function)": [[20, "_CPPv4I0ENK5slint8platform16SoftwareRenderer14render_by_lineE14PhysicalRegion8Callback"]], "platform::softwarerenderer::set_rendering_rotation (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRenderer22set_rendering_rotationE17RenderingRotation"]], "platform::softwarerenderer::~softwarerenderer (c++ function)": [[20, "_CPPv4N5slint8platform16SoftwareRendererD0Ev"]], "platform::windowadapter (c++ class)": [[21, "_CPPv4N5slint8platform13WindowAdapterE"]], "platform::windowadapter::windowadapter (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter13WindowAdapterEv"]], "platform::windowadapter::windowproperties (c++ struct)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowPropertiesE"]], "platform::windowadapter::windowproperties::layoutconstraints (c++ struct)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraintsE"]], "platform::windowadapter::windowproperties::layoutconstraints::max (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3maxE"]], "platform::windowadapter::windowproperties::layoutconstraints::min (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints3minE"]], "platform::windowadapter::windowproperties::layoutconstraints::preferred (c++ member)": [[21, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"], [170, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"], [171, "_CPPv4N5slint8platform13WindowAdapter16WindowProperties17LayoutConstraints9preferredE"]], "platform::windowadapter::windowproperties::background (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10backgroundEv"]], "platform::windowadapter::windowproperties::fullscreen (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties10fullscreenEv"]], "platform::windowadapter::windowproperties::is_fullscreen (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties13is_fullscreenEv"]], "platform::windowadapter::windowproperties::is_maximized (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_maximizedEv"]], "platform::windowadapter::windowproperties::is_minimized (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties12is_minimizedEv"]], "platform::windowadapter::windowproperties::layout_constraints (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties18layout_constraintsEv"]], "platform::windowadapter::windowproperties::title (c++ function)": [[21, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv"], [170, "_CPPv4NK5slint8platform13WindowAdapter16WindowProperties5titleEv"]], "platform::windowadapter::position (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8positionEv"]], "platform::windowadapter::renderer (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8rendererEv"]], "platform::windowadapter::request_redraw (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter14request_redrawEv"]], "platform::windowadapter::set_position (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter12set_positionEN5slint16PhysicalPositionE"]], "platform::windowadapter::set_size (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter8set_sizeEN5slint12PhysicalSizeE"]], "platform::windowadapter::set_visible (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter11set_visibleEb"]], "platform::windowadapter::size (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter4sizeEv"]], "platform::windowadapter::update_window_properties (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter24update_window_propertiesERK16WindowProperties"]], "platform::windowadapter::window (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapter6windowEv"], [21, "_CPPv4NK5slint8platform13WindowAdapter6windowEv"]], "platform::windowadapter::~windowadapter (c++ function)": [[21, "_CPPv4N5slint8platform13WindowAdapterD0Ev"]], "testing::elementhandle (c++ class)": [[22, "_CPPv4N5slint7testing13ElementHandleE"]], "testing::elementhandle::absolute_position (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle17absolute_positionEv"]], "testing::elementhandle::accessible_checkable (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle20accessible_checkableEv"]], "testing::elementhandle::accessible_checked (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle18accessible_checkedEv"]], "testing::elementhandle::accessible_description (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle22accessible_descriptionEv"]], "testing::elementhandle::accessible_label (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle16accessible_labelEv"]], "testing::elementhandle::accessible_placeholder_text (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle27accessible_placeholder_textEv"]], "testing::elementhandle::accessible_role (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle15accessible_roleEv"]], "testing::elementhandle::accessible_value (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle16accessible_valueEv"]], "testing::elementhandle::accessible_value_maximum (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_maximumEv"]], "testing::elementhandle::accessible_value_minimum (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle24accessible_value_minimumEv"]], "testing::elementhandle::accessible_value_step (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle21accessible_value_stepEv"]], "testing::elementhandle::bases (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle5basesEv"]], "testing::elementhandle::find_by_accessible_label (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle24find_by_accessible_labelE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::find_by_element_id (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle18find_by_element_idE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::find_by_element_type_name (c++ function)": [[22, "_CPPv4I0EN5slint7testing13ElementHandle25find_by_element_type_nameE12SharedVectorI13ElementHandleERK15ComponentHandleI1TENSt11string_viewE"]], "testing::elementhandle::id (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle2idEv"]], "testing::elementhandle::invoke_accessible_decrement_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_decrement_actionEv"]], "testing::elementhandle::invoke_accessible_default_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle32invoke_accessible_default_actionEv"]], "testing::elementhandle::invoke_accessible_increment_action (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle34invoke_accessible_increment_actionEv"]], "testing::elementhandle::is_valid (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle8is_validEv"]], "testing::elementhandle::set_accessible_value (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle20set_accessible_valueE12SharedString"]], "testing::elementhandle::size (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle4sizeEv"]], "testing::elementhandle::type_name (c++ function)": [[22, "_CPPv4NK5slint7testing13ElementHandle9type_nameEv"]], "testing::elementhandle::visit_elements (c++ function)": [[22, "_CPPv4I0_NSt9invocableI13ElementHandleEE0EN5slint7testing13ElementHandle14visit_elementsENSt15invoke_result_tI7Visitor13ElementHandleEERK15ComponentHandleI1TE7Visitor"]], "slint_feature_backend_qt (c macro)": [[23, "c.SLINT_FEATURE_BACKEND_QT"]], "slint_feature_gettext (c macro)": [[24, "c.SLINT_FEATURE_GETTEXT"]], "slint_feature_interpreter (c macro)": [[25, "c.SLINT_FEATURE_INTERPRETER"]], "slint_version_patch (c macro)": [[26, "c.SLINT_VERSION_PATCH"]], "slint_feature_backend_linuxkms (c macro)": [[27, "c.SLINT_FEATURE_BACKEND_LINUXKMS"]], "slint_feature_experimental (c macro)": [[28, "c.SLINT_FEATURE_EXPERIMENTAL"]], "slint_version_string (c macro)": [[29, "c.SLINT_VERSION_STRING"]], "slint_feature_renderer_femtovg (c macro)": [[30, "c.SLINT_FEATURE_RENDERER_FEMTOVG"]], "slint_feature_renderer_skia (c macro)": [[31, "c.SLINT_FEATURE_RENDERER_SKIA"]], "slint_feature_system_testing (c macro)": [[32, "c.SLINT_FEATURE_SYSTEM_TESTING"]], "slint_feature_accessibility (c macro)": [[33, "c.SLINT_FEATURE_ACCESSIBILITY"]], "slint_feature_renderer_software (c macro)": [[34, "c.SLINT_FEATURE_RENDERER_SOFTWARE"]], "slint_version_minor (c macro)": [[35, "c.SLINT_VERSION_MINOR"]], "slint_feature_freestanding (c macro)": [[36, "c.SLINT_FEATURE_FREESTANDING"]], "slint_feature_testing (c macro)": [[37, "c.SLINT_FEATURE_TESTING"]], "slint_version_major (c macro)": [[38, "c.SLINT_VERSION_MAJOR"]], "slint_feature_backend_winit (c macro)": [[39, "c.SLINT_FEATURE_BACKEND_WINIT"]], "assert_eq (c macro)": [[40, "c.assert_eq"]], "valuetype (c++ enum)": [[46, "_CPPv4N5slint11interpreter9ValueTypeE"]], "valuetype::bool (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType4BoolE"]], "valuetype::brush (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5BrushE"]], "valuetype::image (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5ImageE"]], "valuetype::model (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5ModelE"]], "valuetype::number (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6NumberE"]], "valuetype::other (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType5OtherE"]], "valuetype::string (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6StringE"]], "valuetype::struct (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType6StructE"]], "valuetype::void (c++ enumerator)": [[46, "_CPPv4N5slint11interpreter9ValueType4VoidE"]], "diagnosticlevel (c++ enum)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevelE"]], "diagnosticlevel::error (c++ enumerator)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevel5ErrorE"]], "diagnosticlevel::warning (c++ enumerator)": [[47, "_CPPv4N5slint11interpreter15DiagnosticLevel7WarningE"]], "testing::accessiblerole (c++ enum)": [[48, "_CPPv4N5slint7testing14AccessibleRoleE"]], "testing::accessiblerole::button (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6ButtonE"]], "testing::accessiblerole::checkbox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8CheckboxE"]], "testing::accessiblerole::combobox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8ComboboxE"]], "testing::accessiblerole::list (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4ListE"]], "testing::accessiblerole::listitem (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8ListItemE"]], "testing::accessiblerole::none (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4NoneE"]], "testing::accessiblerole::progressindicator (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole17ProgressIndicatorE"]], "testing::accessiblerole::slider (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6SliderE"]], "testing::accessiblerole::spinbox (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole7SpinboxE"]], "testing::accessiblerole::switch (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole6SwitchE"]], "testing::accessiblerole::tab (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole3TabE"]], "testing::accessiblerole::tablist (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole7TabListE"]], "testing::accessiblerole::table (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole5TableE"]], "testing::accessiblerole::text (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4TextE"]], "testing::accessiblerole::textinput (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole9TextInputE"]], "testing::accessiblerole::tree (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole4TreeE"]], "setrenderingnotifiererror (c++ enum)": [[49, "_CPPv4N5slint25SetRenderingNotifierErrorE"]], "setrenderingnotifiererror::alreadyset (c++ enumerator)": [[49, "_CPPv4N5slint25SetRenderingNotifierError10AlreadySetE"]], "setrenderingnotifiererror::unsupported (c++ enumerator)": [[49, "_CPPv4N5slint25SetRenderingNotifierError11UnsupportedE"]], "pointereventbutton (c++ enum)": [[50, "_CPPv4N5slint18PointerEventButtonE"]], "pointereventbutton::back (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton4BackE"]], "pointereventbutton::forward (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton7ForwardE"]], "pointereventbutton::left (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton4LeftE"]], "pointereventbutton::middle (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton6MiddleE"]], "pointereventbutton::other (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton5OtherE"]], "pointereventbutton::right (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton5RightE"]], "eventloopmode (c++ enum)": [[51, "_CPPv4N5slint13EventLoopModeE"]], "eventloopmode::quitonlastwindowclosed (c++ enumerator)": [[51, "_CPPv4N5slint13EventLoopMode22QuitOnLastWindowClosedE"]], "eventloopmode::rununtilquit (c++ enumerator)": [[51, "_CPPv4N5slint13EventLoopMode12RunUntilQuitE"]], "graphicsapi (c++ enum)": [[52, "_CPPv4N5slint11GraphicsAPIE"]], "graphicsapi::nativeopengl (c++ enumerator)": [[52, "_CPPv4N5slint11GraphicsAPI12NativeOpenGLE"]], "renderingstate (c++ enum)": [[53, "_CPPv4N5slint14RenderingStateE"]], "renderingstate::afterrendering (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState14AfterRenderingE"]], "renderingstate::beforerendering (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState15BeforeRenderingE"]], "renderingstate::renderingsetup (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState14RenderingSetupE"]], "renderingstate::renderingteardown (c++ enumerator)": [[53, "_CPPv4N5slint14RenderingState17RenderingTeardownE"]], "closerequestresponse (c++ enum)": [[54, "_CPPv4N5slint20CloseRequestResponseE"]], "closerequestresponse::hidewindow (c++ enumerator)": [[54, "_CPPv4N5slint20CloseRequestResponse10HideWindowE"]], "closerequestresponse::keepwindowshown (c++ enumerator)": [[54, "_CPPv4N5slint20CloseRequestResponse15KeepWindowShownE"]], "platform::duration_until_next_timer_update (c++ function)": [[93, "_CPPv4N5slint8platform32duration_until_next_timer_updateEv"]], "platform::update_timers_and_animations (c++ function)": [[94, "_CPPv4N5slint8platform28update_timers_and_animationsEv"]], "platform::set_platform (c++ function)": [[95, "_CPPv4N5slint8platform12set_platformENSt10unique_ptrI8PlatformEE"]], "testing::init (c++ function)": [[96, "_CPPv4N5slint7testing4initEv"]], "quit_event_loop (c++ function)": [[97, "_CPPv4N5slint15quit_event_loopEv"]], "invoke_from_event_loop (c++ function)": [[98, "_CPPv4I_NSt9invocableEEN5slint22invoke_from_event_loopEv7Functor"]], "blocking_invoke_from_event_loop (c++ function)": [[99, "_CPPv4I_NSt9invocableEEN5slint31blocking_invoke_from_event_loopENSt15invoke_result_tI7FunctorEE7Functor"]], "run_event_loop (c++ function)": [[100, "_CPPv4N5slint14run_event_loopE13EventLoopMode"]], "update_all_translations (c++ function)": [[101, "_CPPv4N5slint23update_all_translationsEv"]], "hsvacolor (c++ struct)": [[147, "_CPPv4N5slint9HsvaColorE"]], "hsvacolor::alpha (c++ member)": [[147, "_CPPv4N5slint9HsvaColor5alphaE"]], "hsvacolor::hue (c++ member)": [[147, "_CPPv4N5slint9HsvaColor3hueE"]], "hsvacolor::saturation (c++ member)": [[147, "_CPPv4N5slint9HsvaColor10saturationE"]], "hsvacolor::value (c++ member)": [[147, "_CPPv4N5slint9HsvaColor5valueE"]], "image (c++ struct)": [[148, "_CPPv4N5slint5ImageE"]], "image::borrowedopengltextureorigin (c++ enum)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOriginE"]], "image::borrowedopengltextureorigin::bottomleft (c++ enumerator)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin10BottomLeftE"]], "image::borrowedopengltextureorigin::topleft (c++ enumerator)": [[148, "_CPPv4N5slint5Image27BorrowedOpenGLTextureOrigin7TopLeftE"]], "image::image (c++ function)": [[148, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI10Rgba8PixelE"], [148, "_CPPv4N5slint5Image5ImageE17SharedPixelBufferI9Rgb8PixelE"], [148, "_CPPv4N5slint5Image5ImageEv"]], "image::create_from_borrowed_gl_2d_rgba_texture (c++ function)": [[148, "_CPPv4N5slint5Image39create_from_borrowed_gl_2d_rgba_textureE8uint32_t4SizeI8uint32_tE27BorrowedOpenGLTextureOrigin"]], "image::load_from_path (c++ function)": [[148, "_CPPv4N5slint5Image14load_from_pathERK12SharedString"]], "image::operator!= (c++ function)": [[148, "_CPPv4N5slint5ImageneERK5ImageRK5Image"]], "image::operator== (c++ function)": [[148, "_CPPv4N5slint5ImageeqERK5ImageRK5Image"]], "image::path (c++ function)": [[148, "_CPPv4NK5slint5Image4pathEv"]], "image::set_nine_slice_edges (c++ function)": [[148, "_CPPv4N5slint5Image20set_nine_slice_edgesEtttt"]], "image::size (c++ function)": [[148, "_CPPv4NK5slint5Image4sizeEv"]], "image::to_rgb8 (c++ function)": [[148, "_CPPv4NK5slint5Image7to_rgb8Ev"]], "image::to_rgba8 (c++ function)": [[148, "_CPPv4NK5slint5Image8to_rgba8Ev"]], "image::to_rgba8_premultiplied (c++ function)": [[148, "_CPPv4NK5slint5Image22to_rgba8_premultipliedEv"]], "logicalposition (c++ struct)": [[149, "_CPPv4N5slint15LogicalPositionE"]], "logicalposition::logicalposition (c++ function)": [[149, "_CPPv4N5slint15LogicalPosition15LogicalPositionEK5PointIfE"], [149, "_CPPv4N5slint15LogicalPosition15LogicalPositionEv"]], "logicalsize (c++ struct)": [[150, "_CPPv4N5slint11LogicalSizeE"]], "logicalsize::logicalsize (c++ function)": [[150, "_CPPv4N5slint11LogicalSize11LogicalSizeEK4SizeIfE"]], "physicalposition (c++ struct)": [[151, "_CPPv4N5slint16PhysicalPositionE"]], "physicalposition::physicalposition (c++ function)": [[151, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEK5PointI7int32_tE"], [151, "_CPPv4N5slint16PhysicalPosition16PhysicalPositionEv"]], "physicalsize (c++ struct)": [[152, "_CPPv4N5slint12PhysicalSizeE"]], "physicalsize::physicalsize (c++ function)": [[152, "_CPPv4N5slint12PhysicalSize12PhysicalSizeEK4SizeI8uint32_tE"]], "point (c++ struct)": [[153, "_CPPv4I0EN5slint5PointE"]], "point::operator== (c++ function)": [[153, "_CPPv4NK5slint5PointeqERK5Point"]], "point::x (c++ member)": [[153, "_CPPv4N5slint5Point1xE"]], "point::y (c++ member)": [[153, "_CPPv4N5slint5Point1yE"]], "rgb8pixel (c++ struct)": [[154, "_CPPv4N5slint9Rgb8PixelE"]], "rgb8pixel::b (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1bE"]], "rgb8pixel::g (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1gE"]], "rgb8pixel::r (c++ member)": [[154, "_CPPv4N5slint9Rgb8Pixel1rE"]], "rgba8pixel (c++ struct)": [[155, "_CPPv4N5slint10Rgba8PixelE"]], "rgba8pixel::a (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1aE"]], "rgba8pixel::b (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1bE"]], "rgba8pixel::g (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1gE"]], "rgba8pixel::r (c++ member)": [[155, "_CPPv4N5slint10Rgba8Pixel1rE"]], "rgbacolor (c++ struct)": [[156, "_CPPv4I0EN5slint9RgbaColorE"]], "rgbacolor::rgbacolor (c++ function)": [[156, "_CPPv4N5slint9RgbaColor9RgbaColorERK5Color"]], "rgbacolor::alpha (c++ member)": [[156, "_CPPv4N5slint9RgbaColor5alphaE"]], "rgbacolor::blue (c++ member)": [[156, "_CPPv4N5slint9RgbaColor4blueE"]], "rgbacolor::green (c++ member)": [[156, "_CPPv4N5slint9RgbaColor5greenE"]], "rgbacolor::red (c++ member)": [[156, "_CPPv4N5slint9RgbaColor3redE"]], "sharedpixelbuffer (c++ struct)": [[157, "_CPPv4I0EN5slint17SharedPixelBufferE"]], "sharedpixelbuffer::sharedpixelbuffer (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_t"], [157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferE8uint32_t8uint32_tPK5Pixel"], [157, "_CPPv4N5slint17SharedPixelBuffer17SharedPixelBufferEv"]], "sharedpixelbuffer::begin (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer5beginEv"], [157, "_CPPv4NK5slint17SharedPixelBuffer5beginEv"]], "sharedpixelbuffer::cbegin (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer6cbeginEv"]], "sharedpixelbuffer::cend (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer4cendEv"]], "sharedpixelbuffer::end (c++ function)": [[157, "_CPPv4N5slint17SharedPixelBuffer3endEv"], [157, "_CPPv4NK5slint17SharedPixelBuffer3endEv"]], "sharedpixelbuffer::height (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer6heightEv"]], "sharedpixelbuffer::operator== (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffereqERK17SharedPixelBuffer"]], "sharedpixelbuffer::width (c++ function)": [[157, "_CPPv4NK5slint17SharedPixelBuffer5widthEv"]], "sharedstring (c++ struct)": [[158, "_CPPv4N5slint12SharedStringE"]], "sharedstring::sharedstring (c++ function)": [[158, "_CPPv4N5slint12SharedString12SharedStringENSt11string_viewE"], [158, "_CPPv4N5slint12SharedString12SharedStringENSt13u8string_viewE"], [158, "_CPPv4N5slint12SharedString12SharedStringEPKDu"], [158, "_CPPv4N5slint12SharedString12SharedStringEPKc"], [158, "_CPPv4N5slint12SharedString12SharedStringERK12SharedString"], [158, "_CPPv4N5slint12SharedString12SharedStringEv"]], "sharedstring::begin (c++ function)": [[158, "_CPPv4NK5slint12SharedString5beginEv"]], "sharedstring::data (c++ function)": [[158, "_CPPv4NK5slint12SharedString4dataEv"]], "sharedstring::empty (c++ function)": [[158, "_CPPv4NK5slint12SharedString5emptyEv"]], "sharedstring::end (c++ function)": [[158, "_CPPv4NK5slint12SharedString3endEv"]], "sharedstring::ends_with (c++ function)": [[158, "_CPPv4NK5slint12SharedString9ends_withENSt11string_viewE"]], "sharedstring::from_number (c++ function)": [[158, "_CPPv4N5slint12SharedString11from_numberEd"]], "sharedstring::operator std::string_view (c++ function)": [[158, "_CPPv4NK5slint12SharedStringcvNSt11string_viewEEv"]], "sharedstring::operator!= (c++ function)": [[158, "_CPPv4N5slint12SharedStringneERK12SharedStringRK12SharedString"]], "sharedstring::operator+ (c++ function)": [[158, "_CPPv4N5slint12SharedStringplERK12SharedStringNSt11string_viewE"], [158, "_CPPv4N5slint12SharedStringplERR12SharedStringNSt11string_viewE"]], "sharedstring::operator+= (c++ function)": [[158, "_CPPv4N5slint12SharedStringpLENSt11string_viewE"]], "sharedstring::operator< (c++ function)": [[158, "_CPPv4N5slint12SharedStringltERK12SharedStringRK12SharedString"]], "sharedstring::operator<< (c++ function)": [[158, "_CPPv4N5slint12SharedStringlsERNSt7ostreamERK12SharedString"]], "sharedstring::operator<= (c++ function)": [[158, "_CPPv4N5slint12SharedStringleERK12SharedStringRK12SharedString"]], "sharedstring::operator= (c++ function)": [[158, "_CPPv4N5slint12SharedStringaSENSt11string_viewE"], [158, "_CPPv4N5slint12SharedStringaSEPKc"], [158, "_CPPv4N5slint12SharedStringaSERK12SharedString"], [158, "_CPPv4N5slint12SharedStringaSERR12SharedString"]], "sharedstring::operator== (c++ function)": [[158, "_CPPv4N5slint12SharedStringeqERK12SharedStringRK12SharedString"]], "sharedstring::operator> (c++ function)": [[158, "_CPPv4N5slint12SharedStringgtERK12SharedStringRK12SharedString"]], "sharedstring::operator>= (c++ function)": [[158, "_CPPv4N5slint12SharedStringgeERK12SharedStringRK12SharedString"]], "sharedstring::size (c++ function)": [[158, "_CPPv4NK5slint12SharedString4sizeEv"]], "sharedstring::starts_with (c++ function)": [[158, "_CPPv4NK5slint12SharedString11starts_withENSt11string_viewE"]], "sharedstring::~sharedstring (c++ function)": [[158, "_CPPv4N5slint12SharedStringD0Ev"]], "sharedvector (c++ struct)": [[159, "_CPPv4I0EN5slint12SharedVectorE"]], "sharedvector::sharedvector (c++ function)": [[159, "_CPPv4I0EN5slint12SharedVector12SharedVectorE7InputIt7InputIt"], [159, "_CPPv4N5slint12SharedVector12SharedVectorE6size_t"], [159, "_CPPv4N5slint12SharedVector12SharedVectorE6size_tRK1T"], [159, "_CPPv4N5slint12SharedVector12SharedVectorENSt16initializer_listI1TEE"], [159, "_CPPv4N5slint12SharedVector12SharedVectorERK12SharedVector"], [159, "_CPPv4N5slint12SharedVector12SharedVectorEv"]], "sharedvector::at (c++ function)": [[159, "_CPPv4NK5slint12SharedVector2atENSt6size_tE"]], "sharedvector::begin (c++ function)": [[159, "_CPPv4N5slint12SharedVector5beginEv"], [159, "_CPPv4NK5slint12SharedVector5beginEv"]], "sharedvector::cbegin (c++ function)": [[159, "_CPPv4NK5slint12SharedVector6cbeginEv"]], "sharedvector::cend (c++ function)": [[159, "_CPPv4NK5slint12SharedVector4cendEv"]], "sharedvector::clear (c++ function)": [[159, "_CPPv4N5slint12SharedVector5clearEv"]], "sharedvector::empty (c++ function)": [[159, "_CPPv4NK5slint12SharedVector5emptyEv"]], "sharedvector::end (c++ function)": [[159, "_CPPv4N5slint12SharedVector3endEv"], [159, "_CPPv4NK5slint12SharedVector3endEv"]], "sharedvector::operator= (c++ function)": [[159, "_CPPv4N5slint12SharedVectoraSERK12SharedVector"], [159, "_CPPv4N5slint12SharedVectoraSERR12SharedVector"]], "sharedvector::operator== (c++ function)": [[159, "_CPPv4N5slint12SharedVectoreqERK12SharedVectorRK12SharedVector"]], "sharedvector::operator[] (c++ function)": [[159, "_CPPv4N5slint12SharedVectorixENSt6size_tE"], [159, "_CPPv4NK5slint12SharedVectorixENSt6size_tE"]], "sharedvector::push_back (c++ function)": [[159, "_CPPv4N5slint12SharedVector9push_backERK1T"], [159, "_CPPv4N5slint12SharedVector9push_backERR1T"]], "sharedvector::size (c++ function)": [[159, "_CPPv4NK5slint12SharedVector4sizeEv"]], "sharedvector::~sharedvector (c++ function)": [[159, "_CPPv4N5slint12SharedVectorD0Ev"]], "size (c++ struct)": [[160, "_CPPv4I0EN5slint4SizeE"]], "size::height (c++ member)": [[160, "_CPPv4N5slint4Size6heightE"]], "size::operator== (c++ function)": [[160, "_CPPv4NK5slint4SizeeqERK4Size"]], "size::width (c++ member)": [[160, "_CPPv4N5slint4Size5widthE"]], "standardlistviewitem (c++ struct)": [[161, "_CPPv4N5slint20StandardListViewItemE"]], "standardlistviewitem::text (c++ member)": [[161, "_CPPv4N5slint20StandardListViewItem4textE"]], "timer (c++ struct)": [[162, "_CPPv4N5slint5TimerE"]], "timer::timer (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer5TimerENSt6chrono12millisecondsE1F"], [162, "_CPPv4N5slint5Timer5TimerERK5Timer"], [162, "_CPPv4N5slint5Timer5TimerEv"]], "timer::interval (c++ function)": [[162, "_CPPv4NK5slint5Timer8intervalEv"]], "timer::operator= (c++ function)": [[162, "_CPPv4N5slint5TimeraSERK5Timer"]], "timer::restart (c++ function)": [[162, "_CPPv4N5slint5Timer7restartEv"]], "timer::running (c++ function)": [[162, "_CPPv4NK5slint5Timer7runningEv"]], "timer::single_shot (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer11single_shotEvNSt6chrono12millisecondsE1F"]], "timer::start (c++ function)": [[162, "_CPPv4I_NSt9invocableEEN5slint5Timer5startEv9TimerModeNSt6chrono12millisecondsE1F"]], "timer::stop (c++ function)": [[162, "_CPPv4N5slint5Timer4stopEv"]], "timer::~timer (c++ function)": [[162, "_CPPv4N5slint5TimerD0Ev"]], "diagnostic (c++ struct)": [[163, "_CPPv4N5slint11interpreter10DiagnosticE"]], "diagnostic::column (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic6columnE"]], "diagnostic::level (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic5levelE"]], "diagnostic::line (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic4lineE"]], "diagnostic::message (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic7messageE"]], "diagnostic::source_file (c++ member)": [[163, "_CPPv4N5slint11interpreter10Diagnostic11source_fileE"]], "propertydescriptor (c++ struct)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptorE"]], "propertydescriptor::property_name (c++ member)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_nameE"]], "propertydescriptor::property_type (c++ member)": [[164, "_CPPv4N5slint11interpreter18PropertyDescriptor13property_typeE"]], "struct (c++ struct)": [[165, "_CPPv4N5slint11interpreter6StructE"]], "struct::struct (c++ function)": [[165, "_CPPv4I0EN5slint11interpreter6Struct6StructE13InputIterator13InputIterator"], [165, "_CPPv4N5slint11interpreter6Struct6StructENSt16initializer_listINSt4pairINSt11string_viewE5ValueEEEE"], [165, "_CPPv4N5slint11interpreter6Struct6StructERK6Struct"], [165, "_CPPv4N5slint11interpreter6Struct6StructERR6Struct"], [165, "_CPPv4N5slint11interpreter6Struct6StructEv"]], "struct::begin (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct5beginEv"]], "struct::end (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct3endEv"]], "struct::get_field (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct9get_fieldENSt11string_viewE"]], "struct::iterator (c++ struct)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorE"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorE"]], "struct::iterator::iterator (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator"], [165, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iterator8iteratorERR8iterator"]], "struct::iterator::operator!= (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorneERK8iteratorRK8iterator"]], "struct::iterator::operator* (c++ function)": [[165, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv"], [166, "_CPPv4NK5slint11interpreter6Struct8iteratormlEv"]], "struct::iterator::operator++ (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorppEv"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorppEv"]], "struct::iterator::operator= (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator"], [165, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoraSERK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoraSERR8iterator"]], "struct::iterator::operator== (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator"], [166, "_CPPv4N5slint11interpreter6Struct8iteratoreqERK8iteratorRK8iterator"]], "struct::iterator::value_type (c++ type)": [[165, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE"], [166, "_CPPv4N5slint11interpreter6Struct8iterator10value_typeE"]], "struct::iterator::~iterator (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev"], [166, "_CPPv4N5slint11interpreter6Struct8iteratorD0Ev"]], "struct::operator= (c++ function)": [[165, "_CPPv4N5slint11interpreter6StructaSERK6Struct"], [165, "_CPPv4N5slint11interpreter6StructaSERR6Struct"]], "struct::set_field (c++ function)": [[165, "_CPPv4N5slint11interpreter6Struct9set_fieldENSt11string_viewERK5Value"]], "struct::~struct (c++ function)": [[165, "_CPPv4N5slint11interpreter6StructD0Ev"]], "platform::rgb565pixel (c++ struct)": [[167, "_CPPv4N5slint8platform11Rgb565PixelE"]], "platform::rgb565pixel::rgb565pixel (c++ function)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelERK9Rgb8Pixel"], [167, "_CPPv4N5slint8platform11Rgb565Pixel11Rgb565PixelEv"]], "platform::rgb565pixel::b (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1bE"]], "platform::rgb565pixel::blue (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel4blueEv"]], "platform::rgb565pixel::g (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1gE"]], "platform::rgb565pixel::green (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel5greenEv"]], "platform::rgb565pixel::operator rgb8pixel (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixelcv9Rgb8PixelEv"]], "platform::rgb565pixel::operator== (c++ function)": [[167, "_CPPv4N5slint8platform11Rgb565PixeleqERK11Rgb565PixelRK11Rgb565Pixel"]], "platform::rgb565pixel::r (c++ member)": [[167, "_CPPv4N5slint8platform11Rgb565Pixel1rE"]], "platform::rgb565pixel::red (c++ function)": [[167, "_CPPv4NK5slint8platform11Rgb565Pixel3redEv"]]}}) \ No newline at end of file diff --git a/snapshots/master/docs/node/assets/icons.js b/snapshots/master/docs/node/assets/icons.js new file mode 100644 index 000000000..b79c9e89f --- /dev/null +++ b/snapshots/master/docs/node/assets/icons.js @@ -0,0 +1,15 @@ +(function(svg) { + svg.innerHTML = ``; + svg.style.display = 'none'; + if (location.protocol === 'file:') { + if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', updateUseElements); + else updateUseElements() + function updateUseElements() { + document.querySelectorAll('use').forEach(el => { + if (el.getAttribute('href').includes('#icon-')) { + el.setAttribute('href', el.getAttribute('href').replace(/.*#/, '#')); + } + }); + } + } +})(document.body.appendChild(document.createElementNS('http://www.w3.org/2000/svg', 'svg'))) \ No newline at end of file diff --git a/snapshots/master/docs/node/assets/icons.svg b/snapshots/master/docs/node/assets/icons.svg new file mode 100644 index 000000000..7dead6118 --- /dev/null +++ b/snapshots/master/docs/node/assets/icons.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/snapshots/master/docs/node/assets/main.js b/snapshots/master/docs/node/assets/main.js index d0aa8d5f9..d6f138860 100644 --- a/snapshots/master/docs/node/assets/main.js +++ b/snapshots/master/docs/node/assets/main.js @@ -1,8 +1,8 @@ "use strict"; -"use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` - ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); +"use strict";(()=>{var Ce=Object.create;var ne=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Pe(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Ce(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),y=s.str.charAt(1),p;y in s.node.edges?p=s.node.edges[y]:(p=new t.TokenSet,s.node.edges[y]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(console.log("Show page"),document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){console.log("Scorlling");let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!e.checkVisibility()){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ve(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ne(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ve(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let y=document.createElement("li");y.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,y.append(p),e.appendChild(y)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ne(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var He={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>He[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",fe="mousemove",H="mouseup",J={x:0,y:0},pe=!1,ee=!1,Be=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(Be=!0,F="touchstart",fe="touchmove",H="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(H,()=>{ee=!1});document.addEventListener("click",t=>{pe&&(t.preventDefault(),t.stopImmediatePropagation(),pe=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(H,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(H,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ye=document.head.appendChild(document.createElement("style"));ye.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ye.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ve(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ve(t.value)})}function ve(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.pathname===r.pathname&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/snapshots/master/docs/node/assets/style.css b/snapshots/master/docs/node/assets/style.css index 108428c3f..778b94927 100644 --- a/snapshots/master/docs/node/assets/style.css +++ b/snapshots/master/docs/node/assets/style.css @@ -11,6 +11,7 @@ --light-color-text-aside: #6e6e6e; --light-color-link: #1f70c2; + --light-color-ts-keyword: #056bd6; --light-color-ts-project: #b111c9; --light-color-ts-module: var(--light-color-ts-project); --light-color-ts-namespace: var(--light-color-ts-project); @@ -28,7 +29,7 @@ --light-color-ts-constructor-signature: var(--light-color-ts-constructor); --light-color-ts-parameter: var(--light-color-ts-variable); /* type literal not included as links will never be generated to it */ - --light-color-ts-type-parameter: var(--light-color-ts-type-alias); + --light-color-ts-type-parameter: #a55c0e; --light-color-ts-accessor: var(--light-color-ts-property); --light-color-ts-get-signature: var(--light-color-ts-accessor); --light-color-ts-set-signature: var(--light-color-ts-accessor); @@ -50,6 +51,7 @@ --dark-color-text-aside: #dddddd; --dark-color-link: #00aff4; + --dark-color-ts-keyword: #3399ff; --dark-color-ts-project: #e358ff; --dark-color-ts-module: var(--dark-color-ts-project); --dark-color-ts-namespace: var(--dark-color-ts-project); @@ -67,7 +69,7 @@ --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); --dark-color-ts-parameter: var(--dark-color-ts-variable); /* type literal not included as links will never be generated to it */ - --dark-color-ts-type-parameter: var(--dark-color-ts-type-alias); + --dark-color-ts-type-parameter: #e07d13; --dark-color-ts-accessor: var(--dark-color-ts-property); --dark-color-ts-get-signature: var(--dark-color-ts-accessor); --dark-color-ts-set-signature: var(--dark-color-ts-accessor); @@ -91,6 +93,7 @@ --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); + --color-ts-keyword: var(--light-color-ts-keyword); --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); --color-ts-enum: var(--light-color-ts-enum); @@ -132,6 +135,7 @@ --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); + --color-ts-keyword: var(--dark-color-ts-keyword); --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); --color-ts-enum: var(--dark-color-ts-enum); @@ -180,6 +184,7 @@ body { --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); + --color-ts-keyword: var(--light-color-ts-keyword); --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); --color-ts-enum: var(--light-color-ts-enum); @@ -219,6 +224,7 @@ body { --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); + --color-ts-keyword: var(--dark-color-ts-keyword); --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); --color-ts-enum: var(--dark-color-ts-enum); @@ -260,12 +266,12 @@ h6 { line-height: 1.2; } -h1 > a, -h2 > a, -h3 > a, -h4 > a, -h5 > a, -h6 > a { +h1 > a:not(.link), +h2 > a:not(.link), +h3 > a:not(.link), +h4 > a:not(.link), +h5 > a:not(.link), +h6 > a:not(.link) { text-decoration: none; color: var(--color-text); } @@ -321,17 +327,14 @@ dd { } /* Footer */ -.tsd-generator { +footer { border-top: 1px solid var(--color-accent); padding-top: 1rem; padding-bottom: 1rem; max-height: 3.5rem; } - -.tsd-generator > p { - margin-top: 0; - margin-bottom: 0; - padding: 0 1rem; +.tsd-generator { + margin: 0 1em; } .container-main { @@ -399,7 +402,8 @@ dd { } body { background: var(--color-background); - font-family: "Segoe UI", sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; color: var(--color-text); } @@ -643,6 +647,28 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { font-weight: bold; } +.tsd-full-hierarchy:not(:last-child) { + margin-bottom: 1em; + padding-bottom: 1em; + border-bottom: 1px solid var(--color-accent); +} +.tsd-full-hierarchy, +.tsd-full-hierarchy ul { + list-style: none; + margin: 0; + padding: 0; +} +.tsd-full-hierarchy ul { + padding-left: 1.5rem; +} +.tsd-full-hierarchy a { + padding: 0.25rem 0 !important; + font-size: 1rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} + .tsd-panel-group.tsd-index-group { margin-bottom: 0; } @@ -708,12 +734,15 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { } .tsd-navigation > a, .tsd-navigation .tsd-accordion-summary { - width: calc(100% - 0.5rem); + width: calc(100% - 0.25rem); + display: flex; + align-items: center; } .tsd-navigation a, .tsd-navigation summary > span, .tsd-page-navigation a { - display: inline-flex; + display: flex; + width: calc(100% - 0.25rem); align-items: center; padding: 0.25rem; color: var(--color-text); @@ -753,11 +782,6 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { margin-left: -1.5rem; } -.tsd-nested-navigation > li > a, -.tsd-nested-navigation > li > span { - width: calc(100% - 1.75rem - 0.5rem); -} - .tsd-page-navigation ul { padding-left: 1.75rem; } @@ -984,6 +1008,11 @@ a.tsd-index-link { overflow-x: auto; } +.tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; +} + .tsd-signature-symbol { color: var(--color-text-aside); font-weight: normal; diff --git a/snapshots/master/docs/node/classes/ArrayModel.html b/snapshots/master/docs/node/classes/ArrayModel.html index 756a65a7c..aa12f01f9 100644 --- a/snapshots/master/docs/node/classes/ArrayModel.html +++ b/snapshots/master/docs/node/classes/ArrayModel.html @@ -1,383 +1,47 @@ -ArrayModel | slint-ui
-
- -
-
-
-
- -

Class ArrayModel<T>

-
-

ArrayModel wraps a JavaScript array for use in .slint views. The underlying +ArrayModel | slint-ui

Class ArrayModel<T>

ArrayModel wraps a JavaScript array for use in .slint views. The underlying array can be modified with the [[ArrayModel.push]] and [[ArrayModel.remove]] methods.

-
-
-
-

Type Parameters

-
    -
  • -

    T

-
-

Hierarchy

-
-
-
-
- -
-
-

Constructors

-
- -
-
-

Accessors

-
- -
-
-

Methods

-
- -
-
- -
    - -
  • -

    Returns an iterable of key, value pairs for every entry in the array.

    -
    -

    Returns IterableIterator<[number, T]>

    -
-
- -
-
- -
    - -
  • -

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

    -
    -
    -

    Parameters

    -
      -
    • -
      row: number
      -

      index of the first added row.

      -
      -
    • -
    • -
      count: number
      -

      the number of added items.

      -
      -
    -

    Returns void

    -
-
- -
-
- -
    - -
  • -

    Notifies the view that multiple rows are removed to the model.

    -
    -
    -

    Parameters

    -
      -
    • -
      row: number
      -

      index of the first removed row.

      -
      -
    • -
    • -
      count: number
      -

      the number of removed items.

      -
      -
    -

    Returns void

    -
-
- -
    - -
  • -

    Removes the last element from the array and returns it.

    -
    -

    Returns T

    The removed element or undefined if the array is empty.

    - -
-
- -
    - -
  • -

    Pushes new values to the array that's backing the model and notifies +

Type Parameters

  • T

Hierarchy (view full)

Constructors

Accessors

Methods

  • Returns an iterable of key, value pairs for every entry in the array.

    +

    Returns IterableIterator<[number, T]>

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

    +

    Parameters

    • row: number

      index of the first added row.

      +
    • count: number

      the number of added items.

      +

    Returns void

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

    +

    Parameters

    • row: number

      index of the first removed row.

      +
    • count: number

      the number of removed items.

      +

    Returns void

  • Removes the last element from the array and returns it.

    +

    Returns T

    The removed element or undefined if the array is empty.

    +
  • Pushes new values to the array that's backing the model and notifies the run-time about the added rows.

    -
    -
    -

    Parameters

    -
      -
    • -
      Rest ...values: T[]
      -

      list of values that will be pushed to the array.

      -
      -
    -

    Returns void

    -
-
- -
    - -
  • -

    Removes the specified number of element from the array that's backing +

    Parameters

    • Rest ...values: T[]

      list of values that will be pushed to the array.

      +

    Returns void

  • Removes the specified number of element from the array that's backing the model, starting at the specified index.

    -
    -
    -

    Parameters

    -
      -
    • -
      index: number
      -

      index of first row to remove.

      -
      -
    • -
    • -
      size: number
      -

      number of rows to remove.

      -
      -
    -

    Returns void

    -
-
- -
-
- -
    - -
  • -

    Returns the data at the specified row.

    -
    -
    -

    Parameters

    -
      -
    • -
      row: number
      -

      index in range 0..(rowCount() - 1).

      -
      -
    -

    Returns T

    undefined if row is out of range otherwise the data.

    - -
-
- -
    - -
  • -

    Stores the given data on the given row index and notifies run-time about the changed row.

    -
    -
    -

    Parameters

    -
      -
    • -
      row: number
      -

      index in range 0..(rowCount() - 1).

      -
      -
    • -
    • -
      data: T
      -

      new data item to store on the given row index

      -
      -
    -

    Returns void

    -
-
- -
-
- -
-
\ No newline at end of file +

Parameters

  • index: number

    index of first row to remove.

    +
  • size: number

    number of rows to remove.

    +

Returns void

  • Returns the data at the specified row.

    +

    Parameters

    • row: number

      index in range 0..(rowCount() - 1).

      +

    Returns T

    undefined if row is out of range otherwise the data.

    +
  • Stores the given data on the given row index and notifies run-time about the changed row.

    +

    Parameters

    • row: number

      index in range 0..(rowCount() - 1).

      +
    • data: T

      new data item to store on the given row index

      +

    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 d1705b124..35b6831d0 100644 --- a/snapshots/master/docs/node/classes/CompileError.html +++ b/snapshots/master/docs/node/classes/CompileError.html @@ -1,211 +1,18 @@ -CompileError | slint-ui
-
- -
-
-
-
- -

Class CompileError

-
-

Represents an errors that can be emitted by the compiler.

-
-
-
-

Hierarchy

-
    -
  • Error -
      -
    • CompileError
-
-
-
- -
-
-

Constructors

-
-
-

Properties

-
-
-

Methods

-
-
-

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)
-
-

Type declaration

-
-
- -
stackTraceLimit: number
-
-

Methods

-
- -
    - -
  • -

    Create .stack property on a target object

    -
    -
    -

    Parameters

    -
      -
    • -
      targetObject: object
    • -
    • -
      Optional constructorOpt: Function
    -

    Returns void

    -
-
- -
-
\ No newline at end of file +CompileError | slint-ui

Class CompileError

Represents an errors that can be emitted by the compiler.

+

Hierarchy

  • Error
    • CompileError

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

+

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 874f117ae..b2dd74529 100644 --- a/snapshots/master/docs/node/classes/Model.html +++ b/snapshots/master/docs/node/classes/Model.html @@ -1,255 +1,34 @@ -Model | slint-ui
-
- -
-
-
-
- -

Class Model<T>Abstract

-
-

Model is the interface for feeding dynamic data into +Model | slint-ui

Class Model<T>Abstract

Model is the interface for feeding dynamic data into .slint views.

A model is organized like a table with rows of data. The fields of the data type T behave like columns.

-
-
-
-

Type Parameters

-
    -
  • -

    T

    -

    the type of the model's items.

    +

Type Parameters

  • T

    the type of the model's items.

    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

-
-
-

Implements

-
    -
  • Iterable<T>
-
-
-
- -
-
-

Methods

-
- -
    - -
  • -

    Returns Iterator<T, any, undefined>

-
- -
-
- -
    - -
  • -

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

    -
    -
    -

    Parameters

    -
      -
    • -
      row: number
      -

      index of the first added row.

      -
      -
    • -
    • -
      count: number
      -

      the number of added items.

      -
      -
    -

    Returns void

    -
-
- -
    - -
  • -

    Notifies the view that the data of the current row is changed.

    -
    -
    -

    Parameters

    -
      -
    • -
      row: number
      -

      index of the changed row.

      -
      -
    -

    Returns void

    -
-
- -
    - -
  • -

    Notifies the view that multiple rows are removed to the model.

    -
    -
    -

    Parameters

    -
      -
    • -
      row: number
      -

      index of the first removed row.

      -
      -
    • -
    • -
      count: number
      -

      the number of removed items.

      -
      -
    -

    Returns void

    -
-
- -
-
- -
    - -
  • -

    Implementations of this function must return the data at the specified row.

    -
    -
    -

    Parameters

    -
      -
    • -
      row: number
      -

      index in range 0..(rowCount() - 1).

      -
      -
    -

    Returns T

    undefined if row is out of range otherwise the data.

    - -
-
- -
    - -
  • -

    Implementations of this function must store the provided data parameter +

Hierarchy (view full)

Implements

  • Iterable<T>

Methods

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

    +

    Parameters

    • row: number

      index of the first added row.

      +
    • count: number

      the number of added items.

      +

    Returns void

  • Notifies the view that the data of the current row is changed.

    +

    Parameters

    • row: number

      index of the changed row.

      +

    Returns void

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

    +

    Parameters

    • row: number

      index of the first removed row.

      +
    • count: number

      the number of removed items.

      +

    Returns void

  • Implementations of this function must return the data at the specified row.

    +

    Parameters

    • row: number

      index in range 0..(rowCount() - 1).

      +

    Returns T

    undefined if row is out of range otherwise the data.

    +
  • Implementations of this function must store the provided data parameter in the model at the specified row.

    -
    -
    -

    Parameters

    -
      -
    • -
      _row: number
      -

      index in range 0..(rowCount() - 1).

      -
      -
    • -
    • -
      _data: T
      -

      new data item to store on the given row index

      -
      -
    -

    Returns void

    -
-
- -
-
\ No newline at end of file +

Parameters

  • _row: number

    index in range 0..(rowCount() - 1).

    +
  • _data: T

    new data item to store on the given row index

    +

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 7c96b9a6a..b71800f23 100644 --- a/snapshots/master/docs/node/functions/loadFile.html +++ b/snapshots/master/docs/node/functions/loadFile.html @@ -1,25 +1,4 @@ -loadFile | slint-ui
-
- -
-
-
-
- -

Function loadFile

-
-
    - -
  • -

    Loads the specified Slint file and returns an object containing functions to construct the exported +loadFile | slint-ui

    Function loadFile

    • Loads the specified Slint file and returns an object containing functions to construct the exported components defined within the Slint file.

      The following example loads a "Hello World" style Slint file and changes the Text label to a new greeting: main.slint:

      @@ -28,60 +7,12 @@

      Function loadFile

      index.js:

      import * as slint from "slint-ui";
      let ui = slint.loadFile("main.slint");
      let main = new ui.Main();
      main.greeting = "Hello friends";
      -
    -
    -

    Parameters

    -
      -
    • -
      filePath: string
      -

      The path to the file to load. Relative paths are resolved against the process' current working directory.

      -
      -
    • -
    • -
      Optional options: LoadFileOptions
      -

      An optional LoadFileOptions to configure additional Slint compilation settings, +

      Parameters

      • filePath: string

        The path to the file to load. Relative paths are resolved against the process' current working directory.

        +
      • Optional options: LoadFileOptions

        An optional LoadFileOptions to configure additional Slint compilation settings, such as include search paths, library imports, or the widget style.

        -
        -
      -

      Returns Object

      Returns an object that is immutable and provides a constructor function for each exported Window component found in the .slint file. +

Returns Object

Returns an object that is immutable and provides a constructor function for each exported Window component found in the .slint file. For instance, in the example above, a Main property is available, which can be used to create instances of the Main component using the new keyword. 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 +

Throws

CompileError if errors occur during compilation.

+
\ 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 2daae60f2..5ef0f2f9a 100644 --- a/snapshots/master/docs/node/functions/loadSource.html +++ b/snapshots/master/docs/node/functions/loadSource.html @@ -1,89 +1,16 @@ -loadSource | slint-ui
-
- -
-
-
-
- -

Function loadSource

-
-
    - -
  • -

    Loads the given Slint source code and returns an object that contains a functions to construct the exported +loadSource | slint-ui

    Function loadSource

    • Loads the given Slint source code and returns an object that contains a functions to construct the exported components of the Slint source code.

      The following example loads a "Hello World" style Slint source code and changes the Text label to a new greeting:

      import * as slint from "slint-ui";
      const source = `export component Main {
      in-out property <string> greeting <=> label.text;
      label := Text {
      text: "Hello World";
      }
      }`; // The content of main.slint
      let ui = slint.loadSource(source, "main.js");
      let main = new ui.Main();
      main.greeting = "Hello friends";
      -
      -
      -

      Parameters

      -
        -
      • -
        source: string
        -

        The Slint source code to load.

        -
        -
      • -
      • -
        filePath: string
        -

        A path to the file to show log and resolve relative import and images. +

        Parameters

        • source: string

          The Slint source code to load.

          +
        • filePath: string

          A path to the file to show log and resolve relative import and images. Relative paths are resolved against the process' current working directory.

          -
          -
        • -
        • -
          Optional options: LoadFileOptions
          -

          An optional LoadFileOptions to configure additional Slint compilation settings, +

        • Optional options: LoadFileOptions

          An optional LoadFileOptions to configure additional Slint compilation settings, such as include search paths, library imports, or the widget style.

          -
          -
        -

        Returns Object

        Returns an object that is immutable and provides a constructor function for each exported Window component found in the .slint file. +

    Returns Object

    Returns an object that is immutable and provides a constructor function for each exported Window component found in the .slint file. For instance, in the example above, a Main property is available, which can be used to create instances of the Main component using the new keyword. 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 +

Throws

CompileError if errors occur during compilation.

+
\ 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 7b210b7cb..bdef69d32 100644 --- a/snapshots/master/docs/node/functions/quitEventLoop.html +++ b/snapshots/master/docs/node/functions/quitEventLoop.html @@ -1,60 +1,3 @@ -quitEventLoop | slint-ui
-
- -
-
-
-
- -

Function quitEventLoop

-
-
\ 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 6fc1ae7ce..f8f5526b2 100644 --- a/snapshots/master/docs/node/functions/runEventLoop.html +++ b/snapshots/master/docs/node/functions/runEventLoop.html @@ -1,69 +1,5 @@ -runEventLoop | slint-ui
-
- -
-
-
-
- -

Function runEventLoop

-
-
    - -
  • -

    Spins the Slint event loop and returns a promise that resolves when the loop terminates.

    +runEventLoop | slint-ui

    Function runEventLoop

    • Spins the Slint event loop and returns a promise that resolves when the loop terminates.

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

      -
      -
      -

      Parameters

      -
        -
      • -
        Optional args: Function | {
            quitOnLastWindowClosed?: boolean;
            runningCallback?: Function;
        }
        -

        As Function it defines a callback that's invoked once when the event loop is running.

        -
        -
      -

      Returns Promise<unknown>

      -
    -
    - -
    -
    \ No newline at end of file +

    Parameters

    • Optional args: Function | {
          quitOnLastWindowClosed?: boolean;
          runningCallback?: Function;
      }

      As Function it defines a callback that's invoked once when the event loop is running.

      +

    Returns Promise<unknown>

\ No newline at end of file diff --git a/snapshots/master/docs/node/hierarchy.html b/snapshots/master/docs/node/hierarchy.html new file mode 100644 index 000000000..20b7c4793 --- /dev/null +++ b/snapshots/master/docs/node/hierarchy.html @@ -0,0 +1 @@ +slint-ui

slint-ui

Class Hierarchy

\ No newline at end of file diff --git a/snapshots/master/docs/node/index.html b/snapshots/master/docs/node/index.html index fdf318ab5..a84930243 100644 --- a/snapshots/master/docs/node/index.html +++ b/snapshots/master/docs/node/index.html @@ -1,18 +1,4 @@ -slint-ui
-
- -
-
-
-
-

slint-ui

-
+slint-ui

slint-ui

Slint-node (Beta)

npm

Slint is a UI toolkit that supports different programming languages. Slint-node is the integration with Node.js and Deno.

@@ -111,7 +97,7 @@

slint-ui

}

let ui = slint.loadFile("main.slint");
let instance = new ui.MainWindow();
console.log(instance.age); // Prints 42
instance.name = "Joe";
-

Setting and Invoking Callbacks

Callbacks declared in .slint files are visible as JavaScript function properties on the component instance. Invoke them +

Setting and Invoking Callbacks

Callbacks declared in .slint files are visible as JavaScript function properties on the component instance. Invoke them as function to invoke the callback, and assign JavaScript functions to set the callback handler.

ui/my-component.slint

export component MyComponent inherits Window {
callback clicked <=> i-touch-area.clicked;

width: 400px;
height: 200px;

i-touch-area := TouchArea {}
} @@ -219,61 +205,4 @@

slint-ui

Note: Global singletons are instantiated once per component. When declaring multiple components for export to JavaScript, each instance will have their own instance of associated globals singletons.

-
-
-
\ No newline at end of file +
\ No newline at end of file diff --git a/snapshots/master/docs/node/interfaces/ComponentHandle.html b/snapshots/master/docs/node/interfaces/ComponentHandle.html index ae7663175..3428dc582 100644 --- a/snapshots/master/docs/node/interfaces/ComponentHandle.html +++ b/snapshots/master/docs/node/interfaces/ComponentHandle.html @@ -1,136 +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 +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().

-
-
-
-

Hierarchy

-
    -
  • ComponentHandle
-
-
-
- -
-
-

Accessors

-
-
-

Methods

-
-
-

Accessors

-
- -
    -
  • get window(): Window
  • -
  • -

    Returns the Window associated with this component instance. +

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

-
- -
-
- -

Methods

  • 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>

    -
-
- -
-
- -
-
\ 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 f5402ec9f..0bc6167bb 100644 --- a/snapshots/master/docs/node/interfaces/ImageData.html +++ b/snapshots/master/docs/node/interfaces/ImageData.html @@ -1,129 +1,12 @@ -ImageData | slint-ui
-
- -
-
-
-
- -

Interface ImageData

-
-

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

+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.

-
-
-
-

Hierarchy

-
    -
  • ImageData
-
-
-
- -
-
-

Properties

-
-
-

Accessors

-
-
-

Properties

-
- -
path?: string
-

Returns the path of the image, if it was loaded from disk. Otherwise +

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

-
- -
-
- -
-
- -
-
- -
-
\ No newline at end of file +

Accessors

\ 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 57304af3f..7a9aeddbd 100644 --- a/snapshots/master/docs/node/interfaces/LoadFileOptions.html +++ b/snapshots/master/docs/node/interfaces/LoadFileOptions.html @@ -1,113 +1,10 @@ -LoadFileOptions | slint-ui
-
- -
-
-
-
- -

Interface LoadFileOptions

-
-

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

-
-
-
-

Hierarchy

-
    -
  • LoadFileOptions
-
-
-
- -
-
-

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 +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

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 diff --git a/snapshots/master/docs/node/interfaces/Point.html b/snapshots/master/docs/node/interfaces/Point.html index 0ba88fc6f..25b95105a 100644 --- a/snapshots/master/docs/node/interfaces/Point.html +++ b/snapshots/master/docs/node/interfaces/Point.html @@ -1,93 +1,6 @@ -Point | slint-ui
-
- -
-
-
-
- -

Interface Point

-
-

Represents a two-dimensional point.

-
-
-
-

Hierarchy

-
    -
  • Point
-
-
-
- -
-
-

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 +Point | slint-ui

Interface Point

Represents a two-dimensional point.

+
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 diff --git a/snapshots/master/docs/node/interfaces/Size.html b/snapshots/master/docs/node/interfaces/Size.html index 6b816c598..835b888ea 100644 --- a/snapshots/master/docs/node/interfaces/Size.html +++ b/snapshots/master/docs/node/interfaces/Size.html @@ -1,93 +1,6 @@ -Size | slint-ui
-
- -
-
-
-
- -

Interface Size

-
-

Represents a two-dimensional size.

-
-
-
-

Hierarchy

-
    -
  • Size
-
-
-
- -
-
-

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 +Size | slint-ui

Interface Size

Represents a two-dimensional size.

+
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 diff --git a/snapshots/master/docs/node/interfaces/Window.html b/snapshots/master/docs/node/interfaces/Window.html index 4067fd386..c2a544085 100644 --- a/snapshots/master/docs/node/interfaces/Window.html +++ b/snapshots/master/docs/node/interfaces/Window.html @@ -1,209 +1,28 @@ -Window | slint-ui
-
- -
-
-
-
- -

Interface Window

-
-

This type represents a window towards the windowing system, that's used to render the +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.

-
-
-
-

Hierarchy

-
    -
  • Window
-
-
-
- -
-
-

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() +

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() on it, for example if the user minimized the window.

    -
    -

    Returns boolean

    -
-
-

Methods

-
- -
-
- -
    - -
  • -

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

    -
    -

    Returns void

    -
-
- -

Methods

  • 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/node/modules.html b/snapshots/master/docs/node/modules.html index 08892890a..28b466a3f 100644 --- a/snapshots/master/docs/node/modules.html +++ b/snapshots/master/docs/node/modules.html @@ -1,71 +1,14 @@ -slint-ui
-
- -
-
-
-
-

slint-ui

-
-
-

Index

-
-

Classes

-
-
-

Interfaces

-
-
-

Functions

-
-
- -
-
\ No newline at end of file +slint-ui
\ No newline at end of file diff --git a/snapshots/master/docs/rust/help.html b/snapshots/master/docs/rust/help.html index 5cbf33213..8e4cb12a9 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 709cb1f98..9bb1f78b4 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 4c9985871..ded9bf93e 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 + Sync + Send>), + OtherError(Box<dyn Error + Send + Sync>), }
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 + 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.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.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 +
§

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.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.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 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 + Sync + Send>

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 + Send + Sync>

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 d5535209e..df896240a 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 + Sync + Send>), + OtherError(Box<dyn Error + Send + Sync>), }
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 + 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.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.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 +
§

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.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.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 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 + Sync + Send>

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 + Send + Sync>

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 83eab7f94..04aa5c15e 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 + Sync + Send>>;
-    fn swap_buffers(&self) -> Result<(), Box<dyn Error + Sync + Send>>;
+    fn ensure_current(&self) -> Result<(), Box<dyn Error + Send + Sync>>;
+    fn swap_buffers(&self) -> Result<(), Box<dyn Error + Send + Sync>>;
     fn resize(
         &self,
         width: NonZero<u32>,
         height: NonZero<u32>,
-    ) -> Result<(), Box<dyn Error + Sync + Send>>;
+    ) -> Result<(), Box<dyn Error + Send + Sync>>;
     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 + 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 +

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 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 + Sync + Send>>

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

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 6149202d4..7a3909e93 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 + Sync + Send>), + OtherError(Box<dyn Error + Send + Sync>), }
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 + 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.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.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 +
§

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.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.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 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 + Sync + Send>

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 + Send + Sync>

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 22210522a..37d5ae257 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
slint_interpreter

Enum Value

source
#[non_exhaustive]
#[repr(u8)]
pub enum Value { +
slint_interpreter

Enum Value

source
#[non_exhaustive]
#[repr(u8)]
pub enum Value { Void = 0, Number(f64), String(SharedString), @@ -147,8 +147,8 @@
§

Struct(Struct)

An object

§

Brush(Brush)

Correspond to brush or color type in .slint. For color, this is then a Brush::SolidColor

Implementations§

source§

impl Value

source

pub fn value_type(&self) -> ValueType

Returns the type variant that this value holds without the containing value.

-

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Value

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Value

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for Value

source§

fn default() -> Value

Returns the “default value” for a type. Read more
source§

impl From<()> for Value

source§

fn from(_: ()) -> Self

Converts to this type from the input type.
source§

impl From<AccessibleRole> for Value

source§

fn from(v: AccessibleRole) -> Self

Converts to this type from the input type.
source§

impl From<AnimationDirection> for Value

source§

fn from(v: AnimationDirection) -> Self

Converts to this type from the input type.
source§

impl From<Brush> for Value

source§

fn from(v: Brush) -> Self

Converts to this type from the input type.
source§

impl From<Color> for Value

source§

fn from(c: Color) -> Self

Converts to this type from the input type.
source§

impl From<ColorScheme> for Value

source§

fn from(v: ColorScheme) -> Self

Converts to this type from the input type.
source§

impl From<ComponentFactory> for Value

source§

fn from(v: ComponentFactory) -> Self

Converts to this type from the input type.
source§

impl From<DialogButtonRole> for Value

source§

fn from(v: DialogButtonRole) -> Self

Converts to this type from the input type.
source§

impl From<EasingCurve> for Value

source§

fn from(v: EasingCurve) -> Self

Converts to this type from the input type.
source§

impl From<EventResult> for Value

source§

fn from(v: EventResult) -> Self

Converts to this type from the input type.
source§

impl From<FillRule> for Value

source§

fn from(v: FillRule) -> Self

Converts to this type from the input type.
source§

impl From<FontMetrics> for Value

source§

fn from(item: FontMetrics) -> Self

Converts to this type from the input type.
source§

impl From<Image> for Value

source§

fn from(v: Image) -> Self

Converts to this type from the input type.
source§

impl From<ImageFit> for Value

source§

fn from(v: ImageFit) -> Self

Converts to this type from the input type.
source§

impl From<ImageHorizontalAlignment> for Value

source§

fn from(v: ImageHorizontalAlignment) -> Self

Converts to this type from the input type.
source§

impl From<ImageRendering> for Value

source§

fn from(v: ImageRendering) -> Self

Converts to this type from the input type.
source§

impl From<ImageTiling> for Value

source§

fn from(v: ImageTiling) -> Self

Converts to this type from the input type.
source§

impl From<ImageVerticalAlignment> for Value

source§

fn from(v: ImageVerticalAlignment) -> Self

Converts to this type from the input type.
source§

impl From<InputType> for Value

source§

fn from(v: InputType) -> Self

Converts to this type from the input type.
source§

impl From<Instant> for Value

source§

fn from(value: Instant) -> Self

Converts to this type from the input type.
source§

impl From<KeyEvent> for Value

source§

fn from(item: KeyEvent) -> Self

Converts to this type from the input type.
source§

impl From<KeyboardModifiers> for Value

source§

fn from(item: KeyboardModifiers) -> Self

Converts to this type from the input type.
source§

impl From<LayoutAlignment> for Value

source§

fn from(v: LayoutAlignment) -> Self

Converts to this type from the input type.
source§

impl From<LayoutInfo> for Value

source§

fn from(_: LayoutInfo) -> Self

Converts to this type from the input type.
source§

impl From<Length<f32, LogicalPx>> for Value

source§

fn from(l: LogicalLength) -> Self

Converts to this type from the input type.
source§

impl From<LogicalPosition> for Value

source§

fn from(_: LogicalPosition) -> Self

Converts to this type from the input type.
source§

impl From<MouseCursor> for Value

source§

fn from(v: MouseCursor) -> Self

Converts to this type from the input type.
source§

impl From<Orientation> for Value

source§

fn from(v: Orientation) -> Self

Converts to this type from the input type.
source§

impl From<PathData> for Value

source§

fn from(v: PathData) -> Self

Converts to this type from the input type.
source§

impl From<PathEvent> for Value

source§

fn from(v: PathEvent) -> Self

Converts to this type from the input type.
source§

impl From<Point2D<f32, UnknownUnit>> for Value

source§

fn from(_: Point) -> Self

Converts to this type from the input type.
source§

impl From<PointerEvent> for Value

source§

fn from(item: PointerEvent) -> Self

Converts to this type from the input type.
source§

impl From<PointerEventButton> for Value

source§

fn from(v: PointerEventButton) -> Self

Converts to this type from the input type.
source§

impl From<PointerEventKind> for Value

source§

fn from(v: PointerEventKind) -> Self

Converts to this type from the input type.
source§

impl From<PointerScrollEvent> for Value

source§

fn from(item: PointerScrollEvent) -> Self

Converts to this type from the input type.
source§

impl From<SharedString> for Value

source§

fn from(v: SharedString) -> Self

Converts to this type from the input type.
source§

impl From<SharedVector<f32>> for Value

source§

fn from(v: SharedVector<f32>) -> Self

Converts to this type from the input type.
source§

impl From<SortOrder> for Value

source§

fn from(v: SortOrder) -> Self

Converts to this type from the input type.
source§

impl From<StandardButtonKind> for Value

source§

fn from(v: StandardButtonKind) -> Self

Converts to this type from the input type.
source§

impl From<StandardListViewItem> for Value

source§

fn from(item: StandardListViewItem) -> Self

Converts to this type from the input type.
source§

impl From<StateInfo> for Value

source§

fn from(item: StateInfo) -> Self

Converts to this type from the input type.
source§

impl From<Struct> for Value

source§

fn from(v: Struct) -> Self

Converts to this type from the input type.
source§

impl From<TableColumn> for Value

source§

fn from(item: TableColumn) -> Self

Converts to this type from the input type.
source§

impl From<TextHorizontalAlignment> for Value

source§

fn from(v: TextHorizontalAlignment) -> Self

Converts to this type from the input type.
source§

impl From<TextOverflow> for Value

source§

fn from(v: TextOverflow) -> Self

Converts to this type from the input type.
source§

impl From<TextStrokeStyle> for Value

source§

fn from(v: TextStrokeStyle) -> Self

Converts to this type from the input type.
source§

impl From<TextVerticalAlignment> for Value

source§

fn from(v: TextVerticalAlignment) -> Self

Converts to this type from the input type.
source§

impl From<TextWrap> for Value

source§

fn from(v: TextWrap) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(v: bool) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Value

source§

fn from(v: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(v: f64) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Value

source§

fn from(v: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(v: i64) -> Self

Converts to this type from the input type.
source§

impl From<isize> for Value

source§

fn from(v: isize) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Value

source§

fn from(v: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Value

source§

fn from(v: u64) -> Self

Converts to this type from the input type.
source§

impl From<usize> for Value

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Value

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
source§

impl TryFrom<Value> for ()

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(_: Value) -> Result<(), Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for AccessibleRole

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<AccessibleRole, ()>

Performs the conversion.
source§

impl TryFrom<Value> for AnimationDirection

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<AnimationDirection, ()>

Performs the conversion.
source§

impl TryFrom<Value> for Brush

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Brush, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Color

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Color, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for ColorScheme

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ColorScheme, ()>

Performs the conversion.
source§

impl TryFrom<Value> for ComponentFactory

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ComponentFactory, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for DialogButtonRole

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<DialogButtonRole, ()>

Performs the conversion.
source§

impl TryFrom<Value> for EasingCurve

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<EasingCurve, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for EventResult

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<EventResult, ()>

Performs the conversion.
source§

impl TryFrom<Value> for FillRule

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<FillRule, ()>

Performs the conversion.
source§

impl TryFrom<Value> for FontMetrics

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<FontMetrics, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Image

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Image, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for ImageFit

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ImageFit, ()>

Performs the conversion.
source§

impl TryFrom<Value> for ImageHorizontalAlignment

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ImageHorizontalAlignment, ()>

Performs the conversion.
source§

impl TryFrom<Value> for ImageRendering

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ImageRendering, ()>

Performs the conversion.
source§

impl TryFrom<Value> for ImageTiling

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ImageTiling, ()>

Performs the conversion.
source§

impl TryFrom<Value> for ImageVerticalAlignment

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ImageVerticalAlignment, ()>

Performs the conversion.
source§

impl TryFrom<Value> for InputType

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<InputType, ()>

Performs the conversion.
source§

impl TryFrom<Value> for Instant

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Instant, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for KeyEvent

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<KeyEvent, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for KeyboardModifiers

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<KeyboardModifiers, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for LayoutAlignment

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<LayoutAlignment, ()>

Performs the conversion.
source§

impl TryFrom<Value> for LayoutInfo

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<LayoutInfo, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for LogicalLength

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<LogicalLength, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for LogicalPosition

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<LogicalPosition, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for MouseCursor

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<MouseCursor, ()>

Performs the conversion.
source§

impl TryFrom<Value> for Orientation

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Orientation, ()>

Performs the conversion.
source§

impl TryFrom<Value> for PathData

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PathData, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for PathEvent

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PathEvent, ()>

Performs the conversion.
source§

impl TryFrom<Value> for Point

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Point, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for PointerEvent

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PointerEvent, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for PointerEventButton

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PointerEventButton, ()>

Performs the conversion.
source§

impl TryFrom<Value> for PointerEventKind

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PointerEventKind, ()>

Performs the conversion.
source§

impl TryFrom<Value> for PointerScrollEvent

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PointerScrollEvent, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for SharedString

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<SharedString, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for SharedVector<f32>

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<SharedVector<f32>, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for SortOrder

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<SortOrder, ()>

Performs the conversion.
source§

impl TryFrom<Value> for StandardButtonKind

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<StandardButtonKind, ()>

Performs the conversion.
source§

impl TryFrom<Value> for StandardListViewItem

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<StandardListViewItem, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for StateInfo

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<StateInfo, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Struct

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Struct, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for TableColumn

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TableColumn, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for TextHorizontalAlignment

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TextHorizontalAlignment, ()>

Performs the conversion.
source§

impl TryFrom<Value> for TextOverflow

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TextOverflow, ()>

Performs the conversion.
source§

impl TryFrom<Value> for TextStrokeStyle

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TextStrokeStyle, ()>

Performs the conversion.
source§

impl TryFrom<Value> for TextVerticalAlignment

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TextVerticalAlignment, ()>

Performs the conversion.
source§

impl TryFrom<Value> for TextWrap

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TextWrap, ()>

Performs the conversion.
source§

impl TryFrom<Value> for bool

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<bool, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for f32

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<f32, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for f64

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<f64, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for i32

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<i32, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for i64

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<i64, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for isize

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<isize, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for u32

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<u32, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for u64

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<u64, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for usize

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<usize, Self::Error>

Performs the conversion.
source§

impl ValueType for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl !RefUnwindSafe for Value

§

impl !Send for Value

§

impl !Sync for Value

§

impl Unpin for Value

§

impl !UnwindSafe for Value

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Value

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Value

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for Value

source§

fn default() -> Value

Returns the “default value” for a type. Read more
source§

impl From<()> for Value

source§

fn from(_: ()) -> Self

Converts to this type from the input type.
source§

impl From<AccessibleRole> for Value

source§

fn from(v: AccessibleRole) -> Self

Converts to this type from the input type.
source§

impl From<AnimationDirection> for Value

source§

fn from(v: AnimationDirection) -> Self

Converts to this type from the input type.
source§

impl From<Brush> for Value

source§

fn from(v: Brush) -> Self

Converts to this type from the input type.
source§

impl From<Color> for Value

source§

fn from(c: Color) -> Self

Converts to this type from the input type.
source§

impl From<ColorScheme> for Value

source§

fn from(v: ColorScheme) -> Self

Converts to this type from the input type.
source§

impl From<ComponentFactory> for Value

source§

fn from(v: ComponentFactory) -> Self

Converts to this type from the input type.
source§

impl From<DialogButtonRole> for Value

source§

fn from(v: DialogButtonRole) -> Self

Converts to this type from the input type.
source§

impl From<EasingCurve> for Value

source§

fn from(v: EasingCurve) -> Self

Converts to this type from the input type.
source§

impl From<EventResult> for Value

source§

fn from(v: EventResult) -> Self

Converts to this type from the input type.
source§

impl From<FillRule> for Value

source§

fn from(v: FillRule) -> Self

Converts to this type from the input type.
source§

impl From<FontMetrics> for Value

source§

fn from(item: FontMetrics) -> Self

Converts to this type from the input type.
source§

impl From<Image> for Value

source§

fn from(v: Image) -> Self

Converts to this type from the input type.
source§

impl From<ImageFit> for Value

source§

fn from(v: ImageFit) -> Self

Converts to this type from the input type.
source§

impl From<ImageHorizontalAlignment> for Value

source§

fn from(v: ImageHorizontalAlignment) -> Self

Converts to this type from the input type.
source§

impl From<ImageRendering> for Value

source§

fn from(v: ImageRendering) -> Self

Converts to this type from the input type.
source§

impl From<ImageTiling> for Value

source§

fn from(v: ImageTiling) -> Self

Converts to this type from the input type.
source§

impl From<ImageVerticalAlignment> for Value

source§

fn from(v: ImageVerticalAlignment) -> Self

Converts to this type from the input type.
source§

impl From<InputType> for Value

source§

fn from(v: InputType) -> Self

Converts to this type from the input type.
source§

impl From<Instant> for Value

source§

fn from(value: Instant) -> Self

Converts to this type from the input type.
source§

impl From<KeyEvent> for Value

source§

fn from(item: KeyEvent) -> Self

Converts to this type from the input type.
source§

impl From<KeyboardModifiers> for Value

source§

fn from(item: KeyboardModifiers) -> Self

Converts to this type from the input type.
source§

impl From<LayoutAlignment> for Value

source§

fn from(v: LayoutAlignment) -> Self

Converts to this type from the input type.
source§

impl From<LayoutInfo> for Value

source§

fn from(_: LayoutInfo) -> Self

Converts to this type from the input type.
source§

impl From<Length<f32, LogicalPx>> for Value

source§

fn from(l: LogicalLength) -> Self

Converts to this type from the input type.
source§

impl From<LogicalPosition> for Value

source§

fn from(_: LogicalPosition) -> Self

Converts to this type from the input type.
source§

impl From<MouseCursor> for Value

source§

fn from(v: MouseCursor) -> Self

Converts to this type from the input type.
source§

impl From<Orientation> for Value

source§

fn from(v: Orientation) -> Self

Converts to this type from the input type.
source§

impl From<PathData> for Value

source§

fn from(v: PathData) -> Self

Converts to this type from the input type.
source§

impl From<PathEvent> for Value

source§

fn from(v: PathEvent) -> Self

Converts to this type from the input type.
source§

impl From<Point2D<f32, UnknownUnit>> for Value

source§

fn from(_: Point) -> Self

Converts to this type from the input type.
source§

impl From<PointerEvent> for Value

source§

fn from(item: PointerEvent) -> Self

Converts to this type from the input type.
source§

impl From<PointerEventButton> for Value

source§

fn from(v: PointerEventButton) -> Self

Converts to this type from the input type.
source§

impl From<PointerEventKind> for Value

source§

fn from(v: PointerEventKind) -> Self

Converts to this type from the input type.
source§

impl From<PointerScrollEvent> for Value

source§

fn from(item: PointerScrollEvent) -> Self

Converts to this type from the input type.
source§

impl From<ScrollBarPolicy> for Value

source§

fn from(v: ScrollBarPolicy) -> Self

Converts to this type from the input type.
source§

impl From<SharedString> for Value

source§

fn from(v: SharedString) -> Self

Converts to this type from the input type.
source§

impl From<SharedVector<f32>> for Value

source§

fn from(v: SharedVector<f32>) -> Self

Converts to this type from the input type.
source§

impl From<SortOrder> for Value

source§

fn from(v: SortOrder) -> Self

Converts to this type from the input type.
source§

impl From<StandardButtonKind> for Value

source§

fn from(v: StandardButtonKind) -> Self

Converts to this type from the input type.
source§

impl From<StandardListViewItem> for Value

source§

fn from(item: StandardListViewItem) -> Self

Converts to this type from the input type.
source§

impl From<StateInfo> for Value

source§

fn from(item: StateInfo) -> Self

Converts to this type from the input type.
source§

impl From<Struct> for Value

source§

fn from(v: Struct) -> Self

Converts to this type from the input type.
source§

impl From<TableColumn> for Value

source§

fn from(item: TableColumn) -> Self

Converts to this type from the input type.
source§

impl From<TextHorizontalAlignment> for Value

source§

fn from(v: TextHorizontalAlignment) -> Self

Converts to this type from the input type.
source§

impl From<TextOverflow> for Value

source§

fn from(v: TextOverflow) -> Self

Converts to this type from the input type.
source§

impl From<TextStrokeStyle> for Value

source§

fn from(v: TextStrokeStyle) -> Self

Converts to this type from the input type.
source§

impl From<TextVerticalAlignment> for Value

source§

fn from(v: TextVerticalAlignment) -> Self

Converts to this type from the input type.
source§

impl From<TextWrap> for Value

source§

fn from(v: TextWrap) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(v: bool) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Value

source§

fn from(v: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(v: f64) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Value

source§

fn from(v: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(v: i64) -> Self

Converts to this type from the input type.
source§

impl From<isize> for Value

source§

fn from(v: isize) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Value

source§

fn from(v: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Value

source§

fn from(v: u64) -> Self

Converts to this type from the input type.
source§

impl From<usize> for Value

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Value

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
source§

impl TryFrom<Value> for ()

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(_: Value) -> Result<(), Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for AccessibleRole

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<AccessibleRole, ()>

Performs the conversion.
source§

impl TryFrom<Value> for AnimationDirection

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<AnimationDirection, ()>

Performs the conversion.
source§

impl TryFrom<Value> for Brush

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Brush, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Color

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Color, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for ColorScheme

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ColorScheme, ()>

Performs the conversion.
source§

impl TryFrom<Value> for ComponentFactory

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ComponentFactory, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for DialogButtonRole

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<DialogButtonRole, ()>

Performs the conversion.
source§

impl TryFrom<Value> for EasingCurve

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<EasingCurve, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for EventResult

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<EventResult, ()>

Performs the conversion.
source§

impl TryFrom<Value> for FillRule

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<FillRule, ()>

Performs the conversion.
source§

impl TryFrom<Value> for FontMetrics

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<FontMetrics, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Image

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Image, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for ImageFit

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ImageFit, ()>

Performs the conversion.
source§

impl TryFrom<Value> for ImageHorizontalAlignment

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ImageHorizontalAlignment, ()>

Performs the conversion.
source§

impl TryFrom<Value> for ImageRendering

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ImageRendering, ()>

Performs the conversion.
source§

impl TryFrom<Value> for ImageTiling

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ImageTiling, ()>

Performs the conversion.
source§

impl TryFrom<Value> for ImageVerticalAlignment

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ImageVerticalAlignment, ()>

Performs the conversion.
source§

impl TryFrom<Value> for InputType

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<InputType, ()>

Performs the conversion.
source§

impl TryFrom<Value> for Instant

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Instant, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for KeyEvent

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<KeyEvent, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for KeyboardModifiers

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<KeyboardModifiers, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for LayoutAlignment

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<LayoutAlignment, ()>

Performs the conversion.
source§

impl TryFrom<Value> for LayoutInfo

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<LayoutInfo, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for LogicalLength

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<LogicalLength, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for LogicalPosition

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<LogicalPosition, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for MouseCursor

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<MouseCursor, ()>

Performs the conversion.
source§

impl TryFrom<Value> for Orientation

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Orientation, ()>

Performs the conversion.
source§

impl TryFrom<Value> for PathData

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PathData, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for PathEvent

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PathEvent, ()>

Performs the conversion.
source§

impl TryFrom<Value> for Point

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Point, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for PointerEvent

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PointerEvent, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for PointerEventButton

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PointerEventButton, ()>

Performs the conversion.
source§

impl TryFrom<Value> for PointerEventKind

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PointerEventKind, ()>

Performs the conversion.
source§

impl TryFrom<Value> for PointerScrollEvent

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<PointerScrollEvent, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for ScrollBarPolicy

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<ScrollBarPolicy, ()>

Performs the conversion.
source§

impl TryFrom<Value> for SharedString

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<SharedString, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for SharedVector<f32>

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<SharedVector<f32>, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for SortOrder

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<SortOrder, ()>

Performs the conversion.
source§

impl TryFrom<Value> for StandardButtonKind

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<StandardButtonKind, ()>

Performs the conversion.
source§

impl TryFrom<Value> for StandardListViewItem

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<StandardListViewItem, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for StateInfo

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<StateInfo, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Struct

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<Struct, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for TableColumn

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TableColumn, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for TextHorizontalAlignment

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TextHorizontalAlignment, ()>

Performs the conversion.
source§

impl TryFrom<Value> for TextOverflow

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TextOverflow, ()>

Performs the conversion.
source§

impl TryFrom<Value> for TextStrokeStyle

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TextStrokeStyle, ()>

Performs the conversion.
source§

impl TryFrom<Value> for TextVerticalAlignment

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TextVerticalAlignment, ()>

Performs the conversion.
source§

impl TryFrom<Value> for TextWrap

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<TextWrap, ()>

Performs the conversion.
source§

impl TryFrom<Value> for bool

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<bool, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for f32

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<f32, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for f64

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<f64, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for i32

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<i32, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for i64

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<i64, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for isize

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<isize, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for u32

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<u32, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for u64

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<u64, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for usize

source§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(v: Value) -> Result<usize, Self::Error>

Performs the conversion.
source§

impl ValueType for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl !RefUnwindSafe for Value

§

impl !Send for Value

§

impl !Sync for Value

§

impl Unpin for Value

§

impl !UnwindSafe for Value

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
source§

impl<T> CloneToUninit for T
where @@ -157,7 +157,7 @@ then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be 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.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+generate &mut Any’s vtable from &mut Trait’s.
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 Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where @@ -176,8 +176,8 @@ R: Read + ReadEndian<P>, P: Default,

source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a diff --git a/snapshots/master/docs/rust/slint_interpreter/enum.ValueType.html b/snapshots/master/docs/rust/slint_interpreter/enum.ValueType.html index 6efce2e5a..72fab4737 100644 --- a/snapshots/master/docs/rust/slint_interpreter/enum.ValueType.html +++ b/snapshots/master/docs/rust/slint_interpreter/enum.ValueType.html @@ -1,4 +1,4 @@ -ValueType in slint_interpreter - Rust"),typeof Bt!="string"&&!ho(Bt))if(typeof Bt.toString=="function"){if(Bt=Bt.toString(),typeof Bt!="string")throw h4("dirty is not a string, aborting")}else throw h4("toString is not a function");if(!e.isSupported)return Bt;if(rs||be(K),e.removed=[],typeof Bt=="string"&&(Gs=!1),Gs){if(Bt.nodeName){const se=Br(Bt.nodeName);if(!Ne[se]||ss[se])throw h4("root node is forbidden and cannot be sanitized in-place")}}else if(Bt instanceof a)de=ta(""),T=de.ownerDocument.importNode(Bt,!0),T.nodeType===1&&T.nodeName==="BODY"||T.nodeName==="HTML"?de=T:de.appendChild(T);else{if(!Ln&&!ea&&!ki&&Bt.indexOf("<")===-1)return y&&wd?y.createHTML(Bt):Bt;if(de=ta(Bt),!de)return Ln?null:wd?C:""}de&&Or&&Wr(de.firstChild);const O=Oh(Gs?Bt:de);for(;ie=O.nextNode();)gn(ie)||(ie.content instanceof r&&Si(ie.content),Ot(ie));if(Gs)return Bt;if(Ln){if(Wa)for(ye=k.call(de.ownerDocument);de.firstChild;)ye.appendChild(de.firstChild);else ye=de;return(Dt.shadowroot||Dt.shadowrootmode)&&(ye=R.call(t,ye,!0)),ye}let $=ki?de.outerHTML:de.innerHTML;return ki&&Ne["!doctype"]&&de.ownerDocument&&de.ownerDocument.doctype&&de.ownerDocument.doctype.name&&Dp(nqe,de.ownerDocument.doctype.name)&&($=" -`+$),ea&&($=pv($,G," "),$=pv($,Y," "),$=pv($,j," ")),y&&wd?y.createHTML($):$},e.setConfig=function(Bt){be(Bt),rs=!0},e.clearConfig=function(){Ts=null,rs=!1},e.isValidAttribute=function(Bt,K,de){Ts||be({});const T=Br(Bt),ie=Br(K);return Se(T,ie,de)},e.addHook=function(Bt,K){typeof K=="function"&&(z[Bt]=z[Bt]||[],d4(z[Bt],K))},e.removeHook=function(Bt){if(z[Bt])return _Oe(z[Bt])},e.removeHooks=function(Bt){z[Bt]&&(z[Bt]=[])},e.removeAllHooks=function(){z={}},e}var RTe=sqe();const rqe=RTe.sanitize,oqe=RTe.addHook,aqe=RTe.removeHook;function Hc(s){return tae(s,0)}function tae(s,e){switch(typeof s){case"object":return s===null?ES(349,e):Array.isArray(s)?xht(s,e):Dht(s,e);case"string":return MTe(s,e);case"boolean":return Eht(s,e);case"number":return ES(s,e);case"undefined":return ES(937,e);default:return ES(617,e)}}function ES(s,e){return(e<<5)-e+s|0}function Eht(s,e){return ES(s?433:863,e)}function MTe(s,e){e=ES(149417,e);for(let t=0,i=s.length;ttae(i,t),e)}function Dht(s,e){return e=ES(181387,e),Object.keys(s).sort().reduce((t,i)=>(t=MTe(i,t),tae(s[i],t)),e)}var $m;(function(s){s[s.BLOCK_SIZE=64]="BLOCK_SIZE",s[s.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})($m||($m={}));function $de(s,e,t=32){const i=t-e,n=~((1<>>i)>>>0}function SOe(s,e=0,t=s.byteLength,i=0){for(let n=0;nt.toString(16).padStart(2,"0")).join(""):kht((s>>>0).toString(16),e/4)}const rse=class rse{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array($m.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,r=this._leftoverHighSurrogate,o,a;for(r!==0?(o=r,a=-1,r=0):(o=e.charCodeAt(0),a=0);;){let c=o;if(Fc(o))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>=$m.BLOCK_SIZE&&(this._step(),t-=$m.BLOCK_SIZE,this._totalLen+=$m.BLOCK_SIZE,e[0]=e[$m.BLOCK_SIZE+0],e[1]=e[$m.BLOCK_SIZE+1],e[2]=e[$m.BLOCK_SIZE+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,$m.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),u4(this._h0)+u4(this._h1)+u4(this._h2)+u4(this._h3)+u4(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,SOe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),SOe(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=rse._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,$de(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,r=this._h2,o=this._h3,a=this._h4,c,l,d;for(let h=0;h<80;h++)h<20?(c=n&r|~n&o,l=1518500249):h<40?(c=n^r^o,l=1859775393):h<60?(c=n&r|n&o|r&o,l=2400959708):(c=n^r^o,l=3395469782),d=$de(i,5)+c+a+l+e.getUint32(h*4,!1)&4294967295,a=o,o=r,r=$de(n,30),n=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+n&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};rse._bigBlock32=new DataView(new ArrayBuffer(320));let Npe=rse;function qa(s,e,t){return Math.min(Math.max(s,e),t)}function AOe(s,e){return(e+s%e)%e}class Iht{constructor(){this._next=0}getNext(){return this._next++}}class NTe{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 Tht{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(o.vscodeWindowId),i.fire(o)})),a.add(ue(o,ke.BEFORE_UNLOAD,()=>{n.fire(o)})),t.fire(c),a},getWindows(){return s.values()},getWindowsCount(){return s.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return s.has(o)},getWindowById:r,getWindow(o){const a=o;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;const c=o;return c?.view?c.view.window:ri},getDocument(o){return lt(o).document}}}();function Ns(s){for(;s.firstChild;)s.firstChild.remove()}class Nht{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 Nht(s,e,t,i)}function cqe(s,e){return function(t){return e(new Dh(s,t))}}function Pht(s){return function(e){return s(new xn(e))}}const Rr=function(e,t,i,n){let r=i;return t==="click"||t==="mousedown"||t==="contextmenu"?r=cqe(lt(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=Pht(i)),ue(e,t,r,n)},Fht=function(e,t,i){const n=cqe(lt(e),t);return Oht(e,n,i)};function Oht(s,e,t){return ue(s,gm&&NO.pointerEvents?ke.POINTER_DOWN:ke.MOUSE_DOWN,e,t)}function sF(s,e,t){return FO(s,e,t)}class o5 extends ZKe{constructor(e,t){super(e,t)}}let eY,Ml;function Bht(s,e,t,i){let n=0;const r=s.setInterval(()=>{n++,(n>=i||e()===!0)&&o.dispose()},t),o=Ee(()=>{s.clearInterval(r)});return o}class d6 extends l6{constructor(e){super(),this.defaultTarget=e&<(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class Gde{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 s=new Map,e=new Map,t=new Map,i=new Map,n=r=>{t.set(r,!1);const o=s.get(r)??[];for(e.set(r,o),s.set(r,[]),i.set(r,!0);o.length>0;)o.sort(Gde.sort),o.shift().execute();i.set(r,!1)};Ml=(r,o,a=0)=>{const c=z2(r),l=new Gde(o,a);let d=s.get(c);return d||(d=[],s.set(c,d)),d.push(l),t.get(c)||(t.set(c,!0),r.requestAnimationFrame(()=>n(c))),l},eY=(r,o,a)=>{const c=z2(r);if(i.get(c)){const l=new Gde(o,a);let d=e.get(c);return d||(d=[],e.set(c,d)),d.push(l),l}else return Ml(r,o,a)}})();const Wht=8,Hht=function(s,e){return e};class Uht extends V{constructor(e,t,i,n=Hht,r=Wht){super();let o=null,a=0;const c=this._register(new Em),l=()=>{a=new Date().getTime(),i(o),o=null};this._register(ue(e,t,d=>{o=n(o,d);const h=new Date().getTime()-a;h>=r?(c.cancel(),l()):c.setIfNotSet(l,r-h)}))}}function Vht(s,e,t,i,n){return new Uht(s,e,t,i,n)}function iae(s){return lt(s).getComputedStyle(s,null)}function K_(s,e){const t=lt(s),i=t.document;if(s!==i.body)return new wn(s.clientWidth,s.clientHeight);if(gm&&t?.visualViewport)return new wn(t.visualViewport.width,t.visualViewport.height);if(t?.innerWidth&&t.innerHeight)return new wn(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new wn(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new wn(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class Go{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=iae(e),r=n?n.getPropertyValue(t):"0";return Go.convertToPixels(e,r)}static getBorderLeftWidth(e){return Go.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Go.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Go.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Go.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Go.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Go.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Go.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Go.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Go.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Go.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Go.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Go.getDimension(e,"margin-bottom","marginBottom")}}const v1=class v1{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new v1(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof v1?e:new v1(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};v1.None=new v1(0,0);let wn=v1;function tY(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=uqe(s)?null:iae(s);n&&(i-=n.direction!=="rtl"?s.scrollLeft:-s.scrollLeft),s===e&&(i+=Go.getBorderLeftWidth(s),t+=Go.getBorderTopWidth(s),t+=s.offsetTop,i+=s.offsetLeft,e=s.offsetParent)}return{left:i,top:t}}function lqe(s,e,t){typeof e=="number"&&(s.style.width=`${e}px`),typeof t=="number"&&(s.style.height=`${t}px`)}function So(s){const e=s.getBoundingClientRect(),t=lt(s);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function dqe(s){let e=s,t=1;do{const i=iae(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Od(s){const e=Go.getMarginLeft(s)+Go.getMarginRight(s);return s.offsetWidth+e}function a5(s){const e=Go.getBorderLeftWidth(s)+Go.getBorderRightWidth(s),t=Go.getPaddingLeft(s)+Go.getPaddingRight(s);return s.offsetWidth-e-t}function zht(s){const e=Go.getMarginLeft(s)+Go.getMarginRight(s);return s.scrollWidth+e}function PTe(s){const e=Go.getBorderTopWidth(s)+Go.getBorderBottomWidth(s),t=Go.getPaddingTop(s)+Go.getPaddingBottom(s);return s.offsetHeight-e-t}function vb(s){const e=Go.getMarginTop(s)+Go.getMarginBottom(s);return s.offsetHeight+e}function $ht(s,e){if(s===null)return 0;const t=tY(s),i=tY(e);return t.left-i.left}function Ght(s,e){const t=e.map(n=>Math.max(zht(n),Od(n))+$ht(n,s)||0);return Math.max(...t)}function yc(s,e){return!!e?.contains(s)}const hqe="parentFlowToElementId";function Kht(s,e){s.dataset[hqe]=e.id}function qht(s){const e=s.dataset[hqe];return typeof e=="string"?s.ownerDocument.getElementById(e):null}function Qht(s,e){let t=s;for(;t;){if(t===e)return!0;if(Jo(t)){const i=qht(t);if(i){t=i;continue}}t=t.parentNode}return!1}function jht(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 kq(s,e,t){return!!jht(s,e,t)}function uqe(s){return s&&!!s.host&&!!s.mode}function F8(s){return!!AM(s)}function AM(s){for(;s.parentNode;){if(s===s.ownerDocument?.body)return null;s=s.parentNode}return uqe(s)?s:null}function Wc(){let s=Vu().activeElement;for(;s?.shadowRoot;)s=s.shadowRoot.activeElement;return s}function dv(s){return Wc()===s}function FTe(s){return yc(Wc(),s)}function Yht(s){return s.ownerDocument===Vu()}function Vu(){return Lht()<=1?ri.document:Array.from(P8()).map(({window:e})=>e.document).find(e=>e.hasFocus())??ri.document}function Ry(){return Vu().defaultView?.window??ri}const OTe=new Map;function gqe(){return new Jht}class Jht{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=fl(ri.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function fl(s=ri.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===ri.document.head){const n=new Set;OTe.set(i,n);for(const{window:r,disposables:o}of P8()){if(r===ri)continue;const a=o.add(Xht(i,n,r));t?.add(a)}}return i}function Xht(s,e,t){const i=new Z,n=s.cloneNode(!0);t.document.head.appendChild(n),i.add(Ee(()=>n.remove()));for(const r of pqe(s))n.sheet?.insertRule(r.cssText,n.sheet?.cssRules.length);return i.add(Zht.observe(s,i,{childList:!0})(()=>{n.textContent=s.textContent})),e.add(n),i.add(Ee(()=>e.delete(n))),i}const Zht=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=Hc(t);let r=i.get(n);if(r)r.users+=1;else{const o=new I,a=new MutationObserver(l=>o.fire(l));a.observe(s,t);const c=r={users:1,observer:a,onDidMutate:o.event};e.add(Ee(()=>{c.users-=1,c.users===0&&(o.dispose(),a.disconnect(),i?.delete(n),i?.size===0&&this.mutationObservers.delete(s))})),i.set(n,r)}return r.onDidMutate}};let Kde=null;function fqe(){return Kde||(Kde=fl()),Kde}function pqe(s){return s?.sheet?.rules?s.sheet.rules:s?.sheet?.cssRules?s.sheet.cssRules:[]}function $f(s,e,t=fqe()){if(!(!t||!e)){t.sheet?.insertRule(`${s} {${e}}`,0);for(const i of OTe.get(t)??[])$f(s,e,i)}}function xS(s,e=fqe()){if(!e)return;const t=pqe(e),i=[];for(let n=0;n=0;n--)e.sheet?.deleteRule(i[n]);for(const n of OTe.get(e)??[])xS(s,n)}function eut(s){return typeof s.selectorText=="string"}function Jo(s){return s instanceof HTMLElement||s instanceof lt(s).HTMLElement}function EOe(s){return s instanceof HTMLAnchorElement||s instanceof lt(s).HTMLAnchorElement}function tut(s){return s instanceof HTMLTextAreaElement||s instanceof lt(s).HTMLTextAreaElement}function iut(s){return s instanceof HTMLInputElement||s instanceof lt(s).HTMLInputElement}function nut(s){return s instanceof SVGElement||s instanceof lt(s).SVGElement}function BTe(s){return s instanceof MouseEvent||s instanceof lt(s).MouseEvent}function g_(s){return s instanceof KeyboardEvent||s instanceof lt(s).KeyboardEvent}function sut(s){return s instanceof DragEvent||s instanceof lt(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:AT?"webkitAnimationStart":"animationstart",ANIMATION_END:AT?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:AT?"webkitAnimationIteration":"animationiteration"};function rut(s){const e=s;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const tn={stop:(s,e)=>(s.preventDefault(),e&&s.stopPropagation(),s)};function out(s){const e=[];for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)e[t]=s.scrollTop,s=s.parentNode;return e}function aut(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 iY extends V{static hasFocusWithin(e){if(Jo(e)){const t=AM(e),i=t?t.activeElement:e.ownerDocument.activeElement;return yc(i,e)}else{const t=e;return yc(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=iY.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},r=()=>{t&&(i=!0,(Jo(e)?lt(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{iY.hasFocusWithin(e)!==t&&(t?r():n())},this._register(ue(e,ke.FOCUS,n,!0)),this._register(ue(e,ke.BLUR,r,!0)),Jo(e)&&(this._register(ue(e,ke.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ue(e,ke.FOCUS_OUT,()=>this._refreshStateHandler())))}refreshState(){this._refreshStateHandler()}}function Ec(s){return new iY(s)}function mqe(s,e){return s.after(e),e}function oe(s,...e){if(s.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function nae(s,e){return s.insertBefore(e,s.firstChild),e}function ca(s,...e){s.innerText="",oe(s,...e)}const cut=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var O8;(function(s){s.HTML="http://www.w3.org/1999/xhtml",s.SVG="http://www.w3.org/2000/svg"})(O8||(O8={}));function _qe(s,e,t,...i){const n=cut.exec(e);if(!n)throw new Error("Bad use of emmet");const r=n[1]||"div";let o;return s!==O8.HTML?o=document.createElementNS(s,r):o=document.createElement(r),n[3]&&(o.id=n[3]),n[4]&&(o.className=n[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,c])=>{typeof c>"u"||(/^on\w+$/.test(a)?o[a]=c:a==="selected"?c&&o.setAttribute(a,"true"):o.setAttribute(a,c))}),o.append(...i),o}function fe(s,e,...t){return _qe(O8.HTML,s,e,...t)}fe.SVG=function(s,e,...t){return _qe(O8.SVG,s,e,...t)};function WTe(s,...e){s?Xh(...e):Gd(...e)}function Xh(...s){for(const e of s)e.style.display="",e.removeAttribute("aria-hidden")}function Gd(...s){for(const e of s)e.style.display="none",e.setAttribute("aria-hidden","true")}function xOe(s,e){const t=s.devicePixelRatio*e;return Math.max(1,Math.floor(t))/s.devicePixelRatio}function vqe(s){ri.open(s,"_blank","noopener")}function lut(s,e){const t=()=>{e(),i=Ml(s,t)};let i=Ml(s,t);return Ee(()=>i.dispose())}M8.setPreferredWebSchema(/^https:/.test(ri.location.href)?"https":"http");function ig(s){return s?`url('${sf.uriToBrowserUri(s).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function Iq(s){return`'${s.replace(/'/g,"%27")}'`}function My(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=My(i[1].trim(),e)),`var(${i[0]}, ${e})`}return s}return e}function dut(s,e){let t;if(N.isUri(s))t=s.toString(!0);else{const r=new Blob([s]);t=URL.createObjectURL(r),setTimeout(()=>URL.revokeObjectURL(t))}const i=Ry(),n=document.createElement("a");i.document.body.appendChild(n),n.download=e,n.href=t,n.click(),setTimeout(()=>n.remove())}function hut(){return new Promise(s=>{const e=Ry(),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 c5;(function(s){s[s.DOCUMENT=1]="DOCUMENT",s[s.BROWSER=2]="BROWSER"})(c5||(c5={}));function uut(s){return s.document.fullscreenElement||s.document.webkitFullscreenElement||s.document.webkitIsFullScreen?{mode:c5.DOCUMENT,guess:!1}:s.innerHeight===s.screen.height?{mode:c5.BROWSER,guess:!1}:(jt||mo)&&s.outerHeight===s.screen.height&&s.outerWidth===s.screen.width?{mode:c5.BROWSER,guess:!0}:null}function gut(s,e=!1){const t=document.createElement("a");return oqe("afterSanitizeAttributes",i=>{for(const n of["href","src"])if(i.hasAttribute(n)){const r=i.getAttribute(n);if(n==="href"&&r.startsWith("#"))continue;if(t.href=r,!s.includes(t.protocol.replace(/:$/,""))){if(e&&n==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(n)}}}),Ee(()=>{aqe("afterSanitizeAttributes")})}pe.http,pe.https,pe.command;const fut=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 put(s){const e=new Uint16Array(s.length);for(let n=0;nthis.registerListeners(e,t),{window:ri,disposables:this._subscriptions}))}registerListeners(e,t){t.add(ue(e,"keydown",i=>{if(i.defaultPrevented)return;const n=new xn(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 bb.instance||(bb.instance=new bb),bb.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class nY 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 bqe=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Wt(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=bqe.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const r=n.groups.tag||"div",o=document.createElement(r);n.groups.id&&(o.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&&(o.className=a.join(" "));const c={};if(n.groups.name&&(c[n.groups.name]=o),i)for(const l of i)Jo(l)?o.appendChild(l):typeof l=="string"?o.append(l):"root"in l&&(Object.assign(c,l),o.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))o.style.setProperty(sY(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?o.tabIndex=d:o.setAttribute(sY(l),d.toString());return c.root=o,c}function aP(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=bqe.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const r=n.groups.tag||"div",o=document.createElementNS("http://www.w3.org/2000/svg",r);n.groups.id&&(o.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&&(o.className=a.join(" "));const c={};if(n.groups.name&&(c[n.groups.name]=o),i)for(const l of i)Jo(l)?o.appendChild(l):typeof l=="string"?o.append(l):"root"in l&&(Object.assign(c,l),o.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))o.style.setProperty(sY(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?o.tabIndex=d:o.setAttribute(sY(l),d.toString());return c.root=o,c}function sY(s){return s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class mut 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 _ut 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 mut(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 vut{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=z2(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=L2(new _ut(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),L2(M.once(Mht)(({vscodeWindowId:n})=>{n===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const W8=new vut;class wqe{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=Sf(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Sf(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Sf(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Sf(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Sf(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Sf(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Sf(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){const t=Sf(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){const t=Sf(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){const t=Sf(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){const t=Sf(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=Sf(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=Sf(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Sf(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 Sf(s){return typeof s=="number"?`${s}px`:s}function ds(s){return new wqe(s)}function kl(s,e){s instanceof wqe?(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 rc;(function(s){s[s.Regular=0]="Regular",s[s.Italic=1]="Italic",s[s.Bold=2]="Bold"})(rc||(rc={}));class but{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class HTe{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");kl(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");kl(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");kl(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const r=[];for(const o of this._requests){let a;o.type===rc.Regular&&(a=t),o.type===rc.Bold&&(a=i),o.type===rc.Italic&&(a=n),a.appendChild(document.createElement("br"));const c=document.createElement("span");HTe._render(c,o),a.appendChild(c),r.push(c)}this._container=e,this._testElements=r}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 r of i)r.isTrusted||(n=!0,t.remove(r));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!==yqe)continue;const n=new Tq(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 Tq({pixelRatio:W8.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 r=new but(e,t);return i.push(r),n?.push(r),r}_actualReadFontInfo(e,t){const i=[],n=[],r=this._createRequest("n",rc.Regular,i,n),o=this._createRequest("m",rc.Regular,i,null),a=this._createRequest(" ",rc.Regular,i,n),c=this._createRequest("0",rc.Regular,i,n),l=this._createRequest("1",rc.Regular,i,n),d=this._createRequest("2",rc.Regular,i,n),h=this._createRequest("3",rc.Regular,i,n),u=this._createRequest("4",rc.Regular,i,n),f=this._createRequest("5",rc.Regular,i,n),p=this._createRequest("6",rc.Regular,i,n),m=this._createRequest("7",rc.Regular,i,n),v=this._createRequest("8",rc.Regular,i,n),b=this._createRequest("9",rc.Regular,i,n),w=this._createRequest("→",rc.Regular,i,n),y=this._createRequest("→",rc.Regular,i,null),C=this._createRequest("·",rc.Regular,i,n),A=this._createRequest("⸱",rc.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 Tq({pixelRatio:W8.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:r.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:z,spaceWidth:a.width,middotWidth:C.width,wsmiddotWidth:A.width,maxDigitWidth:k},!0)}}class Sut{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 Cut;var C_;(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})(C_||(C_={}));const we=ae("instantiationService");function Aut(s,e,t){e[C_.DI_TARGET]===e?e[C_.DI_DEPENDENCIES].push({id:s,index:t}):(e[C_.DI_DEPENDENCIES]=[{id:s,index:t}],e[C_.DI_TARGET]=e)}function ae(s){if(C_.serviceIds.has(s))return C_.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");Aut(e,t,n)};return e.toString=()=>s,C_.serviceIds.set(s,e),e}const qt=ae("codeEditorService"),fi=ae("modelService"),pn=ae("textModelService");function Eut(s){return!!s.textEditorModel}function D(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r}function _(s,e){return function(t,i){e(t,i,s)}}class an extends V{constructor(e,t="",i="",n=!0,r){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=r}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 q_ 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 Uz=class Uz{constructor(){this.id=Uz.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 Uz,...i]:t=i);return t}async run(){}};Uz.ID="vs.actions.separator";let Eo=Uz;class Hk{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 ose=class ose extends an{constructor(){super(ose.ID,g(1610,"(empty)"),void 0,!1)}};ose.ID="vs.actions.empty";let Fpe=ose;function al(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 $2;(function(s){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}s.isThemeColor=e})($2||($2={}));function DOe(s){return{id:s}}var He;(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 r(u){return u&&typeof u=="object"&&typeof u.id=="string"&&(typeof u.color>"u"||$2.isThemeColor(u.color))}s.isThemeIcon=r;const o=new RegExp(`^\\$\\((${s.iconNameExpression}(?:${s.iconModifierExpression})?)\\)$`);function a(u){const f=o.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})(He||(He={}));const bi=ae("commandService"),vt=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 o=[];for(const c of s.metadata.args)o.push(c.constraint);const a=s.handler;s.handler=function(c,...l){return Bat(l,o),a(c,...l)}}const{id:t}=s;let i=this._commands.get(t);i||(i=new ul,this._commands.set(t,i));const n=i.unshift(s),r=Ee(()=>{n(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(s,e){return vt.registerCommand(s,(t,...i)=>t.get(bi).executeCommand(e,...i))}getCommand(s){const e=this._commands.get(s);if(!(!e||e.isEmpty()))return ui.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}};vt.registerCommand("noop",()=>{});const Le=ae("contextKeyService");function Zf(s,e){if(!s)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function h6(s,e="Unreachable"){throw new Error(e)}function kOe(s){s||bt(new Pi("Soft Assertion Failed"))}function Q_(s){if(!s()){debugger;s(),bt(new Pi("Assertion Failed"))}}function DU(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(kut)),this._cachedMergedKeybindings.slice(0)}}const Sr=new UTe,Dut={EditorModes:"platform.keybindingsRegistry"};je.add(Dut.EditorModes,Sr);function kut(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 Lq;function ET(s){return s.command!==void 0}function Iut(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 Vz=class Vz{static for(e){let t=this._all.get(e);return t||(t=new Vz(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof Vz&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};Vz._all=new Map;let V0=Vz;const Yn=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new _ct({merge:V0.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(s){return this._commands.set(s.id,s),this._onDidChangeMenu.fire(V0.for(_e.CommandPalette)),Ee(()=>{this._commands.delete(s.id)&&this._onDidChangeMenu.fire(V0.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 ul,this._menuItems.set(s,t));const i=t.push(e);return this._onDidChangeMenu.fire(V0.for(s)),Ee(()=>{i(),this._onDidChangeMenu.fire(V0.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)ET(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 Ny extends Hk{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 Ac=Lq=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,r,o,a){this.hideActions=n,this.menuKeybinding=r,this._commandService=a,this.id=e.id,this.label=Lq.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const l=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(l.condition),this.checked&&l.tooltip&&(this.tooltip=typeof l.tooltip=="string"?l.tooltip:l.tooltip.value),this.checked&&He.isThemeIcon(l.icon)&&(c=l.icon),this.checked&&l.title&&(this.label=typeof l.title=="string"?l.title:l.title.value)}c||(c=He.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new Lq(t,void 0,i,n,void 0,o,a):void 0,this._options=i,this.class=c&&He.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)}};Ac=Lq=D([_(5,Le),_(6,bi)],Ac);class di{constructor(e){this.desc=e}}function Et(s){const e=[],t=new s,{f1:i,menu:n,keybinding:r,...o}=t.desc;if(vt.getCommand(o.id))throw new Error(`Cannot register two commands with the same id: ${o.id}`);if(e.push(vt.registerCommand({id:o.id,handler:(a,...c)=>t.run(a,...c),metadata:o.metadata})),Array.isArray(n))for(const a of n)e.push(Yn.appendMenuItem(a.id,{command:{...o,precondition:a.precondition===null?void 0:o.precondition},...a}));else n&&e.push(Yn.appendMenuItem(n.id,{command:{...o,precondition:n.precondition===null?void 0:o.precondition},...n}));if(i&&(e.push(Yn.appendMenuItem(_e.CommandPalette,{command:o,when:o.precondition})),e.push(Yn.addCommand(o))),Array.isArray(r))for(const a of r)e.push(Sr.registerKeybindingRule({...a,id:o.id,when:o.precondition?he.and(o.precondition,a.when):a.when}));else r&&e.push(Sr.registerKeybindingRule({...r,id:o.id,when:o.precondition?he.and(o.precondition,r.when):r.when}));return{dispose(){wt(e)}}}const Ji=ae("telemetryService"),Tut=ae("customEndpointTelemetryService"),Ke=ae("logService"),pf=ae("loggerService");var ai;(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"})(ai||(ai={}));let sae=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};Sr.registerKeybindingRule(n)}}vt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){Yn.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 xI extends sae{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((r,o)=>o.priority-r.priority),{dispose:()=>{for(let r=0;r{if(a.get(Le).contextMatchesRules(i??void 0))return n(a,o,t)})}runCommand(e,t){return uc.runEditorCommand(e,t,this.precondition,(i,n,r)=>this.runEditorCommand(i,n,r))}}class it extends uc{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(it.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(Ji).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class Sqe extends it{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 o=r.get(Le),a=r.get(Ke);if(!o.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(r,n,...t)})}}function lg(s,e){vt.registerCommand(s,function(t,...i){const n=t.get(we),[r,o]=i;Lt(N.isUri(r)),Lt(re.isIPosition(o));const a=t.get(fi).getModel(r);if(a){const c=re.lift(o);return n.invokeFunction(e,a,c,...i.slice(2))}return t.get(pn).createModelReference(r).then(c=>new Promise((l,d)=>{try{const h=n.invokeFunction(e,c.object.textEditorModel,re.lift(o),i.slice(2));l(h)}catch(h){d(h)}}).finally(()=>{c.dispose()}))})}function Qe(s){return ep.INSTANCE.registerEditorCommand(s),s}function Re(s){const e=new s;return ep.INSTANCE.registerEditorAction(e),e}function Aqe(s){return ep.INSTANCE.registerEditorAction(s),s}function Lut(s){ep.INSTANCE.registerEditorAction(s)}function on(s,e,t){ep.INSTANCE.registerEditorContribution(s,e,t)}function Eqe(s,e){ep.INSTANCE.registerDiffEditorContribution(s,e)}var dp;(function(s){function e(o){return ep.INSTANCE.getEditorCommand(o)}s.getEditorCommand=e;function t(){return ep.INSTANCE.getEditorActions()}s.getEditorActions=t;function i(){return ep.INSTANCE.getEditorContributions()}s.getEditorContributions=i;function n(o){return ep.INSTANCE.getEditorContributions().filter(a=>o.indexOf(a.id)>=0)}s.getSomeEditorContributions=n;function r(){return ep.INSTANCE.getDiffEditorContributions()}s.getDiffEditorContributions=r})(dp||(dp={}));const Rut={EditorCommonContributions:"editor.contributions"},ase=class ase{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}};ase.INSTANCE=new ase;let ep=ase;je.add(Rut.EditorCommonContributions,ep.INSTANCE);function u6(s){return s.register(),s}const xqe=u6(new xI({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}]}));u6(new Cqe(xqe,{id:"default:undo",precondition:void 0}));const Dqe=u6(new xI({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}]}));u6(new Cqe(Dqe,{id:"default:redo",precondition:void 0}));const Mut=u6(new xI({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}]})),Nut="$initialize";let IOe=!1;function Ope(s){Hn&&(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 Vf;(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"})(Vf||(Vf={}));class Put{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=Vf.Request}}class TOe{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=Vf.Reply}}class Fut{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=Vf.SubscribeEvent}}class Out{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=Vf.Event}}class But{constructor(e,t){this.vsWorker=e,this.req=t,this.type=Vf.UnsubscribeEvent}}class Wut{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,r)=>{this._pendingReplies[i]={resolve:n,reject:r},this._send(new Put(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 Fut(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new But(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 Vf.Reply:return this._handleReplyMessage(e);case Vf.Request:return this._handleRequestMessage(e);case Vf.SubscribeEvent:return this._handleSubscribeEventMessage(e);case Vf.Event:return this._handleEventMessage(e);case Vf.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 TOe(this._workerId,t,n,void 0))},n=>{n.detail instanceof Error&&(n.detail=kA(n.detail)),this._send(new TOe(this._workerId,t,void 0,kA(n)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(n=>{this._send(new Out(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===Vf.Request)for(let i=0;i{this._protocol.handleMessage(l)},l=>{n?.(l)})),this._protocol=new Wut({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(Iqe(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(kqe(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 r=null;typeof globalThis.requirejs<"u"&&(r=globalThis.requirejs.s.contexts._.config);const o=uTe(i);this._onModuleLoaded=this._protocol.sendMessage(Nut,[this._worker.getId(),JSON.parse(JSON.stringify(r)),t,o]);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(Uut(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 kqe(s){return s[0]==="o"&&s[1]==="n"&&Uw(s.charCodeAt(2))}function Iqe(s){return/^onDynamic/.test(s)&&Uw(s.charCodeAt(9))}function Uut(s,e,t){const i=o=>function(){const a=Array.prototype.slice.call(arguments,0);return e(o,a)},n=o=>function(a){return t(o,a)},r={};for(const o of s){if(Iqe(o)){r[o]=n(o);continue}if(kqe(o)){r[o]=t(o,void 0);continue}r[o]=i(o)}return r}function ZA(s,e){const t=globalThis.MonacoEnvironment;if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(s,e)}catch(i){bt(i);return}try{return globalThis.trustedTypes?.createPolicy(s,e)}catch(i){bt(i);return}}let rY;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?rY=globalThis.workerttPolicy:rY=ZA("defaultWorkerFactory",{createScriptURL:s=>s});function Vut(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(rY?rY.createScriptURL(t):t,{name:s})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function zut(s){return typeof s.then=="function"}class $ut extends V{constructor(e,t,i,n,r){super(),this.id=t,this.label=i;const o=Vut(i);zut(o)?this.worker=o:this.worker=Promise.resolve(o),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(c){n(c.data)},a.onmessageerror=r,typeof a.addEventListener=="function"&&a.addEventListener("error",r)}),this._register(Ee(()=>{this.worker?.then(a=>{a.onmessage=null,a.onmessageerror=null,a.removeEventListener("error",r),a.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){this.worker?.then(i=>{try{i.postMessage(e,t)}catch(n){bt(n),bt(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:n}))}})}}const cse=class cse{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++cse.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new $ut(e,n,this._label||"anonymous"+n,t,r=>{Ope(r),this._webWorkerFailedBeforeError=r,i(r)})}};cse.LAST_WORKER_ID=0;let Bpe=cse;var Co;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(Co||(Co={}));class Qde{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 Qde(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Qde({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Qde({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:b1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:b1.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}};b1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class Elt extends co{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:xt(t.enabled,this.defaultValue.enabled),autohide:xt(t.autohide,this.defaultValue.autohide),size:qo(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:qo(t.side,this.defaultValue.side,["right","left"]),showSlider:qo(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:xt(t.renderCharacters,this.defaultValue.renderCharacters),scale:br.clampedInt(t.scale,1,1,3),maxColumn:br.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:xt(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:xt(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:rp.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:rp.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function xlt(s){return s==="ctrlCmd"?jt?"metaKey":"ctrlKey":"altKey"}class Dlt extends co{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:br.clampedInt(t.top,0,0,1e3),bottom:br.clampedInt(t.bottom,0,0,1e3)}}}class klt extends co{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:xt(t.enabled,this.defaultValue.enabled),cycle:xt(t.cycle,this.defaultValue.cycle)}}}class Ilt extends r6{constructor(){super(x.pixelRatio)}compute(e,t,i){return e.pixelRatio}}class Tlt extends co{constructor(){super(x.placeholder,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}}class Llt extends co{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,r=["on","inline","off"];let o,a,c;return typeof t=="boolean"?o=t?"on":"off":o=qo(t,this.defaultValue.other,r),typeof i=="boolean"?a=i?"on":"off":a=qo(i,this.defaultValue.comments,r),typeof n=="boolean"?c=n?"on":"off":c=qo(n,this.defaultValue.strings,r),{other:o,comments:a,strings:c}}}var yo;(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"})(yo||(yo={}));class Rlt extends co{constructor(){super(x.lineNumbers,"lineNumbers",{renderType:yo.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=yo.Custom,i=e):e==="interval"?t=yo.Interval:e==="relative"?t=yo.Relative:e==="on"?t=yo.On:t=yo.Off),{renderType:t,renderFn:i}}}function Gj(s){const e=s.get(x.renderValidationDecorations);return e==="editable"?s.get(x.readOnly):e!=="on"}class Mlt extends co{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:br.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const n=i;t.push({column:br.clampedInt(n.column,0,0,1e4),color:n.color})}return t.sort((i,n)=>i.column-n.column),t}return this.defaultValue}}class Nlt extends co{constructor(){super(x.readOnlyMessage,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function sOe(s,e){if(typeof s!="string")return e;switch(s){case"hidden":return Cr.Hidden;case"visible":return Cr.Visible;default:return Cr.Auto}}let Plt=class extends co{constructor(){const e={vertical:Cr.Auto,horizontal:Cr.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=br.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=br.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:br.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:sOe(t.vertical,this.defaultValue.vertical),horizontal:sOe(t.horizontal,this.defaultValue.horizontal),useShadows:xt(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:xt(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:xt(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:xt(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:xt(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:br.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:br.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:xt(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:xt(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const Lf="inUntrustedWorkspace",Pu={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 Flt extends co{constructor(){const e={nonBasicASCII:Lf,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Lf,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(x.unicodeHighlighting,"unicodeHighlight",e,{[Pu.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Lf],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.")},[Pu.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.")},[Pu.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.")},[Pu.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Lf],default:e.includeComments,description:g(191,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[Pu.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Lf],default:e.includeStrings,description:g(192,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[Pu.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:g(193,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Pu.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&&(Js(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(Js(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const n=super.applyUpdate(e,t);return i?new r5(n.newValue,!0):n}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:MO(t.nonBasicASCII,Lf,[!0,!1,Lf]),invisibleCharacters:xt(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:xt(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:MO(t.includeComments,Lf,[!0,!1,Lf]),includeStrings:MO(t.includeStrings,Lf,[!0,!1,Lf]),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,r]of Object.entries(e))r===!0&&(i[n]=!0);return i}}class Olt extends co{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:xt(t.enabled,this.defaultValue.enabled),mode:qo(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:qo(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:xt(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:xt(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:yh.string(t.fontFamily,this.defaultValue.fontFamily)}}}class Blt extends co{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:xt(t.enabled,this.defaultValue.enabled),showToolbar:qo(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:yh.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:xt(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class Wlt extends co{constructor(){const e={enabled:$d.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:$d.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:xt(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:xt(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class Hlt extends co{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:MO(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:MO(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:xt(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:xt(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:MO(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function MO(s,e,t){const i=t.indexOf(s);return i===-1?e:t[i]}class Ult extends co{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:qo(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:xt(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:xt(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:xt(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:xt(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:qo(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:xt(t.showIcons,this.defaultValue.showIcons),showStatusBar:xt(t.showStatusBar,this.defaultValue.showStatusBar),preview:xt(t.preview,this.defaultValue.preview),previewMode:qo(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:xt(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:xt(t.showMethods,this.defaultValue.showMethods),showFunctions:xt(t.showFunctions,this.defaultValue.showFunctions),showConstructors:xt(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:xt(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:xt(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:xt(t.showFields,this.defaultValue.showFields),showVariables:xt(t.showVariables,this.defaultValue.showVariables),showClasses:xt(t.showClasses,this.defaultValue.showClasses),showStructs:xt(t.showStructs,this.defaultValue.showStructs),showInterfaces:xt(t.showInterfaces,this.defaultValue.showInterfaces),showModules:xt(t.showModules,this.defaultValue.showModules),showProperties:xt(t.showProperties,this.defaultValue.showProperties),showEvents:xt(t.showEvents,this.defaultValue.showEvents),showOperators:xt(t.showOperators,this.defaultValue.showOperators),showUnits:xt(t.showUnits,this.defaultValue.showUnits),showValues:xt(t.showValues,this.defaultValue.showValues),showConstants:xt(t.showConstants,this.defaultValue.showConstants),showEnums:xt(t.showEnums,this.defaultValue.showEnums),showEnumMembers:xt(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:xt(t.showKeywords,this.defaultValue.showKeywords),showWords:xt(t.showWords,this.defaultValue.showWords),showColors:xt(t.showColors,this.defaultValue.showColors),showFiles:xt(t.showFiles,this.defaultValue.showFiles),showReferences:xt(t.showReferences,this.defaultValue.showReferences),showFolders:xt(t.showFolders,this.defaultValue.showFolders),showTypeParameters:xt(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:xt(t.showSnippets,this.defaultValue.showSnippets),showUsers:xt(t.showUsers,this.defaultValue.showUsers),showIssues:xt(t.showIssues,this.defaultValue.showIssues)}}}class Vlt extends co{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:xt(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:xt(e.selectSubwords,this.defaultValue.selectSubwords)}}}class zlt extends co{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 Fu;(function(s){s[s.None=0]="None",s[s.Same=1]="Same",s[s.Indent=2]="Indent",s[s.DeepIndent=3]="DeepIndent"})(Fu||(Fu={}));class $lt extends co{constructor(){super(x.wrappingIndent,"wrappingIndent",Fu.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 Fu.None;case"same":return Fu.Same;case"indent":return Fu.Indent;case"deepIndent":return Fu.DeepIndent}return Fu.Same}compute(e,t,i){return t.get(x.accessibilitySupport)===Zl.Enabled?Fu.None:i}}class Glt extends r6{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 Klt extends co{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:xt(t.enabled,this.defaultValue.enabled),showDropSelector:qo(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class qlt extends co{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:xt(t.enabled,this.defaultValue.enabled),showPasteSelector:qo(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const Qlt="Consolas, 'Courier New', monospace",jlt="Menlo, Monaco, 'Courier New', monospace",Ylt="'Droid Sans Mono', 'monospace', monospace",dd={fontFamily:jt?jlt:mo?Ylt:Qlt,fontWeight:"normal",fontSize:jt?12:14,lineHeight:0,letterSpacing:0},nF=[];function Ve(s){return nF[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 Ch={acceptSuggestionOnCommitCharacter:Ve(new Rn(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:Ve(new Wo(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:Ve(new alt),accessibilityPageSize:Ve(new br(x.accessibilityPageSize,"accessibilityPageSize",10,1,Vn.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:Ve(new yh(x.ariaLabel,"ariaLabel",g(292,"Editor content"))),ariaRequired:Ve(new Rn(x.ariaRequired,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Ve(new Rn(x.screenReaderAnnounceInlineSuggestion,"screenReaderAnnounceInlineSuggestion",!0,{description:g(293,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Ve(new Wo(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:Ve(new Wo(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:Ve(new Wo(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:Ve(new Wo(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:Ve(new Wo(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:Ve(new MG(x.autoIndent,"autoIndent",dl.Full,"full",["none","keep","brackets","advanced","full"],olt,{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:Ve(new Rn(x.automaticLayout,"automaticLayout",!1)),autoSurround:Ve(new Wo(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:Ve(new Wlt),bracketPairGuides:Ve(new Hlt),stickyTabStops:Ve(new Rn(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:Ve(new Rn(x.codeLens,"codeLens",!0,{description:g(318,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Ve(new yh(x.codeLensFontFamily,"codeLensFontFamily","",{description:g(319,"Controls the font family for CodeLens.")})),codeLensFontSize:Ve(new br(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:Ve(new Rn(x.colorDecorators,"colorDecorators",!0,{description:g(321,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Ve(new Wo(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:Ve(new br(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:Ve(new Rn(x.columnSelection,"columnSelection",!1,{description:g(327,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:Ve(new clt),contextmenu:Ve(new Rn(x.contextmenu,"contextmenu",!0)),copyWithSyntaxHighlighting:Ve(new Rn(x.copyWithSyntaxHighlighting,"copyWithSyntaxHighlighting",!0,{description:g(328,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Ve(new MG(x.cursorBlinking,"cursorBlinking",Nd.Blink,"blink",["blink","smooth","phase","expand","solid"],llt,{description:g(329,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:Ve(new Wo(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:Ve(new MG(x.cursorStyle,"cursorStyle",Qo.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],hlt,{description:g(334,"Controls the cursor style.")})),cursorSurroundingLines:Ve(new br(x.cursorSurroundingLines,"cursorSurroundingLines",0,0,Vn.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:Ve(new Wo(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:Ve(new br(x.cursorWidth,"cursorWidth",0,0,Vn.MAX_SAFE_SMALL_INTEGER,{markdownDescription:g(339,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Ve(new Rn(x.disableLayerHinting,"disableLayerHinting",!1)),disableMonospaceOptimizations:Ve(new Rn(x.disableMonospaceOptimizations,"disableMonospaceOptimizations",!1)),domReadOnly:Ve(new Rn(x.domReadOnly,"domReadOnly",!1)),dragAndDrop:Ve(new Rn(x.dragAndDrop,"dragAndDrop",!0,{description:g(340,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Ve(new glt),dropIntoEditor:Ve(new Klt),stickyScroll:Ve(new ylt),experimentalWhitespaceRendering:Ve(new Wo(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:Ve(new yh(x.extraEditorClassName,"extraEditorClassName","")),fastScrollSensitivity:Ve(new rp(x.fastScrollSensitivity,"fastScrollSensitivity",5,s=>s<=0?5:s,{markdownDescription:g(345,"Scrolling speed multiplier when pressing `Alt`.")})),find:Ve(new flt),fixedOverflowWidgets:Ve(new Rn(x.fixedOverflowWidgets,"fixedOverflowWidgets",!1)),folding:Ve(new Rn(x.folding,"folding",!0,{description:g(346,"Controls whether the editor has code folding enabled.")})),foldingStrategy:Ve(new Wo(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:Ve(new Rn(x.foldingHighlight,"foldingHighlight",!0,{description:g(350,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Ve(new Rn(x.foldingImportsByDefault,"foldingImportsByDefault",!1,{description:g(351,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Ve(new br(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:Ve(new Rn(x.unfoldOnClickAfterEndOfLine,"unfoldOnClickAfterEndOfLine",!1,{description:g(353,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Ve(new yh(x.fontFamily,"fontFamily",dd.fontFamily,{description:g(354,"Controls the font family.")})),fontInfo:Ve(new plt),fontLigatures2:Ve(new Ok),fontSize:Ve(new mlt),fontWeight:Ve(new Sfe),fontVariations:Ve(new S8),formatOnPaste:Ve(new Rn(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:Ve(new Rn(x.formatOnType,"formatOnType",!1,{description:g(356,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Ve(new Rn(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:Ve(new _lt),hideCursorInOverviewRuler:Ve(new Rn(x.hideCursorInOverviewRuler,"hideCursorInOverviewRuler",!1,{description:g(358,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:Ve(new vlt),inDiffEditor:Ve(new Rn(x.inDiffEditor,"inDiffEditor",!1)),letterSpacing:Ve(new rp(x.letterSpacing,"letterSpacing",dd.letterSpacing,s=>rp.clamp(s,-5,20),{description:g(359,"Controls the letter spacing in pixels.")})),lightbulb:Ve(new wlt),lineDecorationsWidth:Ve(new Slt),lineHeight:Ve(new Alt),lineNumbers:Ve(new Rlt),lineNumbersMinChars:Ve(new br(x.lineNumbersMinChars,"lineNumbersMinChars",5,1,300)),linkedEditing:Ve(new Rn(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:Ve(new Rn(x.links,"links",!0,{description:g(361,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Ve(new Wo(x.matchBrackets,"matchBrackets","always",["always","near","never"],{description:g(362,"Highlight matching brackets.")})),minimap:Ve(new Elt),mouseStyle:Ve(new Wo(x.mouseStyle,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Ve(new rp(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:Ve(new Rn(x.mouseWheelZoom,"mouseWheelZoom",!1,{markdownDescription:jt?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:Ve(new Rn(x.multiCursorMergeOverlapping,"multiCursorMergeOverlapping",!0,{description:g(366,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Ve(new MG(x.multiCursorModifier,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],xlt,{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:Ve(new Wo(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:Ve(new br(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:Ve(new Wo(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:Ve(new Rn(x.overviewRulerBorder,"overviewRulerBorder",!0,{description:g(378,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Ve(new br(x.overviewRulerLanes,"overviewRulerLanes",3,0,3)),padding:Ve(new Dlt),pasteAs:Ve(new qlt),parameterHints:Ve(new klt),peekWidgetDefaultFocus:Ve(new Wo(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:Ve(new Tlt),definitionLinkOpensInPeek:Ve(new Rn(x.definitionLinkOpensInPeek,"definitionLinkOpensInPeek",!1,{description:g(382,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Ve(new Llt),quickSuggestionsDelay:Ve(new br(x.quickSuggestionsDelay,"quickSuggestionsDelay",10,0,Vn.MAX_SAFE_SMALL_INTEGER,{description:g(383,"Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Ve(new Rn(x.readOnly,"readOnly",!1)),readOnlyMessage:Ve(new Nlt),renameOnType:Ve(new Rn(x.renameOnType,"renameOnType",!1,{description:g(384,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:g(385,"Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Ve(new Rn(x.renderControlCharacters,"renderControlCharacters",!0,{description:g(386,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Ve(new Wo(x.renderFinalNewline,"renderFinalNewline",mo?"dimmed":"on",["off","on","dimmed"],{description:g(387,"Render last line number when the file ends with a newline.")})),renderLineHighlight:Ve(new Wo(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:Ve(new Rn(x.renderLineHighlightOnlyWhenFocus,"renderLineHighlightOnlyWhenFocus",!1,{description:g(390,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Ve(new Wo(x.renderValidationDecorations,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Ve(new Wo(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:Ve(new br(x.revealHorizontalRightPadding,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Ve(new Rn(x.roundedSelection,"roundedSelection",!0,{description:g(395,"Controls whether selections should have rounded corners.")})),rulers:Ve(new Mlt),scrollbar:Ve(new Plt),scrollBeyondLastColumn:Ve(new br(x.scrollBeyondLastColumn,"scrollBeyondLastColumn",4,0,Vn.MAX_SAFE_SMALL_INTEGER,{description:g(396,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Ve(new Rn(x.scrollBeyondLastLine,"scrollBeyondLastLine",!0,{description:g(397,"Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Ve(new Rn(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:Ve(new Rn(x.selectionClipboard,"selectionClipboard",!0,{description:g(399,"Controls whether the Linux primary clipboard should be supported."),included:mo})),selectionHighlight:Ve(new Rn(x.selectionHighlight,"selectionHighlight",!0,{description:g(400,"Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Ve(new Rn(x.selectOnLineNumbers,"selectOnLineNumbers",!0)),showFoldingControls:Ve(new Wo(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:Ve(new Rn(x.showUnused,"showUnused",!0,{description:g(405,"Controls fading out of unused code.")})),showDeprecated:Ve(new Rn(x.showDeprecated,"showDeprecated",!0,{description:g(406,"Controls strikethrough deprecated variables.")})),inlayHints:Ve(new Clt),snippetSuggestions:Ve(new Wo(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:Ve(new Vlt),smoothScrolling:Ve(new Rn(x.smoothScrolling,"smoothScrolling",!1,{description:g(412,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Ve(new br(x.stopRenderingLineAfter,"stopRenderingLineAfter",1e4,-1,Vn.MAX_SAFE_SMALL_INTEGER)),suggest:Ve(new Ult),inlineSuggest:Ve(new Olt),inlineEdit:Ve(new Blt),inlineCompletionsAccessibilityVerbose:Ve(new Rn(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:Ve(new br(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:Ve(new br(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:Ve(new Rn(x.suggestOnTriggerCharacters,"suggestOnTriggerCharacters",!0,{description:g(416,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Ve(new Wo(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:Ve(new Wo(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:Ve(new br(x.tabIndex,"tabIndex",0,-1,Vn.MAX_SAFE_SMALL_INTEGER)),unicodeHighlight:Ve(new Flt),unusualLineTerminators:Ve(new Wo(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:Ve(new Rn(x.useShadowDOM,"useShadowDOM",!0)),useTabStops:Ve(new Rn(x.useTabStops,"useTabStops",!0,{description:g(429,"Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:Ve(new Wo(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:Ve(new zlt),wordSeparators:Ve(new yh(x.wordSeparators,"wordSeparators",lKe,{description:g(433,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Ve(new Wo(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:Ve(new yh(x.wordWrapBreakAfterCharacters,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Ve(new yh(x.wordWrapBreakBeforeCharacters,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Ve(new br(x.wordWrapColumn,"wordWrapColumn",80,1,Vn.MAX_SAFE_SMALL_INTEGER,{markdownDescription:g(439,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Ve(new Wo(x.wordWrapOverride1,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Ve(new Wo(x.wordWrapOverride2,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Ve(new ult),defaultColorDecorators:Ve(new Rn(x.defaultColorDecorators,"defaultColorDecorators",!1,{markdownDescription:g(440,"Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Ve(new Ilt),tabFocusMode:Ve(new Rn(x.tabFocusMode,"tabFocusMode",!1,{markdownDescription:g(441,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Ve(new RO),wrappingInfo:Ve(new Glt),wrappingIndent:Ve(new $lt),wrappingStrategy:Ve(new blt)};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 kTe{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 Aq=new kTe,Afe=new kTe,Efe=new kTe,xKe=new Array(230),xfe={},DKe=[],kKe=Object.create(null),IKe=Object.create(null),Gp={lowerCaseToEnum:s=>IKe[s]||X.None,toEnum:s=>kKe[s]||X.None,toString:s=>DKe[s]||"None"},Gg=[],A8=[];for(let s=0;s<=X.MAX_VALUE;s++)Gg[s]=S.DependsOnKbLayout;for(let s=0;s<=S.MAX_VALUE;s++)A8[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[r,o,a,c,l,d,h,u,f]=n;if(i[o]||(i[o]=!0,DKe[o]=a,kKe[a]=o,IKe[a.toLowerCase()]=o,r&&(Gg[o]=c,c!==S.Unknown&&c!==S.Enter&&c!==S.Ctrl&&c!==S.Shift&&c!==S.Alt&&c!==S.Meta&&(A8[c]=o))),!t[c]){if(t[c]=!0,!l)throw new Error(`String representation missing for key code ${c} around scan code ${a}`);Aq.define(c,l),Afe.define(c,u||l),Efe.define(c,f||u||l)}d&&(xKe[d]=c),h&&(xfe[h]=c)}A8[S.Enter]=X.Enter})();var Ta;(function(s){function e(a){return Aq.keyCodeToStr(a)}s.toString=e;function t(a){return Aq.strToKeyCode(a)}s.fromString=t;function i(a){return Afe.keyCodeToStr(a)}s.toUserSettingsUS=i;function n(a){return Efe.keyCodeToStr(a)}s.toUserSettingsGeneral=n;function r(a){return Afe.strToKeyCode(a)||Efe.strToKeyCode(a)}s.fromUserSettings=r;function o(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 Aq.keyCodeToStr(a)}s.toElectronAccelerator=o})(Ta||(Ta={}));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 oo(s,e){const t=(e&65535)<<16>>>0;return(s|t)>>>0}var ys;(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"})(ys||(ys={}));var rOe={};let CT;const Bde=globalThis.vscode;if(typeof Bde<"u"&&typeof Bde.process<"u"){const s=Bde.process;CT={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"?CT={get platform(){return process.platform},get arch(){return process.arch},get env(){return rOe},cwd(){return rOe.VSCODE_CWD||process.cwd()}}:CT={get platform(){return jn?"win32":jt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const M2=CT.cwd,N2=CT.env,TKe=CT.platform,Jlt=CT.arch,Xlt=65,Zlt=97,edt=90,tdt=122,iD=46,hh=47,xf=92,gE=58,idt=63;class LKe 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 r=e.indexOf(".")!==-1?"property":"argument";let o=`The "${e}" ${r} ${n} of type ${t}`;o+=`. Received type ${typeof i}`,super(o),this.code="ERR_INVALID_ARG_TYPE"}}function ndt(s,e){if(s===null||typeof s!="object")throw new LKe(e,"Object",s)}function nl(s,e){if(typeof s!="string")throw new LKe(e,"string",s)}const lv=TKe==="win32";function Bs(s){return s===hh||s===xf}function Dfe(s){return s===hh}function fE(s){return s>=Xlt&&s<=edt||s>=Zlt&&s<=tdt}function Kj(s,e,t,i){let n="",r=0,o=-1,a=0,c=0;for(let l=0;l<=s.length;++l){if(l2){const d=n.lastIndexOf(t);d===-1?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf(t)),o=l,a=0;continue}else if(n.length!==0){n="",r=0,o=l,a=0;continue}}e&&(n+=n.length>0?`${t}..`:"..",r=2)}else n.length>0?n+=`${t}${s.slice(o+1,l)}`:n=s.slice(o+1,l),r=l-o-1;o=l,a=0}else c===iD&&a!==-1?++a:a=-1}return n}function sdt(s){return s?`${s[0]==="."?"":"."}${s}`:""}function RKe(s,e){ndt(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${sdt(e.ext)}`;return t?t===e.root?`${t}${i}`:`${t}${s}${i}`:i}const lc={resolve(...s){let e="",t="",i=!1;for(let n=s.length-1;n>=-1;n--){let r;if(n>=0){if(r=s[n],nl(r,`paths[${n}]`),r.length===0)continue}else e.length===0?r=M2():(r=N2[`=${e}`]||M2(),(r===void 0||r.slice(0,2).toLowerCase()!==e.toLowerCase()&&r.charCodeAt(2)===xf)&&(r=`${e}\\`));const o=r.length;let a=0,c="",l=!1;const d=r.charCodeAt(0);if(o===1)Bs(d)&&(a=1,l=!0);else if(Bs(d))if(l=!0,Bs(r.charCodeAt(1))){let h=2,u=h;for(;h2&&Bs(r.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=`${r.slice(a)}\\${t}`,i=l,l&&e.length>0)break}return t=Kj(t,!i,"\\",Bs),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(s){nl(s,"path");const e=s.length;if(e===0)return".";let t=0,i,n=!1;const r=s.charCodeAt(0);if(e===1)return Dfe(r)?"\\":s;if(Bs(r))if(n=!0,Bs(s.charCodeAt(1))){let a=2,c=a;for(;a2&&Bs(s.charCodeAt(2))&&(n=!0,t=3));let o=t0&&Bs(s.charCodeAt(e-1))&&(o+="\\"),i===void 0?n?`\\${o}`:o:n?`${i}\\${o}`:`${i}${o}`},isAbsolute(s){nl(s,"path");const e=s.length;if(e===0)return!1;const t=s.charCodeAt(0);return Bs(t)||e>2&&fE(t)&&s.charCodeAt(1)===gE&&Bs(s.charCodeAt(2))},join(...s){if(s.length===0)return".";let e,t;for(let r=0;r0&&(e===void 0?e=t=o:e+=`\\${o}`)}if(e===void 0)return".";let i=!0,n=0;if(typeof t=="string"&&Bs(t.charCodeAt(0))){++n;const r=t.length;r>1&&Bs(t.charCodeAt(1))&&(++n,r>2&&(Bs(t.charCodeAt(2))?++n:i=!1))}if(i){for(;n=2&&(e=`\\${e.slice(n)}`)}return lc.normalize(e)},relative(s,e){if(nl(s,"from"),nl(e,"to"),s===e)return"";const t=lc.resolve(s),i=lc.resolve(e);if(t===i||(s=t.toLowerCase(),e=i.toLowerCase(),s===e))return"";let n=0;for(;nn&&s.charCodeAt(r-1)===xf;)r--;const o=r-n;let a=0;for(;aa&&e.charCodeAt(c-1)===xf;)c--;const l=c-a,d=od){if(e.charCodeAt(a+u)===xf)return i.slice(a+u+1);if(u===2)return i.slice(a+u)}o>d&&(s.charCodeAt(n+u)===xf?h=u:u===2&&(h=3)),h===-1&&(h=0)}let f="";for(u=n+h+1;u<=r;++u)(u===r||s.charCodeAt(u)===xf)&&(f+=f.length===0?"..":"\\..");return a+=h,f.length>0?`${f}${i.slice(a,c)}`:(i.charCodeAt(a)===xf&&++a,i.slice(a,c))},toNamespacedPath(s){if(typeof s!="string"||s.length===0)return s;const e=lc.resolve(s);if(e.length<=2)return s;if(e.charCodeAt(0)===xf){if(e.charCodeAt(1)===xf){const t=e.charCodeAt(2);if(t!==idt&&t!==iD)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(fE(e.charCodeAt(0))&&e.charCodeAt(1)===gE&&e.charCodeAt(2)===xf)return`\\\\?\\${e}`;return s},dirname(s){nl(s,"path");const e=s.length;if(e===0)return".";let t=-1,i=0;const n=s.charCodeAt(0);if(e===1)return Bs(n)?s:".";if(Bs(n)){if(t=i=1,Bs(s.charCodeAt(1))){let a=2,c=a;for(;a2&&Bs(s.charCodeAt(2))?3:2,i=t);let r=-1,o=!0;for(let a=e-1;a>=i;--a)if(Bs(s.charCodeAt(a))){if(!o){r=a;break}}else o=!1;if(r===-1){if(t===-1)return".";r=t}return s.slice(0,r)},basename(s,e){e!==void 0&&nl(e,"suffix"),nl(s,"path");let t=0,i=-1,n=!0,r;if(s.length>=2&&fE(s.charCodeAt(0))&&s.charCodeAt(1)===gE&&(t=2),e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let o=e.length-1,a=-1;for(r=s.length-1;r>=t;--r){const c=s.charCodeAt(r);if(Bs(c)){if(!n){t=r+1;break}}else a===-1&&(n=!1,a=r+1),o>=0&&(c===e.charCodeAt(o)?--o===-1&&(i=r):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(r=s.length-1;r>=t;--r)if(Bs(s.charCodeAt(r))){if(!n){t=r+1;break}}else i===-1&&(n=!1,i=r+1);return i===-1?"":s.slice(t,i)},extname(s){nl(s,"path");let e=0,t=-1,i=0,n=-1,r=!0,o=0;s.length>=2&&s.charCodeAt(1)===gE&&fE(s.charCodeAt(0))&&(e=i=2);for(let a=s.length-1;a>=e;--a){const c=s.charCodeAt(a);if(Bs(c)){if(!r){i=a+1;break}continue}n===-1&&(r=!1,n=a+1),c===iD?t===-1?t=a:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||n===-1||o===0||o===1&&t===n-1&&t===i+1?"":s.slice(t,n)},format:RKe.bind(null,"\\"),parse(s){nl(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 Bs(n)?(e.root=e.dir=s,e):(e.base=e.name=s,e);if(Bs(n)){if(i=1,Bs(s.charCodeAt(1))){let h=2,u=h;for(;h0&&(e.root=s.slice(0,i));let r=-1,o=i,a=-1,c=!0,l=s.length-1,d=0;for(;l>=i;--l){if(n=s.charCodeAt(l),Bs(n)){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),n===iD?r===-1?r=l:d!==1&&(d=1):r!==-1&&(d=-1)}return a!==-1&&(r===-1||d===0||d===1&&r===a-1&&r===o+1?e.base=e.name=s.slice(o,a):(e.name=s.slice(o,r),e.base=s.slice(o,a),e.ext=s.slice(r,a))),o>0&&o!==i?e.dir=s.slice(0,o-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},rdt=(()=>{if(lv){const s=/\\/g;return()=>{const e=M2().replace(s,"/");return e.slice(e.indexOf("/"))}}return()=>M2()})(),zi={resolve(...s){let e="",t=!1;for(let i=s.length-1;i>=-1&&!t;i--){const n=i>=0?s[i]:rdt();nl(n,`paths[${i}]`),n.length!==0&&(e=`${n}/${e}`,t=n.charCodeAt(0)===hh)}return e=Kj(e,!t,"/",Dfe),t?`/${e}`:e.length>0?e:"."},normalize(s){if(nl(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===hh,t=s.charCodeAt(s.length-1)===hh;return s=Kj(s,!e,"/",Dfe),s.length===0?e?"/":t?"./":".":(t&&(s+="/"),e?`/${s}`:s)},isAbsolute(s){return nl(s,"path"),s.length>0&&s.charCodeAt(0)===hh},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?".":zi.normalize(e)},relative(s,e){if(nl(s,"from"),nl(e,"to"),s===e||(s=zi.resolve(s),e=zi.resolve(e),s===e))return"";const t=1,i=s.length,n=i-t,r=1,o=e.length-r,a=na){if(e.charCodeAt(r+l)===hh)return e.slice(r+l+1);if(l===0)return e.slice(r+l)}else n>a&&(s.charCodeAt(t+l)===hh?c=l:l===0&&(c=0));let d="";for(l=t+c+1;l<=i;++l)(l===i||s.charCodeAt(l)===hh)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(r+c)}`},toNamespacedPath(s){return s},dirname(s){if(nl(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===hh;let t=-1,i=!0;for(let n=s.length-1;n>=1;--n)if(s.charCodeAt(n)===hh){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&&nl(e,"ext"),nl(s,"path");let t=0,i=-1,n=!0,r;if(e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let o=e.length-1,a=-1;for(r=s.length-1;r>=0;--r){const c=s.charCodeAt(r);if(c===hh){if(!n){t=r+1;break}}else a===-1&&(n=!1,a=r+1),o>=0&&(c===e.charCodeAt(o)?--o===-1&&(i=r):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(r=s.length-1;r>=0;--r)if(s.charCodeAt(r)===hh){if(!n){t=r+1;break}}else i===-1&&(n=!1,i=r+1);return i===-1?"":s.slice(t,i)},extname(s){nl(s,"path");let e=-1,t=0,i=-1,n=!0,r=0;for(let o=s.length-1;o>=0;--o){const a=s.charCodeAt(o);if(a===hh){if(!n){t=o+1;break}continue}i===-1&&(n=!1,i=o+1),a===iD?e===-1?e=o:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||i===-1||r===0||r===1&&e===i-1&&e===t+1?"":s.slice(e,i)},format:RKe.bind(null,"/"),parse(s){nl(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.charCodeAt(0)===hh;let i;t?(e.root="/",i=1):i=0;let n=-1,r=0,o=-1,a=!0,c=s.length-1,l=0;for(;c>=i;--c){const d=s.charCodeAt(c);if(d===hh){if(!a){r=c+1;break}continue}o===-1&&(a=!1,o=c+1),d===iD?n===-1?n=c:l!==1&&(l=1):n!==-1&&(l=-1)}if(o!==-1){const d=r===0&&t?1:r;n===-1||l===0||l===1&&n===o-1&&n===r+1?e.base=e.name=s.slice(d,o):(e.name=s.slice(d,n),e.base=s.slice(d,o),e.ext=s.slice(n,o))}return r>0?e.dir=s.slice(0,r-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};zi.win32=lc.win32=lc;zi.posix=lc.posix=zi;const Bk=lv?lc.normalize:zi.normalize,yM=lv?lc.isAbsolute:zi.isAbsolute,kfe=lv?lc.join:zi.join,odt=lv?lc.resolve:zi.resolve,P2=lv?lc.relative:zi.relative,xb=lv?lc.dirname:zi.dirname,Kr=lv?lc.basename:zi.basename,jy=lv?lc.extname:zi.extname,adt=lv?lc.parse:zi.parse,au=lv?lc.sep:zi.sep;lv?lc.delimiter:zi.delimiter;const cdt=/^\w[\w\d+.-]*$/,ldt=/^\//,ddt=/^\/\//;function hdt(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&&!cdt.test(s.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(s.path){if(s.authority){if(!ldt.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(ddt.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 udt(s,e){return!s&&!e?"file":s}function gdt(s,e){switch(s){case"https":case"http":case"file":e?e[0]!==Qv&&(e=Qv+e):e=Qv;break}return e}const xa="",Qv="/",fdt=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;let N=class Eq{static isUri(e){return e instanceof Eq?!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,r,o=!1){typeof e=="object"?(this.scheme=e.scheme||xa,this.authority=e.authority||xa,this.path=e.path||xa,this.query=e.query||xa,this.fragment=e.fragment||xa):(this.scheme=udt(e,o),this.authority=t||xa,this.path=gdt(this.scheme,i||xa),this.query=n||xa,this.fragment=r||xa,hdt(this,o))}get fsPath(){return qj(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:r,fragment:o}=e;return t===void 0?t=this.scheme:t===null&&(t=xa),i===void 0?i=this.authority:i===null&&(i=xa),n===void 0?n=this.path:n===null&&(n=xa),r===void 0?r=this.query:r===null&&(r=xa),o===void 0?o=this.fragment:o===null&&(o=xa),t===this.scheme&&i===this.authority&&n===this.path&&r===this.query&&o===this.fragment?this:new rP(t,i,n,r,o)}static parse(e,t=!1){const i=fdt.exec(e);return i?new rP(i[2]||xa,NG(i[4]||xa),NG(i[5]||xa),NG(i[7]||xa),NG(i[9]||xa),t):new rP(xa,xa,xa,xa,xa)}static file(e){let t=xa;if(jn&&(e=e.replace(/\\/g,Qv)),e[0]===Qv&&e[1]===Qv){const i=e.indexOf(Qv,2);i===-1?(t=e.substring(2),e=Qv):(t=e.substring(2,i),e=e.substring(i)||Qv)}return new rP("file",t,e,xa,xa)}static from(e,t){return new rP(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 jn&&e.scheme==="file"?i=Eq.file(lc.join(qj(e,!0),...t)).path:i=zi.join(e.path,...t),e.with({path:i})}toString(e=!1){return Tfe(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof Eq)return e;{const t=new rP(e);return t._formatted=e.external??null,t._fsPath=e._sep===MKe?e.fsPath??null:null,t}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};function Ife(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 MKe=jn?1:void 0;let rP=class extends N{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=qj(this,!1)),this._fsPath}toString(e=!1){return e?Tfe(this,!0):(this._formatted||(this._formatted=Tfe(this,!1)),this._formatted)}toJSON(){const e={$mid:ys.Uri};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=MKe),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 NKe={[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 oOe(s,e,t){let i,n=-1;for(let r=0;r=B.a&&o<=B.z||o>=B.A&&o<=B.Z||o>=B.Digit0&&o<=B.Digit9||o===B.Dash||o===B.Period||o===B.Underline||o===B.Tilde||e&&o===B.Slash||t&&o===B.OpenSquareBracket||t&&o===B.CloseSquareBracket||t&&o===B.Colon)n!==-1&&(i+=encodeURIComponent(s.substring(n,r)),n=-1),i!==void 0&&(i+=s.charAt(r));else{i===void 0&&(i=s.substr(0,r));const a=NKe[o];a!==void 0?(n!==-1&&(i+=encodeURIComponent(s.substring(n,r)),n=-1),i+=a):n===-1&&(n=r)}}return n!==-1&&(i+=encodeURIComponent(s.substring(n))),i!==void 0?i:s}function pdt(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,jn&&(t=t.replace(/\//g,"\\")),t}function Tfe(s,e){const t=e?pdt:oOe;let i="",{scheme:n,authority:r,path:o,query:a,fragment:c}=s;if(n&&(i+=n,i+=":"),(r||n==="file")&&(i+=Qv,i+=Qv),r){let l=r.indexOf("@");if(l!==-1){const d=r.substr(0,l);r=r.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+="@"}r=r.toLowerCase(),l=r.lastIndexOf(":"),l===-1?i+=t(r,!1,!0):(i+=t(r.substr(0,l),!1,!0),i+=r.substr(l))}if(o){if(o.length>=3&&o.charCodeAt(0)===B.Slash&&o.charCodeAt(2)===B.Colon){const l=o.charCodeAt(1);l>=B.A&&l<=B.Z&&(o=`/${String.fromCharCode(l+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===B.Colon){const l=o.charCodeAt(0);l>=B.A&&l<=B.Z&&(o=`${String.fromCharCode(l+32)}:${o.substr(2)}`)}i+=t(o,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),c&&(i+="#",i+=e?c:oOe(c,!1,!1)),i}function PKe(s){try{return decodeURIComponent(s)}catch{return s.length>3?s.substr(0,3)+PKe(s.substr(3)):s}}const aOe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function NG(s){return s.match(aOe)?s.replace(aOe,e=>PKe(e)):s}let re=class o0{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 o0(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return o0.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return o0.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 vl.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return vl.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 vl.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 vl.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 vl.plusRange(this,e)}static plusRange(e,t){let i,n,r,o;return t.startLineNumbere.endLineNumber?(r=t.endLineNumber,o=t.endColumn):t.endLineNumber===e.endLineNumber?(r=t.endLineNumber,o=Math.max(t.endColumn,e.endColumn)):(r=e.endLineNumber,o=e.endColumn),new vl(i,n,r,o)}intersectRanges(e){return vl.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,r=e.endLineNumber,o=e.endColumn;const a=t.startLineNumber,c=t.startColumn,l=t.endLineNumber,d=t.endColumn;return il?(r=l,o=d):r===l&&(o=Math.min(o,d)),i>r||i===r&&n>o?null:new vl(i,n,r,o)}equalsRange(e){return vl.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 vl.getEndPosition(this)}static getEndPosition(e){return new re(e.endLineNumber,e.endColumn)}getStartPosition(){return vl.getStartPosition(this)}static getStartPosition(e){return new re(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new vl(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new vl(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return vl.collapseToStart(this)}static collapseToStart(e){return new vl(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return vl.collapseToEnd(this)}static collapseToEnd(e){return new vl(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new vl(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new vl(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new vl(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 h_;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})(h_||(h_={}));let ht=class Wm 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 Wm.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?h_.LTR:h_.RTL}setEndPosition(e,t){return this.getDirection()===h_.LTR?new Wm(this.startLineNumber,this.startColumn,e,t):new Wm(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new re(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new re(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===h_.LTR?new Wm(e,t,this.endLineNumber,this.endColumn):new Wm(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Wm(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===h_.LTR?new Wm(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Wm(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Wm(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>>Ui.LANGUAGEID_OFFSET}static getTokenType(e){return(e&Ui.TOKEN_TYPE_MASK)>>>Ui.TOKEN_TYPE_OFFSET}static containsBalancedBrackets(e){return(e&Ui.BALANCED_BRACKETS_MASK)!==0}static getFontStyle(e){return(e&Ui.FONT_STYLE_MASK)>>>Ui.FONT_STYLE_OFFSET}static getForeground(e){return(e&Ui.FOREGROUND_MASK)>>>Ui.FOREGROUND_OFFSET}static getBackground(e){return(e&Ui.BACKGROUND_MASK)>>>Ui.BACKGROUND_OFFSET}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const n=this.getFontStyle(e);return n&Vr.Italic&&(i+=" mtki"),n&Vr.Bold&&(i+=" mtkb"),n&Vr.Underline&&(i+=" mtku"),n&Vr.Strikethrough&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let r=`color: ${t[i]};`;n&Vr.Italic&&(r+="font-style: italic;"),n&Vr.Bold&&(r+="font-weight: bold;");let o="";return n&Vr.Underline&&(o+=" underline"),n&Vr.Strikethrough&&(o+=" line-through"),o&&(r+=`text-decoration:${o};`),r}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&Vr.Italic),bold:!!(i&Vr.Bold),underline:!!(i&Vr.Underline),strikethrough:!!(i&Vr.Strikethrough)}}}let vdt=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 bdt(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>Ml.DefaultBackground?this._colorMap[Ml.DefaultBackground]:null}};class bdt 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 E8=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 Joe{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var Nc;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(Nc||(Nc={}));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 x8;(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(r){let o=e.get(r);return o||(console.info("No codicon found for CompletionItemKind "+r),o=ve.symbolProperty),o}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(r,o){let a=i.get(r);return typeof a>"u"&&!o&&(a=Me.Property),a}s.fromString=n})(x8||(x8={}));var F2;(function(s){s[s.Deprecated=1]="Deprecated"})(F2||(F2={}));var Zg;(function(s){s[s.None=0]="None",s[s.KeepWhitespace=1]="KeepWhitespace",s[s.InsertAsSnippet=4]="InsertAsSnippet"})(Zg||(Zg={}));var nD;(function(s){s[s.Word=0]="Word",s[s.Line=1]="Line",s[s.Suggest=2]="Suggest"})(nD||(nD={}));var ju;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(ju||(ju={}));var nm;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(nm||(nm={}));class OKe{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 Ah;(function(s){s[s.Invoke=1]="Invoke",s[s.Auto=2]="Auto"})(Ah||(Ah={}));var D8;(function(s){s[s.Automatic=0]="Automatic",s[s.PasteAs=1]="PasteAs"})(D8||(D8={}));var Ly;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(Ly||(Ly={}));var k8;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(k8||(k8={}));function BKe(s){return s&&N.isUri(s.uri)&&F.isIRange(s.range)&&(F.isIRange(s.originSelectionRange)||F.isIRange(s.targetSelectionRange))}var mt;(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"})(mt||(mt={}));const wdt={[mt.Array]:g(1658,"array"),[mt.Boolean]:g(1659,"boolean"),[mt.Class]:g(1660,"class"),[mt.Constant]:g(1661,"constant"),[mt.Constructor]:g(1662,"constructor"),[mt.Enum]:g(1663,"enumeration"),[mt.EnumMember]:g(1664,"enumeration member"),[mt.Event]:g(1665,"event"),[mt.Field]:g(1666,"field"),[mt.File]:g(1667,"file"),[mt.Function]:g(1668,"function"),[mt.Interface]:g(1669,"interface"),[mt.Key]:g(1670,"key"),[mt.Method]:g(1671,"method"),[mt.Module]:g(1672,"module"),[mt.Namespace]:g(1673,"namespace"),[mt.Null]:g(1674,"null"),[mt.Number]:g(1675,"number"),[mt.Object]:g(1676,"object"),[mt.Operator]:g(1677,"operator"),[mt.Package]:g(1678,"package"),[mt.Property]:g(1679,"property"),[mt.String]:g(1680,"string"),[mt.Struct]:g(1681,"struct"),[mt.TypeParameter]:g(1682,"type parameter"),[mt.Variable]:g(1683,"variable")};function ydt(s,e){return g(1684,"{0} ({1})",s,wdt[e])}var I8;(function(s){s[s.Deprecated=1]="Deprecated"})(I8||(I8={}));var Qj;(function(s){const e=new Map;e.set(mt.File,ve.symbolFile),e.set(mt.Module,ve.symbolModule),e.set(mt.Namespace,ve.symbolNamespace),e.set(mt.Package,ve.symbolPackage),e.set(mt.Class,ve.symbolClass),e.set(mt.Method,ve.symbolMethod),e.set(mt.Property,ve.symbolProperty),e.set(mt.Field,ve.symbolField),e.set(mt.Constructor,ve.symbolConstructor),e.set(mt.Enum,ve.symbolEnum),e.set(mt.Interface,ve.symbolInterface),e.set(mt.Function,ve.symbolFunction),e.set(mt.Variable,ve.symbolVariable),e.set(mt.Constant,ve.symbolConstant),e.set(mt.String,ve.symbolString),e.set(mt.Number,ve.symbolNumber),e.set(mt.Boolean,ve.symbolBoolean),e.set(mt.Array,ve.symbolArray),e.set(mt.Object,ve.symbolObject),e.set(mt.Key,ve.symbolKey),e.set(mt.Null,ve.symbolNull),e.set(mt.EnumMember,ve.symbolEnumMember),e.set(mt.Struct,ve.symbolStruct),e.set(mt.Event,ve.symbolEvent),e.set(mt.Operator,ve.symbolOperator),e.set(mt.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})(Qj||(Qj={}));let TTe=class{static asEditOperation(e){return es.replace(F.lift(e.range),e.text)}};var Fg;let u_=(Fg=class{static fromValue(e){switch(e){case"comment":return Fg.Comment;case"imports":return Fg.Imports;case"region":return Fg.Region}return new Fg(e)}constructor(e){this.value=e}},Fg.Comment=new Fg("comment"),Fg.Imports=new Fg("imports"),Fg.Region=new Fg("region"),Fg);var Rfe;(function(s){s[s.AIGenerated=1]="AIGenerated"})(Rfe||(Rfe={}));var CM;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(CM||(CM={}));var jj;(function(s){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}s.is=e})(jj||(jj={}));var Rc;(function(s){s[s.Collapsed=0]="Collapsed",s[s.Expanded=1]="Expanded"})(Rc||(Rc={}));var cu;(function(s){s[s.Unresolved=0]="Unresolved",s[s.Resolved=1]="Resolved"})(cu||(cu={}));var sD;(function(s){s[s.Current=0]="Current",s[s.Outdated=1]="Outdated"})(sD||(sD={}));var O2;(function(s){s[s.Editing=0]="Editing",s[s.Preview=1]="Preview"})(O2||(O2={}));var Yj;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Yj||(Yj={}));class Cdt{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 La=new vdt;var cOe;(function(s){s[s.None=0]="None",s[s.Option=1]="Option",s[s.Default=2]="Default",s[s.Preferred=3]="Preferred"})(cOe||(cOe={}));var B2;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(B2||(B2={}));var Mfe;(function(s){s[s.Unknown=0]="Unknown",s[s.Disabled=1]="Disabled",s[s.Enabled=2]="Enabled"})(Mfe||(Mfe={}));var Nfe;(function(s){s[s.Invoke=1]="Invoke",s[s.Auto=2]="Auto"})(Nfe||(Nfe={}));var Pfe;(function(s){s[s.None=0]="None",s[s.KeepWhitespace=1]="KeepWhitespace",s[s.InsertAsSnippet=4]="InsertAsSnippet"})(Pfe||(Pfe={}));var Ffe;(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"})(Ffe||(Ffe={}));var Ofe;(function(s){s[s.Deprecated=1]="Deprecated"})(Ofe||(Ofe={}));var Bfe;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(Bfe||(Bfe={}));var Wfe;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(Wfe||(Wfe={}));var Hfe;(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"})(Hfe||(Hfe={}));var Ufe;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(Ufe||(Ufe={}));var Vfe;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(Vfe||(Vfe={}));var zfe;(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"})(zfe||(zfe={}));var $fe;(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"})($fe||($fe={}));var Gfe;(function(s){s[s.TextDefined=0]="TextDefined",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(Gfe||(Gfe={}));var Kfe;(function(s){s[s.LF=0]="LF",s[s.CRLF=1]="CRLF"})(Kfe||(Kfe={}));var qfe;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=3]="Right"})(qfe||(qfe={}));var Qfe;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(Qfe||(Qfe={}));var jfe;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(jfe||(jfe={}));var Yfe;(function(s){s[s.Both=0]="Both",s[s.Right=1]="Right",s[s.Left=2]="Left",s[s.None=3]="None"})(Yfe||(Yfe={}));var Jfe;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Jfe||(Jfe={}));var Xfe;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(Xfe||(Xfe={}));var Zfe;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(Zfe||(Zfe={}));var epe;(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"})(epe||(epe={}));var tpe;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(tpe||(tpe={}));var ipe;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(ipe||(ipe={}));var npe;(function(s){s[s.Inline=1]="Inline",s[s.Gutter=2]="Gutter"})(npe||(npe={}));var spe;(function(s){s[s.Normal=1]="Normal",s[s.Underlined=2]="Underlined"})(spe||(spe={}));var rpe;(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"})(rpe||(rpe={}));var ope;(function(s){s[s.AIGenerated=1]="AIGenerated"})(ope||(ope={}));var ape;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(ape||(ape={}));var cpe;(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"})(cpe||(cpe={}));var lpe;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(lpe||(lpe={}));var dpe;(function(s){s[s.Word=0]="Word",s[s.Line=1]="Line",s[s.Suggest=2]="Suggest"})(dpe||(dpe={}));var hpe;(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"})(hpe||(hpe={}));var upe;(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"})(upe||(upe={}));var gpe;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Blocks=2]="Blocks"})(gpe||(gpe={}));var fpe;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(fpe||(fpe={}));var ppe;(function(s){s[s.Auto=1]="Auto",s[s.Hidden=2]="Hidden",s[s.Visible=3]="Visible"})(ppe||(ppe={}));var mpe;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})(mpe||(mpe={}));var _pe;(function(s){s.Off="off",s.OnCode="onCode",s.On="on"})(_pe||(_pe={}));var vpe;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(vpe||(vpe={}));var bpe;(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"})(bpe||(bpe={}));var wpe;(function(s){s[s.Deprecated=1]="Deprecated"})(wpe||(wpe={}));var ype;(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"})(ype||(ype={}));var Cpe;(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"})(Cpe||(Cpe={}));var Spe;(function(s){s[s.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",s[s.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",s[s.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",s[s.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(Spe||(Spe={}));var Ape;(function(s){s[s.None=0]="None",s[s.Same=1]="Same",s[s.Indent=2]="Indent",s[s.DeepIndent=3]="DeepIndent"})(Ape||(Ape={}));const QF=class QF{static chord(e,t){return oo(e,t)}};QF.CtrlCmd=U.CtrlCmd,QF.Shift=U.Shift,QF.Alt=U.Alt,QF.WinCtrl=U.WinCtrl;let Epe=QF;function WKe(){return{editor:void 0,languages:void 0,CancellationTokenSource:li,Emitter:I,KeyCode:epe,KeyMod:Epe,Position:re,Range:F,Selection:ht,SelectionDirection:mpe,MarkerSeverity:tpe,MarkerTag:ipe,Uri:N,Token:E8}}function Sdt(s,e){const t=s;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const ri=window;function Adt(s){return s===ri?!1:typeof s?.vscodeWindowId=="number"}var lOe=[],l4=[];function gt(s,e){if(s&&typeof document<"u"){var t,i=e.prepend===!0?"prepend":"append",n=e.singleTag===!0,r=typeof e.container=="string"?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(n){var o=lOe.indexOf(r);o===-1&&(o=lOe.push(r)-1,l4[o]={}),t=l4[o]&&l4[o][i]?l4[o][i]:l4[o][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,AT=EU.indexOf("AppleWebKit")>=0,o6=EU.indexOf("Chrome")>=0,Yy=!o6&&EU.indexOf("Safari")>=0,UKe=!o6&&!Yy&&AT;EU.indexOf("Electron/")>=0;const dOe=EU.indexOf("Android")>=0;let xq=!1;if(typeof ri.matchMedia=="function"){const s=ri.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=ri.matchMedia("(display-mode: fullscreen)");xq=s.matches,Jj(ri,s,({matches:t})=>{xq&&e.matches||(xq=t)})}function VKe(){return xq}var rD;(function(s){s[s.Always=0]="Always",s[s.FullScreen=1]="FullScreen",s[s.None=2]="None"})(rD||(rD={}));const NO={clipboard:{writeText:ld||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:ld||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:ld||VKe()?rD.Always:navigator.keyboard||Yy?rD.FullScreen:rD.None,touch:"ontouchstart"in ri||navigator.maxTouchPoints>0,pointerEvents:ri.PointerEvent&&("ontouchstart"in ri||navigator.maxTouchPoints>0)};var H0;(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"})(H0||(H0={}));function Dpe(s,e){if(typeof s=="number"){if(s===0)return null;const t=(s&65535)>>>0,i=(s&4294901760)>>>16;return i!==0?new PO([PG(t,e),PG(i,e)]):new PO([PG(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 Dh{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=Fdt.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class SM{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(o6){const r=navigator.userAgent.match(/Chrome\/(\d+)/);n=(r?parseInt(r[1]):123)<=122}if(e){const r=e,o=e,a=e.view?.devicePixelRatio||1;if(typeof r.wheelDeltaY<"u")n?this.deltaY=r.wheelDeltaY/(120*a):this.deltaY=r.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){const c=e;c.deltaMode===c.DOM_DELTA_LINE?lf&&!jt?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof r.wheelDeltaX<"u")Yy&&jn?this.deltaX=-(r.wheelDeltaX/120):n?this.deltaX=r.wheelDeltaX/(120*a):this.deltaX=r.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const c=e;c.deltaMode===c.DOM_DELTA_LINE?lf&&!jt?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 pE(s){return s===B.Slash||s===B.Backslash}function L8(s){return s.replace(/[\\/]/g,zi.sep)}function Wdt(s){return s.indexOf("/")===-1&&(s=L8(s)),/^[a-zA-Z]:(\/|$)/.test(s)&&(s="/"+s),s}function uOe(s,e=zi.sep){if(!s)return"";const t=s.length,i=s.charCodeAt(0);if(pE(i)){if(pE(s.charCodeAt(1))&&!pE(s.charCodeAt(2))){let r=3;const o=r;for(;r\|]/g,Vdt=/[/]/g,zdt=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function $dt(s,e=jn){const t=e?Udt:Vdt;return!(!s||s.length===0||/^\s+$/.test(s)||(t.lastIndex=0,t.test(s))||e&&zdt.test(s)||s==="."||s===".."||e&&s[s.length-1]==="."||e&&s.length!==s.trim().length||s.length>255)}function Gdt(s,e,t){const i=s===e;return!t||i?i:!s||!e?!1:ga(s,e)}function Xj(s,e,t,i=au){if(s===e)return!0;if(!s||!e||e.length>s.length)return!1;if(t){if(!J7(s,e))return!1;if(e.length===s.length)return!0;let r=e.length;return e.charAt(e.length-1)===i&&r--,s.charAt(r)===i}return e.charAt(e.length-1)!==i&&(e+=i),s.indexOf(e)===0}function zKe(s){return s>=B.A&&s<=B.Z||s>=B.a&&s<=B.z}function $Ke(s,e=jn){return e?zKe(s.charCodeAt(0))&&s.charCodeAt(1)===B.Colon:!1}function Kdt(s,e=jn){return $Ke(s,e)?s[0]:void 0}function GKe(s,e,t){return e.length>s.length?-1:s===e?0:(t&&(s=s.toLowerCase(),e=e.toLowerCase()),s.indexOf(e))}function KKe(s){const e=s.split(":");let t,i,n;for(const r of e){const o=Number(r);dc(o)?i===void 0?i=o:n===void 0&&(n=o):t=t?[t,r].join(":"):r}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 IA(s,e){return N.isUri(s)?ga(s.scheme,e):J7(s,e+":")}function R8(s,...e){return e.some(t=>IA(s,t))}const qdt="tkn";class Qdt{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=jdt(e,t)}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return zi.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 bt(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],r=this._connectionTokens[t];let o=`path=${encodeURIComponent(e.path)}`;return typeof r=="string"&&(o+=`&${qdt}=${encodeURIComponent(r)}`),N.from({scheme:Hn?this._preferredWebSchema:pe.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:o})}}const M8=new Qdt;function jdt(s,e){return zi.join(e??"/",`${s.quality??"oss"}-${s.commit??"dev"}`)}const Ydt="vscode-app",jF=class jF{constructor(){this.staticBrowserUris=new gi,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?M8.rewrite(e):e.scheme===pe.file&&(ld||Kat===`${pe.vscodeFileResource}://${jF.FALLBACK_AUTHORITY}`)?e.with({scheme:pe.vscodeFileResource,authority:e.authority||jF.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!==jF.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()}};jF.FALLBACK_AUTHORITY=Ydt;let kpe=jF;const sf=new kpe;var Ipe;(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(r){let o;typeof r=="string"?o=new URL(r).searchParams:r instanceof URL?o=r.searchParams:N.isUri(r)&&(o=new URL(r.toString(!0)).searchParams);const a=o?.get(t);if(a)return e.get(a)}s.getHeadersFromQuery=i;function n(r,o,a){if(!globalThis.crossOriginIsolated)return;const c=o&&a?"3":a?"2":"1";r instanceof URLSearchParams?r.set(t,c):r[t]=c}s.addSearchParam=n})(Ipe||(Ipe={}));function i_(s){return qj(s,!0)}class RN{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:mm(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 Xj(i_(e),i_(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(W2(e.authority,t.authority))return Xj(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 vi(e)||e.authority}basename(e){return zi.basename(e.path)}extname(e){return zi.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===pe.file?t=N.file(xb(i_(e))).path:(t=zi.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(Bk(i_(e))).path:t=zi.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!W2(e.authority,t.authority))return;if(e.scheme===pe.file){const r=P2(i_(e),i_(t));return jn?L8(r):r}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let r=0;for(const o=Math.min(i.length,n.length);ruOe(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=au){return fOe(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=au){let i=!1;if(e.scheme===pe.file){const n=i_(e);i=n!==void 0&&n.length===uOe(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&&!fOe(e,t)?e.with({path:e.path+"/"}):e}}const Dn=new RN(()=>!1),qKe=new RN(s=>s.scheme===pe.file?!mo:!0),Xoe=new RN(s=>!0),Yi=Dn.isEqual.bind(Dn),Jy=Dn.isEqualOrParent.bind(Dn);Dn.getComparisonKey.bind(Dn);const TA=Dn.basenameOrAuthority.bind(Dn),vi=Dn.basename.bind(Dn),xU=Dn.extname.bind(Dn),Ro=Dn.dirname.bind(Dn),Ft=Dn.joinPath.bind(Dn),QKe=Dn.normalizePath.bind(Dn),MN=Dn.relativePath.bind(Dn),gOe=Dn.resolvePath.bind(Dn),jKe=Dn.isAbsolutePath.bind(Dn),W2=Dn.isEqualAuthority.bind(Dn),fOe=Dn.hasTrailingPathSeparator.bind(Dn),pOe=Dn.removeTrailingPathSeparator.bind(Dn);Dn.addTrailingPathSeparator.bind(Dn);function Jdt(s,e){const t=[];for(let i=0;io===i?!1:Jy(n,e(r)))||t.push(s[i])}return t}var Wk;(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(o=>{const[a,c]=o.split(":");a&&c&&i.set(a,c)});const r=t.path.substring(0,t.path.indexOf(";"));return r&&i.set(s.META_DATA_MIME,r),i}s.parseMetaData=e})(Wk||(Wk={}));function N8(s,e,t){if(e){let i=s.path;return i&&i[0]!==zi.sep&&(i=zi.sep+i),s.with({scheme:t,authority:e,path:i})}return s.with({scheme:t})}const YKe=Symbol("MicrotaskDelay");function Xy(s){return!!s&&typeof s.then=="function"}function Mo(s){const e=new li,t=s(e.token),i=new Promise((n,r)=>{const o=e.token.onCancellationRequested(()=>{o.dispose(),r(new Pa)});Promise.resolve(t).then(a=>{o.dispose(),e.dispose(),n(a)},a=>{o.dispose(),e.dispose(),r(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(n,r){return i.then(n,r)}catch(n){return this.then(void 0,n)}finally(n){return i.finally(n)}}}function $_(s,e,t){return new Promise((i,n)=>{const r=e.onCancellationRequested(()=>{r.dispose(),i(t)});s.then(i,n).finally(()=>r.dispose())})}function Zoe(s,e){return new Promise((t,i)=>{const n=e.onCancellationRequested(()=>{n.dispose(),i(new Pa)});s.then(t,i).finally(()=>n.dispose())})}function JKe(s,e,t){let i;const n=setTimeout(()=>{i?.(void 0)},e);return Promise.race([s.finally(()=>clearTimeout(n)),new Promise(r=>i=r)])}function Jh(s){return new Promise((e,t)=>{const i=s();Xy(i)?i.then(e,t):e(i)})}function H2(){let s,e;return{promise:new Promise((i,n)=>{s=i,e=n}),resolve:s,reject:e}}class a6{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 Xdt{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 Zdt=(s,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},s);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},eht=s=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,s())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};let Ph=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,r)=>{this.doResolve=n,this.doReject=r}).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===YKe?eht(i):Zdt(t,i),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new Pa),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};class c6{constructor(e){this.delayer=new Ph(e),this.throttler=new a6}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 jd{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 Ao(s,e){return e?new Promise((t,i)=>{const n=setTimeout(()=>{r.dispose(),t()},s),r=e.onCancellationRequested(()=>{clearTimeout(n),r.dispose(),i(new Pa)})}):Mo(t=>Ao(s,t))}function Zy(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 eae(s,e=i=>!!i,t=null){let i=0;const n=s.length,r=()=>{if(i>=n)return Promise.resolve(t);const o=s[i++];return Promise.resolve(o()).then(c=>e(c)?Promise.resolve(c):r())};return r()}class Tpe{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 EI=class extends Tpe{constructor(){super(1)}};class LTe{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 hc;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=Dn){const i=t.getComparisonKey(e);return this.queues.get(i)?.size??0}queueFor(e,t,i=Dn){const n=i.getComparisonKey(e);let r=this.queues.get(n);if(!r){r=new EI;const o=this.drainListenerCount++,a=M.once(r.onDrained)(()=>{r?.dispose(),this.queues.delete(n),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(o),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new mr),this.drainListeners.set(o,a),this.queues.set(n,r)}return r.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 Em{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 Pi("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Pi("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class l6{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 Pi("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 ln{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 XKe extends ln{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 U2,FO;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?FO=(s,e)=>{pTe(()=>{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)}}}:FO=(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))}}},U2=s=>FO(globalThis,s)})();class ZKe{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(i){this._error=i}finally{this._didRun=!0}},this._handle=FO(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 Lpe extends ZKe{constructor(e){super(globalThis,e)}}class eqe{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}=H2();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 U0;(function(s){s[s.Resolved=0]="Resolved",s[s.Rejected=1]="Rejected"})(U0||(U0={}));class hc{get isRejected(){return this.outcome?.outcome===U0.Rejected}get isResolved(){return this.outcome?.outcome===U0.Resolved}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===U0.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:U0.Resolved,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:U0.Rejected,value:e},t()})}cancel(){return this.error(new Pa)}}var er;(function(s){async function e(i){let n;const r=await Promise.all(i.map(o=>o.then(a=>a,a=>{n||(n=a)})));if(typeof n<"u")throw n;return r}s.settled=e;function t(i){return new Promise(async(n,r)=>{try{await i(n,r)}catch(o){r(o)}})}s.withAsyncBody=t})(er||(er={}));class tht{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 Pi("Promise is not resolved yet");if(this._error)throw this._error;return this._value}}class iht{constructor(e){this._compute=e,this._promise=new Ca(()=>new tht(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}}var Iv;(function(s){s[s.Initial=0]="Initial",s[s.DoneOK=1]="DoneOK",s[s.DoneError=2]="DoneError"})(Iv||(Iv={}));const Dg=class Dg{static fromArray(e){return new Dg(t=>{t.emitMany(e)})}static fromPromise(e){return new Dg(async t=>{t.emitMany(await e)})}static fromPromises(e){return new Dg(async t=>{await Promise.all(e.map(async i=>t.emitOne(await i)))})}static merge(e){return new Dg(async t=>{await Promise.all(e.map(async i=>{for await(const n of i)t.emitOne(n)}))})}constructor(e,t){this._state=Iv.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===Iv.DoneError)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,t){return new Dg(async i=>{for await(const n of e)i.emitOne(t(n))})}map(e){return Dg.map(this,e)}static filter(e,t){return new Dg(async i=>{for await(const n of e)t(n)&&i.emitOne(n)})}filter(e){return Dg.filter(this,e)}static coalesce(e){return Dg.filter(e,t=>!!t)}coalesce(){return Dg.coalesce(this)}static async toPromise(e){const t=[];for await(const i of e)t.push(i);return t}toPromise(){return Dg.toPromise(this)}emitOne(e){this._state===Iv.Initial&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===Iv.Initial&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===Iv.Initial&&(this._state=Iv.DoneOK,this._onStateChanged.fire())}reject(e){this._state===Iv.Initial&&(this._state=Iv.DoneError,this._error=e,this._onStateChanged.fire())}};Dg.EMPTY=Dg.fromArray([]);let Yd=Dg;class nht extends Yd{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function sht(s){const e=new li,t=s(e.token);return new nht(e,async i=>{const n=e.token.onCancellationRequested(()=>{n.dispose(),e.dispose(),i.reject(new Pa)});try{for await(const r of t){if(e.token.isCancellationRequested)return;i.emitOne(r)}n.dispose(),e.dispose()}catch(r){n.dispose(),e.dispose(),i.reject(r)}})}class V2{constructor(e){this._deferred=new hc,this._asyncIterable=new Yd(n=>{if(t){n.reject(t);return}return i&&n.emitMany(i),this._errorFn=r=>n.reject(r),this._emitFn=r=>n.emitOne(r),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:tqe,setPrototypeOf:mOe,isFrozen:rht,getPrototypeOf:oht,getOwnPropertyDescriptor:aht}=Object;let{freeze:df,seal:Mb,create:cht}=Object,{apply:Rpe,construct:Mpe}=typeof Reflect<"u"&&Reflect;Rpe||(Rpe=function(e,t,i){return e.apply(t,i)});df||(df=function(e){return e});Mb||(Mb=function(e){return e});Mpe||(Mpe=function(e,t){return new e(...t)});const lht=G_(Array.prototype.forEach),_Oe=G_(Array.prototype.pop),d4=G_(Array.prototype.push),Dq=G_(String.prototype.toLowerCase),Wde=G_(String.prototype.toString),dht=G_(String.prototype.match),pv=G_(String.prototype.replace),hht=G_(String.prototype.indexOf),uht=G_(String.prototype.trim),Dp=G_(RegExp.prototype.test),h4=ght(TypeError);function G_(s){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n/gm),vht=Mb(/\${[\w\W]*}/gm),bht=Mb(/^data-[\-\w.\u00B7-\uFFFF]/),wht=Mb(/^aria-[\-\w]+$/),iqe=Mb(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yht=Mb(/^(?:\w+script|data):/i),Cht=Mb(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nqe=Mb(/^html$/i);var COe=Object.freeze({__proto__:null,MUSTACHE_EXPR:mht,ERB_EXPR:_ht,TMPLIT_EXPR:vht,DATA_ATTR:bht,ARIA_ATTR:wht,IS_ALLOWED_URI:iqe,IS_SCRIPT_OR_DATA:yht,ATTR_WHITESPACE:Cht,DOCTYPE_NAME:nqe});const Sht=()=>typeof window>"u"?null:window,Aht=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 r="dompurify"+(i?"#"+i:"");try{return e.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}};function sqe(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sht();const e=Bt=>sqe(Bt);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:r,HTMLTemplateElement:o,Node:a,Element:c,NodeFilter:l,NamedNodeMap:d=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:h,DOMParser:u,trustedTypes:f}=s,p=c.prototype,m=FG(p,"cloneNode"),v=FG(p,"nextSibling"),b=FG(p,"childNodes"),w=FG(p,"parentNode");if(typeof o=="function"){const Bt=n.createElement("template");Bt.content&&Bt.content.ownerDocument&&(n=Bt.content.ownerDocument)}let y,C="";const{implementation:A,createNodeIterator:L,createDocumentFragment:k,getElementsByTagName:P}=n,{importNode:R}=t;let z={};e.isSupported=typeof tqe=="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:Be}=COe;let{IS_ALLOWED_URI:Ct}=COe,Ne=null;const dt=Ks({},[...vOe,...Hde,...Ude,...Vde,...bOe]);let Dt=null;const Xi=Ks({},[...wOe,...zde,...yOe,...OG]);let Ti=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}})),ss=null,$s=null,Fn=!0,Zo=!0,hs=!1,Zr=!0,ea=!1,ki=!1,rs=!1,Or=!1,Ln=!1,Ha=!1,wd=!1,On=!0,nh=!1;const mc="user-content-";let $c=!0,Gs=!1,ic={},pl=null;const sh=Ks({},["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 mg=null;const _c=Ks({},["audio","video","img","source","image","track"]);let Gc=null;const rh=Ks({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kc="http://www.w3.org/1998/Math/MathML",ml="http://www.w3.org/2000/svg",nc="http://www.w3.org/1999/xhtml";let Bo=nc,_l=!1,oh=null;const ah=Ks({},[kc,ml,nc],Wde);let Kc;const qc=["application/xhtml+xml","text/html"],Ua="text/html";let Br,Ts=null;const Ic=n.createElement("form"),Fh=function(K){return K instanceof RegExp||K instanceof Function},be=function(K){if(!(Ts&&Ts===K)){if((!K||typeof K!="object")&&(K={}),K=oP(K),Kc=qc.indexOf(K.PARSER_MEDIA_TYPE)===-1?Kc=Ua:Kc=K.PARSER_MEDIA_TYPE,Br=Kc==="application/xhtml+xml"?Wde:Dq,Ne="ALLOWED_TAGS"in K?Ks({},K.ALLOWED_TAGS,Br):dt,Dt="ALLOWED_ATTR"in K?Ks({},K.ALLOWED_ATTR,Br):Xi,oh="ALLOWED_NAMESPACES"in K?Ks({},K.ALLOWED_NAMESPACES,Wde):ah,Gc="ADD_URI_SAFE_ATTR"in K?Ks(oP(rh),K.ADD_URI_SAFE_ATTR,Br):rh,mg="ADD_DATA_URI_TAGS"in K?Ks(oP(_c),K.ADD_DATA_URI_TAGS,Br):_c,pl="FORBID_CONTENTS"in K?Ks({},K.FORBID_CONTENTS,Br):sh,ss="FORBID_TAGS"in K?Ks({},K.FORBID_TAGS,Br):{},$s="FORBID_ATTR"in K?Ks({},K.FORBID_ATTR,Br):{},ic="USE_PROFILES"in K?K.USE_PROFILES:!1,Fn=K.ALLOW_ARIA_ATTR!==!1,Zo=K.ALLOW_DATA_ATTR!==!1,hs=K.ALLOW_UNKNOWN_PROTOCOLS||!1,Zr=K.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ea=K.SAFE_FOR_TEMPLATES||!1,ki=K.WHOLE_DOCUMENT||!1,Ln=K.RETURN_DOM||!1,Ha=K.RETURN_DOM_FRAGMENT||!1,wd=K.RETURN_TRUSTED_TYPE||!1,Or=K.FORCE_BODY||!1,On=K.SANITIZE_DOM!==!1,nh=K.SANITIZE_NAMED_PROPS||!1,$c=K.KEEP_CONTENT!==!1,Gs=K.IN_PLACE||!1,Ct=K.ALLOWED_URI_REGEXP||iqe,Bo=K.NAMESPACE||nc,Ti=K.CUSTOM_ELEMENT_HANDLING||{},K.CUSTOM_ELEMENT_HANDLING&&Fh(K.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ti.tagNameCheck=K.CUSTOM_ELEMENT_HANDLING.tagNameCheck),K.CUSTOM_ELEMENT_HANDLING&&Fh(K.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ti.attributeNameCheck=K.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),K.CUSTOM_ELEMENT_HANDLING&&typeof K.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ti.allowCustomizedBuiltInElements=K.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ea&&(Zo=!1),Ha&&(Ln=!0),ic&&(Ne=Ks({},[...bOe]),Dt=[],ic.html===!0&&(Ks(Ne,vOe),Ks(Dt,wOe)),ic.svg===!0&&(Ks(Ne,Hde),Ks(Dt,zde),Ks(Dt,OG)),ic.svgFilters===!0&&(Ks(Ne,Ude),Ks(Dt,zde),Ks(Dt,OG)),ic.mathMl===!0&&(Ks(Ne,Vde),Ks(Dt,yOe),Ks(Dt,OG))),K.ADD_TAGS&&(Ne===dt&&(Ne=oP(Ne)),Ks(Ne,K.ADD_TAGS,Br)),K.ADD_ATTR&&(Dt===Xi&&(Dt=oP(Dt)),Ks(Dt,K.ADD_ATTR,Br)),K.ADD_URI_SAFE_ATTR&&Ks(Gc,K.ADD_URI_SAFE_ATTR,Br),K.FORBID_CONTENTS&&(pl===sh&&(pl=oP(pl)),Ks(pl,K.FORBID_CONTENTS,Br)),$c&&(Ne["#text"]=!0),ki&&Ks(Ne,["html","head","body"]),Ne.table&&(Ks(Ne,["tbody"]),delete ss.tbody),K.TRUSTED_TYPES_POLICY){if(typeof K.TRUSTED_TYPES_POLICY.createHTML!="function")throw h4('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof K.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw h4('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=K.TRUSTED_TYPES_POLICY,C=y.createHTML("")}else y===void 0&&(y=Aht(f,i)),y!==null&&typeof C=="string"&&(C=y.createHTML(""));df&&df(K),Ts=K}},Ea=Ks({},["mi","mo","mn","ms","mtext"]),ee=Ks({},["foreignobject","desc","title","annotation-xml"]),xe=Ks({},["title","style","font","a","script"]),ft=Ks({},Hde);Ks(ft,Ude),Ks(ft,fht);const $n=Ks({},Vde);Ks($n,pht);const Ss=function(K){let de=w(K);(!de||!de.tagName)&&(de={namespaceURI:Bo,tagName:"template"});const T=Dq(K.tagName),ie=Dq(de.tagName);return oh[K.namespaceURI]?K.namespaceURI===ml?de.namespaceURI===nc?T==="svg":de.namespaceURI===kc?T==="svg"&&(ie==="annotation-xml"||Ea[ie]):!!ft[T]:K.namespaceURI===kc?de.namespaceURI===nc?T==="math":de.namespaceURI===ml?T==="math"&&ee[ie]:!!$n[T]:K.namespaceURI===nc?de.namespaceURI===ml&&!ee[ie]||de.namespaceURI===kc&&!Ea[ie]?!1:!$n[T]&&(xe[T]||!ft[T]):!!(Kc==="application/xhtml+xml"&&oh[K.namespaceURI]):!1},Wr=function(K){d4(e.removed,{element:K});try{K.parentNode.removeChild(K)}catch{K.remove()}},Va=function(K,de){try{d4(e.removed,{attribute:de.getAttributeNode(K),from:de})}catch{d4(e.removed,{attribute:null,from:de})}if(de.removeAttribute(K),K==="is"&&!Dt[K])if(Ln||Ha)try{Wr(de)}catch{}else try{de.setAttribute(K,"")}catch{}},ta=function(K){let de,T;if(Or)K=""+K;else{const O=dht(K,/^[\r\n\t ]+/);T=O&&O[0]}Kc==="application/xhtml+xml"&&Bo===nc&&(K=''+K+"");const ie=y?y.createHTML(K):K;if(Bo===nc)try{de=new u().parseFromString(ie,Kc)}catch{}if(!de||!de.documentElement){de=A.createDocument(Bo,"template",null);try{de.documentElement.innerHTML=_l?C:ie}catch{}}const ye=de.body||de.documentElement;return K&&T&&ye.insertBefore(n.createTextNode(T),ye.childNodes[0]||null),Bo===nc?P.call(de,ki?"html":"body")[0]:ki?de.documentElement:ye},Oh=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")},ho=function(K){return typeof a=="object"?K instanceof a:K&&typeof K=="object"&&typeof K.nodeType=="number"&&typeof K.nodeName=="string"},nr=function(K,de,T){z[K]&&lht(z[K],ie=>{ie.call(e,de,T,Ts)})},gn=function(K){let de;if(nr("beforeSanitizeElements",K,null),le(K))return Wr(K),!0;const T=Br(K.nodeName);if(nr("uponSanitizeElement",K,{tagName:T,allowedTags:Ne}),K.hasChildNodes()&&!ho(K.firstElementChild)&&(!ho(K.content)||!ho(K.content.firstElementChild))&&Dp(/<[/\w]/g,K.innerHTML)&&Dp(/<[/\w]/g,K.textContent))return Wr(K),!0;if(!Ne[T]||ss[T]){if(!ss[T]&&at(T)&&(Ti.tagNameCheck instanceof RegExp&&Dp(Ti.tagNameCheck,T)||Ti.tagNameCheck instanceof Function&&Ti.tagNameCheck(T)))return!1;if($c&&!pl[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 Wr(K),!0}return K instanceof c&&!Ss(K)||(T==="noscript"||T==="noembed"||T==="noframes")&&Dp(/<\/no(script|embed|frames)/i,K.innerHTML)?(Wr(K),!0):(ea&&K.nodeType===3&&(de=K.textContent,de=pv(de,G," "),de=pv(de,Y," "),de=pv(de,j," "),K.textContent!==de&&(d4(e.removed,{element:K.cloneNode()}),K.textContent=de)),nr("afterSanitizeElements",K,null),!1)},Se=function(K,de,T){if(On&&(de==="id"||de==="name")&&(T in n||T in Ic))return!1;if(!(Zo&&!$s[de]&&Dp(ne,de))){if(!(Fn&&Dp(ge,de))){if(!Dt[de]||$s[de]){if(!(at(K)&&(Ti.tagNameCheck instanceof RegExp&&Dp(Ti.tagNameCheck,K)||Ti.tagNameCheck instanceof Function&&Ti.tagNameCheck(K))&&(Ti.attributeNameCheck instanceof RegExp&&Dp(Ti.attributeNameCheck,de)||Ti.attributeNameCheck instanceof Function&&Ti.attributeNameCheck(de))||de==="is"&&Ti.allowCustomizedBuiltInElements&&(Ti.tagNameCheck instanceof RegExp&&Dp(Ti.tagNameCheck,T)||Ti.tagNameCheck instanceof Function&&Ti.tagNameCheck(T))))return!1}else if(!Gc[de]){if(!Dp(Ct,pv(T,Be,""))){if(!((de==="src"||de==="xlink:href"||de==="href")&&K!=="script"&&hht(T,"data:")===0&&mg[K])){if(!(hs&&!Dp(De,pv(T,Be,"")))){if(T)return!1}}}}}}return!0},at=function(K){return K.indexOf("-")>0},Ot=function(K){let de,T,ie,ye;nr("beforeSanitizeAttributes",K,null);const{attributes:O}=K;if(!O)return;const $={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Dt};for(ye=O.length;ye--;){de=O[ye];const{name:se,namespaceURI:qe}=de;if(T=se==="value"?de.value:uht(de.value),ie=Br(se),$.attrName=ie,$.attrValue=T,$.keepAttr=!0,$.forceKeepAttr=void 0,nr("uponSanitizeAttribute",K,$),T=$.attrValue,$.forceKeepAttr||(Va(se,K),!$.keepAttr))continue;if(!Zr&&Dp(/\/>/i,T)){Va(se,K);continue}ea&&(T=pv(T,G," "),T=pv(T,Y," "),T=pv(T,j," "));const Wi=Br(K.nodeName);if(Se(Wi,ie,T)){if(nh&&(ie==="id"||ie==="name")&&(Va(se,K),T=mc+T),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!qe)switch(f.getAttributeType(Wi,ie)){case"TrustedHTML":{T=y.createHTML(T);break}case"TrustedScriptURL":{T=y.createScriptURL(T);break}}try{qe?K.setAttributeNS(qe,se,T):K.setAttribute(se,T),_Oe(e.removed)}catch{}}}nr("afterSanitizeAttributes",K,null)},Si=function Bt(K){let de;const T=Oh(K);for(nr("beforeSanitizeShadowDOM",K,null);de=T.nextNode();)nr("uponSanitizeShadowNode",de,null),!gn(de)&&(de.content instanceof r&&Bt(de.content),Ot(de));nr("afterSanitizeShadowDOM",K,null)};return e.sanitize=function(Bt){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},de,T,ie,ye;if(_l=!Bt,_l&&(Bt=""),typeof Bt!="string"&&!ho(Bt))if(typeof Bt.toString=="function"){if(Bt=Bt.toString(),typeof Bt!="string")throw h4("dirty is not a string, aborting")}else throw h4("toString is not a function");if(!e.isSupported)return Bt;if(rs||be(K),e.removed=[],typeof Bt=="string"&&(Gs=!1),Gs){if(Bt.nodeName){const se=Br(Bt.nodeName);if(!Ne[se]||ss[se])throw h4("root node is forbidden and cannot be sanitized in-place")}}else if(Bt instanceof a)de=ta(""),T=de.ownerDocument.importNode(Bt,!0),T.nodeType===1&&T.nodeName==="BODY"||T.nodeName==="HTML"?de=T:de.appendChild(T);else{if(!Ln&&!ea&&!ki&&Bt.indexOf("<")===-1)return y&&wd?y.createHTML(Bt):Bt;if(de=ta(Bt),!de)return Ln?null:wd?C:""}de&&Or&&Wr(de.firstChild);const O=Oh(Gs?Bt:de);for(;ie=O.nextNode();)gn(ie)||(ie.content instanceof r&&Si(ie.content),Ot(ie));if(Gs)return Bt;if(Ln){if(Ha)for(ye=k.call(de.ownerDocument);de.firstChild;)ye.appendChild(de.firstChild);else ye=de;return(Dt.shadowroot||Dt.shadowrootmode)&&(ye=R.call(t,ye,!0)),ye}let $=ki?de.outerHTML:de.innerHTML;return ki&&Ne["!doctype"]&&de.ownerDocument&&de.ownerDocument.doctype&&de.ownerDocument.doctype.name&&Dp(nqe,de.ownerDocument.doctype.name)&&($=" +`+$),ea&&($=pv($,G," "),$=pv($,Y," "),$=pv($,j," ")),y&&wd?y.createHTML($):$},e.setConfig=function(Bt){be(Bt),rs=!0},e.clearConfig=function(){Ts=null,rs=!1},e.isValidAttribute=function(Bt,K,de){Ts||be({});const T=Br(Bt),ie=Br(K);return Se(T,ie,de)},e.addHook=function(Bt,K){typeof K=="function"&&(z[Bt]=z[Bt]||[],d4(z[Bt],K))},e.removeHook=function(Bt){if(z[Bt])return _Oe(z[Bt])},e.removeHooks=function(Bt){z[Bt]&&(z[Bt]=[])},e.removeAllHooks=function(){z={}},e}var RTe=sqe();const rqe=RTe.sanitize,oqe=RTe.addHook,aqe=RTe.removeHook;function Hc(s){return tae(s,0)}function tae(s,e){switch(typeof s){case"object":return s===null?ES(349,e):Array.isArray(s)?xht(s,e):Dht(s,e);case"string":return MTe(s,e);case"boolean":return Eht(s,e);case"number":return ES(s,e);case"undefined":return ES(937,e);default:return ES(617,e)}}function ES(s,e){return(e<<5)-e+s|0}function Eht(s,e){return ES(s?433:863,e)}function MTe(s,e){e=ES(149417,e);for(let t=0,i=s.length;ttae(i,t),e)}function Dht(s,e){return e=ES(181387,e),Object.keys(s).sort().reduce((t,i)=>(t=MTe(i,t),tae(s[i],t)),e)}var $m;(function(s){s[s.BLOCK_SIZE=64]="BLOCK_SIZE",s[s.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})($m||($m={}));function $de(s,e,t=32){const i=t-e,n=~((1<>>i)>>>0}function SOe(s,e=0,t=s.byteLength,i=0){for(let n=0;nt.toString(16).padStart(2,"0")).join(""):kht((s>>>0).toString(16),e/4)}const rse=class rse{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array($m.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,r=this._leftoverHighSurrogate,o,a;for(r!==0?(o=r,a=-1,r=0):(o=e.charCodeAt(0),a=0);;){let c=o;if(Fc(o))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>=$m.BLOCK_SIZE&&(this._step(),t-=$m.BLOCK_SIZE,this._totalLen+=$m.BLOCK_SIZE,e[0]=e[$m.BLOCK_SIZE+0],e[1]=e[$m.BLOCK_SIZE+1],e[2]=e[$m.BLOCK_SIZE+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,$m.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),u4(this._h0)+u4(this._h1)+u4(this._h2)+u4(this._h3)+u4(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,SOe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),SOe(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=rse._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,$de(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,r=this._h2,o=this._h3,a=this._h4,c,l,d;for(let h=0;h<80;h++)h<20?(c=n&r|~n&o,l=1518500249):h<40?(c=n^r^o,l=1859775393):h<60?(c=n&r|n&o|r&o,l=2400959708):(c=n^r^o,l=3395469782),d=$de(i,5)+c+a+l+e.getUint32(h*4,!1)&4294967295,a=o,o=r,r=$de(n,30),n=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+n&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};rse._bigBlock32=new DataView(new ArrayBuffer(320));let Npe=rse;function Qa(s,e,t){return Math.min(Math.max(s,e),t)}function AOe(s,e){return(e+s%e)%e}class Iht{constructor(){this._next=0}getNext(){return this._next++}}class NTe{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 Tht{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(o.vscodeWindowId),i.fire(o)})),a.add(ue(o,ke.BEFORE_UNLOAD,()=>{n.fire(o)})),t.fire(c),a},getWindows(){return s.values()},getWindowsCount(){return s.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return s.has(o)},getWindowById:r,getWindow(o){const a=o;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;const c=o;return c?.view?c.view.window:ri},getDocument(o){return lt(o).document}}}();function Ns(s){for(;s.firstChild;)s.firstChild.remove()}class Nht{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 Nht(s,e,t,i)}function cqe(s,e){return function(t){return e(new Dh(s,t))}}function Pht(s){return function(e){return s(new xn(e))}}const Rr=function(e,t,i,n){let r=i;return t==="click"||t==="mousedown"||t==="contextmenu"?r=cqe(lt(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=Pht(i)),ue(e,t,r,n)},Fht=function(e,t,i){const n=cqe(lt(e),t);return Oht(e,n,i)};function Oht(s,e,t){return ue(s,gm&&NO.pointerEvents?ke.POINTER_DOWN:ke.MOUSE_DOWN,e,t)}function sF(s,e,t){return FO(s,e,t)}class o5 extends ZKe{constructor(e,t){super(e,t)}}let eY,Nl;function Bht(s,e,t,i){let n=0;const r=s.setInterval(()=>{n++,(n>=i||e()===!0)&&o.dispose()},t),o=Ee(()=>{s.clearInterval(r)});return o}class d6 extends l6{constructor(e){super(),this.defaultTarget=e&<(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class Gde{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 s=new Map,e=new Map,t=new Map,i=new Map,n=r=>{t.set(r,!1);const o=s.get(r)??[];for(e.set(r,o),s.set(r,[]),i.set(r,!0);o.length>0;)o.sort(Gde.sort),o.shift().execute();i.set(r,!1)};Nl=(r,o,a=0)=>{const c=z2(r),l=new Gde(o,a);let d=s.get(c);return d||(d=[],s.set(c,d)),d.push(l),t.get(c)||(t.set(c,!0),r.requestAnimationFrame(()=>n(c))),l},eY=(r,o,a)=>{const c=z2(r);if(i.get(c)){const l=new Gde(o,a);let d=e.get(c);return d||(d=[],e.set(c,d)),d.push(l),l}else return Nl(r,o,a)}})();const Wht=8,Hht=function(s,e){return e};class Uht extends V{constructor(e,t,i,n=Hht,r=Wht){super();let o=null,a=0;const c=this._register(new Em),l=()=>{a=new Date().getTime(),i(o),o=null};this._register(ue(e,t,d=>{o=n(o,d);const h=new Date().getTime()-a;h>=r?(c.cancel(),l()):c.setIfNotSet(l,r-h)}))}}function Vht(s,e,t,i,n){return new Uht(s,e,t,i,n)}function iae(s){return lt(s).getComputedStyle(s,null)}function K_(s,e){const t=lt(s),i=t.document;if(s!==i.body)return new wn(s.clientWidth,s.clientHeight);if(gm&&t?.visualViewport)return new wn(t.visualViewport.width,t.visualViewport.height);if(t?.innerWidth&&t.innerHeight)return new wn(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new wn(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new wn(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class Go{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=iae(e),r=n?n.getPropertyValue(t):"0";return Go.convertToPixels(e,r)}static getBorderLeftWidth(e){return Go.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Go.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Go.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Go.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Go.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Go.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Go.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Go.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Go.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Go.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Go.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Go.getDimension(e,"margin-bottom","marginBottom")}}const v1=class v1{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new v1(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof v1?e:new v1(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};v1.None=new v1(0,0);let wn=v1;function tY(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=uqe(s)?null:iae(s);n&&(i-=n.direction!=="rtl"?s.scrollLeft:-s.scrollLeft),s===e&&(i+=Go.getBorderLeftWidth(s),t+=Go.getBorderTopWidth(s),t+=s.offsetTop,i+=s.offsetLeft,e=s.offsetParent)}return{left:i,top:t}}function lqe(s,e,t){typeof e=="number"&&(s.style.width=`${e}px`),typeof t=="number"&&(s.style.height=`${t}px`)}function So(s){const e=s.getBoundingClientRect(),t=lt(s);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function dqe(s){let e=s,t=1;do{const i=iae(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Od(s){const e=Go.getMarginLeft(s)+Go.getMarginRight(s);return s.offsetWidth+e}function a5(s){const e=Go.getBorderLeftWidth(s)+Go.getBorderRightWidth(s),t=Go.getPaddingLeft(s)+Go.getPaddingRight(s);return s.offsetWidth-e-t}function zht(s){const e=Go.getMarginLeft(s)+Go.getMarginRight(s);return s.scrollWidth+e}function PTe(s){const e=Go.getBorderTopWidth(s)+Go.getBorderBottomWidth(s),t=Go.getPaddingTop(s)+Go.getPaddingBottom(s);return s.offsetHeight-e-t}function vb(s){const e=Go.getMarginTop(s)+Go.getMarginBottom(s);return s.offsetHeight+e}function $ht(s,e){if(s===null)return 0;const t=tY(s),i=tY(e);return t.left-i.left}function Ght(s,e){const t=e.map(n=>Math.max(zht(n),Od(n))+$ht(n,s)||0);return Math.max(...t)}function yc(s,e){return!!e?.contains(s)}const hqe="parentFlowToElementId";function Kht(s,e){s.dataset[hqe]=e.id}function qht(s){const e=s.dataset[hqe];return typeof e=="string"?s.ownerDocument.getElementById(e):null}function Qht(s,e){let t=s;for(;t;){if(t===e)return!0;if(Jo(t)){const i=qht(t);if(i){t=i;continue}}t=t.parentNode}return!1}function jht(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 kq(s,e,t){return!!jht(s,e,t)}function uqe(s){return s&&!!s.host&&!!s.mode}function F8(s){return!!AM(s)}function AM(s){for(;s.parentNode;){if(s===s.ownerDocument?.body)return null;s=s.parentNode}return uqe(s)?s:null}function Wc(){let s=Vu().activeElement;for(;s?.shadowRoot;)s=s.shadowRoot.activeElement;return s}function dv(s){return Wc()===s}function FTe(s){return yc(Wc(),s)}function Yht(s){return s.ownerDocument===Vu()}function Vu(){return Lht()<=1?ri.document:Array.from(P8()).map(({window:e})=>e.document).find(e=>e.hasFocus())??ri.document}function Ry(){return Vu().defaultView?.window??ri}const OTe=new Map;function gqe(){return new Jht}class Jht{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=fl(ri.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function fl(s=ri.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===ri.document.head){const n=new Set;OTe.set(i,n);for(const{window:r,disposables:o}of P8()){if(r===ri)continue;const a=o.add(Xht(i,n,r));t?.add(a)}}return i}function Xht(s,e,t){const i=new Z,n=s.cloneNode(!0);t.document.head.appendChild(n),i.add(Ee(()=>n.remove()));for(const r of pqe(s))n.sheet?.insertRule(r.cssText,n.sheet?.cssRules.length);return i.add(Zht.observe(s,i,{childList:!0})(()=>{n.textContent=s.textContent})),e.add(n),i.add(Ee(()=>e.delete(n))),i}const Zht=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=Hc(t);let r=i.get(n);if(r)r.users+=1;else{const o=new I,a=new MutationObserver(l=>o.fire(l));a.observe(s,t);const c=r={users:1,observer:a,onDidMutate:o.event};e.add(Ee(()=>{c.users-=1,c.users===0&&(o.dispose(),a.disconnect(),i?.delete(n),i?.size===0&&this.mutationObservers.delete(s))})),i.set(n,r)}return r.onDidMutate}};let Kde=null;function fqe(){return Kde||(Kde=fl()),Kde}function pqe(s){return s?.sheet?.rules?s.sheet.rules:s?.sheet?.cssRules?s.sheet.cssRules:[]}function $f(s,e,t=fqe()){if(!(!t||!e)){t.sheet?.insertRule(`${s} {${e}}`,0);for(const i of OTe.get(t)??[])$f(s,e,i)}}function xS(s,e=fqe()){if(!e)return;const t=pqe(e),i=[];for(let n=0;n=0;n--)e.sheet?.deleteRule(i[n]);for(const n of OTe.get(e)??[])xS(s,n)}function eut(s){return typeof s.selectorText=="string"}function Jo(s){return s instanceof HTMLElement||s instanceof lt(s).HTMLElement}function EOe(s){return s instanceof HTMLAnchorElement||s instanceof lt(s).HTMLAnchorElement}function tut(s){return s instanceof HTMLTextAreaElement||s instanceof lt(s).HTMLTextAreaElement}function iut(s){return s instanceof HTMLInputElement||s instanceof lt(s).HTMLInputElement}function nut(s){return s instanceof SVGElement||s instanceof lt(s).SVGElement}function BTe(s){return s instanceof MouseEvent||s instanceof lt(s).MouseEvent}function g_(s){return s instanceof KeyboardEvent||s instanceof lt(s).KeyboardEvent}function sut(s){return s instanceof DragEvent||s instanceof lt(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:AT?"webkitAnimationStart":"animationstart",ANIMATION_END:AT?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:AT?"webkitAnimationIteration":"animationiteration"};function rut(s){const e=s;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const tn={stop:(s,e)=>(s.preventDefault(),e&&s.stopPropagation(),s)};function out(s){const e=[];for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)e[t]=s.scrollTop,s=s.parentNode;return e}function aut(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 iY extends V{static hasFocusWithin(e){if(Jo(e)){const t=AM(e),i=t?t.activeElement:e.ownerDocument.activeElement;return yc(i,e)}else{const t=e;return yc(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=iY.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},r=()=>{t&&(i=!0,(Jo(e)?lt(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{iY.hasFocusWithin(e)!==t&&(t?r():n())},this._register(ue(e,ke.FOCUS,n,!0)),this._register(ue(e,ke.BLUR,r,!0)),Jo(e)&&(this._register(ue(e,ke.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ue(e,ke.FOCUS_OUT,()=>this._refreshStateHandler())))}refreshState(){this._refreshStateHandler()}}function Ec(s){return new iY(s)}function mqe(s,e){return s.after(e),e}function oe(s,...e){if(s.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function nae(s,e){return s.insertBefore(e,s.firstChild),e}function ca(s,...e){s.innerText="",oe(s,...e)}const cut=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var O8;(function(s){s.HTML="http://www.w3.org/1999/xhtml",s.SVG="http://www.w3.org/2000/svg"})(O8||(O8={}));function _qe(s,e,t,...i){const n=cut.exec(e);if(!n)throw new Error("Bad use of emmet");const r=n[1]||"div";let o;return s!==O8.HTML?o=document.createElementNS(s,r):o=document.createElement(r),n[3]&&(o.id=n[3]),n[4]&&(o.className=n[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,c])=>{typeof c>"u"||(/^on\w+$/.test(a)?o[a]=c:a==="selected"?c&&o.setAttribute(a,"true"):o.setAttribute(a,c))}),o.append(...i),o}function fe(s,e,...t){return _qe(O8.HTML,s,e,...t)}fe.SVG=function(s,e,...t){return _qe(O8.SVG,s,e,...t)};function WTe(s,...e){s?Xh(...e):Gd(...e)}function Xh(...s){for(const e of s)e.style.display="",e.removeAttribute("aria-hidden")}function Gd(...s){for(const e of s)e.style.display="none",e.setAttribute("aria-hidden","true")}function xOe(s,e){const t=s.devicePixelRatio*e;return Math.max(1,Math.floor(t))/s.devicePixelRatio}function vqe(s){ri.open(s,"_blank","noopener")}function lut(s,e){const t=()=>{e(),i=Nl(s,t)};let i=Nl(s,t);return Ee(()=>i.dispose())}M8.setPreferredWebSchema(/^https:/.test(ri.location.href)?"https":"http");function ig(s){return s?`url('${sf.uriToBrowserUri(s).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function Iq(s){return`'${s.replace(/'/g,"%27")}'`}function My(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=My(i[1].trim(),e)),`var(${i[0]}, ${e})`}return s}return e}function dut(s,e){let t;if(N.isUri(s))t=s.toString(!0);else{const r=new Blob([s]);t=URL.createObjectURL(r),setTimeout(()=>URL.revokeObjectURL(t))}const i=Ry(),n=document.createElement("a");i.document.body.appendChild(n),n.download=e,n.href=t,n.click(),setTimeout(()=>n.remove())}function hut(){return new Promise(s=>{const e=Ry(),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 c5;(function(s){s[s.DOCUMENT=1]="DOCUMENT",s[s.BROWSER=2]="BROWSER"})(c5||(c5={}));function uut(s){return s.document.fullscreenElement||s.document.webkitFullscreenElement||s.document.webkitIsFullScreen?{mode:c5.DOCUMENT,guess:!1}:s.innerHeight===s.screen.height?{mode:c5.BROWSER,guess:!1}:(jt||mo)&&s.outerHeight===s.screen.height&&s.outerWidth===s.screen.width?{mode:c5.BROWSER,guess:!0}:null}function gut(s,e=!1){const t=document.createElement("a");return oqe("afterSanitizeAttributes",i=>{for(const n of["href","src"])if(i.hasAttribute(n)){const r=i.getAttribute(n);if(n==="href"&&r.startsWith("#"))continue;if(t.href=r,!s.includes(t.protocol.replace(/:$/,""))){if(e&&n==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(n)}}}),Ee(()=>{aqe("afterSanitizeAttributes")})}pe.http,pe.https,pe.command;const fut=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 put(s){const e=new Uint16Array(s.length);for(let n=0;nthis.registerListeners(e,t),{window:ri,disposables:this._subscriptions}))}registerListeners(e,t){t.add(ue(e,"keydown",i=>{if(i.defaultPrevented)return;const n=new xn(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 bb.instance||(bb.instance=new bb),bb.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class nY 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 bqe=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Wt(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=bqe.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const r=n.groups.tag||"div",o=document.createElement(r);n.groups.id&&(o.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&&(o.className=a.join(" "));const c={};if(n.groups.name&&(c[n.groups.name]=o),i)for(const l of i)Jo(l)?o.appendChild(l):typeof l=="string"?o.append(l):"root"in l&&(Object.assign(c,l),o.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))o.style.setProperty(sY(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?o.tabIndex=d:o.setAttribute(sY(l),d.toString());return c.root=o,c}function aP(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=bqe.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const r=n.groups.tag||"div",o=document.createElementNS("http://www.w3.org/2000/svg",r);n.groups.id&&(o.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&&(o.className=a.join(" "));const c={};if(n.groups.name&&(c[n.groups.name]=o),i)for(const l of i)Jo(l)?o.appendChild(l):typeof l=="string"?o.append(l):"root"in l&&(Object.assign(c,l),o.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))o.style.setProperty(sY(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?o.tabIndex=d:o.setAttribute(sY(l),d.toString());return c.root=o,c}function sY(s){return s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class mut 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 _ut 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 mut(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 vut{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=z2(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=L2(new _ut(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),L2(M.once(Mht)(({vscodeWindowId:n})=>{n===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const W8=new vut;class wqe{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=Sf(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Sf(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Sf(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Sf(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Sf(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Sf(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Sf(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){const t=Sf(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){const t=Sf(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){const t=Sf(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){const t=Sf(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=Sf(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=Sf(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Sf(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 Sf(s){return typeof s=="number"?`${s}px`:s}function ds(s){return new wqe(s)}function Il(s,e){s instanceof wqe?(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 rc;(function(s){s[s.Regular=0]="Regular",s[s.Italic=1]="Italic",s[s.Bold=2]="Bold"})(rc||(rc={}));class but{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class HTe{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");Il(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Il(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");Il(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const r=[];for(const o of this._requests){let a;o.type===rc.Regular&&(a=t),o.type===rc.Bold&&(a=i),o.type===rc.Italic&&(a=n),a.appendChild(document.createElement("br"));const c=document.createElement("span");HTe._render(c,o),a.appendChild(c),r.push(c)}this._container=e,this._testElements=r}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 r of i)r.isTrusted||(n=!0,t.remove(r));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!==yqe)continue;const n=new Tq(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 Tq({pixelRatio:W8.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 r=new but(e,t);return i.push(r),n?.push(r),r}_actualReadFontInfo(e,t){const i=[],n=[],r=this._createRequest("n",rc.Regular,i,n),o=this._createRequest("m",rc.Regular,i,null),a=this._createRequest(" ",rc.Regular,i,n),c=this._createRequest("0",rc.Regular,i,n),l=this._createRequest("1",rc.Regular,i,n),d=this._createRequest("2",rc.Regular,i,n),h=this._createRequest("3",rc.Regular,i,n),u=this._createRequest("4",rc.Regular,i,n),f=this._createRequest("5",rc.Regular,i,n),p=this._createRequest("6",rc.Regular,i,n),m=this._createRequest("7",rc.Regular,i,n),v=this._createRequest("8",rc.Regular,i,n),b=this._createRequest("9",rc.Regular,i,n),w=this._createRequest("→",rc.Regular,i,n),y=this._createRequest("→",rc.Regular,i,null),C=this._createRequest("·",rc.Regular,i,n),A=this._createRequest("⸱",rc.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 Tq({pixelRatio:W8.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:r.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:z,spaceWidth:a.width,middotWidth:C.width,wsmiddotWidth:A.width,maxDigitWidth:k},!0)}}class Sut{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 Cut;var C_;(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})(C_||(C_={}));const we=ae("instantiationService");function Aut(s,e,t){e[C_.DI_TARGET]===e?e[C_.DI_DEPENDENCIES].push({id:s,index:t}):(e[C_.DI_DEPENDENCIES]=[{id:s,index:t}],e[C_.DI_TARGET]=e)}function ae(s){if(C_.serviceIds.has(s))return C_.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");Aut(e,t,n)};return e.toString=()=>s,C_.serviceIds.set(s,e),e}const qt=ae("codeEditorService"),fi=ae("modelService"),pn=ae("textModelService");function Eut(s){return!!s.textEditorModel}function D(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r}function _(s,e){return function(t,i){e(t,i,s)}}class an extends V{constructor(e,t="",i="",n=!0,r){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=r}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 q_ 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 Uz=class Uz{constructor(){this.id=Uz.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 Uz,...i]:t=i);return t}async run(){}};Uz.ID="vs.actions.separator";let Eo=Uz;class Hk{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 ose=class ose extends an{constructor(){super(ose.ID,g(1610,"(empty)"),void 0,!1)}};ose.ID="vs.actions.empty";let Fpe=ose;function al(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 $2;(function(s){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}s.isThemeColor=e})($2||($2={}));function DOe(s){return{id:s}}var He;(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 r(u){return u&&typeof u=="object"&&typeof u.id=="string"&&(typeof u.color>"u"||$2.isThemeColor(u.color))}s.isThemeIcon=r;const o=new RegExp(`^\\$\\((${s.iconNameExpression}(?:${s.iconModifierExpression})?)\\)$`);function a(u){const f=o.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})(He||(He={}));const bi=ae("commandService"),vt=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 o=[];for(const c of s.metadata.args)o.push(c.constraint);const a=s.handler;s.handler=function(c,...l){return Bat(l,o),a(c,...l)}}const{id:t}=s;let i=this._commands.get(t);i||(i=new ul,this._commands.set(t,i));const n=i.unshift(s),r=Ee(()=>{n(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(s,e){return vt.registerCommand(s,(t,...i)=>t.get(bi).executeCommand(e,...i))}getCommand(s){const e=this._commands.get(s);if(!(!e||e.isEmpty()))return ui.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}};vt.registerCommand("noop",()=>{});const Le=ae("contextKeyService");function Zf(s,e){if(!s)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function h6(s,e="Unreachable"){throw new Error(e)}function kOe(s){s||bt(new Pi("Soft Assertion Failed"))}function Q_(s){if(!s()){debugger;s(),bt(new Pi("Assertion Failed"))}}function DU(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(kut)),this._cachedMergedKeybindings.slice(0)}}const Sr=new UTe,Dut={EditorModes:"platform.keybindingsRegistry"};je.add(Dut.EditorModes,Sr);function kut(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 Lq;function ET(s){return s.command!==void 0}function Iut(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 Vz=class Vz{static for(e){let t=this._all.get(e);return t||(t=new Vz(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof Vz&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};Vz._all=new Map;let V0=Vz;const Yn=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new _ct({merge:V0.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(s){return this._commands.set(s.id,s),this._onDidChangeMenu.fire(V0.for(_e.CommandPalette)),Ee(()=>{this._commands.delete(s.id)&&this._onDidChangeMenu.fire(V0.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 ul,this._menuItems.set(s,t));const i=t.push(e);return this._onDidChangeMenu.fire(V0.for(s)),Ee(()=>{i(),this._onDidChangeMenu.fire(V0.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)ET(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 Ny extends Hk{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 Ac=Lq=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,r,o,a){this.hideActions=n,this.menuKeybinding=r,this._commandService=a,this.id=e.id,this.label=Lq.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const l=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(l.condition),this.checked&&l.tooltip&&(this.tooltip=typeof l.tooltip=="string"?l.tooltip:l.tooltip.value),this.checked&&He.isThemeIcon(l.icon)&&(c=l.icon),this.checked&&l.title&&(this.label=typeof l.title=="string"?l.title:l.title.value)}c||(c=He.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new Lq(t,void 0,i,n,void 0,o,a):void 0,this._options=i,this.class=c&&He.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)}};Ac=Lq=D([_(5,Le),_(6,bi)],Ac);class di{constructor(e){this.desc=e}}function Et(s){const e=[],t=new s,{f1:i,menu:n,keybinding:r,...o}=t.desc;if(vt.getCommand(o.id))throw new Error(`Cannot register two commands with the same id: ${o.id}`);if(e.push(vt.registerCommand({id:o.id,handler:(a,...c)=>t.run(a,...c),metadata:o.metadata})),Array.isArray(n))for(const a of n)e.push(Yn.appendMenuItem(a.id,{command:{...o,precondition:a.precondition===null?void 0:o.precondition},...a}));else n&&e.push(Yn.appendMenuItem(n.id,{command:{...o,precondition:n.precondition===null?void 0:o.precondition},...n}));if(i&&(e.push(Yn.appendMenuItem(_e.CommandPalette,{command:o,when:o.precondition})),e.push(Yn.addCommand(o))),Array.isArray(r))for(const a of r)e.push(Sr.registerKeybindingRule({...a,id:o.id,when:o.precondition?he.and(o.precondition,a.when):a.when}));else r&&e.push(Sr.registerKeybindingRule({...r,id:o.id,when:o.precondition?he.and(o.precondition,r.when):r.when}));return{dispose(){wt(e)}}}const Ji=ae("telemetryService"),Tut=ae("customEndpointTelemetryService"),Ke=ae("logService"),pf=ae("loggerService");var ai;(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"})(ai||(ai={}));let sae=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};Sr.registerKeybindingRule(n)}}vt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){Yn.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 xI extends sae{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((r,o)=>o.priority-r.priority),{dispose:()=>{for(let r=0;r{if(a.get(Le).contextMatchesRules(i??void 0))return n(a,o,t)})}runCommand(e,t){return uc.runEditorCommand(e,t,this.precondition,(i,n,r)=>this.runEditorCommand(i,n,r))}}class it extends uc{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(it.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(Ji).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class Sqe extends it{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 o=r.get(Le),a=r.get(Ke);if(!o.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(r,n,...t)})}}function lg(s,e){vt.registerCommand(s,function(t,...i){const n=t.get(we),[r,o]=i;Lt(N.isUri(r)),Lt(re.isIPosition(o));const a=t.get(fi).getModel(r);if(a){const c=re.lift(o);return n.invokeFunction(e,a,c,...i.slice(2))}return t.get(pn).createModelReference(r).then(c=>new Promise((l,d)=>{try{const h=n.invokeFunction(e,c.object.textEditorModel,re.lift(o),i.slice(2));l(h)}catch(h){d(h)}}).finally(()=>{c.dispose()}))})}function Qe(s){return ep.INSTANCE.registerEditorCommand(s),s}function Re(s){const e=new s;return ep.INSTANCE.registerEditorAction(e),e}function Aqe(s){return ep.INSTANCE.registerEditorAction(s),s}function Lut(s){ep.INSTANCE.registerEditorAction(s)}function on(s,e,t){ep.INSTANCE.registerEditorContribution(s,e,t)}function Eqe(s,e){ep.INSTANCE.registerDiffEditorContribution(s,e)}var dp;(function(s){function e(o){return ep.INSTANCE.getEditorCommand(o)}s.getEditorCommand=e;function t(){return ep.INSTANCE.getEditorActions()}s.getEditorActions=t;function i(){return ep.INSTANCE.getEditorContributions()}s.getEditorContributions=i;function n(o){return ep.INSTANCE.getEditorContributions().filter(a=>o.indexOf(a.id)>=0)}s.getSomeEditorContributions=n;function r(){return ep.INSTANCE.getDiffEditorContributions()}s.getDiffEditorContributions=r})(dp||(dp={}));const Rut={EditorCommonContributions:"editor.contributions"},ase=class ase{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}};ase.INSTANCE=new ase;let ep=ase;je.add(Rut.EditorCommonContributions,ep.INSTANCE);function u6(s){return s.register(),s}const xqe=u6(new xI({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}]}));u6(new Cqe(xqe,{id:"default:undo",precondition:void 0}));const Dqe=u6(new xI({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}]}));u6(new Cqe(Dqe,{id:"default:redo",precondition:void 0}));const Mut=u6(new xI({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}]})),Nut="$initialize";let IOe=!1;function Ope(s){Hn&&(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 Vf;(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"})(Vf||(Vf={}));class Put{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=Vf.Request}}class TOe{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=Vf.Reply}}class Fut{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=Vf.SubscribeEvent}}class Out{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=Vf.Event}}class But{constructor(e,t){this.vsWorker=e,this.req=t,this.type=Vf.UnsubscribeEvent}}class Wut{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,r)=>{this._pendingReplies[i]={resolve:n,reject:r},this._send(new Put(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 Fut(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new But(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 Vf.Reply:return this._handleReplyMessage(e);case Vf.Request:return this._handleRequestMessage(e);case Vf.SubscribeEvent:return this._handleSubscribeEventMessage(e);case Vf.Event:return this._handleEventMessage(e);case Vf.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 TOe(this._workerId,t,n,void 0))},n=>{n.detail instanceof Error&&(n.detail=kA(n.detail)),this._send(new TOe(this._workerId,t,void 0,kA(n)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(n=>{this._send(new Out(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===Vf.Request)for(let i=0;i{this._protocol.handleMessage(l)},l=>{n?.(l)})),this._protocol=new Wut({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(Iqe(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(kqe(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 r=null;typeof globalThis.requirejs<"u"&&(r=globalThis.requirejs.s.contexts._.config);const o=uTe(i);this._onModuleLoaded=this._protocol.sendMessage(Nut,[this._worker.getId(),JSON.parse(JSON.stringify(r)),t,o]);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(Uut(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 kqe(s){return s[0]==="o"&&s[1]==="n"&&Uw(s.charCodeAt(2))}function Iqe(s){return/^onDynamic/.test(s)&&Uw(s.charCodeAt(9))}function Uut(s,e,t){const i=o=>function(){const a=Array.prototype.slice.call(arguments,0);return e(o,a)},n=o=>function(a){return t(o,a)},r={};for(const o of s){if(Iqe(o)){r[o]=n(o);continue}if(kqe(o)){r[o]=t(o,void 0);continue}r[o]=i(o)}return r}function ZA(s,e){const t=globalThis.MonacoEnvironment;if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(s,e)}catch(i){bt(i);return}try{return globalThis.trustedTypes?.createPolicy(s,e)}catch(i){bt(i);return}}let rY;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?rY=globalThis.workerttPolicy:rY=ZA("defaultWorkerFactory",{createScriptURL:s=>s});function Vut(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(rY?rY.createScriptURL(t):t,{name:s})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function zut(s){return typeof s.then=="function"}class $ut extends V{constructor(e,t,i,n,r){super(),this.id=t,this.label=i;const o=Vut(i);zut(o)?this.worker=o:this.worker=Promise.resolve(o),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(c){n(c.data)},a.onmessageerror=r,typeof a.addEventListener=="function"&&a.addEventListener("error",r)}),this._register(Ee(()=>{this.worker?.then(a=>{a.onmessage=null,a.onmessageerror=null,a.removeEventListener("error",r),a.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){this.worker?.then(i=>{try{i.postMessage(e,t)}catch(n){bt(n),bt(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:n}))}})}}const cse=class cse{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++cse.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new $ut(e,n,this._label||"anonymous"+n,t,r=>{Ope(r),this._webWorkerFailedBeforeError=r,i(r)})}};cse.LAST_WORKER_ID=0;let Bpe=cse;var Co;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(Co||(Co={}));class Qde{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 Qde(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Qde({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Qde({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:b1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:b1.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}};b1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> `,b1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> `,b1.DEFAULT_AUTOCLOSE_BEFORE_WHITESPACE=` - `;let Wpe=b1;function L1(s,e){const t=s.getCount(),i=s.findTokenIndexAtOffset(e),n=s.getLanguageId(i);let r=i;for(;r+10&&s.getLanguageId(o-1)===n;)o--;return new Kut(s,n,o,r+1,s.getStartOffset(o),s.getEndOffset(r))}class Kut{constructor(e,t,i,n,r,o){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=r,this._lastCharOffset=o,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 Hpe;(function(s){s[s.value=3]="value"})(Hpe||(Hpe={}));function nw(s){return(s&Hpe.value)!==0}function Rq(s){const e=s;return e?[e.on,e.pause,e.resume,e.destroy].every(t=>typeof t=="function"):!1}function jde(s){const e=s;return e?Rq(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}function eE(s,e){return new qut(s,e)}class qut{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 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 Qut(s,e){const t=[];let i;for(;(i=s.read())!==null;)t.push(i);return e(t)}function jut(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 r=n;return n=void 0,r}return s.read()}}}function VTe(s,e){return new Promise((t,i)=>{const n=[];NN(s,{onData:r=>{e&&n.push(r)},onError:r=>{e?i(r):t(void 0)},onEnd:()=>{t(e?e(n):void 0)}})})}function NN(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 Yut(s,e){return new Promise((t,i)=>{const n=new Z,r=[],o=l=>{if(r.push(l),r.length>e)return n.dispose(),s.pause(),t({stream:s,buffer:r,ended:!1})},a=l=>(n.dispose(),i(l)),c=()=>(n.dispose(),t({stream:s,buffer:r,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",o))),s.on("data",o)})}function Jut(s,e){const t=eE(e);return t.end(s),t}function Xut(s){let e=!1;return{read:()=>e?null:(e=!0,s)}}function Zut(s,e,t){const i=eE(t);return NN(s,{onData:n=>i.write(e.data(n)),onError:n=>i.error(e.error?e.error(n):n),onEnd:()=>i.end()}),i}const BG=typeof Buffer<"u",egt=new Ca(()=>new Uint8Array(256));let Yde,Jde;class Ge{static alloc(e){return BG?new Ge(Buffer.allocUnsafe(e)):new Ge(new Uint8Array(e))}static wrap(e){return BG&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new Ge(e)}static fromString(e,t){return!(t?.dontUseNodeBuffer||!1)&&BG?new Ge(Buffer.from(e)):(Yde||(Yde=new TextEncoder),new Ge(Yde.encode(e)))}static fromByteArray(e){const t=Ge.alloc(e.length);for(let i=0,n=e.length;i"u"){t=0;for(let r=0,o=e.length;rn-t)return-1;const r=egt.value;r.fill(e.length);for(let l=0;l>>0|s[e+1]<<8>>>0}function ngt(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function Lu(s,e){return s[e]*2**24+s[e+1]*2**16+s[e+2]*2**8+s[e+3]}function Ru(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 sgt(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0|s[e+2]<<16>>>0|s[e+3]<<24>>>0}function rgt(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 Upe(s,e){return s[e]}function Vpe(s,e,t){s[t]=e}function ogt(s){return Qut(s,e=>Ge.concat(e))}function Tqe(s){return Xut(s)}function oD(s){return VTe(s,e=>Ge.concat(e))}async function agt(s){return s.ended?Ge.concat(s.buffer):Ge.concat([...s.buffer,await oD(s.stream)])}function g6(s){return Jut(s,e=>Ge.concat(e))}function Lqe(s){return eE(e=>Ge.concat(e),s)}function Rqe(s){let e=0,t=0,i=0;const n=new Uint8Array(Math.floor(s.length/4*3)),r=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)r(c-65);else if(c>=97&&c<=122)r(c-97+26);else if(c>=48&&c<=57)r(c-48+52);else if(c===43||c===45)r(62);else if(c===47||c===95)r(63);else{if(c===61)break;throw new SyntaxError(`Unexpected base64 character ${s[a]}`)}}const o=i;for(;t>0;)r(0);return Ge.wrap(n).slice(0,o)}const cgt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lgt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function zTe({buffer:s},e=!0,t=!1){const i=t?lgt:cgt;let n="";const r=s.byteLength%3;let o=0;for(;o>>2],n+=i[(a<<4|c>>>4)&63],n+=i[(c<<2|l>>>6)&63],n+=i[l&63]}if(r===1){const a=s[o+0];n+=i[a>>>2],n+=i[a<<4&63],e&&(n+="==")}else if(r===2){const a=s[o+0],c=s[o+1];n+=i[a>>>2],n+=i[(a<<4|c>>>4)&63],n+=i[c<<2&63],e&&(n+="=")}return n}let Xde;function Mqe(){return Xde||(Xde=new TextDecoder("UTF-16LE")),Xde}let Zde;function dgt(){return Zde||(Zde=new TextDecoder("UTF-16BE")),Zde}let ehe;function Nqe(){return ehe||(ehe=mTe()?Mqe():dgt()),ehe}function hgt(s,e,t){const i=new Uint16Array(s.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?ugt(s,e,t):Mqe().decode(i)}function ugt(s,e,t){const i=[];let n=0;for(let r=0;r=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[o[0].toLowerCase(),o[1].toLowerCase()]);const t=[];for(let o=0;o{const[c,l]=o,[d,h]=a;return c===d||c===h||l===d||l===h},n=(o,a)=>{const c=Math.min(o,a),l=Math.max(o,a);for(let d=0;d0&&r.push({open:a,close:c})}return r}class fgt{constructor(e,t){this._richEditBracketsBrand=void 0;const i=ggt(t);this.brackets=i.map((n,r)=>new oY(e,r,n.open,n.close,pgt(n.open,n.close,i,r),mgt(n.open,n.close,i,r))),this.forwardRegex=_gt(this.brackets),this.reversedRegex=vgt(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const r of n.open)this.textIsBracket[r]=n,this.textIsOpenBracket[r]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,r.length);for(const r of n.close)this.textIsBracket[r]=n,this.textIsOpenBracket[r]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,r.length)}}}function Pqe(s,e,t,i){for(let n=0,r=e.length;n=0&&i.push(a);for(const a of o.close)a.indexOf(s)>=0&&i.push(a)}}function Fqe(s,e){return s.length-e.length}function rae(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 pgt(s,e,t,i){let n=[];n=n.concat(s),n=n.concat(e);for(let r=0,o=n.length;r=0;o--)n[r++]=i.charCodeAt(o);return Nqe().decode(n)}let e=null,t=null;return function(n){return e!==n&&(e=n,t=s(e)),t}}();class Hm{static _findPrevBracketInText(e,t,i,n){const r=i.match(e);if(!r)return null;const o=i.length-(r.index||0),a=r[0].length,c=n+o;return new F(t,c-a+1,t,c+1)}static findPrevBracketInRange(e,t,i,n,r){const a=$Te(i).substring(i.length-r,i.length-n);return this._findPrevBracketInText(e,t,a,n)}static findNextBracketInText(e,t,i,n){const r=i.match(e);if(!r)return null;const o=r.index||0,a=r[0].length;if(a===0)return null;const c=n+o;return new F(t,c+1,t,c+1+a)}static findNextBracketInRange(e,t,i,n,r){const o=i.substring(n,r);return this.findNextBracketInText(e,t,o,n)}}class wgt{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 Ya(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const n=t.findTokenIndexAtOffset(i-1);if(nw(t.getStandardTokenType(n)))return null;const r=this._richEditBrackets.reversedRegex,o=t.getLineContent().substring(0,i-1)+e,a=Hm.findPrevBracketInRange(r,1,o,0,o.length);if(!a)return null;const c=o.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 wb;(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"})(wb||(wb={}));function WG(s){return s.global&&(s.lastIndex=0),!0}class ygt{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&WG(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&WG(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&WG(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&WG(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=wb.INCREASE_MASK),this.shouldDecrease(e)&&(t+=wb.DECREASE_MASK),this.shouldIndentNextLine(e)&&(t+=wb.INDENT_NEXTLINE_MASK),this.shouldIgnore(e)&&(t+=wb.UNINDENT_MASK),t}}class rF{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=rF._createOpenBracketRegExp(t[0]),n=rF._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>=dl.Advanced)for(let r=0,o=this._regExpRules.length;rl.reg?(l.reg.lastIndex=0,l.reg.test(l.text)):!0))return a.action}if(e>=dl.Brackets&&i.length>0&&n.length>0)for(let r=0,o=this._brackets.length;r=dl.Brackets&&i.length>0){for(let r=0,o=this._brackets.length;r"u"?t:r}function Dgt(s){return s.replace(/[\[\]]/g,"")}function kgt(s){let e=!1;const t=new Map,i=new Map;if(Igt(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 r="$defs";for(;s.hasOwnProperty(r);)r+="_";const o=[];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=`_${o.length}`,o.push(f.schemas[0])),{$ref:`#/${r}/${f.id}`}}return u})}const c=a(s),l=[];for(let d=0;d{for(const l of c)cP(l)&&o.push(l)},i=(...c)=>{for(const l of c)if(cP(l))for(const d in l){const h=l[d];cP(h)&&o.push(h)}},n=(...c)=>{for(const l of c)if(Array.isArray(l))for(const d of l)cP(d)&&o.push(d)},r=c=>{if(Array.isArray(c))for(const l of c)cP(l)&&o.push(l);else cP(c)&&o.push(c)},o=[s];let a=o.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),r(a.items)),a=o.pop()}const tE={JSONContribution:"base.contributions.json"};function Tgt(s){return s.length>0&&s.charAt(s.length-1)==="#"?s.substring(0,s.length-1):s}class Lgt{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(e,t){this.schemasById[Tgt(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?kgt(t):void 0}hasSchemaContent(e){return!!this.schemasById[e]}}const Rgt=new Lgt;je.add(tE.JSONContribution,Rgt);var LOe;(function(s){s.Multiline="multilineText",s.Singleline="singlelineText"})(LOe||(LOe={}));const Pn={Configuration:"base.contributions.configuration"};var ct;(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"})(ct||(ct={}));const Tg={properties:{},patternProperties:{}},oV={properties:{},patternProperties:{}},oF={properties:{},patternProperties:{}},hS={properties:{},patternProperties:{}},uS={properties:{},patternProperties:{}},Yv={properties:{},patternProperties:{}},AE="vscode://schemas/settings/resourceLanguage",Uqe="vscode://schemas/settings/configurationDefaults",HG=je.as(tE.JSONContribution);class Mgt{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={},HG.registerSchema(AE,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),HG.registerSchema(AE,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(e){const t=new Set;this.doDeregisterConfigurations(e,t),HG.registerSchema(AE,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),HG.registerSchema(AE,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:r}of e)for(const o in n){t.add(o);const a=this.configurationDefaultsOverrides.get(o)??this.configurationDefaultsOverrides.set(o,{configurationDefaultOverrides:[]}).get(o),c=n[o];if(a.configurationDefaultOverrides.push({value:c,source:r}),rf.test(o)){const l=this.mergeDefaultConfigurationsForOverrideIdentifier(o,c,r,a.configurationDefaultOverrideValue);if(!l)continue;a.configurationDefaultOverrideValue=l,this.updateDefaultOverrideProperty(o,l,r),i.push(...U8(o))}else{const l=this.mergeDefaultConfigurationsForConfigurationProperty(o,c,r,a.configurationDefaultOverrideValue);if(!l)continue;a.configurationDefaultOverrideValue=l;const d=this.configurationProperties[o];d&&(this.updatePropertyDefaultValue(o,d),this.updateSchema(o,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 r in i){const o=this.configurationDefaultsOverrides.get(r);if(!o)continue;const a=o.configurationDefaultOverrides.findIndex(c=>n?c.source?.id===n.id:c.value===i[r]);if(a!==-1){if(o.configurationDefaultOverrides.splice(a,1),o.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(r),rf.test(r)){let c;for(const l of o.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForOverrideIdentifier(r,l.value,l.source,c);c&&!DA(c.value)?(o.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(r,c,n)):(this.configurationDefaultsOverrides.delete(r),delete this.configurationProperties[r],delete this.defaultLanguageConfigurationOverridesNode.properties[r])}else{let c;for(const d of o.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForConfigurationProperty(r,d.value,d.source,c);o.configurationDefaultOverrideValue=c;const l=this.configurationProperties[r];l&&(this.updatePropertyDefaultValue(r,l),this.updateSchema(r,l))}t.add(r)}}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.",Dgt(e)),$ref:AE,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=n,this.defaultLanguageConfigurationOverridesNode.properties[e]=n}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,n){const r=n?.value||{},o=n?.source??new Map;if(!(o instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const a of Object.keys(t)){const c=t[a];if(In(c)&&(Ja(r[a])||In(r[a]))){if(r[a]={...r[a]??{},...c},i)for(const d in c)o.set(`${a}.${d}`,i)}else r[a]=c,i?o.set(a,i):o.delete(a)}return{value:r,source:o}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,n){const r=this.configurationProperties[e],o=n?.value??r?.defaultDefaultValue;let a=i;if(In(t)&&(r!==void 0&&r.type==="object"||r===void 0&&(Ja(o)||In(o)))){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={...In(o)?o:{},...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 r in n.properties){t.add(r);const o=this.configurationProperties[r];o?.policy?.name&&this.policyConfigurations.delete(o.policy.name),delete this.configurationProperties[r],this.removeFromSchema(r,n.properties[r])}n.allOf?.forEach(r=>i(r))};for(const n of e){i(n);const r=this.configurationContributors.indexOf(n);r!==-1&&this.configurationContributors.splice(r,1)}}validateAndRegisterProperties(e,t=!0,i,n,r=ct.WINDOW,o){r=aa(e.scope)?r:e.scope;const a=e.properties;if(a)for(const l in a){const d=a[l];if(t&&Gqe(l,d)){delete a[l];continue}if(d.source=i,d.defaultDefaultValue=a[l].default,this.updatePropertyDefaultValue(l,d),rf.test(l)?d.scope=void 0:(d.scope=aa(d.scope)?r:d.scope,d.restricted=aa(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),o.add(l)}const c=e.allOf;if(c)for(const l of c)this.validateAndRegisterProperties(l,t,i,n,r,o)}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 o in n)this.updateSchema(o,n[o]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(Tg.properties[e]=t,t.scope){case ct.APPLICATION:oV.properties[e]=t;break;case ct.MACHINE:oF.properties[e]=t;break;case ct.MACHINE_OVERRIDABLE:hS.properties[e]=t;break;case ct.WINDOW:uS.properties[e]=t;break;case ct.RESOURCE:Yv.properties[e]=t;break;case ct.LANGUAGE_OVERRIDABLE:Yv.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete Tg.properties[e],t.scope){case ct.APPLICATION:delete oV.properties[e];break;case ct.MACHINE:delete oF.properties[e];break;case ct.MACHINE_OVERRIDABLE:delete hS.properties[e];break;case ct.WINDOW:delete uS.properties[e];break;case ct.RESOURCE:case ct.LANGUAGE_OVERRIDABLE:delete Yv.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:AE};this.updatePropertyDefaultValue(t,i),Tg.properties[t]=i,oV.properties[t]=i,oF.properties[t]=i,hS.properties[t]=i,uS.properties[t]=i,Yv.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:AE};Tg.patternProperties[NE]=e,oV.patternProperties[NE]=e,oF.patternProperties[NE]=e,hS.patternProperties[NE]=e,uS.patternProperties[NE]=e,Yv.patternProperties[NE]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;let n,r;i&&(!t.disallowConfigurationDefault||!i.source)&&(n=i.value,r=i.source),Ja(n)&&(n=t.defaultDefaultValue,r=void 0),Ja(n)&&(n=$qe(t.type)),t.default=n,t.defaultValueSource=r}}const Vqe="\\[([^\\]]+)\\]",ROe=new RegExp(Vqe,"g"),NE=`^(${Vqe})+$`,rf=new RegExp(NE);function U8(s){const e=[];if(rf.test(s)){let t=ROe.exec(s);for(;t?.length;){const i=t[1].trim();i&&e.push(i),t=ROe.exec(s)}}return Ya(e)}function zqe(s){return s.reduce((e,t)=>`${e}[${t}]`,"")}function $qe(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 l5=new Mgt;je.add(Pn.Configuration,l5);function Gqe(s,e){return s.trim()?rf.test(s)?g(477,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",s):l5.getConfigurationProperties()[s]!==void 0?g(478,"Cannot register '{0}'. This property is already registered.",s):e.policy?.name&&l5.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,l5.getPolicyConfigurations().get(e.policy?.name)):null:g(476,"Cannot register an empty property")}function Ngt(){const s=[],e=l5.getConfigurationProperties();for(const t of Object.keys(e))s.push([t,e[t].scope]);return s.push(["launch",ct.RESOURCE]),s.push(["task",ct.RESOURCE]),s}function Kqe(s){const e={};for(const t of s){const i=t.properties;if(In(i))for(const n in i)e[n]=i[n];t.allOf&&Object.assign(e,Kqe(t.allOf))}return e}function Pgt(s){switch(s){case"application":return ct.APPLICATION;case"machine":return ct.MACHINE;case"resource":return ct.RESOURCE;case"machine-overridable":return ct.MACHINE_OVERRIDABLE;case"language-overridable":return ct.LANGUAGE_OVERRIDABLE;default:return ct.WINDOW}}const Fgt={ModesRegistry:"editor.modesRegistry"};class Ogt{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 Wgt(this,a,c),closing:c}}),r=new Wj(a=>{const c=new Set,l=new Set;return{info:new Hgt(this,a,c,l),opening:c,openingColorized:l}});for(const[a,c]of i){const l=n.get(a),d=r.get(c);l.closing.add(d.info),d.opening.add(l.info)}const o=t.colorizedBracketPairs?MOe(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,c]of o){const l=n.get(a),d=r.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([...r.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 f6(t,e)}}function MOe(s){return s.filter(([e,t])=>e!==""&&t!=="")}class Qqe{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class Wgt extends Qqe{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Hgt extends Qqe{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 ihe{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const zs=ae("languageConfigurationService");let $pe=class extends V{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new $gt),this.onDidChangeEmitter=this._register(new I),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(Gpe));this._register(this.configurationService.onDidChangeConfiguration(n=>{const r=n.change.keys.some(a=>i.has(a)),o=n.change.overrides.filter(([a,c])=>c.some(l=>i.has(l))).map(([a])=>a);if(r)this.configurations.clear(),this.onDidChangeEmitter.fire(new ihe(void 0));else for(const a of o)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new ihe(a)))})),this._register(this._registry.onDidChange(n=>{this.configurations.delete(n.languageId),this.onDidChangeEmitter.fire(new ihe(n.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Ugt(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};$pe=D([_(0,Te),_(1,Di)],$pe);function Ugt(s,e,t,i){let n=e.getLanguageConfiguration(s);if(!n){if(!i.isRegisteredLanguageId(s))return new OO(s,{});n=new OO(s,{})}const r=Vgt(n.languageId,t),o=Yqe([n.underlyingConfig,r]);return new OO(n.languageId,o)}const Gpe={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Vgt(s,e){const t=e.getValue(Gpe.brackets,{overrideIdentifier:s}),i=e.getValue(Gpe.colorizedBracketPairs,{overrideIdentifier:s});return{brackets:NOe(t),colorizedBracketPairs:NOe(i)}}function NOe(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 jqe(s,e,t){const i=s.getLineContent(e);let n=hr(i);return n.length>t-1&&(n=n.substring(0,t-1)),n}class zgt{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new POe(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ee(()=>{for(let n=0;ne.configuration)))}}function Yqe(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 POe{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 FOe{constructor(e){this.languageId=e}}class $gt extends V{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.register(Sa,{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 zgt(e),this._entries.set(e,n));const r=n.register(t,i);return this._onDidChange.fire(new FOe(e)),Ee(()=>{r.dispose(),this._onDidChange.fire(new FOe(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}}class OO{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 rF(this.underlyingConfig):null,this.comments=OO._handleComments(this.underlyingConfig),this.characterPair=new Wpe(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||CTe,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new ygt(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Bgt(e,this.underlyingConfig)}getWordDefinition(){return j7(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new fgt(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new wgt(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new Gut(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,r]=t.blockComment;i.blockCommentStartToken=n,i.blockCommentEndToken=r}return i}}ce(zs,$pe,Qt.Delayed);class EE{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 OOe{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 EE(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Vn.MAX_SAFE_SMALL_INTEGER,this.m_modifiedStart=Vn.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 Kw{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,r,o]=Kw._getElements(e),[a,c,l]=Kw._getElements(t);this._hasStrings=o&&l,this._originalStringElements=n,this._originalElementsOrHash=r,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(Kw._isStringArray(t)){const i=new Int32Array(t.length);for(let n=0,r=t.length;n=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let h;return i<=n?(lP.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new EE(e,0,i,n-i+1)]):e<=t?(lP.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[new EE(e,t-e+1,i,0)]):(lP.Assert(e===t+1,"originalStart should only be one more than originalEnd"),lP.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const o=[0],a=[0],c=this.ComputeRecursionPoint(e,t,i,n,o,a,r),l=o[0],d=a[0];if(c!==null)return c;if(!r[0]){const h=this.ComputeDiffRecursive(e,l,i,d,r);let u=[];return r[0]?u=[new EE(l+1,t-(l+1)+1,d+1,n-(d+1)+1)]:u=this.ComputeDiffRecursive(l+1,t,d+1,n,r),this.ConcatenateChanges(h,u)}return[new EE(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b,w){let y=null,C=null,A=new BOe,L=t,k=i,P=f[0]-v[0]-n,R=Vn.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 EE(G,u-G+1,Y,m-Y+1)]}else{A=new BOe,L=o,k=a,P=f[0]-v[0]-c,R=Vn.MAX_SAFE_SMALL_INTEGER,z=b?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const G=P+r;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-r):(h=d[G-1],p=h-P-c,h>R&&A.MarkNextChange(),R=h,A.AddModifiedElement(h+1,p+1),P=G-1-r),z>=0&&(d=this.m_reverseHistory[z],r=d[0],L=1,k=d.length-1)}while(--z>=-1);C=A.getChanges()}return this.ConcatenateChanges(y,C)}ComputeRecursionPoint(e,t,i,n,r,o,a){let c=0,l=0,d=0,h=0,u=0,f=0;e--,i--,r[0]=0,o[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 r[0]=c,o[0]=l,j<=b[Y]&&IC.MaxDifferencesHistory>0&&P<=IC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,r,l,n,o,k,a):null}const G=(R-e+(z-i)-P)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(R,G))return a[0]=!0,r[0]=R,o[0]=z,G>0&&IC.MaxDifferencesHistory>0&&P<=IC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,r,l,n,o,k,a):(e++,i++,[new EE(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 r[0]=c,o[0]=l,j>=v[Y]&&IC.MaxDifferencesHistory>0&&P<=IC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,r,l,n,o,k,a):null}if(P<=IC.MaxDifferencesHistory){let Y=new Int32Array(h-d+2);Y[0]=w-d+1,dP.Copy2(v,d,Y,1,h-d+1),this.m_forwardHistory.push(Y),Y=new Int32Array(f-u+2),Y[0]=y-u+1,dP.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,r,l,n,o,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,r=0;if(t>0){const h=e[t-1];n=h.originalStart+h.originalLength,r=h.modifiedStart+h.modifiedLength}const o=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 r=0;r=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 r=this._OriginalRegionIsBoundary(e,t)?1:0,o=this._ModifiedRegionIsBoundary(i,n)?1:0;return r+o}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 dP.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],dP.Copy(t,1,n,e.length,t.length-1),n}else{const n=new Array(e.length+t.length);return dP.Copy(e,0,n,0,e.length),dP.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,i){if(lP.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),lP.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 r=e.originalLength;const o=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(r=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new EE(n,r,o,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=sP(e),t=sP(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const r=i.length-e;return t>=r&&(t=r),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=sP(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,r=0,o=0;for(;t<=i;)if(n=t+(i-t)/2|0,r=this.prefixSum[n],o=r-this.values[n],e=r)t=n+1;else break;return new Jqe(n,e-o)}}class qgt{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 Jqe(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=K7(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 r=0;r=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 d5;(function(s){s[s.False=0]="False",s[s.True=1]="True"})(d5||(d5={}));class cY{constructor(){this._actual=new IU(d5.False)}add(e){this._actual.set(e,d5.True)}has(e){return this._actual.get(e)===d5.True}clear(){return this._actual.clear()}}var Mi;(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"})(Mi||(Mi={}));class Qgt{constructor(e,t,i){const n=new Uint8Array(e*t);for(let r=0,o=e*t;rt&&(t=c),a>i&&(i=a),l>i&&(i=l)}t++,i++;const n=new Qgt(i,t,Mi.Invalid);for(let r=0,o=e.length;r=this._maxCharCode?Mi.Invalid:this._states.get(e,t)}}let nhe=null;function jgt(){return nhe===null&&(nhe=new Zqe([[Mi.Start,B.h,Mi.H],[Mi.Start,B.H,Mi.H],[Mi.Start,B.f,Mi.F],[Mi.Start,B.F,Mi.F],[Mi.H,B.t,Mi.HT],[Mi.H,B.T,Mi.HT],[Mi.HT,B.t,Mi.HTT],[Mi.HT,B.T,Mi.HTT],[Mi.HTT,B.p,Mi.HTTP],[Mi.HTT,B.P,Mi.HTTP],[Mi.HTTP,B.s,Mi.BeforeColon],[Mi.HTTP,B.S,Mi.BeforeColon],[Mi.HTTP,B.Colon,Mi.AfterColon],[Mi.F,B.i,Mi.FI],[Mi.F,B.I,Mi.FI],[Mi.FI,B.l,Mi.FIL],[Mi.FI,B.L,Mi.FIL],[Mi.FIL,B.e,Mi.BeforeColon],[Mi.FIL,B.E,Mi.BeforeColon],[Mi.BeforeColon,B.Colon,Mi.AfterColon],[Mi.AfterColon,B.Slash,Mi.AlmostThere],[Mi.AlmostThere,B.Slash,Mi.End]])),nhe}var Da;(function(s){s[s.None=0]="None",s[s.ForceTermination=1]="ForceTermination",s[s.CannotEndIn=2]="CannotEndIn"})(Da||(Da={}));let f4=null;function Ygt(){if(f4===null){f4=new IU(Da.None);const s=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;tn);if(n>0){const a=t.charCodeAt(n-1),c=t.charCodeAt(o);(a===B.OpenParen&&c===B.CloseParen||a===B.OpenSquareBracket&&c===B.CloseSquareBracket||a===B.OpenCurlyBrace&&c===B.CloseCurlyBrace)&&o--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:o+2},url:t.substring(n,o+1)}}static computeLinks(e,t=jgt()){const i=Ygt(),n=[];for(let r=1,o=e.getLineCount();r<=o;r++){const a=e.getLineContent(r),c=a.length;let l=0,d=0,h=0,u=Mi.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}};lse.INSTANCE=new lse;let Kpe=lse;var $o;(function(s){s[s.Regular=0]="Regular",s[s.Whitespace=1]="Whitespace",s[s.WordSeparator=2]="WordSeparator"})($o||($o={}));class Xgt extends IU{constructor(e,t){super($o.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.index0&&s.getLanguageId(o-1)===n;)o--;return new Kut(s,n,o,r+1,s.getStartOffset(o),s.getEndOffset(r))}class Kut{constructor(e,t,i,n,r,o){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=r,this._lastCharOffset=o,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 Hpe;(function(s){s[s.value=3]="value"})(Hpe||(Hpe={}));function nw(s){return(s&Hpe.value)!==0}function Rq(s){const e=s;return e?[e.on,e.pause,e.resume,e.destroy].every(t=>typeof t=="function"):!1}function jde(s){const e=s;return e?Rq(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}function eE(s,e){return new qut(s,e)}class qut{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 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 Qut(s,e){const t=[];let i;for(;(i=s.read())!==null;)t.push(i);return e(t)}function jut(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 r=n;return n=void 0,r}return s.read()}}}function VTe(s,e){return new Promise((t,i)=>{const n=[];NN(s,{onData:r=>{e&&n.push(r)},onError:r=>{e?i(r):t(void 0)},onEnd:()=>{t(e?e(n):void 0)}})})}function NN(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 Yut(s,e){return new Promise((t,i)=>{const n=new Z,r=[],o=l=>{if(r.push(l),r.length>e)return n.dispose(),s.pause(),t({stream:s,buffer:r,ended:!1})},a=l=>(n.dispose(),i(l)),c=()=>(n.dispose(),t({stream:s,buffer:r,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",o))),s.on("data",o)})}function Jut(s,e){const t=eE(e);return t.end(s),t}function Xut(s){let e=!1;return{read:()=>e?null:(e=!0,s)}}function Zut(s,e,t){const i=eE(t);return NN(s,{onData:n=>i.write(e.data(n)),onError:n=>i.error(e.error?e.error(n):n),onEnd:()=>i.end()}),i}const BG=typeof Buffer<"u",egt=new Ca(()=>new Uint8Array(256));let Yde,Jde;class Ge{static alloc(e){return BG?new Ge(Buffer.allocUnsafe(e)):new Ge(new Uint8Array(e))}static wrap(e){return BG&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new Ge(e)}static fromString(e,t){return!(t?.dontUseNodeBuffer||!1)&&BG?new Ge(Buffer.from(e)):(Yde||(Yde=new TextEncoder),new Ge(Yde.encode(e)))}static fromByteArray(e){const t=Ge.alloc(e.length);for(let i=0,n=e.length;i"u"){t=0;for(let r=0,o=e.length;rn-t)return-1;const r=egt.value;r.fill(e.length);for(let l=0;l>>0|s[e+1]<<8>>>0}function ngt(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function Lu(s,e){return s[e]*2**24+s[e+1]*2**16+s[e+2]*2**8+s[e+3]}function Ru(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 sgt(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0|s[e+2]<<16>>>0|s[e+3]<<24>>>0}function rgt(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 Upe(s,e){return s[e]}function Vpe(s,e,t){s[t]=e}function ogt(s){return Qut(s,e=>Ge.concat(e))}function Tqe(s){return Xut(s)}function oD(s){return VTe(s,e=>Ge.concat(e))}async function agt(s){return s.ended?Ge.concat(s.buffer):Ge.concat([...s.buffer,await oD(s.stream)])}function g6(s){return Jut(s,e=>Ge.concat(e))}function Lqe(s){return eE(e=>Ge.concat(e),s)}function Rqe(s){let e=0,t=0,i=0;const n=new Uint8Array(Math.floor(s.length/4*3)),r=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)r(c-65);else if(c>=97&&c<=122)r(c-97+26);else if(c>=48&&c<=57)r(c-48+52);else if(c===43||c===45)r(62);else if(c===47||c===95)r(63);else{if(c===61)break;throw new SyntaxError(`Unexpected base64 character ${s[a]}`)}}const o=i;for(;t>0;)r(0);return Ge.wrap(n).slice(0,o)}const cgt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lgt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function zTe({buffer:s},e=!0,t=!1){const i=t?lgt:cgt;let n="";const r=s.byteLength%3;let o=0;for(;o>>2],n+=i[(a<<4|c>>>4)&63],n+=i[(c<<2|l>>>6)&63],n+=i[l&63]}if(r===1){const a=s[o+0];n+=i[a>>>2],n+=i[a<<4&63],e&&(n+="==")}else if(r===2){const a=s[o+0],c=s[o+1];n+=i[a>>>2],n+=i[(a<<4|c>>>4)&63],n+=i[c<<2&63],e&&(n+="=")}return n}let Xde;function Mqe(){return Xde||(Xde=new TextDecoder("UTF-16LE")),Xde}let Zde;function dgt(){return Zde||(Zde=new TextDecoder("UTF-16BE")),Zde}let ehe;function Nqe(){return ehe||(ehe=mTe()?Mqe():dgt()),ehe}function hgt(s,e,t){const i=new Uint16Array(s.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?ugt(s,e,t):Mqe().decode(i)}function ugt(s,e,t){const i=[];let n=0;for(let r=0;r=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[o[0].toLowerCase(),o[1].toLowerCase()]);const t=[];for(let o=0;o{const[c,l]=o,[d,h]=a;return c===d||c===h||l===d||l===h},n=(o,a)=>{const c=Math.min(o,a),l=Math.max(o,a);for(let d=0;d0&&r.push({open:a,close:c})}return r}class fgt{constructor(e,t){this._richEditBracketsBrand=void 0;const i=ggt(t);this.brackets=i.map((n,r)=>new oY(e,r,n.open,n.close,pgt(n.open,n.close,i,r),mgt(n.open,n.close,i,r))),this.forwardRegex=_gt(this.brackets),this.reversedRegex=vgt(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const r of n.open)this.textIsBracket[r]=n,this.textIsOpenBracket[r]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,r.length);for(const r of n.close)this.textIsBracket[r]=n,this.textIsOpenBracket[r]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,r.length)}}}function Pqe(s,e,t,i){for(let n=0,r=e.length;n=0&&i.push(a);for(const a of o.close)a.indexOf(s)>=0&&i.push(a)}}function Fqe(s,e){return s.length-e.length}function rae(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 pgt(s,e,t,i){let n=[];n=n.concat(s),n=n.concat(e);for(let r=0,o=n.length;r=0;o--)n[r++]=i.charCodeAt(o);return Nqe().decode(n)}let e=null,t=null;return function(n){return e!==n&&(e=n,t=s(e)),t}}();class Hm{static _findPrevBracketInText(e,t,i,n){const r=i.match(e);if(!r)return null;const o=i.length-(r.index||0),a=r[0].length,c=n+o;return new F(t,c-a+1,t,c+1)}static findPrevBracketInRange(e,t,i,n,r){const a=$Te(i).substring(i.length-r,i.length-n);return this._findPrevBracketInText(e,t,a,n)}static findNextBracketInText(e,t,i,n){const r=i.match(e);if(!r)return null;const o=r.index||0,a=r[0].length;if(a===0)return null;const c=n+o;return new F(t,c+1,t,c+1+a)}static findNextBracketInRange(e,t,i,n,r){const o=i.substring(n,r);return this.findNextBracketInText(e,t,o,n)}}class wgt{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 Ya(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const n=t.findTokenIndexAtOffset(i-1);if(nw(t.getStandardTokenType(n)))return null;const r=this._richEditBrackets.reversedRegex,o=t.getLineContent().substring(0,i-1)+e,a=Hm.findPrevBracketInRange(r,1,o,0,o.length);if(!a)return null;const c=o.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 wb;(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"})(wb||(wb={}));function WG(s){return s.global&&(s.lastIndex=0),!0}class ygt{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&WG(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&WG(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&WG(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&WG(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=wb.INCREASE_MASK),this.shouldDecrease(e)&&(t+=wb.DECREASE_MASK),this.shouldIndentNextLine(e)&&(t+=wb.INDENT_NEXTLINE_MASK),this.shouldIgnore(e)&&(t+=wb.UNINDENT_MASK),t}}class rF{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=rF._createOpenBracketRegExp(t[0]),n=rF._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>=dl.Advanced)for(let r=0,o=this._regExpRules.length;rl.reg?(l.reg.lastIndex=0,l.reg.test(l.text)):!0))return a.action}if(e>=dl.Brackets&&i.length>0&&n.length>0)for(let r=0,o=this._brackets.length;r=dl.Brackets&&i.length>0){for(let r=0,o=this._brackets.length;r"u"?t:r}function Dgt(s){return s.replace(/[\[\]]/g,"")}function kgt(s){let e=!1;const t=new Map,i=new Map;if(Igt(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 r="$defs";for(;s.hasOwnProperty(r);)r+="_";const o=[];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=`_${o.length}`,o.push(f.schemas[0])),{$ref:`#/${r}/${f.id}`}}return u})}const c=a(s),l=[];for(let d=0;d{for(const l of c)cP(l)&&o.push(l)},i=(...c)=>{for(const l of c)if(cP(l))for(const d in l){const h=l[d];cP(h)&&o.push(h)}},n=(...c)=>{for(const l of c)if(Array.isArray(l))for(const d of l)cP(d)&&o.push(d)},r=c=>{if(Array.isArray(c))for(const l of c)cP(l)&&o.push(l);else cP(c)&&o.push(c)},o=[s];let a=o.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),r(a.items)),a=o.pop()}const tE={JSONContribution:"base.contributions.json"};function Tgt(s){return s.length>0&&s.charAt(s.length-1)==="#"?s.substring(0,s.length-1):s}class Lgt{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(e,t){this.schemasById[Tgt(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?kgt(t):void 0}hasSchemaContent(e){return!!this.schemasById[e]}}const Rgt=new Lgt;je.add(tE.JSONContribution,Rgt);var LOe;(function(s){s.Multiline="multilineText",s.Singleline="singlelineText"})(LOe||(LOe={}));const Pn={Configuration:"base.contributions.configuration"};var ct;(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"})(ct||(ct={}));const Tg={properties:{},patternProperties:{}},oV={properties:{},patternProperties:{}},oF={properties:{},patternProperties:{}},hS={properties:{},patternProperties:{}},uS={properties:{},patternProperties:{}},Yv={properties:{},patternProperties:{}},AE="vscode://schemas/settings/resourceLanguage",Uqe="vscode://schemas/settings/configurationDefaults",HG=je.as(tE.JSONContribution);class Mgt{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={},HG.registerSchema(AE,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),HG.registerSchema(AE,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(e){const t=new Set;this.doDeregisterConfigurations(e,t),HG.registerSchema(AE,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),HG.registerSchema(AE,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:r}of e)for(const o in n){t.add(o);const a=this.configurationDefaultsOverrides.get(o)??this.configurationDefaultsOverrides.set(o,{configurationDefaultOverrides:[]}).get(o),c=n[o];if(a.configurationDefaultOverrides.push({value:c,source:r}),rf.test(o)){const l=this.mergeDefaultConfigurationsForOverrideIdentifier(o,c,r,a.configurationDefaultOverrideValue);if(!l)continue;a.configurationDefaultOverrideValue=l,this.updateDefaultOverrideProperty(o,l,r),i.push(...U8(o))}else{const l=this.mergeDefaultConfigurationsForConfigurationProperty(o,c,r,a.configurationDefaultOverrideValue);if(!l)continue;a.configurationDefaultOverrideValue=l;const d=this.configurationProperties[o];d&&(this.updatePropertyDefaultValue(o,d),this.updateSchema(o,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 r in i){const o=this.configurationDefaultsOverrides.get(r);if(!o)continue;const a=o.configurationDefaultOverrides.findIndex(c=>n?c.source?.id===n.id:c.value===i[r]);if(a!==-1){if(o.configurationDefaultOverrides.splice(a,1),o.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(r),rf.test(r)){let c;for(const l of o.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForOverrideIdentifier(r,l.value,l.source,c);c&&!DA(c.value)?(o.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(r,c,n)):(this.configurationDefaultsOverrides.delete(r),delete this.configurationProperties[r],delete this.defaultLanguageConfigurationOverridesNode.properties[r])}else{let c;for(const d of o.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForConfigurationProperty(r,d.value,d.source,c);o.configurationDefaultOverrideValue=c;const l=this.configurationProperties[r];l&&(this.updatePropertyDefaultValue(r,l),this.updateSchema(r,l))}t.add(r)}}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.",Dgt(e)),$ref:AE,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=n,this.defaultLanguageConfigurationOverridesNode.properties[e]=n}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,n){const r=n?.value||{},o=n?.source??new Map;if(!(o instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const a of Object.keys(t)){const c=t[a];if(In(c)&&(Ja(r[a])||In(r[a]))){if(r[a]={...r[a]??{},...c},i)for(const d in c)o.set(`${a}.${d}`,i)}else r[a]=c,i?o.set(a,i):o.delete(a)}return{value:r,source:o}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,n){const r=this.configurationProperties[e],o=n?.value??r?.defaultDefaultValue;let a=i;if(In(t)&&(r!==void 0&&r.type==="object"||r===void 0&&(Ja(o)||In(o)))){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={...In(o)?o:{},...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 r in n.properties){t.add(r);const o=this.configurationProperties[r];o?.policy?.name&&this.policyConfigurations.delete(o.policy.name),delete this.configurationProperties[r],this.removeFromSchema(r,n.properties[r])}n.allOf?.forEach(r=>i(r))};for(const n of e){i(n);const r=this.configurationContributors.indexOf(n);r!==-1&&this.configurationContributors.splice(r,1)}}validateAndRegisterProperties(e,t=!0,i,n,r=ct.WINDOW,o){r=aa(e.scope)?r:e.scope;const a=e.properties;if(a)for(const l in a){const d=a[l];if(t&&Gqe(l,d)){delete a[l];continue}if(d.source=i,d.defaultDefaultValue=a[l].default,this.updatePropertyDefaultValue(l,d),rf.test(l)?d.scope=void 0:(d.scope=aa(d.scope)?r:d.scope,d.restricted=aa(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),o.add(l)}const c=e.allOf;if(c)for(const l of c)this.validateAndRegisterProperties(l,t,i,n,r,o)}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 o in n)this.updateSchema(o,n[o]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(Tg.properties[e]=t,t.scope){case ct.APPLICATION:oV.properties[e]=t;break;case ct.MACHINE:oF.properties[e]=t;break;case ct.MACHINE_OVERRIDABLE:hS.properties[e]=t;break;case ct.WINDOW:uS.properties[e]=t;break;case ct.RESOURCE:Yv.properties[e]=t;break;case ct.LANGUAGE_OVERRIDABLE:Yv.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete Tg.properties[e],t.scope){case ct.APPLICATION:delete oV.properties[e];break;case ct.MACHINE:delete oF.properties[e];break;case ct.MACHINE_OVERRIDABLE:delete hS.properties[e];break;case ct.WINDOW:delete uS.properties[e];break;case ct.RESOURCE:case ct.LANGUAGE_OVERRIDABLE:delete Yv.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:AE};this.updatePropertyDefaultValue(t,i),Tg.properties[t]=i,oV.properties[t]=i,oF.properties[t]=i,hS.properties[t]=i,uS.properties[t]=i,Yv.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:AE};Tg.patternProperties[NE]=e,oV.patternProperties[NE]=e,oF.patternProperties[NE]=e,hS.patternProperties[NE]=e,uS.patternProperties[NE]=e,Yv.patternProperties[NE]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;let n,r;i&&(!t.disallowConfigurationDefault||!i.source)&&(n=i.value,r=i.source),Ja(n)&&(n=t.defaultDefaultValue,r=void 0),Ja(n)&&(n=$qe(t.type)),t.default=n,t.defaultValueSource=r}}const Vqe="\\[([^\\]]+)\\]",ROe=new RegExp(Vqe,"g"),NE=`^(${Vqe})+$`,rf=new RegExp(NE);function U8(s){const e=[];if(rf.test(s)){let t=ROe.exec(s);for(;t?.length;){const i=t[1].trim();i&&e.push(i),t=ROe.exec(s)}}return Ya(e)}function zqe(s){return s.reduce((e,t)=>`${e}[${t}]`,"")}function $qe(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 l5=new Mgt;je.add(Pn.Configuration,l5);function Gqe(s,e){return s.trim()?rf.test(s)?g(477,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",s):l5.getConfigurationProperties()[s]!==void 0?g(478,"Cannot register '{0}'. This property is already registered.",s):e.policy?.name&&l5.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,l5.getPolicyConfigurations().get(e.policy?.name)):null:g(476,"Cannot register an empty property")}function Ngt(){const s=[],e=l5.getConfigurationProperties();for(const t of Object.keys(e))s.push([t,e[t].scope]);return s.push(["launch",ct.RESOURCE]),s.push(["task",ct.RESOURCE]),s}function Kqe(s){const e={};for(const t of s){const i=t.properties;if(In(i))for(const n in i)e[n]=i[n];t.allOf&&Object.assign(e,Kqe(t.allOf))}return e}function Pgt(s){switch(s){case"application":return ct.APPLICATION;case"machine":return ct.MACHINE;case"resource":return ct.RESOURCE;case"machine-overridable":return ct.MACHINE_OVERRIDABLE;case"language-overridable":return ct.LANGUAGE_OVERRIDABLE;default:return ct.WINDOW}}const Fgt={ModesRegistry:"editor.modesRegistry"};class Ogt{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 Wgt(this,a,c),closing:c}}),r=new Wj(a=>{const c=new Set,l=new Set;return{info:new Hgt(this,a,c,l),opening:c,openingColorized:l}});for(const[a,c]of i){const l=n.get(a),d=r.get(c);l.closing.add(d.info),d.opening.add(l.info)}const o=t.colorizedBracketPairs?MOe(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,c]of o){const l=n.get(a),d=r.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([...r.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 f6(t,e)}}function MOe(s){return s.filter(([e,t])=>e!==""&&t!=="")}class Qqe{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class Wgt extends Qqe{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Hgt extends Qqe{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 ihe{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const zs=ae("languageConfigurationService");let $pe=class extends V{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new $gt),this.onDidChangeEmitter=this._register(new I),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(Gpe));this._register(this.configurationService.onDidChangeConfiguration(n=>{const r=n.change.keys.some(a=>i.has(a)),o=n.change.overrides.filter(([a,c])=>c.some(l=>i.has(l))).map(([a])=>a);if(r)this.configurations.clear(),this.onDidChangeEmitter.fire(new ihe(void 0));else for(const a of o)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new ihe(a)))})),this._register(this._registry.onDidChange(n=>{this.configurations.delete(n.languageId),this.onDidChangeEmitter.fire(new ihe(n.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Ugt(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};$pe=D([_(0,Te),_(1,Di)],$pe);function Ugt(s,e,t,i){let n=e.getLanguageConfiguration(s);if(!n){if(!i.isRegisteredLanguageId(s))return new OO(s,{});n=new OO(s,{})}const r=Vgt(n.languageId,t),o=Yqe([n.underlyingConfig,r]);return new OO(n.languageId,o)}const Gpe={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Vgt(s,e){const t=e.getValue(Gpe.brackets,{overrideIdentifier:s}),i=e.getValue(Gpe.colorizedBracketPairs,{overrideIdentifier:s});return{brackets:NOe(t),colorizedBracketPairs:NOe(i)}}function NOe(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 jqe(s,e,t){const i=s.getLineContent(e);let n=hr(i);return n.length>t-1&&(n=n.substring(0,t-1)),n}class zgt{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new POe(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ee(()=>{for(let n=0;ne.configuration)))}}function Yqe(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 POe{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 FOe{constructor(e){this.languageId=e}}class $gt extends V{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.register(Sa,{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 zgt(e),this._entries.set(e,n));const r=n.register(t,i);return this._onDidChange.fire(new FOe(e)),Ee(()=>{r.dispose(),this._onDidChange.fire(new FOe(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}}class OO{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 rF(this.underlyingConfig):null,this.comments=OO._handleComments(this.underlyingConfig),this.characterPair=new Wpe(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||CTe,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new ygt(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Bgt(e,this.underlyingConfig)}getWordDefinition(){return j7(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new fgt(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new wgt(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new Gut(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,r]=t.blockComment;i.blockCommentStartToken=n,i.blockCommentEndToken=r}return i}}ce(zs,$pe,Qt.Delayed);class EE{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 OOe{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 EE(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Vn.MAX_SAFE_SMALL_INTEGER,this.m_modifiedStart=Vn.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 Kw{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,r,o]=Kw._getElements(e),[a,c,l]=Kw._getElements(t);this._hasStrings=o&&l,this._originalStringElements=n,this._originalElementsOrHash=r,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(Kw._isStringArray(t)){const i=new Int32Array(t.length);for(let n=0,r=t.length;n=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let h;return i<=n?(lP.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new EE(e,0,i,n-i+1)]):e<=t?(lP.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[new EE(e,t-e+1,i,0)]):(lP.Assert(e===t+1,"originalStart should only be one more than originalEnd"),lP.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const o=[0],a=[0],c=this.ComputeRecursionPoint(e,t,i,n,o,a,r),l=o[0],d=a[0];if(c!==null)return c;if(!r[0]){const h=this.ComputeDiffRecursive(e,l,i,d,r);let u=[];return r[0]?u=[new EE(l+1,t-(l+1)+1,d+1,n-(d+1)+1)]:u=this.ComputeDiffRecursive(l+1,t,d+1,n,r),this.ConcatenateChanges(h,u)}return[new EE(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b,w){let y=null,C=null,A=new BOe,L=t,k=i,P=f[0]-v[0]-n,R=Vn.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 EE(G,u-G+1,Y,m-Y+1)]}else{A=new BOe,L=o,k=a,P=f[0]-v[0]-c,R=Vn.MAX_SAFE_SMALL_INTEGER,z=b?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const G=P+r;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-r):(h=d[G-1],p=h-P-c,h>R&&A.MarkNextChange(),R=h,A.AddModifiedElement(h+1,p+1),P=G-1-r),z>=0&&(d=this.m_reverseHistory[z],r=d[0],L=1,k=d.length-1)}while(--z>=-1);C=A.getChanges()}return this.ConcatenateChanges(y,C)}ComputeRecursionPoint(e,t,i,n,r,o,a){let c=0,l=0,d=0,h=0,u=0,f=0;e--,i--,r[0]=0,o[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 r[0]=c,o[0]=l,j<=b[Y]&&IC.MaxDifferencesHistory>0&&P<=IC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,r,l,n,o,k,a):null}const G=(R-e+(z-i)-P)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(R,G))return a[0]=!0,r[0]=R,o[0]=z,G>0&&IC.MaxDifferencesHistory>0&&P<=IC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,r,l,n,o,k,a):(e++,i++,[new EE(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 r[0]=c,o[0]=l,j>=v[Y]&&IC.MaxDifferencesHistory>0&&P<=IC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,r,l,n,o,k,a):null}if(P<=IC.MaxDifferencesHistory){let Y=new Int32Array(h-d+2);Y[0]=w-d+1,dP.Copy2(v,d,Y,1,h-d+1),this.m_forwardHistory.push(Y),Y=new Int32Array(f-u+2),Y[0]=y-u+1,dP.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,r,l,n,o,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,r=0;if(t>0){const h=e[t-1];n=h.originalStart+h.originalLength,r=h.modifiedStart+h.modifiedLength}const o=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 r=0;r=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 r=this._OriginalRegionIsBoundary(e,t)?1:0,o=this._ModifiedRegionIsBoundary(i,n)?1:0;return r+o}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 dP.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],dP.Copy(t,1,n,e.length,t.length-1),n}else{const n=new Array(e.length+t.length);return dP.Copy(e,0,n,0,e.length),dP.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,i){if(lP.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),lP.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 r=e.originalLength;const o=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(r=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new EE(n,r,o,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=sP(e),t=sP(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const r=i.length-e;return t>=r&&(t=r),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=sP(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,r=0,o=0;for(;t<=i;)if(n=t+(i-t)/2|0,r=this.prefixSum[n],o=r-this.values[n],e=r)t=n+1;else break;return new Jqe(n,e-o)}}class qgt{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 Jqe(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=K7(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 r=0;r=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 d5;(function(s){s[s.False=0]="False",s[s.True=1]="True"})(d5||(d5={}));class cY{constructor(){this._actual=new IU(d5.False)}add(e){this._actual.set(e,d5.True)}has(e){return this._actual.get(e)===d5.True}clear(){return this._actual.clear()}}var Mi;(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"})(Mi||(Mi={}));class Qgt{constructor(e,t,i){const n=new Uint8Array(e*t);for(let r=0,o=e*t;rt&&(t=c),a>i&&(i=a),l>i&&(i=l)}t++,i++;const n=new Qgt(i,t,Mi.Invalid);for(let r=0,o=e.length;r=this._maxCharCode?Mi.Invalid:this._states.get(e,t)}}let nhe=null;function jgt(){return nhe===null&&(nhe=new Zqe([[Mi.Start,B.h,Mi.H],[Mi.Start,B.H,Mi.H],[Mi.Start,B.f,Mi.F],[Mi.Start,B.F,Mi.F],[Mi.H,B.t,Mi.HT],[Mi.H,B.T,Mi.HT],[Mi.HT,B.t,Mi.HTT],[Mi.HT,B.T,Mi.HTT],[Mi.HTT,B.p,Mi.HTTP],[Mi.HTT,B.P,Mi.HTTP],[Mi.HTTP,B.s,Mi.BeforeColon],[Mi.HTTP,B.S,Mi.BeforeColon],[Mi.HTTP,B.Colon,Mi.AfterColon],[Mi.F,B.i,Mi.FI],[Mi.F,B.I,Mi.FI],[Mi.FI,B.l,Mi.FIL],[Mi.FI,B.L,Mi.FIL],[Mi.FIL,B.e,Mi.BeforeColon],[Mi.FIL,B.E,Mi.BeforeColon],[Mi.BeforeColon,B.Colon,Mi.AfterColon],[Mi.AfterColon,B.Slash,Mi.AlmostThere],[Mi.AlmostThere,B.Slash,Mi.End]])),nhe}var Da;(function(s){s[s.None=0]="None",s[s.ForceTermination=1]="ForceTermination",s[s.CannotEndIn=2]="CannotEndIn"})(Da||(Da={}));let f4=null;function Ygt(){if(f4===null){f4=new IU(Da.None);const s=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;tn);if(n>0){const a=t.charCodeAt(n-1),c=t.charCodeAt(o);(a===B.OpenParen&&c===B.CloseParen||a===B.OpenSquareBracket&&c===B.CloseSquareBracket||a===B.OpenCurlyBrace&&c===B.CloseCurlyBrace)&&o--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:o+2},url:t.substring(n,o+1)}}static computeLinks(e,t=jgt()){const i=Ygt(),n=[];for(let r=1,o=e.getLineCount();r<=o;r++){const a=e.getLineContent(r),c=a.length;let l=0,d=0,h=0,u=Mi.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}};lse.INSTANCE=new lse;let Kpe=lse;var $o;(function(s){s[s.Regular=0]="Regular",s[s.Whitespace=1]="Whitespace",s[s.WordSeparator=2]="WordSeparator"})($o||($o={}));class Xgt extends IU{constructor(e,t){super($o.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=fKe(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 eft(t,this.wordSeparators?_m(this.wordSeparators,[]):null,i?this.searchString:null)}}function eQe(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 z0(s,e,t){if(!t)return new $8(s,null);const i=[];for(let n=0,r=e.length;n>0);t[r]>=e?n=r-1:t[r+1]>=e?(i=r,n=r):i=r+1}return i+1}}class UG{static findMatches(e,t,i,n,r){const o=t.parseSearchRequest();return o?o.regex.multiline?this._doFindMatchesMultiline(e,i,new aF(o.wordSeparators,o.regex),n,r):this._doFindMatchesLineByLine(e,i,o,n,r):[]}static _getMultilineMatchRange(e,t,i,n,r,o){let a,c=0;n?(c=n.findLineFeedCountBeforeOffset(r),a=t+r+c):a=t+r;let l;if(n){const f=n.findLineFeedCountBeforeOffset(r+o.length)-c;l=a+o.length+f}else l=a+o.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,r){const o=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,gr.LF),c=e.getEOL()===`\r `?new HOe(a):null,l=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(l[d++]=z0(this._getMultilineMatchRange(e,o,a,c,h.index,h[0]),h,n),d>=r)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,r){const o=[];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,o,n,r),o}const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,o,n,r);for(let l=t.startLineNumber+1;l=c))return r;return r}const d=new aF(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(o[r++]=z0(new F(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),r>=c))return r;while(h);return r}static findNextMatch(e,t,i,n){const r=t.parseSearchRequest();if(!r)return null;const o=new aF(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindNextMatchMultiline(e,i,o,n):this._doFindNextMatchLineByLine(e,i,o,n)}static _doFindNextMatchMultiline(e,t,i,n){const r=new re(t.lineNumber,1),o=e.getOffsetAt(r),a=e.getLineCount(),c=e.getValueInRange(new F(r.lineNumber,r.column,a,e.getLineMaxColumn(a)),gr.LF),l=e.getEOL()===`\r `?new HOe(c):null;i.reset(t.column-1);const d=i.next(c);return d?z0(this._getMultilineMatchRange(e,o,c,l,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new re(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const r=e.getLineCount(),o=t.lineNumber,a=e.getLineContent(o),c=this._findFirstMatchInLine(i,a,o,t.column,n);if(c)return c;for(let l=1;l<=r;l++){const d=(o+l-1)%r,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,r){e.reset(n-1);const o=e.next(t);return o?z0(new F(i,o.index+1,i,o.index+1+o[0].length),o,r):null}static findPreviousMatch(e,t,i,n){const r=t.parseSearchRequest();if(!r)return null;const o=new aF(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindPreviousMatchMultiline(e,i,o,n):this._doFindPreviousMatchLineByLine(e,i,o,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const r=this._doFindMatchesMultiline(e,new F(1,1,t.lineNumber,t.column),i,n,10*ift);if(r.length>0)return r[r.length-1];const o=e.getLineCount();return t.lineNumber!==o||t.column!==e.getLineMaxColumn(o)?this._doFindPreviousMatchMultiline(e,new re(o,e.getLineMaxColumn(o)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const r=e.getLineCount(),o=t.lineNumber,a=e.getLineContent(o).substring(0,t.column-1),c=this._findLastMatchInLine(i,a,o,n);if(c)return c;for(let l=1;l<=r;l++){const d=(r+o-l-1)%r,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 r=null,o;for(e.reset(0);o=e.next(t);)r=z0(new F(i,o.index+1,i,o.index+1+o[0].length),o,n);return r}}function nft(s,e,t,i,n){if(i===0)return!0;const r=e.charCodeAt(i-1);if(s.get(r)!==$o.Regular||r===B.CarriageReturn||r===B.LineFeed)return!0;if(n>0){const o=e.charCodeAt(i);if(s.get(o)!==$o.Regular)return!0}return!1}function sft(s,e,t,i,n){if(i+n===t)return!0;const r=e.charCodeAt(i+n);if(s.get(r)!==$o.Regular||r===B.CarriageReturn||r===B.LineFeed)return!0;if(n>0){const o=e.charCodeAt(i+n-1);if(s.get(o)!==$o.Regular)return!0}return!1}function GTe(s,e,t,i,n){return nft(s,e,t,i,n)&&sft(s,e,t,i,n)}class aF{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,r=i[0].length;if(n===this._prevMatchStartIndex&&r===this._prevMatchLength){if(r===0){Uj(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=r,!this._wordSeparators||GTe(this._wordSeparators,e,t,n,r))return i}while(i);return null}}class KTe{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,r=i?i.endLineNumber:e.getLineCount(),o=new UOe(t),a=o.getCandidateCodePoints();let c;a==="allNonBasicAscii"?c=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):c=new RegExp(`${rft(Array.from(a))}`,"g");const l=new aF(null,c),d=[];let h=!1,u,f=0,p=0,m=0;e:for(let v=n,b=r;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);Fc(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 UOe(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case Mu.None:return null;case Mu.Invisible:return{kind:A_.Invisible};case Mu.Ambiguous:{const r=e.codePointAt(0),o=i.ambiguousCharacters.getPrimaryConfusable(r),a=y8.getLocales().filter(c=>!y8.getInstance(new Set([...t.allowedLocales,c])).isAmbiguous(r));return{kind:A_.Ambiguous,confusableWith:String.fromCodePoint(o),notAmbiguousInLocales:a}}case Mu.NonBasicASCII:return{kind:A_.NonBasicAscii}}}}function rft(s,e){return`[${Nh(s.map(i=>String.fromCodePoint(i)).join(""))}]`}var A_;(function(s){s[s.Ambiguous=0]="Ambiguous",s[s.Invisible=1]="Invisible",s[s.NonBasicAscii=2]="NonBasicAscii"})(A_||(A_={}));class UOe{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=y8.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of yT.codePoints)VOe(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 Mu.None;if(this.options.nonBasicASCII)return Mu.NonBasicASCII;let n=!1,r=!1;if(t)for(const o of t){const a=o.codePointAt(0),c=X7(o);n=n||c,!c&&!this.ambiguousCharacters.isAmbiguous(a)&&!yT.isInvisibleCharacter(a)&&(r=!0)}return!n&&r?Mu.None:this.options.invisibleCharacters&&!VOe(e)&&yT.isInvisibleCharacter(i)?Mu.Invisible:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?Mu.Ambiguous:Mu.None}}function VOe(s){return s===" "||s===` @@ -43,11 +43,11 @@ Received: '{1}'.`,e,c4.getLexeme(t)),r=t.offset,o=c4.getLexeme(t);return this._p `&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}getOffsetRange(e){return new _i(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){const t=x2(this.lineStartOffsetByLineIdx,r=>r<=e),i=t+1,n=e-this.lineStartOffsetByLineIdx[t]+1;return new re(i,n)}getRange(e){return F.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return ng.ofRange(this.getRange(e))}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new ng(e,this.text.length-this.lineStartOffsetByLineIdx[e])}}let G2=class Pq{static single(e,t){return new Pq([new lu(e,t)])}constructor(e){this.edits=e,Q_(()=>DU(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 lu(i.range.plusRange(t.range),i.text+t.text)}else t.isEmpty||e.push(t);return new Pq(e)}mapPosition(e){let t=0,i=0,n=0;for(const r of this.edits){const o=r.range.getStartPosition(),a=r.range.getEndPosition();if(e.isBeforeOrEqual(o))break;const c=ng.ofText(r.text);if(e.isBefore(a)){const l=new re(o.lineNumber+t,o.column+(o.lineNumber+t===i?n:0)),d=c.addToPosition(l);return VG(l,d)}t+=c.lineCount-(r.range.endLineNumber-r.range.startLineNumber),c.lineCount===0?a.lineNumber!==o.lineNumber?n+=c.columnCount-(a.column-1):n+=c.columnCount-(a.column-o.column):n=c.columnCount,i=a.lineNumber+t}return new re(e.lineNumber+t,e.column+(e.lineNumber+t===i?n:0))}mapRange(e){function t(o){return o instanceof re?o:o.getStartPosition()}function i(o){return o instanceof re?o:o.getEndPosition()}const n=t(this.mapPosition(e.getStartPosition())),r=i(this.mapPosition(e.getEndPosition()));return VG(n,r)}inverseMapPosition(e,t){return this.inverse(t).mapPosition(e)}inverseMapRange(e,t){return this.inverse(t).mapRange(e)}apply(e){let t="",i=new re(1,1);for(const r of this.edits){const o=r.range,a=o.getStartPosition(),c=o.getEndPosition(),l=VG(i,a);l.isEmpty()||(t+=e.getValueOfRange(l)),t+=r.text,i=c}const n=VG(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new aft(e);return this.apply(t)}inverse(e){const t=this.getNewRanges();return new Pq(this.edits.map((i,n)=>new lu(t[n],e.getValueOfRange(i.range))))}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const r of this.edits){const o=ng.ofText(r.text),a=re.lift({lineNumber:r.range.startLineNumber+i,column:r.range.startColumn+(r.range.startLineNumber===t?n:0)}),c=o.createRange(a);e.push(c),i=c.endLineNumber-r.range.endLineNumber,n=c.endColumn-r.range.endColumn,t=r.range.endLineNumber}return e}};class lu{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 VG(s,e){if(s.lineNumber===e.lineNumber&&s.column===Number.MAX_SAFE_INTEGER)return F.fromPositions(e,e);if(!s.isBeforeOrEqual(e))throw new Pi("start must be before end");return new F(s.lineNumber,s.column,e.lineNumber,e.column)}class tQe{get endPositionExclusive(){return this.length.addToPosition(new re(1,1))}getValue(){return this.getValueOfRange(this.length.toRange())}}class aft extends tQe{constructor(e){super(),this.value=e,this._t=new oft(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}let N_=class FP{static inverse(e,t,i){const n=[];let r=1,o=1;for(const c of e){const l=new FP(new mi(r,c.original.startLineNumber),new mi(o,c.modified.startLineNumber));l.modified.isEmpty||n.push(l),r=c.original.endLineNumberExclusive,o=c.modified.endLineNumberExclusive}const a=new FP(new mi(r,t+1),new mi(o,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){const n=[];for(const r of e){const o=r.original.intersect(t),a=r.modified.intersect(i);o&&!o.isEmpty&&a&&!a.isEmpty&&n.push(new FP(o,a))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new FP(this.modified,this.original)}join(e){return new FP(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 Qp(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Pi("not a valid diff");return new Qp(new F(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new F(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Qp(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(zOe(this.original.endLineNumberExclusive,e)&&zOe(this.modified.endLineNumberExclusive,t))return new Qp(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 Qp(F.fromPositions(new re(this.original.startLineNumber,1),hP(new re(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),F.fromPositions(new re(this.modified.startLineNumber,1),hP(new re(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Qp(F.fromPositions(hP(new re(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),hP(new re(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),F.fromPositions(hP(new re(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),hP(new re(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new Pi}};function hP(s,e){if(s.lineNumber<1)return new re(1,1);if(s.lineNumber>e.length)return new re(e.length,e[e.length-1].length+1);const t=e[s.lineNumber-1];return s.column>t.length+1?new re(s.lineNumber,t.length+1):s}function zOe(s,e){return s>=1&&s<=e.length}let Y_=class Fq extends N_{static fromRangeMappings(e){const t=mi.join(e.map(n=>mi.fromRangeInclusive(n.originalRange))),i=mi.join(e.map(n=>mi.fromRangeInclusive(n.modifiedRange)));return new Fq(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new Fq(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new Fq(this.original,this.modified,[this.toRangeMapping()])}},Qp=class iQe{static assertSorted(e){for(let t=1;t${this.modifiedRange.toString()}}`}flip(){return new iQe(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new lu(this.originalRange,t)}};const cft=3;class lft{computeDiff(e,t,i){const r=new sQe(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),o=[];let a=null;for(const c of r.changes){let l;c.originalEndLineNumber===0?l=new mi(c.originalStartLineNumber+1,c.originalStartLineNumber+1):l=new mi(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new mi(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new mi(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new Y_(l,d,c.charChanges?.map(u=>new Qp(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 Y_(a.original.join(h.original),a.modified.join(h.modified),a.innerChanges&&h.innerChanges?a.innerChanges.concat(h.innerChanges):void 0),o.pop()),o.push(h),a=h}return Q_(()=>DU(o,(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 BO{constructor(e,t,i,n,r,o,a,c){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=r,this.modifiedStartColumn=o,this.modifiedEndLineNumber=a,this.modifiedEndColumn=c}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),r=t.getStartColumn(e.originalStart),o=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 BO(n,r,o,a,c,l,d,h)}}function hft(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&&r()){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=nQe(f,p,r,!0).changes;a&&(m=hft(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,r+1,1,p,o+1,1,m)}{let p=Qpe(u,1),m=Qpe(f,1);const v=u.length+1,b=f.length+1;for(;p!0;const e=Date.now();return()=>Date.now()-e{i.push(Mc.fromOffsetPairs(n?n.getEndExclusives():DS.zero,r?r.getStarts():new DS(t,(n?n.seq2Range.endExclusive-n.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new Mc(new _i(e.offset1,t.offset1),new _i(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 Pi("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Mc(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Mc(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Mc(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Mc(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Mc(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 Mc(t,i)}getStarts(){return new DS(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new DS(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const w1=class w1{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new w1(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};w1.zero=new w1(0,0),w1.max=new w1(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let DS=w1;const dse=class dse{isValid(){return!0}};dse.instance=new dse;let G8=dse;class uft{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Pi("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime!0,this.valid=!0}}class rhe{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 jpe(s){return s===B.Space||s===B.Tab}const zz=class zz{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 r=e.startLineNumber-1;r0&&m>0&&o.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),o.set(p,m,3)}else y===v?(a.set(p,m,0),o.set(p,m,1)):y===b&&(a.set(p,m,0),o.set(p,m,2));r.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 Mc(new _i(p+1,l),new _i(m+1,d))),l=p,d=m}let u=e.length-1,f=t.length-1;for(;u>=0&&f>=0;)o.get(u,f)===3?(h(u,f),u--,f--):o.get(u,f)===1?u--:f--;return h(-1,-1),c.reverse(),new iA(c,!1)}}class rQe{compute(e,t,i=G8.instance){if(e.length===0||t.length===0)return iA.trivial(e,t);const n=e,r=t;function o(m,v){for(;mn.length||C>r.length)continue;const A=o(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 KOe(L,y,C,A-y):L),c.get(d)===n.length&&c.get(d)-d===r.length)break e}}let h=l.get(d);const u=[];let f=n.length,p=r.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 Mc(new _i(m,f),new _i(v,p))),!h)break;f=h.x,p=h.y,h=h.prev}return u.reverse(),new iA(u,!1)}}class KOe{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class fft{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 pft{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 hY{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 r=e[n-1],o=0;n===this.range.startLineNumber&&this.range.startColumn>1&&(o=this.range.startColumn-1,r=r.substring(o)),this.lineStartOffsets.push(o);let a=0;if(!i){const l=r.trimStart();a=r.length-l.length,r=l.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);const c=n===this.range.endLineNumber?Math.min(this.range.endColumn-1-o-a,r.length):r.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=QOe(e>0?this.elements[e-1]:-1),i=QOe(er<=e),n=e-this.firstElementOffsetByLineIdx[i];return new re(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||!ohe(this.elements[e]))return;let t=e;for(;t>0&&ohe(this.elements[t-1]);)t--;let i=e;for(;in<=e.start)??0,i=Aat(this.firstElementOffsetByLineIdx,n=>e.endExclusive<=n)??this.elements.length;return new _i(t,i)}}function ohe(s){return s>=B.a&&s<=B.z||s>=B.A&&s<=B.Z||s>=B.Digit0&&s<=B.Digit9}var cc;(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"})(cc||(cc={}));const mft={[cc.WordLower]:0,[cc.WordUpper]:0,[cc.WordNumber]:0,[cc.End]:10,[cc.Other]:2,[cc.Separator]:30,[cc.Space]:3,[cc.LineBreakCR]:10,[cc.LineBreakLF]:10};function qOe(s){return mft[s]}function QOe(s){return s===B.LineFeed?cc.LineBreakLF:s===B.CarriageReturn?cc.LineBreakCR:jpe(s)?cc.Space:s>=B.a&&s<=B.z?cc.WordLower:s>=B.A&&s<=B.Z?cc.WordUpper:s>=B.Digit0&&s<=B.Digit9?cc.WordNumber:s===-1?cc.End:s===B.Comma||s===B.Semicolon?cc.Separator:cc.Other}function _ft(s,e,t,i,n,r){let{moves:o,excludedChanges:a}=bft(s,e,t,r);if(!r.isValid())return[];const c=s.filter(d=>!a.has(d)),l=wft(c,i,n,e,t,r);return dfe(o,l),o=yft(o),o=o.filter(d=>{const h=d.original.toOffsetRange().slice(e).map(f=>f.trim());return h.join(` `).length>=15&&vft(h,f=>f.length>=2)>=2}),o=Cft(s,o),o}function vft(s,e){let t=0;for(const i of s)e(i)&&t++;return t}function bft(s,e,t,i){const n=[],r=s.filter(c=>c.modified.isEmpty&&c.original.length>=3).map(c=>new dY(c.original,e,c)),o=new Set(s.filter(c=>c.original.isEmpty&&c.modified.length>=3).map(c=>new dY(c.modified,t,c))),a=new Set;for(const c of r){let l=-1,d;for(const h of o){const u=c.computeSimilarity(h);u>l&&(l=u,d=h)}if(l>.9&&d&&(o.delete(d),n.push(new N_(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 wft(s,e,t,i,n,r){const o=[],a=new q7;for(const u of s)for(let f=u.original.startLineNumber;fu.modified.startLineNumber,ru));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 mi(C.originalLineRange.startLineNumber,w.endLineNumberExclusive),C.modifiedLineRange=new mi(C.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),b.push(C);return}const y={modifiedLineRange:v,originalLineRange:w};c.push(y),b.push(y)}),f=b}if(!r.isValid())return[]}c.sort(GGe(Sc(u=>u.modifiedLineRange.length,ru)));const l=new Xp,d=new Xp;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);o.push(new N_(y,w)),l.addRange(w),d.addRange(y)}}o.sort(Sc(u=>u.original.startLineNumber,ru));const h=new Lj(s);for(let u=0;uL.original.startLineNumber<=f.original.startLineNumber),m=E2(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)||!jOe(i[L-1],n[k-1],r))break}C>0&&(d.addRange(new mi(f.original.startLineNumber-C,f.original.startLineNumber)),l.addRange(new mi(f.modified.startLineNumber-C,f.modified.startLineNumber)));let A;for(A=0;Ai.length||k>n.length||l.contains(k)||d.contains(L)||!jOe(i[L-1],n[k-1],r))break}A>0&&(d.addRange(new mi(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+A)),l.addRange(new mi(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+A))),(C>0||A>0)&&(o[u]=new N_(new mi(f.original.startLineNumber-C,f.original.endLineNumberExclusive+A),new mi(f.modified.startLineNumber-C,f.modified.endLineNumberExclusive+A)))}return o}function jOe(s,e,t){if(s.trim()===e.trim())return!0;if(s.length>300&&e.length>300)return!1;const n=new rQe().compute(new hY([s],new F(1,1,1,s.length),!1),new hY([e],new F(1,1,1,e.length),!1),t);let r=0;const o=Mc.invert(n.diffs,s.length);for(const d of o)d.seq1Range.forEach(h=>{jpe(s.charCodeAt(h))||r++});function a(d){let h=0;for(let u=0;ue.length?s:e);return r/c>.6&&c>10}function yft(s){if(s.length===0)return s;s.sort(Sc(t=>t.original.startLineNumber,ru));const e=[s[0]];for(let t=1;t=0&&o>=0&&r+o<=2){e[e.length-1]=i.join(n);continue}e.push(n)}return e}function Cft(s,e){const t=new Lj(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 Sft(s,e,t){if(!s.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,r=t[i],o=i+1=i.start&&s.seq2Range.start-o>=n.start&&t.isStronglyEqual(s.seq2Range.start-o,s.seq2Range.endExclusive-o)&&o<100;)o++;o--;let a=0;for(;s.seq1Range.start+al&&(l=p,c=d)}return s.delta(c)}function Aft(s,e,t){const i=[];for(const n of t){const r=i[i.length-1];if(!r){i.push(n);continue}n.seq1Range.start-r.seq1Range.endExclusive<=2||n.seq2Range.start-r.seq2Range.endExclusive<=2?i[i.length-1]=new Mc(r.seq1Range.join(n.seq1Range),r.seq2Range.join(n.seq2Range)):i.push(n)}return i}function Eft(s,e,t){const i=Mc.invert(t,s.length),n=[];let r=new DS(0,0);function o(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 Mc(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),r=u.getEndExclusives()}for(;i.length>0;){const c=i.shift();c.seq1Range.isEmpty||(o(c.getStarts(),c),o(c.getEndExclusives().delta(-1),c))}return xft(t,n)}function xft(s,e){const t=[];for(;s.length>0||e.length>0;){const i=s[0],n=e[0];let r;i&&(!n||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=r.seq1Range.start?t[t.length-1]=t[t.length-1].join(r):t.push(r)}return t}function Dft(s,e,t){let i=t;if(i.length===0)return i;let n=0,r;do{r=!1;const o=[i[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const c=i[a],l=o[o.length-1];d(l,c)?(r=!0,o[o.length-1]=o[o.length-1].join(c)):o.push(c)}i=o}while(n++<10&&r);return i}function kft(s,e,t){let i=t;if(i.length===0)return i;let n=0,r;do{r=!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)?(r=!0,a[a.length-1]=a[a.length-1].join(l)):a.push(l)}i=a}while(n++<10&&r);const o=[];return Rat(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 _i(u.start,c.seq1Range.start));h(f)&&(d=d.deltaStart(-f.length));const p=s.getText(new _i(c.seq1Range.endExclusive,u.endExclusive));h(p)&&(d=d.deltaEnd(p.length));const m=Mc.fromOffsetPairs(a?a.getEndExclusives():DS.zero,l?l.getStarts():DS.max),v=d.intersect(m);o.length>0&&v.getStarts().equals(o[o.length-1].getEndExclusives())?o[o.length-1]=o[o.length-1].join(v):o.push(v)}),o}class XOe{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:ZOe(this.lines[e-1]),i=e===this.lines.length?0:ZOe(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 ZOe(s){let e=0;for(;eA===L))return new Nq([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new Nq([new Y_(new mi(1,e.length+1),new mi(1,t.length+1),[new Qp(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?G8.instance:new uft(i.maxComputationTimeMs),r=!i.ignoreTrimWhitespace,o=new Map;function a(A){let L=o.get(A);return L===void 0&&(L=o.size,o.set(A,L)),L}const c=e.map(A=>a(A.trim())),l=t.map(A=>a(A.trim())),d=new XOe(c,e),h=new XOe(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=Ype(d,h,f),f=Dft(d,h,f);const m=[],v=A=>{if(r)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,r);k.hitTimeout&&(p=!0);for(const P of k.mappings)m.push(P)}v(e.length-b);const y=eBe(m,e,t);let C=[];return i.computeMoves&&(C=this.computeMoves(y,e,t,c,l,n,r)),Q_(()=>{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 Nq(y,C,p)}computeMoves(e,t,i,n,r,o,a){return _ft(e,t,i,n,r,o).map(d=>{const h=this.refineDiff(t,i,new Mc(d.original.toOffsetRange(),d.modified.toOffsetRange()),o,a),u=eBe(h.mappings,t,i,!0);return new oae(d,u)})}refineDiff(e,t,i,n,r){const a=Tft(i).toRangeMapping2(e,t),c=new hY(e,a.originalRange,r),l=new hY(t,a.modifiedRange,r),d=c.length+l.length<500?this.dynamicProgrammingDiffing.compute(c,l,n):this.myersDiffingAlgorithm.compute(c,l,n);let h=d.diffs;return h=Ype(c,l,h),h=Eft(c,l,h),h=Aft(c,l,h),h=kft(c,l,h),{mappings:h.map(f=>new Qp(c.translateRange(f.seq1Range),l.translateRange(f.seq2Range))),hitTimeout:d.hitTimeout}}}function eBe(s,e,t,i=!1){const n=[];for(const r of cTe(s.map(o=>Ift(o,e,t)),(o,a)=>o.original.overlapOrTouch(a.original)||o.modified.overlapOrTouch(a.modified))){const o=r[0],a=r[r.length-1];n.push(new Y_(o.original.join(a.original),o.modified.join(a.modified),r.map(c=>c.innerChanges[0])))}return Q_(()=>!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:DU(n,(r,o)=>o.original.startLineNumber-r.original.endLineNumberExclusive===o.modified.startLineNumber-r.modified.endLineNumberExclusive&&r.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 r=new mi(s.originalRange.startLineNumber+i,s.originalRange.endLineNumber+1+n),o=new mi(s.modifiedRange.startLineNumber+i,s.modifiedRange.endLineNumber+1+n);return new Y_(r,o,[s])}function Tft(s){return new N_(new mi(s.seq1Range.start+1,s.seq1Range.endExclusive+1),new mi(s.seq2Range.start+1,s.seq2Range.endExclusive+1))}const ahe={getLegacy:()=>new lft,getDefault:()=>new oQe};function aD(s,e){const t=Math.pow(10,e);return Math.round(s*t)/t}class hn{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=aD(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 f_{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=aD(Math.max(Math.min(1,t),0),3),this.l=aD(Math.max(Math.min(1,i),0),3),this.a=aD(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,r=e.a,o=Math.max(t,i,n),a=Math.min(t,i,n);let c=0,l=0;const d=(a+o)/2,h=o-a;if(h>0){switch(l=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),o){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:r}=e;let o,a,c;if(i===0)o=a=c=n;else{const l=n<.5?n*(1+i):n+i-n*i,d=2*n-l;o=f_._hue2rgb(d,l,t+1/3),a=f_._hue2rgb(d,l,t),c=f_._hue2rgb(d,l,t-1/3)}return new hn(Math.round(o*255),Math.round(a*255),Math.round(c*255),r)}}class vy{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=aD(Math.max(Math.min(1,t),0),3),this.v=aD(Math.max(Math.min(1,i),0),3),this.a=aD(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,r=Math.max(t,i,n),o=Math.min(t,i,n),a=r-o,c=r===0?0:a/r;let l;return a===0?l=0:r===t?l=((i-n)/a%6+6)%6:r===i?l=(n-t)/a+2:l=(t-i)/a+4,new vy(Math.round(l*60),c,r,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:r}=e,o=n*i,a=o*(1-Math.abs(t/60%2-1)),c=n-o;let[l,d,h]=[0,0,0];return t<60?(l=o,d=a):t<120?(l=a,d=o):t<180?(d=o,h=a):t<240?(d=a,h=o):t<300?(l=a,h=o):t<=360&&(l=o,h=a),l=Math.round((l+c)*255),d=Math.round((d+c)*255),h=Math.round((h+c)*255),new hn(l,d,h,r)}}var _r;let me=(_r=class{static fromHex(e){return _r.Format.CSS.parseHex(e)||_r.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:f_.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:vy.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof hn)this.rgba=e;else if(e instanceof f_)this._hsla=e,this.rgba=f_.toRGBA(e);else if(e instanceof vy)this._hsva=e,this.rgba=vy.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&hn.equals(this.rgba,e.rgba)&&f_.equals(this.hsla,e.hsla)&&vy.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=_r._relativeLuminanceForComponent(this.rgba.r),t=_r._relativeLuminanceForComponent(this.rgba.g),i=_r._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return aD(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_r._flatten(n,i));return _r._flatten(this,t)}static _flatten(e,t){const i=1-e.rgba.a;return new _r(new hn(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=_r.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),r=t.getRelativeLuminance();return i=i*(r-n)/r,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),r=t.getRelativeLuminance();return i=i*(n-r)/n,e.darken(i)}},_r.white=new _r(new hn(255,255,255,1)),_r.black=new _r(new hn(0,0,0,1)),_r.red=new _r(new hn(255,0,0,1)),_r.blue=new _r(new hn(0,0,255,1)),_r.green=new _r(new hn(0,255,0,1)),_r.cyan=new _r(new hn(0,255,255,1)),_r.lightgrey=new _r(new hn(211,211,211,1)),_r.transparent=new _r(new hn(0,0,0,0)),_r);(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 r(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=r;function o(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=o;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 hn(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 hn(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 hn(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 hn(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 aQe(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 QTe(s,e,t,i){return{red:s/255,blue:t/255,green:e/255,alpha:i}}function p4(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 Lft(s,e){if(!s)return;const t=me.Format.CSS.parseHex(e);if(t)return{range:s,color:QTe(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function tBe(s,e,t){if(!s||e.length!==1)return;const n=e[0].values(),r=aQe(n);return{range:s,color:QTe(r[0],r[1],r[2],t?r[3]:1)}}function iBe(s,e,t){if(!s||e.length!==1)return;const n=e[0].values(),r=aQe(n),o=new me(new f_(r[0],r[1]/100,r[2]/100,t?r[3]:1));return{range:s,color:QTe(o.rgba.r,o.rgba.g,o.rgba.b,o.rgba.a)}}function m4(s,e){return typeof s=="string"?[...s.matchAll(e)]:s.findMatches(e)}function Rft(s){const e=[],i=m4(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 r=n.filter(l=>l!==void 0),o=r[1],a=r[2];if(!a)continue;let c;if(o==="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=tBe(p4(s,n),m4(a,l),!1)}else if(o==="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=tBe(p4(s,n),m4(a,l),!0)}else if(o==="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=iBe(p4(s,n),m4(a,l),!1)}else if(o==="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=iBe(p4(s,n),m4(a,l),!0)}else o==="#"&&(c=Lft(p4(s,n),o+a));c&&e.push(c)}return e}function Mft(s){return!s||typeof s.getValue!="function"||typeof s.positionAt!="function"?[]:Rft(s)}const nBe=new RegExp("\\bMARK:\\s*(.*)$","d"),Nft=/^-+|-+$/g;function Pft(s,e){let t=[];if(e.findRegionSectionHeaders&&e.foldingRules?.markers){const i=Fft(s,e);t=t.concat(i)}if(e.findMarkSectionHeaders){const i=Oft(s);t=t.concat(i)}return t}function Fft(s,e){const t=[],i=s.getLineCount();for(let n=1;n<=i;n++){const r=s.getLineContent(n),o=r.match(e.foldingRules.markers.start);if(o){const a={startLineNumber:n,startColumn:o[0].length+1,endLineNumber:n,endColumn:r.length+1};if(a.endColumn>a.startColumn){const c={range:a,...cQe(r.substring(o[0].length)),shouldBeInComments:!1};(c.text||c.hasSeparatorLine)&&t.push(c)}}}return t}function Oft(s){const e=[],t=s.getLineCount();for(let i=1;i<=t;i++){const n=s.getLineContent(i);Bft(n,i,e)}return e}function Bft(s,e,t){nBe.lastIndex=0;const i=nBe.exec(s);if(i){const n=i.indices[1][0]+1,r=i.indices[1][1]+1,o={startLineNumber:e,startColumn:n,endLineNumber:e,endColumn:r};if(o.endColumn>o.startColumn){const a={range:o,...cQe(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function cQe(s){s=s.trim();const e=s.startsWith("-");return s=s.replace(Nft,""),{text:s,hasSeparatorLine:e}}class Wft extends Xqe{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 r=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>r&&(i=r,n=!0)}return n?{lineNumber:t,column:i}:e}}const QE=class QE{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 Wft(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?KTe.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(e,t){const i=this._getModel(e);return i?Pft(i,t):[]}async computeDiff(e,t,i,n){const r=this._getModel(e),o=this._getModel(t);return!r||!o?null:QE.computeDiff(r,o,i,n)}static computeDiff(e,t,i,n){const r=n==="advanced"?ahe.getDefault():ahe.getLegacy(),o=e.getLinesContent(),a=t.getLinesContent(),c=r.computeDiff(o,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 r=1;r<=i;r++){const o=e.getLineContent(r),a=t.getLineContent(r);if(o!==a)return!1}return!0}async computeDirtyDiff(e,t,i){const n=this._getModel(e),r=this._getModel(t);if(!n||!r)return null;const o=n.getLinesContent(),a=r.getLinesContent();return new sQe(o,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 r=[];let o;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;cQE._diffLimit){r.push({range:c,text:l});continue}const u=Ggt(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&&r.push(b)}}return typeof o=="number"&&r.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r}computeHumanReadableDiff(e,t,i){const n=this._getModel(e);if(!n)return t;const r=[];let o;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 re(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"&&(o=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)>QE._diffLimit){r.push({range:a,text:c});continue}const h=d.split(/\r\n|\n|\r/),u=c.split(/\r\n|\n|\r/),f=ahe.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)r.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 Pi("The experimental diff algorithm always produces inner changes")}return typeof o=="number"&&r.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r}async computeLinks(e){const t=this._getModel(e);return t?Jgt(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?Mft(t):null}async textualSuggest(e,t,i,n){const r=new Ys,o=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(o))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>QE._suggestionsLimit))break e}}return{words:Array.from(a),duration:r.elapsed()}}async computeWordRanges(e,t,i,n){const r=this._getModel(e);if(!r)return Object.create(null);const o=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(o,t),Promise.resolve(uTe(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)}}};QE._diffLimit=1e5,QE._suggestionsLimit=1e4;let uY=QE;typeof importScripts=="function"&&(globalThis.monaco=WKe());const xc=ae("textResourceConfigurationService"),jTe=ae("textResourcePropertiesService"),nt=ae("ILanguageFeaturesService"),sBe=60*1e3,rBe=5*60*1e3;function uw(s,e){const t=s.getModel(e);return!(!t||t.isTooLargeForSyncing())}let Jpe=class extends V{constructor(e,t,i,n,r){super(),this._modelService=e,this._workerManager=this._register(new Uft(this._modelService,n)),this._logService=i,this._register(r.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(o,a)=>uw(this._modelService,o.uri)?this._workerManager.withWorker().then(c=>c.computeLinks(o.uri)).then(c=>c&&{links:c}):Promise.resolve({links:[]})})),this._register(r.completionProvider.register("*",new Hft(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return uw(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 r=await this._workerManager.withWorker().then(c=>c.computeDiff(e,t,i,n));if(!r)return null;return{identical:r.identical,quitEarly:r.quitEarly,changes:a(r.changes),moves:r.moves.map(c=>new oae(new N_(new mi(c[0],c[1]),new mi(c[2],c[3])),a(c[4])))};function a(c){return c.map(l=>new Y_(new mi(l[0],l[1]),new mi(l[2],l[3]),l[4]?.map(d=>new Qp(new F(d[0],d[1],d[2],d[3]),new F(d[4],d[5],d[6],d[7])))))}}canComputeDirtyDiff(e,t){return uw(this._modelService,e)&&uw(this._modelService,t)}computeDirtyDiff(e,t,i){return this._workerManager.withWorker().then(n=>n.computeDirtyDiff(e,t,i))}computeMoreMinimalEdits(e,t,i=!1){if(tr(t)){if(!uw(this._modelService,e))return Promise.resolve(t);const n=Ys.create(),r=this._workerManager.withWorker().then(o=>o.computeMoreMinimalEdits(e,t,i));return r.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([r,Ao(1e3).then(()=>t)])}else return Promise.resolve(void 0)}computeHumanReadableDiff(e,t){if(tr(t)){if(!uw(this._modelService,e))return Promise.resolve(t);const i=Ys.create(),n=this._workerManager.withWorker().then(r=>r.computeHumanReadableDiff(e,t,{ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3,computeMoves:!1})).catch(r=>(bt(r),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 uw(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return uw(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))}};Jpe=D([_(0,fi),_(1,xc),_(2,Ke),_(3,zs),_(4,nt)],Jpe);class Hft{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")uw(this._modelService,e.uri)&&n.push(e.uri);else for(const h of this._modelService.getModels())uw(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 r=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),o=e.getWordAtPosition(t),a=o?new F(t.lineNumber,o.startColumn,t.lineNumber,o.endColumn):F.fromPositions(t),c=a.setEndPosition(t.lineNumber,t.column),d=await(await this._workerManager.withWorker()).textualSuggest(n,o?.word,r);if(d)return{duration:d.duration,suggestions:d.words.map(h=>({kind:Me.Text,label:h,insertText:h,range:{insert:c,replace:a}}))}}}class Uft extends V{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new d6).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(rBe/2),ri),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>rBe&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new YTe(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class Vft 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 l6;n.cancelAndSet(()=>this._checkStopModelSync(),Math.round(sBe/2)),this._register(n)}}dispose(){for(const e in this._syncedModels)wt(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]>sBe&&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 r=new Z;r.add(i.onDidChangeContent(o=>{this._proxy.acceptModelChanged(n.toString(),o)})),r.add(i.onWillDispose(()=>{this._stopModelSync(n)})),r.add(Ee(()=>{this._proxy.acceptRemovedModel(n)})),this._syncedModels[n]=r}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],wt(t)}}class oBe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class che{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class YTe extends V{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new Bpe(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 Hut(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new che(this)))}catch(e){Ope(e),this._worker=new oBe(new uY(new che(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(Ope(e),this._worker=new oBe(new uY(new che(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new Vft(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(Ty()):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(r=>r.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),r=i.source,o=i.flags;return n.textualSuggest(e.map(a=>a.toString()),t,r,o)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),o=r.source,a=r.flags;return i.computeWordRanges(e.toString(),t,o,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(n=>{const r=this._modelService.getModel(e);if(!r)return null;const o=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),a=o.source,c=o.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 zft(s,e,t){return new $ft(s,e,t)}class $ft extends YTe{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?uTe(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const n=(a,c)=>e.fmr(a,c),r=(a,c)=>function(){const l=Array.prototype.slice.call(arguments,0);return c(a,l)},o={};for(const a of i)o[a]=r(a,n);return o})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}var _t;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(_t||(_t={}));function Gft(s){return s&&typeof s.id=="string"}const TU={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 K8=new class{clone(){return this}equals(s){return this===s}};function lQe(s,e){return new ITe([new E8(0,"",s)],e)}function JTe(s,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(s<>>0,new Joe(t,e===null?K8:e)}const $C=class $C{static createEmpty(e,t){const i=$C.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new $C(n,e,t)}static createFromTextAndMetadata(e,t){let i=0,n="";const r=new Array;for(const{text:o,metadata:a}of e)r.push(i+o.length,a),i+=o.length,n+=o;return new $C(new Uint32Array(r),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 $C?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,r=n+(i<<1);for(let o=n;o0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=jv.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return jv.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return jv.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return jv.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return jv.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return jv.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return $C.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new XTe(this,e,t,i)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let r=0;r>>1)-1;for(;it&&(n=r)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const r=new Array;let o=0;for(;;){const a=to){n+=this._text.substring(o,c.offset);const l=this._tokens[(t<<1)+1];r.push(n.length,l),o=c.offset}n+=c.text,r.push(n.length,c.tokenMetadata),i++}else break}return new $C(new Uint32Array(r),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 pd=$C;class XTe{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 r=this._firstTokenIndex,o=e.getCount();r=i);r++)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 XTe?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 r=this._source.getTokenText(t);return ithis._endOffset&&(r=r.substring(0,r.length-(n-this._endOffset))),r}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&&ns(e.data,t.data)}static equalsArr(e,t){return ns(e,t,q8.equals)}}class iu{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 r=0;r=r||(a[c++]=new iu(Math.max(1,l.startColumn-n+1),Math.min(o+1,l.endColumn-n+1),l.className,l.type));return a}static filter(e,t,i,n){if(e.length===0)return[];const r=[];let o=0;for(let a=0,c=e.length;at||d.isEmpty()&&(l.type===Xa.Regular||l.type===Xa.RegularAffectingLetterSpacing))continue;const h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:n;r[o++]=new iu(h,u,l.inlineClassName,l.type)}return r}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=iu._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 jft{static normalize(e,t){if(t.length===0)return[];const i=[],n=new gY;let r=0;for(let o=0,a=t.length;o1){const m=e.charCodeAt(l-2);Fc(m)&&l--}if(d>1){const m=e.charCodeAt(d-2);Fc(m)&&d--}const f=l-1,p=d-2;r=n.consumeLowerThan(f,r,i),n.count===0&&(r=f),n.insert(p,h,u)}return n.consumeLowerThan(Vn.MAX_SAFE_SMALL_INTEGER,r,i),i}}var tp;(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"})(tp||(tp={}));let hQe=class{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}};class DI{constructor(e,t,i,n,r,o,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=r,this.containsRTL=o,this.fauxIndentLength=a,this.lineTokens=c,this.lineDecorations=l.sort(iu.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=m,this.renderWhitespace=v==="all"?tp.All:v==="boundary"?tp.Boundary:v==="selection"?tp.Selection:v==="trailing"?tp.Trailing:tp.None,this.renderControlCharacters=b,this.fontLigatures=w,this.selectionsOnLine=y&&y.sort((L,k)=>L.startOffset>>gw.PART_INDEX_OFFSET}static getCharIndex(e){return(e&gw.CHAR_INDEX_MASK)>>>gw.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 r=(t<>>0;this._data[e-1]=r,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=o_.getPartIndex(t),n=o_.getCharIndex(t);return new uQe(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 r=0,o=this.length-1;for(;r+1>>1,v=this._data[m];if(v===n)return m;v>n?o=m:r=m}if(r===o)return r;const a=this._data[r],c=this._data[o];if(a===n)return r;if(c===n)return o;const l=o_.getPartIndex(a),d=o_.getCharIndex(a),h=o_.getPartIndex(c);let u;l!==h?u=t:u=o_.getCharIndex(c);const f=i-d,p=u-i;return f<=p?r:o}inflate(){const e=[];for(let t=0;t0){e.appendString("");let t=0,i=0,n=Yu.None;for(const o of s.lineDecorations)(o.type===Xa.Before||o.type===Xa.After)&&(e.appendString(''),o.type===Xa.Before&&(n|=Yu.Before,t++),o.type===Xa.After&&(n|=Yu.After,i++));e.appendString("");const r=new o_(1,t+i);return r.setColumnInfo(1,t,0,0),new Xpe(r,!1,n)}return e.appendString(""),new Xpe(new o_(0,0),!1,Yu.None)}return spt(Xft(s),e)}class Yft{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function aae(s){const e=new kU(1e4),t=p6(s,e);return new Yft(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class Jft{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=r,this.overflowingCharCount=o,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 Xft(s){const e=s.lineContent;let t,i,n;s.stopRenderingLineAfter!==-1&&s.stopRenderingLineAfter0){for(let a=0,c=s.lineDecorations.length;a0&&(r[o++]=new cl(i,"",0,!1));let a=i;for(let c=0,l=t.getCount();c=n){const f=e?R2(s.substring(a,n)):!1;r[o++]=new cl(n,h,0,f);break}const u=e?R2(s.substring(a,d)):!1;r[o++]=new cl(d,h,0,u),a=d}return r}var $0;(function(s){s[s.LongToken=50]="LongToken"})($0||($0={}));function ept(s,e,t){let i=0;const n=[];let r=0;if(t)for(let o=0,a=e.length;o=$0.LongToken&&(n[r++]=new cl(f+1,d,h,u),p=f+1,f=-1);p!==l&&(n[r++]=new cl(l,d,h,u))}else n[r++]=c;i=l}else for(let o=0,a=e.length;o$0.LongToken){const h=c.type,u=c.metadata,f=c.containsRTL,p=Math.ceil(d/$0.LongToken);for(let m=1;m=8234&&s<=8238||s>=8294&&s<=8297||s>=8206&&s<=8207||s===1564}function tpt(s,e){const t=[];let i=new cl(0,"",0,!1),n=0;for(const r of e){const o=r.endIndex;for(;ni.endIndex&&(i=new cl(n,r.type,r.metadata,r.containsRTL),t.push(i)),i=new cl(n+1,"mtkcontrol",r.metadata,!1),t.push(i))}n>i.endIndex&&(i=new cl(o,r.type,r.metadata,r.containsRTL),t.push(i))}return t}function ipt(s,e,t,i){const n=s.continuesWithWrappedLine,r=s.fauxIndentLength,o=s.tabSize,a=s.startVisibleColumn,c=s.useMonospaceOptimizations,l=s.selectionsOnLine,d=s.renderWhitespace===tp.Boundary,h=s.renderWhitespace===tp.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=Th(e),L;A===-1?(C=!0,A=t,L=t):L=M_(e);let k=!1,P=0,R=l&&l[P],z=a%o;for(let Y=r;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>=o){if(u){const ge=p>0?f[p-1].endIndex:r;for(let De=ge+1;De<=Y;De++)f[p++]=new cl(De,"mtkw",by.IS_WHITESPACE,!1)}else f[p++]=new cl(Y,"mtkw",by.IS_WHITESPACE,!1);z=z%o}}else(Y===w||ne&&Y>r)&&(f[p++]=new cl(Y,v,0,b),z=z%o);for(j===B.Tab?z=o:Fk(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:r;for(let j=Y+1;j<=t;j++)f[p++]=new cl(j,"mtkw",by.IS_WHITESPACE,!1)}else f[p++]=new cl(t,"mtkw",by.IS_WHITESPACE,!1);else f[p++]=new cl(t,v,0,b);return f}function npt(s,e,t,i){i.sort(iu.compare);const n=jft.normalize(s,i),r=n.length;let o=0;const a=[];let c=0,l=0;for(let h=0,u=t.length;hl&&(l=w.startOffset,a[c++]=new cl(l,m,v,b)),w.endOffset+1<=p)l=w.endOffset+1,a[c++]=new cl(l,m+" "+w.className,v|w.metadata,b),o++;else{l=p,a[c++]=new cl(l,m+" "+w.className,v|w.metadata,b);break}}p>l&&(l=p,a[c++]=new cl(l,m,v,b))}const d=t[t.length-1].endIndex;if(o'):e.appendString("");for(let R=0,z=l.length;R=d&&(dt+=Xi)}}for(De&&(e.appendString(' style="width:'),e.appendString(String(p*Ct)),e.appendString('px"')),e.appendASCIICharCode(B.GreaterThan);C1?e.appendCharCode(8594):e.appendCharCode(65515);for(let Xi=2;Xi<=Dt;Xi++)e.appendCharCode(160)}else dt=2,Dt=1,e.appendCharCode(m),e.appendCharCode(8204);L+=dt,k+=Dt,C>=d&&(A+=Dt)}}else for(e.appendASCIICharCode(B.GreaterThan);C=d&&(A+=dt)}Be?P++:P=0,C>=o&&!y&&G.isPseudoAfter()&&(y=!0,w.setColumnInfo(C+1,R,L,k)),e.appendString("")}return y||w.setColumnInfo(o+1,l.length-1,L,k),a&&(e.appendString(''),e.appendString(g(9364,"Show more ({0})",opt(c))),e.appendString("")),e.appendString(""),new Xpe(w,f,n)}function rpt(s){return s.toString(16).toUpperCase().padStart(4,"0")}function opt(s){return s<1024?g(9365,"{0} chars",s):s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}var apt=".monaco-aria-container{left:-999em;position:absolute}";gt(apt,{});const lBe=2e4;let G0,Oq,Zpe,Bq,eme;function cpt(s){G0=document.createElement("div"),G0.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"),G0.appendChild(i),i};Oq=e(),Zpe=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),G0.appendChild(i),i};Bq=t(),eme=t(),s.appendChild(G0)}function No(s){G0&&(Oq.textContent!==s?(Ns(Zpe),fY(Oq,s)):(Ns(Oq),fY(Zpe,s)))}function xh(s){G0&&(Bq.textContent!==s?(Ns(eme),fY(Bq,s)):(Ns(Bq),fY(eme,s)))}function fY(s,e){Ns(s),e.length>lBe&&(e=e.substr(0,lBe)),s.textContent=e,s.style.visibility="hidden",s.style.visibility="visible"}const eLe=ae("markerDecorationsService");var yB;let pY=(yB=class{constructor(e,t){}dispose(){}},yB.ID="editor.contrib.markerDecorations",yB);pY=D([_(1,eLe)],pY);on(pY.ID,pY,ai.Eager);var lpt='::-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)}';gt(lpt,{});class fQe 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 r=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{Ml(lt(this._referenceDomElement),()=>{n=!1,r()})}};this._resizeObserver=new ResizeObserver(o=>{o&&o[0]&&o[0].contentRect?e={width:o[0].contentRect.width,height:o[0].contentRect.height}:e=null,i=!0,r()}),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 YF=class YF{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=YF._read(e,this.key),i=r=>YF._read(e,r),n=(r,o)=>YF._write(e,r,o);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 r=t.substring(0,n);e[r]=e[r]||{},this._write(e[r],t.substring(n+1),i);return}e[t]=i}};YF.items=[];let Q8=YF;function Gb(s,e){Q8.items.push(new Q8(s,e))}function _f(s,e){Gb(s,(t,i,n)=>{if(typeof t<"u"){for(const[r,o]of e)if(t===r){n(s,o);return}}})}function dpt(s){Q8.items.forEach(e=>e.apply(s))}_f("wordWrap",[[!0,"on"],[!1,"off"]]);_f("lineNumbers",[[!0,"on"],[!1,"off"]]);_f("cursorBlinking",[["visible","solid"]]);_f("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);_f("renderLineHighlight",[[!0,"line"],[!1,"none"]]);_f("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);_f("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);_f("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);_f("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);_f("autoIndent",[[!1,"advanced"],[!0,"full"]]);_f("matchBrackets",[[!0,"always"],[!1,"never"]]);_f("renderFinalNewline",[[!0,"on"],[!1,"off"]]);_f("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);_f("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);_f("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);Gb("autoClosingBrackets",(s,e,t)=>{s===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Gb("renderIndentGuides",(s,e,t)=>{typeof s<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!s))});Gb("highlightActiveIndentGuide",(s,e,t)=>{typeof s<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!s))});const hpt={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"};Gb("suggest.filteredTypes",(s,e,t)=>{if(s&&typeof s=="object"){for(const i of Object.entries(hpt))s[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});Gb("quickSuggestions",(s,e,t)=>{if(typeof s=="boolean"){const i=s?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});Gb("experimental.stickyScroll.enabled",(s,e,t)=>{typeof s=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",s))});Gb("experimental.stickyScroll.maxLineCount",(s,e,t)=>{typeof s=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",s))});Gb("codeActionsOnSave",(s,e,t)=>{if(s&&typeof s=="object"){let i=!1;const n={};for(const r of Object.entries(s))typeof r[1]=="boolean"?(i=!0,n[r[0]]=r[1]?"explicit":"never"):n[r[0]]=r[1];i&&t("codeActionsOnSave",n)}});Gb("codeActionWidget.includeNearbyQuickfixes",(s,e,t)=>{typeof s=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",s))});Gb("lightbulb.enabled",(s,e,t)=>{typeof s=="boolean"&&t("lightbulb.enabled",s?void 0:"off")});class upt{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 Uk=new upt,_o=ae("accessibilityService");let tme=class extends V{constructor(e,t,i,n,r,o){super(),this._accessibilityService=o,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 EKe,this.isSimpleWidget=e,this.contextMenuId=t,this.isStandaloneEditor=i,this._containerObserver=this._register(new fQe(r,n.dimension)),this._targetWindowId=lt(r).vscodeWindowId,this._rawOptions=dBe(n),this._validatedOptions=gS.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(x.automaticLayout)&&this._containerObserver.startObserving(),this._register(Jp.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Uk.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(Ppe.onDidChange(()=>this._recomputeOptions())),this._register(W8.getInstance(lt(r)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=gS.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=xx.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:Uk.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return gS.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:fpt(this.isStandaloneEditor),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:AT||lf,pixelRatio:W8.getInstance(Zj(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?Zl.Enabled:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return Ppe.readFontInfo(Zj(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=dBe(e);gS.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=gS.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=gpt(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())}};tme=D([_(5,_o)],tme);function gpt(s){let e=0;for(;s;)s=Math.floor(s/10),e++;return e||1}function fpt(s){let e="";return!Yy&&!UKe&&(e+="no-user-select "),Yy&&(e+="no-minimap-shadow ",e+="enable-user-select "),jt&&(e+="mac "),s&&(e+="standalone "),e}class ppt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class mpt{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 gS{static validateOptions(e){const t=new ppt;for(const i of nF){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 mpt;for(const n of nF)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)?ns(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!gS._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const r of nF){const o=!gS._deepEquals(e._read(r.id),t._read(r.id));i[r.id]=o,o&&(n=!0)}return n?new AKe(i):null}static applyUpdate(e,t){let i=!1;for(const n of nF)if(t.hasOwnProperty(n.name)){const r=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=r.newValue,i=i||r.didChange}return i}}function dBe(s){const e=Ds(s);return dpt(e),e}var Dx;(function(s){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},n={...e};let r=0,o;(function(P){P[P.Before=0]="Before",P[P.InProgress=1]="InProgress",P[P.Finished=2]="Finished"})(o||(o={}));const a={keydown:o.Before,input:o.Before,render:o.Before};function c(){w(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),a.keydown=o.InProgress,queueMicrotask(l)}s.onKeyDown=c;function l(){a.keydown===o.InProgress&&(performance.mark("keydown/end"),a.keydown=o.Finished)}function d(){performance.mark("input/start"),a.input=o.InProgress,b()}s.onBeforeInput=d;function h(){a.input===o.Before&&d(),queueMicrotask(u)}s.onInput=h;function u(){a.input===o.InProgress&&(performance.mark("input/end"),a.input=o.Finished)}function f(){w()}s.onKeyUp=f;function p(){w()}s.onSelectionChange=p;function m(){a.keydown===o.Finished&&a.input===o.Finished&&a.render===o.Before&&(performance.mark("render/start"),a.render=o.InProgress,queueMicrotask(v),b())}s.onRenderStart=m;function v(){a.render===o.InProgress&&(performance.mark("render/end"),a.render=o.Finished)}function b(){setTimeout(w)}function w(){a.keydown===o.Finished&&a.input===o.Finished&&a.render===o.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),r++,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=o.Before,a.input=o.Before,a.render=o.Before}function A(){if(r===0)return;const P={keydown:L(e),input:L(t),render:L(i),total:L(n),sampleCount:r};return k(e),k(t),k(i),k(n),r=0,P}s.getAndClearMeasurements=A;function L(P){return{average:P.total/r,max:P.max,min:P.min}}function k(P){P.total=0,P.min=Number.MAX_VALUE,P.max=0}})(Dx||(Dx={}));var ts;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(ts||(ts={}));var Vg;(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"})(Vg||(Vg={}));var Mt;(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"})(Mt||(Mt={}));function jo(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===TU.ICodeEditor:!1}function rm(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===TU.IDiffEditor:!1}function K2(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function m6(s){return jo(s)?s:rm(s)?s.getModifiedEditor():K2(s)&&jo(s.activeCodeEditor)?s.activeCodeEditor:null}function _pt(s){return jo(s)||rm(s)?s:null}class LU{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,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=r;let o=e;try{e.setPointerCapture(t),this._hooks.add(Ee(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=lt(e)}this._hooks.add(ue(o,ke.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ue(o,ke.POINTER_UP,a=>this.stopMonitoring(!0)))}}function cae(s){return`--vscode-${s.replace(/\./g,"-")}`}function $e(s){return`var(${cae(s)})`}function ime(s,e){return`var(${cae(s)}, ${e})`}var Ou;(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"})(Ou||(Ou={}));function vpt(s){return s!==null&&typeof s=="object"&&"light"in s&&"dark"in s}const tLe={ColorContribution:"base.contributions.colors"},bpt="default";class wpt{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,r){const o={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:r};this.colorsById[e]=o;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return r&&(a.deprecationMessage=r),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:bpt,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=vpt(i.defaults)?i.defaults[t.type]:i.defaults;return wv(n,t)}}getColorSchema(){return this.colorSchema}getColorReferenceSchema(){return this.colorReferenceSchema}toString(){const e=(t,i)=>{const n=t.indexOf(".")===-1?0:1,r=i.indexOf(".")===-1?0:1;return n!==r?n-r:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` -`)}}const lae=new wpt;je.add(tLe.ColorContribution,lae);function W(s,e,t,i,n){return lae.registerColor(s,e,t,i,n)}function ypt(s,e){switch(s.op){case Ou.Darken:return wv(s.value,e)?.darken(s.factor);case Ou.Lighten:return wv(s.value,e)?.lighten(s.factor);case Ou.Transparent:return wv(s.value,e)?.transparent(s.factor);case Ou.Opaque:{const t=wv(s.background,e);return t?wv(s.value,e)?.makeOpaque(t):wv(s.value,e)}case Ou.OneOf:for(const t of s.values){const i=wv(t,e);if(i)return i}return;case Ou.IfDefinedThenElse:return wv(e.defines(s.if)?s.then:s.else,e);case Ou.LessProminent:{const t=wv(s.value,e);if(!t)return;const i=wv(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 h6()}}function vp(s,e){return{op:Ou.Darken,value:s,factor:e}}function P_(s,e){return{op:Ou.Lighten,value:s,factor:e}}function rt(s,e){return{op:Ou.Transparent,value:s,factor:e}}function hBe(s,e){return{op:Ou.Opaque,value:s,background:e}}function j8(...s){return{op:Ou.OneOf,values:s}}function Cpt(s,e,t){return{op:Ou.IfDefinedThenElse,if:s,then:e,else:t}}function uBe(s,e,t,i){return{op:Ou.LessProminent,value:s,background:e,factor:t,transparency:i}}function wv(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 ypt(s,e)}}const pQe="vscode://schemas/workbench-colors",mQe=je.as(tE.JSONContribution);mQe.registerSchema(pQe,lae.getColorSchema());const gBe=new ln(()=>mQe.notifySchemaChanged(pQe),200);lae.onDidChangeSchema(()=>{gBe.isScheduled()||gBe.schedule()});const $i=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.")),fBe=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.")),pBe=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:rt($i,.7),hcDark:rt($i,.7),hcLight:rt($i,.7)},g(1699,"Foreground color for description text providing additional information, for example for a label."));const mY=W("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},g(1700,"The default color for icons in the workbench.")),bp=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.")),yt=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.")),Xs=W("contrastActiveBorder",{light:null,dark:null,hcDark:bp,hcLight:bp},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 iLe=W("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(1705,"Foreground color for links in text.")),Spt=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 Apt=W("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},g(1710,"Background color for block quotes in text.")),Ept=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",bp,g(1908,"Border color of active sashes."));const DT=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.")),dae=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.")),_6=W("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},g(1911,"Scrollbar shadow to indicate that the view is scrolled.")),_Qe=W("scrollbarSlider.background",{dark:me.fromHex("#797979").transparent(.4),light:me.fromHex("#646464").transparent(.4),hcDark:rt(yt,.6),hcLight:rt(yt,.4)},g(1912,"Scrollbar slider background color.")),vQe=W("scrollbarSlider.hoverBackground",{dark:me.fromHex("#646464").transparent(.7),light:me.fromHex("#646464").transparent(.7),hcDark:rt(yt,.8),hcLight:rt(yt,.8)},g(1913,"Scrollbar slider background color when hovering.")),bQe=W("scrollbarSlider.activeBackground",{dark:me.fromHex("#BFBFBF").transparent(.4),light:me.fromHex("#000000").transparent(.6),hcDark:yt,hcLight:yt},g(1914,"Scrollbar slider background color when clicked on.")),xpt=W("progressBar.background",{dark:me.fromHex("#0E70C0"),light:me.fromHex("#0E70C0"),hcDark:yt,hcLight:yt},g(1915,"Background color of the progress bar that can show for long running operations.")),Uc=W("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:me.black,hcLight:me.white},g(1721,"Editor background color.")),Nl=W("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:me.white,hcLight:$i},g(1722,"Editor default foreground color."));W("editorStickyScroll.background",Uc,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:yt,hcLight:yt},g(1725,"Border color of sticky scroll in the editor"));W("editorStickyScroll.shadow",_6,g(1726," Shadow color of sticky scroll in the editor"));const kh=W("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:me.white},g(1727,"Background color of editor widgets, such as find/replace.")),PN=W("editorWidget.foreground",$i,g(1728,"Foreground color of editor widgets, such as find/replace.")),v6=W("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:yt,hcLight:yt},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 FN=W("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},g(1732,"Foreground color of error squigglies in the editor.")),Dpt=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.")),kpt=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),vm=W("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},g(1735,"Foreground color of warning squigglies in the editor.")),Y8=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 bm=W("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},g(1738,"Foreground color of info squigglies in the editor.")),J8=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.")),Ipt=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 Tpt=W("editorLink.activeForeground",{dark:"#4E94CE",light:me.blue,hcDark:me.cyan,hcLight:"#292929"},g(1742,"Color of active links.")),kS=W("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},g(1743,"Color of the editor selection.")),Lpt=W("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:me.white},g(1744,"Color of the selected text for high contrast.")),wQe=W("editor.inactiveSelectionBackground",{light:rt(kS,.5),dark:rt(kS,.5),hcDark:rt(kS,.7),hcLight:rt(kS,.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),nLe=W("editor.selectionHighlightBackground",{light:uBe(kS,Uc,.3,.6),dark:uBe(kS,Uc,.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:Xs,hcLight:Xs},g(1747,"Border color for regions with the same content as the selection."));const mBe=W("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},g(1748,"Color of the current search match.")),Rpt=W("editor.findMatchForeground",null,g(1749,"Text color of the current search match.")),yb=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),Mpt=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:Xs,hcLight:Xs},g(1753,"Border color of the current search match."));const kx=W("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Xs,hcLight:Xs},g(1754,"Border color of the other search matches.")),Npt=W("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:rt(Xs,.4),hcLight:rt(Xs,.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),Ppt=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),_Y=W("editorHoverWidget.background",kh,g(1757,"Background color of the editor hover."));W("editorHoverWidget.foreground",PN,g(1758,"Foreground color of the editor hover."));const yQe=W("editorHoverWidget.border",v6,g(1759,"Border color of the editor hover."));W("editorHoverWidget.statusBarBackground",{dark:P_(_Y,.2),light:vp(_Y,.05),hcDark:kh,hcLight:kh},g(1760,"Background color of the editor hover status bar."));const sLe=W("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:me.white,hcLight:me.black},g(1761,"Foreground color of inline hints")),rLe=W("editorInlayHint.background",{dark:rt(DT,.1),light:rt(DT,.1),hcDark:rt(me.white,.1),hcLight:rt(DT,.1)},g(1762,"Background color of inline hints")),Fpt=W("editorInlayHint.typeForeground",sLe,g(1763,"Foreground color of inline hints for types")),Opt=W("editorInlayHint.typeBackground",rLe,g(1764,"Background color of inline hints for types")),Bpt=W("editorInlayHint.parameterForeground",sLe,g(1765,"Foreground color of inline hints for parameters")),Wpt=W("editorInlayHint.parameterBackground",rLe,g(1766,"Background color of inline hints for parameters")),Hpt=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",Hpt,g(1769,"The color used for the lightbulb AI icon."));W("editor.snippetTabstopHighlightBackground",{dark:new me(new hn(124,124,124,.3)),light:new me(new hn(10,50,100,.2)),hcDark:new me(new hn(124,124,124,.3)),hcLight:new me(new hn(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 hn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},g(1773,"Highlight border color of the final tabstop of a snippet."));const nme=new me(new hn(155,185,85,.2)),sme=new me(new hn(255,0,0,.2)),wy=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),cF=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:nme,light:nme,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:sme,light:sme,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 Upt=W("diffEditorOverview.insertedForeground",null,g(1780,"Diff overview ruler foreground for inserted content.")),Vpt=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:yt,hcLight:yt},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 kI=W("widget.shadow",{dark:rt(me.black,.36),light:rt(me.black,.16),hcDark:null,hcLight:null},g(1789,"Shadow color of widgets such as find/replace inside the editor.")),q2=W("widget.border",{dark:null,light:null,hcDark:yt,hcLight:yt},g(1790,"Border color of widgets such as find/replace inside the editor.")),vY=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:Xs,hcLight:Xs},g(1792,"Toolbar outline when hovering over actions using the mouse"));W("toolbar.activeBackground",{dark:P_(vY,.1),light:vp(vY,.1),hcDark:null,hcLight:null},g(1793,"Toolbar background when holding the mouse over actions"));const zpt=W("breadcrumb.foreground",rt($i,.8),g(1794,"Color of focused breadcrumb items.")),$pt=W("breadcrumb.background",Uc,g(1795,"Background color of breadcrumb items.")),_Be=W("breadcrumb.focusForeground",{light:vp($i,.2),dark:P_($i,.1),hcDark:P_($i,.1),hcLight:P_($i,.1)},g(1794,"Color of focused breadcrumb items.")),Gpt=W("breadcrumb.activeSelectionForeground",{light:vp($i,.2),dark:P_($i,.1),hcDark:P_($i,.1),hcLight:P_($i,.1)},g(1796,"Color of selected breadcrumb items."));W("breadcrumbPicker.background",kh,g(1797,"Background color of breadcrumb item picker."));const CQe=.5,vBe=me.fromHex("#40C8AE").transparent(CQe),bBe=me.fromHex("#40A6FF").transparent(CQe),wBe=me.fromHex("#606060").transparent(.4),oLe=.4,Q2=1,rme=W("merge.currentHeaderBackground",{dark:vBe,light:vBe,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",rt(rme,oLe),g(1799,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const ome=W("merge.incomingHeaderBackground",{dark:bBe,light:bBe,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",rt(ome,oLe),g(1801,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const ame=W("merge.commonHeaderBackground",{dark:wBe,light:wBe,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",rt(ame,oLe),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 j2=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:rt(rme,Q2),light:rt(rme,Q2),hcDark:j2,hcLight:j2},g(1805,"Current overview ruler foreground for inline merge-conflicts."));W("editorOverviewRuler.incomingContentForeground",{dark:rt(ome,Q2),light:rt(ome,Q2),hcDark:j2,hcLight:j2},g(1806,"Incoming overview ruler foreground for inline merge-conflicts."));W("editorOverviewRuler.commonContentForeground",{dark:rt(ame,Q2),light:rt(ame,Q2),hcDark:j2,hcLight:j2},g(1807,"Common ancestor overview ruler foreground for inline merge-conflicts."));const u5=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),SQe=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),Kpt=W("problemsErrorIcon.foreground",FN,g(1810,"The color used for the problems error icon.")),qpt=W("problemsWarningIcon.foreground",vm,g(1811,"The color used for the problems warning icon.")),Qpt=W("problemsInfoIcon.foreground",bm,g(1812,"The color used for the problems info icon.")),cme=W("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},g(1897,"Minimap marker color for find matches."),!0),hae=W("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1898,"Minimap marker color for repeating editor selections."),!0),yBe=W("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1899,"Minimap marker color for the editor selection."),!0),jpt=W("minimap.infoHighlight",{dark:bm,light:bm,hcDark:J8,hcLight:J8},g(1900,"Minimap marker color for infos.")),Ypt=W("minimap.warningHighlight",{dark:vm,light:vm,hcDark:Y8,hcLight:Y8},g(1901,"Minimap marker color for warnings.")),Jpt=W("minimap.errorHighlight",{dark:new me(new hn(255,18,18,.7)),light:new me(new hn(255,18,18,.7)),hcDark:new me(new hn(255,50,50,1)),hcLight:"#B5200D"},g(1902,"Minimap marker color for errors.")),Xpt=W("minimap.background",null,g(1903,"Minimap background color.")),Zpt=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",rt(_Qe,.5),g(1905,"Minimap slider background color."));W("minimapSlider.hoverBackground",rt(vQe,.5),g(1906,"Minimap slider background color when hovering."));W("minimapSlider.activeBackground",rt(bQe,.5),g(1907,"Minimap slider background color when clicked on."));W("charts.foreground",$i,g(1713,"The foreground color used in charts."));W("charts.lines",rt($i,.5),g(1714,"The color used for horizontal lines in charts."));W("charts.red",FN,g(1715,"The red color used in chart visualizations."));W("charts.blue",bm,g(1716,"The blue color used in chart visualizations."));W("charts.yellow",vm,g(1717,"The yellow color used in chart visualizations."));W("charts.orange",cme,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 Y2=W("input.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},g(1813,"Input box background.")),AQe=W("input.foreground",$i,g(1814,"Input box foreground.")),g5=W("input.border",{dark:null,light:null,hcDark:yt,hcLight:yt},g(1815,"Input box border.")),uae=W("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:yt,hcLight:yt},g(1816,"Border color of activated options in input fields.")),emt=W("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},g(1817,"Background color of activated options in input fields.")),b6=W("inputOption.activeBackground",{dark:rt(bp,.4),light:rt(bp,.2),hcDark:me.transparent,hcLight:me.transparent},g(1818,"Background hover color of options in input fields.")),gae=W("inputOption.activeForeground",{dark:me.white,light:me.black,hcDark:$i,hcLight:$i},g(1819,"Foreground color of activated options in input fields.")),tmt=W("input.placeholderForeground",{light:rt($i,.5),dark:rt($i,.5),hcDark:rt($i,.7),hcLight:rt($i,.7)},g(1820,"Input box foreground color for placeholder text.")),imt=W("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:me.black,hcLight:me.white},g(1821,"Input validation background color for information severity.")),nmt=W("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:$i},g(1822,"Input validation foreground color for information severity.")),smt=W("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:yt,hcLight:yt},g(1823,"Input validation border color for information severity.")),rmt=W("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:me.black,hcLight:me.white},g(1824,"Input validation background color for warning severity.")),omt=W("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:$i},g(1825,"Input validation foreground color for warning severity.")),amt=W("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:yt,hcLight:yt},g(1826,"Input validation border color for warning severity.")),EQe=W("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:me.black,hcLight:me.white},g(1827,"Input validation background color for error severity.")),xQe=W("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:$i},g(1828,"Input validation foreground color for error severity.")),DQe=W("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:yt,hcLight:yt},g(1829,"Input validation border color for error severity.")),fae=W("dropdown.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},g(1830,"Dropdown background.")),cmt=W("dropdown.listBackground",{dark:null,light:null,hcDark:me.black,hcLight:me.white},g(1831,"Dropdown list background.")),aLe=W("dropdown.foreground",{dark:"#F0F0F0",light:$i,hcDark:me.white,hcLight:$i},g(1832,"Dropdown foreground.")),cLe=W("dropdown.border",{dark:fae,light:"#CECECE",hcDark:yt,hcLight:yt},g(1833,"Dropdown border.")),EM=W("button.foreground",me.white,g(1834,"Button foreground color.")),kQe=W("button.separator",rt(EM,.4),g(1835,"Button separator color.")),yy=W("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},g(1836,"Button background color.")),X8=W("button.hoverBackground",{dark:P_(yy,.2),light:vp(yy,.2),hcDark:yy,hcLight:yy},g(1837,"Button background color when hovering.")),lmt=W("button.border",yt,g(1838,"Button border color.")),dmt=W("button.secondaryForeground",{dark:me.white,light:me.white,hcDark:me.white,hcLight:$i},g(1839,"Secondary button foreground color.")),lme=W("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:me.white},g(1840,"Secondary button background color.")),hmt=W("button.secondaryHoverBackground",{dark:P_(lme,.2),light:vp(lme,.2),hcDark:null,hcLight:null},g(1841,"Secondary button background color when hovering.")),aV=W("radio.activeForeground",gae,g(1842,"Foreground color of active radio option.")),umt=W("radio.activeBackground",b6,g(1843,"Background color of active radio option.")),gmt=W("radio.activeBorder",uae,g(1844,"Border color of the active radio option.")),fmt=W("radio.inactiveForeground",null,g(1845,"Foreground color of inactive radio option.")),pmt=W("radio.inactiveBackground",null,g(1846,"Background color of inactive radio option.")),mmt=W("radio.inactiveBorder",{light:rt(aV,.2),dark:rt(aV,.2),hcDark:rt(aV,.4),hcLight:rt(aV,.2)},g(1847,"Border color of the inactive radio option.")),_mt=W("radio.inactiveHoverBackground",emt,g(1848,"Background color of inactive active radio option when hovering.")),vmt=W("checkbox.background",fae,g(1849,"Background color of checkbox widget."));W("checkbox.selectBackground",kh,g(1850,"Background color of checkbox widget when the element it's in is selected."));const bmt=W("checkbox.foreground",aLe,g(1851,"Foreground color of checkbox widget.")),wmt=W("checkbox.border",cLe,g(1852,"Border color of checkbox widget."));W("checkbox.selectBorder",mY,g(1853,"Border color of checkbox widget when the element it's in is selected."));const ymt=W("keybindingLabel.background",{dark:new me(new hn(128,128,128,.17)),light:new me(new hn(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.")),Cmt=W("keybindingLabel.foreground",{dark:me.fromHex("#CCCCCC"),light:me.fromHex("#555555"),hcDark:me.white,hcLight:$i},g(1855,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Smt=W("keybindingLabel.border",{dark:new me(new hn(51,51,51,.6)),light:new me(new hn(204,204,204,.4)),hcDark:new me(new hn(111,195,223)),hcLight:yt},g(1856,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Amt=W("keybindingLabel.bottomBorder",{dark:new me(new hn(68,68,68,.6)),light:new me(new hn(187,187,187,.4)),hcDark:new me(new hn(111,195,223)),hcLight:$i},g(1857,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Emt=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.")),xmt=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.")),dme=W("list.focusOutline",{dark:bp,light:bp,hcDark:Xs,hcLight:Xs},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.")),Dmt=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.")),Cy=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.")),Z8=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.")),IQe=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.")),hme=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.")),kmt=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.")),Imt=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.")),Tmt=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.")),Lmt=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.")),TQe=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.")),Rmt=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.")),Mmt=W("list.dropBetweenBackground",{dark:mY,light:mY,hcDark:null,hcLight:null},g(1873,"List/Tree drag and drop border color when moving items between items when using the mouse.")),lF=W("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:bp,hcLight:bp},g(1874,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),Nmt=W("list.focusHighlightForeground",{dark:lF,light:Cpt(Cy,lF,"#BBE7FF"),hcDark:lF,hcLight:lF},g(1875,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),Pmt=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.")),CBe=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 Fmt=W("listFilterWidget.background",{light:vp(kh,0),dark:P_(kh,0),hcDark:kh,hcLight:kh},g(1879,"Background color of the type filter widget in lists and trees.")),Omt=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.")),Bmt=W("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:yt,hcLight:yt},g(1881,"Outline color of the type filter widget in lists and trees, when there are no matches.")),Wmt=W("listFilterWidget.shadow",kI,g(1882,"Shadow color of the type filter widget in lists and trees."));W("list.filterMatchBackground",{dark:yb,light:yb,hcDark:null,hcLight:null},g(1883,"Background color of the filtered match."));W("list.filterMatchBorder",{dark:kx,light:kx,hcDark:yt,hcLight:Xs},g(1884,"Border color of the filtered match."));const Hmt=W("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},g(1885,"List/Tree foreground color for items that are deemphasized.")),bY=W("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},g(1886,"Tree stroke color for the indentation guides.")),Umt=W("tree.inactiveIndentGuidesStroke",rt(bY,.4),g(1887,"Tree stroke color for the indentation guides that are not active.")),Vmt=W("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},g(1888,"Table border color between columns.")),zmt=W("tree.tableOddRowsBackground",{dark:rt($i,.04),light:rt($i,.04),hcDark:null,hcLight:null},g(1889,"Background color for odd table rows.")),$mt=W("menu.border",{dark:null,light:null,hcDark:yt,hcLight:yt},g(1890,"Border color of menus.")),Gmt=W("menu.foreground",aLe,g(1891,"Foreground color of menu items.")),Kmt=W("menu.background",fae,g(1892,"Background color of menu items.")),qmt=W("menu.selectionForeground",Z8,g(1893,"Foreground color of the selected menu item in menus.")),Qmt=W("menu.selectionBackground",Cy,g(1894,"Background color of the selected menu item in menus.")),jmt=W("menu.selectionBorder",{dark:null,light:null,hcDark:Xs,hcLight:Xs},g(1895,"Border color of the selected menu item in menus.")),Ymt=W("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:yt,hcLight:yt},g(1896,"Color of a separator menu item in menus.")),SBe=W("quickInput.background",kh,g(1916,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Jmt=W("quickInput.foreground",PN,g(1917,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Xmt=W("quickInputTitle.background",{dark:new me(new hn(255,255,255,.105)),light:new me(new hn(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.")),RQe=W("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:me.white,hcLight:"#0F4A85"},g(1919,"Quick picker color for grouping labels.")),Zmt=W("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:me.white,hcLight:"#0F4A85"},g(1920,"Quick picker color for grouping borders.")),ABe=W("quickInput.list.focusBackground",null,"",void 0,g(1921,"Please use quickInputList.focusBackground instead")),e3=W("quickInputList.focusForeground",Z8,g(1922,"Quick picker foreground color for the focused item.")),lLe=W("quickInputList.focusIconForeground",IQe,g(1923,"Quick picker icon foreground color for the focused item.")),t3=W("quickInputList.focusBackground",{dark:j8(ABe,Cy),light:j8(ABe,Cy),hcDark:null,hcLight:null},g(1924,"Quick picker background color for the focused item."));W("search.resultsInfoForeground",{light:$i,dark:rt($i,.65),hcDark:$i,hcLight:$i},g(1925,"Color of the text in the search viewlet's completion message."));W("searchEditor.findMatchBackground",{light:rt(yb,.66),dark:rt(yb,.66),hcDark:yb,hcLight:yb},g(1926,"Color of the Search Editor query matches."));W("searchEditor.findMatchBorder",{light:rt(kx,.66),dark:rt(kx,.66),hcDark:kx,hcLight:kx},g(1927,"Border color of the Search Editor query matches."));class pae{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new MQe(this.x-e.scrollX,this.y-e.scrollY)}}class MQe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new pae(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class e_t{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class t_t{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function dLe(s){const e=So(s);return new e_t(e.left,e.top,e.width,e.height)}function hLe(s,e,t){const i=e.width/s.offsetWidth,n=e.height/s.offsetHeight,r=(t.x-e.x)/i,o=(t.y-e.y)/n;return new t_t(r,o)}class Vk extends Dh{constructor(e,t,i){super(lt(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new pae(this.posx,this.posy),this.editorPos=dLe(i),this.relativePos=hLe(i,this.editorPos,this.pos)}}class i_t{constructor(e){this._editorViewDomNode=e}_create(e){return new Vk(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 n_t{constructor(e){this._editorViewDomNode=e}_create(e){return new Vk(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 s_t extends V{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new LU),this._keydownListener=null}startMonitoring(e,t,i,n,r){this._keydownListener=Rr(e.ownerDocument,"keydown",o=>{o.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,o.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,o=>{n(new Vk(o,!0,this._editorViewDomNode))},o=>{this._keydownListener.dispose(),r(o)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}const hse=class hse{constructor(e){this._editor=e,this._instanceId=++hse._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new ln(()=>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 r_t(t,`dyn-rule-${this._instanceId}-${n}`,F8(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())}};hse._idPool=0;let wY=hse;class r_t{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new Z,this._styleElement=fl(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 r=t[n];let o;typeof r=="object"?o=$e(r.id):o=r;const a=o_t(n);i+=` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function ZOe(s){let e=0;for(;eA===L))return new Nq([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new Nq([new Y_(new mi(1,e.length+1),new mi(1,t.length+1),[new Qp(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?G8.instance:new uft(i.maxComputationTimeMs),r=!i.ignoreTrimWhitespace,o=new Map;function a(A){let L=o.get(A);return L===void 0&&(L=o.size,o.set(A,L)),L}const c=e.map(A=>a(A.trim())),l=t.map(A=>a(A.trim())),d=new XOe(c,e),h=new XOe(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=Ype(d,h,f),f=Dft(d,h,f);const m=[],v=A=>{if(r)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,r);k.hitTimeout&&(p=!0);for(const P of k.mappings)m.push(P)}v(e.length-b);const y=eBe(m,e,t);let C=[];return i.computeMoves&&(C=this.computeMoves(y,e,t,c,l,n,r)),Q_(()=>{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 Nq(y,C,p)}computeMoves(e,t,i,n,r,o,a){return _ft(e,t,i,n,r,o).map(d=>{const h=this.refineDiff(t,i,new Mc(d.original.toOffsetRange(),d.modified.toOffsetRange()),o,a),u=eBe(h.mappings,t,i,!0);return new oae(d,u)})}refineDiff(e,t,i,n,r){const a=Tft(i).toRangeMapping2(e,t),c=new hY(e,a.originalRange,r),l=new hY(t,a.modifiedRange,r),d=c.length+l.length<500?this.dynamicProgrammingDiffing.compute(c,l,n):this.myersDiffingAlgorithm.compute(c,l,n);let h=d.diffs;return h=Ype(c,l,h),h=Eft(c,l,h),h=Aft(c,l,h),h=kft(c,l,h),{mappings:h.map(f=>new Qp(c.translateRange(f.seq1Range),l.translateRange(f.seq2Range))),hitTimeout:d.hitTimeout}}}function eBe(s,e,t,i=!1){const n=[];for(const r of cTe(s.map(o=>Ift(o,e,t)),(o,a)=>o.original.overlapOrTouch(a.original)||o.modified.overlapOrTouch(a.modified))){const o=r[0],a=r[r.length-1];n.push(new Y_(o.original.join(a.original),o.modified.join(a.modified),r.map(c=>c.innerChanges[0])))}return Q_(()=>!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:DU(n,(r,o)=>o.original.startLineNumber-r.original.endLineNumberExclusive===o.modified.startLineNumber-r.modified.endLineNumberExclusive&&r.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 r=new mi(s.originalRange.startLineNumber+i,s.originalRange.endLineNumber+1+n),o=new mi(s.modifiedRange.startLineNumber+i,s.modifiedRange.endLineNumber+1+n);return new Y_(r,o,[s])}function Tft(s){return new N_(new mi(s.seq1Range.start+1,s.seq1Range.endExclusive+1),new mi(s.seq2Range.start+1,s.seq2Range.endExclusive+1))}const ahe={getLegacy:()=>new lft,getDefault:()=>new oQe};function aD(s,e){const t=Math.pow(10,e);return Math.round(s*t)/t}class hn{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=aD(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 f_{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=aD(Math.max(Math.min(1,t),0),3),this.l=aD(Math.max(Math.min(1,i),0),3),this.a=aD(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,r=e.a,o=Math.max(t,i,n),a=Math.min(t,i,n);let c=0,l=0;const d=(a+o)/2,h=o-a;if(h>0){switch(l=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),o){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:r}=e;let o,a,c;if(i===0)o=a=c=n;else{const l=n<.5?n*(1+i):n+i-n*i,d=2*n-l;o=f_._hue2rgb(d,l,t+1/3),a=f_._hue2rgb(d,l,t),c=f_._hue2rgb(d,l,t-1/3)}return new hn(Math.round(o*255),Math.round(a*255),Math.round(c*255),r)}}class vy{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=aD(Math.max(Math.min(1,t),0),3),this.v=aD(Math.max(Math.min(1,i),0),3),this.a=aD(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,r=Math.max(t,i,n),o=Math.min(t,i,n),a=r-o,c=r===0?0:a/r;let l;return a===0?l=0:r===t?l=((i-n)/a%6+6)%6:r===i?l=(n-t)/a+2:l=(t-i)/a+4,new vy(Math.round(l*60),c,r,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:r}=e,o=n*i,a=o*(1-Math.abs(t/60%2-1)),c=n-o;let[l,d,h]=[0,0,0];return t<60?(l=o,d=a):t<120?(l=a,d=o):t<180?(d=o,h=a):t<240?(d=a,h=o):t<300?(l=a,h=o):t<=360&&(l=o,h=a),l=Math.round((l+c)*255),d=Math.round((d+c)*255),h=Math.round((h+c)*255),new hn(l,d,h,r)}}var _r;let me=(_r=class{static fromHex(e){return _r.Format.CSS.parseHex(e)||_r.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:f_.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:vy.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof hn)this.rgba=e;else if(e instanceof f_)this._hsla=e,this.rgba=f_.toRGBA(e);else if(e instanceof vy)this._hsva=e,this.rgba=vy.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&hn.equals(this.rgba,e.rgba)&&f_.equals(this.hsla,e.hsla)&&vy.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=_r._relativeLuminanceForComponent(this.rgba.r),t=_r._relativeLuminanceForComponent(this.rgba.g),i=_r._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return aD(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_r._flatten(n,i));return _r._flatten(this,t)}static _flatten(e,t){const i=1-e.rgba.a;return new _r(new hn(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=_r.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),r=t.getRelativeLuminance();return i=i*(r-n)/r,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),r=t.getRelativeLuminance();return i=i*(n-r)/n,e.darken(i)}},_r.white=new _r(new hn(255,255,255,1)),_r.black=new _r(new hn(0,0,0,1)),_r.red=new _r(new hn(255,0,0,1)),_r.blue=new _r(new hn(0,0,255,1)),_r.green=new _r(new hn(0,255,0,1)),_r.cyan=new _r(new hn(0,255,255,1)),_r.lightgrey=new _r(new hn(211,211,211,1)),_r.transparent=new _r(new hn(0,0,0,0)),_r);(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 r(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=r;function o(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=o;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 hn(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 hn(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 hn(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 hn(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 aQe(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 QTe(s,e,t,i){return{red:s/255,blue:t/255,green:e/255,alpha:i}}function p4(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 Lft(s,e){if(!s)return;const t=me.Format.CSS.parseHex(e);if(t)return{range:s,color:QTe(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function tBe(s,e,t){if(!s||e.length!==1)return;const n=e[0].values(),r=aQe(n);return{range:s,color:QTe(r[0],r[1],r[2],t?r[3]:1)}}function iBe(s,e,t){if(!s||e.length!==1)return;const n=e[0].values(),r=aQe(n),o=new me(new f_(r[0],r[1]/100,r[2]/100,t?r[3]:1));return{range:s,color:QTe(o.rgba.r,o.rgba.g,o.rgba.b,o.rgba.a)}}function m4(s,e){return typeof s=="string"?[...s.matchAll(e)]:s.findMatches(e)}function Rft(s){const e=[],i=m4(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 r=n.filter(l=>l!==void 0),o=r[1],a=r[2];if(!a)continue;let c;if(o==="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=tBe(p4(s,n),m4(a,l),!1)}else if(o==="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=tBe(p4(s,n),m4(a,l),!0)}else if(o==="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=iBe(p4(s,n),m4(a,l),!1)}else if(o==="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=iBe(p4(s,n),m4(a,l),!0)}else o==="#"&&(c=Lft(p4(s,n),o+a));c&&e.push(c)}return e}function Mft(s){return!s||typeof s.getValue!="function"||typeof s.positionAt!="function"?[]:Rft(s)}const nBe=new RegExp("\\bMARK:\\s*(.*)$","d"),Nft=/^-+|-+$/g;function Pft(s,e){let t=[];if(e.findRegionSectionHeaders&&e.foldingRules?.markers){const i=Fft(s,e);t=t.concat(i)}if(e.findMarkSectionHeaders){const i=Oft(s);t=t.concat(i)}return t}function Fft(s,e){const t=[],i=s.getLineCount();for(let n=1;n<=i;n++){const r=s.getLineContent(n),o=r.match(e.foldingRules.markers.start);if(o){const a={startLineNumber:n,startColumn:o[0].length+1,endLineNumber:n,endColumn:r.length+1};if(a.endColumn>a.startColumn){const c={range:a,...cQe(r.substring(o[0].length)),shouldBeInComments:!1};(c.text||c.hasSeparatorLine)&&t.push(c)}}}return t}function Oft(s){const e=[],t=s.getLineCount();for(let i=1;i<=t;i++){const n=s.getLineContent(i);Bft(n,i,e)}return e}function Bft(s,e,t){nBe.lastIndex=0;const i=nBe.exec(s);if(i){const n=i.indices[1][0]+1,r=i.indices[1][1]+1,o={startLineNumber:e,startColumn:n,endLineNumber:e,endColumn:r};if(o.endColumn>o.startColumn){const a={range:o,...cQe(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function cQe(s){s=s.trim();const e=s.startsWith("-");return s=s.replace(Nft,""),{text:s,hasSeparatorLine:e}}class Wft extends Xqe{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 r=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>r&&(i=r,n=!0)}return n?{lineNumber:t,column:i}:e}}const QE=class QE{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 Wft(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?KTe.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(e,t){const i=this._getModel(e);return i?Pft(i,t):[]}async computeDiff(e,t,i,n){const r=this._getModel(e),o=this._getModel(t);return!r||!o?null:QE.computeDiff(r,o,i,n)}static computeDiff(e,t,i,n){const r=n==="advanced"?ahe.getDefault():ahe.getLegacy(),o=e.getLinesContent(),a=t.getLinesContent(),c=r.computeDiff(o,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 r=1;r<=i;r++){const o=e.getLineContent(r),a=t.getLineContent(r);if(o!==a)return!1}return!0}async computeDirtyDiff(e,t,i){const n=this._getModel(e),r=this._getModel(t);if(!n||!r)return null;const o=n.getLinesContent(),a=r.getLinesContent();return new sQe(o,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 r=[];let o;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;cQE._diffLimit){r.push({range:c,text:l});continue}const u=Ggt(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&&r.push(b)}}return typeof o=="number"&&r.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r}computeHumanReadableDiff(e,t,i){const n=this._getModel(e);if(!n)return t;const r=[];let o;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 re(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"&&(o=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)>QE._diffLimit){r.push({range:a,text:c});continue}const h=d.split(/\r\n|\n|\r/),u=c.split(/\r\n|\n|\r/),f=ahe.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)r.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 Pi("The experimental diff algorithm always produces inner changes")}return typeof o=="number"&&r.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r}async computeLinks(e){const t=this._getModel(e);return t?Jgt(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?Mft(t):null}async textualSuggest(e,t,i,n){const r=new Ys,o=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(o))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>QE._suggestionsLimit))break e}}return{words:Array.from(a),duration:r.elapsed()}}async computeWordRanges(e,t,i,n){const r=this._getModel(e);if(!r)return Object.create(null);const o=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(o,t),Promise.resolve(uTe(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)}}};QE._diffLimit=1e5,QE._suggestionsLimit=1e4;let uY=QE;typeof importScripts=="function"&&(globalThis.monaco=WKe());const xc=ae("textResourceConfigurationService"),jTe=ae("textResourcePropertiesService"),nt=ae("ILanguageFeaturesService"),sBe=60*1e3,rBe=5*60*1e3;function uw(s,e){const t=s.getModel(e);return!(!t||t.isTooLargeForSyncing())}let Jpe=class extends V{constructor(e,t,i,n,r){super(),this._modelService=e,this._workerManager=this._register(new Uft(this._modelService,n)),this._logService=i,this._register(r.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(o,a)=>uw(this._modelService,o.uri)?this._workerManager.withWorker().then(c=>c.computeLinks(o.uri)).then(c=>c&&{links:c}):Promise.resolve({links:[]})})),this._register(r.completionProvider.register("*",new Hft(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return uw(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 r=await this._workerManager.withWorker().then(c=>c.computeDiff(e,t,i,n));if(!r)return null;return{identical:r.identical,quitEarly:r.quitEarly,changes:a(r.changes),moves:r.moves.map(c=>new oae(new N_(new mi(c[0],c[1]),new mi(c[2],c[3])),a(c[4])))};function a(c){return c.map(l=>new Y_(new mi(l[0],l[1]),new mi(l[2],l[3]),l[4]?.map(d=>new Qp(new F(d[0],d[1],d[2],d[3]),new F(d[4],d[5],d[6],d[7])))))}}canComputeDirtyDiff(e,t){return uw(this._modelService,e)&&uw(this._modelService,t)}computeDirtyDiff(e,t,i){return this._workerManager.withWorker().then(n=>n.computeDirtyDiff(e,t,i))}computeMoreMinimalEdits(e,t,i=!1){if(tr(t)){if(!uw(this._modelService,e))return Promise.resolve(t);const n=Ys.create(),r=this._workerManager.withWorker().then(o=>o.computeMoreMinimalEdits(e,t,i));return r.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([r,Ao(1e3).then(()=>t)])}else return Promise.resolve(void 0)}computeHumanReadableDiff(e,t){if(tr(t)){if(!uw(this._modelService,e))return Promise.resolve(t);const i=Ys.create(),n=this._workerManager.withWorker().then(r=>r.computeHumanReadableDiff(e,t,{ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3,computeMoves:!1})).catch(r=>(bt(r),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 uw(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return uw(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))}};Jpe=D([_(0,fi),_(1,xc),_(2,Ke),_(3,zs),_(4,nt)],Jpe);class Hft{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")uw(this._modelService,e.uri)&&n.push(e.uri);else for(const h of this._modelService.getModels())uw(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 r=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),o=e.getWordAtPosition(t),a=o?new F(t.lineNumber,o.startColumn,t.lineNumber,o.endColumn):F.fromPositions(t),c=a.setEndPosition(t.lineNumber,t.column),d=await(await this._workerManager.withWorker()).textualSuggest(n,o?.word,r);if(d)return{duration:d.duration,suggestions:d.words.map(h=>({kind:Me.Text,label:h,insertText:h,range:{insert:c,replace:a}}))}}}class Uft extends V{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new d6).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(rBe/2),ri),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>rBe&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new YTe(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class Vft 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 l6;n.cancelAndSet(()=>this._checkStopModelSync(),Math.round(sBe/2)),this._register(n)}}dispose(){for(const e in this._syncedModels)wt(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]>sBe&&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 r=new Z;r.add(i.onDidChangeContent(o=>{this._proxy.acceptModelChanged(n.toString(),o)})),r.add(i.onWillDispose(()=>{this._stopModelSync(n)})),r.add(Ee(()=>{this._proxy.acceptRemovedModel(n)})),this._syncedModels[n]=r}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],wt(t)}}class oBe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class che{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class YTe extends V{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new Bpe(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 Hut(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new che(this)))}catch(e){Ope(e),this._worker=new oBe(new uY(new che(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(Ope(e),this._worker=new oBe(new uY(new che(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new Vft(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(Ty()):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(r=>r.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),r=i.source,o=i.flags;return n.textualSuggest(e.map(a=>a.toString()),t,r,o)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),o=r.source,a=r.flags;return i.computeWordRanges(e.toString(),t,o,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(n=>{const r=this._modelService.getModel(e);if(!r)return null;const o=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),a=o.source,c=o.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 zft(s,e,t){return new $ft(s,e,t)}class $ft extends YTe{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?uTe(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const n=(a,c)=>e.fmr(a,c),r=(a,c)=>function(){const l=Array.prototype.slice.call(arguments,0);return c(a,l)},o={};for(const a of i)o[a]=r(a,n);return o})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}var _t;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(_t||(_t={}));function Gft(s){return s&&typeof s.id=="string"}const TU={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 K8=new class{clone(){return this}equals(s){return this===s}};function lQe(s,e){return new ITe([new E8(0,"",s)],e)}function JTe(s,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(s<>>0,new Joe(t,e===null?K8:e)}const $C=class $C{static createEmpty(e,t){const i=$C.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new $C(n,e,t)}static createFromTextAndMetadata(e,t){let i=0,n="";const r=new Array;for(const{text:o,metadata:a}of e)r.push(i+o.length,a),i+=o.length,n+=o;return new $C(new Uint32Array(r),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 $C?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,r=n+(i<<1);for(let o=n;o0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=jv.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return jv.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return jv.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return jv.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return jv.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return jv.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return $C.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new XTe(this,e,t,i)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let r=0;r>>1)-1;for(;it&&(n=r)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const r=new Array;let o=0;for(;;){const a=to){n+=this._text.substring(o,c.offset);const l=this._tokens[(t<<1)+1];r.push(n.length,l),o=c.offset}n+=c.text,r.push(n.length,c.tokenMetadata),i++}else break}return new $C(new Uint32Array(r),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 pd=$C;class XTe{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 r=this._firstTokenIndex,o=e.getCount();r=i);r++)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 XTe?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 r=this._source.getTokenText(t);return ithis._endOffset&&(r=r.substring(0,r.length-(n-this._endOffset))),r}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&&ns(e.data,t.data)}static equalsArr(e,t){return ns(e,t,q8.equals)}}class iu{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 r=0;r=r||(a[c++]=new iu(Math.max(1,l.startColumn-n+1),Math.min(o+1,l.endColumn-n+1),l.className,l.type));return a}static filter(e,t,i,n){if(e.length===0)return[];const r=[];let o=0;for(let a=0,c=e.length;at||d.isEmpty()&&(l.type===Xa.Regular||l.type===Xa.RegularAffectingLetterSpacing))continue;const h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:n;r[o++]=new iu(h,u,l.inlineClassName,l.type)}return r}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=iu._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 jft{static normalize(e,t){if(t.length===0)return[];const i=[],n=new gY;let r=0;for(let o=0,a=t.length;o1){const m=e.charCodeAt(l-2);Fc(m)&&l--}if(d>1){const m=e.charCodeAt(d-2);Fc(m)&&d--}const f=l-1,p=d-2;r=n.consumeLowerThan(f,r,i),n.count===0&&(r=f),n.insert(p,h,u)}return n.consumeLowerThan(Vn.MAX_SAFE_SMALL_INTEGER,r,i),i}}var tp;(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"})(tp||(tp={}));let hQe=class{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}};class DI{constructor(e,t,i,n,r,o,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=r,this.containsRTL=o,this.fauxIndentLength=a,this.lineTokens=c,this.lineDecorations=l.sort(iu.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=m,this.renderWhitespace=v==="all"?tp.All:v==="boundary"?tp.Boundary:v==="selection"?tp.Selection:v==="trailing"?tp.Trailing:tp.None,this.renderControlCharacters=b,this.fontLigatures=w,this.selectionsOnLine=y&&y.sort((L,k)=>L.startOffset>>gw.PART_INDEX_OFFSET}static getCharIndex(e){return(e&gw.CHAR_INDEX_MASK)>>>gw.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 r=(t<>>0;this._data[e-1]=r,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=o_.getPartIndex(t),n=o_.getCharIndex(t);return new uQe(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 r=0,o=this.length-1;for(;r+1>>1,v=this._data[m];if(v===n)return m;v>n?o=m:r=m}if(r===o)return r;const a=this._data[r],c=this._data[o];if(a===n)return r;if(c===n)return o;const l=o_.getPartIndex(a),d=o_.getCharIndex(a),h=o_.getPartIndex(c);let u;l!==h?u=t:u=o_.getCharIndex(c);const f=i-d,p=u-i;return f<=p?r:o}inflate(){const e=[];for(let t=0;t0){e.appendString("");let t=0,i=0,n=Yu.None;for(const o of s.lineDecorations)(o.type===Xa.Before||o.type===Xa.After)&&(e.appendString(''),o.type===Xa.Before&&(n|=Yu.Before,t++),o.type===Xa.After&&(n|=Yu.After,i++));e.appendString("");const r=new o_(1,t+i);return r.setColumnInfo(1,t,0,0),new Xpe(r,!1,n)}return e.appendString(""),new Xpe(new o_(0,0),!1,Yu.None)}return spt(Xft(s),e)}class Yft{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function aae(s){const e=new kU(1e4),t=p6(s,e);return new Yft(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class Jft{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=r,this.overflowingCharCount=o,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 Xft(s){const e=s.lineContent;let t,i,n;s.stopRenderingLineAfter!==-1&&s.stopRenderingLineAfter0){for(let a=0,c=s.lineDecorations.length;a0&&(r[o++]=new cl(i,"",0,!1));let a=i;for(let c=0,l=t.getCount();c=n){const f=e?R2(s.substring(a,n)):!1;r[o++]=new cl(n,h,0,f);break}const u=e?R2(s.substring(a,d)):!1;r[o++]=new cl(d,h,0,u),a=d}return r}var $0;(function(s){s[s.LongToken=50]="LongToken"})($0||($0={}));function ept(s,e,t){let i=0;const n=[];let r=0;if(t)for(let o=0,a=e.length;o=$0.LongToken&&(n[r++]=new cl(f+1,d,h,u),p=f+1,f=-1);p!==l&&(n[r++]=new cl(l,d,h,u))}else n[r++]=c;i=l}else for(let o=0,a=e.length;o$0.LongToken){const h=c.type,u=c.metadata,f=c.containsRTL,p=Math.ceil(d/$0.LongToken);for(let m=1;m=8234&&s<=8238||s>=8294&&s<=8297||s>=8206&&s<=8207||s===1564}function tpt(s,e){const t=[];let i=new cl(0,"",0,!1),n=0;for(const r of e){const o=r.endIndex;for(;ni.endIndex&&(i=new cl(n,r.type,r.metadata,r.containsRTL),t.push(i)),i=new cl(n+1,"mtkcontrol",r.metadata,!1),t.push(i))}n>i.endIndex&&(i=new cl(o,r.type,r.metadata,r.containsRTL),t.push(i))}return t}function ipt(s,e,t,i){const n=s.continuesWithWrappedLine,r=s.fauxIndentLength,o=s.tabSize,a=s.startVisibleColumn,c=s.useMonospaceOptimizations,l=s.selectionsOnLine,d=s.renderWhitespace===tp.Boundary,h=s.renderWhitespace===tp.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=Th(e),L;A===-1?(C=!0,A=t,L=t):L=M_(e);let k=!1,P=0,R=l&&l[P],z=a%o;for(let Y=r;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>=o){if(u){const ge=p>0?f[p-1].endIndex:r;for(let De=ge+1;De<=Y;De++)f[p++]=new cl(De,"mtkw",by.IS_WHITESPACE,!1)}else f[p++]=new cl(Y,"mtkw",by.IS_WHITESPACE,!1);z=z%o}}else(Y===w||ne&&Y>r)&&(f[p++]=new cl(Y,v,0,b),z=z%o);for(j===B.Tab?z=o:Fk(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:r;for(let j=Y+1;j<=t;j++)f[p++]=new cl(j,"mtkw",by.IS_WHITESPACE,!1)}else f[p++]=new cl(t,"mtkw",by.IS_WHITESPACE,!1);else f[p++]=new cl(t,v,0,b);return f}function npt(s,e,t,i){i.sort(iu.compare);const n=jft.normalize(s,i),r=n.length;let o=0;const a=[];let c=0,l=0;for(let h=0,u=t.length;hl&&(l=w.startOffset,a[c++]=new cl(l,m,v,b)),w.endOffset+1<=p)l=w.endOffset+1,a[c++]=new cl(l,m+" "+w.className,v|w.metadata,b),o++;else{l=p,a[c++]=new cl(l,m+" "+w.className,v|w.metadata,b);break}}p>l&&(l=p,a[c++]=new cl(l,m,v,b))}const d=t[t.length-1].endIndex;if(o'):e.appendString("");for(let R=0,z=l.length;R=d&&(dt+=Xi)}}for(De&&(e.appendString(' style="width:'),e.appendString(String(p*Ct)),e.appendString('px"')),e.appendASCIICharCode(B.GreaterThan);C1?e.appendCharCode(8594):e.appendCharCode(65515);for(let Xi=2;Xi<=Dt;Xi++)e.appendCharCode(160)}else dt=2,Dt=1,e.appendCharCode(m),e.appendCharCode(8204);L+=dt,k+=Dt,C>=d&&(A+=Dt)}}else for(e.appendASCIICharCode(B.GreaterThan);C=d&&(A+=dt)}Be?P++:P=0,C>=o&&!y&&G.isPseudoAfter()&&(y=!0,w.setColumnInfo(C+1,R,L,k)),e.appendString("")}return y||w.setColumnInfo(o+1,l.length-1,L,k),a&&(e.appendString(''),e.appendString(g(9364,"Show more ({0})",opt(c))),e.appendString("")),e.appendString(""),new Xpe(w,f,n)}function rpt(s){return s.toString(16).toUpperCase().padStart(4,"0")}function opt(s){return s<1024?g(9365,"{0} chars",s):s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}var apt=".monaco-aria-container{left:-999em;position:absolute}";gt(apt,{});const lBe=2e4;let G0,Oq,Zpe,Bq,eme;function cpt(s){G0=document.createElement("div"),G0.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"),G0.appendChild(i),i};Oq=e(),Zpe=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),G0.appendChild(i),i};Bq=t(),eme=t(),s.appendChild(G0)}function No(s){G0&&(Oq.textContent!==s?(Ns(Zpe),fY(Oq,s)):(Ns(Oq),fY(Zpe,s)))}function xh(s){G0&&(Bq.textContent!==s?(Ns(eme),fY(Bq,s)):(Ns(Bq),fY(eme,s)))}function fY(s,e){Ns(s),e.length>lBe&&(e=e.substr(0,lBe)),s.textContent=e,s.style.visibility="hidden",s.style.visibility="visible"}const eLe=ae("markerDecorationsService");var yB;let pY=(yB=class{constructor(e,t){}dispose(){}},yB.ID="editor.contrib.markerDecorations",yB);pY=D([_(1,eLe)],pY);on(pY.ID,pY,ai.Eager);var lpt='::-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)}';gt(lpt,{});class fQe 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 r=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{Nl(lt(this._referenceDomElement),()=>{n=!1,r()})}};this._resizeObserver=new ResizeObserver(o=>{o&&o[0]&&o[0].contentRect?e={width:o[0].contentRect.width,height:o[0].contentRect.height}:e=null,i=!0,r()}),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 YF=class YF{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=YF._read(e,this.key),i=r=>YF._read(e,r),n=(r,o)=>YF._write(e,r,o);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 r=t.substring(0,n);e[r]=e[r]||{},this._write(e[r],t.substring(n+1),i);return}e[t]=i}};YF.items=[];let Q8=YF;function Gb(s,e){Q8.items.push(new Q8(s,e))}function _f(s,e){Gb(s,(t,i,n)=>{if(typeof t<"u"){for(const[r,o]of e)if(t===r){n(s,o);return}}})}function dpt(s){Q8.items.forEach(e=>e.apply(s))}_f("wordWrap",[[!0,"on"],[!1,"off"]]);_f("lineNumbers",[[!0,"on"],[!1,"off"]]);_f("cursorBlinking",[["visible","solid"]]);_f("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);_f("renderLineHighlight",[[!0,"line"],[!1,"none"]]);_f("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);_f("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);_f("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);_f("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);_f("autoIndent",[[!1,"advanced"],[!0,"full"]]);_f("matchBrackets",[[!0,"always"],[!1,"never"]]);_f("renderFinalNewline",[[!0,"on"],[!1,"off"]]);_f("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);_f("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);_f("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);Gb("autoClosingBrackets",(s,e,t)=>{s===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Gb("renderIndentGuides",(s,e,t)=>{typeof s<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!s))});Gb("highlightActiveIndentGuide",(s,e,t)=>{typeof s<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!s))});const hpt={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"};Gb("suggest.filteredTypes",(s,e,t)=>{if(s&&typeof s=="object"){for(const i of Object.entries(hpt))s[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});Gb("quickSuggestions",(s,e,t)=>{if(typeof s=="boolean"){const i=s?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});Gb("experimental.stickyScroll.enabled",(s,e,t)=>{typeof s=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",s))});Gb("experimental.stickyScroll.maxLineCount",(s,e,t)=>{typeof s=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",s))});Gb("codeActionsOnSave",(s,e,t)=>{if(s&&typeof s=="object"){let i=!1;const n={};for(const r of Object.entries(s))typeof r[1]=="boolean"?(i=!0,n[r[0]]=r[1]?"explicit":"never"):n[r[0]]=r[1];i&&t("codeActionsOnSave",n)}});Gb("codeActionWidget.includeNearbyQuickfixes",(s,e,t)=>{typeof s=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",s))});Gb("lightbulb.enabled",(s,e,t)=>{typeof s=="boolean"&&t("lightbulb.enabled",s?void 0:"off")});class upt{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 Uk=new upt,_o=ae("accessibilityService");let tme=class extends V{constructor(e,t,i,n,r,o){super(),this._accessibilityService=o,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 EKe,this.isSimpleWidget=e,this.contextMenuId=t,this.isStandaloneEditor=i,this._containerObserver=this._register(new fQe(r,n.dimension)),this._targetWindowId=lt(r).vscodeWindowId,this._rawOptions=dBe(n),this._validatedOptions=gS.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(x.automaticLayout)&&this._containerObserver.startObserving(),this._register(Jp.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Uk.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(Ppe.onDidChange(()=>this._recomputeOptions())),this._register(W8.getInstance(lt(r)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=gS.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=xx.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:Uk.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return gS.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:fpt(this.isStandaloneEditor),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:AT||lf,pixelRatio:W8.getInstance(Zj(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?Zl.Enabled:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return Ppe.readFontInfo(Zj(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=dBe(e);gS.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=gS.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=gpt(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())}};tme=D([_(5,_o)],tme);function gpt(s){let e=0;for(;s;)s=Math.floor(s/10),e++;return e||1}function fpt(s){let e="";return!Yy&&!UKe&&(e+="no-user-select "),Yy&&(e+="no-minimap-shadow ",e+="enable-user-select "),jt&&(e+="mac "),s&&(e+="standalone "),e}class ppt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class mpt{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 gS{static validateOptions(e){const t=new ppt;for(const i of nF){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 mpt;for(const n of nF)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)?ns(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!gS._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const r of nF){const o=!gS._deepEquals(e._read(r.id),t._read(r.id));i[r.id]=o,o&&(n=!0)}return n?new AKe(i):null}static applyUpdate(e,t){let i=!1;for(const n of nF)if(t.hasOwnProperty(n.name)){const r=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=r.newValue,i=i||r.didChange}return i}}function dBe(s){const e=Ds(s);return dpt(e),e}var Dx;(function(s){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},n={...e};let r=0,o;(function(P){P[P.Before=0]="Before",P[P.InProgress=1]="InProgress",P[P.Finished=2]="Finished"})(o||(o={}));const a={keydown:o.Before,input:o.Before,render:o.Before};function c(){w(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),a.keydown=o.InProgress,queueMicrotask(l)}s.onKeyDown=c;function l(){a.keydown===o.InProgress&&(performance.mark("keydown/end"),a.keydown=o.Finished)}function d(){performance.mark("input/start"),a.input=o.InProgress,b()}s.onBeforeInput=d;function h(){a.input===o.Before&&d(),queueMicrotask(u)}s.onInput=h;function u(){a.input===o.InProgress&&(performance.mark("input/end"),a.input=o.Finished)}function f(){w()}s.onKeyUp=f;function p(){w()}s.onSelectionChange=p;function m(){a.keydown===o.Finished&&a.input===o.Finished&&a.render===o.Before&&(performance.mark("render/start"),a.render=o.InProgress,queueMicrotask(v),b())}s.onRenderStart=m;function v(){a.render===o.InProgress&&(performance.mark("render/end"),a.render=o.Finished)}function b(){setTimeout(w)}function w(){a.keydown===o.Finished&&a.input===o.Finished&&a.render===o.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),r++,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=o.Before,a.input=o.Before,a.render=o.Before}function A(){if(r===0)return;const P={keydown:L(e),input:L(t),render:L(i),total:L(n),sampleCount:r};return k(e),k(t),k(i),k(n),r=0,P}s.getAndClearMeasurements=A;function L(P){return{average:P.total/r,max:P.max,min:P.min}}function k(P){P.total=0,P.min=Number.MAX_VALUE,P.max=0}})(Dx||(Dx={}));var ts;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(ts||(ts={}));var Vg;(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"})(Vg||(Vg={}));var Mt;(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"})(Mt||(Mt={}));function jo(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===TU.ICodeEditor:!1}function rm(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===TU.IDiffEditor:!1}function K2(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function m6(s){return jo(s)?s:rm(s)?s.getModifiedEditor():K2(s)&&jo(s.activeCodeEditor)?s.activeCodeEditor:null}function _pt(s){return jo(s)||rm(s)?s:null}class LU{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,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=r;let o=e;try{e.setPointerCapture(t),this._hooks.add(Ee(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=lt(e)}this._hooks.add(ue(o,ke.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ue(o,ke.POINTER_UP,a=>this.stopMonitoring(!0)))}}function cae(s){return`--vscode-${s.replace(/\./g,"-")}`}function $e(s){return`var(${cae(s)})`}function ime(s,e){return`var(${cae(s)}, ${e})`}var Ou;(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"})(Ou||(Ou={}));function vpt(s){return s!==null&&typeof s=="object"&&"light"in s&&"dark"in s}const tLe={ColorContribution:"base.contributions.colors"},bpt="default";class wpt{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,r){const o={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:r};this.colorsById[e]=o;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return r&&(a.deprecationMessage=r),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:bpt,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=vpt(i.defaults)?i.defaults[t.type]:i.defaults;return wv(n,t)}}getColorSchema(){return this.colorSchema}getColorReferenceSchema(){return this.colorReferenceSchema}toString(){const e=(t,i)=>{const n=t.indexOf(".")===-1?0:1,r=i.indexOf(".")===-1?0:1;return n!==r?n-r:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const lae=new wpt;je.add(tLe.ColorContribution,lae);function W(s,e,t,i,n){return lae.registerColor(s,e,t,i,n)}function ypt(s,e){switch(s.op){case Ou.Darken:return wv(s.value,e)?.darken(s.factor);case Ou.Lighten:return wv(s.value,e)?.lighten(s.factor);case Ou.Transparent:return wv(s.value,e)?.transparent(s.factor);case Ou.Opaque:{const t=wv(s.background,e);return t?wv(s.value,e)?.makeOpaque(t):wv(s.value,e)}case Ou.OneOf:for(const t of s.values){const i=wv(t,e);if(i)return i}return;case Ou.IfDefinedThenElse:return wv(e.defines(s.if)?s.then:s.else,e);case Ou.LessProminent:{const t=wv(s.value,e);if(!t)return;const i=wv(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 h6()}}function vp(s,e){return{op:Ou.Darken,value:s,factor:e}}function P_(s,e){return{op:Ou.Lighten,value:s,factor:e}}function rt(s,e){return{op:Ou.Transparent,value:s,factor:e}}function hBe(s,e){return{op:Ou.Opaque,value:s,background:e}}function j8(...s){return{op:Ou.OneOf,values:s}}function Cpt(s,e,t){return{op:Ou.IfDefinedThenElse,if:s,then:e,else:t}}function uBe(s,e,t,i){return{op:Ou.LessProminent,value:s,background:e,factor:t,transparency:i}}function wv(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 ypt(s,e)}}const pQe="vscode://schemas/workbench-colors",mQe=je.as(tE.JSONContribution);mQe.registerSchema(pQe,lae.getColorSchema());const gBe=new ln(()=>mQe.notifySchemaChanged(pQe),200);lae.onDidChangeSchema(()=>{gBe.isScheduled()||gBe.schedule()});const $i=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.")),fBe=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.")),pBe=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:rt($i,.7),hcDark:rt($i,.7),hcLight:rt($i,.7)},g(1699,"Foreground color for description text providing additional information, for example for a label."));const mY=W("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},g(1700,"The default color for icons in the workbench.")),bp=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.")),yt=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.")),Xs=W("contrastActiveBorder",{light:null,dark:null,hcDark:bp,hcLight:bp},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 iLe=W("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(1705,"Foreground color for links in text.")),Spt=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 Apt=W("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},g(1710,"Background color for block quotes in text.")),Ept=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",bp,g(1908,"Border color of active sashes."));const DT=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.")),dae=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.")),_6=W("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},g(1911,"Scrollbar shadow to indicate that the view is scrolled.")),_Qe=W("scrollbarSlider.background",{dark:me.fromHex("#797979").transparent(.4),light:me.fromHex("#646464").transparent(.4),hcDark:rt(yt,.6),hcLight:rt(yt,.4)},g(1912,"Scrollbar slider background color.")),vQe=W("scrollbarSlider.hoverBackground",{dark:me.fromHex("#646464").transparent(.7),light:me.fromHex("#646464").transparent(.7),hcDark:rt(yt,.8),hcLight:rt(yt,.8)},g(1913,"Scrollbar slider background color when hovering.")),bQe=W("scrollbarSlider.activeBackground",{dark:me.fromHex("#BFBFBF").transparent(.4),light:me.fromHex("#000000").transparent(.6),hcDark:yt,hcLight:yt},g(1914,"Scrollbar slider background color when clicked on.")),xpt=W("progressBar.background",{dark:me.fromHex("#0E70C0"),light:me.fromHex("#0E70C0"),hcDark:yt,hcLight:yt},g(1915,"Background color of the progress bar that can show for long running operations.")),Uc=W("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:me.black,hcLight:me.white},g(1721,"Editor background color.")),Pl=W("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:me.white,hcLight:$i},g(1722,"Editor default foreground color."));W("editorStickyScroll.background",Uc,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:yt,hcLight:yt},g(1725,"Border color of sticky scroll in the editor"));W("editorStickyScroll.shadow",_6,g(1726," Shadow color of sticky scroll in the editor"));const kh=W("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:me.white},g(1727,"Background color of editor widgets, such as find/replace.")),PN=W("editorWidget.foreground",$i,g(1728,"Foreground color of editor widgets, such as find/replace.")),v6=W("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:yt,hcLight:yt},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 FN=W("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},g(1732,"Foreground color of error squigglies in the editor.")),Dpt=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.")),kpt=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),vm=W("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},g(1735,"Foreground color of warning squigglies in the editor.")),Y8=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 bm=W("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},g(1738,"Foreground color of info squigglies in the editor.")),J8=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.")),Ipt=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 Tpt=W("editorLink.activeForeground",{dark:"#4E94CE",light:me.blue,hcDark:me.cyan,hcLight:"#292929"},g(1742,"Color of active links.")),kS=W("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},g(1743,"Color of the editor selection.")),Lpt=W("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:me.white},g(1744,"Color of the selected text for high contrast.")),wQe=W("editor.inactiveSelectionBackground",{light:rt(kS,.5),dark:rt(kS,.5),hcDark:rt(kS,.7),hcLight:rt(kS,.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),nLe=W("editor.selectionHighlightBackground",{light:uBe(kS,Uc,.3,.6),dark:uBe(kS,Uc,.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:Xs,hcLight:Xs},g(1747,"Border color for regions with the same content as the selection."));const mBe=W("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},g(1748,"Color of the current search match.")),Rpt=W("editor.findMatchForeground",null,g(1749,"Text color of the current search match.")),yb=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),Mpt=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:Xs,hcLight:Xs},g(1753,"Border color of the current search match."));const kx=W("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Xs,hcLight:Xs},g(1754,"Border color of the other search matches.")),Npt=W("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:rt(Xs,.4),hcLight:rt(Xs,.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),Ppt=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),_Y=W("editorHoverWidget.background",kh,g(1757,"Background color of the editor hover."));W("editorHoverWidget.foreground",PN,g(1758,"Foreground color of the editor hover."));const yQe=W("editorHoverWidget.border",v6,g(1759,"Border color of the editor hover."));W("editorHoverWidget.statusBarBackground",{dark:P_(_Y,.2),light:vp(_Y,.05),hcDark:kh,hcLight:kh},g(1760,"Background color of the editor hover status bar."));const sLe=W("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:me.white,hcLight:me.black},g(1761,"Foreground color of inline hints")),rLe=W("editorInlayHint.background",{dark:rt(DT,.1),light:rt(DT,.1),hcDark:rt(me.white,.1),hcLight:rt(DT,.1)},g(1762,"Background color of inline hints")),Fpt=W("editorInlayHint.typeForeground",sLe,g(1763,"Foreground color of inline hints for types")),Opt=W("editorInlayHint.typeBackground",rLe,g(1764,"Background color of inline hints for types")),Bpt=W("editorInlayHint.parameterForeground",sLe,g(1765,"Foreground color of inline hints for parameters")),Wpt=W("editorInlayHint.parameterBackground",rLe,g(1766,"Background color of inline hints for parameters")),Hpt=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",Hpt,g(1769,"The color used for the lightbulb AI icon."));W("editor.snippetTabstopHighlightBackground",{dark:new me(new hn(124,124,124,.3)),light:new me(new hn(10,50,100,.2)),hcDark:new me(new hn(124,124,124,.3)),hcLight:new me(new hn(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 hn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},g(1773,"Highlight border color of the final tabstop of a snippet."));const nme=new me(new hn(155,185,85,.2)),sme=new me(new hn(255,0,0,.2)),wy=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),cF=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:nme,light:nme,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:sme,light:sme,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 Upt=W("diffEditorOverview.insertedForeground",null,g(1780,"Diff overview ruler foreground for inserted content.")),Vpt=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:yt,hcLight:yt},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 kI=W("widget.shadow",{dark:rt(me.black,.36),light:rt(me.black,.16),hcDark:null,hcLight:null},g(1789,"Shadow color of widgets such as find/replace inside the editor.")),q2=W("widget.border",{dark:null,light:null,hcDark:yt,hcLight:yt},g(1790,"Border color of widgets such as find/replace inside the editor.")),vY=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:Xs,hcLight:Xs},g(1792,"Toolbar outline when hovering over actions using the mouse"));W("toolbar.activeBackground",{dark:P_(vY,.1),light:vp(vY,.1),hcDark:null,hcLight:null},g(1793,"Toolbar background when holding the mouse over actions"));const zpt=W("breadcrumb.foreground",rt($i,.8),g(1794,"Color of focused breadcrumb items.")),$pt=W("breadcrumb.background",Uc,g(1795,"Background color of breadcrumb items.")),_Be=W("breadcrumb.focusForeground",{light:vp($i,.2),dark:P_($i,.1),hcDark:P_($i,.1),hcLight:P_($i,.1)},g(1794,"Color of focused breadcrumb items.")),Gpt=W("breadcrumb.activeSelectionForeground",{light:vp($i,.2),dark:P_($i,.1),hcDark:P_($i,.1),hcLight:P_($i,.1)},g(1796,"Color of selected breadcrumb items."));W("breadcrumbPicker.background",kh,g(1797,"Background color of breadcrumb item picker."));const CQe=.5,vBe=me.fromHex("#40C8AE").transparent(CQe),bBe=me.fromHex("#40A6FF").transparent(CQe),wBe=me.fromHex("#606060").transparent(.4),oLe=.4,Q2=1,rme=W("merge.currentHeaderBackground",{dark:vBe,light:vBe,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",rt(rme,oLe),g(1799,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const ome=W("merge.incomingHeaderBackground",{dark:bBe,light:bBe,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",rt(ome,oLe),g(1801,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const ame=W("merge.commonHeaderBackground",{dark:wBe,light:wBe,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",rt(ame,oLe),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 j2=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:rt(rme,Q2),light:rt(rme,Q2),hcDark:j2,hcLight:j2},g(1805,"Current overview ruler foreground for inline merge-conflicts."));W("editorOverviewRuler.incomingContentForeground",{dark:rt(ome,Q2),light:rt(ome,Q2),hcDark:j2,hcLight:j2},g(1806,"Incoming overview ruler foreground for inline merge-conflicts."));W("editorOverviewRuler.commonContentForeground",{dark:rt(ame,Q2),light:rt(ame,Q2),hcDark:j2,hcLight:j2},g(1807,"Common ancestor overview ruler foreground for inline merge-conflicts."));const u5=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),SQe=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),Kpt=W("problemsErrorIcon.foreground",FN,g(1810,"The color used for the problems error icon.")),qpt=W("problemsWarningIcon.foreground",vm,g(1811,"The color used for the problems warning icon.")),Qpt=W("problemsInfoIcon.foreground",bm,g(1812,"The color used for the problems info icon.")),cme=W("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},g(1897,"Minimap marker color for find matches."),!0),hae=W("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1898,"Minimap marker color for repeating editor selections."),!0),yBe=W("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1899,"Minimap marker color for the editor selection."),!0),jpt=W("minimap.infoHighlight",{dark:bm,light:bm,hcDark:J8,hcLight:J8},g(1900,"Minimap marker color for infos.")),Ypt=W("minimap.warningHighlight",{dark:vm,light:vm,hcDark:Y8,hcLight:Y8},g(1901,"Minimap marker color for warnings.")),Jpt=W("minimap.errorHighlight",{dark:new me(new hn(255,18,18,.7)),light:new me(new hn(255,18,18,.7)),hcDark:new me(new hn(255,50,50,1)),hcLight:"#B5200D"},g(1902,"Minimap marker color for errors.")),Xpt=W("minimap.background",null,g(1903,"Minimap background color.")),Zpt=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",rt(_Qe,.5),g(1905,"Minimap slider background color."));W("minimapSlider.hoverBackground",rt(vQe,.5),g(1906,"Minimap slider background color when hovering."));W("minimapSlider.activeBackground",rt(bQe,.5),g(1907,"Minimap slider background color when clicked on."));W("charts.foreground",$i,g(1713,"The foreground color used in charts."));W("charts.lines",rt($i,.5),g(1714,"The color used for horizontal lines in charts."));W("charts.red",FN,g(1715,"The red color used in chart visualizations."));W("charts.blue",bm,g(1716,"The blue color used in chart visualizations."));W("charts.yellow",vm,g(1717,"The yellow color used in chart visualizations."));W("charts.orange",cme,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 Y2=W("input.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},g(1813,"Input box background.")),AQe=W("input.foreground",$i,g(1814,"Input box foreground.")),g5=W("input.border",{dark:null,light:null,hcDark:yt,hcLight:yt},g(1815,"Input box border.")),uae=W("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:yt,hcLight:yt},g(1816,"Border color of activated options in input fields.")),emt=W("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},g(1817,"Background color of activated options in input fields.")),b6=W("inputOption.activeBackground",{dark:rt(bp,.4),light:rt(bp,.2),hcDark:me.transparent,hcLight:me.transparent},g(1818,"Background hover color of options in input fields.")),gae=W("inputOption.activeForeground",{dark:me.white,light:me.black,hcDark:$i,hcLight:$i},g(1819,"Foreground color of activated options in input fields.")),tmt=W("input.placeholderForeground",{light:rt($i,.5),dark:rt($i,.5),hcDark:rt($i,.7),hcLight:rt($i,.7)},g(1820,"Input box foreground color for placeholder text.")),imt=W("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:me.black,hcLight:me.white},g(1821,"Input validation background color for information severity.")),nmt=W("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:$i},g(1822,"Input validation foreground color for information severity.")),smt=W("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:yt,hcLight:yt},g(1823,"Input validation border color for information severity.")),rmt=W("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:me.black,hcLight:me.white},g(1824,"Input validation background color for warning severity.")),omt=W("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:$i},g(1825,"Input validation foreground color for warning severity.")),amt=W("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:yt,hcLight:yt},g(1826,"Input validation border color for warning severity.")),EQe=W("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:me.black,hcLight:me.white},g(1827,"Input validation background color for error severity.")),xQe=W("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:$i},g(1828,"Input validation foreground color for error severity.")),DQe=W("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:yt,hcLight:yt},g(1829,"Input validation border color for error severity.")),fae=W("dropdown.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},g(1830,"Dropdown background.")),cmt=W("dropdown.listBackground",{dark:null,light:null,hcDark:me.black,hcLight:me.white},g(1831,"Dropdown list background.")),aLe=W("dropdown.foreground",{dark:"#F0F0F0",light:$i,hcDark:me.white,hcLight:$i},g(1832,"Dropdown foreground.")),cLe=W("dropdown.border",{dark:fae,light:"#CECECE",hcDark:yt,hcLight:yt},g(1833,"Dropdown border.")),EM=W("button.foreground",me.white,g(1834,"Button foreground color.")),kQe=W("button.separator",rt(EM,.4),g(1835,"Button separator color.")),yy=W("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},g(1836,"Button background color.")),X8=W("button.hoverBackground",{dark:P_(yy,.2),light:vp(yy,.2),hcDark:yy,hcLight:yy},g(1837,"Button background color when hovering.")),lmt=W("button.border",yt,g(1838,"Button border color.")),dmt=W("button.secondaryForeground",{dark:me.white,light:me.white,hcDark:me.white,hcLight:$i},g(1839,"Secondary button foreground color.")),lme=W("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:me.white},g(1840,"Secondary button background color.")),hmt=W("button.secondaryHoverBackground",{dark:P_(lme,.2),light:vp(lme,.2),hcDark:null,hcLight:null},g(1841,"Secondary button background color when hovering.")),aV=W("radio.activeForeground",gae,g(1842,"Foreground color of active radio option.")),umt=W("radio.activeBackground",b6,g(1843,"Background color of active radio option.")),gmt=W("radio.activeBorder",uae,g(1844,"Border color of the active radio option.")),fmt=W("radio.inactiveForeground",null,g(1845,"Foreground color of inactive radio option.")),pmt=W("radio.inactiveBackground",null,g(1846,"Background color of inactive radio option.")),mmt=W("radio.inactiveBorder",{light:rt(aV,.2),dark:rt(aV,.2),hcDark:rt(aV,.4),hcLight:rt(aV,.2)},g(1847,"Border color of the inactive radio option.")),_mt=W("radio.inactiveHoverBackground",emt,g(1848,"Background color of inactive active radio option when hovering.")),vmt=W("checkbox.background",fae,g(1849,"Background color of checkbox widget."));W("checkbox.selectBackground",kh,g(1850,"Background color of checkbox widget when the element it's in is selected."));const bmt=W("checkbox.foreground",aLe,g(1851,"Foreground color of checkbox widget.")),wmt=W("checkbox.border",cLe,g(1852,"Border color of checkbox widget."));W("checkbox.selectBorder",mY,g(1853,"Border color of checkbox widget when the element it's in is selected."));const ymt=W("keybindingLabel.background",{dark:new me(new hn(128,128,128,.17)),light:new me(new hn(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.")),Cmt=W("keybindingLabel.foreground",{dark:me.fromHex("#CCCCCC"),light:me.fromHex("#555555"),hcDark:me.white,hcLight:$i},g(1855,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Smt=W("keybindingLabel.border",{dark:new me(new hn(51,51,51,.6)),light:new me(new hn(204,204,204,.4)),hcDark:new me(new hn(111,195,223)),hcLight:yt},g(1856,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Amt=W("keybindingLabel.bottomBorder",{dark:new me(new hn(68,68,68,.6)),light:new me(new hn(187,187,187,.4)),hcDark:new me(new hn(111,195,223)),hcLight:$i},g(1857,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Emt=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.")),xmt=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.")),dme=W("list.focusOutline",{dark:bp,light:bp,hcDark:Xs,hcLight:Xs},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.")),Dmt=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.")),Cy=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.")),Z8=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.")),IQe=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.")),hme=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.")),kmt=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.")),Imt=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.")),Tmt=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.")),Lmt=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.")),TQe=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.")),Rmt=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.")),Mmt=W("list.dropBetweenBackground",{dark:mY,light:mY,hcDark:null,hcLight:null},g(1873,"List/Tree drag and drop border color when moving items between items when using the mouse.")),lF=W("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:bp,hcLight:bp},g(1874,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),Nmt=W("list.focusHighlightForeground",{dark:lF,light:Cpt(Cy,lF,"#BBE7FF"),hcDark:lF,hcLight:lF},g(1875,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),Pmt=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.")),CBe=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 Fmt=W("listFilterWidget.background",{light:vp(kh,0),dark:P_(kh,0),hcDark:kh,hcLight:kh},g(1879,"Background color of the type filter widget in lists and trees.")),Omt=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.")),Bmt=W("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:yt,hcLight:yt},g(1881,"Outline color of the type filter widget in lists and trees, when there are no matches.")),Wmt=W("listFilterWidget.shadow",kI,g(1882,"Shadow color of the type filter widget in lists and trees."));W("list.filterMatchBackground",{dark:yb,light:yb,hcDark:null,hcLight:null},g(1883,"Background color of the filtered match."));W("list.filterMatchBorder",{dark:kx,light:kx,hcDark:yt,hcLight:Xs},g(1884,"Border color of the filtered match."));const Hmt=W("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},g(1885,"List/Tree foreground color for items that are deemphasized.")),bY=W("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},g(1886,"Tree stroke color for the indentation guides.")),Umt=W("tree.inactiveIndentGuidesStroke",rt(bY,.4),g(1887,"Tree stroke color for the indentation guides that are not active.")),Vmt=W("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},g(1888,"Table border color between columns.")),zmt=W("tree.tableOddRowsBackground",{dark:rt($i,.04),light:rt($i,.04),hcDark:null,hcLight:null},g(1889,"Background color for odd table rows.")),$mt=W("menu.border",{dark:null,light:null,hcDark:yt,hcLight:yt},g(1890,"Border color of menus.")),Gmt=W("menu.foreground",aLe,g(1891,"Foreground color of menu items.")),Kmt=W("menu.background",fae,g(1892,"Background color of menu items.")),qmt=W("menu.selectionForeground",Z8,g(1893,"Foreground color of the selected menu item in menus.")),Qmt=W("menu.selectionBackground",Cy,g(1894,"Background color of the selected menu item in menus.")),jmt=W("menu.selectionBorder",{dark:null,light:null,hcDark:Xs,hcLight:Xs},g(1895,"Border color of the selected menu item in menus.")),Ymt=W("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:yt,hcLight:yt},g(1896,"Color of a separator menu item in menus.")),SBe=W("quickInput.background",kh,g(1916,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Jmt=W("quickInput.foreground",PN,g(1917,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Xmt=W("quickInputTitle.background",{dark:new me(new hn(255,255,255,.105)),light:new me(new hn(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.")),RQe=W("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:me.white,hcLight:"#0F4A85"},g(1919,"Quick picker color for grouping labels.")),Zmt=W("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:me.white,hcLight:"#0F4A85"},g(1920,"Quick picker color for grouping borders.")),ABe=W("quickInput.list.focusBackground",null,"",void 0,g(1921,"Please use quickInputList.focusBackground instead")),e3=W("quickInputList.focusForeground",Z8,g(1922,"Quick picker foreground color for the focused item.")),lLe=W("quickInputList.focusIconForeground",IQe,g(1923,"Quick picker icon foreground color for the focused item.")),t3=W("quickInputList.focusBackground",{dark:j8(ABe,Cy),light:j8(ABe,Cy),hcDark:null,hcLight:null},g(1924,"Quick picker background color for the focused item."));W("search.resultsInfoForeground",{light:$i,dark:rt($i,.65),hcDark:$i,hcLight:$i},g(1925,"Color of the text in the search viewlet's completion message."));W("searchEditor.findMatchBackground",{light:rt(yb,.66),dark:rt(yb,.66),hcDark:yb,hcLight:yb},g(1926,"Color of the Search Editor query matches."));W("searchEditor.findMatchBorder",{light:rt(kx,.66),dark:rt(kx,.66),hcDark:kx,hcLight:kx},g(1927,"Border color of the Search Editor query matches."));class pae{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new MQe(this.x-e.scrollX,this.y-e.scrollY)}}class MQe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new pae(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class e_t{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class t_t{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function dLe(s){const e=So(s);return new e_t(e.left,e.top,e.width,e.height)}function hLe(s,e,t){const i=e.width/s.offsetWidth,n=e.height/s.offsetHeight,r=(t.x-e.x)/i,o=(t.y-e.y)/n;return new t_t(r,o)}class Vk extends Dh{constructor(e,t,i){super(lt(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new pae(this.posx,this.posy),this.editorPos=dLe(i),this.relativePos=hLe(i,this.editorPos,this.pos)}}class i_t{constructor(e){this._editorViewDomNode=e}_create(e){return new Vk(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 n_t{constructor(e){this._editorViewDomNode=e}_create(e){return new Vk(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 s_t extends V{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new LU),this._keydownListener=null}startMonitoring(e,t,i,n,r){this._keydownListener=Rr(e.ownerDocument,"keydown",o=>{o.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,o.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,o=>{n(new Vk(o,!0,this._editorViewDomNode))},o=>{this._keydownListener.dispose(),r(o)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}const hse=class hse{constructor(e){this._editor=e,this._instanceId=++hse._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new ln(()=>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 r_t(t,`dyn-rule-${this._instanceId}-${n}`,F8(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())}};hse._idPool=0;let wY=hse;class r_t{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new Z,this._styleElement=fl(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 r=t[n];let o;typeof r=="object"?o=$e(r.id):o=r;const a=o_t(n);i+=` ${a}: ${o};`}return i+=` -}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function o_t(s){return s.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}var cr;(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"})(cr||(cr={}));class a_t{constructor(){this.type=cr.ViewCompositionStart}}class c_t{constructor(){this.type=cr.ViewCompositionEnd}}class l_t{constructor(e){this.type=cr.ViewConfigurationChanged,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class d_t{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=cr.ViewCursorStateChanged}}class HI{constructor(e){this.type=cr.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 zG{constructor(){this.type=cr.ViewFlushed}}class h_t{constructor(e){this.type=cr.ViewFocusChanged,this.isFocused=e}}class u_t{constructor(){this.type=cr.ViewLanguageConfigurationChanged}}class $G{constructor(){this.type=cr.ViewLineMappingChanged}}class NQe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=cr.ViewLinesChanged}}class ume{constructor(e,t){this.type=cr.ViewLinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class gme{constructor(e,t){this.type=cr.ViewLinesInserted,this.fromLineNumber=e,this.toLineNumber=t}}var vs;(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"})(vs||(vs={}));class f5{constructor(e,t,i,n,r,o,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=r,this.revealHorizontal=o,this.scrollType=a,this.type=cr.ViewRevealRangeRequest}}class g_t{constructor(e){this.type=cr.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 f_t{constructor(e){this.theme=e,this.type=cr.ViewThemeChanged}}class p_t{constructor(e){this.type=cr.ViewTokensChanged,this.ranges=e}}class m_t{constructor(){this.type=cr.ViewTokensColorsChanged}}let __t=class{constructor(){this.type=cr.ViewZonesChanged}};class w6 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 mae{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 r=0,o=e.length;rc)return null;if(t=Math.min(c,Math.max(0,t)),n=Math.min(c,Math.max(0,n)),t===n&&i===r&&i===0&&!e.children[t].firstChild){const u=e.children[t].getClientRects();return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,o.clientRectDeltaLeft,o.clientRectScale)}t!==n&&n>0&&r===0&&(n--,r=Vn.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=Vn.MAX_SAFE_SMALL_INTEGER),!d&&r===0&&n>0&&(d=e.children[n-1].firstChild,r=Vn.MAX_SAFE_SMALL_INTEGER)),!l||!d)return null;i=Math.min(l.textContent.length,Math.max(0,i)),r=Math.min(d.textContent.length,Math.max(0,r));const h=this._readClientRects(l,i,d,r,o.endNode);return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,o.clientRectDeltaLeft,o.clientRectScale)}}var ef;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_DARK="hcDark",s.HIGH_CONTRAST_LIGHT="hcLight"})(ef||(ef={}));function Fy(s){return s===ef.HIGH_CONTRAST_DARK||s===ef.HIGH_CONTRAST_LIGHT}function _ae(s){return s===ef.DARK||s===ef.HIGH_CONTRAST_DARK}const C_t=function(){return ld?!0:!(mo||lf||Yy)}();let HO=!0;class xBe{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 use=class use{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=ds(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 Fy(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,n,r){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=n.getViewLineRenderingData(e),a=this._options,c=iu.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(Fy(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:o.minColumn,v=p.endLineNumber===e?p.endColumn:o.maxColumn;m');const h=p6(d,r);r.appendString("
");let u=null;return HO&&C_t&&o.isBasicASCII&&a.useMonospaceOptimizations&&h.containsForeignElements===Yu.None&&(u=new GG(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 GG:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof GG?this._renderedViewLine.monospaceAssumptionsAreValid():HO}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof GG&&(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 r=this._renderedViewLine.input.stopRenderingLineAfter;if(r!==-1&&t>r+1&&i>r+1)return new EBe(!0,[new kT(this.getWidth(n),0)]);r!==-1&&t>r+1&&(t=r+1),r!==-1&&i>r+1&&(i=r+1);const o=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return o&&o.length>0?new EBe(!1,o):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};use.CLASS_NAME="view-line";let fS=use;var TC;(function(s){s[s.MaxMonospaceDistance=300]="MaxMonospaceDistance"})(TC||(TC={}));class GG{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/TC.MaxMonospaceDistance);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let r=0;r=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),HO=!1)}return HO}toSlowRenderedLine(){return FQe(this.domNode,this.input,this._characterMapping,!1,Yu.None)}getVisibleRangesForRange(e,t,i,n){const r=this._getColumnPixelOffset(e,t,n),o=this._getColumnPixelOffset(e,i,n);return[new kT(r,o-r)]}_getColumnPixelOffset(e,t,i){if(t<=TC.MaxMonospaceDistance){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const n=Math.floor((t-1)/TC.MaxMonospaceDistance)-1,r=(n+1)*TC.MaxMonospaceDistance+1;let o=-1;if(this._keyColumnPixelOffsetCache&&(o=this._keyColumnPixelOffsetCache[n],o===-1&&(o=this._actualReadPixelOffset(e,r,i),this._keyColumnPixelOffsetCache[n]=o)),o===-1){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const a=this._characterMapping.getHorizontalOffset(r),c=this._characterMapping.getHorizontalOffset(t);return o+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),r=Wq.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return!r||r.length===0?-1:r[0].left}getColumnOfNodeOffset(e,t){return uLe(this._characterMapping,e,t)}}class PQe{constructor(e,t,i,n,r){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=r,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let o=0,a=this._characterMapping.length;o<=a;o++)this._pixelOffsetCache[o]=-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 r=this._readPixelOffset(this.domNode,e,t,n);if(r===-1)return null;const o=this._readPixelOffset(this.domNode,e,i,n);return o===-1?null:[new kT(r,o-r)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,r){if(i===n){const o=this._readPixelOffset(e,t,i,r);return o===-1?null:[new kT(o,0)]}else return this._readRawVisibleRangesForRange(e,i,n,r)}_readPixelOffset(e,t,i,n){if(this._characterMapping.length===0){if(this._containsForeignElements===Yu.None||this._containsForeignElements===Yu.After)return 0;if(this._containsForeignElements===Yu.Before)return this.getWidth(n);const r=this._getReadingTarget(e);return r.firstChild?(n.markDidDomLayout(),r.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const r=this._pixelOffsetCache[i];if(r!==-1)return r;const o=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=o,o}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(this._characterMapping.length===0){const c=Wq.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===Yu.None)return this.getWidth(n);const r=this._characterMapping.getDomPosition(i),o=Wq.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,r.partIndex,r.charIndex,n);if(!o||o.length===0)return-1;const a=o[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 kT(0,this.getWidth(n))];const r=this._characterMapping.getDomPosition(t),o=this._characterMapping.getDomPosition(i);return Wq.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,o.partIndex,o.charIndex,n)}getColumnOfNodeOffset(e,t){return uLe(this._characterMapping,e,t)}}class S_t extends PQe{_readVisibleRangesForRange(e,t,i,n,r){const o=super._readVisibleRangesForRange(e,t,i,n,r);if(!o||o.length===0||i===n||i===1&&n===this._characterMapping.length)return o;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,n,r);if(a!==-1){const c=o[o.length-1];c.left=t){const h=t-o;return l-t=4&&e[0]===ra.OverflowGuard&&e[3]===ra.ViewLines}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===ra.OverflowGuard&&e[3]===ra.ViewLines}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===ra.OverflowGuard&&e[1]===ra.ScrollableElement}static isChildOfMinimap(e){return e.length>=2&&e[0]===ra.OverflowGuard&&e[1]===ra.Minimap}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===ra.OverflowGuard&&e[3]===ra.ContentWidgets}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===ra.OverflowGuard}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===ra.OverflowingContentWidgets}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===ra.OverflowGuard&&e[1]===ra.OverlayWidgets}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===ra.OverflowingOverlayWidgets}}class xM{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 xM.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,r=e.viewModel.getLineCount();let o=null,a,c=null;return i.afterLineNumber!==r&&(c=new re(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(o=new re(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),c===null?a=o:o===null?a=c:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Id._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class DBe extends D_t{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=Nb.collect(this.target,this._targetElement)),this._targetPathCacheValue}constructor(e,t,i,n,r,o=null){super(e,t,i,n),this.hitTestResult=new Ca(()=>Id.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._targetElement=null,this._ctx=e,this._eventTarget=r,this._targetElement=o;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.columno.contentLeft+o.width)continue;const a=e.getVerticalOffsetForLineNumber(o.position.lineNumber);if(a<=r&&r<=a+o.height)return t.fulfillContentText(o.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?Mt.CONTENT_VIEW_ZONE:Mt.GUTTER_VIEW_ZONE;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return Bh.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 r=Math.abs(t.relativePos.x);const o={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:r};if(r-=e.layoutInfo.glyphMarginLeft,r<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),c=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return o.glyphMarginLane=c[Math.floor(r/e.lineHeight)],t.fulfillMargin(Mt.GUTTER_GLYPH_MARGIN,n,i.range,o)}return r-=e.layoutInfo.glyphMarginWidth,r<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(Mt.GUTTER_LINE_NUMBERS,n,i.range,o):(r-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(Mt.GUTTER_LINE_DECORATIONS,n,i.range,o))}return null}static _hitTestViewLines(e,t){if(!Bh.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new re(1,1),kBe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const n=e.viewModel.getLineCount(),r=e.viewModel.getLineMaxColumn(n);return t.fulfillContentEmpty(new re(n,r),kBe)}if(Bh.isStrictChildOfViewLines(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(n)===0){const o=e.getLineWidth(n),a=lhe(t.mouseContentHorizontalOffset-o);return t.fulfillContentEmpty(new re(n,1),a)}const r=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>=r){const o=lhe(t.mouseContentHorizontalOffset-r),a=new re(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(a,o)}}const i=t.hitTestResult.value;return i.type===IT.Content?Id.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(Bh.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new re(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(Bh.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),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new re(n,r))}}return null}static _hitTestScrollbar(e,t){if(Bh.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new re(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 Id._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,r){const o=n.lineNumber,a=n.column,c=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>c){const b=lhe(t.mouseContentHorizontalOffset-c);return t.fulfillContentEmpty(n,b)}const l=e.visibleRangeForPosition(o,a);if(!l)return t.fulfillUnknown(n);const d=l.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!r,injectedText:r});const h=[];if(h.push({offset:l.left,column:a}),a>1){const b=e.visibleRangeForPosition(o,a-1);b&&h.push({offset:b.left,column:a-1})}const u=e.viewModel.getLineMaxColumn(o);if(ab.offset-w.offset);const f=t.pos.toClientCoordinates(lt(e.viewDomNode)),p=i.getBoundingClientRect(),m=p.left<=f.clientX&&f.clientX<=p.right;let v=null;for(let b=1;br)){const a=Math.floor((n+r)/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 pae(t.pos.x,c),d=this._actualDoHitTestWithCaretRangeFromPoint(e,l.toClientCoordinates(lt(e.viewDomNode)));if(d.type===IT.Content)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(lt(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=AM(e.viewDomNode);let n;if(i?typeof i.caretRangeFromPoint>"u"?n=k_t(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 xE;const r=n.startContainer;if(r.nodeType===r.TEXT_NODE){const o=r.parentNode,a=o?o.parentNode:null,c=a?a.parentNode:null;return(c&&c.nodeType===c.ELEMENT_NODE?c.className:null)===fS.CLASS_NAME?K0.createFromDOMInfo(e,o,n.startOffset):new xE(r.parentNode)}else if(r.nodeType===r.ELEMENT_NODE){const o=r.parentNode,a=o?o.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===fS.CLASS_NAME?K0.createFromDOMInfo(e,r,r.textContent.length):new xE(r)}return new xE}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,r=n?n.parentNode:null,o=r?r.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===fS.CLASS_NAME?K0.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new xE(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const n=i.offsetNode.parentNode,r=n&&n.nodeType===n.ELEMENT_NODE?n.className:null,o=n?n.parentNode:null,a=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(r===fS.CLASS_NAME){const c=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(c)return K0.createFromDOMInfo(e,c,0)}else if(a===fS.CLASS_NAME)return K0.createFromDOMInfo(e,i.offsetNode,0)}return new xE(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),r=i3.atomicPosition(i,e.column-1,n,cD.Nearest);return r!==-1?new re(e.lineNumber,r+1):e}static doHitTest(e,t){let i=new xE;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(lt(e.viewDomNode)))),i.type===IT.Content){const n=e.viewModel.getInjectedTextAt(i.position),r=e.viewModel.normalizePosition(i.position,Ir.None);(n||!r.equals(i.position))&&(i=new OQe(r,i.spanNode,n))}return i}}function k_t(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 r=n.getBoundingClientRect(),o=lt(n),a=o.getComputedStyle(n,null).getPropertyValue("font-style"),c=o.getComputedStyle(n,null).getPropertyValue("font-variant"),l=o.getComputedStyle(n,null).getPropertyValue("font-weight"),d=o.getComputedStyle(n,null).getPropertyValue("font-size"),h=o.getComputedStyle(n,null).getPropertyValue("line-height"),u=o.getComputedStyle(n,null).getPropertyValue("font-family"),f=`${a} ${c} ${l} ${d}/${h} ${u}`,p=n.innerText;let m=r.left,v=0,b;if(e>r.left+r.width)v=p.length;else{const w=fme.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:ri,disposables:this._store}))}static addTarget(e){if(!Gl.isTouchDevice())return V.None;Gl.INSTANCE||(Gl.INSTANCE=L2(new Gl));const t=Gl.INSTANCE.targets.push(e);return Ee(t)}static ignoreTarget(e){if(!Gl.isTouchDevice())return V.None;Gl.INSTANCE||(Gl.INSTANCE=L2(new Gl));const t=Gl.INSTANCE.ignoreTargets.push(e);return Ee(t)}static isTouchDevice(){return"ontouchstart"in ri||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=Gl.HOLD_DELAY&&Math.abs(c.initialPageX-Eg(c.rollingPageX))<30&&Math.abs(c.initialPageY-Eg(c.rollingPageY))<30){const d=this.newGestureEvent(ur.Contextmenu,c.initialTarget);d.pageX=Eg(c.rollingPageX),d.pageY=Eg(c.rollingPageY),this.dispatchEvent(d)}else if(n===1){const d=Eg(c.rollingPageX),h=Eg(c.rollingPageY),u=Eg(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(ur.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===ur.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Gl.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===ur.Change||e.type===ur.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,r=e.initialTarget;for(;r&&r!==i;)n++,r=r.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,r,o,a,c,l){this.handle=Ml(e,()=>{const d=Date.now(),h=d-i;let u=0,f=0,p=!0;n+=Gl.SCROLL_FRICTION*h,a+=Gl.SCROLL_FRICTION*h,n>0&&(p=!1,u=r*n*h),a>0&&(p=!1,f=c*a*h);const m=this.newGestureEvent(ur.Change);m.translationX=u,m.translationY=f,t.forEach(v=>v.dispatchEvent(m)),p||this.inertia(e,t,d,n,r,o+u,a,c,l+f)})}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(r.pageX),o.rollingPageY.push(r.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};Gl.SCROLL_FRICTION=-.005,Gl.HOLD_DELAY=700,Gl.CLEAR_TAP_COUNT_TIME=400;let md=Gl;function I_t(s,e,t){let i=0;for(let r=0;r!0,L_t=()=>!1,R_t=s=>s===" "||s===" ";class uP{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 r=i.options,o=r.get(x.layoutInfo),a=r.get(x.fontInfo);this.readOnly=r.get(x.readOnly),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=r.get(x.stickyTabStops),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=r.get(x.useTabStops),this.wordSeparators=r.get(x.wordSeparators),this.emptySelectionClipboard=r.get(x.emptySelectionClipboard),this.copyWithSyntaxHighlighting=r.get(x.copyWithSyntaxHighlighting),this.multiCursorMergeOverlapping=r.get(x.multiCursorMergeOverlapping),this.multiCursorPaste=r.get(x.multiCursorPaste),this.multiCursorLimit=r.get(x.multiCursorLimit),this.autoClosingBrackets=r.get(x.autoClosingBrackets),this.autoClosingComments=r.get(x.autoClosingComments),this.autoClosingQuotes=r.get(x.autoClosingQuotes),this.autoClosingDelete=r.get(x.autoClosingDelete),this.autoClosingOvertype=r.get(x.autoClosingOvertype),this.autoSurround=r.get(x.autoSurround),this.autoIndent=r.get(x.autoIndent),this.wordSegmenterLocales=r.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=L1(t,i-1),r=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return r?r.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return gLe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return R_t;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return T_t;case"never":return L_t}}_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),r=e.getLineMinColumn(t);if(no?o:n}}let Mn=class BQe{static fromModelState(e){return new M_t(e)}static fromViewState(e){return new N_t(e)}static fromModelSelection(e){const t=ht.liftSelection(e),i=new xl(F.fromPositions(t.getSelectionStart()),$h.Simple,0,t.getPosition(),0);return BQe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;ir,l=n>o,d=no||bn||v0&&n--,q0.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const r=Math.min(i.fromViewLineNumber,i.toViewLineNumber),o=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let c=r;c<=o;c++){const l=t.getLineMaxColumn(c),d=e.visibleColumnFromColumn(t,new re(c,l));n=Math.max(n,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-pKe(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new re(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),r=e.getLineContent(t.lineNumber),o=i3.atomicPosition(r,t.column-1,i,cD.Left);if(o!==-1&&o+1>=n)return new re(t.lineNumber,o+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?Es.leftPositionAtomicSoftTabs(t,i,e.tabSize):Es.leftPosition(t,i);return new dhe(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,r){let o,a;if(i.hasSelection()&&!n)o=i.selection.startLineNumber,a=i.selection.startColumn;else{const c=i.position.delta(void 0,-(r-1)),l=t.normalizePosition(Es.clipPositionColumn(c,t),Ir.Left),d=Es.left(e,t,l);o=d.lineNumber,a=d.column}return i.move(n,o,a,0)}static clipPositionColumn(e,t){return new re(e.lineNumber,Es.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?r=0:r=l-Qa.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),c!==void 0){const p=new re(i,n),m=t.normalizePosition(p,c);r=r+(n-m.column),i=m.lineNumber,n=m.column}return new dhe(i,n,r)}static down(e,t,i,n,r,o,a){return this.vertical(e,t,i,n,r,i+o,a,Ir.RightOfInjectedText)}static moveDown(e,t,i,n,r){let o,a;i.hasSelection()&&!n?(o=i.selection.endLineNumber,a=i.selection.endColumn):(o=i.position.lineNumber,a=i.position.column);let c=0,l;do if(l=Es.down(e,t,o+c,a,i.leftoverVisibleColumns,r,!0),t.normalizePosition(new re(l.lineNumber,l.column),Ir.None).lineNumber>o)break;while(c++<10&&o+c1&&this._isBlankLine(t,r);)r--;for(;r>1&&!this._isBlankLine(t,r);)r--;return i.move(n,r,t.getLineMinColumn(r),0)}static moveToNextBlankLine(e,t,i,n){const r=t.getLineCount();let o=i.position.lineNumber;for(;o=u.length+1)return!1;const f=u.charAt(h.column-2),p=n.get(f);if(!p)return!1;if(zk(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 r=t.getLineContent(n.lineNumber),o=Th(r),a=o===-1?r.length+1:o+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(DM.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=Vct(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 re(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const n=[];let r=null;i.sort((o,a)=>re.compare(o.getStartPosition(),a.getEndPosition()));for(let o=0,a=i.length;o1&&r?.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);r=p,p.isEmpty()?n[o]=null:n[o]=new nd(p,"")}else n[o]=null;else n[o]=new nd(c,"")}return new sg(so.Other,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}var Bi;(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"})(Bi||(Bi={}));var Do;(function(s){s[s.None=0]="None",s[s.Regular=1]="Regular",s[s.Separator=2]="Separator"})(Do||(Do={}));var fs;(function(s){s[s.WordStart=0]="WordStart",s[s.WordStartFast=1]="WordStartFast",s[s.WordEnd=2]="WordEnd",s[s.WordAccessibility=3]="WordAccessibility"})(fs||(fs={}));class us{static _createWord(e,t,i,n,r){return{start:n,end:r,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:Do.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=Do.None;const r=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let o=i.column-2;o>=0;o--){const a=e.charCodeAt(o),c=t.get(a);if(r&&o===r.index)return this._createIntlWord(r,c);if(c===$o.Regular){if(n===Do.Separator)return this._createWord(e,n,c,o+1,this._findEndOfWord(e,t,n,o+1));n=Do.Regular}else if(c===$o.WordSeparator){if(n===Do.Regular)return this._createWord(e,n,c,o+1,this._findEndOfWord(e,t,n,o+1));n=Do.Separator}else if(c===$o.Whitespace&&n!==Do.None)return this._createWord(e,n,c,o+1,this._findEndOfWord(e,t,n,o+1))}return n!==Do.None?this._createWord(e,n,$o.Whitespace,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const r=t.findNextIntlWordAtOrAfterOffset(e,n),o=e.length;for(let a=n;a=0;o--){const a=e.charCodeAt(o),c=t.get(a);if(r&&o===r.index)return o;if(c===$o.Whitespace||i===Do.Regular&&c===$o.WordSeparator||i===Do.Separator&&c===$o.Regular)return o+1}return 0}static moveWordLeft(e,t,i,n,r){let o=i.lineNumber,a=i.column;a===1&&o>1&&(o=o-1,a=t.getLineMaxColumn(o));let c=us._findPreviousWordOnLine(e,t,new re(o,a));if(n===fs.WordStart)return new re(o,c?c.start+1:1);if(n===fs.WordStartFast)return!r&&c&&c.wordType===Do.Separator&&c.end-c.start===1&&c.nextCharClass===$o.Regular&&(c=us._findPreviousWordOnLine(e,t,new re(o,c.start+1))),new re(o,c?c.start+1:1);if(n===fs.WordAccessibility){for(;c&&c.wordType===Do.Separator;)c=us._findPreviousWordOnLine(e,t,new re(o,c.start+1));return new re(o,c?c.start+1:1)}return c&&a<=c.end+1&&(c=us._findPreviousWordOnLine(e,t,new re(o,c.start+1))),new re(o,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 re(i-1,e.getLineMaxColumn(i-1)):t;const r=e.getLineContent(i);for(let o=t.column-1;o>1;o--){const a=r.charCodeAt(o-2),c=r.charCodeAt(o-1);if(a===B.Underline&&c!==B.Underline)return new re(i,o);if(a===B.Dash&&c!==B.Dash)return new re(i,o);if((Ex(a)||RG(a))&&Uw(c))return new re(i,o);if(Uw(a)&&Uw(c)&&o+1=c.start+1&&(c=us._findNextWordOnLine(e,t,new re(r,c.end+1))),c?o=c.start+1:o=t.getLineMaxColumn(r);return new re(r,o)}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=us._findPreviousWordOnLine(i,n,new re(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 re(i.positionLineNumber,i.positionColumn),r=this._deleteInsideWordWhitespace(t,n);return r||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 r=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,r))return null;let o=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,o))return null;for(;r>0&&this._charAtIsWhitespace(i,r-1);)r--;for(;o+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=us._findPreviousWordOnLine(e,t,i);if(l&&o(l))return c(l);const d=us._findNextWordOnLine(e,t,i);return d&&o(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,r+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=us._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=us._findNextWordOnLine(i,n,new re(c,u.end+1))),u?l=u.start+1:l!!e)}class wl{static addCursorDown(e,t,i){const n=[];let r=0;for(let o=0,a=t.length;ol&&(d=l,h=e.model.getLineMaxColumn(d)),Mn.fromModelState(new xl(new F(o.lineNumber,1,d,h),$h.Line,0,new re(d,h),0))}const c=t.modelState.selectionStart.getStartPosition().lineNumber;if(o.lineNumberc){const l=e.getLineCount();let d=a.lineNumber+1,h=1;return d>l&&(d=l,h=e.getLineMaxColumn(d)),Mn.fromViewState(t.viewState.move(!0,d,h,0))}else{const l=t.modelState.selectionStart.getEndPosition();return Mn.fromModelState(t.modelState.move(!0,l.lineNumber,l.column,0))}}static word(e,t,i,n){const r=e.model.validatePosition(n);return Mn.fromModelState(us.word(e.cursorConfig,e.model,t.modelState,i,r))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Mn(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Mn.fromViewState(new xl(new F(i,n,i,n),$h.Simple,0,new re(i,n),0))}static moveTo(e,t,i,n,r){if(i){if(t.modelState.selectionStartKind===$h.Word)return this.word(e,t,i,n);if(t.modelState.selectionStartKind===$h.Line)return this.line(e,t,i,n,r)}const o=e.model.validatePosition(n),a=r?e.coordinatesConverter.validateViewPosition(new re(r.lineNumber,r.column),o):e.coordinatesConverter.convertModelPositionToViewPosition(o);return Mn.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,n,r,o){switch(i){case Ni.Direction.Left:return o===Ni.Unit.HalfLine?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,r);case Ni.Direction.Right:return o===Ni.Unit.HalfLine?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,r);case Ni.Direction.Up:return o===Ni.Unit.WrappedLine?this._moveUpByViewLines(e,t,n,r):this._moveUpByModelLines(e,t,n,r);case Ni.Direction.Down:return o===Ni.Unit.WrappedLine?this._moveDownByViewLines(e,t,n,r):this._moveDownByModelLines(e,t,n,r);case Ni.Direction.PrevBlankLine:return o===Ni.Unit.WrappedLine?t.map(a=>Mn.fromViewState(Es.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Mn.fromModelState(Es.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,n)));case Ni.Direction.NextBlankLine:return o===Ni.Unit.WrappedLine?t.map(a=>Mn.fromViewState(Es.moveToNextBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Mn.fromModelState(Es.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,n)));case Ni.Direction.WrappedLineStart:return this._moveToViewMinColumn(e,t,n);case Ni.Direction.WrappedLineFirstNonWhitespaceCharacter:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case Ni.Direction.WrappedLineColumnCenter:return this._moveToViewCenterColumn(e,t,n);case Ni.Direction.WrappedLineEnd:return this._moveToViewMaxColumn(e,t,n);case Ni.Direction.WrappedLineLastNonWhitespaceCharacter:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,r){const o=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(o);switch(i){case Ni.Direction.ViewPortTop:{const c=this._firstLineNumberInRange(e.model,a,r),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Ni.Direction.ViewPortBottom:{const c=this._lastLineNumberInRange(e.model,a,r),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Ni.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 Ni.Direction.ViewPortIfOutside:{const c=[];for(let l=0,d=t.length;li.endLineNumber-1?o=i.endLineNumber-1:rMn.fromViewState(Es.moveLeft(e.cursorConfig,e,r.viewState,i,n)))}static _moveHalfLineLeft(e,t,i){const n=[];for(let r=0,o=t.length;rMn.fromViewState(Es.moveRight(e.cursorConfig,e,r.viewState,i,n)))}static _moveHalfLineRight(e,t,i){const n=[];for(let r=0,o=t.length;r0}}function o_t(s){return s.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}var cr;(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"})(cr||(cr={}));class a_t{constructor(){this.type=cr.ViewCompositionStart}}class c_t{constructor(){this.type=cr.ViewCompositionEnd}}class l_t{constructor(e){this.type=cr.ViewConfigurationChanged,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class d_t{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=cr.ViewCursorStateChanged}}class HI{constructor(e){this.type=cr.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 zG{constructor(){this.type=cr.ViewFlushed}}class h_t{constructor(e){this.type=cr.ViewFocusChanged,this.isFocused=e}}class u_t{constructor(){this.type=cr.ViewLanguageConfigurationChanged}}class $G{constructor(){this.type=cr.ViewLineMappingChanged}}class NQe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=cr.ViewLinesChanged}}class ume{constructor(e,t){this.type=cr.ViewLinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class gme{constructor(e,t){this.type=cr.ViewLinesInserted,this.fromLineNumber=e,this.toLineNumber=t}}var vs;(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"})(vs||(vs={}));class f5{constructor(e,t,i,n,r,o,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=r,this.revealHorizontal=o,this.scrollType=a,this.type=cr.ViewRevealRangeRequest}}class g_t{constructor(e){this.type=cr.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 f_t{constructor(e){this.theme=e,this.type=cr.ViewThemeChanged}}class p_t{constructor(e){this.type=cr.ViewTokensChanged,this.ranges=e}}class m_t{constructor(){this.type=cr.ViewTokensColorsChanged}}let __t=class{constructor(){this.type=cr.ViewZonesChanged}};class w6 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 mae{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 r=0,o=e.length;rc)return null;if(t=Math.min(c,Math.max(0,t)),n=Math.min(c,Math.max(0,n)),t===n&&i===r&&i===0&&!e.children[t].firstChild){const u=e.children[t].getClientRects();return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,o.clientRectDeltaLeft,o.clientRectScale)}t!==n&&n>0&&r===0&&(n--,r=Vn.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=Vn.MAX_SAFE_SMALL_INTEGER),!d&&r===0&&n>0&&(d=e.children[n-1].firstChild,r=Vn.MAX_SAFE_SMALL_INTEGER)),!l||!d)return null;i=Math.min(l.textContent.length,Math.max(0,i)),r=Math.min(d.textContent.length,Math.max(0,r));const h=this._readClientRects(l,i,d,r,o.endNode);return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,o.clientRectDeltaLeft,o.clientRectScale)}}var ef;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_DARK="hcDark",s.HIGH_CONTRAST_LIGHT="hcLight"})(ef||(ef={}));function Fy(s){return s===ef.HIGH_CONTRAST_DARK||s===ef.HIGH_CONTRAST_LIGHT}function _ae(s){return s===ef.DARK||s===ef.HIGH_CONTRAST_DARK}const C_t=function(){return ld?!0:!(mo||lf||Yy)}();let HO=!0;class xBe{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 use=class use{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=ds(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 Fy(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,n,r){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=n.getViewLineRenderingData(e),a=this._options,c=iu.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(Fy(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:o.minColumn,v=p.endLineNumber===e?p.endColumn:o.maxColumn;m');const h=p6(d,r);r.appendString("
");let u=null;return HO&&C_t&&o.isBasicASCII&&a.useMonospaceOptimizations&&h.containsForeignElements===Yu.None&&(u=new GG(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 GG:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof GG?this._renderedViewLine.monospaceAssumptionsAreValid():HO}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof GG&&(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 r=this._renderedViewLine.input.stopRenderingLineAfter;if(r!==-1&&t>r+1&&i>r+1)return new EBe(!0,[new kT(this.getWidth(n),0)]);r!==-1&&t>r+1&&(t=r+1),r!==-1&&i>r+1&&(i=r+1);const o=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return o&&o.length>0?new EBe(!1,o):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};use.CLASS_NAME="view-line";let fS=use;var TC;(function(s){s[s.MaxMonospaceDistance=300]="MaxMonospaceDistance"})(TC||(TC={}));class GG{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/TC.MaxMonospaceDistance);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let r=0;r=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),HO=!1)}return HO}toSlowRenderedLine(){return FQe(this.domNode,this.input,this._characterMapping,!1,Yu.None)}getVisibleRangesForRange(e,t,i,n){const r=this._getColumnPixelOffset(e,t,n),o=this._getColumnPixelOffset(e,i,n);return[new kT(r,o-r)]}_getColumnPixelOffset(e,t,i){if(t<=TC.MaxMonospaceDistance){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const n=Math.floor((t-1)/TC.MaxMonospaceDistance)-1,r=(n+1)*TC.MaxMonospaceDistance+1;let o=-1;if(this._keyColumnPixelOffsetCache&&(o=this._keyColumnPixelOffsetCache[n],o===-1&&(o=this._actualReadPixelOffset(e,r,i),this._keyColumnPixelOffsetCache[n]=o)),o===-1){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const a=this._characterMapping.getHorizontalOffset(r),c=this._characterMapping.getHorizontalOffset(t);return o+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),r=Wq.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return!r||r.length===0?-1:r[0].left}getColumnOfNodeOffset(e,t){return uLe(this._characterMapping,e,t)}}class PQe{constructor(e,t,i,n,r){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=r,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let o=0,a=this._characterMapping.length;o<=a;o++)this._pixelOffsetCache[o]=-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 r=this._readPixelOffset(this.domNode,e,t,n);if(r===-1)return null;const o=this._readPixelOffset(this.domNode,e,i,n);return o===-1?null:[new kT(r,o-r)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,r){if(i===n){const o=this._readPixelOffset(e,t,i,r);return o===-1?null:[new kT(o,0)]}else return this._readRawVisibleRangesForRange(e,i,n,r)}_readPixelOffset(e,t,i,n){if(this._characterMapping.length===0){if(this._containsForeignElements===Yu.None||this._containsForeignElements===Yu.After)return 0;if(this._containsForeignElements===Yu.Before)return this.getWidth(n);const r=this._getReadingTarget(e);return r.firstChild?(n.markDidDomLayout(),r.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const r=this._pixelOffsetCache[i];if(r!==-1)return r;const o=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=o,o}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(this._characterMapping.length===0){const c=Wq.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===Yu.None)return this.getWidth(n);const r=this._characterMapping.getDomPosition(i),o=Wq.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,r.partIndex,r.charIndex,n);if(!o||o.length===0)return-1;const a=o[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 kT(0,this.getWidth(n))];const r=this._characterMapping.getDomPosition(t),o=this._characterMapping.getDomPosition(i);return Wq.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,o.partIndex,o.charIndex,n)}getColumnOfNodeOffset(e,t){return uLe(this._characterMapping,e,t)}}class S_t extends PQe{_readVisibleRangesForRange(e,t,i,n,r){const o=super._readVisibleRangesForRange(e,t,i,n,r);if(!o||o.length===0||i===n||i===1&&n===this._characterMapping.length)return o;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,n,r);if(a!==-1){const c=o[o.length-1];c.left=t){const h=t-o;return l-t=4&&e[0]===ra.OverflowGuard&&e[3]===ra.ViewLines}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===ra.OverflowGuard&&e[3]===ra.ViewLines}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===ra.OverflowGuard&&e[1]===ra.ScrollableElement}static isChildOfMinimap(e){return e.length>=2&&e[0]===ra.OverflowGuard&&e[1]===ra.Minimap}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===ra.OverflowGuard&&e[3]===ra.ContentWidgets}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===ra.OverflowGuard}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===ra.OverflowingContentWidgets}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===ra.OverflowGuard&&e[1]===ra.OverlayWidgets}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===ra.OverflowingOverlayWidgets}}class xM{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 xM.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,r=e.viewModel.getLineCount();let o=null,a,c=null;return i.afterLineNumber!==r&&(c=new re(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(o=new re(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),c===null?a=o:o===null?a=c:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Id._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class DBe extends D_t{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=Nb.collect(this.target,this._targetElement)),this._targetPathCacheValue}constructor(e,t,i,n,r,o=null){super(e,t,i,n),this.hitTestResult=new Ca(()=>Id.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._targetElement=null,this._ctx=e,this._eventTarget=r,this._targetElement=o;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.columno.contentLeft+o.width)continue;const a=e.getVerticalOffsetForLineNumber(o.position.lineNumber);if(a<=r&&r<=a+o.height)return t.fulfillContentText(o.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?Mt.CONTENT_VIEW_ZONE:Mt.GUTTER_VIEW_ZONE;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return Bh.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 r=Math.abs(t.relativePos.x);const o={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:r};if(r-=e.layoutInfo.glyphMarginLeft,r<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),c=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return o.glyphMarginLane=c[Math.floor(r/e.lineHeight)],t.fulfillMargin(Mt.GUTTER_GLYPH_MARGIN,n,i.range,o)}return r-=e.layoutInfo.glyphMarginWidth,r<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(Mt.GUTTER_LINE_NUMBERS,n,i.range,o):(r-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(Mt.GUTTER_LINE_DECORATIONS,n,i.range,o))}return null}static _hitTestViewLines(e,t){if(!Bh.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new re(1,1),kBe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const n=e.viewModel.getLineCount(),r=e.viewModel.getLineMaxColumn(n);return t.fulfillContentEmpty(new re(n,r),kBe)}if(Bh.isStrictChildOfViewLines(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(n)===0){const o=e.getLineWidth(n),a=lhe(t.mouseContentHorizontalOffset-o);return t.fulfillContentEmpty(new re(n,1),a)}const r=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>=r){const o=lhe(t.mouseContentHorizontalOffset-r),a=new re(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(a,o)}}const i=t.hitTestResult.value;return i.type===IT.Content?Id.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(Bh.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new re(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(Bh.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),r=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new re(n,r))}}return null}static _hitTestScrollbar(e,t){if(Bh.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new re(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 Id._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,r){const o=n.lineNumber,a=n.column,c=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>c){const b=lhe(t.mouseContentHorizontalOffset-c);return t.fulfillContentEmpty(n,b)}const l=e.visibleRangeForPosition(o,a);if(!l)return t.fulfillUnknown(n);const d=l.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!r,injectedText:r});const h=[];if(h.push({offset:l.left,column:a}),a>1){const b=e.visibleRangeForPosition(o,a-1);b&&h.push({offset:b.left,column:a-1})}const u=e.viewModel.getLineMaxColumn(o);if(ab.offset-w.offset);const f=t.pos.toClientCoordinates(lt(e.viewDomNode)),p=i.getBoundingClientRect(),m=p.left<=f.clientX&&f.clientX<=p.right;let v=null;for(let b=1;br)){const a=Math.floor((n+r)/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 pae(t.pos.x,c),d=this._actualDoHitTestWithCaretRangeFromPoint(e,l.toClientCoordinates(lt(e.viewDomNode)));if(d.type===IT.Content)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(lt(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=AM(e.viewDomNode);let n;if(i?typeof i.caretRangeFromPoint>"u"?n=k_t(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 xE;const r=n.startContainer;if(r.nodeType===r.TEXT_NODE){const o=r.parentNode,a=o?o.parentNode:null,c=a?a.parentNode:null;return(c&&c.nodeType===c.ELEMENT_NODE?c.className:null)===fS.CLASS_NAME?K0.createFromDOMInfo(e,o,n.startOffset):new xE(r.parentNode)}else if(r.nodeType===r.ELEMENT_NODE){const o=r.parentNode,a=o?o.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===fS.CLASS_NAME?K0.createFromDOMInfo(e,r,r.textContent.length):new xE(r)}return new xE}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,r=n?n.parentNode:null,o=r?r.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===fS.CLASS_NAME?K0.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new xE(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const n=i.offsetNode.parentNode,r=n&&n.nodeType===n.ELEMENT_NODE?n.className:null,o=n?n.parentNode:null,a=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(r===fS.CLASS_NAME){const c=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(c)return K0.createFromDOMInfo(e,c,0)}else if(a===fS.CLASS_NAME)return K0.createFromDOMInfo(e,i.offsetNode,0)}return new xE(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),r=i3.atomicPosition(i,e.column-1,n,cD.Nearest);return r!==-1?new re(e.lineNumber,r+1):e}static doHitTest(e,t){let i=new xE;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(lt(e.viewDomNode)))),i.type===IT.Content){const n=e.viewModel.getInjectedTextAt(i.position),r=e.viewModel.normalizePosition(i.position,Ir.None);(n||!r.equals(i.position))&&(i=new OQe(r,i.spanNode,n))}return i}}function k_t(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 r=n.getBoundingClientRect(),o=lt(n),a=o.getComputedStyle(n,null).getPropertyValue("font-style"),c=o.getComputedStyle(n,null).getPropertyValue("font-variant"),l=o.getComputedStyle(n,null).getPropertyValue("font-weight"),d=o.getComputedStyle(n,null).getPropertyValue("font-size"),h=o.getComputedStyle(n,null).getPropertyValue("line-height"),u=o.getComputedStyle(n,null).getPropertyValue("font-family"),f=`${a} ${c} ${l} ${d}/${h} ${u}`,p=n.innerText;let m=r.left,v=0,b;if(e>r.left+r.width)v=p.length;else{const w=fme.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:ri,disposables:this._store}))}static addTarget(e){if(!Gl.isTouchDevice())return V.None;Gl.INSTANCE||(Gl.INSTANCE=L2(new Gl));const t=Gl.INSTANCE.targets.push(e);return Ee(t)}static ignoreTarget(e){if(!Gl.isTouchDevice())return V.None;Gl.INSTANCE||(Gl.INSTANCE=L2(new Gl));const t=Gl.INSTANCE.ignoreTargets.push(e);return Ee(t)}static isTouchDevice(){return"ontouchstart"in ri||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=Gl.HOLD_DELAY&&Math.abs(c.initialPageX-Eg(c.rollingPageX))<30&&Math.abs(c.initialPageY-Eg(c.rollingPageY))<30){const d=this.newGestureEvent(ur.Contextmenu,c.initialTarget);d.pageX=Eg(c.rollingPageX),d.pageY=Eg(c.rollingPageY),this.dispatchEvent(d)}else if(n===1){const d=Eg(c.rollingPageX),h=Eg(c.rollingPageY),u=Eg(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(ur.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===ur.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Gl.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===ur.Change||e.type===ur.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,r=e.initialTarget;for(;r&&r!==i;)n++,r=r.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,r,o,a,c,l){this.handle=Nl(e,()=>{const d=Date.now(),h=d-i;let u=0,f=0,p=!0;n+=Gl.SCROLL_FRICTION*h,a+=Gl.SCROLL_FRICTION*h,n>0&&(p=!1,u=r*n*h),a>0&&(p=!1,f=c*a*h);const m=this.newGestureEvent(ur.Change);m.translationX=u,m.translationY=f,t.forEach(v=>v.dispatchEvent(m)),p||this.inertia(e,t,d,n,r,o+u,a,c,l+f)})}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(r.pageX),o.rollingPageY.push(r.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};Gl.SCROLL_FRICTION=-.005,Gl.HOLD_DELAY=700,Gl.CLEAR_TAP_COUNT_TIME=400;let md=Gl;function I_t(s,e,t){let i=0;for(let r=0;r!0,L_t=()=>!1,R_t=s=>s===" "||s===" ";class uP{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 r=i.options,o=r.get(x.layoutInfo),a=r.get(x.fontInfo);this.readOnly=r.get(x.readOnly),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=r.get(x.stickyTabStops),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=r.get(x.useTabStops),this.wordSeparators=r.get(x.wordSeparators),this.emptySelectionClipboard=r.get(x.emptySelectionClipboard),this.copyWithSyntaxHighlighting=r.get(x.copyWithSyntaxHighlighting),this.multiCursorMergeOverlapping=r.get(x.multiCursorMergeOverlapping),this.multiCursorPaste=r.get(x.multiCursorPaste),this.multiCursorLimit=r.get(x.multiCursorLimit),this.autoClosingBrackets=r.get(x.autoClosingBrackets),this.autoClosingComments=r.get(x.autoClosingComments),this.autoClosingQuotes=r.get(x.autoClosingQuotes),this.autoClosingDelete=r.get(x.autoClosingDelete),this.autoClosingOvertype=r.get(x.autoClosingOvertype),this.autoSurround=r.get(x.autoSurround),this.autoIndent=r.get(x.autoIndent),this.wordSegmenterLocales=r.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=L1(t,i-1),r=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return r?r.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return gLe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return R_t;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return T_t;case"never":return L_t}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return n=>i.indexOf(n)!==-1}visibleColumnFromColumn(e,t){return ja.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=ja.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),r=e.getLineMinColumn(t);if(no?o:n}}let Mn=class BQe{static fromModelState(e){return new M_t(e)}static fromViewState(e){return new N_t(e)}static fromModelSelection(e){const t=ht.liftSelection(e),i=new Dl(F.fromPositions(t.getSelectionStart()),$h.Simple,0,t.getPosition(),0);return BQe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;ir,l=n>o,d=no||bn||v0&&n--,q0.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const r=Math.min(i.fromViewLineNumber,i.toViewLineNumber),o=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let c=r;c<=o;c++){const l=t.getLineMaxColumn(c),d=e.visibleColumnFromColumn(t,new re(c,l));n=Math.max(n,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-pKe(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new re(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),r=e.getLineContent(t.lineNumber),o=i3.atomicPosition(r,t.column-1,i,cD.Left);if(o!==-1&&o+1>=n)return new re(t.lineNumber,o+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?Es.leftPositionAtomicSoftTabs(t,i,e.tabSize):Es.leftPosition(t,i);return new dhe(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,r){let o,a;if(i.hasSelection()&&!n)o=i.selection.startLineNumber,a=i.selection.startColumn;else{const c=i.position.delta(void 0,-(r-1)),l=t.normalizePosition(Es.clipPositionColumn(c,t),Ir.Left),d=Es.left(e,t,l);o=d.lineNumber,a=d.column}return i.move(n,o,a,0)}static clipPositionColumn(e,t){return new re(e.lineNumber,Es.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?r=0:r=l-ja.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),c!==void 0){const p=new re(i,n),m=t.normalizePosition(p,c);r=r+(n-m.column),i=m.lineNumber,n=m.column}return new dhe(i,n,r)}static down(e,t,i,n,r,o,a){return this.vertical(e,t,i,n,r,i+o,a,Ir.RightOfInjectedText)}static moveDown(e,t,i,n,r){let o,a;i.hasSelection()&&!n?(o=i.selection.endLineNumber,a=i.selection.endColumn):(o=i.position.lineNumber,a=i.position.column);let c=0,l;do if(l=Es.down(e,t,o+c,a,i.leftoverVisibleColumns,r,!0),t.normalizePosition(new re(l.lineNumber,l.column),Ir.None).lineNumber>o)break;while(c++<10&&o+c1&&this._isBlankLine(t,r);)r--;for(;r>1&&!this._isBlankLine(t,r);)r--;return i.move(n,r,t.getLineMinColumn(r),0)}static moveToNextBlankLine(e,t,i,n){const r=t.getLineCount();let o=i.position.lineNumber;for(;o=u.length+1)return!1;const f=u.charAt(h.column-2),p=n.get(f);if(!p)return!1;if(zk(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 r=t.getLineContent(n.lineNumber),o=Th(r),a=o===-1?r.length+1:o+1;if(n.column<=a){const c=i.visibleColumnFromColumn(t,n),l=ja.prevIndentTabStop(c,i.indentSize),d=i.columnFromVisibleColumn(t,n.lineNumber,l);return new F(n.lineNumber,d,n.lineNumber,n.column)}}return F.fromPositions(DM.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=Vct(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 re(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const n=[];let r=null;i.sort((o,a)=>re.compare(o.getStartPosition(),a.getEndPosition()));for(let o=0,a=i.length;o1&&r?.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);r=p,p.isEmpty()?n[o]=null:n[o]=new nd(p,"")}else n[o]=null;else n[o]=new nd(c,"")}return new sg(so.Other,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}var Bi;(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"})(Bi||(Bi={}));var Do;(function(s){s[s.None=0]="None",s[s.Regular=1]="Regular",s[s.Separator=2]="Separator"})(Do||(Do={}));var fs;(function(s){s[s.WordStart=0]="WordStart",s[s.WordStartFast=1]="WordStartFast",s[s.WordEnd=2]="WordEnd",s[s.WordAccessibility=3]="WordAccessibility"})(fs||(fs={}));class us{static _createWord(e,t,i,n,r){return{start:n,end:r,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:Do.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=Do.None;const r=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let o=i.column-2;o>=0;o--){const a=e.charCodeAt(o),c=t.get(a);if(r&&o===r.index)return this._createIntlWord(r,c);if(c===$o.Regular){if(n===Do.Separator)return this._createWord(e,n,c,o+1,this._findEndOfWord(e,t,n,o+1));n=Do.Regular}else if(c===$o.WordSeparator){if(n===Do.Regular)return this._createWord(e,n,c,o+1,this._findEndOfWord(e,t,n,o+1));n=Do.Separator}else if(c===$o.Whitespace&&n!==Do.None)return this._createWord(e,n,c,o+1,this._findEndOfWord(e,t,n,o+1))}return n!==Do.None?this._createWord(e,n,$o.Whitespace,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const r=t.findNextIntlWordAtOrAfterOffset(e,n),o=e.length;for(let a=n;a=0;o--){const a=e.charCodeAt(o),c=t.get(a);if(r&&o===r.index)return o;if(c===$o.Whitespace||i===Do.Regular&&c===$o.WordSeparator||i===Do.Separator&&c===$o.Regular)return o+1}return 0}static moveWordLeft(e,t,i,n,r){let o=i.lineNumber,a=i.column;a===1&&o>1&&(o=o-1,a=t.getLineMaxColumn(o));let c=us._findPreviousWordOnLine(e,t,new re(o,a));if(n===fs.WordStart)return new re(o,c?c.start+1:1);if(n===fs.WordStartFast)return!r&&c&&c.wordType===Do.Separator&&c.end-c.start===1&&c.nextCharClass===$o.Regular&&(c=us._findPreviousWordOnLine(e,t,new re(o,c.start+1))),new re(o,c?c.start+1:1);if(n===fs.WordAccessibility){for(;c&&c.wordType===Do.Separator;)c=us._findPreviousWordOnLine(e,t,new re(o,c.start+1));return new re(o,c?c.start+1:1)}return c&&a<=c.end+1&&(c=us._findPreviousWordOnLine(e,t,new re(o,c.start+1))),new re(o,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 re(i-1,e.getLineMaxColumn(i-1)):t;const r=e.getLineContent(i);for(let o=t.column-1;o>1;o--){const a=r.charCodeAt(o-2),c=r.charCodeAt(o-1);if(a===B.Underline&&c!==B.Underline)return new re(i,o);if(a===B.Dash&&c!==B.Dash)return new re(i,o);if((Ex(a)||RG(a))&&Uw(c))return new re(i,o);if(Uw(a)&&Uw(c)&&o+1=c.start+1&&(c=us._findNextWordOnLine(e,t,new re(r,c.end+1))),c?o=c.start+1:o=t.getLineMaxColumn(r);return new re(r,o)}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=us._findPreviousWordOnLine(i,n,new re(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 re(i.positionLineNumber,i.positionColumn),r=this._deleteInsideWordWhitespace(t,n);return r||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 r=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,r))return null;let o=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,o))return null;for(;r>0&&this._charAtIsWhitespace(i,r-1);)r--;for(;o+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=us._findPreviousWordOnLine(e,t,i);if(l&&o(l))return c(l);const d=us._findNextWordOnLine(e,t,i);return d&&o(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,r+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=us._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=us._findNextWordOnLine(i,n,new re(c,u.end+1))),u?l=u.start+1:l!!e)}class yl{static addCursorDown(e,t,i){const n=[];let r=0;for(let o=0,a=t.length;ol&&(d=l,h=e.model.getLineMaxColumn(d)),Mn.fromModelState(new Dl(new F(o.lineNumber,1,d,h),$h.Line,0,new re(d,h),0))}const c=t.modelState.selectionStart.getStartPosition().lineNumber;if(o.lineNumberc){const l=e.getLineCount();let d=a.lineNumber+1,h=1;return d>l&&(d=l,h=e.getLineMaxColumn(d)),Mn.fromViewState(t.viewState.move(!0,d,h,0))}else{const l=t.modelState.selectionStart.getEndPosition();return Mn.fromModelState(t.modelState.move(!0,l.lineNumber,l.column,0))}}static word(e,t,i,n){const r=e.model.validatePosition(n);return Mn.fromModelState(us.word(e.cursorConfig,e.model,t.modelState,i,r))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Mn(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Mn.fromViewState(new Dl(new F(i,n,i,n),$h.Simple,0,new re(i,n),0))}static moveTo(e,t,i,n,r){if(i){if(t.modelState.selectionStartKind===$h.Word)return this.word(e,t,i,n);if(t.modelState.selectionStartKind===$h.Line)return this.line(e,t,i,n,r)}const o=e.model.validatePosition(n),a=r?e.coordinatesConverter.validateViewPosition(new re(r.lineNumber,r.column),o):e.coordinatesConverter.convertModelPositionToViewPosition(o);return Mn.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,n,r,o){switch(i){case Ni.Direction.Left:return o===Ni.Unit.HalfLine?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,r);case Ni.Direction.Right:return o===Ni.Unit.HalfLine?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,r);case Ni.Direction.Up:return o===Ni.Unit.WrappedLine?this._moveUpByViewLines(e,t,n,r):this._moveUpByModelLines(e,t,n,r);case Ni.Direction.Down:return o===Ni.Unit.WrappedLine?this._moveDownByViewLines(e,t,n,r):this._moveDownByModelLines(e,t,n,r);case Ni.Direction.PrevBlankLine:return o===Ni.Unit.WrappedLine?t.map(a=>Mn.fromViewState(Es.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Mn.fromModelState(Es.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,n)));case Ni.Direction.NextBlankLine:return o===Ni.Unit.WrappedLine?t.map(a=>Mn.fromViewState(Es.moveToNextBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Mn.fromModelState(Es.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,n)));case Ni.Direction.WrappedLineStart:return this._moveToViewMinColumn(e,t,n);case Ni.Direction.WrappedLineFirstNonWhitespaceCharacter:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case Ni.Direction.WrappedLineColumnCenter:return this._moveToViewCenterColumn(e,t,n);case Ni.Direction.WrappedLineEnd:return this._moveToViewMaxColumn(e,t,n);case Ni.Direction.WrappedLineLastNonWhitespaceCharacter:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,r){const o=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(o);switch(i){case Ni.Direction.ViewPortTop:{const c=this._firstLineNumberInRange(e.model,a,r),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Ni.Direction.ViewPortBottom:{const c=this._lastLineNumberInRange(e.model,a,r),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Ni.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 Ni.Direction.ViewPortIfOutside:{const c=[];for(let l=0,d=t.length;li.endLineNumber-1?o=i.endLineNumber-1:rMn.fromViewState(Es.moveLeft(e.cursorConfig,e,r.viewState,i,n)))}static _moveHalfLineLeft(e,t,i){const n=[];for(let r=0,o=t.length;rMn.fromViewState(Es.moveRight(e.cursorConfig,e,r.viewState,i,n)))}static _moveHalfLineRight(e,t,i){const n=[];for(let r=0,o=t.length;r{this.model.tokenization.forceTokenization(f);const p=this.model.tokenization.getLineTokens(f),m=this.model.getLineMaxColumn(f)-1;return L1(p,m)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),n=L1(i,e.startColumn-1),r=pd.createEmpty("",n.languageIdCodec),o=e.startLineNumber-1;if(o===0||!(n.firstCharOffset===0))return r;const l=t(o);if(!(n.languageId===l.languageId))return r;const h=l.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(h)}}class WQe{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){const i=(o,a)=>{const c=hr(o);return a+o.substring(c.length)};this.model.tokenization.forceTokenization?.(e);const n=this.model.tokenization.getLineTokens(e);let r=this.getProcessedTokens(n).getLineContent();return t!==void 0&&(r=i(r,t)),r}getProcessedTokens(e){const t=c=>c===no.String||c===no.RegEx||c===no.Comment,i=e.getLanguageId(0),r=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),o=[];return e.forEach(c=>{const l=e.getStandardTokenType(c);let d=e.getTokenText(c);t(l)&&(d=d.replace(r,""));const h=e.getMetadata(c);o.push({text:d,metadata:h})}),pd.createFromTextAndMetadata(o,e.languageIdCodec)}}function _Le(s,e){s.tokenization.forceTokenization(e.lineNumber);const t=s.tokenization.getLineTokens(e.lineNumber),i=L1(t,e.column-1),n=i.firstCharOffset===0,r=t.getLanguageId(0)===i.languageId;return!n&&!r}function UO(s,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const n=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),r=i.getLanguageConfiguration(n);if(!r)return null;const a=new mLe(e,i).getProcessedTokenContextAroundRange(t),c=a.previousLineProcessedTokens.getLineContent(),l=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),h=r.onEnter(s,c,l,d);if(!h)return null;const u=h.indentAction;let f=h.appendText;const p=h.removeText||0;f?u===Co.Indent&&(f=" "+f):u===Co.Indent||u===Co.IndentOutdent?f=" ":f="";let m=jqe(e,t.startLineNumber,t.startColumn);return p&&(m=m.substring(0,m.length-p)),{indentAction:u,appendText:f,removeText:p,indentation:m}}var Uq;const hhe=Object.create(null);function UI(s,e){if(e<=0)return"";hhe[s]||(hhe[s]=["",s]);const t=hhe[s];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+s;return t[e]}let wm=Uq=class{static unshiftIndent(e,t,i,n,r){const o=Qa.visibleColumnFromColumn(e,t,i);if(r){const a=UI(" ",n),l=Qa.prevIndentTabStop(o,n)/n;return UI(a,l)}else{const a=" ",l=Qa.prevRenderTabStop(o,i)/i;return UI(a,l)}}static shiftIndent(e,t,i,n,r){const o=Qa.visibleColumnFromColumn(e,t,i);if(r){const a=UI(" ",n),l=Qa.nextIndentTabStop(o,n)/n;return UI(a,l)}else{const a=" ",l=Qa.nextRenderTabStop(o,i)/i;return UI(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:r,indentSize:o,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=Th(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,r)%o!==0&&e.tokenization.isCheapToTokenize(h-1)){const v=UO(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,r=-1;for(n=e-1;n>=1;n--){if(s.tokenization.getLanguageIdAtPosition(n,0)!==i)return r;const o=s.getLineContent(n);if(t.shouldIgnore(n)||/^\s+$/.test(o)||o===""){r=n;continue}return n}}return-1}function n3(s,e,t,i=!0,n){if(s0&&e.getLineContent(c)==="";c--)if(c===1)return{indentation:"",action:null};const a=B_t(e,t,o);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(o.shouldIncrease(a)||o.shouldIndentNextLine(a)){const c=e.getLineContent(a);return{indentation:hr(c),action:Co.Indent,line:a}}else if(o.shouldDecrease(a)){const c=e.getLineContent(a);return{indentation:hr(c),action:null,line:a}}else{if(a===1)return{indentation:hr(e.getLineContent(a)),action:null,line:a};const c=a-1,l=r.getIndentMetadata(e.getLineContent(c));if(!(l&(wb.INCREASE_MASK|wb.DECREASE_MASK))&&l&wb.INDENT_NEXTLINE_MASK){let d=0;for(let h=c-1;h>0;h--)if(!o.shouldIndentNextLine(h)){d=h;break}return{indentation:hr(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:hr(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(o.shouldIncrease(d))return{indentation:hr(e.getLineContent(d)),action:Co.Indent,line:d};if(o.shouldIndentNextLine(d)){let h=0;for(let u=d-1;u>0;u--)if(!o.shouldIndentNextLine(d)){h=u;break}return{indentation:hr(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(d))return{indentation:hr(e.getLineContent(d)),action:null,line:d}}return{indentation:hr(e.getLineContent(1)),action:null,line:1}}}function p5(s,e,t,i,n,r){if(s0){const b=e.getLineContent(v);if(l.shouldIndentNextLine(b)&&l.shouldIncrease(m)){const y=n3(o,e,t.startLineNumber,!1,r)?.indentation;if(y!==void 0){const C=e.getLineContent(t.startLineNumber),A=hr(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 HQe(s,e,t){const i=t.getLanguageConfiguration(s.getLanguageId()).indentRulesSupport;return!i||e<1||e>s.getLineCount()?null:i.getIndentMetadata(s.getLineContent(e))}function U_t(s,e,t){return{tokenization:{getLineTokens:n=>n===e?t:s.tokenization.getLineTokens(n),getLanguageId:()=>s.getLanguageId(),getLanguageIdAtPosition:(n,r)=>s.getLanguageIdAtPosition(n,r)},getLineContent:n=>n===e?t.getLineContent():s.getLineContent(n)}}class V_t{static getEdits(e,t,i,n,r){if(!r&&this._isAutoIndentType(e,t,i)){const o=[];for(const c of i){const l=this._findActualIndentationForSelection(e,t,c,n);if(l===null)return;o.push({selection:c,indentation:l})}const a=pme.getAutoClosingPairClose(e,t,i,n,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,o,n,a)}}static _isAutoIndentType(e,t,i){if(e.autoIndentyae(e,a),unshiftIndent:a=>s3(e,a)},e.languageConfigurationService);if(r===null)return null;const o=jqe(t,i.startLineNumber,i.startColumn);return r===e.normalizeIndentation(o)?null:r}static _getIndentationAndAutoClosingPairEdits(e,t,i,n,r){const o=i.map(({selection:c,indentation:l})=>{if(r!==null){const d=this._getEditFromIndentationAndSelection(e,t,l,c,n,!1);return new Z_t(d,c,n,r)}else{const d=this._getEditFromIndentationAndSelection(e,t,l,c,n,!0);return a0(d.range,d.text,!1)}}),a={shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1};return new sg(so.TypingOther,o,a)}static _getEditFromIndentationAndSelection(e,t,i,n,r,o=!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+=o?r:"",{range:new F(a,1,n.endLineNumber,n.endColumn),text:l}}}class z_t{static getEdits(e,t,i,n,r,o){if(UQe(t,i,n,r,o))return this._runAutoClosingOvertype(e,n,o)}static _runAutoClosingOvertype(e,t,i){const n=[];for(let r=0,o=t.length;rnew nd(new F(a.positionLineNumber,a.positionColumn,a.positionLineNumber,a.positionColumn+1),"",!1));return new sg(so.TypingOther,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}}class pme{static getEdits(e,t,i,n,r,o){if(!o){const a=this.getAutoClosingPairClose(e,t,i,n,r);if(a!==null)return this._runAutoClosingOpenCharType(i,n,r,a)}}static _runAutoClosingOpenCharType(e,t,i,n){const r=[];for(let o=0,a=e.length;o{const m=p.getPosition();return r?{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,o.map(p=>new re(p.lineNumber,p.beforeColumn)),n);if(!a)return null;let c,l;if(zk(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 o){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=_m(e.wordSeparators,[]);if(y.length>0){const R=y.charCodeAt(y.length-1);if(P.get(R)===$o.Regular)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const A=t.tokenization.getLineTokens(m),L=L1(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 r=null;for(const o of n)o.open!==t.open&&t.open.includes(o.open)&&t.close.endsWith(o.close)&&(!r||o.open.length>r.open.length)&&(r=o);return r}static _findAutoClosingPairOpen(e,t,i,n){const r=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!r)return null;let o=null;for(const a of r)if(o===null||a.open.length>o.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&&(o=a)}return o}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],r=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],o=n.some(c=>t.startsWith(c.open)),a=r.some(c=>t.startsWith(c.close));return!o&&a}}class G_t{static getEdits(e,t,i,n,r){if(!r&&this._isSurroundSelectionType(e,t,i,n))return this._runSurroundSelectionType(e,i,n)}static _runSurroundSelectionType(e,t,i){const n=[];for(let r=0,o=t.length;r{this.model.tokenization.forceTokenization(f);const p=this.model.tokenization.getLineTokens(f),m=this.model.getLineMaxColumn(f)-1;return L1(p,m)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),n=L1(i,e.startColumn-1),r=pd.createEmpty("",n.languageIdCodec),o=e.startLineNumber-1;if(o===0||!(n.firstCharOffset===0))return r;const l=t(o);if(!(n.languageId===l.languageId))return r;const h=l.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(h)}}class WQe{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){const i=(o,a)=>{const c=hr(o);return a+o.substring(c.length)};this.model.tokenization.forceTokenization?.(e);const n=this.model.tokenization.getLineTokens(e);let r=this.getProcessedTokens(n).getLineContent();return t!==void 0&&(r=i(r,t)),r}getProcessedTokens(e){const t=c=>c===no.String||c===no.RegEx||c===no.Comment,i=e.getLanguageId(0),r=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),o=[];return e.forEach(c=>{const l=e.getStandardTokenType(c);let d=e.getTokenText(c);t(l)&&(d=d.replace(r,""));const h=e.getMetadata(c);o.push({text:d,metadata:h})}),pd.createFromTextAndMetadata(o,e.languageIdCodec)}}function _Le(s,e){s.tokenization.forceTokenization(e.lineNumber);const t=s.tokenization.getLineTokens(e.lineNumber),i=L1(t,e.column-1),n=i.firstCharOffset===0,r=t.getLanguageId(0)===i.languageId;return!n&&!r}function UO(s,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const n=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),r=i.getLanguageConfiguration(n);if(!r)return null;const a=new mLe(e,i).getProcessedTokenContextAroundRange(t),c=a.previousLineProcessedTokens.getLineContent(),l=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),h=r.onEnter(s,c,l,d);if(!h)return null;const u=h.indentAction;let f=h.appendText;const p=h.removeText||0;f?u===Co.Indent&&(f=" "+f):u===Co.Indent||u===Co.IndentOutdent?f=" ":f="";let m=jqe(e,t.startLineNumber,t.startColumn);return p&&(m=m.substring(0,m.length-p)),{indentAction:u,appendText:f,removeText:p,indentation:m}}var Uq;const hhe=Object.create(null);function UI(s,e){if(e<=0)return"";hhe[s]||(hhe[s]=["",s]);const t=hhe[s];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+s;return t[e]}let wm=Uq=class{static unshiftIndent(e,t,i,n,r){const o=ja.visibleColumnFromColumn(e,t,i);if(r){const a=UI(" ",n),l=ja.prevIndentTabStop(o,n)/n;return UI(a,l)}else{const a=" ",l=ja.prevRenderTabStop(o,i)/i;return UI(a,l)}}static shiftIndent(e,t,i,n,r){const o=ja.visibleColumnFromColumn(e,t,i);if(r){const a=UI(" ",n),l=ja.nextIndentTabStop(o,n)/n;return UI(a,l)}else{const a=" ",l=ja.nextRenderTabStop(o,i)/i;return UI(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:r,indentSize:o,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=Th(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&&ja.visibleColumnFromColumn(u,f+1,r)%o!==0&&e.tokenization.isCheapToTokenize(h-1)){const v=UO(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,r=-1;for(n=e-1;n>=1;n--){if(s.tokenization.getLanguageIdAtPosition(n,0)!==i)return r;const o=s.getLineContent(n);if(t.shouldIgnore(n)||/^\s+$/.test(o)||o===""){r=n;continue}return n}}return-1}function n3(s,e,t,i=!0,n){if(s0&&e.getLineContent(c)==="";c--)if(c===1)return{indentation:"",action:null};const a=B_t(e,t,o);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(o.shouldIncrease(a)||o.shouldIndentNextLine(a)){const c=e.getLineContent(a);return{indentation:hr(c),action:Co.Indent,line:a}}else if(o.shouldDecrease(a)){const c=e.getLineContent(a);return{indentation:hr(c),action:null,line:a}}else{if(a===1)return{indentation:hr(e.getLineContent(a)),action:null,line:a};const c=a-1,l=r.getIndentMetadata(e.getLineContent(c));if(!(l&(wb.INCREASE_MASK|wb.DECREASE_MASK))&&l&wb.INDENT_NEXTLINE_MASK){let d=0;for(let h=c-1;h>0;h--)if(!o.shouldIndentNextLine(h)){d=h;break}return{indentation:hr(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:hr(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(o.shouldIncrease(d))return{indentation:hr(e.getLineContent(d)),action:Co.Indent,line:d};if(o.shouldIndentNextLine(d)){let h=0;for(let u=d-1;u>0;u--)if(!o.shouldIndentNextLine(d)){h=u;break}return{indentation:hr(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(d))return{indentation:hr(e.getLineContent(d)),action:null,line:d}}return{indentation:hr(e.getLineContent(1)),action:null,line:1}}}function p5(s,e,t,i,n,r){if(s0){const b=e.getLineContent(v);if(l.shouldIndentNextLine(b)&&l.shouldIncrease(m)){const y=n3(o,e,t.startLineNumber,!1,r)?.indentation;if(y!==void 0){const C=e.getLineContent(t.startLineNumber),A=hr(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 HQe(s,e,t){const i=t.getLanguageConfiguration(s.getLanguageId()).indentRulesSupport;return!i||e<1||e>s.getLineCount()?null:i.getIndentMetadata(s.getLineContent(e))}function U_t(s,e,t){return{tokenization:{getLineTokens:n=>n===e?t:s.tokenization.getLineTokens(n),getLanguageId:()=>s.getLanguageId(),getLanguageIdAtPosition:(n,r)=>s.getLanguageIdAtPosition(n,r)},getLineContent:n=>n===e?t.getLineContent():s.getLineContent(n)}}class V_t{static getEdits(e,t,i,n,r){if(!r&&this._isAutoIndentType(e,t,i)){const o=[];for(const c of i){const l=this._findActualIndentationForSelection(e,t,c,n);if(l===null)return;o.push({selection:c,indentation:l})}const a=pme.getAutoClosingPairClose(e,t,i,n,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,o,n,a)}}static _isAutoIndentType(e,t,i){if(e.autoIndentyae(e,a),unshiftIndent:a=>s3(e,a)},e.languageConfigurationService);if(r===null)return null;const o=jqe(t,i.startLineNumber,i.startColumn);return r===e.normalizeIndentation(o)?null:r}static _getIndentationAndAutoClosingPairEdits(e,t,i,n,r){const o=i.map(({selection:c,indentation:l})=>{if(r!==null){const d=this._getEditFromIndentationAndSelection(e,t,l,c,n,!1);return new Z_t(d,c,n,r)}else{const d=this._getEditFromIndentationAndSelection(e,t,l,c,n,!0);return a0(d.range,d.text,!1)}}),a={shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1};return new sg(so.TypingOther,o,a)}static _getEditFromIndentationAndSelection(e,t,i,n,r,o=!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+=o?r:"",{range:new F(a,1,n.endLineNumber,n.endColumn),text:l}}}class z_t{static getEdits(e,t,i,n,r,o){if(UQe(t,i,n,r,o))return this._runAutoClosingOvertype(e,n,o)}static _runAutoClosingOvertype(e,t,i){const n=[];for(let r=0,o=t.length;rnew nd(new F(a.positionLineNumber,a.positionColumn,a.positionLineNumber,a.positionColumn+1),"",!1));return new sg(so.TypingOther,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}}class pme{static getEdits(e,t,i,n,r,o){if(!o){const a=this.getAutoClosingPairClose(e,t,i,n,r);if(a!==null)return this._runAutoClosingOpenCharType(i,n,r,a)}}static _runAutoClosingOpenCharType(e,t,i,n){const r=[];for(let o=0,a=e.length;o{const m=p.getPosition();return r?{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,o.map(p=>new re(p.lineNumber,p.beforeColumn)),n);if(!a)return null;let c,l;if(zk(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 o){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=_m(e.wordSeparators,[]);if(y.length>0){const R=y.charCodeAt(y.length-1);if(P.get(R)===$o.Regular)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const A=t.tokenization.getLineTokens(m),L=L1(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 r=null;for(const o of n)o.open!==t.open&&t.open.includes(o.open)&&t.close.endsWith(o.close)&&(!r||o.open.length>r.open.length)&&(r=o);return r}static _findAutoClosingPairOpen(e,t,i,n){const r=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!r)return null;let o=null;for(const a of r)if(o===null||a.open.length>o.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&&(o=a)}return o}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],r=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],o=n.some(c=>t.startsWith(c.open)),a=r.some(c=>t.startsWith(c.close));return!o&&a}}class G_t{static getEdits(e,t,i,n,r){if(!r&&this._isSurroundSelectionType(e,t,i,n))return this._runSurroundSelectionType(e,i,n)}static _runSurroundSelectionType(e,t,i){const n=[];for(let r=0,o=t.length;rthis._compositionType(i,d,r,o,a,c));return new sg(so.TypingOther,l,{shouldPushStackElementBefore:wae(e,so.TypingOther),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,r,o){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+r),d=new F(a.lineNumber,c,a.lineNumber,l);return e.getValueInRange(d)===i&&o===0?null:new yY(d,i,0,o)}}class Y_t{static getEdits(e,t,i){const n=[];for(let o=0,a=t.length;o1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(M_(d)>=0)break}if(a<1)return null;const c=t.getLineMaxColumn(a),l=UO(e.autoIndent,t,new F(a,c,a,c),e.languageConfigurationService);l&&(r=l.indentation+l.appendText)}return n&&(n===Co.Indent&&(r=yae(e,r)),n===Co.Outdent&&(r=s3(e,r)),r=e.normalizeIndentation(r)),r||null}static _replaceJumpToNextIndent(e,t,i,n){let r="";const o=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,o),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(qt).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(t,n,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const n=Wc();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(qt).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 Oy;(function(s){s[s.Regular=0]="Regular",s[s.Minimal=1]="Minimal",s[s.None=2]="None"})(Oy||(Oy={}));var el;(function(s){class e extends na{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,C){if(!C.position)return;y.model.pushStackElement(),y.setCursorStates(C.source,Bi.Explicit,[wl.moveTo(y,y.getPrimaryCursorState(),this._inSelectionMode,C.position,C.viewPosition)])&&C.revealType!==Oy.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 na{runCoreEditorCommand(y,C){y.model.pushStackElement();const A=this._getColumnSelectResult(y,y.getPrimaryCursorState(),y.getCursorColumnSelectData(),C);A!==null&&(y.setCursorStates(C.source,Bi.Explicit,A.viewStates.map(L=>Mn.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 re(A.viewPosition.lineNumber,A.viewPosition.column),L),P=A.doColumnSelect?C.fromViewLineNumber:k.lineNumber,R=A.doColumnSelect?C.fromViewVisualColumn:A.mouseColumn-1;return q0.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 q0.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 q0.columnSelectRight(w.cursorConfig,w,C)}});class i extends t{constructor(y){super(y),this._isPaged=y.isPaged}_getColumnSelectResult(y,C,A,L){return q0.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 q0.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 r extends na{constructor(){super({id:"cursorMove",precondition:void 0,metadata:Ni.metadata})}runCoreEditorCommand(y,C){const A=Ni.parse(C);A&&this._runCursorMove(y,C.source,A)}_runCursorMove(y,C,A){y.model.pushStackElement(),y.setCursorStates(C,Bi.Explicit,r._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 Ni.Direction.Left:case Ni.Direction.Right:case Ni.Direction.Up:case Ni.Direction.Down:case Ni.Direction.PrevBlankLine:case Ni.Direction.NextBlankLine:case Ni.Direction.WrappedLineStart:case Ni.Direction.WrappedLineFirstNonWhitespaceCharacter:case Ni.Direction.WrappedLineColumnCenter:case Ni.Direction.WrappedLineEnd:case Ni.Direction.WrappedLineLastNonWhitespaceCharacter:return wl.simpleMove(y,C,A.direction,L,k,A.unit);case Ni.Direction.ViewPortTop:case Ni.Direction.ViewPortBottom:case Ni.Direction.ViewPortCenter:case Ni.Direction.ViewPortIfOutside:return wl.viewportMove(y,C,A.direction,L,k);default:return null}}}s.CursorMoveImpl=r,s.CursorMove=Qe(new r);let o;(function(w){w[w.PAGE_SIZE_MARKER=-1]="PAGE_SIZE_MARKER"})(o||(o={}));class a extends na{constructor(y){super(y),this._staticArgs=y.args}runCoreEditorCommand(y,C){let A=this._staticArgs;this._staticArgs.value===o.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,Bi.Explicit,wl.simpleMove(y,y.getCursorStates(),A.direction,A.select,A.value,A.unit)),y.revealAllCursors(C.source,!0)}}s.CursorLeft=Qe(new a({args:{direction:Ni.Direction.Left,unit:Ni.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:Ni.Direction.Left,unit:Ni.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:Ni.Direction.Right,unit:Ni.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:Ni.Direction.Right,unit:Ni.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:Ni.Direction.Up,unit:Ni.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:Ni.Direction.Up,unit:Ni.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:Ni.Direction.Up,unit:Ni.Unit.WrappedLine,select:!1,value:o.PAGE_SIZE_MARKER},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.PageUp}})),s.CursorPageUpSelect=Qe(new a({args:{direction:Ni.Direction.Up,unit:Ni.Unit.WrappedLine,select:!0,value:o.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:Ni.Direction.Down,unit:Ni.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:Ni.Direction.Down,unit:Ni.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:Ni.Direction.Down,unit:Ni.Unit.WrappedLine,select:!1,value:o.PAGE_SIZE_MARKER},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.PageDown}})),s.CursorPageDownSelect=Qe(new a({args:{direction:Ni.Direction.Down,unit:Ni.Unit.WrappedLine,select:!0,value:o.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 na{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(w,y){if(!y.position)return;let C;y.wholeLine?C=wl.line(w,w.getPrimaryCursorState(),!1,y.position,y.viewPosition):C=wl.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=vs.Simple;if(C.at)switch(C.at){case dF.RawAtArgument.Top:R=vs.Top;break;case dF.RawAtArgument.Center:R=vs.Center;break;case dF.RawAtArgument.Bottom:R=vs.Bottom;break}const z=w.coordinatesConverter.convertModelRangeToViewRange(P);w.revealRange(y.source,!1,z,R,_t.Smooth)}}),s.SelectAll=new class extends mme{constructor(){super(Mut)}runDOMCommand(w){lf&&(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",Bi.Explicit,[wl.selectAll(w,w.getPrimaryCursorState())])}},s.SetSelection=Qe(new class extends na{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(w,y){y.selection&&(w.model.pushStackElement(),w.setCursorStates(y.source,Bi.Explicit,[Mn.fromModelSelection(y.selection)]))}})})(el||(el={}));const tvt=he.and(J.textInputFocus,J.columnSelection);function RU(s,e){Sr.registerKeybindingRule({id:s,primary:e,when:tvt,weight:os+1})}RU(el.CursorColumnSelectLeft.id,U.Shift|S.LeftArrow);RU(el.CursorColumnSelectRight.id,U.Shift|S.RightArrow);RU(el.CursorColumnSelectUp.id,U.Shift|S.UpArrow);RU(el.CursorColumnSelectPageUp.id,U.Shift|S.PageUp);RU(el.CursorColumnSelectDown.id,U.Shift|S.DownArrow);RU(el.CursorColumnSelectPageDown.id,U.Shift|S.PageDown);function LBe(s){return s.register(),s}var VO;(function(s){class e extends uc{runEditorCommand(i,n,r){const o=n._getViewModel();o&&this.runCoreEditingCommand(n,o,r||{})}}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,bae.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.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,nx.outdent(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.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,nx.tab(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.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[r,o]=DM.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());r&&t.pushUndoStop(),t.executeCommands(this.id,o),i.setPrevEditOperationType(so.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[r,o]=DM.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));r&&t.pushUndoStop(),t.executeCommands(this.id,o),i.setPrevEditOperationType(so.DeletingRight)}}),s.Undo=new class extends mme{constructor(){super(xqe)}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 mme{constructor(){super(Dqe)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().redo()}}})(VO||(VO={}));class RBe extends sae{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(qt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function ON(s,e){LBe(new RBe("default:"+s,s)),LBe(new RBe(s,s,e))}ON(oc.Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});ON(oc.ReplacePreviousChar);ON(oc.CompositionType);ON(oc.CompositionStart);ON(oc.CompositionEnd);ON(oc.Paste);ON(oc.Cut);let _d=class extends V{onclick(e,t){this._register(ue(e,ke.CLICK,i=>t(new Dh(lt(e),i))))}onmousedown(e,t){this._register(ue(e,ke.MOUSE_DOWN,i=>t(new Dh(lt(e),i))))}onmouseover(e,t){this._register(ue(e,ke.MOUSE_OVER,i=>t(new Dh(lt(e),i))))}onmouseleave(e,t){this._register(ue(e,ke.MOUSE_LEAVE,i=>t(new Dh(lt(e),i))))}onkeydown(e,t){this._register(ue(e,ke.KEY_DOWN,i=>t(new xn(i))))}onkeyup(e,t){this._register(ue(e,ke.KEY_UP,i=>t(new xn(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 md.ignoreTarget(e)}};const J2=11;class ivt extends _d{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(...He.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=J2+"px",this.domNode.style.height=J2+"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 LU),this._register(Rr(this.bgDomNode,ke.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Rr(this.domNode,ke.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new d6),this._pointerdownScheduleRepeatTimer=this._register(new Em)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,lt(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 nvt 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 Em)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===Cr.Hidden?!1:this._visibility===Cr.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 svt=140;class zQe extends _d{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 nvt(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new LU),this._shouldRender=!0,this.domNode=ds(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 ivt(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=ds(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,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.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(),r=this._sliderPointerPosition(e);i<=r&&r<=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 r=So(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.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,r=>{const o=this._sliderOrthogonalPointerPosition(r),a=Math.abs(o-i);if(jn&&a>svt){this._setDesiredScrollPositionNow(n.getScrollPosition());return}const l=this._sliderPointerPosition(r)-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 rvt=20;class X2{constructor(e,t,i,n,r,o){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=r,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new X2(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,r){const o=Math.max(0,i-e),a=Math.max(0,o-2*t),c=n>0&&n>i;if(!c)return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(rvt,Math.floor(i*a/n))),d=(a-l)/(n-i),h=r*d;return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=X2._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 SM(null,1,0))}),this._createArrow({className:"scra",icon:ve.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:o,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new SM(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===Cr.Hidden?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===Cr.Hidden?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class avt extends zQe{constructor(e,t,i){const n=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new X2(t.verticalHasArrows?t.arrowSize:0,t.vertical===Cr.Hidden?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const o=(t.arrowSize-J2)/2,a=(t.verticalScrollbarSize-J2)/2;this._createArrow({className:"scra",icon:ve.scrollbarButtonUp,top:o,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new SM(null,0,1))}),this._createArrow({className:"scra",icon:ve.scrollbarButtonDown,top:void 0,left:a,bottom:o,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new SM(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===Cr.Hidden?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}var cvt=".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)}";gt(cvt,{});const lvt=500,MBe=50;class dvt{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}const gse=class gse{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 r=n===this._front?e:Math.pow(2,-i);if(e-=r,t+=this._memory[n].score*r,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(o6){const t=lt(e.browserEvent),i=Edt(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 r=new dvt(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=r,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]=r),r.score=this._computeScore(r,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),r=Math.abs(e.deltaY),o=Math.abs(t.deltaX),a=Math.abs(t.deltaY),c=Math.max(Math.min(n,o),1),l=Math.max(Math.min(r,a),1),d=Math.max(n,o),h=Math.max(r,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}};gse.INSTANCE=new gse;let CY=gse;class wLe extends _d{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=hvt(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));const n={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new avt(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new ovt(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=ds(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ds(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ds(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,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new Em),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=wt(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,jt&&(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 SM(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=wt(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new SM(n))};this._mouseWheelToDispose.push(ue(this._listenOnDomNode,ke.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=CY.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+r===0?o=r=0:Math.abs(r)>=Math.abs(o)?o=0:r=0),this._options.flipAxes&&([r,o]=[o,r]);const a=!jt&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!o&&(o=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let l={};if(r){const d=MBe*r,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(l,h)}if(o){const d=MBe*o,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":"",r=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${r}${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(),lvt)}}class $Qe extends wLe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new DN({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Ml(lt(e),n)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class y6 extends wLe{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 MU extends wLe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new DN({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Ml(lt(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 hvt(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:Cr.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:Cr.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,jt&&(e.className+=" mac"),e}class yLe extends w6{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 Id(this._context,i),this._mouseDownOperation=this._register(new uvt(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 i_t(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 Vk(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 r=this.viewHelper.overflowWidgetsDomNode;r&&(this._register(n.onMouseMove(r,a=>{this._mouseOnOverflowWidgetsDomNode=!0,this._mouseLeaveMonitor?.dispose(),this._mouseLeaveMonitor=null,this._onMouseMoveOverOverflowWidgetsDomNode(a)})),this._register(n.onMouseLeave(r,a=>{this._mouseOnOverflowWidgetsDomNode=!1,setTimeout(()=>{this._mouseOnViewDomNode||this._onMouseLeave(a)},0)})));let o=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(a,c)=>{o=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,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=CY.INSTANCE;let t=0,i=Jp.getZoomLevel(),n=!1,r=0;const o=c=>{if(this.viewController.emitMouseWheel(c),!this._context.configuration.options.get(x.mouseWheelZoom))return;const l=new SM(c);if(e.acceptStandardWheelEvent(l),e.isPhysicalMouseWheel()){if(a(c)){const d=Jp.getZoomLevel(),h=l.deltaY>0?1:-1;Jp.setZoomLevel(d+h),l.preventDefault(),l.stopPropagation()}}else Date.now()-t>50&&(i=Jp.getZoomLevel(),n=a(c),r=0),t=Date.now(),r+=l.deltaY,n&&(Jp.setZoomLevel(i+r/5),l.preventDefault(),l.stopPropagation())};this._register(ue(this.viewHelper.viewDomNode,ke.MOUSE_WHEEL,o,{capture:!0,passive:!1}));function a(c){return jt?(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 MQe(e,t).toPageCoordinates(lt(this.viewHelper.viewDomNode)),r=dLe(this.viewHelper.viewDomNode);if(n.yr.y+r.height||n.xr.x+r.width)return null;const o=hLe(this.viewHelper.viewDomNode,r,n);return this.mouseTargetFactory.createMouseTargetForView(this.viewHelper.getLastRenderData(),r,n,o,null)}_createMouseTargetForView(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const n=AM(this.viewHelper.viewDomNode);n&&(i=n.elementsFromPoint(e.posx,e.posy).find(r=>this.viewHelper.viewDomNode.contains(r)))}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||o&&a))h(),this._mouseDownOperation.start(i.type,e,t);else if(r)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 uvt extends V{constructor(e,t,i,n,r,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=r,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new s_t(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new gvt(this._context,this._viewHelper,this._mouseTargetFactory,(a,c,l)=>this._dispatchMouse(a,c,l))),this._mouseState=new _me,this._currentSelection=new ht(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,Oy.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 n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const r=this._context.configuration.options;if(!r.get(x.readOnly)&&r.get(x.dragAndDrop)&&!r.get(x.columnSelection)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&n.type===Mt.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,o=>this._onMouseDownThenMove(o),o=>{const a=this._findMousePosition(this._lastMouseEvent,!1);g_(o)?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,Oy.Minimal),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,o=>this._onMouseDownThenMove(o),()=>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,r=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,c=n.getCurrentScrollTop()+e.relativePos.y,l=xM.getZoneAtCoord(this._context,c);if(l){const h=this._helpPositionJumpOverViewZone(l);if(h)return fh.createOutsideEditor(r,h,"below",a)}const d=n.getLineNumberAtVerticalOffset(c);return fh.createOutsideEditor(r,new re(d,i.getLineMaxColumn(d)),"below",a)}const o=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return fh.createOutsideEditor(r,new re(o,i.getLineMaxColumn(o)),"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===Mt.CONTENT_VIEW_ZONE||n.type===Mt.GUTTER_VIEW_ZONE){const o=this._helpPositionJumpOverViewZone(n.detail);if(o)return fh.createViewZone(n.type,n.element,n.mouseColumn,o,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new re(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===Mt.CONTENT_TEXT&&e.detail.injectedText!==null})}}class gvt 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 fvt(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class fvt extends V{constructor(e,t,i,n,r,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=r,this._mouseEvent=o,this._lastTime=Date.now(),this._animationFrameDisposable=Ml(lt(o.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,r=this._position.outsidePosition==="above"?-n:n;this._context.viewModel.viewLayout.deltaScrollNow(0,r),this._viewHelper.renderNow();const o=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?o.startLineNumber:o.endLineNumber;let c;{const l=dLe(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(x.layoutInfo).horizontalScrollbarHeight,h=new pae(this._mouseEvent.pos.x,l.y+l.height-d-.1),u=hLe(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=fh.createOutsideEditor(this._position.mouseColumn,new re(a,1),"above",this._position.outsideDistance):c=fh.createOutsideEditor(this._position.mouseColumn,new re(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(c,!0,Oy.None),this._animationFrameDisposable=Ml(lt(c.element),()=>this._execute())}}const fse=class fse{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>fse.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)}};fse.CLEAR_MOUSE_DOWN_COUNT_TIME=400;let _me=fse;class ni{get event(){return this.emitter.event}constructor(e,t,i){const n=r=>this.emitter.fire(r);this.emitter=new I({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}const JF=class JF{constructor(e,t,i,n,r){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=r}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),r=e.getSelectionEnd();let o;if(t){const a=i.substring(0,n),c=t.value.substring(0,t.selectionStart);a===c&&(o=t.newlineCountBeforeSelection)}return new JF(i,n,r,null,o)}collapseSelection(){return this.selectionStart===this.value.length?this:new JF(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,r=-1;for(;(r=t.indexOf(` +`)!==n.length-1&&(r=!1),r){const h=new F(d.lineNumber,1,d.lineNumber,1);o[a]=new fLe(h,n,l,!0)}else o[a]=new nd(l,n)}return new sg(so.Other,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class j_t{static getEdits(e,t,i,n,r,o,a,c){const l=n.map(d=>this._compositionType(i,d,r,o,a,c));return new sg(so.TypingOther,l,{shouldPushStackElementBefore:wae(e,so.TypingOther),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,r,o){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+r),d=new F(a.lineNumber,c,a.lineNumber,l);return e.getValueInRange(d)===i&&o===0?null:new yY(d,i,0,o)}}class Y_t{static getEdits(e,t,i){const n=[];for(let o=0,a=t.length;o1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(M_(d)>=0)break}if(a<1)return null;const c=t.getLineMaxColumn(a),l=UO(e.autoIndent,t,new F(a,c,a,c),e.languageConfigurationService);l&&(r=l.indentation+l.appendText)}return n&&(n===Co.Indent&&(r=yae(e,r)),n===Co.Outdent&&(r=s3(e,r)),r=e.normalizeIndentation(r)),r||null}static _replaceJumpToNextIndent(e,t,i,n){let r="";const o=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,o),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(qt).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(t,n,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const n=Wc();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(qt).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 Oy;(function(s){s[s.Regular=0]="Regular",s[s.Minimal=1]="Minimal",s[s.None=2]="None"})(Oy||(Oy={}));var el;(function(s){class e extends na{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,C){if(!C.position)return;y.model.pushStackElement(),y.setCursorStates(C.source,Bi.Explicit,[yl.moveTo(y,y.getPrimaryCursorState(),this._inSelectionMode,C.position,C.viewPosition)])&&C.revealType!==Oy.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 na{runCoreEditorCommand(y,C){y.model.pushStackElement();const A=this._getColumnSelectResult(y,y.getPrimaryCursorState(),y.getCursorColumnSelectData(),C);A!==null&&(y.setCursorStates(C.source,Bi.Explicit,A.viewStates.map(L=>Mn.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 re(A.viewPosition.lineNumber,A.viewPosition.column),L),P=A.doColumnSelect?C.fromViewLineNumber:k.lineNumber,R=A.doColumnSelect?C.fromViewVisualColumn:A.mouseColumn-1;return q0.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 q0.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 q0.columnSelectRight(w.cursorConfig,w,C)}});class i extends t{constructor(y){super(y),this._isPaged=y.isPaged}_getColumnSelectResult(y,C,A,L){return q0.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 q0.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 r extends na{constructor(){super({id:"cursorMove",precondition:void 0,metadata:Ni.metadata})}runCoreEditorCommand(y,C){const A=Ni.parse(C);A&&this._runCursorMove(y,C.source,A)}_runCursorMove(y,C,A){y.model.pushStackElement(),y.setCursorStates(C,Bi.Explicit,r._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 Ni.Direction.Left:case Ni.Direction.Right:case Ni.Direction.Up:case Ni.Direction.Down:case Ni.Direction.PrevBlankLine:case Ni.Direction.NextBlankLine:case Ni.Direction.WrappedLineStart:case Ni.Direction.WrappedLineFirstNonWhitespaceCharacter:case Ni.Direction.WrappedLineColumnCenter:case Ni.Direction.WrappedLineEnd:case Ni.Direction.WrappedLineLastNonWhitespaceCharacter:return yl.simpleMove(y,C,A.direction,L,k,A.unit);case Ni.Direction.ViewPortTop:case Ni.Direction.ViewPortBottom:case Ni.Direction.ViewPortCenter:case Ni.Direction.ViewPortIfOutside:return yl.viewportMove(y,C,A.direction,L,k);default:return null}}}s.CursorMoveImpl=r,s.CursorMove=Qe(new r);let o;(function(w){w[w.PAGE_SIZE_MARKER=-1]="PAGE_SIZE_MARKER"})(o||(o={}));class a extends na{constructor(y){super(y),this._staticArgs=y.args}runCoreEditorCommand(y,C){let A=this._staticArgs;this._staticArgs.value===o.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,Bi.Explicit,yl.simpleMove(y,y.getCursorStates(),A.direction,A.select,A.value,A.unit)),y.revealAllCursors(C.source,!0)}}s.CursorLeft=Qe(new a({args:{direction:Ni.Direction.Left,unit:Ni.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:Ni.Direction.Left,unit:Ni.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:Ni.Direction.Right,unit:Ni.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:Ni.Direction.Right,unit:Ni.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:Ni.Direction.Up,unit:Ni.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:Ni.Direction.Up,unit:Ni.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:Ni.Direction.Up,unit:Ni.Unit.WrappedLine,select:!1,value:o.PAGE_SIZE_MARKER},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.PageUp}})),s.CursorPageUpSelect=Qe(new a({args:{direction:Ni.Direction.Up,unit:Ni.Unit.WrappedLine,select:!0,value:o.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:Ni.Direction.Down,unit:Ni.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:Ni.Direction.Down,unit:Ni.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:Ni.Direction.Down,unit:Ni.Unit.WrappedLine,select:!1,value:o.PAGE_SIZE_MARKER},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.PageDown}})),s.CursorPageDownSelect=Qe(new a({args:{direction:Ni.Direction.Down,unit:Ni.Unit.WrappedLine,select:!0,value:o.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 na{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(w,y){if(!y.position)return;let C;y.wholeLine?C=yl.line(w,w.getPrimaryCursorState(),!1,y.position,y.viewPosition):C=yl.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=vs.Simple;if(C.at)switch(C.at){case dF.RawAtArgument.Top:R=vs.Top;break;case dF.RawAtArgument.Center:R=vs.Center;break;case dF.RawAtArgument.Bottom:R=vs.Bottom;break}const z=w.coordinatesConverter.convertModelRangeToViewRange(P);w.revealRange(y.source,!1,z,R,_t.Smooth)}}),s.SelectAll=new class extends mme{constructor(){super(Mut)}runDOMCommand(w){lf&&(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",Bi.Explicit,[yl.selectAll(w,w.getPrimaryCursorState())])}},s.SetSelection=Qe(new class extends na{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(w,y){y.selection&&(w.model.pushStackElement(),w.setCursorStates(y.source,Bi.Explicit,[Mn.fromModelSelection(y.selection)]))}})})(el||(el={}));const tvt=he.and(J.textInputFocus,J.columnSelection);function RU(s,e){Sr.registerKeybindingRule({id:s,primary:e,when:tvt,weight:os+1})}RU(el.CursorColumnSelectLeft.id,U.Shift|S.LeftArrow);RU(el.CursorColumnSelectRight.id,U.Shift|S.RightArrow);RU(el.CursorColumnSelectUp.id,U.Shift|S.UpArrow);RU(el.CursorColumnSelectPageUp.id,U.Shift|S.PageUp);RU(el.CursorColumnSelectDown.id,U.Shift|S.DownArrow);RU(el.CursorColumnSelectPageDown.id,U.Shift|S.PageDown);function LBe(s){return s.register(),s}var VO;(function(s){class e extends uc{runEditorCommand(i,n,r){const o=n._getViewModel();o&&this.runCoreEditingCommand(n,o,r||{})}}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,bae.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.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,nx.outdent(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.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,nx.tab(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.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[r,o]=DM.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());r&&t.pushUndoStop(),t.executeCommands(this.id,o),i.setPrevEditOperationType(so.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[r,o]=DM.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));r&&t.pushUndoStop(),t.executeCommands(this.id,o),i.setPrevEditOperationType(so.DeletingRight)}}),s.Undo=new class extends mme{constructor(){super(xqe)}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 mme{constructor(){super(Dqe)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().redo()}}})(VO||(VO={}));class RBe extends sae{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(qt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function ON(s,e){LBe(new RBe("default:"+s,s)),LBe(new RBe(s,s,e))}ON(oc.Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});ON(oc.ReplacePreviousChar);ON(oc.CompositionType);ON(oc.CompositionStart);ON(oc.CompositionEnd);ON(oc.Paste);ON(oc.Cut);let _d=class extends V{onclick(e,t){this._register(ue(e,ke.CLICK,i=>t(new Dh(lt(e),i))))}onmousedown(e,t){this._register(ue(e,ke.MOUSE_DOWN,i=>t(new Dh(lt(e),i))))}onmouseover(e,t){this._register(ue(e,ke.MOUSE_OVER,i=>t(new Dh(lt(e),i))))}onmouseleave(e,t){this._register(ue(e,ke.MOUSE_LEAVE,i=>t(new Dh(lt(e),i))))}onkeydown(e,t){this._register(ue(e,ke.KEY_DOWN,i=>t(new xn(i))))}onkeyup(e,t){this._register(ue(e,ke.KEY_UP,i=>t(new xn(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 md.ignoreTarget(e)}};const J2=11;class ivt extends _d{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(...He.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=J2+"px",this.domNode.style.height=J2+"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 LU),this._register(Rr(this.bgDomNode,ke.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Rr(this.domNode,ke.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new d6),this._pointerdownScheduleRepeatTimer=this._register(new Em)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,lt(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 nvt 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 Em)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===Cr.Hidden?!1:this._visibility===Cr.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 svt=140;class zQe extends _d{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 nvt(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new LU),this._shouldRender=!0,this.domNode=ds(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 ivt(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=ds(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,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.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(),r=this._sliderPointerPosition(e);i<=r&&r<=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 r=So(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.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,r=>{const o=this._sliderOrthogonalPointerPosition(r),a=Math.abs(o-i);if(jn&&a>svt){this._setDesiredScrollPositionNow(n.getScrollPosition());return}const l=this._sliderPointerPosition(r)-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 rvt=20;class X2{constructor(e,t,i,n,r,o){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=r,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new X2(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,r){const o=Math.max(0,i-e),a=Math.max(0,o-2*t),c=n>0&&n>i;if(!c)return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(rvt,Math.floor(i*a/n))),d=(a-l)/(n-i),h=r*d;return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=X2._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 SM(null,1,0))}),this._createArrow({className:"scra",icon:ve.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:o,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new SM(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===Cr.Hidden?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===Cr.Hidden?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class avt extends zQe{constructor(e,t,i){const n=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new X2(t.verticalHasArrows?t.arrowSize:0,t.vertical===Cr.Hidden?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const o=(t.arrowSize-J2)/2,a=(t.verticalScrollbarSize-J2)/2;this._createArrow({className:"scra",icon:ve.scrollbarButtonUp,top:o,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new SM(null,0,1))}),this._createArrow({className:"scra",icon:ve.scrollbarButtonDown,top:void 0,left:a,bottom:o,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new SM(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===Cr.Hidden?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}var cvt=".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)}";gt(cvt,{});const lvt=500,MBe=50;class dvt{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}const gse=class gse{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 r=n===this._front?e:Math.pow(2,-i);if(e-=r,t+=this._memory[n].score*r,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(o6){const t=lt(e.browserEvent),i=Edt(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 r=new dvt(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=r,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]=r),r.score=this._computeScore(r,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),r=Math.abs(e.deltaY),o=Math.abs(t.deltaX),a=Math.abs(t.deltaY),c=Math.max(Math.min(n,o),1),l=Math.max(Math.min(r,a),1),d=Math.max(n,o),h=Math.max(r,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}};gse.INSTANCE=new gse;let CY=gse;class wLe extends _d{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=hvt(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));const n={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new avt(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new ovt(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=ds(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ds(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ds(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,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new Em),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=wt(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,jt&&(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 SM(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=wt(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new SM(n))};this._mouseWheelToDispose.push(ue(this._listenOnDomNode,ke.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=CY.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+r===0?o=r=0:Math.abs(r)>=Math.abs(o)?o=0:r=0),this._options.flipAxes&&([r,o]=[o,r]);const a=!jt&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!o&&(o=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let l={};if(r){const d=MBe*r,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(l,h)}if(o){const d=MBe*o,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":"",r=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${r}${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(),lvt)}}class $Qe extends wLe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new DN({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Nl(lt(e),n)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class y6 extends wLe{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 MU extends wLe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new DN({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Nl(lt(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 hvt(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:Cr.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:Cr.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,jt&&(e.className+=" mac"),e}class yLe extends w6{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 Id(this._context,i),this._mouseDownOperation=this._register(new uvt(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 i_t(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 Vk(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 r=this.viewHelper.overflowWidgetsDomNode;r&&(this._register(n.onMouseMove(r,a=>{this._mouseOnOverflowWidgetsDomNode=!0,this._mouseLeaveMonitor?.dispose(),this._mouseLeaveMonitor=null,this._onMouseMoveOverOverflowWidgetsDomNode(a)})),this._register(n.onMouseLeave(r,a=>{this._mouseOnOverflowWidgetsDomNode=!1,setTimeout(()=>{this._mouseOnViewDomNode||this._onMouseLeave(a)},0)})));let o=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(a,c)=>{o=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,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=CY.INSTANCE;let t=0,i=Jp.getZoomLevel(),n=!1,r=0;const o=c=>{if(this.viewController.emitMouseWheel(c),!this._context.configuration.options.get(x.mouseWheelZoom))return;const l=new SM(c);if(e.acceptStandardWheelEvent(l),e.isPhysicalMouseWheel()){if(a(c)){const d=Jp.getZoomLevel(),h=l.deltaY>0?1:-1;Jp.setZoomLevel(d+h),l.preventDefault(),l.stopPropagation()}}else Date.now()-t>50&&(i=Jp.getZoomLevel(),n=a(c),r=0),t=Date.now(),r+=l.deltaY,n&&(Jp.setZoomLevel(i+r/5),l.preventDefault(),l.stopPropagation())};this._register(ue(this.viewHelper.viewDomNode,ke.MOUSE_WHEEL,o,{capture:!0,passive:!1}));function a(c){return jt?(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 MQe(e,t).toPageCoordinates(lt(this.viewHelper.viewDomNode)),r=dLe(this.viewHelper.viewDomNode);if(n.yr.y+r.height||n.xr.x+r.width)return null;const o=hLe(this.viewHelper.viewDomNode,r,n);return this.mouseTargetFactory.createMouseTargetForView(this.viewHelper.getLastRenderData(),r,n,o,null)}_createMouseTargetForView(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const n=AM(this.viewHelper.viewDomNode);n&&(i=n.elementsFromPoint(e.posx,e.posy).find(r=>this.viewHelper.viewDomNode.contains(r)))}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||o&&a))h(),this._mouseDownOperation.start(i.type,e,t);else if(r)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 uvt extends V{constructor(e,t,i,n,r,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=r,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new s_t(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new gvt(this._context,this._viewHelper,this._mouseTargetFactory,(a,c,l)=>this._dispatchMouse(a,c,l))),this._mouseState=new _me,this._currentSelection=new ht(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,Oy.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 n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const r=this._context.configuration.options;if(!r.get(x.readOnly)&&r.get(x.dragAndDrop)&&!r.get(x.columnSelection)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&n.type===Mt.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,o=>this._onMouseDownThenMove(o),o=>{const a=this._findMousePosition(this._lastMouseEvent,!1);g_(o)?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,Oy.Minimal),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,o=>this._onMouseDownThenMove(o),()=>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,r=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,c=n.getCurrentScrollTop()+e.relativePos.y,l=xM.getZoneAtCoord(this._context,c);if(l){const h=this._helpPositionJumpOverViewZone(l);if(h)return fh.createOutsideEditor(r,h,"below",a)}const d=n.getLineNumberAtVerticalOffset(c);return fh.createOutsideEditor(r,new re(d,i.getLineMaxColumn(d)),"below",a)}const o=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return fh.createOutsideEditor(r,new re(o,i.getLineMaxColumn(o)),"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===Mt.CONTENT_VIEW_ZONE||n.type===Mt.GUTTER_VIEW_ZONE){const o=this._helpPositionJumpOverViewZone(n.detail);if(o)return fh.createViewZone(n.type,n.element,n.mouseColumn,o,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new re(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===Mt.CONTENT_TEXT&&e.detail.injectedText!==null})}}class gvt 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 fvt(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class fvt extends V{constructor(e,t,i,n,r,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=r,this._mouseEvent=o,this._lastTime=Date.now(),this._animationFrameDisposable=Nl(lt(o.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,r=this._position.outsidePosition==="above"?-n:n;this._context.viewModel.viewLayout.deltaScrollNow(0,r),this._viewHelper.renderNow();const o=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?o.startLineNumber:o.endLineNumber;let c;{const l=dLe(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(x.layoutInfo).horizontalScrollbarHeight,h=new pae(this._mouseEvent.pos.x,l.y+l.height-d-.1),u=hLe(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=fh.createOutsideEditor(this._position.mouseColumn,new re(a,1),"above",this._position.outsideDistance):c=fh.createOutsideEditor(this._position.mouseColumn,new re(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(c,!0,Oy.None),this._animationFrameDisposable=Nl(lt(c.element),()=>this._execute())}}const fse=class fse{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>fse.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)}};fse.CLEAR_MOUSE_DOWN_COUNT_TIME=400;let _me=fse;class ni{get event(){return this.emitter.event}constructor(e,t,i){const n=r=>this.emitter.fire(r);this.emitter=new I({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}const JF=class JF{constructor(e,t,i,n,r){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=r}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),r=e.getSelectionEnd();let o;if(t){const a=i.substring(0,n),c=t.value.substring(0,t.selectionStart);a===c&&(o=t.newlineCountBeforeSelection)}return new JF(i,n,r,null,o)}collapseSelection(){return this.selectionStart===this.value.length?this:new JF(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,r=-1;for(;(r=t.indexOf(` `,r+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(Qy(e.value,t.value),e.selectionStart,t.selectionStart),r=Math.min(Hj(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-r);const o=t.value.substring(n,t.value.length-r),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:o,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=c-a;return{text:o,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(Qy(e.value,t.value),e.selectionEnd),n=Math.min(Hj(e.value,t.value),e.value.length-e.selectionEnd),r=e.value.substring(i,e.value.length-n),o=t.value.substring(i,t.value.length-n),a=e.selectionEnd-i,c=t.selectionEnd-i;return{text:o,replacePrevCharCnt:a,replaceNextCharCnt:r.length-a,positionDelta:c-o.length}}};JF.EMPTY=new JF("",0,0,null,void 0);let Fd=JF;class hF{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,r=i+t;return new F(n,1,r+1,1)}static fromEditorSelection(e,t,i,n){const o=hF._getPageOfLine(t.startLineNumber,i),a=hF._getRangeForPage(o,i),c=hF._getPageOfLine(t.endLineNumber,i),l=hF._getRangeForPage(c,i);let d=a.intersectRanges(new F(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(d,gr.LF)>500){const b=e.modifyPosition(d.getEndPosition(),-500);d=F.fromPositions(b,d.getEndPosition())}const h=e.getValueInRange(d,gr.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,gr.LF)>500){const b=e.modifyPosition(p.getStartPosition(),500);p=F.fromPositions(p.getStartPosition(),b)}const m=e.getValueInRange(p,gr.LF);let v;if(o===c||o+1===c)v=e.getValueInRange(t,gr.LF);else{const b=a.intersectRanges(t),w=l.intersectRanges(t);v=e.getValueInRange(b,gr.LF)+"…"+e.getValueInRange(w,gr.LF)}return n&&v.length>2*500&&(v=v.substring(0,500)+"…"+v.substring(v.length-500,v.length)),new Fd(h+v+m,h.length,h.length+v.length,t,d.endLineNumber-d.startLineNumber)}}var SY;(function(s){s.Tap="-monaco-textarea-synthetic-tap"})(SY||(SY={}));const vme={forceCopyWithSyntaxHighlighting:!1},pse=class pse{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)}};pse.INSTANCE=new pse;let r3=pse;class pvt{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 bme=class extends V{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,r,o){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=r,this._logService=o,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 yn),this._asyncTriggerCut=this._register(new ln(()=>this._onCut.fire(),0)),this._textAreaState=Fd.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 ln(()=>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 xn(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 xn(c);this._onKeyUp.fire(l)})),this._register(this._textArea.onCompositionStart(c=>{const l=new pvt;if(this._currentComposition){this._currentComposition=l;return}if(this._currentComposition=l,this._OS===ks.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=Fd.readFromTextArea(this._textArea,this._textAreaState),u=Fd.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionUpdate.fire(c);return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=Fd.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=Fd.readFromTextArea(this._textArea,this._textAreaState),u=Fd.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionEnd.fire();return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=Fd.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=Fd.readFromTextArea(this._textArea,this._textAreaState),d=Fd.deduceInput(this._textAreaState,l,this._OS===ks.Macintosh);d.replacePrevCharCnt===0&&d.text.length===1&&(Fc(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]=wme.getTextData(c.clipboardData);l&&(d=d||r3.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 ln(()=>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=Fd.readFromTextArea(this._textArea,null)}_installSelectionChangeListener(){let e=0;return ue(this._textArea.ownerDocument,"selectionchange",t=>{if(Dx.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const r=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),r<100||!this._textAreaState.selection)return;const o=this._textArea.getValue();if(this._textAreaState.value!==o)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 ht(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};r3.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` `):t.text,i),e.preventDefault(),e.clipboardData&&wme.setTextData(e.clipboardData,t.text,t.html,i)}};bme=D([_(4,_o),_(5,Ke)],bme);const wme={getTextData(s){const e=s.getData(Vs.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(r=>r.name).join(` -`),null]:[e,t]},setTextData(s,e,t,i){s.setData(Vs.text,e),typeof t=="string"&&s.setData("text/html",t),s.setData("vscode-editor-data",JSON.stringify(i))}};class mvt extends V{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new ni(this._actual,"keydown")).event,this.onKeyPress=this._register(new ni(this._actual,"keypress")).event,this.onKeyUp=this._register(new ni(this._actual,"keyup")).event,this.onCompositionStart=this._register(new ni(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new ni(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new ni(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new ni(this._actual,"beforeinput")).event,this.onInput=this._register(new ni(this._actual,"input")).event,this.onCut=this._register(new ni(this._actual,"cut")).event,this.onCopy=this._register(new ni(this._actual,"copy")).event,this.onPaste=this._register(new ni(this._actual,"paste")).event,this.onFocus=this._register(new ni(this._actual,"focus")).event,this.onBlur=this._register(new ni(this._actual,"blur")).event,this._onSyntheticTap=this._register(new I),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Dx.onKeyDown())),this._register(this.onBeforeInput(()=>Dx.onBeforeInput())),this._register(this.onInput(()=>Dx.onInput())),this._register(this.onKeyUp(()=>Dx.onKeyUp())),this._register(ue(this._actual,SY.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=AM(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Wc()===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 r=null;const o=AM(n);o?r=o.activeElement:r=Wc();const a=lt(r),c=r===n,l=n.selectionStart,d=n.selectionEnd;if(c&&l===t&&d===i){lf&&a.parent!==a&&n.focus();return}if(c){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),lf&&a.parent!==a&&n.focus();return}try{const h=out(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),aut(n,h)}catch{}}}class _vt extends yLe{constructor(e,t,i){super(e,t,i),this._register(md.addTarget(this.viewHelper.linesContentDomNode)),this._register(ue(this.viewHelper.linesContentDomNode,ur.Tap,r=>this.onTap(r))),this._register(ue(this.viewHelper.linesContentDomNode,ur.Change,r=>this.onChange(r))),this._register(ue(this.viewHelper.linesContentDomNode,ur.Contextmenu,r=>this._onContextMenu(new Vk(r,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ue(this.viewHelper.linesContentDomNode,"pointerdown",r=>{const o=r.pointerType;if(o==="mouse"){this._lastPointerType="mouse";return}else o==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new n_t(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,r=>this._onMouseMoveOverView(r))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(r,o)=>this._onMouseDown(r,o)))}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 Vk(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:Oy.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 vvt extends yLe{constructor(e,t,i){super(e,t,i),this._register(md.addTarget(this.viewHelper.linesContentDomNode)),this._register(ue(this.viewHelper.linesContentDomNode,ur.Tap,n=>this.onTap(n))),this._register(ue(this.viewHelper.linesContentDomNode,ur.Change,n=>this.onChange(n))),this._register(ue(this.viewHelper.linesContentDomNode,ur.Contextmenu,n=>this._onContextMenu(new Vk(n,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTargetForView(new Vk(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(SY.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,Oy.Minimal)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class bvt extends V{constructor(e,t,i){super(),(gm||jat&&ZGe)&&NO.pointerEvents?this.handler=this._register(new _vt(e,t,i)):ri.TouchEvent?this.handler=this._register(new vvt(e,t,i)):this.handler=this._register(new yLe(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var wvt=".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}";gt(wvt,{});var yvt=".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)}";gt(yvt,{});class BN extends w6{}function $r(s){return{id:s}}function yme(s){switch(s){case ef.DARK:return"vs-dark";case ef.HIGH_CONTRAST_DARK:return"hc-black";case ef.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const GQe={ThemingContribution:"base.contributions.theming"};class Cvt{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 KQe=new Cvt;je.add(GQe.ThemingContribution,KQe);function Ep(s){return KQe.onColorThemeChange(s)}class CLe 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 qQe=W("editor.lineHighlightBackground",null,g(4890,"Background color for the highlight of line at the cursor position.")),NBe=W("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:yt},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:Xs,hcLight:Xs},g(4893,"Background color of the border around highlighted ranges."));W("editor.symbolHighlightBackground",{dark:yb,light:yb,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:Xs,hcLight:Xs},g(4895,"Background color of the border around highlighted symbols."));const Cae=W("editorCursor.foreground",{dark:"#AEAFAD",light:me.black,hcDark:me.white,hcLight:"#0F4A85"},g(4896,"Color of the editor cursor.")),SLe=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.")),QQe=W("editorMultiCursor.primary.foreground",Cae,g(4898,"Color of the primary editor cursor when multiple cursors are present.")),Svt=W("editorMultiCursor.primary.background",SLe,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.")),jQe=W("editorMultiCursor.secondary.foreground",Cae,g(4900,"Color of secondary editor cursors when multiple cursors are present.")),Avt=W("editorMultiCursor.secondary.background",SLe,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.")),ALe=W("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},g(4902,"Color of whitespace characters in the editor.")),Evt=W("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:me.white,hcLight:"#292929"},g(4903,"Color of editor line numbers.")),xvt=W("editorIndentGuide.background",ALe,g(4904,"Color of the editor indentation guides."),!1,g(4905,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Dvt=W("editorIndentGuide.activeBackground",ALe,g(4906,"Color of the active editor indentation guides."),!1,g(4907,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),C6=W("editorIndentGuide.background1",xvt,g(4908,"Color of the editor indentation guides (1).")),kvt=W("editorIndentGuide.background2","#00000000",g(4909,"Color of the editor indentation guides (2).")),Ivt=W("editorIndentGuide.background3","#00000000",g(4910,"Color of the editor indentation guides (3).")),Tvt=W("editorIndentGuide.background4","#00000000",g(4911,"Color of the editor indentation guides (4).")),Lvt=W("editorIndentGuide.background5","#00000000",g(4912,"Color of the editor indentation guides (5).")),Rvt=W("editorIndentGuide.background6","#00000000",g(4913,"Color of the editor indentation guides (6).")),S6=W("editorIndentGuide.activeBackground1",Dvt,g(4914,"Color of the active editor indentation guides (1).")),Mvt=W("editorIndentGuide.activeBackground2","#00000000",g(4915,"Color of the active editor indentation guides (2).")),Nvt=W("editorIndentGuide.activeBackground3","#00000000",g(4916,"Color of the active editor indentation guides (3).")),Pvt=W("editorIndentGuide.activeBackground4","#00000000",g(4917,"Color of the active editor indentation guides (4).")),Fvt=W("editorIndentGuide.activeBackground5","#00000000",g(4918,"Color of the active editor indentation guides (5).")),Ovt=W("editorIndentGuide.activeBackground6","#00000000",g(4919,"Color of the active editor indentation guides (6).")),Bvt=W("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Xs,hcLight:Xs},g(4920,"Color of editor active line number"),!1,g(4921,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));W("editorLineNumber.activeForeground",Bvt,g(4920,"Color of editor active line number"));const Wvt=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:yt,hcLight:yt},g(4926,"Color for matching brackets boxes"));const YQe=W("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},g(4927,"Color of the overview ruler border.")),Hvt=W("editorOverviewRuler.background",null,g(4928,"Background color of the editor overview ruler."));W("editorGutter.background",Uc,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:yt},g(4930,"Border color of unnecessary (unused) source code in the editor."));const Uvt=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 Vvt=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 zvt=new me(new hn(0,122,204,.6)),JQe=W("editorOverviewRuler.rangeHighlightForeground",zvt,g(4935,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),XQe=W("editorOverviewRuler.errorForeground",{dark:new me(new hn(255,18,18,.7)),light:new me(new hn(255,18,18,.7)),hcDark:new me(new hn(255,50,50,1)),hcLight:"#B5200D"},g(4936,"Overview ruler marker color for errors.")),$vt=W("editorOverviewRuler.warningForeground",{dark:vm,light:vm,hcDark:Y8,hcLight:Y8},g(4937,"Overview ruler marker color for warnings.")),ZQe=W("editorOverviewRuler.infoForeground",{dark:bm,light:bm,hcDark:J8,hcLight:J8},g(4938,"Overview ruler marker color for infos.")),eje=W("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},g(4939,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),tje=W("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},g(4940,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),ije=W("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},g(4941,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),nje=W("editorBracketHighlight.foreground4","#00000000",g(4942,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),sje=W("editorBracketHighlight.foreground5","#00000000",g(4943,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),rje=W("editorBracketHighlight.foreground6","#00000000",g(4944,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Gvt=W("editorBracketHighlight.unexpectedBracket.foreground",{dark:new me(new hn(255,18,18,.8)),light:new me(new hn(255,18,18,.8)),hcDark:new me(new hn(255,50,50,1)),hcLight:""},g(4945,"Foreground color of unexpected brackets.")),Kvt=W("editorBracketPairGuide.background1","#00000000",g(4946,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),qvt=W("editorBracketPairGuide.background2","#00000000",g(4947,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Qvt=W("editorBracketPairGuide.background3","#00000000",g(4948,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),jvt=W("editorBracketPairGuide.background4","#00000000",g(4949,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Yvt=W("editorBracketPairGuide.background5","#00000000",g(4950,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Jvt=W("editorBracketPairGuide.background6","#00000000",g(4951,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Xvt=W("editorBracketPairGuide.activeBackground1","#00000000",g(4952,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Zvt=W("editorBracketPairGuide.activeBackground2","#00000000",g(4953,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),ebt=W("editorBracketPairGuide.activeBackground3","#00000000",g(4954,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),tbt=W("editorBracketPairGuide.activeBackground4","#00000000",g(4955,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),ibt=W("editorBracketPairGuide.activeBackground5","#00000000",g(4956,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),nbt=W("editorBracketPairGuide.activeBackground6","#00000000",g(4957,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));W("editorUnicodeHighlight.border",vm,g(4958,"Border color used to highlight unicode characters."));W("editorUnicodeHighlight.background",kpt,g(4959,"Background color used to highlight unicode characters."));Ep((s,e)=>{const t=s.getColor(Uc),i=s.getColor(qQe),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});const mse=class mse extends BN{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new re(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===yo.Relative||this._renderLineNumbers===yo.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 re(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===yo.Relative){const n=Math.abs(this._lastCursorModelPosition.lineNumber-i);return n===0?''+i+"":String(n)}if(this._renderLineNumbers===yo.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===yo.Off){this._renderResult=null;return}const t=mo?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(l=>!!l.options.lineNumberClassName);r.sort((l,d)=>F.compareRangesUsingEnds(l.range,d.range));let o=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(;o${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]}};mse.CLASS_NAME="line-numbers";let AY=mse;Ep((s,e)=>{const t=s.getColor(Evt),i=s.getColor(Wvt);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 sbt=".monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}";gt(sbt,{});const XF=class XF extends vf{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=ds(document.createElement("div")),this._domNode.setClassName(XF.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ds(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(XF.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)}};XF.CLASS_NAME="glyph-margin",XF.OUTER_CLASS_NAME="margin";let EY=XF;var rbt=".monaco-mouse-cursor-text{cursor:text}";gt(rbt,{});const nA="monaco-mouse-cursor-text";class obt{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 m5=new obt,Vt=ae("keybindingService");class abt{constructor(e,t,i,n,r){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=r,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new re(this.modelLineNumber,this.distanceToModelLineStart+1),i=new re(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:Rl.DefaultForeground,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const uhe=lf;let Cme=class extends vf{constructor(e,t,i,n,r){super(e),this._keybindingService=n,this._instantiationService=r,this._primaryCursorPosition=new re(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,a=o.get(x.layoutInfo);this._setAccessibilityOptions(o),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=o.get(x.fontInfo),this._lineHeight=o.get(x.lineHeight),this._emptySelectionClipboard=o.get(x.emptySelectionClipboard),this._copyWithSyntaxHighlighting=o.get(x.copyWithSyntaxHighlighting),this._visibleTextArea=null,this._selections=[new ht(1,1,1,1)],this._modelSelections=[new ht(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ds(document.createElement("textarea")),Nb.write(this.textArea,ra.TextArea),this.textArea.setClassName(`inputarea ${nA}`),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(o)),this.textArea.setAttribute("aria-required",o.get(x.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.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",o.get(x.readOnly)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ds(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,jn),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(vme.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===Zl.Disabled){const u=this._selections[0];if(jt&&u.isEmpty()){const p=u.getStartPosition();let m=this._getWordBeforePosition(p);if(m.length===0&&(m=this._getCharacterBeforePosition(p)),m.length>0)return new Fd(m,m.length,m.length,F.fromPositions(p),0)}if(jt&&!u.isEmpty()&&l.getValueLengthInRange(u,gr.TextDefined)<500){const p=l.getValueInRange(u,gr.TextDefined);return new Fd(p,0,p.length,u,0)}if(Yy&&!u.isEmpty()){const p="vscode-placeholder";return new Fd(p,0,p.length,null,void 0)}return Fd.EMPTY}if(dOe){const u=this._selections[0];if(u.isEmpty()){const f=u.getStartPosition(),[p,m]=this._getAndroidWordAtPosition(f);if(p.length>0)return new Fd(p,m,m,F.fromPositions(f),0)}return Fd.EMPTY}return hF.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===Zl.Unknown)},deduceModelPosition:(u,f,p)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,f,p)},h=this._register(new mvt(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(bme,d,h,pr,{isAndroid:dOe,isChrome:o6,isFirefox:lf,isSafari:Yy})),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(` +`),null]:[e,t]},setTextData(s,e,t,i){s.setData(Vs.text,e),typeof t=="string"&&s.setData("text/html",t),s.setData("vscode-editor-data",JSON.stringify(i))}};class mvt extends V{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new ni(this._actual,"keydown")).event,this.onKeyPress=this._register(new ni(this._actual,"keypress")).event,this.onKeyUp=this._register(new ni(this._actual,"keyup")).event,this.onCompositionStart=this._register(new ni(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new ni(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new ni(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new ni(this._actual,"beforeinput")).event,this.onInput=this._register(new ni(this._actual,"input")).event,this.onCut=this._register(new ni(this._actual,"cut")).event,this.onCopy=this._register(new ni(this._actual,"copy")).event,this.onPaste=this._register(new ni(this._actual,"paste")).event,this.onFocus=this._register(new ni(this._actual,"focus")).event,this.onBlur=this._register(new ni(this._actual,"blur")).event,this._onSyntheticTap=this._register(new I),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Dx.onKeyDown())),this._register(this.onBeforeInput(()=>Dx.onBeforeInput())),this._register(this.onInput(()=>Dx.onInput())),this._register(this.onKeyUp(()=>Dx.onKeyUp())),this._register(ue(this._actual,SY.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=AM(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Wc()===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 r=null;const o=AM(n);o?r=o.activeElement:r=Wc();const a=lt(r),c=r===n,l=n.selectionStart,d=n.selectionEnd;if(c&&l===t&&d===i){lf&&a.parent!==a&&n.focus();return}if(c){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),lf&&a.parent!==a&&n.focus();return}try{const h=out(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),aut(n,h)}catch{}}}class _vt extends yLe{constructor(e,t,i){super(e,t,i),this._register(md.addTarget(this.viewHelper.linesContentDomNode)),this._register(ue(this.viewHelper.linesContentDomNode,ur.Tap,r=>this.onTap(r))),this._register(ue(this.viewHelper.linesContentDomNode,ur.Change,r=>this.onChange(r))),this._register(ue(this.viewHelper.linesContentDomNode,ur.Contextmenu,r=>this._onContextMenu(new Vk(r,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ue(this.viewHelper.linesContentDomNode,"pointerdown",r=>{const o=r.pointerType;if(o==="mouse"){this._lastPointerType="mouse";return}else o==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new n_t(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,r=>this._onMouseMoveOverView(r))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(r,o)=>this._onMouseDown(r,o)))}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 Vk(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:Oy.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 vvt extends yLe{constructor(e,t,i){super(e,t,i),this._register(md.addTarget(this.viewHelper.linesContentDomNode)),this._register(ue(this.viewHelper.linesContentDomNode,ur.Tap,n=>this.onTap(n))),this._register(ue(this.viewHelper.linesContentDomNode,ur.Change,n=>this.onChange(n))),this._register(ue(this.viewHelper.linesContentDomNode,ur.Contextmenu,n=>this._onContextMenu(new Vk(n,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTargetForView(new Vk(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(SY.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,Oy.Minimal)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class bvt extends V{constructor(e,t,i){super(),(gm||jat&&ZGe)&&NO.pointerEvents?this.handler=this._register(new _vt(e,t,i)):ri.TouchEvent?this.handler=this._register(new vvt(e,t,i)):this.handler=this._register(new yLe(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var wvt=".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}";gt(wvt,{});var yvt=".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)}";gt(yvt,{});class BN extends w6{}function $r(s){return{id:s}}function yme(s){switch(s){case ef.DARK:return"vs-dark";case ef.HIGH_CONTRAST_DARK:return"hc-black";case ef.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const GQe={ThemingContribution:"base.contributions.theming"};class Cvt{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 KQe=new Cvt;je.add(GQe.ThemingContribution,KQe);function Ep(s){return KQe.onColorThemeChange(s)}class CLe 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 qQe=W("editor.lineHighlightBackground",null,g(4890,"Background color for the highlight of line at the cursor position.")),NBe=W("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:yt},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:Xs,hcLight:Xs},g(4893,"Background color of the border around highlighted ranges."));W("editor.symbolHighlightBackground",{dark:yb,light:yb,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:Xs,hcLight:Xs},g(4895,"Background color of the border around highlighted symbols."));const Cae=W("editorCursor.foreground",{dark:"#AEAFAD",light:me.black,hcDark:me.white,hcLight:"#0F4A85"},g(4896,"Color of the editor cursor.")),SLe=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.")),QQe=W("editorMultiCursor.primary.foreground",Cae,g(4898,"Color of the primary editor cursor when multiple cursors are present.")),Svt=W("editorMultiCursor.primary.background",SLe,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.")),jQe=W("editorMultiCursor.secondary.foreground",Cae,g(4900,"Color of secondary editor cursors when multiple cursors are present.")),Avt=W("editorMultiCursor.secondary.background",SLe,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.")),ALe=W("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},g(4902,"Color of whitespace characters in the editor.")),Evt=W("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:me.white,hcLight:"#292929"},g(4903,"Color of editor line numbers.")),xvt=W("editorIndentGuide.background",ALe,g(4904,"Color of the editor indentation guides."),!1,g(4905,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Dvt=W("editorIndentGuide.activeBackground",ALe,g(4906,"Color of the active editor indentation guides."),!1,g(4907,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),C6=W("editorIndentGuide.background1",xvt,g(4908,"Color of the editor indentation guides (1).")),kvt=W("editorIndentGuide.background2","#00000000",g(4909,"Color of the editor indentation guides (2).")),Ivt=W("editorIndentGuide.background3","#00000000",g(4910,"Color of the editor indentation guides (3).")),Tvt=W("editorIndentGuide.background4","#00000000",g(4911,"Color of the editor indentation guides (4).")),Lvt=W("editorIndentGuide.background5","#00000000",g(4912,"Color of the editor indentation guides (5).")),Rvt=W("editorIndentGuide.background6","#00000000",g(4913,"Color of the editor indentation guides (6).")),S6=W("editorIndentGuide.activeBackground1",Dvt,g(4914,"Color of the active editor indentation guides (1).")),Mvt=W("editorIndentGuide.activeBackground2","#00000000",g(4915,"Color of the active editor indentation guides (2).")),Nvt=W("editorIndentGuide.activeBackground3","#00000000",g(4916,"Color of the active editor indentation guides (3).")),Pvt=W("editorIndentGuide.activeBackground4","#00000000",g(4917,"Color of the active editor indentation guides (4).")),Fvt=W("editorIndentGuide.activeBackground5","#00000000",g(4918,"Color of the active editor indentation guides (5).")),Ovt=W("editorIndentGuide.activeBackground6","#00000000",g(4919,"Color of the active editor indentation guides (6).")),Bvt=W("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Xs,hcLight:Xs},g(4920,"Color of editor active line number"),!1,g(4921,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));W("editorLineNumber.activeForeground",Bvt,g(4920,"Color of editor active line number"));const Wvt=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:yt,hcLight:yt},g(4926,"Color for matching brackets boxes"));const YQe=W("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},g(4927,"Color of the overview ruler border.")),Hvt=W("editorOverviewRuler.background",null,g(4928,"Background color of the editor overview ruler."));W("editorGutter.background",Uc,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:yt},g(4930,"Border color of unnecessary (unused) source code in the editor."));const Uvt=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 Vvt=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 zvt=new me(new hn(0,122,204,.6)),JQe=W("editorOverviewRuler.rangeHighlightForeground",zvt,g(4935,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),XQe=W("editorOverviewRuler.errorForeground",{dark:new me(new hn(255,18,18,.7)),light:new me(new hn(255,18,18,.7)),hcDark:new me(new hn(255,50,50,1)),hcLight:"#B5200D"},g(4936,"Overview ruler marker color for errors.")),$vt=W("editorOverviewRuler.warningForeground",{dark:vm,light:vm,hcDark:Y8,hcLight:Y8},g(4937,"Overview ruler marker color for warnings.")),ZQe=W("editorOverviewRuler.infoForeground",{dark:bm,light:bm,hcDark:J8,hcLight:J8},g(4938,"Overview ruler marker color for infos.")),eje=W("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},g(4939,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),tje=W("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},g(4940,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),ije=W("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},g(4941,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),nje=W("editorBracketHighlight.foreground4","#00000000",g(4942,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),sje=W("editorBracketHighlight.foreground5","#00000000",g(4943,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),rje=W("editorBracketHighlight.foreground6","#00000000",g(4944,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Gvt=W("editorBracketHighlight.unexpectedBracket.foreground",{dark:new me(new hn(255,18,18,.8)),light:new me(new hn(255,18,18,.8)),hcDark:new me(new hn(255,50,50,1)),hcLight:""},g(4945,"Foreground color of unexpected brackets.")),Kvt=W("editorBracketPairGuide.background1","#00000000",g(4946,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),qvt=W("editorBracketPairGuide.background2","#00000000",g(4947,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Qvt=W("editorBracketPairGuide.background3","#00000000",g(4948,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),jvt=W("editorBracketPairGuide.background4","#00000000",g(4949,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Yvt=W("editorBracketPairGuide.background5","#00000000",g(4950,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Jvt=W("editorBracketPairGuide.background6","#00000000",g(4951,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Xvt=W("editorBracketPairGuide.activeBackground1","#00000000",g(4952,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Zvt=W("editorBracketPairGuide.activeBackground2","#00000000",g(4953,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),ebt=W("editorBracketPairGuide.activeBackground3","#00000000",g(4954,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),tbt=W("editorBracketPairGuide.activeBackground4","#00000000",g(4955,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),ibt=W("editorBracketPairGuide.activeBackground5","#00000000",g(4956,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),nbt=W("editorBracketPairGuide.activeBackground6","#00000000",g(4957,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));W("editorUnicodeHighlight.border",vm,g(4958,"Border color used to highlight unicode characters."));W("editorUnicodeHighlight.background",kpt,g(4959,"Background color used to highlight unicode characters."));Ep((s,e)=>{const t=s.getColor(Uc),i=s.getColor(qQe),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});const mse=class mse extends BN{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new re(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===yo.Relative||this._renderLineNumbers===yo.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 re(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===yo.Relative){const n=Math.abs(this._lastCursorModelPosition.lineNumber-i);return n===0?''+i+"":String(n)}if(this._renderLineNumbers===yo.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===yo.Off){this._renderResult=null;return}const t=mo?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(l=>!!l.options.lineNumberClassName);r.sort((l,d)=>F.compareRangesUsingEnds(l.range,d.range));let o=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(;o${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]}};mse.CLASS_NAME="line-numbers";let AY=mse;Ep((s,e)=>{const t=s.getColor(Evt),i=s.getColor(Wvt);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 sbt=".monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}";gt(sbt,{});const XF=class XF extends vf{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=ds(document.createElement("div")),this._domNode.setClassName(XF.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ds(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(XF.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)}};XF.CLASS_NAME="glyph-margin",XF.OUTER_CLASS_NAME="margin";let EY=XF;var rbt=".monaco-mouse-cursor-text{cursor:text}";gt(rbt,{});const nA="monaco-mouse-cursor-text";class obt{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 m5=new obt,Vt=ae("keybindingService");class abt{constructor(e,t,i,n,r){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=r,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new re(this.modelLineNumber,this.distanceToModelLineStart+1),i=new re(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:Ml.DefaultForeground,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const uhe=lf;let Cme=class extends vf{constructor(e,t,i,n,r){super(e),this._keybindingService=n,this._instantiationService=r,this._primaryCursorPosition=new re(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,a=o.get(x.layoutInfo);this._setAccessibilityOptions(o),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=o.get(x.fontInfo),this._lineHeight=o.get(x.lineHeight),this._emptySelectionClipboard=o.get(x.emptySelectionClipboard),this._copyWithSyntaxHighlighting=o.get(x.copyWithSyntaxHighlighting),this._visibleTextArea=null,this._selections=[new ht(1,1,1,1)],this._modelSelections=[new ht(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ds(document.createElement("textarea")),Nb.write(this.textArea,ra.TextArea),this.textArea.setClassName(`inputarea ${nA}`),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(o)),this.textArea.setAttribute("aria-required",o.get(x.ariaRequired)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.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",o.get(x.readOnly)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ds(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,jn),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(vme.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===Zl.Disabled){const u=this._selections[0];if(jt&&u.isEmpty()){const p=u.getStartPosition();let m=this._getWordBeforePosition(p);if(m.length===0&&(m=this._getCharacterBeforePosition(p)),m.length>0)return new Fd(m,m.length,m.length,F.fromPositions(p),0)}if(jt&&!u.isEmpty()&&l.getValueLengthInRange(u,gr.TextDefined)<500){const p=l.getValueInRange(u,gr.TextDefined);return new Fd(p,0,p.length,u,0)}if(Yy&&!u.isEmpty()){const p="vscode-placeholder";return new Fd(p,0,p.length,null,void 0)}return Fd.EMPTY}if(dOe){const u=this._selections[0];if(u.isEmpty()){const f=u.getStartPosition(),[p,m]=this._getAndroidWordAtPosition(f);if(p.length>0)return new Fd(p,m,m,F.fromPositions(f),0)}return Fd.EMPTY}return hF.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===Zl.Unknown)},deduceModelPosition:(u,f,p)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,f,p)},h=this._register(new mvt(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(bme,d,h,pr,{isAndroid:dOe,isChrome:o6,isFirefox:lf,isSafari:Yy})),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=cbt(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()),vs.Simple,_t.Immediate),this._visibleTextArea=new abt(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 ${nA} 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 ${nA}`),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(m5.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=_m(t,[]);let r=!0,o=e.column,a=!0,c=e.column,l=0;for(;l<50&&(r||a);){if(r&&o<=1&&(r=!1),r){const d=i.charCodeAt(o-2);n.get(d)!==$o.Regular?r=!1:o--}if(a&&c>i.length&&(a=!1),a){const d=i.charCodeAt(c-1);n.get(d)!==$o.Regular?a=!1:c++}l++}return[i.substring(o-1,c-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=_m(this._context.configuration.options.get(x.wordSeparators),[]);let n=e.column,r=0;for(;n>1;){const o=t.charCodeAt(n-2);if(i.get(o)!==$o.Regular||r>50)return t.substring(n-1,e.column-1);r++,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(!Fc(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){if(e.get(x.accessibilitySupport)===Zl.Disabled){const i=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),n=this._keybindingService.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),r=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),o=g(9841,"The editor is not accessible at this time.");return i?g(9842,"{0} To enable screen reader optimized mode, use {1}",o,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.",o,n):r?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.",o,r):o}return e.get(x.ariaLabel)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(x.accessibilitySupport);const t=e.get(x.accessibilityPageSize);this._accessibilitySupport===Zl.Enabled&&t===Ch.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(x.layoutInfo).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==Zl.Disabled){const r=e.get(x.fontInfo);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*r.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=uhe?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;!m5.enabled||e.get(x.domReadOnly)&&e.get(x.readOnly)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){this._primaryCursorPosition=new re(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,r=this._visibleTextArea.startPosition,o=this._visibleTextArea.endPosition;if(r&&o&&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(r.lineNumber),f=u.tokens.findTokenIndexAtOffset(r.column-1),p=u.tokens.findTokenIndexAtOffset(o.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:(La.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(jt||this._accessibilitySupport===Zl.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:uhe?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:uhe?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;kl(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 "+EY.OUTER_CLASS_NAME):n.get(x.lineNumbers).renderType!==yo.Off?i.setClassName("monaco-editor-background textAreaCover "+AY.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};Cme=D([_(3,Vt),_(4,we)],Cme);function cbt(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 r=s.createElement("span");kl(r,t),r.style.whiteSpace="pre",r.style.tabSize=`${i*t.spaceWidth}px`,r.append(e),n.appendChild(r),s.body.appendChild(n);const o=r.offsetWidth;return n.remove(),o}class lbt{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){el.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){el.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){el.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),el.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),el.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){el.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){el.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){el.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){el.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){el.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){el.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){el.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){el.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){el.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 oje{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 Pi("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 r=0,o=0;for(let c=i;c<=n;c++){const l=c-this._rendLineNumberStart;e<=c&&c<=t&&(o===0?(r=l,o=1):o++)}if(e=n&&a<=r&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,n=this.getStartLineNumber(),r=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>r)return null;if(i+e>r)return this._lines.splice(e-this._rendLineNumberStart,r-e+1);const o=[];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 aje{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new oje(()=>this._host.createVisibleLine())}_createDomNode(){const e=ds(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 o=t,a=Math.min(i,r.rendLineNumberStart-1);o<=a&&(this._insertLinesBefore(r,o,a,n,t),r.linesLength+=a-o+1)}else if(r.rendLineNumberStart0&&(this._removeLinesBefore(r,o),r.linesLength-=o)}if(r.rendLineNumberStart=t,r.rendLineNumberStart+r.linesLength-1i){const o=Math.max(0,i-r.rendLineNumberStart+1),c=r.linesLength-1-o+1;c>0&&(this._removeLinesAfter(r,c),r.linesLength-=c)}return this._finishRendering(r,!1,n),r}_renderUntouchedLines(e,t,i,n,r){const o=e.rendLineNumberStart,a=e.lines;for(let c=t;c<=i;c++){const l=o+c;a[c].layoutLine(l,n[l-r],this.viewportData.lineHeight)}}_insertLinesBefore(e,t,i,n,r){const o=[];let a=0;for(let c=t;c<=i;c++)o[a++]=this.host.createVisibleLine();e.lines=o.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const c=e.lines[a];n[a]&&(c.setDomNode(o),o=o.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");GC._ttPolicy&&(t=GC._ttPolicy.createHTML(t)),n.innerHTML=t;for(let r=0;re}),GC._sb=new kU(1e5);let Sme=GC;class cje extends vf{constructor(e){super(e),this._visibleLines=new aje(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(x.fontInfo);kl(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'),r.appendString(o),r.appendString("
"),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}}class hbt extends cje{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 ubt extends cje{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),kl(this.domNode,t.get(x.fontInfo))}onConfigurationChanged(e){const t=this._context.configuration.options;kl(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 Sae{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 Sae.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 re(e.afterLineNumber,1)).lineNumber}}}var gbt=".monaco-editor .blockDecorations-container{pointer-events:none;position:absolute;top:0}.monaco-editor .blockDecorations-block{box-sizing:border-box;position:absolute}";gt(gbt,{});class fbt extends vf{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=ds(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 r=i.contentLeft;return this.contentLeft!==r&&(this.contentLeft=r,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 r=this.blocks[t];r||(r=this.blocks[t]=ds(document.createElement("div")),this.domNode.appendChild(r));let o,a;n.options.blockIsAfterEnd?(o=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)):(o=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];r.setClassName("blockDecorations-block "+n.options.blockClassName),r.setLeft(this.contentLeft-h),r.setWidth(this.contentWidth+h+l),r.setTop(o-e.scrollTop-c),r.setHeight(a-o+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 r=e.top,o=r,a=e.top+e.height,c=n.viewportHeight-a,l=r-i,d=o>=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:r,fitsBelow:w,belowTop:o,left:f}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new v4(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){const t=r(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),i=this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,n=r(i,this._affinity,this._lineHeight);return{primary:t,secondary:n};function r(o,a,c){if(!o)return null;const l=e.visibleRangeForPosition(o);if(!l)return null;const d=o.column===1&&a===Ir.LeftOfInjectedText?0:l.left,h=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.scrollTop;return new PBe(h,d,c)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(x.fontInfo);let r=t.left;return re.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"&&ghe(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"&&ghe(this._actual.afterRender,this._actual,this._renderData.position)}};class _4{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class v4{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class PBe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function ghe(s,e,...t){try{return s.call(e,...t)}catch{return null}}var _bt=`.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 +`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:uhe?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Il(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 "+EY.OUTER_CLASS_NAME):n.get(x.lineNumbers).renderType!==yo.Off?i.setClassName("monaco-editor-background textAreaCover "+AY.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};Cme=D([_(3,Vt),_(4,we)],Cme);function cbt(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 r=s.createElement("span");Il(r,t),r.style.whiteSpace="pre",r.style.tabSize=`${i*t.spaceWidth}px`,r.append(e),n.appendChild(r),s.body.appendChild(n);const o=r.offsetWidth;return n.remove(),o}class lbt{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){el.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){el.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){el.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),el.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),el.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){el.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){el.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){el.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){el.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){el.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){el.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){el.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){el.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){el.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 oje{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 Pi("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 r=0,o=0;for(let c=i;c<=n;c++){const l=c-this._rendLineNumberStart;e<=c&&c<=t&&(o===0?(r=l,o=1):o++)}if(e=n&&a<=r&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,n=this.getStartLineNumber(),r=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>r)return null;if(i+e>r)return this._lines.splice(e-this._rendLineNumberStart,r-e+1);const o=[];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 aje{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new oje(()=>this._host.createVisibleLine())}_createDomNode(){const e=ds(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 o=t,a=Math.min(i,r.rendLineNumberStart-1);o<=a&&(this._insertLinesBefore(r,o,a,n,t),r.linesLength+=a-o+1)}else if(r.rendLineNumberStart0&&(this._removeLinesBefore(r,o),r.linesLength-=o)}if(r.rendLineNumberStart=t,r.rendLineNumberStart+r.linesLength-1i){const o=Math.max(0,i-r.rendLineNumberStart+1),c=r.linesLength-1-o+1;c>0&&(this._removeLinesAfter(r,c),r.linesLength-=c)}return this._finishRendering(r,!1,n),r}_renderUntouchedLines(e,t,i,n,r){const o=e.rendLineNumberStart,a=e.lines;for(let c=t;c<=i;c++){const l=o+c;a[c].layoutLine(l,n[l-r],this.viewportData.lineHeight)}}_insertLinesBefore(e,t,i,n,r){const o=[];let a=0;for(let c=t;c<=i;c++)o[a++]=this.host.createVisibleLine();e.lines=o.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const c=e.lines[a];n[a]&&(c.setDomNode(o),o=o.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");GC._ttPolicy&&(t=GC._ttPolicy.createHTML(t)),n.innerHTML=t;for(let r=0;re}),GC._sb=new kU(1e5);let Sme=GC;class cje extends vf{constructor(e){super(e),this._visibleLines=new aje(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(x.fontInfo);Il(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'),r.appendString(o),r.appendString("
"),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}}class hbt extends cje{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 ubt extends cje{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),Il(this.domNode,t.get(x.fontInfo))}onConfigurationChanged(e){const t=this._context.configuration.options;Il(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 Sae{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 Sae.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 re(e.afterLineNumber,1)).lineNumber}}}var gbt=".monaco-editor .blockDecorations-container{pointer-events:none;position:absolute;top:0}.monaco-editor .blockDecorations-block{box-sizing:border-box;position:absolute}";gt(gbt,{});class fbt extends vf{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=ds(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 r=i.contentLeft;return this.contentLeft!==r&&(this.contentLeft=r,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 r=this.blocks[t];r||(r=this.blocks[t]=ds(document.createElement("div")),this.domNode.appendChild(r));let o,a;n.options.blockIsAfterEnd?(o=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)):(o=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];r.setClassName("blockDecorations-block "+n.options.blockClassName),r.setLeft(this.contentLeft-h),r.setWidth(this.contentWidth+h+l),r.setTop(o-e.scrollTop-c),r.setHeight(a-o+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 r=e.top,o=r,a=e.top+e.height,c=n.viewportHeight-a,l=r-i,d=o>=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:r,fitsBelow:w,belowTop:o,left:f}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new v4(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){const t=r(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),i=this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,n=r(i,this._affinity,this._lineHeight);return{primary:t,secondary:n};function r(o,a,c){if(!o)return null;const l=e.visibleRangeForPosition(o);if(!l)return null;const d=o.column===1&&a===Ir.LeftOfInjectedText?0:l.left,h=e.getVerticalOffsetForLineNumber(o.lineNumber)-e.scrollTop;return new PBe(h,d,c)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(x.fontInfo);let r=t.left;return re.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"&&ghe(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"&&ghe(this._actual.afterRender,this._actual,this._renderData.position)}};class _4{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class v4{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class PBe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function ghe(s,e,...t){try{return s.call(e,...t)}catch{return null}}var _bt=`.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}`;gt(_bt,{});class lje extends BN{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 ht(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 r of this._selections)t.add(r.positionLineNumber);const i=Array.from(t);i.sort((r,o)=>r-o),ns(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every(r=>r.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 o=t;o<=i;o++){const a=o-t;n[a]=""}if(this._wordWrap){const o=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const c=this._context.viewModel.coordinatesConverter,l=c.convertViewPositionToModelPosition(new re(a,1)).lineNumber,d=c.convertModelPositionToViewPosition(new re(l,1)).lineNumber,h=c.convertModelPositionToViewPosition(new re(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]=o}}}const r=this._renderOne(e,!0);for(const o of this._cursorLineNumbers){if(oi)continue;const a=o-t;n[a]=r}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 vbt extends lje{_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class bbt extends lje{_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Ep((s,e)=>{const t=s.getColor(qQe);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(NBe)){const i=s.getColor(NBe);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}; }`),Fy(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 wbt=".monaco-editor .lines-content .cdr{height:100%;position:absolute}";gt(wbt,{});class ybt extends BN{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 r=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,a=[];for(let c=r;c<=o;c++){const l=c-r;a[l]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let o=0,a=t.length;o
',d=Math.max(c.range.startLineNumber,n),h=Math.min(c.range.endLineNumber,r);for(let u=d;u<=h;u++){const f=u-n;i[f]+=l}}}_renderNormalDecorations(e,t,i){const n=e.visibleRange.startLineNumber;let r=null,o=!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 Cbt extends vf{constructor(e,t,i,n){super(e);const r=this._context.configuration.options,o=r.get(x.scrollbar),a=r.get(x.mouseWheelScrollSensitivity),c=r.get(x.fastScrollSensitivity),l=r.get(x.scrollPredominantAxis),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+yme(e.theme.type),useShadows:!1,lazyRender:!0,vertical:o.vertical,horizontal:o.horizontal,verticalHasArrows:o.verticalHasArrows,horizontalHasArrows:o.horizontalHasArrows,verticalScrollbarSize:o.verticalScrollbarSize,verticalSliderSize:o.verticalSliderSize,horizontalScrollbarSize:o.horizontalScrollbarSize,horizontalSliderSize:o.horizontalSliderSize,handleMouseWheel:o.handleMouseWheel,alwaysConsumeMouseWheel:o.alwaysConsumeMouseWheel,arrowSize:o.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:c,scrollPredominantAxis:l,scrollByPage:o.scrollByPage};this.scrollbar=this._register(new y6(t.domNode,d,this._context.viewLayout.getScrollable())),Nb.write(this.scrollbar.getDomNode(),ra.ScrollableElement),this.scrollbarDomNode=ds(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,_t.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),r=t.get(x.fastScrollSensitivity),o=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:r,scrollPredominantAxis:o};this.scrollbar.updateOptions(a)}return e.hasChanged(x.layoutInfo)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+yme(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var Sbt=".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%)}";gt(Sbt,{});class Ame{constructor(e,t,i,n,r){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=r??0}}class Abt{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class Ebt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class dje extends BN{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const c=a-e;n[c]=new Ebt}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 re(l,0)),h=this._context.viewModel.glyphLanes.getLanesAtLine(d.lineNumber).indexOf(r.preference.lane);t.push(new kbt(l,h,r.preference.zIndex,r))}}_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===TT.Decoration&&n.type===TT.Decoration?i.className0;){const n=t.peek();if(!n)break;const r=t.takeWhile(a=>a.lineNumber===n.lineNumber&&a.laneIndex===n.laneIndex);if(!r||r.length===0)break;const o=r[0];if(o.type===TT.Decoration){const a=[];for(const c of r){if(c.zIndex!==o.zIndex||c.type!==o.type)break;(a.length===0||a[a.length-1]!==c.className)&&a.push(c.className)}i.push(o.accept(a.join(" ")))}else o.widget.renderInfo={lineNumber:o.lineNumber,laneIndex:o.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],r=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(r),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}}var TT;(function(s){s[s.Decoration=0]="Decoration",s[s.Widget=1]="Widget"})(TT||(TT={}));class Dbt{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=TT.Decoration}accept(e){return new Ibt(this.lineNumber,this.laneIndex,e)}}class kbt{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=TT.Widget}}class Ibt{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}var Tbt=".monaco-editor .lines-content .core-guide{box-sizing:border-box;height:100%;position:absolute}";gt(Tbt,{});class hje 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 Aae(s,e){let t=0,i=0;const n=s.length;for(;in)throw new Pi("Illegal value for lineNumber");const r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=!!(r&&r.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(o,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(o,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 r=[];for(let h=e;h<=t;h++)r.push([]);const o=!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=Tk(h,u=>o)?.range}const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new uje;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===LT.Enabled||n.horizontalGuides===LT.EnabledForActive&&u;if(h.range.startLineNumber===h.range.endLineNumber){v&&r[h.range.startLineNumber-e].push(new R1(-1,h.openingBracketRange.getEndPosition().column,f,new _5(!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;Th(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&w>y&&r[p.lineNumber-e].push(new R1(y,-1,f,new _5(!1,p.column),-1,-1)),m.lineNumber<=t&&b>y&&r[m.lineNumber-e].push(new R1(y,-1,f,new _5(!C,m.column),-1,-1)))}for(const h of r)h.sort((u,f)=>u.visibleColumn-f.visibleColumn);return r}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(),r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=!!(r&&r.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(o,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 re(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?LT.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?LT.EnabledForActive:LT.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,r=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let o=0,a=0,c=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const h=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);o=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 Gy(f),m=r?r[h-e]:0;for(let v=1;v<=m;v++){const b=(v-1)*l+1,w=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&o<=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 gP(s){if(!(s&&s.isTransparent()))return s}Ep((s,e)=>{const t=[{bracketColor:eje,guideColor:Kvt,guideColorActive:Xvt},{bracketColor:tje,guideColor:qvt,guideColorActive:Zvt},{bracketColor:ije,guideColor:Qvt,guideColorActive:ebt},{bracketColor:nje,guideColor:jvt,guideColorActive:tbt},{bracketColor:sje,guideColor:Yvt,guideColorActive:ibt},{bracketColor:rje,guideColor:Jvt,guideColorActive:nbt}],i=new uje,n=[{indentColor:C6,indentColorActive:S6},{indentColor:kvt,indentColorActive:Mvt},{indentColor:Ivt,indentColorActive:Nvt},{indentColor:Tvt,indentColorActive:Pvt},{indentColor:Lvt,indentColorActive:Fvt},{indentColor:Rvt,indentColorActive:Ovt}],r=t.map(a=>{const c=s.getColor(a.bracketColor),l=s.getColor(a.guideColor),d=s.getColor(a.guideColorActive),h=gP(gP(l)??c?.transparent(.3)),u=gP(gP(d)??c);if(!(!h||!u))return{guideColor:h,guideColorActive:u}}).filter(Oc),o=n.map(a=>{const c=s.getColor(a.indentColor),l=s.getColor(a.indentColorActive),d=gP(c),h=gP(l);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(Oc);if(r.length>0){for(let a=0;a<30;a++){const c=r[a%r.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(o.length>0){for(let a=0;a<30;a++){const c=o[a%o.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 Mbt=".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}";gt(Mbt,{});class fhe{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 F(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Pbt{constructor(e,t,i,n,r,o,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=r,this.stopScrollTop=o,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Fbt{constructor(e,t,i,n,r){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=r,this.type="selections";let o=t[0].startLineNumber,a=t[0].endLineNumber;for(let c=1,l=t.length;c{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new ln(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Nbt,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 fS(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,kl(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(x.layoutInfo)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new xBe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=i;r<=n;r++)this._visibleLines.getVisibleLine(r).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let r=t;r<=i;r++)n=this._visibleLines.getVisibleLine(r).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 Pbt(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 Fbt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?_t.Immediate:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,r),!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 re(n,1);const r=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();if(no)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 fhe(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),r}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=F.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const r=[];let o=0;const a=new fhe(this.domNode.domNode,this._textRangeRestingSpot);let c=0;t&&(c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new re(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 fhe(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),r}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new y_t(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,r=!0;for(let o=t;o<=i;o++){const a=this._visibleLines.getVisibleLine(o);if(e&&!a.getWidthIsFast()){r=!1;continue}n=Math.max(n,a.getWidth(null))}return r&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),r}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=i;r<=n;r++){const o=this._visibleLines.getVisibleLine(r);if(o.needsMonospaceFontCheck()){const a=o.getWidth(null);a>t&&(t=a,e=r)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let r=i;r<=n;r++)this._visibleLines.getVisibleLine(r).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(),mo&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=i;r<=n;r++)if(this._visibleLines.getVisibleLine(r).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=r[0].startLineNumber,w=r[0].endLineNumber;for(let y=1,C=r.length;yc){if(!d)return-1;v=h}else if(o===vs.NearTop||o===vs.NearTopIfOutsideViewport)if(o===vs.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(o===vs.Center||o===vs.CenterIfOutsideViewport)if(o===vs.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,o===vs.Top,o===vs.Bottom);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(x.layoutInfo),n=t.left,r=n+t.width-i.verticalScrollbarWidth;let o=Vn.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)o=Math.min(o,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)o=Math.min(o,Math.round(h.left)),a=Math.max(a,Math.round(h.left+h.width))}return e.minimalReveal||(o=Math.max(0,o-_se.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-o>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,r,o,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,n,r,o){e=e|0,t=t|0,i=i|0,n=n|0,r=!!r,o=!!o;const a=t-e;if(n-it)return Math.max(0,n-a)}else return i;return e}};_se.HORIZONTAL_EXTRA_PX=30;let Eme=_se;var Obt=".monaco-editor .lines-decorations{background:#fff;position:absolute;top:0}.monaco-editor .margin-view-overlays .cldr{height:100%;position:absolute}";gt(Obt,{});class Bbt extends dje{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 r=0,o=t.length;r',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='
';r[a]=l}this._renderResult=r}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var Ubt=".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}";gt(Ubt,{});const jE=class jE{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=jE._clamp(e),this.g=jE._clamp(t),this.b=jE._clamp(i),this.a=jE._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}};jE.Empty=new jE(0,0,0,0);let sA=jE;var kn;(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"})(kn||(kn={}));const Vbt=(()=>{const s=[];for(let e=kn.START_CH_CODE;e<=kn.END_CH_CODE;e++)s.push(e);return s.push(kn.UNKNOWN_CODE),s})(),zbt=(s,e)=>(s-=kn.START_CH_CODE,s<0||s>kn.CHAR_COUNT?e<=2?(s+kn.CHAR_COUNT)%kn.CHAR_COUNT:kn.CHAR_COUNT-1:s),vse=class vse extends V{static getInstance(){return this._INSTANCE||(this._INSTANCE=L2(new vse)),this._INSTANCE}constructor(){super(),this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(La.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=La.getColorMap();if(!e){this._colors=[sA.Empty],this._backgroundIsLight=!0;return}this._colors=[sA.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=Rl.DefaultBackground),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}};vse._INSTANCE=null;let xY=vse;class o3{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=o3.soften(e,12/15),this.charDataLight=o3.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,r=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=zbt(n,l),b=e.width*kn.RGBA_CHANNELS_CNT,w=a.r,y=a.g,C=a.b,A=r.r-w,L=r.g-y,k=r.b-C,P=Math.max(o,c),R=e.data;let z=v*u*f,G=i*b+t*kn.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*kn.RGBA_CHANNELS_CNT,f=.5*(r/255),p=o.r,m=o.g,v=o.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(r,a),P=e.data;let R=i*u+t*kn.RGBA_CHANNELS_CNT;for(let z=0;z{const e=new Uint8ClampedArray(s.length/2);for(let t=0;t>1]=FBe[s[t]]<<4|FBe[s[t+1]]&15;return e},BBe={1:fm(()=>OBe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:fm(()=>OBe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class v5{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return BBe[e]?i=new o3(BBe[e](),e):i=v5.createFromSampleData(v5.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=`${kn.SAMPLED_CHAR_HEIGHT}px`,t.height=kn.SAMPLED_CHAR_HEIGHT,t.width=kn.CHAR_COUNT*kn.SAMPLED_CHAR_WIDTH,t.style.width=kn.CHAR_COUNT*kn.SAMPLED_CHAR_WIDTH+"px",i.fillStyle="#ffffff",i.font=`bold ${kn.SAMPLED_CHAR_HEIGHT}px ${e}`,i.textBaseline="middle";let n=0;for(const r of Vbt)i.fillText(String.fromCharCode(r),n,kn.SAMPLED_CHAR_HEIGHT/2),n+=kn.SAMPLED_CHAR_WIDTH;return i.getImageData(0,0,kn.CHAR_COUNT*kn.SAMPLED_CHAR_WIDTH,kn.SAMPLED_CHAR_HEIGHT)}static createFromSampleData(e,t){const i=kn.SAMPLED_CHAR_HEIGHT*kn.SAMPLED_CHAR_WIDTH*kn.RGBA_CHANNELS_CNT*kn.CHAR_COUNT;if(e.length!==i)throw new Error("Unexpected source in MinimapCharRenderer");const n=v5._downsample(e,t);return new o3(n,t)}static _downsampleChar(e,t,i,n,r){const o=kn.BASE_CHAR_WIDTH*r,a=kn.BASE_CHAR_HEIGHT*r;let c=n,l=0;for(let d=0;d0){const l=255/c;for(let d=0;dv5.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=i.getColor(Rl.DefaultBackground),this.backgroundColor=zO._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=zO._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Xpt);return i?new sA(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Zpt);return t?sA._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Nl);return i?new sA(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 b5{constructor(e,t,i,n,r,o,a,c,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=r,this.sliderHeight=o,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,r,o,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,r-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(r*r/L)),P=Math.max(0,e.minimapHeight-k),R=P/(d-r),z=l*R,G=P>0,Y=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),j=Math.floor(e.paddingTop/e.lineHeight);return new b5(l,d,G,R,z,k,j,1,Math.min(a,Y))}let v;if(o&&i!==a){const L=i-t+1;v=Math.floor(L*f/u)}else{const L=r/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=r/m;w=Math.max(w,L-1)}let y;if(w>0){const L=r/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-r),A=l*C;if(p>=b+a+w){const L=y>0;return new b5(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 b5(l,d,!0,C,G,v,k,P,R)}}}const bse=class bse{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};bse.INVALID=new bse(-1);let DY=bse;class WBe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new oje(()=>DY.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,r=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 r=this.minimapLines.length-1;r>=0&&!(this.minimapLines[r]=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]=a3.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 r=0,o=t-e+1;r!n.options.minimap?.sectionHeaderStyle);if(this._samplingState){const n=[];for(const r of i){if(!r.options.minimap)continue;const o=r.range,a=this._samplingState.modelLineToMinimapLine(o.startLineNumber),c=this._samplingState.modelLineToMinimapLine(o.endLineNumber);n.push(new dQe(new F(a,o.startColumn,c,o.endColumn),r.options))}return n}return i}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.minimapLineHeight,r=this.options.sectionHeaderFontSize/i;return e=Math.floor(Math.max(1,e-r)),this._getMinimapDecorationsInViewport(e,t).filter(o=>!!o.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],r=this._samplingState.minimapLines[t-1];i=new F(n,1,r,this._context.viewModel.getLineMaxColumn(r))}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 r=t(i);return this._sectionHeaderCache.set(i,r),r}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),vs.Center,_t.Smooth)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},_t.Immediate)}}class uF 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(yBe),this._domNode=ds(document.createElement("div")),Nb.write(this._domNode,ra.Minimap),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=ds(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=ds(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ds(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ds(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=ds(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Rr(this._domNode.domNode,ke.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===_b.None||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const l=So(this._slider.domNode),d=l.top+l.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const r=this._model.options.minimapLineHeight,o=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let c=Math.floor(o/r)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;c=Math.min(c,this._model.getLineCount()),this._model.revealLineNumber(c)}),this._sliderPointerMoveMonitor=new LU,this._sliderPointerDownListener=Rr(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=md.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ue(this._domNode.domNode,ur.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,ur.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Rr(this._domNode.domNode,ur.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 r=(o,a)=>{const c=So(this._domNode.domNode),l=Math.min(Math.abs(a-n),Math.abs(a-c.left),Math.abs(a-c.left-c.width));if(jn&&l>$bt){this._model.setScrollTop(i.scrollTop);return}const d=o-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&r(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>r(o.pageY,o.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 xLe(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(yBe),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===_b.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=b5.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:r}=this._model.options,o=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,r);const d=new HBe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,o),this._renderDecorationsLineHighlights(l,i,d,e,o);const h=new HBe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,o,c,a,n),this._renderDecorationsHighlights(l,i,h,e,o,c,a,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,r){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let o=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,r),f=n.getYForLineNumber(h,r);a>=u||(a>o&&e.fillRect(iw,o,e.canvas.width,a-o),o=u),a=f}a>o&&e.fillRect(iw,o,e.canvas.width,a-o)}_renderDecorationsLineHighlights(e,t,i,n,r){const o=new Map;for(let a=t.length-1;a>=0;a--){const c=t[a],l=c.options.minimap;if(!l||l.position!==Rh.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=o.get(f.toString());p||(p=f.transparent(.5).toString(),o.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,r);e.fillRect(iw,v,e.canvas.width,r)}}}_renderSelectionsHighlights(e,t,i,n,r,o,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,r,r,o,a,c)}}_renderDecorationsHighlights(e,t,i,n,r,o,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 Rh.Inline:this.renderDecorationOnLine(e,i,l.range,p,n,m,r,r,o,a,c);continue;case Rh.Gutter:{const v=n.getYForLineNumber(m,r);this.renderDecoration(e,p,2,v,Gbt,r);continue}}}}renderDecorationOnLine(e,t,i,n,r,o,a,c,l,d,h){const u=r.getYForLineNumber(o,c);if(u+a<0||u>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:p}=i,m=f===o?i.startColumn:1,v=p===o?i.endColumn:this._model.getLineMaxColumn(o),b=this.getXOffsetForPosition(t,o,m,l,d,h),w=this.getXOffsetForPosition(t,o,v,l,d,h);this.renderDecoration(e,n,b,u,w-b,a)}getXOffsetForPosition(e,t,i,n,r,o){if(i===1)return iw;if((i-1)*r>=o)return o;let c=e.get(t);if(!c){const l=this._model.getLineContent(t);c=[iw];let d=iw;for(let h=1;h=o){c[h]=o;break}c[h]=p,d=p}e.set(t,c)}return i-1m.range.startLineNumber-v.range.startLineNumber);const p=uF._fitSectionHeader.bind(null,u,o-iw);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);uF._renderSectionLabel(u,y,m.options.minimap?.sectionHeaderStyle===z8.Underlined,c,d,o,b,r,v,w)}}static _fitSectionHeader(e,t,i){if(!i)return i;const n="…",r=e.measureText(i).width,o=e.measureText(n).width;if(r<=t||r<=o)return i;const a=i.length,c=r/i.length,l=Math.floor((t-o)/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,r,o,a,c,l,d){t&&(e.fillStyle=n,e.fillRect(0,a,o,c),e.fillStyle=r,e.fillText(t,iw,l)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(o,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 WBe(e,ge.imageData,ge.lines)}const r=this._getBuffer();if(!r)return null;const[o,a,c]=uF._renderUntouchedLines(r,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===_b.Text?kn.BASE_CHAR_HEIGHT:kn.BASE_CHAR_HEIGHT+1)*w,L=n>A?Math.floor((n-A)/2):0,k=u.a/255,P=new sA(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*o}else if(Y===B.Space)C+=o;else{const j=Fk(Y)?2:1;for(let ne=0;new)return}}}}}class HBe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,r=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 qbt=".monaco-editor .overlayWidgets{left:0;position:absolute;top:0}";gt(qbt,{});class Qbt extends vf{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=ds(document.createElement("div")),Nb.write(this._domNode,ra.OverlayWidgets),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=ds(document.createElement("div")),Nb.write(this.overflowingOverlayWidgetsDomNode,ra.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=ds(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,r=t?.stackOridinal;return i.preference===n&&i.stack===r?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=r,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,r)=>(this._widgets[n].stack||0)-(this._widgets[r].stack||0));for(let n=0,r=t.length;n=3){const r=Math.floor(n/3),o=Math.floor(n/3),a=n-r-o,c=e,l=c+r,d=c+r+a;return[[0,c,l,c,d,c,l,c],[0,r,a,r+a,o,r+a+o,a+o,r+a+o]]}else if(i===2){const r=Math.floor(n/2),o=n-r,a=e,c=a+r;return[[0,a,a,a,c,a,a,a],[0,r,r,r,o,r+o,r+o,r+o]]}else{const r=e,o=n;return[[0,r,r,r,r,r,r,r],[0,o,o,o,o,o,o,o]]}}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 xme;(function(s){s[s.MIN_DECORATION_HEIGHT=6]="MIN_DECORATION_HEIGHT"})(xme||(xme={}));var kY;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(kY||(kY={}));var Tv;(function(s){s[s.NotNeeded=0]="NotNeeded",s[s.Maybe=1]="Maybe",s[s.Needed=2]="Needed"})(Tv||(Tv={}));class Ybt extends vf{constructor(e){super(e),this._actualShouldRender=Tv.NotNeeded,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ds(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=La.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new re(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new jbt(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=Tv.Needed,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=Tv.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)=>re.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=Tv.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(q8.compareByRenderingProps),this._actualShouldRender===Tv.Maybe&&!q8.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=Tv.Needed),this._actualShouldRender===Tv.Maybe&&!ns(this._renderedCursorPositions,this._cursorPositions,(p,m)=>p.position.lineNumber===m.position.lineNumber&&p.color===m.color)&&(this._actualShouldRender=Tv.Needed),this._actualShouldRender===Tv.Maybe)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,r=this._settings.lineHeight,o=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),c=n/a,l=xme.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[kY.Full],b=this._settings.w[kY.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 Dme;(function(s){s[s.MINIMUM_HEIGHT=4]="MINIMUM_HEIGHT"})(Dme||(Dme={}));class UBe{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 gje{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 UBe(m-v,m+v,w);d.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(UBe.compare),a}}class Xbt extends w6{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ds(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Jbt(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(),r=this._domNode.domNode.getContext("2d");return r.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(r,i,n,e),!0}_renderOneLane(e,t,i,n){let r=0,o=0,a=0;for(const c of t){const l=c.colorId,d=c.from,h=c.to;l!==r?(e.fillRect(0,o,n,a-o),r=l,e.fillStyle=i[r],o=d,a=h):a>=d?a=Math.max(a,h):(e.fillRect(0,o,n,a-o),o=d,a=h)}e.fillRect(0,o,n,a-o)}}var Zbt=".monaco-editor .view-ruler{box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset;position:absolute;top:0}";gt(Zbt,{});class ewt extends vf{constructor(e){super(e),this.domNode=ds(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=ds(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(r),this.domNode.appendChild(a),this._renderedRulers.push(a),o--}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 nwt=".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}";gt(nwt,{});var $a;(function(s){s[s.EXTERN=0]="EXTERN",s[s.INTERN=1]="INTERN",s[s.FLAT=2]="FLAT"})($a||($a={}));class swt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class rwt{constructor(e,t){this.lineNumber=e,this.ranges=t}}function owt(s){return new swt(s)}function awt(s){return new rwt(s.lineNumber,s.ranges.map(owt))}const da=class da extends BN{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 r=null,o=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let l=0;!r&&l=0;l--)i[l].lineNumber===c&&(o=i[l].ranges[0]);r&&!r.startStyle&&(r=null),o&&!o.startStyle&&(o=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;qG(d-p)p&&(u.top=$a.INTERN),qG(h-m)'}_actualRenderOneSelection(e,t,i,n){if(n.length===0)return;const r=!!n[0].ranges[0].startStyle,o=n[0].lineNumber,a=n[n.length-1].lineNumber;for(let c=0,l=n.length;c1,l)}this._previousFrameVisibleRangesWithStyle=r,this._renderResult=t.map(([o,a])=>o+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};da.SELECTION_CLASS_NAME="selected-text",da.SELECTION_TOP_LEFT="top-left-radius",da.SELECTION_BOTTOM_LEFT="bottom-left-radius",da.SELECTION_TOP_RIGHT="top-right-radius",da.SELECTION_BOTTOM_RIGHT="bottom-right-radius",da.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",da.ROUNDED_PIECE_WIDTH=10;let kme=da;Ep((s,e)=>{const t=s.getColor(Lpt);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function qG(s){return s<0?-s:s}var cwt=".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}";gt(cwt,{});class VBe{constructor(e,t,i,n,r,o,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=r,this.textContent=o,this.textContentClassName=a}}var IS;(function(s){s[s.Single=0]="Single",s[s.MultiPrimary=1]="MultiPrimary",s[s.MultiSecondary=2]="MultiSecondary"})(IS||(IS={}));class zBe{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=ds(document.createElement("div")),this._domNode.setClassName(`cursor ${nA}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),kl(this._domNode,n),this._domNode.setDisplay("none"),this._position=new re(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 IS.Single:this._pluralityClass="";break;case IS.MultiPrimary:this._pluralityClass="cursor-primary";break;case IS.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),kl(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,r]=mKe(i,t-1);return[new re(e,n+1),i.substring(n,r)]}_prepareRender(e){let t="",i="";const[n,r]=this._getGraphemeAwarePosition();if(this._cursorStyle===Qo.Line||this._cursorStyle===Qo.LineThin){const u=e.visibleRangeForPosition(n);if(!u||u.outsideRenderedLine)return null;const f=lt(this._domNode.domNode);let p;this._cursorStyle===Qo.Line?(p=xOe(f,this._lineCursorWidth>0?this._lineCursorWidth:2),p>2&&(t=r,i=this._getTokenClassName(n))):p=xOe(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 VBe(b,m,v,p,this._lineHeight,t,i)}const o=e.linesVisibleRangesForRange(new F(n.lineNumber,n.column,n.lineNumber,n.column+r.length),!1);if(!o||o.length===0)return null;const a=o[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const c=a.ranges[0],l=r===" "?this._typicalHalfwidthCharacterWidth:c.width<1?this._typicalHalfwidthCharacterWidth:c.width;this._cursorStyle===Qo.Block&&(t=r,i=this._getTokenClassName(n));let d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return(this._cursorStyle===Qo.Underline||this._cursorStyle===Qo.UnderlineThin)&&(d+=this._lineHeight-2,h=2),new VBe(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} ${nA} ${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 $z=class $z extends vf{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 zBe(this._context,IS.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=ds(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 Em,this._cursorFlatBlinkInterval=new d6,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 r=this._secondaryCursors.length-t.length;for(let o=0;o{for(let n=0,r=e.ranges.length;n{this._isVisible?this._hide():this._show()},$z.BLINK_INTERVAL,lt(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},$z.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Qo.Line:e+=" cursor-line-style";break;case Qo.Block:e+=" cursor-block-style";break;case Qo.Underline:e+=" cursor-underline-style";break;case Qo.LineThin:e+=" cursor-line-thin-style";break;case Qo.BlockOutline:e+=" cursor-block-outline-style";break;case Qo.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case Nd.Blink:e+=" cursor-blink";break;case Nd.Smooth:e+=" cursor-smooth";break;case Nd.Phase:e+=" cursor-phase";break;case Nd.Expand:e+=" cursor-expand";break;case Nd.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:Cae,background:SLe},{class:".cursor-primary",foreground:QQe,background:Svt},{class:".cursor-secondary",foreground:jQe,background:Avt}];for(const i of t){const n=s.getColor(i.foreground);if(n){let r=s.getColor(i.background);r||(r=n.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${r}; }`),Fy(s.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${r}; border-right: 1px solid ${r}; }`)}}});const phe=()=>{throw new Error("Invalid change accessor")};class lwt extends vf{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=ds(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=ds(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 r=Object.keys(this._zones);for(let o=0,a=r.length;o{const n={addZone:r=>(t=!0,this._addZone(i,r)),removeZone:r=>{r&&(t=this._removeZone(i,r)||t)},layoutZone:r=>{r&&(t=this._layoutZone(i,r)||t)}};dwt(e,n),n.addZone=phe,n.removeZone=phe,n.layoutZone=phe}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),r={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:ds(t.domNode),marginDomNode:t.marginDomNode?ds(t.marginDomNode):null};return this._safeCallOnComputedHeight(r.delegate,i.heightInPx),r.domNode.setPosition("absolute"),r.domNode.domNode.style.width="100%",r.domNode.setDisplay("none"),r.domNode.setAttribute("monaco-view-zone",r.whitespaceId),this.domNode.appendChild(r.domNode),r.marginDomNode&&(r.marginDomNode.setPosition("absolute"),r.marginDomNode.domNode.style.width="100%",r.marginDomNode.setDisplay("none"),r.marginDomNode.setAttribute("monaco-view-zone",r.whitespaceId),this.marginDomNode.appendChild(r.marginDomNode)),this._zones[r.whitespaceId]=r,this.setShouldRender(),r.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){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 n=!1;for(const o of t)this._zones[o.id].isInHiddenArea||(i[o.id]=o,n=!0);const r=Object.keys(this._zones);for(let o=0,a=r.length;oa)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 re(t,Y+1));ne&&(o?(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 o?(G=Math.round(G+v),``+A+""):A}_renderArrow(e,t,i){const n=t/7,r=t,o=e/2,a=i,c={x:0,y:n/2},l={x:100/125*r,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 gwt{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 fwt{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 pwt{constructor(e,t,i){this.configuration=e,this.theme=new fwt(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}let Tme=class extends w6{constructor(e,t,i,n,r,o,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new ht(1,1,1,1)],this._renderAnimationFrame=null,this._overflowWidgetsDomNode=o??null;const c=new lbt(t,n,r,e);this._context=new pwt(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(Cme,this._context,c,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ds(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ds(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ds(document.createElement("div")),Nb.write(this._overflowGuardContainer,ra.OverflowGuard),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Cbt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new Eme(this._context,this._linesContent),this._viewZones=new lwt(this._context),this._viewParts.push(this._viewZones);const l=new Ybt(this._context);this._viewParts.push(l);const d=new iwt(this._context);this._viewParts.push(d);const h=new hbt(this._context);this._viewParts.push(h),h.addDynamicOverlay(new vbt(this._context)),h.addDynamicOverlay(new kme(this._context)),h.addDynamicOverlay(new Rbt(this._context)),h.addDynamicOverlay(new ybt(this._context)),h.addDynamicOverlay(new uwt(this._context));const u=new ubt(this._context);this._viewParts.push(u),u.addDynamicOverlay(new bbt(this._context)),u.addDynamicOverlay(new Hbt(this._context)),u.addDynamicOverlay(new Bbt(this._context)),u.addDynamicOverlay(new AY(this._context)),this._glyphMarginWidgets=new xbt(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new EY(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 pbt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new Ime(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Qbt(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=new ewt(this._context);this._viewParts.push(p);const m=new fbt(this._context);this._viewParts.push(m);const v=new Kbt(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),o?(o.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),o.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new bvt(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(r=>{const o=r.options.glyphMargin?.position??j_.Center;return n=Math.max(n,r.range.endLineNumber),{range:r.range,lane:o,persist:r.options.glyphMargin?.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(r=>{const o=e.validateRange(r.preference.range);return n=Math.max(n,o.endLineNumber),{range:o,lane:r.preference.lane}})),i.sort((r,o)=>F.compareRangesUsingStarts(r.range,o.range)),t.reset(n);for(const r of i)t.push(r.lane,r.range,r.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 x_t(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 re(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)+" "+yme(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 Pi;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=Lme.INSTANCE.scheduleCoordinatedRendering({window:lt(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Pi;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Pi;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new Pi;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new Pi;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();Ix(()=>e.prepareRenderText());const t=Ix(()=>e.renderText());if(t){const[i,n]=t;Ix(()=>e.prepareRender(i,n)),Ix(()=>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)}Dx.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 gwt(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 b_t(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},_t.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 r=this._viewLines.visibleRangeForPosition(new re(n.lineNumber,n.column));return r?r.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?Sae.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Xbt(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()}};Tme=D([_(6,we)],Tme);function Ix(s){try{return s()}catch(e){return bt(e),null}}const wse=class wse{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,eY(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)Ix(()=>i.prepareRenderText());const t=[];for(let i=0,n=e.length;ir.renderText())}for(let i=0,n=e.length;ir.prepareRender(a,c))}for(let i=0,n=e.length;ir.render(a,c))}}};wse.INSTANCE=new wse;let Lme=wse;class w5{constructor(e,t,i,n,r){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=r}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 r=0;rthis.injectionOffsets[r];r++)n0?this.breakOffsets[r-1]:0,t===Ir.Left)if(e<=o)n=r-1;else if(e>c)i=r+1;else break;else if(e=c)i=r+1;else break}let a=e-o;return r>0&&(a+=this.wrappedTextIndentLength),new QG(r,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const n=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(r!==n)return this.offsetInInputWithInjectionsToOutputPosition(r,i)}if(i===Ir.Left){if(e>0&&t===this.getMinOutputOffset(e))return new QG(e-1,this.getMaxOutputOffset(e-1))}else if(i===Ir.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===Ir.None){if(e===i.offsetInInputWithInjections+i.length&&GBe(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let n=i.offsetInInputWithInjections;if(KBe(this.injectionOptions[i.injectedTextIndex].cursorStops))return n;let r=i.injectedTextIndex-1;for(;r>=0&&this.injectionOffsets[r]===this.injectionOffsets[i.injectedTextIndex]&&!(GBe(this.injectionOptions[r].cursorStops)||(n-=this.injectionOptions[r].content.length,KBe(this.injectionOptions[r].cursorStops)));)r--;return n}}else if(t===Ir.Right||t===Ir.RightOfInjectedText){let n=i.offsetInInputWithInjections+i.length,r=i.injectedTextIndex;for(;r+1=0&&this.injectionOffsets[r-1]===this.injectionOffsets[r];)n-=this.injectionOptions[r-1].content.length,r--;return n}h6()}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 r=0;re)break;if(e<=c)return{injectedTextIndex:r,offsetInInputWithInjections:a,length:o};n+=o}}}}function GBe(s){return s==null?!0:s===S_.Right||s===S_.Both}function KBe(s){return s==null?!0:s===S_.Left||s===S_.Both}class QG{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new re(e+this.outputLineIndex,this.outputOffset+1)}}var zg;(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"})(zg||(zg={}));class mwt{constructor(){this.changeType=zg.Flush}}class F_{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",n=0;for(const r of t)i+=e.substring(n,r.column-1),n=r.column-1,i+=r.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 F_(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new F_(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,r){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=r}withText(e){return new F_(this.ownerId,this.lineNumber,this.column,{...this.options,content:e},this.order)}}class qBe{constructor(e,t,i){this.changeType=zg.LineChanged,this.lineNumber=e,this.detail=t,this.injectedText=i}}class _wt{constructor(e,t){this.changeType=zg.LinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class vwt{constructor(e,t,i,n){this.changeType=zg.LinesInserted,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class bwt{constructor(){this.changeType=zg.EOLChanged}}class $O{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 DLe{static create(e){return new DLe(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,r){const o=[],a=[];return{addRequest:(c,l,d)=>{o.push(c),a.push(l)},finalize:()=>ywt(Qn(this.targetWindow.deref()),o,e,t,i,n,r,a)}}}function ywt(s,e,t,i,n,r,o,a){function c(R){const z=a[R];if(z){const G=F_.applyInjectedText(e[R],z),Y=z.map(ne=>ne.options),j=z.map(ne=>ne.column-1);return new w5(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=Cwt(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=wwt?.createHTML(C)??C;f.innerHTML=A,f.style.position="absolute",f.style.top="10000",o==="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),Be=Ct.map(Ne=>Ne.column-1)):(De=null,Be=null),P[R]=new w5(Be,De,G,ge,j)}return f.remove(),P}var M1;(function(s){s[s.SPAN_MODULO_LIMIT=16384]="SPAN_MODULO_LIMIT"})(M1||(M1={}));function Cwt(s,e,t,i,n,r){if(r!==0){const u=String(r);n.appendString('
');const o=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 Swt(s,e,t,i){if(t.length<=1)return null;const n=Array.prototype.slice.call(e.children,0),r=[];try{Rme(s,n,i,0,null,t.length-1,null,r)}catch(o){return console.log(o),null}return r.length===0?null:(r.push(t.length),r)}function Rme(s,e,t,i,n,r,o,a){if(i===r||(n=n||mhe(s,e,t[i],t[i+1]),o=o||mhe(s,e,t[r],t[r+1]),Math.abs(n[0].top-o[0].top)<=.1))return;if(i+1===r){a.push(r);return}const c=i+(r-i)/2|0,l=mhe(s,e,t[c],t[c+1]);Rme(s,e,t,i,n,c,l,a),Rme(s,e,t,c,l,r,o,a)}function mhe(s,e,t,i){return s.setStart(e[t/M1.SPAN_MODULO_LIMIT|0].firstChild,t%M1.SPAN_MODULO_LIMIT),s.setEnd(e[i/M1.SPAN_MODULO_LIMIT|0].firstChild,i%M1.SPAN_MODULO_LIMIT),s.getClientRects()}class Awt extends V{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new mr),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[ai.Eager]=!1,this._finishedInstantiation[ai.AfterFirstRender]=!1,this._finishedInstantiation[ai.BeforeFirstInteraction]=!1,this._finishedInstantiation[ai.Eventually]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const n of t){if(this._pending.has(n.id)){bt(new Error(`Cannot have two contributions with the same id ${n.id}`));continue}this._pending.set(n.id,n)}this._instantiateSome(ai.Eager),this._register(sF(lt(this._editor.getDomNode()),()=>{this._instantiateSome(ai.AfterFirstRender)})),this._register(sF(lt(this._editor.getDomNode()),()=>{this._instantiateSome(ai.BeforeFirstInteraction)})),this._register(sF(lt(this._editor.getDomNode()),()=>{this._instantiateSome(ai.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(ai.BeforeFirstInteraction)}onAfterModelAttached(){return sF(lt(this._editor?.getDomNode()),()=>{this._instantiateSome(ai.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!==ai.Eager&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){bt(i)}}}}class pje{constructor(e,t,i,n,r,o,a){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=r,this._run=o,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}var zh;(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"})(zh||(zh={}));var as;(function(s){s[s.Black=0]="Black",s[s.Red=1]="Red"})(as||(as={}));var fr;(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"})(fr||(fr={}));function Au(s){return(s.metadata&fr.ColorMask)>>>fr.ColorOffset}function eo(s,e){s.metadata=s.metadata&fr.ColorMaskInverse|e<>>fr.IsVisitedOffset===1}function qr(s,e){s.metadata=s.metadata&fr.IsVisitedMaskInverse|(e?1:0)<>>fr.IsForValidationOffset===1}function QBe(s,e){s.metadata=s.metadata&fr.IsForValidationMaskInverse|(e?1:0)<>>fr.IsMarginOffset===1}function jBe(s,e){s.metadata=s.metadata&fr.IsMarginMaskInverse|(e?1:0)<>>fr.StickinessOffset}function YBe(s,e){s.metadata=s.metadata&fr.StickinessMaskInverse|e<>>fr.CollapseOnReplaceEditOffset===1}function JBe(s,e){s.metadata=s.metadata&fr.CollapseOnReplaceEditMaskInverse|(e?1:0)<t||i===$v.ForceMove?!1:i===$v.ForceStay?!0:e}function kwt(s,e,t,i,n){const r=Ewt(s),o=r===si.AlwaysGrowsWhenTypingAtEdges||r===si.GrowsOnlyWhenTypingBefore,a=r===si.NeverGrowsWhenTypingAtEdges||r===si.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&&xwt(s)&&(s.start=e,u=!0,s.end=e,p=!0);{const v=n?$v.ForceMove:c>0?$v.ForceStay:$v.MarkerDefined;!u&&fP(h,o,e,v)&&(u=!0),!p&&fP(f,a,e,v)&&(p=!0)}if(d>0&&!n){const v=c>l?$v.ForceStay:$v.MarkerDefined;!u&&fP(h,o,e+d,v)&&(u=!0),!p&&fP(f,a,e+d,v)&&(p=!0)}{const v=n?$v.ForceMove:$v.MarkerDefined;!u&&fP(h,o,t,v)&&(s.start=e+l,u=!0),!p&&fP(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 Iwt(s,e,t){let i=s.root,n=0,r=0,o=0,a=0;const c=[];let l=0;for(;i!==un;){if(hd(i)){qr(i.left,!1),qr(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!hd(i.left)){if(r=n+i.maxEnd,rt){qr(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(o,a,0),c[l++]=i),qr(i,!0),i.right!==un&&!hd(i.right)){n+=i.delta,i=i.right;continue}}return qr(s.root,!1),c}function Twt(s,e,t,i){let n=s.root,r=0,o=0,a=0;const c=i-(t-e);for(;n!==un;){if(hd(n)){qr(n.left,!1),qr(n.right,!1),n===n.parent.right&&(r-=n.parent.delta),$k(n),n=n.parent;continue}if(!hd(n.left)){if(o=r+n.maxEnd,ot){n.start+=c,n.end+=c,n.delta+=c,(n.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),qr(n,!0);continue}if(qr(n,!0),n.right!==un&&!hd(n.right)){r+=n.delta,n=n.right;continue}}qr(s.root,!1)}function Lwt(s,e){let t=s.root;const i=[];let n=0;for(;t!==un;){if(hd(t)){qr(t.left,!1),qr(t.right,!1),t=t.parent;continue}if(t.left!==un&&!hd(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),qr(t,!0),t.right!==un&&!hd(t.right)){t=t.right;continue}}return qr(s.root,!1),i}function Rwt(s){let e=s.root;const t=[];let i=0;for(;e!==un;){if(hd(e)){qr(e.left,!1),qr(e.right,!1),e=e.parent;continue}if(e.left!==un&&!hd(e.left)){e=e.left;continue}if(e.right!==un&&!hd(e.right)){e=e.right;continue}t[i++]=e,qr(e,!0)}return qr(s.root,!1),t}function XBe(s,e,t,i,n){let r=s.root,o=0,a=0,c=0;const l=[];let d=0;for(;r!==un;){if(hd(r)){qr(r.left,!1),qr(r.right,!1),r===r.parent.right&&(o-=r.parent.delta),r=r.parent;continue}if(r.left!==un&&!hd(r.left)){r=r.left;continue}a=o+r.start,c=o+r.end,r.setCachedOffsets(a,c,i);let h=!0;if(e&&r.ownerId&&r.ownerId!==e&&(h=!1),t&&mje(r)&&(h=!1),n&&!_je(r)&&(h=!1),h&&(l[d++]=r),qr(r,!0),r.right!==un&&!hd(r.right)){o+=r.delta,r=r.right;continue}}return qr(s.root,!1),l}function Mwt(s,e,t,i,n,r,o){let a=s.root,c=0,l=0,d=0,h=0;const u=[];let f=0;for(;a!==un;){if(hd(a)){qr(a.left,!1),qr(a.right,!1),a===a.parent.right&&(c-=a.parent.delta),a=a.parent;continue}if(!hd(a.left)){if(l=c+a.maxEnd,lt){qr(a,!0);continue}if(h=c+a.end,h>=e){a.setCachedOffsets(d,h,r);let p=!0;i&&a.ownerId&&a.ownerId!==i&&(p=!1),n&&mje(a)&&(p=!1),o&&!_je(a)&&(p=!1),p&&(u[f++]=a)}if(qr(a,!0),a.right!==un&&!hd(a.right)){c+=a.delta,a=a.right;continue}}return qr(s.root,!1),u}function ZBe(s,e){if(s.root===un)return e.parent=un,e.left=un,e.right=un,eo(e,as.Black),s.root=e,s.root;Nwt(s,e),DE(e.parent);let t=e;for(;t!==s.root&&Au(t.parent)===as.Red;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Au(i)===as.Red?(eo(t.parent,as.Black),eo(i,as.Black),eo(t.parent.parent,as.Red),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,y5(s,t)),eo(t.parent,as.Black),eo(t.parent.parent,as.Red),C5(s,t.parent.parent))}else{const i=t.parent.parent.left;Au(i)===as.Red?(eo(t.parent,as.Black),eo(i,as.Black),eo(t.parent.parent,as.Red),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,C5(s,t)),eo(t.parent,as.Black),eo(t.parent.parent,as.Red),y5(s,t.parent.parent))}return eo(s.root,as.Black),e}function Nwt(s,e){let t=0,i=s.root;const n=e.start,r=e.end;for(;;)if(Fwt(n,r,i.start+t,i.end+t)<0)if(i.left===un){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===un){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=un,e.right=un,eo(e,as.Red)}function e2e(s,e){let t,i;if(e.left===un?(t=e.right,i=e,t.delta+=e.delta,(t.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===un?(t=e.left,i=e):(i=Pwt(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0)),i===s.root){s.root=t,eo(t,as.Black),e.detach(),vhe(),$k(t),s.root.parent=un;return}const n=Au(i)===as.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,eo(i,Au(e)),e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==un&&(i.left.parent=i),i.right!==un&&(i.right.parent=i)),e.detach(),n){DE(t.parent),i!==e&&(DE(i),DE(i.parent)),vhe();return}DE(t),DE(t.parent),i!==e&&(DE(i),DE(i.parent));let r;for(;t!==s.root&&Au(t)===as.Black;)t===t.parent.left?(r=t.parent.right,Au(r)===as.Red&&(eo(r,as.Black),eo(t.parent,as.Red),y5(s,t.parent),r=t.parent.right),Au(r.left)===as.Black&&Au(r.right)===as.Black?(eo(r,as.Red),t=t.parent):(Au(r.right)===as.Black&&(eo(r.left,as.Black),eo(r,as.Red),C5(s,r),r=t.parent.right),eo(r,Au(t.parent)),eo(t.parent,as.Black),eo(r.right,as.Black),y5(s,t.parent),t=s.root)):(r=t.parent.left,Au(r)===as.Red&&(eo(r,as.Black),eo(t.parent,as.Red),C5(s,t.parent),r=t.parent.left),Au(r.left)===as.Black&&Au(r.right)===as.Black?(eo(r,as.Red),t=t.parent):(Au(r.left)===as.Black&&(eo(r.right,as.Black),eo(r,as.Red),y5(s,r),r=t.parent.left),eo(r,Au(t.parent)),eo(t.parent,as.Black),eo(r.left,as.Black),C5(s,t.parent),t=s.root));eo(t,as.Black),vhe()}function Pwt(s){for(;s.left!==un;)s=s.left;return s}function vhe(){un.parent=un,un.delta=0,un.start=0,un.end=0}function y5(s,e){const t=e.right;t.delta+=e.delta,(t.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==un&&(t.left.parent=e),t.parent=e.parent,e.parent===un?s.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,$k(e),$k(t)}function C5(s,e){const t=e.left;e.delta-=t.delta,(e.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==un&&(t.right.parent=e),t.parent=e.parent,e.parent===un?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,$k(e),$k(t)}function bje(s){let e=s.end;if(s.left!==un){const t=s.left.maxEnd;t>e&&(e=t)}if(s.right!==un){const t=s.right.maxEnd+s.delta;t>e&&(e=t)}return e}function $k(s){s.maxEnd=bje(s)}function DE(s){for(;s!==un;){const e=bje(s);if(s.maxEnd===e)return;s.maxEnd=e,s=s.parent}}function Fwt(s,e,t,i){return s===t?e-i:s-t}var TS;(function(s){s[s.Unknown=0]="Unknown",s[s.Invalid=3]="Invalid",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(TS||(TS={}));function kb(s){let e=0,t=0,i=0,n=TS.Unknown;for(let r=0,o=s.length;r=op&&(t=t-s%op),t}function Uwt(s,e){return s.reduce((t,i)=>Lo(t,e(i)),nu)}function wje(s,e){return s===e}function c3(s,e){const t=s,i=e;if(i-t<=0)return nu;const r=Math.floor(t/op),o=Math.floor(i/op),a=i-o*op;if(r===o){const c=t-r*op;return Ia(0,a-c)}else return Ia(o-r,a)}function GO(s,e){return s=e}function gF(s){return Ia(s.lineNumber-1,s.column-1)}function MT(s,e){const t=s,i=Math.floor(t/op),n=t-i*op,r=e,o=Math.floor(r/op),a=r-o*op;return new F(i+1,n+1,o+1,a+1)}function Vwt(s){const e=cv(s);return Ia(e.length-1,e[e.length-1].length)}const jG=[],Rp=class Rp{static create(e,t){if(e<=128&&t.length===0){let i=Rp.cache[e];return i||(i=new Rp(e,t),Rp.cache[e]=i),i}return new Rp(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 o=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 Gr;(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"})(Gr||(Gr={}));class kLe{get length(){return this._length}constructor(e){this._length=e}}class qO extends kLe{static create(e,t,i){let n=e.length;return t&&(n=Lo(n,t.length)),i&&(n=Lo(n,i.length)),new qO(n,e,t,i,t?t.missingOpeningBracketIds:Qg.getEmpty())}get kind(){return Gr.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,r){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=r}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}flattenLists(){return qO.create(this.openingBracket.flattenLists(),this.child&&this.child.flattenLists(),this.closingBracket&&this.closingBracket.flattenLists())}deepClone(){return new qO(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(Lo(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class J_ extends kLe{static create23(e,t,i,n=!1){let r=e.length,o=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(r=Lo(r,t.length),o=o.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");r=Lo(r,i.length),o=o.merge(i.missingOpeningBracketIds)}return n?new zwt(r,e.listHeight+1,e,t,i,o):new l3(r,e.listHeight+1,e,t,i,o)}static create(e,t=!1){if(e.length===0)return this.getEmpty();{let i=e[0].length,n=e[0].missingOpeningBracketIds;for(let r=1;r{const n=F.lift(i.range);return new LS(gF(n.getStartPosition()),gF(n.getEndPosition()),Vwt(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${om(this.startOffset)}...${om(this.endOffset)}) -> ${om(this.newLength)}`}}class Kwt{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>TLe.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:c3(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Ia(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Ia(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=om(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Ia(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Ia(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 r=this.lineTokens,o=r.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const n=Wwt(e,t,this.lineIdx,this.lineCharOffset);return new sx(n,Gu.Text,-1,Qg.getEmpty(),new Q0(n))}}class Qwt{constructor(e,t){this.text=e,this._offset=nu,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+`| + .current-line.current-line-margin.current-line-margin-both{border-right:0}`;gt(_bt,{});class lje extends BN{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 ht(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 r of this._selections)t.add(r.positionLineNumber);const i=Array.from(t);i.sort((r,o)=>r-o),ns(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every(r=>r.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 o=t;o<=i;o++){const a=o-t;n[a]=""}if(this._wordWrap){const o=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const c=this._context.viewModel.coordinatesConverter,l=c.convertViewPositionToModelPosition(new re(a,1)).lineNumber,d=c.convertModelPositionToViewPosition(new re(l,1)).lineNumber,h=c.convertModelPositionToViewPosition(new re(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]=o}}}const r=this._renderOne(e,!0);for(const o of this._cursorLineNumbers){if(oi)continue;const a=o-t;n[a]=r}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 vbt extends lje{_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class bbt extends lje{_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Ep((s,e)=>{const t=s.getColor(qQe);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(NBe)){const i=s.getColor(NBe);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}; }`),Fy(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 wbt=".monaco-editor .lines-content .cdr{height:100%;position:absolute}";gt(wbt,{});class ybt extends BN{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 r=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,a=[];for(let c=r;c<=o;c++){const l=c-r;a[l]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const n=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let o=0,a=t.length;o',d=Math.max(c.range.startLineNumber,n),h=Math.min(c.range.endLineNumber,r);for(let u=d;u<=h;u++){const f=u-n;i[f]+=l}}}_renderNormalDecorations(e,t,i){const n=e.visibleRange.startLineNumber;let r=null,o=!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 Cbt extends vf{constructor(e,t,i,n){super(e);const r=this._context.configuration.options,o=r.get(x.scrollbar),a=r.get(x.mouseWheelScrollSensitivity),c=r.get(x.fastScrollSensitivity),l=r.get(x.scrollPredominantAxis),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+yme(e.theme.type),useShadows:!1,lazyRender:!0,vertical:o.vertical,horizontal:o.horizontal,verticalHasArrows:o.verticalHasArrows,horizontalHasArrows:o.horizontalHasArrows,verticalScrollbarSize:o.verticalScrollbarSize,verticalSliderSize:o.verticalSliderSize,horizontalScrollbarSize:o.horizontalScrollbarSize,horizontalSliderSize:o.horizontalSliderSize,handleMouseWheel:o.handleMouseWheel,alwaysConsumeMouseWheel:o.alwaysConsumeMouseWheel,arrowSize:o.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:c,scrollPredominantAxis:l,scrollByPage:o.scrollByPage};this.scrollbar=this._register(new y6(t.domNode,d,this._context.viewLayout.getScrollable())),Nb.write(this.scrollbar.getDomNode(),ra.ScrollableElement),this.scrollbarDomNode=ds(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,_t.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),r=t.get(x.fastScrollSensitivity),o=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:r,scrollPredominantAxis:o};this.scrollbar.updateOptions(a)}return e.hasChanged(x.layoutInfo)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+yme(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var Sbt=".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%)}";gt(Sbt,{});class Ame{constructor(e,t,i,n,r){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=r??0}}class Abt{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class Ebt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class dje extends BN{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const c=a-e;n[c]=new Ebt}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 re(l,0)),h=this._context.viewModel.glyphLanes.getLanesAtLine(d.lineNumber).indexOf(r.preference.lane);t.push(new kbt(l,h,r.preference.zIndex,r))}}_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===TT.Decoration&&n.type===TT.Decoration?i.className0;){const n=t.peek();if(!n)break;const r=t.takeWhile(a=>a.lineNumber===n.lineNumber&&a.laneIndex===n.laneIndex);if(!r||r.length===0)break;const o=r[0];if(o.type===TT.Decoration){const a=[];for(const c of r){if(c.zIndex!==o.zIndex||c.type!==o.type)break;(a.length===0||a[a.length-1]!==c.className)&&a.push(c.className)}i.push(o.accept(a.join(" ")))}else o.widget.renderInfo={lineNumber:o.lineNumber,laneIndex:o.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],r=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(r),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}}var TT;(function(s){s[s.Decoration=0]="Decoration",s[s.Widget=1]="Widget"})(TT||(TT={}));class Dbt{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=TT.Decoration}accept(e){return new Ibt(this.lineNumber,this.laneIndex,e)}}class kbt{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=TT.Widget}}class Ibt{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}var Tbt=".monaco-editor .lines-content .core-guide{box-sizing:border-box;height:100%;position:absolute}";gt(Tbt,{});class hje 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 Aae(s,e){let t=0,i=0;const n=s.length;for(;in)throw new Pi("Illegal value for lineNumber");const r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=!!(r&&r.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(o,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(o,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 r=[];for(let h=e;h<=t;h++)r.push([]);const o=!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=Tk(h,u=>o)?.range}const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new uje;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===LT.Enabled||n.horizontalGuides===LT.EnabledForActive&&u;if(h.range.startLineNumber===h.range.endLineNumber){v&&r[h.range.startLineNumber-e].push(new R1(-1,h.openingBracketRange.getEndPosition().column,f,new _5(!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;Th(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&w>y&&r[p.lineNumber-e].push(new R1(y,-1,f,new _5(!1,p.column),-1,-1)),m.lineNumber<=t&&b>y&&r[m.lineNumber-e].push(new R1(y,-1,f,new _5(!C,m.column),-1,-1)))}for(const h of r)h.sort((u,f)=>u.visibleColumn-f.visibleColumn);return r}getVisibleColumnFromPosition(e){return ja.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(),r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=!!(r&&r.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(o,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 re(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?LT.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?LT.EnabledForActive:LT.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,r=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let o=0,a=0,c=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const h=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);o=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 Gy(f),m=r?r[h-e]:0;for(let v=1;v<=m;v++){const b=(v-1)*l+1,w=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&o<=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 gP(s){if(!(s&&s.isTransparent()))return s}Ep((s,e)=>{const t=[{bracketColor:eje,guideColor:Kvt,guideColorActive:Xvt},{bracketColor:tje,guideColor:qvt,guideColorActive:Zvt},{bracketColor:ije,guideColor:Qvt,guideColorActive:ebt},{bracketColor:nje,guideColor:jvt,guideColorActive:tbt},{bracketColor:sje,guideColor:Yvt,guideColorActive:ibt},{bracketColor:rje,guideColor:Jvt,guideColorActive:nbt}],i=new uje,n=[{indentColor:C6,indentColorActive:S6},{indentColor:kvt,indentColorActive:Mvt},{indentColor:Ivt,indentColorActive:Nvt},{indentColor:Tvt,indentColorActive:Pvt},{indentColor:Lvt,indentColorActive:Fvt},{indentColor:Rvt,indentColorActive:Ovt}],r=t.map(a=>{const c=s.getColor(a.bracketColor),l=s.getColor(a.guideColor),d=s.getColor(a.guideColorActive),h=gP(gP(l)??c?.transparent(.3)),u=gP(gP(d)??c);if(!(!h||!u))return{guideColor:h,guideColorActive:u}}).filter(Oc),o=n.map(a=>{const c=s.getColor(a.indentColor),l=s.getColor(a.indentColorActive),d=gP(c),h=gP(l);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(Oc);if(r.length>0){for(let a=0;a<30;a++){const c=r[a%r.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(o.length>0){for(let a=0;a<30;a++){const c=o[a%o.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 Mbt=".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}";gt(Mbt,{});class fhe{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 F(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Pbt{constructor(e,t,i,n,r,o,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=r,this.stopScrollTop=o,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Fbt{constructor(e,t,i,n,r){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=r,this.type="selections";let o=t[0].startLineNumber,a=t[0].endLineNumber;for(let c=1,l=t.length;c{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new ln(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Nbt,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 fS(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,Il(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(x.layoutInfo)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new xBe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=i;r<=n;r++)this._visibleLines.getVisibleLine(r).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let r=t;r<=i;r++)n=this._visibleLines.getVisibleLine(r).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 Pbt(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 Fbt(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?_t.Immediate:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,r),!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 re(n,1);const r=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();if(no)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 fhe(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),r}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=F.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const r=[];let o=0;const a=new fhe(this.domNode.domNode,this._textRangeRestingSpot);let c=0;t&&(c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new re(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 fhe(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),r}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new y_t(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,r=!0;for(let o=t;o<=i;o++){const a=this._visibleLines.getVisibleLine(o);if(e&&!a.getWidthIsFast()){r=!1;continue}n=Math.max(n,a.getWidth(null))}return r&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),r}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=i;r<=n;r++){const o=this._visibleLines.getVisibleLine(r);if(o.needsMonospaceFontCheck()){const a=o.getWidth(null);a>t&&(t=a,e=r)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let r=i;r<=n;r++)this._visibleLines.getVisibleLine(r).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(),mo&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let r=i;r<=n;r++)if(this._visibleLines.getVisibleLine(r).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=r[0].startLineNumber,w=r[0].endLineNumber;for(let y=1,C=r.length;yc){if(!d)return-1;v=h}else if(o===vs.NearTop||o===vs.NearTopIfOutsideViewport)if(o===vs.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(o===vs.Center||o===vs.CenterIfOutsideViewport)if(o===vs.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,o===vs.Top,o===vs.Bottom);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(x.layoutInfo),n=t.left,r=n+t.width-i.verticalScrollbarWidth;let o=Vn.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)o=Math.min(o,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)o=Math.min(o,Math.round(h.left)),a=Math.max(a,Math.round(h.left+h.width))}return e.minimalReveal||(o=Math.max(0,o-_se.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-o>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,r,o,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,n,r,o){e=e|0,t=t|0,i=i|0,n=n|0,r=!!r,o=!!o;const a=t-e;if(n-it)return Math.max(0,n-a)}else return i;return e}};_se.HORIZONTAL_EXTRA_PX=30;let Eme=_se;var Obt=".monaco-editor .lines-decorations{background:#fff;position:absolute;top:0}.monaco-editor .margin-view-overlays .cldr{height:100%;position:absolute}";gt(Obt,{});class Bbt extends dje{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 r=0,o=t.length;r',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='
';r[a]=l}this._renderResult=r}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}var Ubt=".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}";gt(Ubt,{});const jE=class jE{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=jE._clamp(e),this.g=jE._clamp(t),this.b=jE._clamp(i),this.a=jE._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}};jE.Empty=new jE(0,0,0,0);let sA=jE;var kn;(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"})(kn||(kn={}));const Vbt=(()=>{const s=[];for(let e=kn.START_CH_CODE;e<=kn.END_CH_CODE;e++)s.push(e);return s.push(kn.UNKNOWN_CODE),s})(),zbt=(s,e)=>(s-=kn.START_CH_CODE,s<0||s>kn.CHAR_COUNT?e<=2?(s+kn.CHAR_COUNT)%kn.CHAR_COUNT:kn.CHAR_COUNT-1:s),vse=class vse extends V{static getInstance(){return this._INSTANCE||(this._INSTANCE=L2(new vse)),this._INSTANCE}constructor(){super(),this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(La.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=La.getColorMap();if(!e){this._colors=[sA.Empty],this._backgroundIsLight=!0;return}this._colors=[sA.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=Ml.DefaultBackground),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}};vse._INSTANCE=null;let xY=vse;class o3{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=o3.soften(e,12/15),this.charDataLight=o3.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,r=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=zbt(n,l),b=e.width*kn.RGBA_CHANNELS_CNT,w=a.r,y=a.g,C=a.b,A=r.r-w,L=r.g-y,k=r.b-C,P=Math.max(o,c),R=e.data;let z=v*u*f,G=i*b+t*kn.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*kn.RGBA_CHANNELS_CNT,f=.5*(r/255),p=o.r,m=o.g,v=o.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(r,a),P=e.data;let R=i*u+t*kn.RGBA_CHANNELS_CNT;for(let z=0;z{const e=new Uint8ClampedArray(s.length/2);for(let t=0;t>1]=FBe[s[t]]<<4|FBe[s[t+1]]&15;return e},BBe={1:fm(()=>OBe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:fm(()=>OBe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class v5{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return BBe[e]?i=new o3(BBe[e](),e):i=v5.createFromSampleData(v5.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=`${kn.SAMPLED_CHAR_HEIGHT}px`,t.height=kn.SAMPLED_CHAR_HEIGHT,t.width=kn.CHAR_COUNT*kn.SAMPLED_CHAR_WIDTH,t.style.width=kn.CHAR_COUNT*kn.SAMPLED_CHAR_WIDTH+"px",i.fillStyle="#ffffff",i.font=`bold ${kn.SAMPLED_CHAR_HEIGHT}px ${e}`,i.textBaseline="middle";let n=0;for(const r of Vbt)i.fillText(String.fromCharCode(r),n,kn.SAMPLED_CHAR_HEIGHT/2),n+=kn.SAMPLED_CHAR_WIDTH;return i.getImageData(0,0,kn.CHAR_COUNT*kn.SAMPLED_CHAR_WIDTH,kn.SAMPLED_CHAR_HEIGHT)}static createFromSampleData(e,t){const i=kn.SAMPLED_CHAR_HEIGHT*kn.SAMPLED_CHAR_WIDTH*kn.RGBA_CHANNELS_CNT*kn.CHAR_COUNT;if(e.length!==i)throw new Error("Unexpected source in MinimapCharRenderer");const n=v5._downsample(e,t);return new o3(n,t)}static _downsampleChar(e,t,i,n,r){const o=kn.BASE_CHAR_WIDTH*r,a=kn.BASE_CHAR_HEIGHT*r;let c=n,l=0;for(let d=0;d0){const l=255/c;for(let d=0;dv5.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=i.getColor(Ml.DefaultBackground),this.backgroundColor=zO._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=zO._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Xpt);return i?new sA(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Zpt);return t?sA._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Pl);return i?new sA(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 b5{constructor(e,t,i,n,r,o,a,c,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=r,this.sliderHeight=o,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,r,o,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,r-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(r*r/L)),P=Math.max(0,e.minimapHeight-k),R=P/(d-r),z=l*R,G=P>0,Y=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),j=Math.floor(e.paddingTop/e.lineHeight);return new b5(l,d,G,R,z,k,j,1,Math.min(a,Y))}let v;if(o&&i!==a){const L=i-t+1;v=Math.floor(L*f/u)}else{const L=r/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=r/m;w=Math.max(w,L-1)}let y;if(w>0){const L=r/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-r),A=l*C;if(p>=b+a+w){const L=y>0;return new b5(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 b5(l,d,!0,C,G,v,k,P,R)}}}const bse=class bse{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};bse.INVALID=new bse(-1);let DY=bse;class WBe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new oje(()=>DY.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,r=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 r=this.minimapLines.length-1;r>=0&&!(this.minimapLines[r]=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]=a3.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 r=0,o=t-e+1;r!n.options.minimap?.sectionHeaderStyle);if(this._samplingState){const n=[];for(const r of i){if(!r.options.minimap)continue;const o=r.range,a=this._samplingState.modelLineToMinimapLine(o.startLineNumber),c=this._samplingState.modelLineToMinimapLine(o.endLineNumber);n.push(new dQe(new F(a,o.startColumn,c,o.endColumn),r.options))}return n}return i}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.minimapLineHeight,r=this.options.sectionHeaderFontSize/i;return e=Math.floor(Math.max(1,e-r)),this._getMinimapDecorationsInViewport(e,t).filter(o=>!!o.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],r=this._samplingState.minimapLines[t-1];i=new F(n,1,r,this._context.viewModel.getLineMaxColumn(r))}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 r=t(i);return this._sectionHeaderCache.set(i,r),r}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),vs.Center,_t.Smooth)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},_t.Immediate)}}class uF 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(yBe),this._domNode=ds(document.createElement("div")),Nb.write(this._domNode,ra.Minimap),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=ds(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=ds(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ds(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ds(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=ds(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Rr(this._domNode.domNode,ke.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===_b.None||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const l=So(this._slider.domNode),d=l.top+l.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const r=this._model.options.minimapLineHeight,o=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let c=Math.floor(o/r)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;c=Math.min(c,this._model.getLineCount()),this._model.revealLineNumber(c)}),this._sliderPointerMoveMonitor=new LU,this._sliderPointerDownListener=Rr(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=md.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ue(this._domNode.domNode,ur.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,ur.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Rr(this._domNode.domNode,ur.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 r=(o,a)=>{const c=So(this._domNode.domNode),l=Math.min(Math.abs(a-n),Math.abs(a-c.left),Math.abs(a-c.left-c.width));if(jn&&l>$bt){this._model.setScrollTop(i.scrollTop);return}const d=o-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&r(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>r(o.pageY,o.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 xLe(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(yBe),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===_b.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=b5.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:r}=this._model.options,o=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,r);const d=new HBe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,o),this._renderDecorationsLineHighlights(l,i,d,e,o);const h=new HBe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,o,c,a,n),this._renderDecorationsHighlights(l,i,h,e,o,c,a,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,r){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let o=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,r),f=n.getYForLineNumber(h,r);a>=u||(a>o&&e.fillRect(iw,o,e.canvas.width,a-o),o=u),a=f}a>o&&e.fillRect(iw,o,e.canvas.width,a-o)}_renderDecorationsLineHighlights(e,t,i,n,r){const o=new Map;for(let a=t.length-1;a>=0;a--){const c=t[a],l=c.options.minimap;if(!l||l.position!==Rh.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=o.get(f.toString());p||(p=f.transparent(.5).toString(),o.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,r);e.fillRect(iw,v,e.canvas.width,r)}}}_renderSelectionsHighlights(e,t,i,n,r,o,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,r,r,o,a,c)}}_renderDecorationsHighlights(e,t,i,n,r,o,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 Rh.Inline:this.renderDecorationOnLine(e,i,l.range,p,n,m,r,r,o,a,c);continue;case Rh.Gutter:{const v=n.getYForLineNumber(m,r);this.renderDecoration(e,p,2,v,Gbt,r);continue}}}}renderDecorationOnLine(e,t,i,n,r,o,a,c,l,d,h){const u=r.getYForLineNumber(o,c);if(u+a<0||u>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:p}=i,m=f===o?i.startColumn:1,v=p===o?i.endColumn:this._model.getLineMaxColumn(o),b=this.getXOffsetForPosition(t,o,m,l,d,h),w=this.getXOffsetForPosition(t,o,v,l,d,h);this.renderDecoration(e,n,b,u,w-b,a)}getXOffsetForPosition(e,t,i,n,r,o){if(i===1)return iw;if((i-1)*r>=o)return o;let c=e.get(t);if(!c){const l=this._model.getLineContent(t);c=[iw];let d=iw;for(let h=1;h=o){c[h]=o;break}c[h]=p,d=p}e.set(t,c)}return i-1m.range.startLineNumber-v.range.startLineNumber);const p=uF._fitSectionHeader.bind(null,u,o-iw);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);uF._renderSectionLabel(u,y,m.options.minimap?.sectionHeaderStyle===z8.Underlined,c,d,o,b,r,v,w)}}static _fitSectionHeader(e,t,i){if(!i)return i;const n="…",r=e.measureText(i).width,o=e.measureText(n).width;if(r<=t||r<=o)return i;const a=i.length,c=r/i.length,l=Math.floor((t-o)/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,r,o,a,c,l,d){t&&(e.fillStyle=n,e.fillRect(0,a,o,c),e.fillStyle=r,e.fillText(t,iw,l)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(o,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 WBe(e,ge.imageData,ge.lines)}const r=this._getBuffer();if(!r)return null;const[o,a,c]=uF._renderUntouchedLines(r,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===_b.Text?kn.BASE_CHAR_HEIGHT:kn.BASE_CHAR_HEIGHT+1)*w,L=n>A?Math.floor((n-A)/2):0,k=u.a/255,P=new sA(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*o}else if(Y===B.Space)C+=o;else{const j=Fk(Y)?2:1;for(let ne=0;new)return}}}}}class HBe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,r=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 qbt=".monaco-editor .overlayWidgets{left:0;position:absolute;top:0}";gt(qbt,{});class Qbt extends vf{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=ds(document.createElement("div")),Nb.write(this._domNode,ra.OverlayWidgets),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=ds(document.createElement("div")),Nb.write(this.overflowingOverlayWidgetsDomNode,ra.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=ds(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,r=t?.stackOridinal;return i.preference===n&&i.stack===r?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=r,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,r)=>(this._widgets[n].stack||0)-(this._widgets[r].stack||0));for(let n=0,r=t.length;n=3){const r=Math.floor(n/3),o=Math.floor(n/3),a=n-r-o,c=e,l=c+r,d=c+r+a;return[[0,c,l,c,d,c,l,c],[0,r,a,r+a,o,r+a+o,a+o,r+a+o]]}else if(i===2){const r=Math.floor(n/2),o=n-r,a=e,c=a+r;return[[0,a,a,a,c,a,a,a],[0,r,r,r,o,r+o,r+o,r+o]]}else{const r=e,o=n;return[[0,r,r,r,r,r,r,r],[0,o,o,o,o,o,o,o]]}}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 xme;(function(s){s[s.MIN_DECORATION_HEIGHT=6]="MIN_DECORATION_HEIGHT"})(xme||(xme={}));var kY;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(kY||(kY={}));var Tv;(function(s){s[s.NotNeeded=0]="NotNeeded",s[s.Maybe=1]="Maybe",s[s.Needed=2]="Needed"})(Tv||(Tv={}));class Ybt extends vf{constructor(e){super(e),this._actualShouldRender=Tv.NotNeeded,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ds(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=La.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new re(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new jbt(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=Tv.Needed,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=Tv.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)=>re.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=Tv.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(q8.compareByRenderingProps),this._actualShouldRender===Tv.Maybe&&!q8.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=Tv.Needed),this._actualShouldRender===Tv.Maybe&&!ns(this._renderedCursorPositions,this._cursorPositions,(p,m)=>p.position.lineNumber===m.position.lineNumber&&p.color===m.color)&&(this._actualShouldRender=Tv.Needed),this._actualShouldRender===Tv.Maybe)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,r=this._settings.lineHeight,o=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),c=n/a,l=xme.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[kY.Full],b=this._settings.w[kY.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 Dme;(function(s){s[s.MINIMUM_HEIGHT=4]="MINIMUM_HEIGHT"})(Dme||(Dme={}));class UBe{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 gje{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 UBe(m-v,m+v,w);d.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(UBe.compare),a}}class Xbt extends w6{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ds(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Jbt(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(),r=this._domNode.domNode.getContext("2d");return r.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(r,i,n,e),!0}_renderOneLane(e,t,i,n){let r=0,o=0,a=0;for(const c of t){const l=c.colorId,d=c.from,h=c.to;l!==r?(e.fillRect(0,o,n,a-o),r=l,e.fillStyle=i[r],o=d,a=h):a>=d?a=Math.max(a,h):(e.fillRect(0,o,n,a-o),o=d,a=h)}e.fillRect(0,o,n,a-o)}}var Zbt=".monaco-editor .view-ruler{box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset;position:absolute;top:0}";gt(Zbt,{});class ewt extends vf{constructor(e){super(e),this.domNode=ds(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=ds(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(r),this.domNode.appendChild(a),this._renderedRulers.push(a),o--}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 nwt=".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}";gt(nwt,{});var Ga;(function(s){s[s.EXTERN=0]="EXTERN",s[s.INTERN=1]="INTERN",s[s.FLAT=2]="FLAT"})(Ga||(Ga={}));class swt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class rwt{constructor(e,t){this.lineNumber=e,this.ranges=t}}function owt(s){return new swt(s)}function awt(s){return new rwt(s.lineNumber,s.ranges.map(owt))}const da=class da extends BN{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 r=null,o=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let l=0;!r&&l=0;l--)i[l].lineNumber===c&&(o=i[l].ranges[0]);r&&!r.startStyle&&(r=null),o&&!o.startStyle&&(o=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;qG(d-p)p&&(u.top=Ga.INTERN),qG(h-m)'}_actualRenderOneSelection(e,t,i,n){if(n.length===0)return;const r=!!n[0].ranges[0].startStyle,o=n[0].lineNumber,a=n[n.length-1].lineNumber;for(let c=0,l=n.length;c1,l)}this._previousFrameVisibleRangesWithStyle=r,this._renderResult=t.map(([o,a])=>o+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};da.SELECTION_CLASS_NAME="selected-text",da.SELECTION_TOP_LEFT="top-left-radius",da.SELECTION_BOTTOM_LEFT="bottom-left-radius",da.SELECTION_TOP_RIGHT="top-right-radius",da.SELECTION_BOTTOM_RIGHT="bottom-right-radius",da.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",da.ROUNDED_PIECE_WIDTH=10;let kme=da;Ep((s,e)=>{const t=s.getColor(Lpt);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function qG(s){return s<0?-s:s}var cwt=".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}";gt(cwt,{});class VBe{constructor(e,t,i,n,r,o,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=r,this.textContent=o,this.textContentClassName=a}}var IS;(function(s){s[s.Single=0]="Single",s[s.MultiPrimary=1]="MultiPrimary",s[s.MultiSecondary=2]="MultiSecondary"})(IS||(IS={}));class zBe{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=ds(document.createElement("div")),this._domNode.setClassName(`cursor ${nA}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Il(this._domNode,n),this._domNode.setDisplay("none"),this._position=new re(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 IS.Single:this._pluralityClass="";break;case IS.MultiPrimary:this._pluralityClass="cursor-primary";break;case IS.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),Il(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,r]=mKe(i,t-1);return[new re(e,n+1),i.substring(n,r)]}_prepareRender(e){let t="",i="";const[n,r]=this._getGraphemeAwarePosition();if(this._cursorStyle===Qo.Line||this._cursorStyle===Qo.LineThin){const u=e.visibleRangeForPosition(n);if(!u||u.outsideRenderedLine)return null;const f=lt(this._domNode.domNode);let p;this._cursorStyle===Qo.Line?(p=xOe(f,this._lineCursorWidth>0?this._lineCursorWidth:2),p>2&&(t=r,i=this._getTokenClassName(n))):p=xOe(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 VBe(b,m,v,p,this._lineHeight,t,i)}const o=e.linesVisibleRangesForRange(new F(n.lineNumber,n.column,n.lineNumber,n.column+r.length),!1);if(!o||o.length===0)return null;const a=o[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const c=a.ranges[0],l=r===" "?this._typicalHalfwidthCharacterWidth:c.width<1?this._typicalHalfwidthCharacterWidth:c.width;this._cursorStyle===Qo.Block&&(t=r,i=this._getTokenClassName(n));let d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return(this._cursorStyle===Qo.Underline||this._cursorStyle===Qo.UnderlineThin)&&(d+=this._lineHeight-2,h=2),new VBe(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} ${nA} ${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 $z=class $z extends vf{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 zBe(this._context,IS.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=ds(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 Em,this._cursorFlatBlinkInterval=new d6,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 r=this._secondaryCursors.length-t.length;for(let o=0;o{for(let n=0,r=e.ranges.length;n{this._isVisible?this._hide():this._show()},$z.BLINK_INTERVAL,lt(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},$z.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Qo.Line:e+=" cursor-line-style";break;case Qo.Block:e+=" cursor-block-style";break;case Qo.Underline:e+=" cursor-underline-style";break;case Qo.LineThin:e+=" cursor-line-thin-style";break;case Qo.BlockOutline:e+=" cursor-block-outline-style";break;case Qo.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case Nd.Blink:e+=" cursor-blink";break;case Nd.Smooth:e+=" cursor-smooth";break;case Nd.Phase:e+=" cursor-phase";break;case Nd.Expand:e+=" cursor-expand";break;case Nd.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:Cae,background:SLe},{class:".cursor-primary",foreground:QQe,background:Svt},{class:".cursor-secondary",foreground:jQe,background:Avt}];for(const i of t){const n=s.getColor(i.foreground);if(n){let r=s.getColor(i.background);r||(r=n.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${r}; }`),Fy(s.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${r}; border-right: 1px solid ${r}; }`)}}});const phe=()=>{throw new Error("Invalid change accessor")};class lwt extends vf{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=ds(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=ds(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 r=Object.keys(this._zones);for(let o=0,a=r.length;o{const n={addZone:r=>(t=!0,this._addZone(i,r)),removeZone:r=>{r&&(t=this._removeZone(i,r)||t)},layoutZone:r=>{r&&(t=this._layoutZone(i,r)||t)}};dwt(e,n),n.addZone=phe,n.removeZone=phe,n.layoutZone=phe}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),r={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:ds(t.domNode),marginDomNode:t.marginDomNode?ds(t.marginDomNode):null};return this._safeCallOnComputedHeight(r.delegate,i.heightInPx),r.domNode.setPosition("absolute"),r.domNode.domNode.style.width="100%",r.domNode.setDisplay("none"),r.domNode.setAttribute("monaco-view-zone",r.whitespaceId),this.domNode.appendChild(r.domNode),r.marginDomNode&&(r.marginDomNode.setPosition("absolute"),r.marginDomNode.domNode.style.width="100%",r.marginDomNode.setDisplay("none"),r.marginDomNode.setAttribute("monaco-view-zone",r.whitespaceId),this.marginDomNode.appendChild(r.marginDomNode)),this._zones[r.whitespaceId]=r,this.setShouldRender(),r.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){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 n=!1;for(const o of t)this._zones[o.id].isInHiddenArea||(i[o.id]=o,n=!0);const r=Object.keys(this._zones);for(let o=0,a=r.length;oa)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 re(t,Y+1));ne&&(o?(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 o?(G=Math.round(G+v),``+A+""):A}_renderArrow(e,t,i){const n=t/7,r=t,o=e/2,a=i,c={x:0,y:n/2},l={x:100/125*r,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 gwt{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 fwt{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 pwt{constructor(e,t,i){this.configuration=e,this.theme=new fwt(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}let Tme=class extends w6{constructor(e,t,i,n,r,o,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new ht(1,1,1,1)],this._renderAnimationFrame=null,this._overflowWidgetsDomNode=o??null;const c=new lbt(t,n,r,e);this._context=new pwt(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(Cme,this._context,c,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ds(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ds(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ds(document.createElement("div")),Nb.write(this._overflowGuardContainer,ra.OverflowGuard),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Cbt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new Eme(this._context,this._linesContent),this._viewZones=new lwt(this._context),this._viewParts.push(this._viewZones);const l=new Ybt(this._context);this._viewParts.push(l);const d=new iwt(this._context);this._viewParts.push(d);const h=new hbt(this._context);this._viewParts.push(h),h.addDynamicOverlay(new vbt(this._context)),h.addDynamicOverlay(new kme(this._context)),h.addDynamicOverlay(new Rbt(this._context)),h.addDynamicOverlay(new ybt(this._context)),h.addDynamicOverlay(new uwt(this._context));const u=new ubt(this._context);this._viewParts.push(u),u.addDynamicOverlay(new bbt(this._context)),u.addDynamicOverlay(new Hbt(this._context)),u.addDynamicOverlay(new Bbt(this._context)),u.addDynamicOverlay(new AY(this._context)),this._glyphMarginWidgets=new xbt(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new EY(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 pbt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new Ime(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Qbt(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=new ewt(this._context);this._viewParts.push(p);const m=new fbt(this._context);this._viewParts.push(m);const v=new Kbt(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),o?(o.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),o.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new bvt(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(r=>{const o=r.options.glyphMargin?.position??j_.Center;return n=Math.max(n,r.range.endLineNumber),{range:r.range,lane:o,persist:r.options.glyphMargin?.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(r=>{const o=e.validateRange(r.preference.range);return n=Math.max(n,o.endLineNumber),{range:o,lane:r.preference.lane}})),i.sort((r,o)=>F.compareRangesUsingStarts(r.range,o.range)),t.reset(n);for(const r of i)t.push(r.lane,r.range,r.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 x_t(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 re(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)+" "+yme(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 Pi;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=Lme.INSTANCE.scheduleCoordinatedRendering({window:lt(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Pi;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Pi;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new Pi;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new Pi;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();Ix(()=>e.prepareRenderText());const t=Ix(()=>e.renderText());if(t){const[i,n]=t;Ix(()=>e.prepareRender(i,n)),Ix(()=>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)}Dx.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 gwt(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 b_t(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},_t.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 r=this._viewLines.visibleRangeForPosition(new re(n.lineNumber,n.column));return r?r.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?Sae.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Xbt(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()}};Tme=D([_(6,we)],Tme);function Ix(s){try{return s()}catch(e){return bt(e),null}}const wse=class wse{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,eY(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)Ix(()=>i.prepareRenderText());const t=[];for(let i=0,n=e.length;ir.renderText())}for(let i=0,n=e.length;ir.prepareRender(a,c))}for(let i=0,n=e.length;ir.render(a,c))}}};wse.INSTANCE=new wse;let Lme=wse;class w5{constructor(e,t,i,n,r){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=r}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 r=0;rthis.injectionOffsets[r];r++)n0?this.breakOffsets[r-1]:0,t===Ir.Left)if(e<=o)n=r-1;else if(e>c)i=r+1;else break;else if(e=c)i=r+1;else break}let a=e-o;return r>0&&(a+=this.wrappedTextIndentLength),new QG(r,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const n=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(r!==n)return this.offsetInInputWithInjectionsToOutputPosition(r,i)}if(i===Ir.Left){if(e>0&&t===this.getMinOutputOffset(e))return new QG(e-1,this.getMaxOutputOffset(e-1))}else if(i===Ir.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===Ir.None){if(e===i.offsetInInputWithInjections+i.length&&GBe(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let n=i.offsetInInputWithInjections;if(KBe(this.injectionOptions[i.injectedTextIndex].cursorStops))return n;let r=i.injectedTextIndex-1;for(;r>=0&&this.injectionOffsets[r]===this.injectionOffsets[i.injectedTextIndex]&&!(GBe(this.injectionOptions[r].cursorStops)||(n-=this.injectionOptions[r].content.length,KBe(this.injectionOptions[r].cursorStops)));)r--;return n}}else if(t===Ir.Right||t===Ir.RightOfInjectedText){let n=i.offsetInInputWithInjections+i.length,r=i.injectedTextIndex;for(;r+1=0&&this.injectionOffsets[r-1]===this.injectionOffsets[r];)n-=this.injectionOptions[r-1].content.length,r--;return n}h6()}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 r=0;re)break;if(e<=c)return{injectedTextIndex:r,offsetInInputWithInjections:a,length:o};n+=o}}}}function GBe(s){return s==null?!0:s===S_.Right||s===S_.Both}function KBe(s){return s==null?!0:s===S_.Left||s===S_.Both}class QG{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new re(e+this.outputLineIndex,this.outputOffset+1)}}var zg;(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"})(zg||(zg={}));class mwt{constructor(){this.changeType=zg.Flush}}class F_{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",n=0;for(const r of t)i+=e.substring(n,r.column-1),n=r.column-1,i+=r.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 F_(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new F_(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,r){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=r}withText(e){return new F_(this.ownerId,this.lineNumber,this.column,{...this.options,content:e},this.order)}}class qBe{constructor(e,t,i){this.changeType=zg.LineChanged,this.lineNumber=e,this.detail=t,this.injectedText=i}}class _wt{constructor(e,t){this.changeType=zg.LinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class vwt{constructor(e,t,i,n){this.changeType=zg.LinesInserted,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class bwt{constructor(){this.changeType=zg.EOLChanged}}class $O{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 DLe{static create(e){return new DLe(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,r){const o=[],a=[];return{addRequest:(c,l,d)=>{o.push(c),a.push(l)},finalize:()=>ywt(Qn(this.targetWindow.deref()),o,e,t,i,n,r,a)}}}function ywt(s,e,t,i,n,r,o,a){function c(R){const z=a[R];if(z){const G=F_.applyInjectedText(e[R],z),Y=z.map(ne=>ne.options),j=z.map(ne=>ne.column-1);return new w5(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=Cwt(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=wwt?.createHTML(C)??C;f.innerHTML=A,f.style.position="absolute",f.style.top="10000",o==="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),Be=Ct.map(Ne=>Ne.column-1)):(De=null,Be=null),P[R]=new w5(Be,De,G,ge,j)}return f.remove(),P}var M1;(function(s){s[s.SPAN_MODULO_LIMIT=16384]="SPAN_MODULO_LIMIT"})(M1||(M1={}));function Cwt(s,e,t,i,n,r){if(r!==0){const u=String(r);n.appendString('
');const o=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 Swt(s,e,t,i){if(t.length<=1)return null;const n=Array.prototype.slice.call(e.children,0),r=[];try{Rme(s,n,i,0,null,t.length-1,null,r)}catch(o){return console.log(o),null}return r.length===0?null:(r.push(t.length),r)}function Rme(s,e,t,i,n,r,o,a){if(i===r||(n=n||mhe(s,e,t[i],t[i+1]),o=o||mhe(s,e,t[r],t[r+1]),Math.abs(n[0].top-o[0].top)<=.1))return;if(i+1===r){a.push(r);return}const c=i+(r-i)/2|0,l=mhe(s,e,t[c],t[c+1]);Rme(s,e,t,i,n,c,l,a),Rme(s,e,t,c,l,r,o,a)}function mhe(s,e,t,i){return s.setStart(e[t/M1.SPAN_MODULO_LIMIT|0].firstChild,t%M1.SPAN_MODULO_LIMIT),s.setEnd(e[i/M1.SPAN_MODULO_LIMIT|0].firstChild,i%M1.SPAN_MODULO_LIMIT),s.getClientRects()}class Awt extends V{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new mr),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[ai.Eager]=!1,this._finishedInstantiation[ai.AfterFirstRender]=!1,this._finishedInstantiation[ai.BeforeFirstInteraction]=!1,this._finishedInstantiation[ai.Eventually]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const n of t){if(this._pending.has(n.id)){bt(new Error(`Cannot have two contributions with the same id ${n.id}`));continue}this._pending.set(n.id,n)}this._instantiateSome(ai.Eager),this._register(sF(lt(this._editor.getDomNode()),()=>{this._instantiateSome(ai.AfterFirstRender)})),this._register(sF(lt(this._editor.getDomNode()),()=>{this._instantiateSome(ai.BeforeFirstInteraction)})),this._register(sF(lt(this._editor.getDomNode()),()=>{this._instantiateSome(ai.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(ai.BeforeFirstInteraction)}onAfterModelAttached(){return sF(lt(this._editor?.getDomNode()),()=>{this._instantiateSome(ai.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!==ai.Eager&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){bt(i)}}}}class pje{constructor(e,t,i,n,r,o,a){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=r,this._run=o,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}var zh;(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"})(zh||(zh={}));var as;(function(s){s[s.Black=0]="Black",s[s.Red=1]="Red"})(as||(as={}));var fr;(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"})(fr||(fr={}));function Au(s){return(s.metadata&fr.ColorMask)>>>fr.ColorOffset}function eo(s,e){s.metadata=s.metadata&fr.ColorMaskInverse|e<>>fr.IsVisitedOffset===1}function qr(s,e){s.metadata=s.metadata&fr.IsVisitedMaskInverse|(e?1:0)<>>fr.IsForValidationOffset===1}function QBe(s,e){s.metadata=s.metadata&fr.IsForValidationMaskInverse|(e?1:0)<>>fr.IsMarginOffset===1}function jBe(s,e){s.metadata=s.metadata&fr.IsMarginMaskInverse|(e?1:0)<>>fr.StickinessOffset}function YBe(s,e){s.metadata=s.metadata&fr.StickinessMaskInverse|e<>>fr.CollapseOnReplaceEditOffset===1}function JBe(s,e){s.metadata=s.metadata&fr.CollapseOnReplaceEditMaskInverse|(e?1:0)<t||i===$v.ForceMove?!1:i===$v.ForceStay?!0:e}function kwt(s,e,t,i,n){const r=Ewt(s),o=r===si.AlwaysGrowsWhenTypingAtEdges||r===si.GrowsOnlyWhenTypingBefore,a=r===si.NeverGrowsWhenTypingAtEdges||r===si.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&&xwt(s)&&(s.start=e,u=!0,s.end=e,p=!0);{const v=n?$v.ForceMove:c>0?$v.ForceStay:$v.MarkerDefined;!u&&fP(h,o,e,v)&&(u=!0),!p&&fP(f,a,e,v)&&(p=!0)}if(d>0&&!n){const v=c>l?$v.ForceStay:$v.MarkerDefined;!u&&fP(h,o,e+d,v)&&(u=!0),!p&&fP(f,a,e+d,v)&&(p=!0)}{const v=n?$v.ForceMove:$v.MarkerDefined;!u&&fP(h,o,t,v)&&(s.start=e+l,u=!0),!p&&fP(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 Iwt(s,e,t){let i=s.root,n=0,r=0,o=0,a=0;const c=[];let l=0;for(;i!==un;){if(hd(i)){qr(i.left,!1),qr(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!hd(i.left)){if(r=n+i.maxEnd,rt){qr(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(o,a,0),c[l++]=i),qr(i,!0),i.right!==un&&!hd(i.right)){n+=i.delta,i=i.right;continue}}return qr(s.root,!1),c}function Twt(s,e,t,i){let n=s.root,r=0,o=0,a=0;const c=i-(t-e);for(;n!==un;){if(hd(n)){qr(n.left,!1),qr(n.right,!1),n===n.parent.right&&(r-=n.parent.delta),$k(n),n=n.parent;continue}if(!hd(n.left)){if(o=r+n.maxEnd,ot){n.start+=c,n.end+=c,n.delta+=c,(n.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),qr(n,!0);continue}if(qr(n,!0),n.right!==un&&!hd(n.right)){r+=n.delta,n=n.right;continue}}qr(s.root,!1)}function Lwt(s,e){let t=s.root;const i=[];let n=0;for(;t!==un;){if(hd(t)){qr(t.left,!1),qr(t.right,!1),t=t.parent;continue}if(t.left!==un&&!hd(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),qr(t,!0),t.right!==un&&!hd(t.right)){t=t.right;continue}}return qr(s.root,!1),i}function Rwt(s){let e=s.root;const t=[];let i=0;for(;e!==un;){if(hd(e)){qr(e.left,!1),qr(e.right,!1),e=e.parent;continue}if(e.left!==un&&!hd(e.left)){e=e.left;continue}if(e.right!==un&&!hd(e.right)){e=e.right;continue}t[i++]=e,qr(e,!0)}return qr(s.root,!1),t}function XBe(s,e,t,i,n){let r=s.root,o=0,a=0,c=0;const l=[];let d=0;for(;r!==un;){if(hd(r)){qr(r.left,!1),qr(r.right,!1),r===r.parent.right&&(o-=r.parent.delta),r=r.parent;continue}if(r.left!==un&&!hd(r.left)){r=r.left;continue}a=o+r.start,c=o+r.end,r.setCachedOffsets(a,c,i);let h=!0;if(e&&r.ownerId&&r.ownerId!==e&&(h=!1),t&&mje(r)&&(h=!1),n&&!_je(r)&&(h=!1),h&&(l[d++]=r),qr(r,!0),r.right!==un&&!hd(r.right)){o+=r.delta,r=r.right;continue}}return qr(s.root,!1),l}function Mwt(s,e,t,i,n,r,o){let a=s.root,c=0,l=0,d=0,h=0;const u=[];let f=0;for(;a!==un;){if(hd(a)){qr(a.left,!1),qr(a.right,!1),a===a.parent.right&&(c-=a.parent.delta),a=a.parent;continue}if(!hd(a.left)){if(l=c+a.maxEnd,lt){qr(a,!0);continue}if(h=c+a.end,h>=e){a.setCachedOffsets(d,h,r);let p=!0;i&&a.ownerId&&a.ownerId!==i&&(p=!1),n&&mje(a)&&(p=!1),o&&!_je(a)&&(p=!1),p&&(u[f++]=a)}if(qr(a,!0),a.right!==un&&!hd(a.right)){c+=a.delta,a=a.right;continue}}return qr(s.root,!1),u}function ZBe(s,e){if(s.root===un)return e.parent=un,e.left=un,e.right=un,eo(e,as.Black),s.root=e,s.root;Nwt(s,e),DE(e.parent);let t=e;for(;t!==s.root&&Au(t.parent)===as.Red;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Au(i)===as.Red?(eo(t.parent,as.Black),eo(i,as.Black),eo(t.parent.parent,as.Red),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,y5(s,t)),eo(t.parent,as.Black),eo(t.parent.parent,as.Red),C5(s,t.parent.parent))}else{const i=t.parent.parent.left;Au(i)===as.Red?(eo(t.parent,as.Black),eo(i,as.Black),eo(t.parent.parent,as.Red),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,C5(s,t)),eo(t.parent,as.Black),eo(t.parent.parent,as.Red),y5(s,t.parent.parent))}return eo(s.root,as.Black),e}function Nwt(s,e){let t=0,i=s.root;const n=e.start,r=e.end;for(;;)if(Fwt(n,r,i.start+t,i.end+t)<0)if(i.left===un){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===un){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=un,e.right=un,eo(e,as.Red)}function e2e(s,e){let t,i;if(e.left===un?(t=e.right,i=e,t.delta+=e.delta,(t.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===un?(t=e.left,i=e):(i=Pwt(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0)),i===s.root){s.root=t,eo(t,as.Black),e.detach(),vhe(),$k(t),s.root.parent=un;return}const n=Au(i)===as.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,eo(i,Au(e)),e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==un&&(i.left.parent=i),i.right!==un&&(i.right.parent=i)),e.detach(),n){DE(t.parent),i!==e&&(DE(i),DE(i.parent)),vhe();return}DE(t),DE(t.parent),i!==e&&(DE(i),DE(i.parent));let r;for(;t!==s.root&&Au(t)===as.Black;)t===t.parent.left?(r=t.parent.right,Au(r)===as.Red&&(eo(r,as.Black),eo(t.parent,as.Red),y5(s,t.parent),r=t.parent.right),Au(r.left)===as.Black&&Au(r.right)===as.Black?(eo(r,as.Red),t=t.parent):(Au(r.right)===as.Black&&(eo(r.left,as.Black),eo(r,as.Red),C5(s,r),r=t.parent.right),eo(r,Au(t.parent)),eo(t.parent,as.Black),eo(r.right,as.Black),y5(s,t.parent),t=s.root)):(r=t.parent.left,Au(r)===as.Red&&(eo(r,as.Black),eo(t.parent,as.Red),C5(s,t.parent),r=t.parent.left),Au(r.left)===as.Black&&Au(r.right)===as.Black?(eo(r,as.Red),t=t.parent):(Au(r.left)===as.Black&&(eo(r.right,as.Black),eo(r,as.Red),y5(s,r),r=t.parent.left),eo(r,Au(t.parent)),eo(t.parent,as.Black),eo(r.left,as.Black),C5(s,t.parent),t=s.root));eo(t,as.Black),vhe()}function Pwt(s){for(;s.left!==un;)s=s.left;return s}function vhe(){un.parent=un,un.delta=0,un.start=0,un.end=0}function y5(s,e){const t=e.right;t.delta+=e.delta,(t.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==un&&(t.left.parent=e),t.parent=e.parent,e.parent===un?s.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,$k(e),$k(t)}function C5(s,e){const t=e.left;e.delta-=t.delta,(e.deltafr.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==un&&(t.right.parent=e),t.parent=e.parent,e.parent===un?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,$k(e),$k(t)}function bje(s){let e=s.end;if(s.left!==un){const t=s.left.maxEnd;t>e&&(e=t)}if(s.right!==un){const t=s.right.maxEnd+s.delta;t>e&&(e=t)}return e}function $k(s){s.maxEnd=bje(s)}function DE(s){for(;s!==un;){const e=bje(s);if(s.maxEnd===e)return;s.maxEnd=e,s=s.parent}}function Fwt(s,e,t,i){return s===t?e-i:s-t}var TS;(function(s){s[s.Unknown=0]="Unknown",s[s.Invalid=3]="Invalid",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(TS||(TS={}));function kb(s){let e=0,t=0,i=0,n=TS.Unknown;for(let r=0,o=s.length;r=op&&(t=t-s%op),t}function Uwt(s,e){return s.reduce((t,i)=>Lo(t,e(i)),nu)}function wje(s,e){return s===e}function c3(s,e){const t=s,i=e;if(i-t<=0)return nu;const r=Math.floor(t/op),o=Math.floor(i/op),a=i-o*op;if(r===o){const c=t-r*op;return Ia(0,a-c)}else return Ia(o-r,a)}function GO(s,e){return s=e}function gF(s){return Ia(s.lineNumber-1,s.column-1)}function MT(s,e){const t=s,i=Math.floor(t/op),n=t-i*op,r=e,o=Math.floor(r/op),a=r-o*op;return new F(i+1,n+1,o+1,a+1)}function Vwt(s){const e=cv(s);return Ia(e.length-1,e[e.length-1].length)}const jG=[],Rp=class Rp{static create(e,t){if(e<=128&&t.length===0){let i=Rp.cache[e];return i||(i=new Rp(e,t),Rp.cache[e]=i),i}return new Rp(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 o=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 Gr;(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"})(Gr||(Gr={}));class kLe{get length(){return this._length}constructor(e){this._length=e}}class qO extends kLe{static create(e,t,i){let n=e.length;return t&&(n=Lo(n,t.length)),i&&(n=Lo(n,i.length)),new qO(n,e,t,i,t?t.missingOpeningBracketIds:Qg.getEmpty())}get kind(){return Gr.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,r){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=r}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}flattenLists(){return qO.create(this.openingBracket.flattenLists(),this.child&&this.child.flattenLists(),this.closingBracket&&this.closingBracket.flattenLists())}deepClone(){return new qO(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(Lo(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class J_ extends kLe{static create23(e,t,i,n=!1){let r=e.length,o=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(r=Lo(r,t.length),o=o.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");r=Lo(r,i.length),o=o.merge(i.missingOpeningBracketIds)}return n?new zwt(r,e.listHeight+1,e,t,i,o):new l3(r,e.listHeight+1,e,t,i,o)}static create(e,t=!1){if(e.length===0)return this.getEmpty();{let i=e[0].length,n=e[0].missingOpeningBracketIds;for(let r=1;r{const n=F.lift(i.range);return new LS(gF(n.getStartPosition()),gF(n.getEndPosition()),Vwt(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${om(this.startOffset)}...${om(this.endOffset)}) -> ${om(this.newLength)}`}}class Kwt{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>TLe.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:c3(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Ia(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Ia(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=om(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Ia(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Ia(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 r=this.lineTokens,o=r.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const n=Wwt(e,t,this.lineIdx,this.lineCharOffset);return new sx(n,Gu.Text,-1,Qg.getEmpty(),new Q0(n))}}class Qwt{constructor(e,t){this.text=e,this._offset=nu,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+`| `,"gi"):null,r=[];let o,a=0,c=0,l=0,d=0;const h=[];for(let p=0;p<60;p++)h.push(new sx(Ia(0,p),Gu.Text,-1,Qg.getEmpty(),new Q0(Ia(0,p))));const u=[];for(let p=0;p<60;p++)u.push(new sx(Ia(1,p),Gu.Text,-1,Qg.getEmpty(),new Q0(Ia(1,p))));if(n)for(n.lastIndex=0;(o=n.exec(e))!==null;){const p=o.index,m=o[0];if(m===` -`)a++,c=p+1;else{if(l!==p){let v;if(d===a){const b=p-l;if(bjwt(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===Gu.ClosingBracket&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function jwt(s){let e=Nh(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class Sje{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=LLe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}getToken(e,t){return this.getSingleLanguageBracketTokens(t).getToken(e)}}function Ywt(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 o=e,a=s[o].listHeight;for(e++;e=2?Aje(o===0&&e===s.length?s:s.slice(o,e),!1):s[o]}let i=t(),n=t();if(!n)return i;for(let o=t();o;o=t())s2e(i,n)<=s2e(n,o)?(i=bhe(i,n),n=o):n=bhe(n,o);return bhe(i,n)}function Aje(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 s2e(s,e){return Math.abs(s.listHeight-e.listHeight)}function bhe(s,e){return s.listHeight===e.listHeight?J_.create23(s,e,null,!1):s.listHeight>e.listHeight?Jwt(s,e):Xwt(e,s)}function Jwt(s,e){s=s.toMutable();let t=s;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==Gr.List)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let r=i.length-1;r>=0;r--){const o=i[r];n?o.childrenLength>=3?n=J_.create23(o.unappendChild(),n,null,!1):(o.appendChildOfSameHeight(n),n=void 0):o.handleChildrenChanged()}return n?J_.create23(s,n,null,!1):s}function Xwt(s,e){s=s.toMutable();let t=s;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==Gr.List)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let r=i.length-1;r>=0;r--){const o=i[r];n?o.childrenLength>=3?n=J_.create23(n,o.unprependChild(),null,!1):(o.prependChildOfSameHeight(n),n=void 0):o.handleChildrenChanged()}return n?J_.create23(n,s,null,!1):s}class Zwt{constructor(e){this.lastOffset=nu,this.nextNodes=[e],this.offsets=[nu],this.idxs=[]}readLongestNodeAt(e,t){if(GO(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=b4(this.nextNodes);if(!i)return;const n=b4(this.offsets);if(GO(e,n))return;if(GO(n,e))if(Lo(n,i.length)<=e)this.nextNodeAfterCurrent();else{const r=whe(i);r!==-1?(this.nextNodes.push(i.getChild(r)),this.offsets.push(n),this.idxs.push(r)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const r=whe(i);if(r===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(r)),this.offsets.push(n),this.idxs.push(r)}}}}nextNodeAfterCurrent(){for(;;){const e=b4(this.offsets),t=b4(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=b4(this.nextNodes),n=whe(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(Lo(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function whe(s,e=-1){for(;;){if(e++,e>=s.childrenLength)return-1;if(s.getChild(e))return e}}function b4(s){return s.length>0?s[s.length-1]:void 0}function Mme(s,e,t,i){return new eyt(s,e,t,i).parseDocument()}let eyt=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 Zwt(i):void 0,this.positionMapper=new Kwt(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Qg.getEmpty(),0);return e||(e=J_.getEmpty()),e}parseList(e,t){const i=[];for(;;){let r=this.tryReadChildFromCache(e);if(!r){const o=this.tokenizer.peek();if(!o||o.kind===Gu.ClosingBracket&&o.bracketIds.intersects(e))break;r=this.parseChild(e,t+1)}r.kind===Gr.List&&r.childrenLength===0||i.push(r)}return this.oldNodeReader?Ywt(i):Aje(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!IY(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!GO(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 Gu.ClosingBracket:return new Gwt(i.bracketIds,i.length);case Gu.Text:return i.astNode;case Gu.OpeningBracket:{if(t>300)return new Q0(i.length);const n=e.merge(i.bracketIds),r=this.parseList(n,t+1),o=this.tokenizer.peek();return o&&o.kind===Gu.ClosingBracket&&(o.bracketId===i.bracketId||o.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),qO.create(i.astNode,r,o.astNode)):qO.create(i.astNode,r,null)}default:throw new Error("unexpected")}}};var lD;(function(s){s[s.InProgress=1]="InProgress",s[s.Completed=2]="Completed"})(lD||(lD={}));function LY(s,e){if(s.length===0)return e;if(e.length===0)return s;const t=new Gy(r2e(s)),i=r2e(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let n=t.dequeue();function r(l){if(l===void 0){const h=t.takeWhile(u=>!0)||[];return n&&h.unshift(n),h}const d=[];for(;n&&!IY(l);){const[h,u]=n.splitAt(l);d.push(h),l=c3(h.lengthAfter,l),n=u??t.dequeue()}return IY(l)||d.push(new Tx(!1,l,l)),d}const o=[];function a(l,d,h){if(o.length>0&&wje(o[o.length-1].endOffset,l)){const u=o[o.length-1];o[o.length-1]=new LS(u.startOffset,d,Lo(u.newLength,h))}else o.push({startOffset:l,endOffset:d,newLength:h})}let c=nu;for(const l of i){const d=r(l.lengthBefore);if(l.modified){const h=Uwt(d,f=>f.lengthBefore),u=Lo(c,h);a(c,u,l.lengthAfter),c=u}else for(const h of d){const u=c;c=Lo(c,h.lengthBefore),h.modified&&a(u,c,h.lengthAfter)}}return o}class Tx{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=c3(e,this.lengthAfter);return wje(t,nu)?[this,void 0]:this.modified?[new Tx(this.modified,this.lengthBefore,e),new Tx(this.modified,nu,t)]:[new Tx(this.modified,e,e),new Tx(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${om(this.lengthBefore)} -> ${om(this.lengthAfter)}`}}function r2e(s){const e=[];let t=nu;for(const i of s){const n=c3(t,i.startOffset);IY(n)||e.push(new Tx(!1,n,n));const r=c3(i.startOffset,i.endOffset);e.push(new Tx(!0,r,i.newLength)),t=i.endOffset}return e}class tyt 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 yje,this.brackets=new Sje(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===lD.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 Qwt(this.textModel.getValue(),i);this.initialAstWithoutTokens=Mme(n,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===lD.Completed){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new LS(Ia(i.fromLineNumber-1,0),Ia(i.toLineNumber,0),Ia(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=LS.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=LY(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=LY(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,r=new Cje(this.textModel,this.brackets);return Mme(r,e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=Ia(e.startLineNumber-1,e.startColumn-1),n=Ia(e.endLineNumber-1,e.endColumn-1);return new bT(r=>{const o=this.initialAstWithoutTokens||this.astWithTokens;Nme(o,nu,o.length,i,n,r,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=gF(e.getStartPosition()),n=gF(e.getEndPosition());return new bT(r=>{const o=this.initialAstWithoutTokens||this.astWithTokens,a=new iyt(r,t,this.textModel);Pme(o,nu,o.length,i,n,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return xje(t,nu,t.length,gF(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Eje(t,nu,t.length,gF(e))}}function Eje(s,e,t,i){if(s.kind===Gr.List||s.kind===Gr.Pair){const n=[];for(const r of s.children)t=Lo(e,r.length),n.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let r=n.length-1;r>=0;r--){const{nodeOffsetStart:o,nodeOffsetEnd:a}=n[r];if(GO(o,i)){const c=Eje(s.children[r],o,a,i);if(c)return c}}return null}else{if(s.kind===Gr.UnexpectedClosingBracket)return null;if(s.kind===Gr.Bracket){const n=MT(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function xje(s,e,t,i){if(s.kind===Gr.List||s.kind===Gr.Pair){for(const n of s.children){if(t=Lo(e,n.length),GO(i,t)){const r=xje(n,e,t,i);if(r)return r}e=t}return null}else{if(s.kind===Gr.UnexpectedClosingBracket)return null;if(s.kind===Gr.Bracket){const n=MT(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function Nme(s,e,t,i,n,r,o,a,c,l,d=!1){if(o>200)return!0;e:for(;;)switch(s.kind){case Gr.List:{const h=s.childrenLength;for(let u=0;u200)return!0;let c=!0;if(s.kind===Gr.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=Lo(e,s.openingBracket.length);let h=-1;if(r.includeMinIndentation&&(h=s.computeMinIndentation(e,r.textModel)),c=r.push(new Bwt(MT(e,t),MT(e,d),s.closingBracket?MT(Lo(d,s.child?.length||nu),t):void 0,o,l,s,h)),e=d,c&&s.child){const u=s.child;if(t=Lo(e,u.length),KO(e,n)&&cV(t,i)&&(c=Pme(u,e,t,i,n,r,o+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=Lo(l,d.length),KO(h,n)&&KO(i,l)&&(c=Pme(d,h,l,i,n,r,o,a),!c))return!1}}return c}class nyt extends V{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new yn),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=syt(e.add(new tyt(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)||bT.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||bT.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||bT.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),r=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const o=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew.getClosingBracketInfo(e);if(!o)return null;const a=this.getBracketPairsInRange(F.fromPositions(t,t)).findLast(c=>o.closes(c.openingBracketInfo));return a?a.openingBracketRange:null}else{const o=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(r).brackets;if(!a)return null;const c=a.textIsBracket[o];return c?YG(this._findMatchingBracketUp(c,n,yhe(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(Sc(n=>n.openingBracketRange.containsPosition(e)?n.openingBracketRange:n.closingBracketRange,F.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=yhe(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const r=t.getCount(),o=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(nw(t.getStandardTokenType(l))||t.getLanguageId(l)!==o){a=d;break}}let c=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let l=n+1;l=c)break;if(nw(t.getStandardTokenType(l))||t.getLanguageId(l)!==o){c=d;break}}return{searchStartOffset:a,searchEndOffset:c}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),r=this.textModel.getLineContent(i),o=n.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(o)).brackets;if(a&&!nw(n.getStandardTokenType(o))){let{searchStartOffset:c,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,o),d=null;for(;;){const h=Hm.findNextBracketInRange(a.forwardRegex,i,r,c,l);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const u=r.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(f){if(f instanceof YC)return null;d=f}}c=h.endColumn-1}if(d)return d}if(o>0&&n.getStartOffset(o)===e.column-1){const c=o-1,l=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(c)).brackets;if(l&&!nw(n.getStandardTokenType(c))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,n,l,c),u=Hm.findPrevBracketInRange(l.reversedRegex,i,r,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){const f=r.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),p=this._matchFoundBracket(u,l.textIsBracket[f],l.textIsOpenBracket[f],t);if(p)return p instanceof YC?null:p}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const r=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return r?r instanceof YC?r:[e,r]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,r=e.reversedRegex;let o=-1,a=0;const c=(l,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return YC.INSTANCE;const f=Hm.findPrevBracketInRange(r,l,d,h,u);if(!f)break;const p=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(p)?o++:e.isClose(p)&&o--,o===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&&!nw(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,r=e.forwardRegex;let o=1,a=0;const c=(d,h,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return YC.INSTANCE;const p=Hm.findNextBracketInRange(r,d,h,u,f);if(!p)break;const m=h.substring(p.startColumn-1,p.endColumn-1).toLowerCase();if(e.isOpen(m)?o++:e.isClose(m)&&o--,o===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;o--){const a=this.textModel.tokenization.getLineTokens(o),c=a.getCount(),l=this.textModel.getLineContent(o);let d=c-1,h=l.length,u=l.length;if(o===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,r=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let f=!0;for(;d>=0;d--){const p=a.getLanguageId(d);if(i!==p){if(n&&r&&f&&h!==u){const v=Hm.findPrevBracketInRange(n.reversedRegex,o,l,h,u);if(v)return this._toFoundBracket(r,v);f=!1}i=p,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,r=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const m=!!n&&!nw(a.getStandardTokenType(d));if(m)f?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(r&&n&&f&&h!==u){const v=Hm.findPrevBracketInRange(n.reversedRegex,o,l,h,u);if(v)return this._toFoundBracket(r,v)}f=m}if(r&&n&&f&&h!==u){const p=Hm.findPrevBracketInRange(n.reversedRegex,o,l,h,u);if(p)return this._toFoundBracket(r,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,r=null,o=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,r=this.languageConfigurationService.getLanguageConfiguration(n).brackets,o=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=yhe(t),r=this.textModel.getLineCount(),o=new Map;let a=[];const c=(f,p)=>{if(!o.has(f)){const m=[];for(let v=0,b=p?p.brackets.length:0;v{for(;;){if(n&&++l%100===0&&!n())return YC.INSTANCE;const w=Hm.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<=r;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 yhe(s){if(typeof s>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=s}}const yse=class yse{constructor(){this._searchCanceledBrand=void 0}};yse.INSTANCE=new yse;let YC=yse;function YG(s){return s instanceof YC?null:s}class ryt extends V{constructor(e){super(),this.textModel=e,this.colorProvider=new Dje,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(o=>({id:`bracket${o.range.toString()}-${o.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(o,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:o.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 Dje{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}`}}Ep((s,e)=>{const t=[eje,tje,ije,nje,sje,rje],i=new Dje;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${s.getColor(Gvt)}; }`);const n=t.map(r=>s.getColor(r)).filter(r=>!!r).filter(r=>!r.isTransparent());for(let r=0;r<30;r++){const o=n[r%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(r)} { color: ${o}; }`)}});var El;(function(s){s[s.Resource=0]="Resource",s[s.Workspace=1]="Workspace"})(El||(El={}));class kje{constructor(e,t){this.resource=e,this.elements=t}}const ZF=class ZF{constructor(){this.id=ZF._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};ZF._ID=0,ZF.None=new ZF;let RY=ZF;const eO=class eO{constructor(){this.id=eO._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};eO._ID=0,eO.None=new eO;let j0=eO;function JG(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Ql{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} "${JG(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${JG(this.oldText)}")`:`(replace@${this.oldPosition} "${JG(this.oldText)}" with "${JG(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Ru(e,n,i),i+=4;for(let r=0;r0&&(this.changes=oyt(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=r}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Ru(e,t?t.length:0,i),i+=4,t)for(const n of t)Ru(e,n.selectionStartLineNumber,i),i+=4,Ru(e,n.selectionStartColumn,i),i+=4,Ru(e,n.positionLineNumber,i),i+=4,Ru(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Lu(e,t);t+=4;for(let r=0;rt.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 tl}append(e,t,i,n,r){this._data instanceof tl&&this._data.append(e,t,i,n,r)}close(){this._data instanceof tl&&(this._data=this._data.serialize())}open(){this._data instanceof tl||(this._data=tl.deserialize(this._data))}undo(){if(N.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof tl&&(this._data=this._data.serialize());const e=tl.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 tl&&(this._data=this._data.serialize());const e=tl.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof tl&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Fme{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=El.Workspace,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const r=pP(n.resource);this._editStackElementsMap.set(r,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=pP(e);return this._editStackElementsMap.has(t)}setModel(e){const t=pP(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=pP(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,r){const o=pP(e.uri);this._editStackElementsMap.get(o).append(e,t,i,n,r)}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=pP(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(`${vi(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function Ome(s){return s.getEOL()===` +`)a++,c=p+1;else{if(l!==p){let v;if(d===a){const b=p-l;if(bjwt(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===Gu.ClosingBracket&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function jwt(s){let e=Nh(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class Sje{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=LLe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}getToken(e,t){return this.getSingleLanguageBracketTokens(t).getToken(e)}}function Ywt(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 o=e,a=s[o].listHeight;for(e++;e=2?Aje(o===0&&e===s.length?s:s.slice(o,e),!1):s[o]}let i=t(),n=t();if(!n)return i;for(let o=t();o;o=t())s2e(i,n)<=s2e(n,o)?(i=bhe(i,n),n=o):n=bhe(n,o);return bhe(i,n)}function Aje(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 s2e(s,e){return Math.abs(s.listHeight-e.listHeight)}function bhe(s,e){return s.listHeight===e.listHeight?J_.create23(s,e,null,!1):s.listHeight>e.listHeight?Jwt(s,e):Xwt(e,s)}function Jwt(s,e){s=s.toMutable();let t=s;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==Gr.List)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let r=i.length-1;r>=0;r--){const o=i[r];n?o.childrenLength>=3?n=J_.create23(o.unappendChild(),n,null,!1):(o.appendChildOfSameHeight(n),n=void 0):o.handleChildrenChanged()}return n?J_.create23(s,n,null,!1):s}function Xwt(s,e){s=s.toMutable();let t=s;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==Gr.List)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let r=i.length-1;r>=0;r--){const o=i[r];n?o.childrenLength>=3?n=J_.create23(n,o.unprependChild(),null,!1):(o.prependChildOfSameHeight(n),n=void 0):o.handleChildrenChanged()}return n?J_.create23(n,s,null,!1):s}class Zwt{constructor(e){this.lastOffset=nu,this.nextNodes=[e],this.offsets=[nu],this.idxs=[]}readLongestNodeAt(e,t){if(GO(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=b4(this.nextNodes);if(!i)return;const n=b4(this.offsets);if(GO(e,n))return;if(GO(n,e))if(Lo(n,i.length)<=e)this.nextNodeAfterCurrent();else{const r=whe(i);r!==-1?(this.nextNodes.push(i.getChild(r)),this.offsets.push(n),this.idxs.push(r)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const r=whe(i);if(r===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(r)),this.offsets.push(n),this.idxs.push(r)}}}}nextNodeAfterCurrent(){for(;;){const e=b4(this.offsets),t=b4(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=b4(this.nextNodes),n=whe(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(Lo(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function whe(s,e=-1){for(;;){if(e++,e>=s.childrenLength)return-1;if(s.getChild(e))return e}}function b4(s){return s.length>0?s[s.length-1]:void 0}function Mme(s,e,t,i){return new eyt(s,e,t,i).parseDocument()}let eyt=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 Zwt(i):void 0,this.positionMapper=new Kwt(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Qg.getEmpty(),0);return e||(e=J_.getEmpty()),e}parseList(e,t){const i=[];for(;;){let r=this.tryReadChildFromCache(e);if(!r){const o=this.tokenizer.peek();if(!o||o.kind===Gu.ClosingBracket&&o.bracketIds.intersects(e))break;r=this.parseChild(e,t+1)}r.kind===Gr.List&&r.childrenLength===0||i.push(r)}return this.oldNodeReader?Ywt(i):Aje(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!IY(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!GO(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 Gu.ClosingBracket:return new Gwt(i.bracketIds,i.length);case Gu.Text:return i.astNode;case Gu.OpeningBracket:{if(t>300)return new Q0(i.length);const n=e.merge(i.bracketIds),r=this.parseList(n,t+1),o=this.tokenizer.peek();return o&&o.kind===Gu.ClosingBracket&&(o.bracketId===i.bracketId||o.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),qO.create(i.astNode,r,o.astNode)):qO.create(i.astNode,r,null)}default:throw new Error("unexpected")}}};var lD;(function(s){s[s.InProgress=1]="InProgress",s[s.Completed=2]="Completed"})(lD||(lD={}));function LY(s,e){if(s.length===0)return e;if(e.length===0)return s;const t=new Gy(r2e(s)),i=r2e(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let n=t.dequeue();function r(l){if(l===void 0){const h=t.takeWhile(u=>!0)||[];return n&&h.unshift(n),h}const d=[];for(;n&&!IY(l);){const[h,u]=n.splitAt(l);d.push(h),l=c3(h.lengthAfter,l),n=u??t.dequeue()}return IY(l)||d.push(new Tx(!1,l,l)),d}const o=[];function a(l,d,h){if(o.length>0&&wje(o[o.length-1].endOffset,l)){const u=o[o.length-1];o[o.length-1]=new LS(u.startOffset,d,Lo(u.newLength,h))}else o.push({startOffset:l,endOffset:d,newLength:h})}let c=nu;for(const l of i){const d=r(l.lengthBefore);if(l.modified){const h=Uwt(d,f=>f.lengthBefore),u=Lo(c,h);a(c,u,l.lengthAfter),c=u}else for(const h of d){const u=c;c=Lo(c,h.lengthBefore),h.modified&&a(u,c,h.lengthAfter)}}return o}class Tx{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=c3(e,this.lengthAfter);return wje(t,nu)?[this,void 0]:this.modified?[new Tx(this.modified,this.lengthBefore,e),new Tx(this.modified,nu,t)]:[new Tx(this.modified,e,e),new Tx(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${om(this.lengthBefore)} -> ${om(this.lengthAfter)}`}}function r2e(s){const e=[];let t=nu;for(const i of s){const n=c3(t,i.startOffset);IY(n)||e.push(new Tx(!1,n,n));const r=c3(i.startOffset,i.endOffset);e.push(new Tx(!0,r,i.newLength)),t=i.endOffset}return e}class tyt 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 yje,this.brackets=new Sje(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===lD.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 Qwt(this.textModel.getValue(),i);this.initialAstWithoutTokens=Mme(n,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===lD.Completed){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new LS(Ia(i.fromLineNumber-1,0),Ia(i.toLineNumber,0),Ia(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=LS.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=LY(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=LY(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,r=new Cje(this.textModel,this.brackets);return Mme(r,e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=Ia(e.startLineNumber-1,e.startColumn-1),n=Ia(e.endLineNumber-1,e.endColumn-1);return new bT(r=>{const o=this.initialAstWithoutTokens||this.astWithTokens;Nme(o,nu,o.length,i,n,r,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=gF(e.getStartPosition()),n=gF(e.getEndPosition());return new bT(r=>{const o=this.initialAstWithoutTokens||this.astWithTokens,a=new iyt(r,t,this.textModel);Pme(o,nu,o.length,i,n,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return xje(t,nu,t.length,gF(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Eje(t,nu,t.length,gF(e))}}function Eje(s,e,t,i){if(s.kind===Gr.List||s.kind===Gr.Pair){const n=[];for(const r of s.children)t=Lo(e,r.length),n.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let r=n.length-1;r>=0;r--){const{nodeOffsetStart:o,nodeOffsetEnd:a}=n[r];if(GO(o,i)){const c=Eje(s.children[r],o,a,i);if(c)return c}}return null}else{if(s.kind===Gr.UnexpectedClosingBracket)return null;if(s.kind===Gr.Bracket){const n=MT(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function xje(s,e,t,i){if(s.kind===Gr.List||s.kind===Gr.Pair){for(const n of s.children){if(t=Lo(e,n.length),GO(i,t)){const r=xje(n,e,t,i);if(r)return r}e=t}return null}else{if(s.kind===Gr.UnexpectedClosingBracket)return null;if(s.kind===Gr.Bracket){const n=MT(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function Nme(s,e,t,i,n,r,o,a,c,l,d=!1){if(o>200)return!0;e:for(;;)switch(s.kind){case Gr.List:{const h=s.childrenLength;for(let u=0;u200)return!0;let c=!0;if(s.kind===Gr.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=Lo(e,s.openingBracket.length);let h=-1;if(r.includeMinIndentation&&(h=s.computeMinIndentation(e,r.textModel)),c=r.push(new Bwt(MT(e,t),MT(e,d),s.closingBracket?MT(Lo(d,s.child?.length||nu),t):void 0,o,l,s,h)),e=d,c&&s.child){const u=s.child;if(t=Lo(e,u.length),KO(e,n)&&cV(t,i)&&(c=Pme(u,e,t,i,n,r,o+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=Lo(l,d.length),KO(h,n)&&KO(i,l)&&(c=Pme(d,h,l,i,n,r,o,a),!c))return!1}}return c}class nyt extends V{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new yn),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=syt(e.add(new tyt(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)||bT.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||bT.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||bT.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),r=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const o=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew.getClosingBracketInfo(e);if(!o)return null;const a=this.getBracketPairsInRange(F.fromPositions(t,t)).findLast(c=>o.closes(c.openingBracketInfo));return a?a.openingBracketRange:null}else{const o=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(r).brackets;if(!a)return null;const c=a.textIsBracket[o];return c?YG(this._findMatchingBracketUp(c,n,yhe(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(Sc(n=>n.openingBracketRange.containsPosition(e)?n.openingBracketRange:n.closingBracketRange,F.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=yhe(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const r=t.getCount(),o=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(nw(t.getStandardTokenType(l))||t.getLanguageId(l)!==o){a=d;break}}let c=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let l=n+1;l=c)break;if(nw(t.getStandardTokenType(l))||t.getLanguageId(l)!==o){c=d;break}}return{searchStartOffset:a,searchEndOffset:c}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),r=this.textModel.getLineContent(i),o=n.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(o)).brackets;if(a&&!nw(n.getStandardTokenType(o))){let{searchStartOffset:c,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,o),d=null;for(;;){const h=Hm.findNextBracketInRange(a.forwardRegex,i,r,c,l);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const u=r.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(f){if(f instanceof YC)return null;d=f}}c=h.endColumn-1}if(d)return d}if(o>0&&n.getStartOffset(o)===e.column-1){const c=o-1,l=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(c)).brackets;if(l&&!nw(n.getStandardTokenType(c))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,n,l,c),u=Hm.findPrevBracketInRange(l.reversedRegex,i,r,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){const f=r.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),p=this._matchFoundBracket(u,l.textIsBracket[f],l.textIsOpenBracket[f],t);if(p)return p instanceof YC?null:p}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const r=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return r?r instanceof YC?r:[e,r]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,r=e.reversedRegex;let o=-1,a=0;const c=(l,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return YC.INSTANCE;const f=Hm.findPrevBracketInRange(r,l,d,h,u);if(!f)break;const p=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(p)?o++:e.isClose(p)&&o--,o===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&&!nw(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,r=e.forwardRegex;let o=1,a=0;const c=(d,h,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return YC.INSTANCE;const p=Hm.findNextBracketInRange(r,d,h,u,f);if(!p)break;const m=h.substring(p.startColumn-1,p.endColumn-1).toLowerCase();if(e.isOpen(m)?o++:e.isClose(m)&&o--,o===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;o--){const a=this.textModel.tokenization.getLineTokens(o),c=a.getCount(),l=this.textModel.getLineContent(o);let d=c-1,h=l.length,u=l.length;if(o===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,r=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let f=!0;for(;d>=0;d--){const p=a.getLanguageId(d);if(i!==p){if(n&&r&&f&&h!==u){const v=Hm.findPrevBracketInRange(n.reversedRegex,o,l,h,u);if(v)return this._toFoundBracket(r,v);f=!1}i=p,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,r=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const m=!!n&&!nw(a.getStandardTokenType(d));if(m)f?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(r&&n&&f&&h!==u){const v=Hm.findPrevBracketInRange(n.reversedRegex,o,l,h,u);if(v)return this._toFoundBracket(r,v)}f=m}if(r&&n&&f&&h!==u){const p=Hm.findPrevBracketInRange(n.reversedRegex,o,l,h,u);if(p)return this._toFoundBracket(r,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,r=null,o=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,r=this.languageConfigurationService.getLanguageConfiguration(n).brackets,o=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=yhe(t),r=this.textModel.getLineCount(),o=new Map;let a=[];const c=(f,p)=>{if(!o.has(f)){const m=[];for(let v=0,b=p?p.brackets.length:0;v{for(;;){if(n&&++l%100===0&&!n())return YC.INSTANCE;const w=Hm.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<=r;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 yhe(s){if(typeof s>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=s}}const yse=class yse{constructor(){this._searchCanceledBrand=void 0}};yse.INSTANCE=new yse;let YC=yse;function YG(s){return s instanceof YC?null:s}class ryt extends V{constructor(e){super(),this.textModel=e,this.colorProvider=new Dje,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(o=>({id:`bracket${o.range.toString()}-${o.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(o,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:o.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 Dje{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}`}}Ep((s,e)=>{const t=[eje,tje,ije,nje,sje,rje],i=new Dje;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${s.getColor(Gvt)}; }`);const n=t.map(r=>s.getColor(r)).filter(r=>!!r).filter(r=>!r.isTransparent());for(let r=0;r<30;r++){const o=n[r%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(r)} { color: ${o}; }`)}});var xl;(function(s){s[s.Resource=0]="Resource",s[s.Workspace=1]="Workspace"})(xl||(xl={}));class kje{constructor(e,t){this.resource=e,this.elements=t}}const ZF=class ZF{constructor(){this.id=ZF._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};ZF._ID=0,ZF.None=new ZF;let RY=ZF;const eO=class eO{constructor(){this.id=eO._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};eO._ID=0,eO.None=new eO;let j0=eO;function JG(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Ql{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} "${JG(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${JG(this.oldText)}")`:`(replace@${this.oldPosition} "${JG(this.oldText)}" with "${JG(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Ru(e,n,i),i+=4;for(let r=0;r0&&(this.changes=oyt(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=r}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Ru(e,t?t.length:0,i),i+=4,t)for(const n of t)Ru(e,n.selectionStartLineNumber,i),i+=4,Ru(e,n.selectionStartColumn,i),i+=4,Ru(e,n.positionLineNumber,i),i+=4,Ru(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Lu(e,t);t+=4;for(let r=0;rt.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 tl}append(e,t,i,n,r){this._data instanceof tl&&this._data.append(e,t,i,n,r)}close(){this._data instanceof tl&&(this._data=this._data.serialize())}open(){this._data instanceof tl||(this._data=tl.deserialize(this._data))}undo(){if(N.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof tl&&(this._data=this._data.serialize());const e=tl.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 tl&&(this._data=this._data.serialize());const e=tl.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof tl&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Fme{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=xl.Workspace,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const r=pP(n.resource);this._editStackElementsMap.set(r,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=pP(e);return this._editStackElementsMap.has(t)}setModel(e){const t=pP(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=pP(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,r){const o=pP(e.uri);this._editStackElementsMap.get(o).append(e,t,i,n,r)}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=pP(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(`${vi(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function Ome(s){return s.getEOL()===` `?Eh.LF:Eh.CRLF}function JC(s){return s?s instanceof Ije||s instanceof Fme:!1}class RLe{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);JC(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);JC(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(JC(i)&&i.canAppend(this._model))return i;const n=new Ije(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,[],Ome(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const r=this._getOrCreateEditStackElement(e,n),o=this._model.applyEdits(t,!0),a=RLe._computeCursorState(i,o),c=o.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),r.append(this._model,c.map(l=>l.textChange),Ome(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return bt(i),null}}}class ayt{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function cyt(s,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let r;for(r=0;r0&&a>0||c>0&&l>0)return;const d=Math.abs(a-l),h=Math.abs(o-c);if(d===0){n.spacesDiff=h,h>0&&0<=c-1&&c-10?n++:C>1&&r++,cyt(o,a,v,y,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const L=h.spacesDiff;L<=l&&d[L]++,o=v,a=y}let u=t;n!==r&&(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 Bme{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!==Ai)return MLe(this.right);let e=this;for(;e.parent!==Ai&&e.parent.left!==e;)e=e.parent;return e.parent===Ai?Ai:e.parent}prev(){if(this.left!==Ai)return Tje(this.left);let e=this;for(;e.parent!==Ai&&e.parent.right!==e;)e=e.parent;return e.parent===Ai?Ai:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}var Gn;(function(s){s[s.Black=0]="Black",s[s.Red=1]="Red"})(Gn||(Gn={}));const Ai=new Bme(null,Gn.Black);Ai.parent=Ai;Ai.left=Ai;Ai.right=Ai;Ai.color=Gn.Black;function MLe(s){for(;s.left!==Ai;)s=s.left;return s}function Tje(s){for(;s.right!==Ai;)s=s.right;return s}function NLe(s){return s===Ai?0:s.size_left+s.piece.length+NLe(s.right)}function PLe(s){return s===Ai?0:s.lf_left+s.piece.lineFeedCnt+PLe(s.right)}function Che(){Ai.parent=Ai}function S5(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!==Ai&&(t.left.parent=e),t.parent=e.parent,e.parent===Ai?s.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function A5(s,e){const t=e.left;e.left=t.right,t.right!==Ai&&(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===Ai?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function XG(s,e){let t,i;if(e.left===Ai?(i=e,t=i.right):e.right===Ai?(i=e,t=i.left):(i=MLe(e.right),t=i.right),i===s.root){s.root=t,t.color=Gn.Black,e.detach(),Che(),s.root.parent=Ai;return}const n=i.color===Gn.Red;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,lV(s,t)):(i.parent===e?t.parent=i:t.parent=i.parent,lV(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!==Ai&&(i.left.parent=i),i.right!==Ai&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,lV(s,i)),e.detach(),t.parent.left===t){const o=NLe(t),a=PLe(t);if(o!==t.parent.size_left||a!==t.parent.lf_left){const c=o-t.parent.size_left,l=a-t.parent.lf_left;t.parent.size_left=o,t.parent.lf_left=a,EC(s,t.parent,c,l)}}if(lV(s,t.parent),n){Che();return}let r;for(;t!==s.root&&t.color===Gn.Black;)t===t.parent.left?(r=t.parent.right,r.color===Gn.Red&&(r.color=Gn.Black,t.parent.color=Gn.Red,S5(s,t.parent),r=t.parent.right),r.left.color===Gn.Black&&r.right.color===Gn.Black?(r.color=Gn.Red,t=t.parent):(r.right.color===Gn.Black&&(r.left.color=Gn.Black,r.color=Gn.Red,A5(s,r),r=t.parent.right),r.color=t.parent.color,t.parent.color=Gn.Black,r.right.color=Gn.Black,S5(s,t.parent),t=s.root)):(r=t.parent.left,r.color===Gn.Red&&(r.color=Gn.Black,t.parent.color=Gn.Red,A5(s,t.parent),r=t.parent.left),r.left.color===Gn.Black&&r.right.color===Gn.Black?(r.color=Gn.Red,t=t.parent):(r.left.color===Gn.Black&&(r.right.color=Gn.Black,r.color=Gn.Red,S5(s,r),r=t.parent.left),r.color=t.parent.color,t.parent.color=Gn.Black,r.left.color=Gn.Black,A5(s,t.parent),t=s.root));t.color=Gn.Black,Che()}function a2e(s,e){for(lV(s,e);e!==s.root&&e.parent.color===Gn.Red;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===Gn.Red?(e.parent.color=Gn.Black,t.color=Gn.Black,e.parent.parent.color=Gn.Red,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,S5(s,e)),e.parent.color=Gn.Black,e.parent.parent.color=Gn.Red,A5(s,e.parent.parent))}else{const t=e.parent.parent.left;t.color===Gn.Red?(e.parent.color=Gn.Black,t.color=Gn.Black,e.parent.parent.color=Gn.Red,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,A5(s,e)),e.parent.color=Gn.Black,e.parent.parent.color=Gn.Red,S5(s,e.parent.parent))}s.root.color=Gn.Black}function EC(s,e,t,i){for(;e!==s.root&&e!==Ai;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function lV(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=NLe(e.left)-e.size_left,i=PLe(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 CC=65535;function Lje(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 lyt{constructor(e,t,i,n,r){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=r}}function LC(s,e=!0){const t=[0];let i=1;for(let n=0,r=s.length;n126)&&(o=!1)}const a=new lyt(Lje(s),i,n,r,o);return s.length=0,a}class vg{constructor(e,t,i,n,r){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=r}}class Y0{constructor(e,t){this.buffer=e,this.lineStarts=t}}class hyt{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Ai&&e.iterate(e.root,i=>(i!==Ai&&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 uyt{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 r of i)r!==null&&n.push(r);this._cache=n}}}class gyt{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Y0("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Ai,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let r=0,o=e.length;r0){e[r].lineStarts||(e[r].lineStarts=LC(e[r].buffer));const a=new vg(r+1,{line:0,column:0},{line:e[r].lineStarts.length-1,column:e[r].buffer.length-e[r].lineStarts[e[r].lineStarts.length-1]},e[r].lineStarts.length-1,e[r].buffer.length);this._buffers.push(e[r]),n=this.rbInsertRight(n,a)}this._searchCache=new uyt(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=CC,i=t-Math.floor(t/3),n=i*2;let r="",o=0;const a=[];if(this.iterate(this.root,c=>{const l=this.getNodeContent(c),d=l.length;if(o<=i||o+d0){const c=r.replace(/\r\n|\r|\n/g,e);a.push(new Y0(c,LC(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 hyt(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===Ai)return!0;const r=this.getNodeContent(n),o=r.length,a=e.nodeAt(t),c=e.nodeAt(t+o),l=e.getValueInRange2(a,c);return t+=o,r===l})}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==Ai;)if(n.left!==Ai&&n.lf_left+1>=e)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;const r=this.getAccumulatedValue(n,e-n.lf_left-2);return i+=r+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!==Ai;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const r=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+r.index,r.index===0){const o=this.getOffsetAt(i+1,1),a=n-o;return new re(i+1,a+1)}return new re(i+1,r.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Ai){const r=this.getOffsetAt(i+1,1),o=n-e-r;return new re(i+1,o+1)}else t=t.right;return new re(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),r=this.getValueInRange2(i,n);return t?t!==this._EOL||!this._EOLNormalized?r.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?r:r.replace(/\r\n|\r|\n/g,t):r}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,r=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let o=n.substring(r+e.remainder,r+i.piece.length);for(i=i.next();i!==Ai;){const a=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){o+=a.substring(c,c+t.remainder);break}else o+=a.substr(c,i.piece.length);i=i.next()}return o}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,r=>{if(r===Ai)return!0;const o=r.piece;let a=o.length;if(a===0)return!0;const c=this._buffers[o.bufferIndex].buffer,l=this._buffers[o.bufferIndex].lineStarts,d=o.start.line,h=o.end.line;let u=l[d]+o.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,r,b),A=b.line===r.line?b.column-r.column+n:b.column+1,L=A+v[0].length;if(h[d++]=z0(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 r=[];let o=0;const a=new aF(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,o,r),r;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(o=this.findMatchesInNode(f,a,u,C,d,this.positionInBuffer(f,y-w),t,i,n,o,r),o>=n)return r;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 o=this._findMatchesInLine(t,a,b,e.endLineNumber,v,o,r,i,n),r}if(o=this._findMatchesInLine(t,a,this.getLineContent(u).substr(v),u,v,o,r,i,n),o>=n)return r;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 o=this._findMatchesInLine(t,a,v,e.endLineNumber,m,o,r,i,n),r}const p=u===e.startLineNumber?e.startColumn:1;return o=this.findMatchesInNode(l.node,a,u,p,d,h,t,i,n,o,r),r}_findMatchesInLine(e,t,i,n,r,o,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||GTe(d,i,p,m,f))&&(a[o++]=new $8(new F(n,m+1+r,n,m+1+f+r),null),o>=l))return o;return o}let h;t.reset(0);do if(h=t.next(i),h&&(a[o++]=z0(new F(n,h.index+1+r,n,h.index+1+h[0].length+r),h,c),o>=l))return o;while(h);return o}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Ai){const{node:n,remainder:r,nodeStartOffset:o}=this.nodeAt(e),a=n.piece,c=a.bufferIndex,l=this.positionInBuffer(n,r);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&o+a.length===e&&t.lengthe){const d=[];let h=new vg(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,r)===10){const m={line:h.start.line+1,column:0};h=new vg(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,r-1)===13){const m=this.positionInBuffer(n,r-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;o--)r=this.rbInsertLeft(r,n[o]);this.validateCRLFWithPrevNode(r),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` @@ -101,7 +101,7 @@ Received: '{1}'.`,e,c4.getLexeme(t)),r=t.offset,o=c4.getLexeme(t);return this._p `:` `}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 r=0,o=i.length;r=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=dyt(this._tmpLineStarts,e);this.chunks.push(new Y0(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=R2(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=vKe(e)))}finish(e=!0){return this._finish(),new fyt(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=LC(e.buffer);e.lineStarts=t,this._previousChar===B.CarriageReturn&&this.cr++}}}class pyt{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),r=this._store.slice(e+t),o=myt(i,this._default);this._store=n.concat(o,r)}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 RC;const o=pd.findIndexInTokensArray(n,t),a=o>0?n[o-1<<1]:0,c=n[o<<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===RC)return e;if(e===RC)return t;if(e===null)return e;if(t===null)return null;const i=pS(e),n=pS(t),r=n.length>>>1,o=new Uint32Array(i.length+n.length);o.set(i,0);let a=i.length;const c=i[i.length-2];for(let l=0;l>>1;let o=pd.findIndexInTokensArray(n,t);o>0&&n[o-1<<1]===t&&o--;for(let a=o;a=this._tokens.length)){if(t<0&&i>=this._tokens.length){this._startLineNumber=0,this._tokens=[];return}if(t===i){this._tokens[t]=Bd.delete(this._tokens[t],e.startColumn-1,e.endColumn-1);return}if(t>=0)if(this._tokens[t]=Bd.deleteEnding(this._tokens[t],e.startColumn-1),i=this._tokens.length)){if(t===0){this._tokens[n]=Bd.insert(this._tokens[n],e.column-1,i);return}this._tokens[n]=Bd.deleteEnding(this._tokens[n],e.column-1),this._tokens[n]=Bd.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 MY(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 r=this._textModel.getLineContent(n.lineNumber),o=w4(this._languageIdCodec,i,this.tokenizationSupport,r,!0,n.startState);e.add(n.lineNumber,o.tokens),this.store.setEndState(n.lineNumber,o.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return no.Other;const n=this._textModel.getLanguageId(),r=this._textModel.getLineContent(e.lineNumber),o=r.substring(0,e.column-1)+t+r.substring(e.column-1),a=w4(this._languageIdCodec,n,this.tokenizationSupport,o,!0,i),c=new pd(a.tokens,o,this._languageIdCodec);if(c.getCount()===0)return no.Other;const l=c.findTokenIndexAtOffset(e.column-1);return c.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,r=e.column,o=this.getStartState(n);if(!o)return null;const a=this._textModel.getLineContent(n),c=a.substring(0,r-1)+i+a.substring(r-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),d=w4(this._languageIdCodec,l,this.tokenizationSupport,c,!0,o);return new pd(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]=kb(t.text);this.acceptChange(new mi(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}}class wyt{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 _i(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 _i(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new _i(i.start,e):this._ranges.splice(t,1,new _i(i.start,e),new _i(e+1,i.endExclusive))}}addRange(e){_i.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 w4(s,e,t,i,n,r){let o=null;if(t)try{o=t.tokenizeEncoded(i,n,r.clone())}catch(a){bt(a)}return o||(o=JTe(s.encodeLanguageId(e),r)),pd.convertToEndOffset(o.tokens,i.length),o}class yyt{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,U2(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 mi(e,t))}}class u3{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&&(r=jv.getLanguageId(n[1])!==e),!r)return RC}if(!n||n.length===0){const r=new Uint32Array(2);return r[0]=t,r[1]=c2e(e),r.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]=Bd.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Bd.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len)){if(t===0){this._lineTokens[n]=Bd.insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=Bd.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=Bd.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,r=e.length;n>>0}class FLe{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 r=t[0].getRange(),o=t[t.length-1].getRange();if(!r||!o)return e;i=e.plusRange(r).plusRange(o)}let n=null;for(let r=0,o=this._pieces.length;ri.endLineNumber){n=n||{index:r};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(r,1),r--,o--;continue}if(a.endLineNumberi.endLineNumber){n=n||{index:r};continue}const[c,l]=a.split(i);if(c.isEmpty()){n=n||{index:r};continue}l.isEmpty()||(this._pieces.splice(r,1,c,l),r++,o++,n=n||{index:r})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=K7(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=FLe._findFirstPieceWithLine(i,e),r=i[n].getLineTokens(e);if(!r)return t;const o=t.getCount(),a=r.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=r-1;else{for(;r>i&&e[r-1].startLineNumber<=t&&t<=e[r-1].endLineNumber;)r--;return r}}return i}acceptEdit(e,t,i,n,r){for(const o of this._pieces)o.acceptEdit(e,t,i,n,r)}}class NY extends hje{constructor(e,t,i,n,r,o){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=r,this._attachedViews=o,this._semanticTokens=new FLe(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 Cyt(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,r]=kb(t.text);this._semanticTokens.acceptEdit(t.range,i,n,r,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 Pi("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),r=n.findTokenIndexAtOffset(t.column-1),[o,a]=NY._findLanguageBoundaries(n,r),c=Pk(t.column,this.getLanguageConfiguration(n.getLanguageId(r)).getWordDefinition(),i.substring(o,a),o);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c;if(r>0&&o===t.column-1){const[l,d]=NY._findLanguageBoundaries(n,r-1),h=Pk(t.column,this.getLanguageConfiguration(n.getLanguageId(r-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 o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let r=e.getLineContent().length;for(let o=t,a=e.getCount();o{const o=this.getLanguageId();r.changedLanguages.indexOf(o)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(n.onDidChangeVisibleRanges(({view:r,state:o})=>{if(o){let a=this._attachedViewStates.get(r);a||(a=new Syt(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(r,a)),a.handleStateChange(o)}else this._attachedViewStates.deleteAndDispose(r)}))}resetTokenization(e=!0){this._tokens.flush(),this._debugBackgroundTokens?.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new Ume(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 r=La.get(this.getLanguageId());if(!r)return[null,null];let o;try{o=r.getInitialState()}catch(a){return bt(a),[null,null]}return[r,o]},[i,n]=t();if(i&&n?this._tokenizer=new vyt(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const r={setTokens:o=>{this.setTokens(o)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===lD.Completed)return;const o=lD.Completed;this._backgroundTokenizationState=o,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(o,a)=>{if(!this._tokenizer)return;const c=this._tokenizer.store.getFirstInvalidEndStateLineNumber();c!==null&&o>=c&&this._tokenizer?.store.setEndState(o,a)}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,r)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new yyt(this._tokenizer,r),this._defaultBackgroundTokenizer.handleChanges()),i?.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new u3(this._languageIdCodec),this._debugBackgroundStates=new Ume(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:o=>{this._debugBackgroundTokens?.setMultilineTokens(o,this._textModel)},backgroundTokenizationFinished(){},setEndState:(o,a)=>{this._debugBackgroundStates?.setEndState(o,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]=kb(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=mi.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 Wme,{heuristicTokens:n}=this._tokenizer.tokenizeHeuristically(i,e,t),r=this.setTokens(i.finalize());if(n)for(const o of r.changes)this._backgroundTokenizer.value?.requestTokens(o.fromLineNumber,o.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new Wme;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 no.Other;const n=this._textModel.validatePosition(new re(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 Syt extends V{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new ln(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){ns(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 iE=ae("undoRedoService");var c0;function Eae(s){const e=new h3;return e.acceptChunk(s),e.finish()}function OLe(s){return new Promise((e,t)=>{const i=new h3;let n=!1;NN(s,{onData:r=>{i.acceptChunk(typeof r=="string"?r:r.toString())},onError:r=>{n||(n=!0,t(r))},onEnd:()=>{n||(n=!0,e(i.finish()))}})})}function A6(s){const e=new h3;let t;for(;typeof(t=s.read())=="string";)e.acceptChunk(t);return e.finish()}function Vme(s,e){let t;return typeof s=="string"?t=Eae(s):Zgt(s)?t=A6(s):t=s,t.create(e)}let ZG=0;const Ayt=999,Eyt=1e4;class xyt{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 y4=()=>{throw new Error("Invalid change accessor")};var Tp;(function(s){s[s.Relaxed=0]="Relaxed",s[s.SurrogatePairs=1]="SurrogatePairs"})(Tp||(Tp={}));var tb;let E_=(tb=class extends V{static resolveOptions(e,t){if(t.detectIndentation){const i=o2e(e,t.tabSize,t.insertSpaces);return new Mq({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new Mq(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 Yo(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,r,o,a){super(),this._undoRedoService=r,this._languageService=o,this._languageConfigurationService=a,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Ryt(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 Myt),this._languageSelectionListener=this._register(new yn),this._deltaDecorationCallCnt=0,this._attachedViews=new Nyt,ZG++,this.id="$model"+ZG,this.isForSimpleWidget=i.isForSimpleWidget,typeof n>"u"||n===null?this._associatedResource=N.parse("inmemory://model/"+ZG):this._associatedResource=n,this._attachedEditorCount=0;const{textBuffer:c,disposable:l}=Vme(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=l,this._options=c0.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 nyt(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Lbt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new ryt(this)),this._tokenizationTextModelPart=new NY(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),gr.TextDefined);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>c0.LARGE_FILE_SIZE_THRESHOLD||h>c0.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>c0.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=u>c0._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=bKe(ZG),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new l2e,this._commandManager=new RLe(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 N1([],"",` +`&&(this._cr>0||this._crlf>0)))for(let r=0,o=i.length;r=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=dyt(this._tmpLineStarts,e);this.chunks.push(new Y0(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=R2(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=vKe(e)))}finish(e=!0){return this._finish(),new fyt(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=LC(e.buffer);e.lineStarts=t,this._previousChar===B.CarriageReturn&&this.cr++}}}class pyt{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),r=this._store.slice(e+t),o=myt(i,this._default);this._store=n.concat(o,r)}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 RC;const o=pd.findIndexInTokensArray(n,t),a=o>0?n[o-1<<1]:0,c=n[o<<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===RC)return e;if(e===RC)return t;if(e===null)return e;if(t===null)return null;const i=pS(e),n=pS(t),r=n.length>>>1,o=new Uint32Array(i.length+n.length);o.set(i,0);let a=i.length;const c=i[i.length-2];for(let l=0;l>>1;let o=pd.findIndexInTokensArray(n,t);o>0&&n[o-1<<1]===t&&o--;for(let a=o;a=this._tokens.length)){if(t<0&&i>=this._tokens.length){this._startLineNumber=0,this._tokens=[];return}if(t===i){this._tokens[t]=Bd.delete(this._tokens[t],e.startColumn-1,e.endColumn-1);return}if(t>=0)if(this._tokens[t]=Bd.deleteEnding(this._tokens[t],e.startColumn-1),i=this._tokens.length)){if(t===0){this._tokens[n]=Bd.insert(this._tokens[n],e.column-1,i);return}this._tokens[n]=Bd.deleteEnding(this._tokens[n],e.column-1),this._tokens[n]=Bd.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 MY(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 r=this._textModel.getLineContent(n.lineNumber),o=w4(this._languageIdCodec,i,this.tokenizationSupport,r,!0,n.startState);e.add(n.lineNumber,o.tokens),this.store.setEndState(n.lineNumber,o.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return no.Other;const n=this._textModel.getLanguageId(),r=this._textModel.getLineContent(e.lineNumber),o=r.substring(0,e.column-1)+t+r.substring(e.column-1),a=w4(this._languageIdCodec,n,this.tokenizationSupport,o,!0,i),c=new pd(a.tokens,o,this._languageIdCodec);if(c.getCount()===0)return no.Other;const l=c.findTokenIndexAtOffset(e.column-1);return c.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,r=e.column,o=this.getStartState(n);if(!o)return null;const a=this._textModel.getLineContent(n),c=a.substring(0,r-1)+i+a.substring(r-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),d=w4(this._languageIdCodec,l,this.tokenizationSupport,c,!0,o);return new pd(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]=kb(t.text);this.acceptChange(new mi(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}}class wyt{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 _i(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 _i(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new _i(i.start,e):this._ranges.splice(t,1,new _i(i.start,e),new _i(e+1,i.endExclusive))}}addRange(e){_i.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 w4(s,e,t,i,n,r){let o=null;if(t)try{o=t.tokenizeEncoded(i,n,r.clone())}catch(a){bt(a)}return o||(o=JTe(s.encodeLanguageId(e),r)),pd.convertToEndOffset(o.tokens,i.length),o}class yyt{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,U2(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 mi(e,t))}}class u3{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&&(r=jv.getLanguageId(n[1])!==e),!r)return RC}if(!n||n.length===0){const r=new Uint32Array(2);return r[0]=t,r[1]=c2e(e),r.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]=Bd.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Bd.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len)){if(t===0){this._lineTokens[n]=Bd.insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=Bd.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=Bd.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,r=e.length;n>>0}class FLe{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 r=t[0].getRange(),o=t[t.length-1].getRange();if(!r||!o)return e;i=e.plusRange(r).plusRange(o)}let n=null;for(let r=0,o=this._pieces.length;ri.endLineNumber){n=n||{index:r};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(r,1),r--,o--;continue}if(a.endLineNumberi.endLineNumber){n=n||{index:r};continue}const[c,l]=a.split(i);if(c.isEmpty()){n=n||{index:r};continue}l.isEmpty()||(this._pieces.splice(r,1,c,l),r++,o++,n=n||{index:r})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=K7(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=FLe._findFirstPieceWithLine(i,e),r=i[n].getLineTokens(e);if(!r)return t;const o=t.getCount(),a=r.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=r-1;else{for(;r>i&&e[r-1].startLineNumber<=t&&t<=e[r-1].endLineNumber;)r--;return r}}return i}acceptEdit(e,t,i,n,r){for(const o of this._pieces)o.acceptEdit(e,t,i,n,r)}}class NY extends hje{constructor(e,t,i,n,r,o){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=r,this._attachedViews=o,this._semanticTokens=new FLe(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 Cyt(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,r]=kb(t.text);this._semanticTokens.acceptEdit(t.range,i,n,r,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 Pi("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),r=n.findTokenIndexAtOffset(t.column-1),[o,a]=NY._findLanguageBoundaries(n,r),c=Pk(t.column,this.getLanguageConfiguration(n.getLanguageId(r)).getWordDefinition(),i.substring(o,a),o);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c;if(r>0&&o===t.column-1){const[l,d]=NY._findLanguageBoundaries(n,r-1),h=Pk(t.column,this.getLanguageConfiguration(n.getLanguageId(r-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 o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let r=e.getLineContent().length;for(let o=t,a=e.getCount();o{const o=this.getLanguageId();r.changedLanguages.indexOf(o)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(n.onDidChangeVisibleRanges(({view:r,state:o})=>{if(o){let a=this._attachedViewStates.get(r);a||(a=new Syt(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(r,a)),a.handleStateChange(o)}else this._attachedViewStates.deleteAndDispose(r)}))}resetTokenization(e=!0){this._tokens.flush(),this._debugBackgroundTokens?.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new Ume(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 r=La.get(this.getLanguageId());if(!r)return[null,null];let o;try{o=r.getInitialState()}catch(a){return bt(a),[null,null]}return[r,o]},[i,n]=t();if(i&&n?this._tokenizer=new vyt(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const r={setTokens:o=>{this.setTokens(o)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===lD.Completed)return;const o=lD.Completed;this._backgroundTokenizationState=o,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(o,a)=>{if(!this._tokenizer)return;const c=this._tokenizer.store.getFirstInvalidEndStateLineNumber();c!==null&&o>=c&&this._tokenizer?.store.setEndState(o,a)}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,r)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new yyt(this._tokenizer,r),this._defaultBackgroundTokenizer.handleChanges()),i?.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new u3(this._languageIdCodec),this._debugBackgroundStates=new Ume(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:o=>{this._debugBackgroundTokens?.setMultilineTokens(o,this._textModel)},backgroundTokenizationFinished(){},setEndState:(o,a)=>{this._debugBackgroundStates?.setEndState(o,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]=kb(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=mi.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 Wme,{heuristicTokens:n}=this._tokenizer.tokenizeHeuristically(i,e,t),r=this.setTokens(i.finalize());if(n)for(const o of r.changes)this._backgroundTokenizer.value?.requestTokens(o.fromLineNumber,o.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new Wme;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 no.Other;const n=this._textModel.validatePosition(new re(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 Syt extends V{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new ln(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){ns(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 iE=ae("undoRedoService");var c0;function Eae(s){const e=new h3;return e.acceptChunk(s),e.finish()}function OLe(s){return new Promise((e,t)=>{const i=new h3;let n=!1;NN(s,{onData:r=>{i.acceptChunk(typeof r=="string"?r:r.toString())},onError:r=>{n||(n=!0,t(r))},onEnd:()=>{n||(n=!0,e(i.finish()))}})})}function A6(s){const e=new h3;let t;for(;typeof(t=s.read())=="string";)e.acceptChunk(t);return e.finish()}function Vme(s,e){let t;return typeof s=="string"?t=Eae(s):Zgt(s)?t=A6(s):t=s,t.create(e)}let ZG=0;const Ayt=999,Eyt=1e4;class xyt{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 y4=()=>{throw new Error("Invalid change accessor")};var Tp;(function(s){s[s.Relaxed=0]="Relaxed",s[s.SurrogatePairs=1]="SurrogatePairs"})(Tp||(Tp={}));var tb;let E_=(tb=class extends V{static resolveOptions(e,t){if(t.detectIndentation){const i=o2e(e,t.tabSize,t.insertSpaces);return new Mq({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new Mq(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 Yo(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,r,o,a){super(),this._undoRedoService=r,this._languageService=o,this._languageConfigurationService=a,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Ryt(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 Myt),this._languageSelectionListener=this._register(new yn),this._deltaDecorationCallCnt=0,this._attachedViews=new Nyt,ZG++,this.id="$model"+ZG,this.isForSimpleWidget=i.isForSimpleWidget,typeof n>"u"||n===null?this._associatedResource=N.parse("inmemory://model/"+ZG):this._associatedResource=n,this._attachedEditorCount=0;const{textBuffer:c,disposable:l}=Vme(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=l,this._options=c0.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 nyt(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Lbt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new ryt(this)),this._tokenizationTextModelPart=new NY(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),gr.TextDefined);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>c0.LARGE_FILE_SIZE_THRESHOLD||h>c0.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>c0.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=u>c0._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=bKe(ZG),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new l2e,this._commandManager=new RLe(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 N1([],"",` `,!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 Pi("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 RT(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Fi();const{textBuffer:t,disposable:i}=Vme(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,r,o,a,c){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:c,versionId:this.getVersionId(),isUndoing:r,isRedoing:o,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),r=this.getLineCount(),o=this.getLineMaxColumn(r);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new l2e,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new $O([new mwt],this._versionId,!1,!1),this._createContentChanged2(new F(1,1,r,o),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===Eh.CRLF?`\r `:` `;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),r=this.getLineCount(),o=this.getLineMaxColumn(r);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new $O([new bwt],this._versionId,!1,!1),this._createContentChanged2(new F(1,1,r,o),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 r=this._buffer.getLineLength(n);r>=Eyt?t+=r:e+=r}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,r=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new Mq({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:r,bracketPairColorizationOptions:o});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=o2e(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),gLe(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(_Ke.source,!1,!0,!1,null,!1,Vn.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,Tp.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 Pi("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 xyt(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=gr.TextDefined){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=gr.TextDefined){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=gr.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 Pi("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Pi("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Pi("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` @@ -110,14 +110,14 @@ Received: '{1}'.`,e,c4.getLexeme(t)),r=t.offset,o=c4.getLexeme(t);return this._p `)<0){const l=new jC(e,i,n,r).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,o,1);return UG.findNextMatch(this,new jC(e,i,n,r),a,o),u.length>0||(h=new F(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,l,o,1),u.length>0)?u[0]:null}return UG.findNextMatch(this,new jC(e,i,n,r),a,o)}findPreviousMatch(e,t,i,n,r,o){this._assertNotDisposed();const a=this.validatePosition(t);return UG.findPreviousMatch(this,new jC(e,i,n,r),a,o)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` `?Eh.LF:Eh.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 she?e:new she(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 o=!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){o=!1;break}}if(o)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 F(l,1,l,d);t.push(new she(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 r=e.map(o=>{const a=this.getPositionAt(o.newPosition),c=this.getPositionAt(o.newEnd);return{range:new F(a.lineNumber,a.column,c.lineNumber,c.column),text:o.oldText}});this._applyUndoRedoEdits(r,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const r=e.map(o=>{const a=this.getPositionAt(o.oldPosition),c=this.getPositionAt(o.oldEnd);return{range:new F(a.lineNumber,a.column,c.lineNumber,c.column),text:o.newText}});this._applyUndoRedoEdits(r,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,r,o){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(r)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(o),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),r=this._buffer.getLineCount(),o=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,o.length!==0){for(let l=0,d=o.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 qBe(z,this.getLineContent(G),Y))}if(bBe.lineNumberBe.lineNumber===De)}a.push(new vwt(z+1,f+v,ne,j))}c+=w}this._emitContentChangedEvent(new $O(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:o,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 qBe(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new fje(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:(r,o)=>this._deltaDecorationsImpl(e,[],[{range:r,options:o}])[0],changeDecoration:(r,o)=>{this._changeDecorationImpl(r,o)},changeDecorationOptions:(r,o)=>{this._changeDecorationOptionsImpl(r,h2e(o))},removeDecoration:r=>{this._deltaDecorationsImpl(e,[r],[])},deltaDecorations:(r,o)=>r.length===0&&o.length===0?[]:this._deltaDecorationsImpl(e,r,o)};let n=null;try{n=t(i)}catch(r){bt(r)}return i.addDecoration=y4,i.changeDecoration=y4,i.changeDecorationOptions=y4,i.removeDecoration=y4,i.deltaDecorations=y4,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."),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 n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:d2e[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const r=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),a=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),o,a,r),n.setOptions(d2e[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,r=!1){const o=this.getLineCount(),a=Math.min(o,Math.max(1,e)),c=Math.min(o,Math.max(1,t)),l=this.getLineMaxColumn(c),d=new F(a,1,c,l),h=this._getDecorationsInRange(d,i,n,r);return dfe(h,this._decorationProvider.getDecorationsInRange(d,i,n)),h}getDecorationsInRange(e,t=0,i=!1,n=!1,r=!1){const o=this.validateRange(e),a=this._getDecorationsInRange(o,t,i,r);return dfe(a,this._decorationProvider.getDecorationsInRange(o,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 F_.fromDecorations(n).filter(r=>r.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 r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,r,o,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),r=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),o=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),r,o,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),r=!!(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 o=n!==r,a=kyt(t)!==Vq(i);o||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,n=!1){const r=this.getVersionId(),o=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 Dyt(this.getLineContent(e))+1}},c0=tb,tb._MODEL_SYNC_LIMIT=50*1024*1024,tb.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024,tb.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3,tb.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024,tb.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:$d.tabSize,indentSize:$d.indentSize,insertSpaces:$d.insertSpaces,detectIndentation:!1,defaultEOL:Db.LF,trimAutoWhitespace:$d.trimAutoWhitespace,largeFileOptimizations:$d.largeFileOptimizations,bracketPairColorizationOptions:$d.bracketPairColorizationOptions},tb);E_=c0=D([_(4,iE),_(5,Di),_(6,zs)],E_);function Dyt(s){let e=0;for(const t of s)if(t===" "||t===" ")e++;else break;return e}function She(s){return!!(s.options.overviewRuler&&s.options.overviewRuler.color)}function kyt(s){return!!s.after||!!s.before}function Vq(s){return!!s.options.after||!!s.options.before}class l2e{constructor(){this._decorationsTree0=new _he,this._decorationsTree1=new _he,this._injectedTextDecorationsTree=new _he}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,r,o){const a=e.getVersionId(),c=this._intervalSearch(t,i,n,r,a,o);return this._ensureNodesHaveRanges(e,c)}_intervalSearch(e,t,i,n,r,o){const a=this._decorationsTree0.intervalSearch(e,t,i,n,r,o),c=this._decorationsTree1.intervalSearch(e,t,i,n,r,o),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,r,o);return a.concat(c).concat(l)}getInjectedTextInInterval(e,t,i,n){const r=e.getVersionId(),o=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,r,!1);return this._ensureNodesHaveRanges(e,o).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(r=>r.options.showIfCollapsed||!r.range.isEmpty())}getAll(e,t,i,n,r){const o=e.getVersionId(),a=this._search(t,i,n,o,r);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,n,r){if(i)return this._decorationsTree1.search(e,t,n,r);{const o=this._decorationsTree0.search(e,t,n,r),a=this._decorationsTree1.search(e,t,n,r),c=this._injectedTextDecorationsTree.search(e,t,n,r);return o.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){Vq(e)?this._injectedTextDecorationsTree.insert(e):She(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Vq(e)?this._injectedTextDecorationsTree.delete(e):She(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){Vq(e)?this._injectedTextDecorationsTree.resolveNode(e,t):She(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 Yb(s){return s.replace(/[^a-z0-9\-_]/gi," ")}class Rje{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Iyt extends Rje{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Il.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??j_.Center,this.persistLane=e?.persistLane}}class Lyt extends Rje{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 Gk{static from(e){return e instanceof Gk?e:new Gk(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?Yb(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||si.AlwaysGrowsWhenTypingAtEdges,this.zIndex=e.zIndex||0,this.className=e.className?Yb(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 Iyt(e.overviewRuler):null,this.minimap=e.minimap?new Lyt(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Tyt(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Yb(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Yb(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?Yb(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?Ict(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Yb(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Yb(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Yb(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Yb(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Yb(e.afterContentClassName):null,this.after=e.after?Gk.from(e.after):null,this.before=e.before?Gk.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1}}Kt.EMPTY=Kt.register({description:"empty"});const d2e=[Kt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:si.AlwaysGrowsWhenTypingAtEdges}),Kt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:si.NeverGrowsWhenTypingAtEdges}),Kt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:si.GrowsOnlyWhenTypingBefore}),Kt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:si.GrowsOnlyWhenTypingAfter})];function h2e(s){return s instanceof Kt?s:Kt.createDynamic(s)}class Ryt 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 Myt 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 Nyt{constructor(){this._onDidChangeVisibleRanges=new I,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Pyt(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 Pyt{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(n=>new mi(n.startLineNumber,n.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class BLe{static create(e){return new BLe(e.get(x.wordWrapBreakBeforeCharacters),e.get(x.wordWrapBreakAfterCharacters))}constructor(e,t){this.classifier=new Fyt(e,t)}createLineBreaksComputer(e,t,i,n,r){const o=[],a=[],c=[];return{addRequest:(l,d,h)=>{o.push(l),a.push(d),c.push(h)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let h=0,u=o.length;h=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?_h.BREAK_IDEOGRAPHIC:this._map.get(e)||this._defaultValue}}let zme=[],$me=[];function Oyt(s,e,t,i,n,r,o,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=Mje(t,i,n,r,o),f=n-u,p=zme,m=$me;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?_h.NONE:s.get(ne),De=!0;for(let Be=L;Beb&&Gme(ne,ge,Ne,dt,l)&&(P=Ct,R=j),j+=Dt,j>y){Ct>b?(z=Ct,G=j-Dt):(z=Be+1,G=j),j-R>f&&(P=0),De=!1;break}ne=Ne,ge=dt}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 Be=L-1;Be>=b;Be--){const Ct=Be+1,Ne=t.charCodeAt(Be);if(Ne===B.Tab){De=!0;break}let dt,Dt;if(wM(Ne)?(Be--,dt=_h.NONE,Dt=2):(dt=s.get(Ne),Dt=Fk(Ne)?r:1),j<=y){if(z===0&&(z=Ct,G=j),j<=y-f)break;if(Gme(Ne,dt,ne,ge,l)){P=Ct,R=j;break}}j-=Dt,ne=Ne,ge=dt}if(P!==0){const Be=f-(G-R);if(Be<=i){const Ct=t.charCodeAt(z);let Ne;Fc(Ct)?Ne=2:Ne=E5(Ct,G,i,r),Be-Ne<0&&(P=0)}}if(De){A--;continue}}if(P===0&&(P=z,R=G),P<=b){const j=t.charCodeAt(b);Fc(j)?(P=b+2,R=w+2):(P=b+1,R=w+E5(j,w,i,r))}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,zme=e.breakOffsets,$me=e.breakOffsetsVisibleColumn,e.breakOffsets=p,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=u,e)}function Byt(s,e,t,i,n,r,o,a){const c=F_.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 w5(d,l,[c.length],[],0):null;const h=c.length;if(h<=1)return l?new w5(d,l,[c.length],[],0):null;const u=a==="keepAll",f=Mje(c,i,n,r,o),p=n-f,m=[],v=[];let b=0,w=0,y=0,C=n,A=c.charCodeAt(0),L=s.get(A),k=E5(A,0,i,r),P=1;Fc(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 w5(d,l,m,v,f))}function E5(s,e,t,i){return s===B.Tab?t-e%t:Fk(s)||s<32?i:1}function u2e(s,e){return e-s%e}function Gme(s,e,t,i,n){return t!==B.Space&&(e===_h.BREAK_AFTER&&i!==_h.BREAK_AFTER||e!==_h.BREAK_BEFORE&&i===_h.BREAK_BEFORE||!n&&e===_h.BREAK_IDEOGRAPHIC&&i!==_h.BREAK_AFTER||!n&&i===_h.BREAK_IDEOGRAPHIC&&e!==_h.BREAK_BEFORE)}function Mje(s,e,t,i,n){let r=0;if(n!==Fu.None){const o=Th(s);if(o!==-1){for(let c=0;ct&&(r=0)}}return r}class PY{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new xl(new F(1,1,1,1),$h.Simple,0,new re(1,1),0),new xl(new F(1,1,1,1),$h.Simple,0,new re(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,si.AlwaysGrowsWhenTypingAtEdges))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,si.AlwaysGrowsWhenTypingAtEdges)}asCursorState(){return new Mn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?ht.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):ht.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,Ir.None)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),r=t.selectionStart.getEndPosition(),o=e.normalizePosition(i,Ir.None),a=this._validatePositionWithCache(e,n,i,o),c=this._validatePositionWithCache(e,r,n,a);return i.equals(o)&&n.equals(a)&&r.equals(c)?t:new xl(F.fromPositions(a,c),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-a.column,o,t.leftoverVisibleColumns+i.column-o.column)}_setState(e,t,i){if(i&&(i=PY._validateViewState(e.viewModel,i)),t){const n=e.model.validateRange(t.selectionStart),r=t.selectionStart.equalsRange(n)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),a=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new xl(n,t.selectionStartKind,r,o,a)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),r=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new xl(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,r,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),r=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new xl(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new re(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),r=e.coordinatesConverter.convertModelPositionToViewPosition(new re(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),o=new F(n.lineNumber,n.column,r.lineNumber,r.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new xl(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class g2e{constructor(e){this.context=e,this.cursors=[new PY(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 xat(this.cursors,Sc(e=>e.viewState.position,re.compare)).viewState.position}getBottomMostViewPosition(){return Eat(this.cursors,Sc(e=>e.viewState.position,re.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(Mn.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 r=0;r=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 f2e{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class Wyt 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 Hyt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}var ma;(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"})(ma||(ma={}));class WLe{constructor(e,t,i,n){this.kind=ma.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 WLe(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class HLe{constructor(e,t){this.kind=ma.FocusChanged,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new HLe(this.oldHasFocus,e.hasFocus)}}class ULe{constructor(e,t,i,n,r,o,a,c){this.kind=ma.ScrollChanged,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=r,this.scrollLeft=o,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 ULe(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Uyt{constructor(){this.kind=ma.ViewZonesChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Vyt{constructor(){this.kind=ma.HiddenAreasChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class FY{constructor(e,t,i,n,r,o,a){this.kind=ma.CursorStateChanged,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=r,this.reason=o,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 r=0;r0){const e=this._cursors.getSelections();for(let t=0;to&&(n=n.slice(0,o),r=!0);const a=x5.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,r)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,r,o){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 f5(t,i,c,l,n,r,o))}revealPrimary(e,t,i,n,r,o){const c=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new f5(t,i,null,c,n,r,o))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const r=Mn.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?Bi.Undo:i.isRedoing?Bi.Redo:Bi.RecoverFromMarkers,r)&&this.revealAll(e,"modelChange",!1,vs.Simple,!0,_t.Smooth)}else{const r=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",Bi.RecoverFromMarkers,Mn.fromModelSelections(r))}}}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,Mn.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,r){const o=x5.from(this._model,this);if(o.equals(n))return!1;const a=this._cursors.getSelections(),c=this._cursors.getViewSelections();if(e.emitViewEvent(new d_t(c,a,i)),!n||n.cursorState.length!==o.cursorState.length||o.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 FY(l,a,d,o.modelVersionId,t||"keyboard",i,r))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i{const a=this.getPositionAt(o.newPosition),c=this.getPositionAt(o.newEnd);return{range:new F(a.lineNumber,a.column,c.lineNumber,c.column),text:o.oldText}});this._applyUndoRedoEdits(r,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const r=e.map(o=>{const a=this.getPositionAt(o.oldPosition),c=this.getPositionAt(o.oldEnd);return{range:new F(a.lineNumber,a.column,c.lineNumber,c.column),text:o.newText}});this._applyUndoRedoEdits(r,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,r,o){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(r)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(o),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),r=this._buffer.getLineCount(),o=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,o.length!==0){for(let l=0,d=o.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 qBe(z,this.getLineContent(G),Y))}if(bBe.lineNumberBe.lineNumber===De)}a.push(new vwt(z+1,f+v,ne,j))}c+=w}this._emitContentChangedEvent(new $O(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:o,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 qBe(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new fje(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:(r,o)=>this._deltaDecorationsImpl(e,[],[{range:r,options:o}])[0],changeDecoration:(r,o)=>{this._changeDecorationImpl(r,o)},changeDecorationOptions:(r,o)=>{this._changeDecorationOptionsImpl(r,h2e(o))},removeDecoration:r=>{this._deltaDecorationsImpl(e,[r],[])},deltaDecorations:(r,o)=>r.length===0&&o.length===0?[]:this._deltaDecorationsImpl(e,r,o)};let n=null;try{n=t(i)}catch(r){bt(r)}return i.addDecoration=y4,i.changeDecoration=y4,i.changeDecorationOptions=y4,i.removeDecoration=y4,i.deltaDecorations=y4,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."),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 n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:d2e[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const r=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),a=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),o,a,r),n.setOptions(d2e[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,r=!1){const o=this.getLineCount(),a=Math.min(o,Math.max(1,e)),c=Math.min(o,Math.max(1,t)),l=this.getLineMaxColumn(c),d=new F(a,1,c,l),h=this._getDecorationsInRange(d,i,n,r);return dfe(h,this._decorationProvider.getDecorationsInRange(d,i,n)),h}getDecorationsInRange(e,t=0,i=!1,n=!1,r=!1){const o=this.validateRange(e),a=this._getDecorationsInRange(o,t,i,r);return dfe(a,this._decorationProvider.getDecorationsInRange(o,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 F_.fromDecorations(n).filter(r=>r.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 r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,r,o,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),r=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),o=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),r,o,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),r=!!(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 o=n!==r,a=kyt(t)!==Vq(i);o||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,n=!1){const r=this.getVersionId(),o=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 Dyt(this.getLineContent(e))+1}},c0=tb,tb._MODEL_SYNC_LIMIT=50*1024*1024,tb.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024,tb.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3,tb.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024,tb.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:$d.tabSize,indentSize:$d.indentSize,insertSpaces:$d.insertSpaces,detectIndentation:!1,defaultEOL:Db.LF,trimAutoWhitespace:$d.trimAutoWhitespace,largeFileOptimizations:$d.largeFileOptimizations,bracketPairColorizationOptions:$d.bracketPairColorizationOptions},tb);E_=c0=D([_(4,iE),_(5,Di),_(6,zs)],E_);function Dyt(s){let e=0;for(const t of s)if(t===" "||t===" ")e++;else break;return e}function She(s){return!!(s.options.overviewRuler&&s.options.overviewRuler.color)}function kyt(s){return!!s.after||!!s.before}function Vq(s){return!!s.options.after||!!s.options.before}class l2e{constructor(){this._decorationsTree0=new _he,this._decorationsTree1=new _he,this._injectedTextDecorationsTree=new _he}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,r,o){const a=e.getVersionId(),c=this._intervalSearch(t,i,n,r,a,o);return this._ensureNodesHaveRanges(e,c)}_intervalSearch(e,t,i,n,r,o){const a=this._decorationsTree0.intervalSearch(e,t,i,n,r,o),c=this._decorationsTree1.intervalSearch(e,t,i,n,r,o),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,r,o);return a.concat(c).concat(l)}getInjectedTextInInterval(e,t,i,n){const r=e.getVersionId(),o=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,r,!1);return this._ensureNodesHaveRanges(e,o).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(r=>r.options.showIfCollapsed||!r.range.isEmpty())}getAll(e,t,i,n,r){const o=e.getVersionId(),a=this._search(t,i,n,o,r);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,n,r){if(i)return this._decorationsTree1.search(e,t,n,r);{const o=this._decorationsTree0.search(e,t,n,r),a=this._decorationsTree1.search(e,t,n,r),c=this._injectedTextDecorationsTree.search(e,t,n,r);return o.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){Vq(e)?this._injectedTextDecorationsTree.insert(e):She(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Vq(e)?this._injectedTextDecorationsTree.delete(e):She(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){Vq(e)?this._injectedTextDecorationsTree.resolveNode(e,t):She(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 Yb(s){return s.replace(/[^a-z0-9\-_]/gi," ")}class Rje{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Iyt extends Rje{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Tl.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??j_.Center,this.persistLane=e?.persistLane}}class Lyt extends Rje{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 Gk{static from(e){return e instanceof Gk?e:new Gk(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?Yb(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||si.AlwaysGrowsWhenTypingAtEdges,this.zIndex=e.zIndex||0,this.className=e.className?Yb(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 Iyt(e.overviewRuler):null,this.minimap=e.minimap?new Lyt(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Tyt(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Yb(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Yb(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?Yb(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?Ict(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Yb(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Yb(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Yb(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Yb(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Yb(e.afterContentClassName):null,this.after=e.after?Gk.from(e.after):null,this.before=e.before?Gk.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1}}Kt.EMPTY=Kt.register({description:"empty"});const d2e=[Kt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:si.AlwaysGrowsWhenTypingAtEdges}),Kt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:si.NeverGrowsWhenTypingAtEdges}),Kt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:si.GrowsOnlyWhenTypingBefore}),Kt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:si.GrowsOnlyWhenTypingAfter})];function h2e(s){return s instanceof Kt?s:Kt.createDynamic(s)}class Ryt 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 Myt 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 Nyt{constructor(){this._onDidChangeVisibleRanges=new I,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Pyt(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 Pyt{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(n=>new mi(n.startLineNumber,n.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class BLe{static create(e){return new BLe(e.get(x.wordWrapBreakBeforeCharacters),e.get(x.wordWrapBreakAfterCharacters))}constructor(e,t){this.classifier=new Fyt(e,t)}createLineBreaksComputer(e,t,i,n,r){const o=[],a=[],c=[];return{addRequest:(l,d,h)=>{o.push(l),a.push(d),c.push(h)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let h=0,u=o.length;h=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?_h.BREAK_IDEOGRAPHIC:this._map.get(e)||this._defaultValue}}let zme=[],$me=[];function Oyt(s,e,t,i,n,r,o,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=Mje(t,i,n,r,o),f=n-u,p=zme,m=$me;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?_h.NONE:s.get(ne),De=!0;for(let Be=L;Beb&&Gme(ne,ge,Ne,dt,l)&&(P=Ct,R=j),j+=Dt,j>y){Ct>b?(z=Ct,G=j-Dt):(z=Be+1,G=j),j-R>f&&(P=0),De=!1;break}ne=Ne,ge=dt}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 Be=L-1;Be>=b;Be--){const Ct=Be+1,Ne=t.charCodeAt(Be);if(Ne===B.Tab){De=!0;break}let dt,Dt;if(wM(Ne)?(Be--,dt=_h.NONE,Dt=2):(dt=s.get(Ne),Dt=Fk(Ne)?r:1),j<=y){if(z===0&&(z=Ct,G=j),j<=y-f)break;if(Gme(Ne,dt,ne,ge,l)){P=Ct,R=j;break}}j-=Dt,ne=Ne,ge=dt}if(P!==0){const Be=f-(G-R);if(Be<=i){const Ct=t.charCodeAt(z);let Ne;Fc(Ct)?Ne=2:Ne=E5(Ct,G,i,r),Be-Ne<0&&(P=0)}}if(De){A--;continue}}if(P===0&&(P=z,R=G),P<=b){const j=t.charCodeAt(b);Fc(j)?(P=b+2,R=w+2):(P=b+1,R=w+E5(j,w,i,r))}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,zme=e.breakOffsets,$me=e.breakOffsetsVisibleColumn,e.breakOffsets=p,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=u,e)}function Byt(s,e,t,i,n,r,o,a){const c=F_.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 w5(d,l,[c.length],[],0):null;const h=c.length;if(h<=1)return l?new w5(d,l,[c.length],[],0):null;const u=a==="keepAll",f=Mje(c,i,n,r,o),p=n-f,m=[],v=[];let b=0,w=0,y=0,C=n,A=c.charCodeAt(0),L=s.get(A),k=E5(A,0,i,r),P=1;Fc(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 w5(d,l,m,v,f))}function E5(s,e,t,i){return s===B.Tab?t-e%t:Fk(s)||s<32?i:1}function u2e(s,e){return e-s%e}function Gme(s,e,t,i,n){return t!==B.Space&&(e===_h.BREAK_AFTER&&i!==_h.BREAK_AFTER||e!==_h.BREAK_BEFORE&&i===_h.BREAK_BEFORE||!n&&e===_h.BREAK_IDEOGRAPHIC&&i!==_h.BREAK_AFTER||!n&&i===_h.BREAK_IDEOGRAPHIC&&e!==_h.BREAK_BEFORE)}function Mje(s,e,t,i,n){let r=0;if(n!==Fu.None){const o=Th(s);if(o!==-1){for(let c=0;ct&&(r=0)}}return r}class PY{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Dl(new F(1,1,1,1),$h.Simple,0,new re(1,1),0),new Dl(new F(1,1,1,1),$h.Simple,0,new re(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,si.AlwaysGrowsWhenTypingAtEdges))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,si.AlwaysGrowsWhenTypingAtEdges)}asCursorState(){return new Mn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?ht.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):ht.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,Ir.None)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),r=t.selectionStart.getEndPosition(),o=e.normalizePosition(i,Ir.None),a=this._validatePositionWithCache(e,n,i,o),c=this._validatePositionWithCache(e,r,n,a);return i.equals(o)&&n.equals(a)&&r.equals(c)?t:new Dl(F.fromPositions(a,c),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-a.column,o,t.leftoverVisibleColumns+i.column-o.column)}_setState(e,t,i){if(i&&(i=PY._validateViewState(e.viewModel,i)),t){const n=e.model.validateRange(t.selectionStart),r=t.selectionStart.equalsRange(n)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),a=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new Dl(n,t.selectionStartKind,r,o,a)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),r=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new Dl(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,r,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),r=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new Dl(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new re(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),r=e.coordinatesConverter.convertModelPositionToViewPosition(new re(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),o=new F(n.lineNumber,n.column,r.lineNumber,r.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new Dl(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class g2e{constructor(e){this.context=e,this.cursors=[new PY(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 xat(this.cursors,Sc(e=>e.viewState.position,re.compare)).viewState.position}getBottomMostViewPosition(){return Eat(this.cursors,Sc(e=>e.viewState.position,re.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(Mn.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 r=0;r=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 f2e{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class Wyt 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 Hyt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}var ma;(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"})(ma||(ma={}));class WLe{constructor(e,t,i,n){this.kind=ma.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 WLe(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class HLe{constructor(e,t){this.kind=ma.FocusChanged,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new HLe(this.oldHasFocus,e.hasFocus)}}class ULe{constructor(e,t,i,n,r,o,a,c){this.kind=ma.ScrollChanged,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=r,this.scrollLeft=o,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 ULe(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Uyt{constructor(){this.kind=ma.ViewZonesChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Vyt{constructor(){this.kind=ma.HiddenAreasChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class FY{constructor(e,t,i,n,r,o,a){this.kind=ma.CursorStateChanged,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=r,this.reason=o,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 r=0;r0){const e=this._cursors.getSelections();for(let t=0;to&&(n=n.slice(0,o),r=!0);const a=x5.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,r)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,r,o){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 f5(t,i,c,l,n,r,o))}revealPrimary(e,t,i,n,r,o){const c=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new f5(t,i,null,c,n,r,o))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const r=Mn.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?Bi.Undo:i.isRedoing?Bi.Redo:Bi.RecoverFromMarkers,r)&&this.revealAll(e,"modelChange",!1,vs.Simple,!0,_t.Smooth)}else{const r=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",Bi.RecoverFromMarkers,Mn.fromModelSelections(r))}}}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,Mn.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,r){const o=x5.from(this._model,this);if(o.equals(n))return!1;const a=this._cursors.getSelections(),c=this._cursors.getViewSelections();if(e.emitViewEvent(new d_t(c,a,i)),!n||n.cursorState.length!==o.cursorState.length||o.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 FY(l,a,d,o.modelVersionId,t||"keyboard",i,r))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i=0)return null;const o=r.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const a=o[1],c=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!c||c.length!==1)return null;const l=c[0].open,d=r.text.length-o[2].length-1,h=r.text.lastIndexOf(l,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,n){let r=null;t==="snippet"&&(r=this._findAutoClosingPairs(i)),r&&(i[0]._isTracked=!0);const o=[],a=[],c=this._model.pushEditOperations(this.getSelections(),i,l=>{if(r)for(let h=0,u=r.length;h0&&this._pushAutoClosedAction(o,a)}_executeEdit(e,t,i,n=Bi.NotSet){if(this.context.cursorConfig.readOnly)return;const r=x5.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(o){bt(o)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,r,!1)&&this.revealAll(t,i,!1,vs.Simple,!0,_t.Smooth)}getAutoClosedCharacters(){return p2e.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new D5(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(nx.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 r=0;for(;r{const l=c.getPosition();return new ht(l.lineNumber,l.column+r,l.lineNumber,l.column+r)});this.setSelections(e,o,a,Bi.NotSet)}return}this._executeEdit(()=>{this._executeEditOperation(nx.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,r))},e,o)}paste(e,t,i,n,r){this._executeEdit(()=>{this._executeEditOperation(nx.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,r,Bi.Paste)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(DM.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new sg(so.Other,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new sg(so.Other,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class x5{static from(e,t){return new x5(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 Jyt{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},r=this._innerExecuteCommands(n,i);for(let o=0,a=n.trackedRanges.length;o0&&(o[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,o,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]===h_.LTR?new ht(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new ht(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 r)r.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:r++},range:h,text:u,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:o,addTrackedEditOperation:(h,u,f)=>{a=!0,o(h,u,f)},trackSelection:(h,u)=>{const f=ht.liftSelection(h);let p;if(f.isEmpty())if(typeof u=="boolean")u?p=si.GrowsOnlyWhenTypingBefore:p=si.GrowsOnlyWhenTypingAfter;else{const b=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===b?p=si.GrowsOnlyWhenTypingBefore:p=si.GrowsOnlyWhenTypingAfter}else p=si.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: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;ir.identifier.major?o=n.identifier.major:o=r.identifier.major,t[o.toString()]=!0;for(let a=0;a0&&i--}}return t}}class Xyt{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class D5{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new Xyt(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=D5._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=D5._capture(e,t);if(!i||this._original.length!==i.length)return null;const n=[];for(let r=0,o=this._original.length;rK8,tokenizeEncoded:(s,e,t)=>JTe(ST.Null,t)};async function Zyt(s,e,t){if(!t)return _2e(e,s.languageIdCodec,m2e);const i=await La.getOrCreate(t);return _2e(e,s.languageIdCodec,i||m2e)}function eCt(s,e,t,i,n,r,o){let a="
",c=i,l=0,d=!0;for(let h=0,u=e.getCount();h0;)o&&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:o&&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 _2e(s,e,t){let i='
';const n=cv(s);let r=t.getInitialState();for(let o=0,a=n.length;o0&&(i+="
");const l=t.tokenizeEncoded(c,!0,r);pd.convertToEndOffset(l.tokens,c.length);const h=new pd(l.tokens,c,e).inflate();let u=0;for(let f=0,p=h.getCount();f${wT(c.substring(u,v))}`,u=v}r=l.endState}return i+="
",i}class tCt{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 iCt{constructor(e,t,i,n,r){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=r,this.prefixSum=0}}var UD;let nCt=(UD=class{constructor(e,t,i,n){this._instanceId=bKe(++UD.INSTANCE_COUNT),this._pendingChanges=new tCt,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,r=e.length;for(;n>>1;t===e[o].afterLineNumber?i{t=!0,n=n|0,r=r|0,o=o|0,a=a|0;const c=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new iCt(c,n,r,o,a)),c},changeOneWhitespace:(n,r,o)=>{t=!0,r=r|0,o=o|0,this._pendingChanges.change({id:n,newAfterLineNumber:r,newHeight:o})},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 r=new Map;for(const c of t)r.set(c.id,c);const o=c=>{const l=[];for(const d of c)if(!n.has(d.id)){if(r.has(d.id)){const h=r.get(d.id);d.afterLineNumber=h.newAfterLineNumber,d.height=h.newHeight}l.push(d)}return l},a=o(this._arr).concat(o(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=UD.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,r=t;for(;n=a+i)n=o+1;else{if(e>=a)return o;r=o}}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,r=this.getVerticalOffsetForLineNumber(n)|0;let o=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(n)|0;const c=this.getWhitespacesCount()|0;let l,d;a===-1?(a=c,d=o+1,l=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);let h=r,u=h;const f=5e5;let p=0;r>=f&&(p=Math.floor(r/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<=o;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=o+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);if(h>=t){o=A;break}}b===-1&&(b=o);const w=this.getVerticalOffsetForLineNumber(o)|0;let y=n,C=o;return yt&&C--,{bigNumbersDelta:p,startLineNumber:n,endLineNumber:o,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),r=this.getHeightForWhitespaceIndex(i);if(e>=n+r)return-1;for(;t=a+c)t=o+1;else{if(e>=a)return o;i=o}}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),r=this.getIdForWhitespaceIndex(t),o=this.getAfterLineNumberForWhitespaceIndex(t);return{id:r,afterLineNumber:o,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 r=[];for(let o=i;o<=n;o++){const a=this.getVerticalOffsetForWhitespaceIndex(o),c=this.getHeightForWhitespaceIndex(o);if(a>=t)break;r.push({id:this.getIdForWhitespaceIndex(o),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(o),verticalOffset:a,height:c})}return r}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}},UD.INSTANCE_COUNT=0,UD);const sCt=125;class dV{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 rCt extends V{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new I),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new dV(0,0,0,0),this._scrollable=this._register(new DN({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 WLe(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 oCt extends V{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,r=n.get(x.layoutInfo),o=n.get(x.padding);this._linesLayout=new nCt(t,n.get(x.lineHeight),o.top,o.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new rCt(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new dV(r.contentWidth,0,r.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)?sCt: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,r=i.height,o=this._scrollable.getScrollDimensions(),a=o.contentWidth;this._scrollable.setScrollDimensions(new dV(n,o.contentWidth,r,this._getContentHeight(n,r,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===Cr.Hidden||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let r=this._linesLayout.getLinesTotalHeight();return n.get(x.scrollBeyondLastLine)?r+=Math.max(0,t-n.get(x.lineHeight)-n.get(x.padding).bottom):n.get(x.scrollbar).ignoreHorizontalScrollbarInContentHeight||(r+=this._getHorizontalScrollbarHeight(e,i)),r}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new dV(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new aBe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new aBe(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),r=e.get(x.layoutInfo);if(i.isViewportWrapping){const o=e.get(x.minimap);return t>r.contentWidth+n.typicalHalfwidthCharacterWidth&&o.enabled&&o.side==="right"?t+r.verticalScrollbarWidth:t}else{const o=e.get(x.scrollBeyondLastColumn)*n.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+o+r.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 dV(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===_t.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 aCt{constructor(e,t,i,n,r){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=r,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,r=e.options;let o;if(r.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new re(n.startLineNumber,1),Ir.Left,!1,!0),c=this._coordinatesConverter.convertModelPositionToViewPosition(new re(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),Ir.Right);o=new F(a.lineNumber,a.column,c.lineNumber,c.column)}else o=this._coordinatesConverter.convertModelRangeToViewRange(n,Ir.Right);i=new dQe(o,r),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,Gj(this.configuration.options),t,i),r=e.startLineNumber,o=e.endLineNumber,a=[];let c=0;const l=[];for(let d=r;d<=o;d++)l[d-r]=[];for(let d=0,h=n.length;dt===no.Comment)}function $Le(s,e){return Nje(s,e.range,t=>t===no.String)}function Nje(s,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const n=s.tokenization.getLineTokens(i),r=i===e.startLineNumber,o=i===e.endLineNumber;let a=r?n.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(n.getStandardTokenType(a)))return!1;a++}}return!0}function Ahe(s,e){return s===null?e?OY.INSTANCE:BY.INSTANCE:new cCt(s,e)}class cCt{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,r=this._projectionData.breakOffsets[i];let o;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((l,d)=>new F_(0,0,l+1,this._projectionData.injectionOptions[d],0));o=F_.applyInjectedText(e.getLineContent(t),a).substring(n,r)}else o=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:r+1});return i>0&&(o=v2e(this._projectionData.wrappedTextIndentLength)+o),o}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,r,o,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 Qft(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:pd.defaultTokenMetadata}))):u=e.tokenization.getLineTokens(t);for(let f=i;f0?n.wrappedTextIndentLength:0,o=i>0?n.breakOffsets[i-1]:0,a=n.breakOffsets[i],c=e.sliceAndInflate(o,a,r);let l=c.getLineContent();i>0&&(l=v2e(n.wrappedTextIndentLength)+l);const d=this._projectionData.getMinOutputOffset(i)+1,h=l.length+1,u=i+1=Ehe.length)for(let e=1;e<=s;e++)Ehe[e]=lCt(e);return Ehe[s]}function lCt(s){return new Array(s+1).join(" ")}class dCt{constructor(e,t,i,n,r,o,a,c,l,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=r,this.tabSize=o,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 uCt(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),r=i.length,o=this.createLineBreaksComputer(),a=new Gy(F_.fromDecorations(n));for(let m=0;mb.lineNumber===m+1);o.addRequest(i[m],v,t?t[m]:null)}const c=o.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=Ahe(c[m],!b);l[m]=w.getViewLineCount(),this.modelLineProjections[m]=w}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new qgt(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(u=>this.model.validateRange(u)),i=hCt(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:Kt.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,r);const o=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,r){const o=this.fontInfo.equals(e),a=this.wrappingStrategy===t,c=this.wrappingColumn===i,l=this.wrappingIndent===n,d=this.wordBreak===r;if(o&&a&&c&&l&&d)return!1;const h=o&&a&&!c&&l&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=r;let u=null;if(h){u=[];for(let f=0,p=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),o=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+(r-c)-1,l=!0):rt?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)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),o=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(n.lineNumber,r.lineNumber,o.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 b2e(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 re(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 re(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),r=new Array;let o=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 R1(f.visibleColumn,p,f.className,new _5(f.horizontalLine.top,m.column),-1,-1):v.lineNumber!!f))}}return o}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 r=[];const o=[],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=J0.BlockNone;w>1&&m.getViewLineMinColumn(this.model,p+1,b)===1&&(y=v===0?J0.BlockSubsequent:J0.BlockAll),o.push(w),a.push(y),d===null&&(d=new re(p+1,0))}else d!==null&&(r=r.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,p)),d=null)}d!==null&&(r=r.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=r.length;pt&&(p=!0,f=t-r+1),h.getViewLinesData(this.model,l+1,u,f,r-e,i,c),r+=f,p)break}return c}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),r=n.index,o=n.remainder,a=this.modelLineProjections[r],c=a.getViewLineMinColumn(this.model,r+1,o),l=a.getViewLineMaxColumn(this.model,r+1,o);tl&&(t=l);const d=a.getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new re(r+1,d)).equals(i)?new re(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 re(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=Ir.None,n=!1,r=!1){const o=this.model.validatePosition(new re(e,t)),a=o.lineNumber,c=o.column;let l=a-1,d=!1;if(r)for(;l0&&!this.modelLineProjections[l].isVisible();)l--,d=!0;if(l===0&&!this.modelLineProjections[l].isVisible())return new re(n?0:1,1);const h=1+this.projectedModelLineLineCounts.getPrefixSum(l);let u;return d?r?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=Ir.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,Ir.Right),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,Ir.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 r=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(r,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,r){const o=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-o.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new F(o.lineNumber,1,a.lineNumber,a.column),t,i,n,r);let c=[];const l=o.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 re(m+1,m===l?o.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 hCt(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 r=1,o=e.length;rn+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 b2e{get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class w2e{constructor(e,t){this.modelRange=e,this.viewLines=t}}class uCt{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 J0;(function(s){s[s.BlockNone=0]="BlockNone",s[s.BlockSubsequent=1]="BlockSubsequent",s[s.BlockAll=2]="BlockAll"})(J0||(J0={}));class gCt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new fCt(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 ume(t,i)}onModelLinesInserted(e,t,i,n){return new gme(t,i)}onModelLineChanged(e,t,i){return[!1,new NQe(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 r=0;rt)}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 VI=j_.Right;class pCt{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*VI/8))}reset(e){const t=Math.ceil((e+1)*VI/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=GLe.create(this.model),this.glyphLanes=new pCt(0),this.model.isTooLargeForTokenization())this._lines=new gCt(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 dCt(this._editorId,this.model,n,r,u,this.model.getOptions().tabSize,f,p.wrappingColumn,m,v)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Yyt(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new oCt(this._configuration,this.getLineCount(),o)),this._register(this.viewLayout.onDidScroll(h=>{h.scrollTopChanged&&this._handleVisibleLinesChanged(),h.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new g_t(h)),this._eventDispatcher.emitOutgoingEvent(new ULe(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 aCt(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(xY.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new m_t)})),this._register(this._themeService.onDidColorThemeChange(h=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new f_t(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 h_t(e)),this._eventDispatcher.emitOutgoingEvent(new HLe(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new a_t)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new c_t)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new re(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new C2e(t,this._viewportStart.startLineDelta)}return new C2e(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,r=n.get(x.fontInfo),o=n.get(x.wrappingStrategy),a=n.get(x.wrappingInfo),c=n.get(x.wrappingIndent),l=n.get(x.wordBreak);this._lines.setWrappingSettings(r,o,a.wrappingColumn,c,l)&&(e.emitViewEvent(new zG),e.emitViewEvent(new $G),e.emitViewEvent(new HI(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 HI(null))),t.hasChanged(x.renderValidationDecorations)&&(this._decorations.reset(),e.emitViewEvent(new HI(null))),e.emitViewEvent(new l_t(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),uP.shouldRecreate(t)&&(this.cursorConfig=new uP(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,r=!1;const o=e instanceof RT?e.rawContentChangedEvent.changes:e.changes,a=e instanceof RT?e.rawContentChangedEvent.versionId:null,c=this._lines.createLineBreaksComputer();for(const h of o)switch(h.changeType){case zg.LinesInserted:{for(let u=0;u!m.ownerId||m.ownerId===this._editorId)),c.addRequest(f,p,null)}break}case zg.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 Gy(l);for(const h of o)switch(h.changeType){case zg.Flush:{this._lines.onModelFlushed(),i.emitViewEvent(new zG),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),n=!0;break}case zg.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 zg.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 zg.LineChanged:{const u=d.dequeue(),[f,p,m,v]=this._lines.onModelLineChanged(a,h.lineNumber,u);r=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 zg.EOLChanged:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!n&&r&&(i.emitViewEvent(new $G),i.emitViewEvent(new HI(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()),r=this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber);this.viewLayout.setScrollPosition({scrollTop:r+this._viewportStart.startLineDelta},_t.Immediate)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof RT&&i.emitOutgoingEvent(new qyt(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 u_t),this.cursorConfig=new uP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Kyt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new uP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Gyt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new zG),t.emitViewEvent(new $G),t.emitViewEvent(new HI(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new uP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Qyt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new HI(e)),this._eventDispatcher.emitOutgoingEvent(new $yt(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 r=!1;try{const o=this._eventDispatcher.beginEmitViewEvents();r=this._lines.setHiddenAreas(i),r&&(o.emitViewEvent(new zG),o.emitViewEvent(new $G),o.emitViewEvent(new HI(null)),this._cursor.onLineMappingChanged(o),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(),r&&this._eventDispatcher.emitOutgoingEvent(new Vyt)}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(),r=Math.max(1,n.completelyVisibleStartLineNumber-i),o=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new F(r,this.getLineMinColumn(r),o,this.getLineMaxColumn(o)))}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 r=0,o=t.startLineNumber,a=t.startColumn;const c=t.endLineNumber,l=t.endColumn;for(let d=0,h=i.length;dc||(o"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=Th(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=M_(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(),r=this.getTabSize(),o=this._lines.getViewLineData(e);return o.inlineDecorations&&(t=[...t,...o.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new _p(o.minColumn,o.maxColumn,o.content,o.continuesWithWrappedLine,i,n,o.tokens,t,r,o.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new qft(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,Gj(this._configuration.options)),i=new _Ct;for(const n of t){const r=n.options,o=r.overviewRuler;if(!o)continue;const a=o.position;if(a===0)continue;const c=o.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,r.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 o=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(o)}getPlainTextToCopy(e,t,i){const n=i?`\r -`:this.model.getEOL();e=e.slice(0),e.sort(F.compareRangesUsingStarts);let r=!1,o=!1;for(const c of e)c.isEmpty()?r=!0:o=!0;if(!o){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(r&&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?gr.CRLF:gr.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?gr.CRLF:gr.TextDefined));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Sa||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 r=this._configuration.options.get(x.fontInfo),o=this._getColorMap(),c=/[:;\\\/<>]/.test(r.fontFamily)||r.fontFamily===dd.fontFamily;let l;return c?l=dd.fontFamily:(l=r.fontFamily,l=l.replace(/"/g,"'"),/[,']/.test(l)||/[+ ]/.test(l)&&(l=`'${l}'`),l=`${l}, ${dd.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(n,o)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,r=e.endLineNumber,o=e.endColumn,a=this.getTabSize();let c="";for(let l=i;l<=r;l++){const d=this.model.tokenization.getLineTokens(l),h=d.getLineContent(),u=l===i?n-1:0,f=l===r?o-1:h.length;h===""?c+="
":c+=eCt(h,d.inflate(),t,u,f,a,jn)}return c}_getColorMap(){const e=La.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=Bi.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 zyt);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,r){this._executeCursorEdit(o=>this._cursor.compositionType(o,e,t,i,n,r))}paste(e,t,i,n){this._executeCursorEdit(r=>this._cursor.paste(r,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,vs.Simple,t,_t.Smooth))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,vs.Simple,t,_t.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 f5(e,!1,i,null,vs.Simple,!0,_t.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 f5(e,!1,i,null,vs.Simple,!0,_t.Smooth)))}revealRange(e,t,i,n,r){this._withViewEventsCollector(o=>o.emitViewEvent(new f5(e,!1,i,null,n,t,r)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new __t),this._eventDispatcher.emitOutgoingEvent(new Uyt))}_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 GLe{static create(e){const t=e._setTrackedRange(null,new F(1,1,1,1),si.NeverGrowsWhenTypingAtEdges);return new GLe(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,r){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=r}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,si.NeverGrowsWhenTypingAtEdges)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new re(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new F(i.lineNumber,i.column,i.lineNumber,i.column),si.NeverGrowsWhenTypingAtEdges),r=e.viewLayout.getVerticalOffsetForLineNumber(t),o=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=o-r}invalidate(){this._isValid=!1}}class _Ct{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,r){const o=this._asMap[e];if(o){const a=o.data,c=a[a.length-3],l=a[a.length-1];if(c===r&&l+1>=i){n>l&&(a[a.length-1]=n);return}a.push(r,i,n)}else{const a=new q8(e,t,[r,i,n]);this._asMap[e]=a,this.asArray.push(a)}}}class vCt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&y2e(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)=>bCt(t,i),[]);return y2e(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function bCt(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=r,this._commandService=o,this._themeService=c,this._register(new ACt(this,this._contextKeyService)),this._register(new ECt(this,this._contextKeyService,u)),this._instantiationService=this._register(n.createChild(new Vc([Le,this._contextKeyService]))),this._modelData=null,this._focusTracker=new xCt(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=dp.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of dp.getEditorActions()){if(this._actions.has(v.id)){bt(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const b=new pje(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 nY(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,r){return new tme(e,t,i,n,this._domElement,r)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return TU.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?us.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=gr.TextDefined;return e&&e.lineEnding&&e.lineEnding===` +`:this.model.getEOL();e=e.slice(0),e.sort(F.compareRangesUsingStarts);let r=!1,o=!1;for(const c of e)c.isEmpty()?r=!0:o=!0;if(!o){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(r&&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?gr.CRLF:gr.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?gr.CRLF:gr.TextDefined));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Sa||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 r=this._configuration.options.get(x.fontInfo),o=this._getColorMap(),c=/[:;\\\/<>]/.test(r.fontFamily)||r.fontFamily===dd.fontFamily;let l;return c?l=dd.fontFamily:(l=r.fontFamily,l=l.replace(/"/g,"'"),/[,']/.test(l)||/[+ ]/.test(l)&&(l=`'${l}'`),l=`${l}, ${dd.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(n,o)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,r=e.endLineNumber,o=e.endColumn,a=this.getTabSize();let c="";for(let l=i;l<=r;l++){const d=this.model.tokenization.getLineTokens(l),h=d.getLineContent(),u=l===i?n-1:0,f=l===r?o-1:h.length;h===""?c+="
":c+=eCt(h,d.inflate(),t,u,f,a,jn)}return c}_getColorMap(){const e=La.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=Bi.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 zyt);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,r){this._executeCursorEdit(o=>this._cursor.compositionType(o,e,t,i,n,r))}paste(e,t,i,n){this._executeCursorEdit(r=>this._cursor.paste(r,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,vs.Simple,t,_t.Smooth))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,vs.Simple,t,_t.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 f5(e,!1,i,null,vs.Simple,!0,_t.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 f5(e,!1,i,null,vs.Simple,!0,_t.Smooth)))}revealRange(e,t,i,n,r){this._withViewEventsCollector(o=>o.emitViewEvent(new f5(e,!1,i,null,n,t,r)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new __t),this._eventDispatcher.emitOutgoingEvent(new Uyt))}_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 GLe{static create(e){const t=e._setTrackedRange(null,new F(1,1,1,1),si.NeverGrowsWhenTypingAtEdges);return new GLe(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,r){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=r}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,si.NeverGrowsWhenTypingAtEdges)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new re(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new F(i.lineNumber,i.column,i.lineNumber,i.column),si.NeverGrowsWhenTypingAtEdges),r=e.viewLayout.getVerticalOffsetForLineNumber(t),o=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=o-r}invalidate(){this._isValid=!1}}class _Ct{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,r){const o=this._asMap[e];if(o){const a=o.data,c=a[a.length-3],l=a[a.length-1];if(c===r&&l+1>=i){n>l&&(a[a.length-1]=n);return}a.push(r,i,n)}else{const a=new q8(e,t,[r,i,n]);this._asMap[e]=a,this.asArray.push(a)}}}class vCt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&y2e(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)=>bCt(t,i),[]);return y2e(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function bCt(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=r,this._commandService=o,this._themeService=c,this._register(new ACt(this,this._contextKeyService)),this._register(new ECt(this,this._contextKeyService,u)),this._instantiationService=this._register(n.createChild(new Vc([Le,this._contextKeyService]))),this._modelData=null,this._focusTracker=new xCt(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=dp.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of dp.getEditorActions()){if(this._actions.has(v.id)){bt(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const b=new pje(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 nY(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,r){return new tme(e,t,i,n,this._domElement,r)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return TU.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?us.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=gr.TextDefined;return e&&e.lineEnding&&e.lineEnding===` `?i=gr.LF:e&&e.lineEnding&&e.lineEnding===`\r -`&&(i=gr.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(),r=this._detachModel();this._attachModel(t),n&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(r),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 r=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(o.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?l0._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?l0._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const r=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?l0._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(!re.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 r=this._modelData.model.validateRange(e),o=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(r);this._modelData.viewModel.revealRange("api",i,o,t,n)}revealLine(e,t=_t.Smooth){this._revealLine(e,vs.Simple,t)}revealLineInCenter(e,t=_t.Smooth){this._revealLine(e,vs.Center,t)}revealLineInCenterIfOutsideViewport(e,t=_t.Smooth){this._revealLine(e,vs.CenterIfOutsideViewport,t)}revealLineNearTop(e,t=_t.Smooth){this._revealLine(e,vs.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=_t.Smooth){this._revealPosition(e,vs.Simple,!0,t)}revealPositionInCenter(e,t=_t.Smooth){this._revealPosition(e,vs.Center,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=_t.Smooth){this._revealPosition(e,vs.CenterIfOutsideViewport,!0,t)}revealPositionNearTop(e,t=_t.Smooth){this._revealPosition(e,vs.NearTop,!0,t)}_revealPosition(e,t,i,n){if(!re.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=ht.isISelection(e),n=F.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const r={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(r,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new ht(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=_t.Smooth){this._revealLines(e,t,vs.Simple,i)}revealLinesInCenter(e,t,i=_t.Smooth){this._revealLines(e,t,vs.Center,i)}revealLinesInCenterIfOutsideViewport(e,t,i=_t.Smooth){this._revealLines(e,t,vs.CenterIfOutsideViewport,i)}revealLinesNearTop(e,t,i=_t.Smooth){this._revealLines(e,t,vs.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=_t.Smooth,i=!1,n=!0){this._revealRange(e,i?vs.Center:vs.Simple,n,t)}revealRangeInCenter(e,t=_t.Smooth){this._revealRange(e,vs.Center,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=_t.Smooth){this._revealRange(e,vs.CenterIfOutsideViewport,!0,t)}revealRangeNearTop(e,t=_t.Smooth){this._revealRange(e,vs.NearTop,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=_t.Smooth){this._revealRange(e,vs.NearTopIfOutsideViewport,!0,t)}revealRangeAtTop(e,t=_t.Smooth){this._revealRange(e,vs.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=Bi.NotSet){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let n=0,r=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 r=i;this._type(e,r.text||"");return}case oc.ReplacePreviousChar:{const r=i;this._compositionType(e,r.text||"",r.replaceCharCnt||0,0,0);return}case oc.CompositionType:{const r=i;this._compositionType(e,r.text||"",r.replacePrevCharCnt||0,r.replaceNextCharCnt||0,r.positionDelta||0);return}case oc.Paste:{const r=i;this._paste(e,r.text||"",r.pasteOnNewLine||!1,r.multicursorText||null,r.mode||null,r.clipboardEvent);return}case oc.Cut:this._cut(e);return}const n=this.getAction(t);if(n){Promise.resolve(n.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,n,r){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,r,e)}_paste(e,t,i,n,r,o){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:o,range:new F(c.lineNumber,c.column,l.lineNumber,l.column),languageId:r})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=dp.getEditorCommand(t);return n?(i=i||{},i.source=e,this._instantiationService.invokeFunction(r=>{Promise.resolve(n.runEditorCommand(r,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 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 DCt(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,Gj(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,Gj(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={},r=this._decorationTypeSubtypes[t]||{};this._decorationTypeSubtypes[t]=n;const o=[];for(const c of i){let l=t;if(c.renderOptions){const h=Hc(c.renderOptions).toString(16);l=t+"-"+h,!r[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),o.push({range:c.range,options:d})}for(const c in r)n[c]||this._removeDecorationType(t+"-"+c);const a=this._decorationTypeKeysToIds[t]||[];this.changeDecorations(c=>this._decorationTypeKeysToIds[t]=c.deltaDecorations(a,o))}setDecorationsByTypeFast(e,t){const i=this._decorationTypeSubtypes[e]||{};for(const a in i)this._removeDecorationType(e+"-"+a);this._decorationTypeSubtypes[e]={};const n=Kt.createDynamic(this._resolveDecorationOptions(e,!1)),r=new Array(t.length);for(let a=0,c=t.length;athis._decorationTypeKeysToIds[e]=a.deltaDecorations(o,r))}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),r=l0._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),o=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.decorationsWidth-this.getScrollLeft();return{top:r,left:o,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){kl(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 mCt(this._id,this._configuration,e,DLe.create(lt(this._domElement)),BLe.create(this._configuration.options),a=>Ml(lt(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 ma.ContentSizeChanged:this._onDidContentSizeChange.fire(a);break;case ma.FocusChanged:this._editorTextFocus.setValue(a.hasFocus);break;case ma.ScrollChanged:this._onDidScrollChange.fire(a);break;case ma.ViewZonesChanged:this._onDidChangeViewZones.fire();break;case ma.HiddenAreasChanged:this._onDidChangeHiddenAreas.fire();break;case ma.ReadOnlyEditAttempt:this._onDidAttemptReadOnlyEdit.fire();break;case ma.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(Ze.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",r,o,a,c)},type:r=>{this._type("keyboard",r)},compositionType:(r,o,a,c)=>{this._compositionType("keyboard",r,o,a,c)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(r,o,a,c)=>{const l={text:r,pasteOnNewLine:o,multicursorText:a,mode:c};this._commandService.executeCommand(oc.Paste,l)},type:r=>{const o={text:r};this._commandService.executeCommand(oc.Type,o)},compositionType:(r,o,a,c)=>{if(a||c){const l={text:r,replacePrevCharCnt:o,replaceNextCharCnt:a,positionDelta:c};this._commandService.executeCommand(oc.CompositionType,l)}else{const l={text:r,replaceCharCnt:o};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 Sae(e.coordinatesConverter);return i.onKeyDown=r=>this._onKeyDown.fire(r),i.onKeyUp=r=>this._onKeyUp.fire(r),i.onContextMenu=r=>this._onContextMenu.fire(r),i.onMouseMove=r=>this._onMouseMove.fire(r),i.onMouseLeave=r=>this._onMouseLeave.fire(r),i.onMouseDown=r=>this._onMouseDown.fire(r),i.onMouseUp=r=>this._onMouseUp.fire(r),i.onMouseDrag=r=>this._onMouseDrag.fire(r),i.onMouseDrop=r=>this._onMouseDrop.fire(r),i.onMouseDropCanceled=r=>this._onMouseDropCanceled.fire(r),i.onMouseWheel=r=>this._onMouseWheel.fire(r),[new Tme(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:l0.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,_t.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()}},l0=fL,fL.dropIntoEditorDecorationOptions=Kt.register({description:"workbench-dnd-target",className:"dnd-target"}),fL);Kk=l0=D([_(3,we),_(4,qt),_(5,bi),_(6,Le),_(7,mn),_(8,wi),_(9,_o),_(10,zs),_(11,nt)],Kk);let CCt=0,SCt=class{constructor(e,t,i,n,r,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=r,this.attachedView=o}dispose(){wt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};var X0;(function(s){s[s.NotSet=0]="NotSet",s[s.False=1]="False",s[s.True=2]="True"})(X0||(X0={}));class S2e 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=X0.NotSet}setValue(e){const t=e?X0.True:X0.False;this._value!==t&&(this._value=t,this._value===X0.True?this._onDidChangeToTrue.fire():this._value===X0.False&&this._onDidChangeToFalse.fire())}}class ch extends I{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class ACt 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(Uk.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(Uk.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 ECt 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 xCt 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(Ec(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(Ec(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 DCt{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 kCt=encodeURIComponent("");function xhe(s){return kCt+encodeURIComponent(s.toString())+ICt}const TCt=encodeURIComponent('');function RCt(s){return TCt+encodeURIComponent(s.toString())+LCt}Ep((s,e)=>{const t=s.getColor(FN);t&&e.addRule(`.monaco-editor .${zh.EditorErrorDecoration} { background: url("data:image/svg+xml,${xhe(t)}") repeat-x bottom left; }`);const i=s.getColor(vm);i&&e.addRule(`.monaco-editor .${zh.EditorWarningDecoration} { background: url("data:image/svg+xml,${xhe(i)}") repeat-x bottom left; }`);const n=s.getColor(bm);n&&e.addRule(`.monaco-editor .${zh.EditorInfoDecoration} { background: url("data:image/svg+xml,${xhe(n)}") repeat-x bottom left; }`);const r=s.getColor(Ipt);r&&e.addRule(`.monaco-editor .${zh.EditorHintDecoration} { background: url("data:image/svg+xml,${RCt(r)}") no-repeat bottom left; }`);const o=s.getColor(Uvt);o&&e.addRule(`.monaco-editor.showUnused .${zh.EditorUnnecessaryInlineDecoration} { opacity: ${o.rgba.a}; }`)});let WY=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 ul,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 PCt(fl())}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!F8(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const n=new NCt(this,i,fl(t));this._editorStyleSheets.set(i,n)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,n,r){let o=this._decorationOptionProviders.get(t);if(!o){const a=this._getOrCreateStyleSheet(r),c={styleSheet:a,key:t,parentTypeKey:n,options:i||Object.create(null)};n?o=new FCt(this._themeService,a,c):o=new OCt(e,this._themeService,a,c),this._decorationOptionProviders.set(t,o),this._onDecorationTypeRegistered.fire(t)}return o.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 r;this._modelProperties.has(n)?r=this._modelProperties.get(n):(r=new Map,this._modelProperties.set(n,r)),r.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 r;this._transientWatchers.hasOwnProperty(n)?r=this._transientWatchers[n]:(r=new MCt(n,e,this),this._transientWatchers[n]=r),r.get(t)!==i&&(r.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 r=await n(e,t,i);if(r!==null)return r}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ee(t)}};WY=D([_(0,mn)],WY);class MCt{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 NCt{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){$f(e,t,this._styleSheet)}removeRulesContainingSelector(e){xS(e,this._styleSheet)}}class PCt{get sheet(){return this._styleSheet.sheet}constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){$f(e,t,this._styleSheet)}removeRulesContainingSelector(e){xS(e,this._styleSheet)}}class FCt{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new HY(Yl.BeforeContentClassName,i,e),this._afterContentRules=new HY(Yl.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 OCt{constructor(e,t,i,n){this._disposables=new Z,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const r=h=>{const u=new HY(h,n,t);if(this._disposables.add(u),u.hasContent)return u.className},o=h=>{const u=new HY(h,n,t);return this._disposables.add(u),u.hasContent?{className:u.className,hasLetterSpacing:u.hasLetterSpacing}:null};this.className=r(Yl.ClassName);const a=o(Yl.InlineClassName);if(a&&(this.inlineClassName=a.className,this.inlineClassNameAffectsLetterSpacing=a.hasLetterSpacing),this.beforeContentClassName=r(Yl.BeforeContentClassName),this.afterContentClassName=r(Yl.AfterContentClassName),n.options.beforeInjectedText&&n.options.beforeInjectedText.contentText){const h=o(Yl.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=o(Yl.AfterInjectedTextClassName);this.afterInjectedText={content:n.options.afterInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||n.options.afterInjectedText.affectsLetterSpacing}}this.glyphMarginClassName=r(Yl.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||Il.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 C4={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 HY{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=Dhe.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+Dhe.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=Dhe.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=i.onDidColorThemeChange(r=>{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 Yl.ClassName:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),n=this.getCSSTextForModelDecorationClassName(e.dark);break;case Yl.InlineClassName:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),n=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case Yl.GlyphMarginClassName:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case Yl.BeforeContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case Yl.AfterContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;case Yl.BeforeInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.beforeInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.beforeInjectedText),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.beforeInjectedText);break;case Yl.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 r=this._providerArgs.styleSheet;let o=!1;t.length>0&&(r.insertRule(this._unThemedSelector,t),o=!0),i.length>0&&(r.insertRule(`.vs${this._unThemedSelector}, .hc-light${this._unThemedSelector}`,i),o=!0),n.length>0&&(r.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector}`,n),o=!0),this._hasContent=o}_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(qp(C4.contentIconPath,ig(N.revive(e.contentIconPath)))),typeof e.contentText=="string"){const n=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(qp(C4.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(qp(C4.gutterIconPath,ig(N.revive(e.gutterIconPath)))),typeof e.gutterIconSize<"u"&&t.push(qp(C4.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)?(t.push(qp("box-sizing: border-box;")),!0):!1}collectCSSText(e,t,i){const n=i.length;for(const r of t){const o=this.resolveValue(e[r]);typeof o=="string"&&i.push(qp(C4[r],o))}return i.length!==n}resolveValue(e){if(Gft(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}var Yl;(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"})(Yl||(Yl={}));class Dhe{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===Yl.BeforeContentClassName?n+="::before":i===Yl.AfterContentClassName&&(n+="::after"),n}}let UY=class extends WY{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,r)=>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 r=t.resource.scheme;if(r===pe.http||r===pe.https)return vqe(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,_t.Immediate);else{const r={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(r),e.revealPositionInCenter(r,_t.Immediate)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};UY=D([_(0,Le),_(1,mn)],UY);ce(qt,UY,Qt.Eager);const _u=ae("layoutService");let VY=class{get mainContainer(){return um(this._codeEditorService.listCodeEditors())?.getContainerDomNode()??ri.document.body}get activeContainer(){return(this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return K_(this.mainContainer)}get activeContainerDimension(){return K_(this.activeContainer)}get containers(){return Oi(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}}};VY=D([_(0,qt)],VY);let Qme=class extends VY{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Qme=D([_(1,qt)],Qme);ce(_u,VY,Qt.Delayed);const ir=ae("dialogService"),dg=ae("fileDialogService");function eK(s){return s.scheme===pe.file?s.fsPath:s.path}let Pje=0;class tK{constructor(e,t,i,n,r,o,a){this.id=++Pje,this.type=El.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=r,this.sourceId=o,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 mS;(function(s){s[s.ExternalRemoval=0]="ExternalRemoval",s[s.NoParallelUniverses=1]="NoParallelUniverses"})(mS||(mS={}));class A2e{constructor(e,t){this.resourceLabel=e,this.reason=t}}class E2e{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements)(n.reason===mS.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 BCt{constructor(e,t,i,n,r,o,a){this.id=++Pje,this.type=El.Workspace,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=r,this.sourceId=o,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 E2e),this.removedResources.has(t)||this.removedResources.set(t,new A2e(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 E2e),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new A2e(e,mS.ExternalRemoval)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Fje{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===El.Workspace&&e.removeResource(this.resourceLabel,this.strResource,mS.ExternalRemoval);for(const e of this._future)e.type===El.Workspace&&e.removeResource(this.resourceLabel,this.strResource,mS.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===El.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e);for(const t of this._future)t.type===El.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e)}_setElementValidFlag(e,t){e.type===El.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===El.Workspace&&t.removeResource(this.resourceLabel,this.strResource,mS.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 kje(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,r=-1;for(let a=0,c=this._past.length;a=t||l.id!==e.elements[n])&&(i=!1,r=0),!i&&l.type===El.Workspace&&l.removeResource(this.resourceLabel,this.strResource,mS.ExternalRemoval)}let o=-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,o=a),!i&&c.type===El.Workspace&&c.removeResource(this.resourceLabel,this.strResource,mS.ExternalRemoval)}r!==-1&&(this._past=this._past.slice(0,r)),o!==-1&&(this._future=this._future.slice(o+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 khe{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=o,i=n)}return[t,i]}canUndo(e){if(e instanceof j0){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,n,r){const o=this._acquireLocks(i);let a;try{a=t()}catch(c){return o(),n.dispose(),this._onError(c,e)}return a?a.then(()=>(o(),n.dispose(),r()),c=>(o(),n.dispose(),this._onError(c,e))):(o(),n.dispose(),r())}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!==El.Workspace||typeof e.actual.prepareUndoRedo>"u")return t(V.None);const i=e.actual.prepareUndoRedo();return i?xN(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)||Oje);return new khe(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new iK(this._undo(e,0,!0));for(const r of t.strResources)this.removeElements(r);return this._notificationService.warn(n),new iK}_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 r=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&r.push(a.resourceLabel);if(r.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,r.join(", ")));const o=[];for(const a of i.editStacks)a.locked&&o.push(a.resourceLabel);return o.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,o.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),r=this._checkWorkspaceUndo(e,t,n,!1);return r?r.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:Ze.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 r;try{r=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const o=this._checkWorkspaceUndo(e,t,i,!0);if(o)return r.dispose(),o.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,r,()=>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 khe([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,r]of this._editStacks){const o=r.getClosestPastElement();o&&o.groupId===e&&(!t||o.groupOrder>t.groupOrder)&&(t=o,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 j0){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),r=n.getClosestPastElement();if(!r)return;if(r.groupId){const[a,c]=this._findClosestUndoElementInGroup(r.groupId);if(r!==a&&c)return this._undo(c,t,i)}if((r.sourceId!==t||r.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,r);try{return r.type===El.Workspace?this._workspaceUndo(e,r,i):this._resourceUndo(n,r,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,r]of this._editStacks){const o=r.getClosestFutureElement();o&&o.sourceId===e&&(!t||o.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,g(1205,"Could not redo '{0}' across all files because changes were made to {1}",t.label,r.join(", ")));const o=[];for(const a of i.editStacks)a.locked&&o.push(a.resourceLabel);return o.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,o.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(o){return this._onError(o,t)}const r=this._checkWorkspaceRedo(e,t,i,!0);if(r)return n.dispose(),r.returnValue;for(const o of i.editStacks)o.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 khe([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,r]of this._editStacks){const o=r.getClosestFutureElement();o&&o.groupId===e&&(!t||o.groupOrdertae(zY.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?qa(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 Tht(6),this._cache.set(i,n));const r=qa(n.update(t),this._min,this._max);return IA(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${r}ms`),r}_overall(){const e=new NTe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return qa(e,this._min,this._max)}}let Yme=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,r=i?.max??n**2,o=i?.key??void 0,a=`${zY.of(e)},${n}${o?","+o:""}`;let c=this._data.get(a);return c||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),c=new WCt(n*1.5)):c=new HCt(this._logService,t,e,this._overallAverage()|0||n*1.5,n,r),this._data.set(a,c)),c}_overallAverage(){const e=new NTe;for(const t of this._data.values())e.update(t.default());return e.value}};Yme=D([_(0,Ke),_(1,ec)],Yme);ce(xp,Yme,Qt.Delayed);function Ihe(s,e){return e&&(s.stack||s.stacktrace)?g(568,"{0}: {1}",D2e(s),x2e(s.stack)||x2e(s.stacktrace)):D2e(s)}function x2e(s){return Array.isArray(s)?s.join(` +`&&(i=gr.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(),r=this._detachModel();this._attachModel(t),n&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(r),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 r=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(o.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?l0._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?l0._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const r=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?l0._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 ja.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 ja.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(!re.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 r=this._modelData.model.validateRange(e),o=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(r);this._modelData.viewModel.revealRange("api",i,o,t,n)}revealLine(e,t=_t.Smooth){this._revealLine(e,vs.Simple,t)}revealLineInCenter(e,t=_t.Smooth){this._revealLine(e,vs.Center,t)}revealLineInCenterIfOutsideViewport(e,t=_t.Smooth){this._revealLine(e,vs.CenterIfOutsideViewport,t)}revealLineNearTop(e,t=_t.Smooth){this._revealLine(e,vs.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=_t.Smooth){this._revealPosition(e,vs.Simple,!0,t)}revealPositionInCenter(e,t=_t.Smooth){this._revealPosition(e,vs.Center,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=_t.Smooth){this._revealPosition(e,vs.CenterIfOutsideViewport,!0,t)}revealPositionNearTop(e,t=_t.Smooth){this._revealPosition(e,vs.NearTop,!0,t)}_revealPosition(e,t,i,n){if(!re.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=ht.isISelection(e),n=F.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const r={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(r,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new ht(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=_t.Smooth){this._revealLines(e,t,vs.Simple,i)}revealLinesInCenter(e,t,i=_t.Smooth){this._revealLines(e,t,vs.Center,i)}revealLinesInCenterIfOutsideViewport(e,t,i=_t.Smooth){this._revealLines(e,t,vs.CenterIfOutsideViewport,i)}revealLinesNearTop(e,t,i=_t.Smooth){this._revealLines(e,t,vs.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=_t.Smooth,i=!1,n=!0){this._revealRange(e,i?vs.Center:vs.Simple,n,t)}revealRangeInCenter(e,t=_t.Smooth){this._revealRange(e,vs.Center,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=_t.Smooth){this._revealRange(e,vs.CenterIfOutsideViewport,!0,t)}revealRangeNearTop(e,t=_t.Smooth){this._revealRange(e,vs.NearTop,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=_t.Smooth){this._revealRange(e,vs.NearTopIfOutsideViewport,!0,t)}revealRangeAtTop(e,t=_t.Smooth){this._revealRange(e,vs.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=Bi.NotSet){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let n=0,r=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 r=i;this._type(e,r.text||"");return}case oc.ReplacePreviousChar:{const r=i;this._compositionType(e,r.text||"",r.replaceCharCnt||0,0,0);return}case oc.CompositionType:{const r=i;this._compositionType(e,r.text||"",r.replacePrevCharCnt||0,r.replaceNextCharCnt||0,r.positionDelta||0);return}case oc.Paste:{const r=i;this._paste(e,r.text||"",r.pasteOnNewLine||!1,r.multicursorText||null,r.mode||null,r.clipboardEvent);return}case oc.Cut:this._cut(e);return}const n=this.getAction(t);if(n){Promise.resolve(n.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,n,r){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,r,e)}_paste(e,t,i,n,r,o){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:o,range:new F(c.lineNumber,c.column,l.lineNumber,l.column),languageId:r})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=dp.getEditorCommand(t);return n?(i=i||{},i.source=e,this._instantiationService.invokeFunction(r=>{Promise.resolve(n.runEditorCommand(r,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 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 DCt(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,Gj(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,Gj(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={},r=this._decorationTypeSubtypes[t]||{};this._decorationTypeSubtypes[t]=n;const o=[];for(const c of i){let l=t;if(c.renderOptions){const h=Hc(c.renderOptions).toString(16);l=t+"-"+h,!r[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),o.push({range:c.range,options:d})}for(const c in r)n[c]||this._removeDecorationType(t+"-"+c);const a=this._decorationTypeKeysToIds[t]||[];this.changeDecorations(c=>this._decorationTypeKeysToIds[t]=c.deltaDecorations(a,o))}setDecorationsByTypeFast(e,t){const i=this._decorationTypeSubtypes[e]||{};for(const a in i)this._removeDecorationType(e+"-"+a);this._decorationTypeSubtypes[e]={};const n=Kt.createDynamic(this._resolveDecorationOptions(e,!1)),r=new Array(t.length);for(let a=0,c=t.length;athis._decorationTypeKeysToIds[e]=a.deltaDecorations(o,r))}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),r=l0._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),o=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.decorationsWidth-this.getScrollLeft();return{top:r,left:o,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){Il(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 mCt(this._id,this._configuration,e,DLe.create(lt(this._domElement)),BLe.create(this._configuration.options),a=>Nl(lt(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 ma.ContentSizeChanged:this._onDidContentSizeChange.fire(a);break;case ma.FocusChanged:this._editorTextFocus.setValue(a.hasFocus);break;case ma.ScrollChanged:this._onDidScrollChange.fire(a);break;case ma.ViewZonesChanged:this._onDidChangeViewZones.fire();break;case ma.HiddenAreasChanged:this._onDidChangeHiddenAreas.fire();break;case ma.ReadOnlyEditAttempt:this._onDidAttemptReadOnlyEdit.fire();break;case ma.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(Ze.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",r,o,a,c)},type:r=>{this._type("keyboard",r)},compositionType:(r,o,a,c)=>{this._compositionType("keyboard",r,o,a,c)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(r,o,a,c)=>{const l={text:r,pasteOnNewLine:o,multicursorText:a,mode:c};this._commandService.executeCommand(oc.Paste,l)},type:r=>{const o={text:r};this._commandService.executeCommand(oc.Type,o)},compositionType:(r,o,a,c)=>{if(a||c){const l={text:r,replacePrevCharCnt:o,replaceNextCharCnt:a,positionDelta:c};this._commandService.executeCommand(oc.CompositionType,l)}else{const l={text:r,replaceCharCnt:o};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 Sae(e.coordinatesConverter);return i.onKeyDown=r=>this._onKeyDown.fire(r),i.onKeyUp=r=>this._onKeyUp.fire(r),i.onContextMenu=r=>this._onContextMenu.fire(r),i.onMouseMove=r=>this._onMouseMove.fire(r),i.onMouseLeave=r=>this._onMouseLeave.fire(r),i.onMouseDown=r=>this._onMouseDown.fire(r),i.onMouseUp=r=>this._onMouseUp.fire(r),i.onMouseDrag=r=>this._onMouseDrag.fire(r),i.onMouseDrop=r=>this._onMouseDrop.fire(r),i.onMouseDropCanceled=r=>this._onMouseDropCanceled.fire(r),i.onMouseWheel=r=>this._onMouseWheel.fire(r),[new Tme(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:l0.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,_t.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()}},l0=fL,fL.dropIntoEditorDecorationOptions=Kt.register({description:"workbench-dnd-target",className:"dnd-target"}),fL);Kk=l0=D([_(3,we),_(4,qt),_(5,bi),_(6,Le),_(7,mn),_(8,wi),_(9,_o),_(10,zs),_(11,nt)],Kk);let CCt=0,SCt=class{constructor(e,t,i,n,r,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=r,this.attachedView=o}dispose(){wt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};var X0;(function(s){s[s.NotSet=0]="NotSet",s[s.False=1]="False",s[s.True=2]="True"})(X0||(X0={}));class S2e 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=X0.NotSet}setValue(e){const t=e?X0.True:X0.False;this._value!==t&&(this._value=t,this._value===X0.True?this._onDidChangeToTrue.fire():this._value===X0.False&&this._onDidChangeToFalse.fire())}}class ch extends I{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class ACt 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(Uk.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(Uk.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 ECt 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 xCt 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(Ec(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(Ec(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 DCt{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 kCt=encodeURIComponent("");function xhe(s){return kCt+encodeURIComponent(s.toString())+ICt}const TCt=encodeURIComponent('');function RCt(s){return TCt+encodeURIComponent(s.toString())+LCt}Ep((s,e)=>{const t=s.getColor(FN);t&&e.addRule(`.monaco-editor .${zh.EditorErrorDecoration} { background: url("data:image/svg+xml,${xhe(t)}") repeat-x bottom left; }`);const i=s.getColor(vm);i&&e.addRule(`.monaco-editor .${zh.EditorWarningDecoration} { background: url("data:image/svg+xml,${xhe(i)}") repeat-x bottom left; }`);const n=s.getColor(bm);n&&e.addRule(`.monaco-editor .${zh.EditorInfoDecoration} { background: url("data:image/svg+xml,${xhe(n)}") repeat-x bottom left; }`);const r=s.getColor(Ipt);r&&e.addRule(`.monaco-editor .${zh.EditorHintDecoration} { background: url("data:image/svg+xml,${RCt(r)}") no-repeat bottom left; }`);const o=s.getColor(Uvt);o&&e.addRule(`.monaco-editor.showUnused .${zh.EditorUnnecessaryInlineDecoration} { opacity: ${o.rgba.a}; }`)});let WY=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 ul,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 PCt(fl())}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!F8(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const n=new NCt(this,i,fl(t));this._editorStyleSheets.set(i,n)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,n,r){let o=this._decorationOptionProviders.get(t);if(!o){const a=this._getOrCreateStyleSheet(r),c={styleSheet:a,key:t,parentTypeKey:n,options:i||Object.create(null)};n?o=new FCt(this._themeService,a,c):o=new OCt(e,this._themeService,a,c),this._decorationOptionProviders.set(t,o),this._onDecorationTypeRegistered.fire(t)}return o.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 r;this._modelProperties.has(n)?r=this._modelProperties.get(n):(r=new Map,this._modelProperties.set(n,r)),r.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 r;this._transientWatchers.hasOwnProperty(n)?r=this._transientWatchers[n]:(r=new MCt(n,e,this),this._transientWatchers[n]=r),r.get(t)!==i&&(r.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 r=await n(e,t,i);if(r!==null)return r}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ee(t)}};WY=D([_(0,mn)],WY);class MCt{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 NCt{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){$f(e,t,this._styleSheet)}removeRulesContainingSelector(e){xS(e,this._styleSheet)}}class PCt{get sheet(){return this._styleSheet.sheet}constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){$f(e,t,this._styleSheet)}removeRulesContainingSelector(e){xS(e,this._styleSheet)}}class FCt{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new HY(Yl.BeforeContentClassName,i,e),this._afterContentRules=new HY(Yl.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 OCt{constructor(e,t,i,n){this._disposables=new Z,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const r=h=>{const u=new HY(h,n,t);if(this._disposables.add(u),u.hasContent)return u.className},o=h=>{const u=new HY(h,n,t);return this._disposables.add(u),u.hasContent?{className:u.className,hasLetterSpacing:u.hasLetterSpacing}:null};this.className=r(Yl.ClassName);const a=o(Yl.InlineClassName);if(a&&(this.inlineClassName=a.className,this.inlineClassNameAffectsLetterSpacing=a.hasLetterSpacing),this.beforeContentClassName=r(Yl.BeforeContentClassName),this.afterContentClassName=r(Yl.AfterContentClassName),n.options.beforeInjectedText&&n.options.beforeInjectedText.contentText){const h=o(Yl.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=o(Yl.AfterInjectedTextClassName);this.afterInjectedText={content:n.options.afterInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||n.options.afterInjectedText.affectsLetterSpacing}}this.glyphMarginClassName=r(Yl.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||Tl.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 C4={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 HY{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=Dhe.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+Dhe.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=Dhe.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=i.onDidColorThemeChange(r=>{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 Yl.ClassName:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),n=this.getCSSTextForModelDecorationClassName(e.dark);break;case Yl.InlineClassName:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),n=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case Yl.GlyphMarginClassName:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case Yl.BeforeContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case Yl.AfterContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;case Yl.BeforeInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.beforeInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.beforeInjectedText),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.beforeInjectedText);break;case Yl.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 r=this._providerArgs.styleSheet;let o=!1;t.length>0&&(r.insertRule(this._unThemedSelector,t),o=!0),i.length>0&&(r.insertRule(`.vs${this._unThemedSelector}, .hc-light${this._unThemedSelector}`,i),o=!0),n.length>0&&(r.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector}`,n),o=!0),this._hasContent=o}_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(qp(C4.contentIconPath,ig(N.revive(e.contentIconPath)))),typeof e.contentText=="string"){const n=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(qp(C4.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(qp(C4.gutterIconPath,ig(N.revive(e.gutterIconPath)))),typeof e.gutterIconSize<"u"&&t.push(qp(C4.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)?(t.push(qp("box-sizing: border-box;")),!0):!1}collectCSSText(e,t,i){const n=i.length;for(const r of t){const o=this.resolveValue(e[r]);typeof o=="string"&&i.push(qp(C4[r],o))}return i.length!==n}resolveValue(e){if(Gft(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}var Yl;(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"})(Yl||(Yl={}));class Dhe{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===Yl.BeforeContentClassName?n+="::before":i===Yl.AfterContentClassName&&(n+="::after"),n}}let UY=class extends WY{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,r)=>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 r=t.resource.scheme;if(r===pe.http||r===pe.https)return vqe(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,_t.Immediate);else{const r={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(r),e.revealPositionInCenter(r,_t.Immediate)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};UY=D([_(0,Le),_(1,mn)],UY);ce(qt,UY,Qt.Eager);const _u=ae("layoutService");let VY=class{get mainContainer(){return um(this._codeEditorService.listCodeEditors())?.getContainerDomNode()??ri.document.body}get activeContainer(){return(this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return K_(this.mainContainer)}get activeContainerDimension(){return K_(this.activeContainer)}get containers(){return Oi(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}}};VY=D([_(0,qt)],VY);let Qme=class extends VY{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Qme=D([_(1,qt)],Qme);ce(_u,VY,Qt.Delayed);const ir=ae("dialogService"),dg=ae("fileDialogService");function eK(s){return s.scheme===pe.file?s.fsPath:s.path}let Pje=0;class tK{constructor(e,t,i,n,r,o,a){this.id=++Pje,this.type=xl.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=r,this.sourceId=o,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 mS;(function(s){s[s.ExternalRemoval=0]="ExternalRemoval",s[s.NoParallelUniverses=1]="NoParallelUniverses"})(mS||(mS={}));class A2e{constructor(e,t){this.resourceLabel=e,this.reason=t}}class E2e{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements)(n.reason===mS.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 BCt{constructor(e,t,i,n,r,o,a){this.id=++Pje,this.type=xl.Workspace,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=r,this.sourceId=o,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 E2e),this.removedResources.has(t)||this.removedResources.set(t,new A2e(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 E2e),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new A2e(e,mS.ExternalRemoval)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Fje{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===xl.Workspace&&e.removeResource(this.resourceLabel,this.strResource,mS.ExternalRemoval);for(const e of this._future)e.type===xl.Workspace&&e.removeResource(this.resourceLabel,this.strResource,mS.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===xl.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e);for(const t of this._future)t.type===xl.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e)}_setElementValidFlag(e,t){e.type===xl.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===xl.Workspace&&t.removeResource(this.resourceLabel,this.strResource,mS.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 kje(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,r=-1;for(let a=0,c=this._past.length;a=t||l.id!==e.elements[n])&&(i=!1,r=0),!i&&l.type===xl.Workspace&&l.removeResource(this.resourceLabel,this.strResource,mS.ExternalRemoval)}let o=-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,o=a),!i&&c.type===xl.Workspace&&c.removeResource(this.resourceLabel,this.strResource,mS.ExternalRemoval)}r!==-1&&(this._past=this._past.slice(0,r)),o!==-1&&(this._future=this._future.slice(o+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 khe{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=o,i=n)}return[t,i]}canUndo(e){if(e instanceof j0){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,n,r){const o=this._acquireLocks(i);let a;try{a=t()}catch(c){return o(),n.dispose(),this._onError(c,e)}return a?a.then(()=>(o(),n.dispose(),r()),c=>(o(),n.dispose(),this._onError(c,e))):(o(),n.dispose(),r())}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!==xl.Workspace||typeof e.actual.prepareUndoRedo>"u")return t(V.None);const i=e.actual.prepareUndoRedo();return i?xN(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)||Oje);return new khe(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new iK(this._undo(e,0,!0));for(const r of t.strResources)this.removeElements(r);return this._notificationService.warn(n),new iK}_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 r=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&r.push(a.resourceLabel);if(r.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,r.join(", ")));const o=[];for(const a of i.editStacks)a.locked&&o.push(a.resourceLabel);return o.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,o.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),r=this._checkWorkspaceUndo(e,t,n,!1);return r?r.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:Ze.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 r;try{r=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const o=this._checkWorkspaceUndo(e,t,i,!0);if(o)return r.dispose(),o.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,r,()=>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 khe([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,r]of this._editStacks){const o=r.getClosestPastElement();o&&o.groupId===e&&(!t||o.groupOrder>t.groupOrder)&&(t=o,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 j0){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),r=n.getClosestPastElement();if(!r)return;if(r.groupId){const[a,c]=this._findClosestUndoElementInGroup(r.groupId);if(r!==a&&c)return this._undo(c,t,i)}if((r.sourceId!==t||r.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,r);try{return r.type===xl.Workspace?this._workspaceUndo(e,r,i):this._resourceUndo(n,r,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,r]of this._editStacks){const o=r.getClosestFutureElement();o&&o.sourceId===e&&(!t||o.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,g(1205,"Could not redo '{0}' across all files because changes were made to {1}",t.label,r.join(", ")));const o=[];for(const a of i.editStacks)a.locked&&o.push(a.resourceLabel);return o.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,o.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(o){return this._onError(o,t)}const r=this._checkWorkspaceRedo(e,t,i,!0);if(r)return n.dispose(),r.returnValue;for(const o of i.editStacks)o.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 khe([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,r]of this._editStacks){const o=r.getClosestFutureElement();o&&o.groupId===e&&(!t||o.groupOrdertae(zY.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Qa(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 Tht(6),this._cache.set(i,n));const r=Qa(n.update(t),this._min,this._max);return IA(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${r}ms`),r}_overall(){const e=new NTe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Qa(e,this._min,this._max)}}let Yme=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,r=i?.max??n**2,o=i?.key??void 0,a=`${zY.of(e)},${n}${o?","+o:""}`;let c=this._data.get(a);return c||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),c=new WCt(n*1.5)):c=new HCt(this._logService,t,e,this._overallAverage()|0||n*1.5,n,r),this._data.set(a,c)),c}_overallAverage(){const e=new NTe;for(const t of this._data.values())e.update(t.default());return e.value}};Yme=D([_(0,Ke),_(1,ec)],Yme);ce(xp,Yme,Qt.Delayed);function Ihe(s,e){return e&&(s.stack||s.stacktrace)?g(568,"{0}: {1}",D2e(s),x2e(s.stack)||x2e(s.stacktrace)):D2e(s)}function x2e(s){return Array.isArray(s)?s.join(` `):s}function D2e(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 Po(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=Oi(s),i=Po(t[0],e);return t.length>1?g(571,"{0} ({1} errors in total)",i,t.length):i}if(Rt(s))return s;if(s.detail){const t=s.detail;if(t.error)return Ihe(t.error,e);if(t.exception)return Ihe(t.exception,e)}return s.stack?Ihe(s,e):s.message?s.message:g(570,"An unknown error occurred. Please consult the log for more details.")}function UCt(s){const e=s;return e instanceof Error&&Array.isArray(e.actions)}function VCt(s,e){let t;return typeof s=="string"?t=new Error(s):t=s,t.actions=e,t}function Bje(s){return dc(s)}var Kn;(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"})(Kn||(Kn={}));const KLe=Kn.Info;function $Y(s,e,t){switch(e){case Kn.Trace:s.trace(t);break;case Kn.Debug:s.debug(t);break;case Kn.Info:s.info(t);break;case Kn.Warning:s.warn(t);break;case Kn.Error:s.error(t);break;case Kn.Off:break;default:throw new Error(`Invalid log level ${e}`)}}function mP(s,e=!1){let t="";for(let i=0;i0?" ":"")+n}return t}class qLe extends V{constructor(){super(...arguments),this.level=KLe,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!==Kn.Off&&this.level<=e}}class xae extends qLe{constructor(e){super(),this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...t){this.checkLogLevel(Kn.Trace)&&this.log(Kn.Trace,mP([e,...t],!0))}debug(e,...t){this.checkLogLevel(Kn.Debug)&&this.log(Kn.Debug,mP([e,...t]))}info(e,...t){this.checkLogLevel(Kn.Info)&&this.log(Kn.Info,mP([e,...t]))}warn(e,...t){this.checkLogLevel(Kn.Warning)&&this.log(Kn.Warning,mP([e,...t]))}error(e,...t){if(this.checkLogLevel(Kn.Error))if(e instanceof Error){const i=Array.prototype.slice.call(arguments);i[0]=e.stack,this.log(Kn.Error,mP(i))}else this.log(Kn.Error,mP([e,...t]))}flush(){}}let zCt=class extends qLe{constructor(e=KLe,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Kn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Kn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Kn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Kn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Kn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}flush(){}};class $Ct extends qLe{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 Wje extends V{constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new gi,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 Rt(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=Rt(e)?e:t?.id??Hc(i.toString()).toString(16);let r=this._loggers.get(i)?.logger;const o=t?.logLevel==="always"?Kn.Trace:t?.logLevel;r||(r=this.doCreateLogger(i,o??this.getLogLevel(i)??this.logLevel,{...t,id:n}));const a={logger:r,info:{resource:i,id:n,logLevel:o,name:t?.name,hidden:t?.hidden,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(a.info),this._loggers.set(i,a),r}toResource(e){return Rt(e)?Ft(this.logsHome,`${e}.log`):e}setLogLevel(e,t){if(N.isUri(e)){const i=e,n=t,r=this._loggers.get(i);r&&n!==r.info.logLevel&&(r.info.logLevel=n===this.logLevel?void 0:n,r.logger?.setLevel(n),this._loggers.set(r.info.resource,r),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 Hje{constructor(){this.onDidChangeLogLevel=new I().event}setLevel(e){}getLevel(){return Kn.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}critical(e,...t){}dispose(){}flush(){}}class GCt extends Hje{}function f3(s){switch(s){case Kn.Trace:return"trace";case Kn.Debug:return"debug";case Kn.Info:return"info";case Kn.Warning:return"warn";case Kn.Error:return"error";case Kn.Off:return"off"}}function Uje(s){switch(s){case"trace":return Kn.Trace;case"debug":return Kn.Debug;case"info":return Kn.Info;case"warn":return Kn.Warning;case"error":return Kn.Error;case"critical":return Kn.Error;case"off":return Kn.Off}}const KCt=new Q("logLevel",f3(Kn.Info));class k5{static create(e,t){return new k5(e,new GY(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,r,o]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new k5(this._startLineNumber,n),new k5(this._startLineNumber+o,r)]}applyEdit(e,t){const[i,n,r]=kb(t);this.acceptEdit(e,i,n,r,t.length>0?t.charCodeAt(0):B.Null)}acceptEdit(e,t,i,n,r){this._acceptDeleteRange(e),this._acceptInsertText(new re(e.startLineNumber,e.startColumn),t,i,n,r),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 r=i-t;this._startLineNumber-=r;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 r=-t;this._startLineNumber-=r,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,r){if(t===0&&i===0)return;const o=e.lineNumber-this._startLineNumber;if(o<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();o>=a+1||this._tokens.acceptInsertText(o,e.column-1,t,i,n,r)}}class GY{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=n-1;else{let o=n;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let a=n;for(;ae||u===e&&p>=t)&&(ue||p===e&&v>=t){if(pr?m-=r-i:m=i;else if(f===t&&p===i)if(f===n&&m>r)m-=r-i;else{d=!0;continue}else if(fr)f=t,p=i,m=p+(m-r);else{d=!0;continue}else if(f>n){if(c===0&&!d){l=a;break}f-=c}else if(f===n&&p>=r)e&&f===0&&(p+=e,m+=e),f-=c,p-=r-i,m-=r-i;else throw new Error("Not possible!");const b=4*l;o[b]=f,o[b+1]=p,o[b+2]=m,o[b+3]=v,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,r,o){const a=i===0&&n===1&&(o>=B.Digit0&&o<=B.Digit9||o>=B.A&&o<=B.Z||o>=B.a&&o<=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")o=QO.NO_STYLING;else{if(o=0,typeof d.italic<"u"){const h=(d.italic?Vr.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!==QO.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=k5.create(p,u);o.push(b)}return o}class qCt{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}const KC=class KC{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=KC._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const r=this._elements;this._currentLengthIndex++,this._currentLength=KC._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 Jme(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};Zme=D([_(0,mn),_(1,Ke),_(2,Di)],Zme);ce(Dae,Zme,Qt.Delayed);const P1="**",e_e="/",zq="[/\\\\]",$q="[^/\\\\]",QCt=/\//g;function I2e(s,e){switch(s){case 0:return"";case 1:return`${$q}*?`;default:return`(?:${zq}|${$q}+${zq}${e?`|${zq}${$q}+`:""})*?`}}function t_e(s,e){if(!s)return[];const t=[];let i=!1,n=!1,r="";for(const o of s){switch(o){case e:if(!i&&!n){t.push(r),r="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}r+=o}return r&&t.push(r),t}function zje(s){if(!s)return"";let e="";const t=t_e(s,e_e);if(t.every(i=>i===P1))e=".*";else{let i=!1;t.forEach((n,r)=>{if(n===P1){if(i)return;e+=I2e(2,r===t.length-1)}else{let o=!1,a="",c=!1,l="";for(const d of n){if(d!=="}"&&o){a+=d;continue}if(c&&(d!=="]"||!l)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!l?h="^":d===e_e?h="":h=Nh(d),l+=h;continue}switch(d){case"{":o=!0;continue;case"[":c=!0;continue;case"}":{const u=`(?:${t_e(a,",").map(f=>zje(f)).join("|")})`;e+=u,o=!1,a="";break}case"]":{e+="["+l+"]",c=!1,l="";break}case"?":e+=$q;continue;case"*":e+=I2e(1);continue;default:e+=Nh(d)}}rQLe(a,e)).filter(a=>a!==By),s),i=t.length;if(!i)return By;if(i===1)return t[0];const n=function(a,c){for(let l=0,d=t.length;l!!a.allBasenames);r&&(n.allBasenames=r.allBasenames);const o=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return o.length&&(n.allPaths=o),n}function M2e(s,e,t){const i=au===zi.sep,n=i?s:s.replace(QCt,au),r=au+n,o=zi.sep+s;let a;return t?a=function(c,l){return typeof c=="string"&&(c===n||c.endsWith(r)||!i&&(c===s||c.endsWith(o)))?e:null}:a=function(c,l){return typeof c=="string"&&(c===n||!i&&c===s)?e:null},a.allPaths=[(t?"*/":"./")+s],a}function sSt(s){try{const e=new RegExp(`^${zje(s)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?s:null}}catch{return By}}function jO(s,e,t){return!s||typeof e!="string"?!1:X_(s)(e,void 0,t)}function X_(s,e={}){if(!s)return L2e;if(typeof s=="string"||$je(s)){const t=QLe(s,e);if(t===By)return L2e;const i=function(n,r){return!!t(n,r)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return rSt(s,e)}function $je(s){const e=s;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function rSt(s,e){const t=Gje(Object.getOwnPropertyNames(s).map(a=>oSt(a,s[a],e)).filter(a=>a!==By)),i=t.length;if(!i)return By;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},r=t.find(a=>!!a.allBasenames);r&&(n.allBasenames=r.allBasenames);const o=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return o.length&&(n.allPaths=o),n}function oSt(s,e,t){if(e===!1)return By;const i=QLe(s,t);if(i===By)return By;if(typeof e=="boolean")return i;if(e){const n=e.when;if(typeof n=="string"){const r=(o,a,c,l)=>{if(!l||!i(o,a))return null;const d=n.replace("$(basename)",()=>c),h=l(d);return Xy(h)?h.then(u=>u?s:null):h?s:null};return r.requiresSiblings=!0,r}}return i}function Gje(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 r=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};r.basenames=i,r.patterns=n,r.allBasenames=i;const o=s.filter(a=>!a.basenames);return o.push(r),o}function kae(s,e,t,i,n,r){if(Array.isArray(s)){let o=0;for(const a of s){const c=kae(a,e,t,i,n,r);if(c===10)return c;c>o&&(o=c)}return o}else{if(typeof s=="string")return i?s==="*"?5:s===t?10:0:0;if(s){const{language:o,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(o)if(o===t)h=10;else if(o==="*")h=Math.max(h,5);else return 0;if(d)if(d===r)h=10;else if(d==="*"&&r!==void 0)h=Math.max(h,5);else return 0;if(a){let u;if(typeof a=="string"?u=a:u={...a,base:Bk(a.base)},u===e.fsPath||jO(u,e.fsPath))h=10;else return 0}return h}else return 0}}function Kje(s){return typeof s=="string"?!1:Array.isArray(s)?s.some(Kje):!!s.notebookType}function qje(s){return typeof s=="string"?!1:Array.isArray(s)?s.every(qje):!!s.exclusive}class N2e{constructor(e,t,i,n,r){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n,this.recursive=r}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 or{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,r=>{i&&n===r._score?i.push(r.provider):(n=r._score,i=[r.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 N2e(e.uri,e.getLanguageId(),i.uri,i.type,t):new N2e(e.uri,e.getLanguageId(),void 0,void 0,t);if(!this._lastCandidate?.equals(n)){this._lastCandidate=n;for(const r of this._entries)if(r._score=kae(r.selector,n.uri,n.languageId,Py(e),n.notebookUri,n.notebookType),qje(r.selector)&&r._score>0)if(t)r._score=0;else{for(const o of this._entries)o._score=0;r._score=1e3;break}this._entries.sort(or._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:hV(e.selector)&&!hV(t.selector)?1:!hV(e.selector)&&hV(t.selector)?-1:e._timet._time?-1:0}}function hV(s){return typeof s=="string"?!1:Array.isArray(s)?s.some(hV):!!s.isBuiltin}class aSt{constructor(){this.referenceProvider=new or(this._score.bind(this)),this.renameProvider=new or(this._score.bind(this)),this.newSymbolNamesProvider=new or(this._score.bind(this)),this.codeActionProvider=new or(this._score.bind(this)),this.definitionProvider=new or(this._score.bind(this)),this.typeDefinitionProvider=new or(this._score.bind(this)),this.declarationProvider=new or(this._score.bind(this)),this.implementationProvider=new or(this._score.bind(this)),this.documentSymbolProvider=new or(this._score.bind(this)),this.inlayHintsProvider=new or(this._score.bind(this)),this.colorProvider=new or(this._score.bind(this)),this.codeLensProvider=new or(this._score.bind(this)),this.documentFormattingEditProvider=new or(this._score.bind(this)),this.documentRangeFormattingEditProvider=new or(this._score.bind(this)),this.onTypeFormattingEditProvider=new or(this._score.bind(this)),this.signatureHelpProvider=new or(this._score.bind(this)),this.hoverProvider=new or(this._score.bind(this)),this.documentHighlightProvider=new or(this._score.bind(this)),this.multiDocumentHighlightProvider=new or(this._score.bind(this)),this.selectionRangeProvider=new or(this._score.bind(this)),this.foldingRangeProvider=new or(this._score.bind(this)),this.linkProvider=new or(this._score.bind(this)),this.inlineCompletionsProvider=new or(this._score.bind(this)),this.inlineEditProvider=new or(this._score.bind(this)),this.completionProvider=new or(this._score.bind(this)),this.linkedEditingRangeProvider=new or(this._score.bind(this)),this.inlineValuesProvider=new or(this._score.bind(this)),this.evaluatableExpressionProvider=new or(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new or(this._score.bind(this)),this.documentSemanticTokensProvider=new or(this._score.bind(this)),this.documentDropEditProvider=new or(this._score.bind(this)),this.documentPasteEditProvider=new or(this._score.bind(this)),this.mappedEditsProvider=new or(this._score.bind(this))}setNotebookTypeResolver(e){this._notebookTypeResolver=e}_score(e){return this._notebookTypeResolver?.(e)}}ce(nt,aSt,Qt.Delayed);const tc=ae("hoverService"),bf=ae("contextViewService"),lo=ae("contextMenuService");var cSt='.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}';gt(cSt,{});var lSt='.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}';gt(lSt,{});const nK=fe;var vr;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT",s[s.BELOW=2]="BELOW",s[s.ABOVE=3]="ABOVE"})(vr||(vr={}));let jLe=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 MU(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class YLe extends V{static render(e,t,i){return new YLe(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=oe(e,nK("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=oe(this.actionContainer,nK("a.action")),this.action.setAttribute("role","button"),t.iconClass&&oe(this.action,nK(`span.icon.${t.iconClass}`));const n=oe(this.action,nK("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._store.add(new jje(this.actionContainer,t.run)),this._store.add(new Yje(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 Qje(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 jje extends V{constructor(e,t){super(),this._register(ue(e,ke.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class Yje extends V{constructor(e,t,i){super(),this._register(ue(e,ke.KEY_DOWN,n=>{const r=new xn(n);i.some(o=>r.equals(o))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}}var Pd;(function(s){function e(r,o){if(r.start>=o.end||o.start>=r.end)return{start:0,end:0};const a=Math.max(r.start,o.start),c=Math.min(r.end,o.end);return c-a<=0?{start:0,end:0}:{start:a,end:c}}s.intersect=e;function t(r){return r.end-r.start<=0}s.isEmpty=t;function i(r,o){return!t(e(r,o))}s.intersects=i;function n(r,o){const a=[],c={start:r.start,end:Math.min(o.start,r.end)},l={start:Math.max(o.end,r.start),end:r.end};return t(c)||a.push(c),t(l)||a.push(l),a}s.relativeComplement=n})(Pd||(Pd={}));var dSt=".context-view{position:absolute}.context-view.fixed{all:initial;color:inherit;font-family:inherit;font-size:13px;position:fixed}";gt(dSt,{});var qw;(function(s){s[s.ABSOLUTE=1]="ABSOLUTE",s[s.FIXED=2]="FIXED",s[s.FIXED_SHADOW=3]="FIXED_SHADOW"})(qw||(qw={}));function hSt(s){const e=s;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Cb;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT"})(Cb||(Cb={}));var Gf;(function(s){s[s.BELOW=0]="BELOW",s[s.ABOVE=1]="ABOVE"})(Gf||(Gf={}));var qY;(function(s){s[s.VERTICAL=0]="VERTICAL",s[s.HORIZONTAL=1]="HORIZONTAL"})(qY||(qY={}));var Ff;(function(s){s[s.Before=0]="Before",s[s.After=1]="After"})(Ff||(Ff={}));var Lx;(function(s){s[s.AVOID=0]="AVOID",s[s.ALIGN=1]="ALIGN"})(Lx||(Lx={}));function fF(s,e,t){const i=t.mode===Lx.ALIGN?t.offset:t.offset+t.size,n=t.mode===Lx.ALIGN?t.offset+t.size:t.offset;return t.position===Ff.Before?e<=s-i?i:e<=n?n-e:Math.max(s-e,0):e<=n?n-e:e<=s-i?i:0}const tO=class tO 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"),Gd(this.view),this.setContainer(e,t),this._register(Ee(()=>this.setContainer(null,qw.ABSOLUTE)))}setContainer(e,t){this.useFixedPosition=t!==qw.ABSOLUTE;const i=this.useShadowDOM;if(this.useShadowDOM=t===qw.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 r=document.createElement("style");r.textContent=uSt,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(fe("slot"))}else this.container.appendChild(this.view);const n=new Z;tO.BUBBLE_UP_EVENTS.forEach(r=>{n.add(Rr(this.container,r,o=>{this.onDOMEvent(o,!1)}))}),tO.BUBBLE_DOWN_EVENTS.forEach(r=>{n.add(Rr(this.container,r,o=>{this.onDOMEvent(o,!0)},!0))}),this.toDisposeOnSetContainer=n}}show(e){this.isVisible()&&this.hide(),Ns(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",Xh(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&&!(gm&&NO.pointerEvents)){this.hide();return}this.delegate?.layout?.(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Jo(e)){const u=So(e),f=dqe(e);t={top:u.top*f,left:u.left*f,width:u.width*f,height:u.height*f}}else hSt(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=Od(this.view),n=vb(this.view),r=this.delegate.anchorPosition||Gf.BELOW,o=this.delegate.anchorAlignment||Cb.LEFT,a=this.delegate.anchorAxisAlignment||qY.VERTICAL;let c,l;const d=Ry();if(a===qY.VERTICAL){const u={offset:t.top-d.pageYOffset,size:t.height,position:r===Gf.BELOW?Ff.Before:Ff.After},f={offset:t.left,size:t.width,position:o===Cb.LEFT?Ff.Before:Ff.After,mode:Lx.ALIGN};c=fF(d.innerHeight,n,u)+d.pageYOffset,Pd.intersects({start:c,end:c+n},{start:u.offset,end:u.offset+u.size})&&(f.mode=Lx.AVOID),l=fF(d.innerWidth,i,f)}else{const u={offset:t.left,size:t.width,position:o===Cb.LEFT?Ff.Before:Ff.After},f={offset:t.top,size:t.height,position:r===Gf.BELOW?Ff.Before:Ff.After,mode:Lx.ALIGN};l=fF(d.innerWidth,i,u),Pd.intersects({start:l,end:l+i},{start:u.offset,end:u.offset+u.size})&&(f.mode=Lx.AVOID),c=fF(d.innerHeight,n,f)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(r===Gf.BELOW?"bottom":"top"),this.view.classList.add(o===Cb.LEFT?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=So(this.container);this.view.style.top=`${c-(this.useFixedPosition?So(this.view).top:h.top)}px`,this.view.style.left=`${l-(this.useFixedPosition?So(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(),Gd(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,lt(e).document.activeElement):t&&!yc(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};tO.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],tO.BUBBLE_DOWN_EVENTS=["click"];let i_e=tO;const uSt=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ @@ -158,7 +158,7 @@ Received: '{1}'.`,e,c4.getLexeme(t)),r=t.offset,o=c4.getLexeme(t);return this._p :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; } `,Ar=ae("openerService");function gSt(s,e={}){const t=XLe(e);return t.textContent=s,t}function JLe(s,e={}){const t=XLe(e);return Jje(t,pSt(s,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function XLe(s){const e=s.inline?"span":"div",t=document.createElement(e);return s.className&&(t.className=s.className),t}class fSt{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 _a;(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"})(_a||(_a={}));function Jje(s,e,t,i){let n;if(e.type===_a.Text)n=document.createTextNode(e.content||"");else if(e.type===_a.Bold)n=document.createElement("b");else if(e.type===_a.Italics)n=document.createElement("i");else if(e.type===_a.Code&&i)n=document.createElement("code");else if(e.type===_a.Action&&t){const r=document.createElement("a");t.disposables.add(Rr(r,"click",o=>{t.callback(String(e.index),o)})),n=r}else e.type===_a.NewLine?n=document.createElement("br"):e.type===_a.Root&&(n=s);n&&s!==n&&s.appendChild(n),n&&Array.isArray(e.children)&&e.children.forEach(r=>{Jje(n,r,t,i)})}function pSt(s,e){const t={type:_a.Root,children:[]};let i=0,n=t;const r=[],o=new fSt(s);for(;!o.eos();){let a=o.next();const c=a==="\\"&&n_e(o.peek(),e)!==_a.Invalid;if(c&&(a=o.next()),!c&&mSt(a,e)&&a===o.peek()){o.advance(),n.type===_a.Text&&(n=r.pop());const l=n_e(a,e);if(n.type===l||n.type===_a.Action&&l===_a.ActionClose)n=r.pop();else{const d={type:l,children:[]};l===_a.Action&&(d.index=i,i++),n.children.push(d),r.push(n),n=d}}else if(a===` -`)n.type===_a.Text&&(n=r.pop()),n.children.push({type:_a.NewLine});else if(n.type!==_a.Text){const l={type:_a.Text,content:a};n.children.push(l),r.push(n),n=l}else n.content+=a}return n.type===_a.Text&&(n=r.pop()),t}function mSt(s,e){return n_e(s,e)!==_a.Invalid}function n_e(s,e){switch(s){case"*":return _a.Bold;case"_":return _a.Italics;case"[":return _a.Action;case"]":return _a.ActionClose;case"`":return e?_a.Code:_a.Invalid;default:return _a.Invalid}}const _St=new RegExp(`(\\\\)?\\$\\((${He.iconNameExpression}(?:${He.iconModifierExpression})?)\\)`,"g");function Ib(s){const e=new Array;let t,i=0,n=0;for(;(t=_St.exec(s))!==null;){n=t.index||0,i0)return new Uint32Array(e)}let Rf=0;const rx=new Uint32Array(10);function bSt(s){if(Rf=0,Jb(s,Lhe,Hl.InitialConsonant),Rf>0||(Jb(s,Rhe,Hl.Vowel),Rf>0)||(Jb(s,Mhe,Hl.FinalConsonant),Rf>0)||(Jb(s,zI,Hl.CompatibilityJamo),Rf))return rx.subarray(0,Rf);if(s>=44032&&s<=55203){const e=s-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),r=t%28-1;if(i=0&&(r0)return rx.subarray(0,Rf)}}function Jb(s,e,t){s>=t&&s>8&&(rx[Rf++]=s>>8&255),s>>16&&(rx[Rf++]=s>>16&255))}var Hl;(function(s){s[s.InitialConsonant=4352]="InitialConsonant",s[s.Vowel=4449]="Vowel",s[s.FinalConsonant=4520]="FinalConsonant",s[s.CompatibilityJamo=12593]="CompatibilityJamo"})(Hl||(Hl={}));var Gt;(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"})(Gt||(Gt={}));var lr;(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"})(lr||(lr={}));const Lhe=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]),Rhe=new Uint16Array([Gt.k,Gt.o,Gt.i,Gt.O,Gt.j,Gt.p,Gt.u,Gt.P,Gt.h,lr.hk,lr.ho,lr.hl,Gt.y,Gt.n,lr.nj,lr.np,lr.nl,Gt.b,Gt.m,lr.ml,Gt.l]),Mhe=new Uint16Array([Gt.r,Gt.R,lr.rt,Gt.s,lr.sw,lr.sg,Gt.e,Gt.f,lr.fr,lr.fa,lr.fq,lr.ft,lr.fx,lr.fv,lr.fg,Gt.a,Gt.q,lr.qt,Gt.t,Gt.T,Gt.d,Gt.w,Gt.c,Gt.z,Gt.x,Gt.v,Gt.g]),zI=new Uint16Array([Gt.r,Gt.R,lr.rt,Gt.s,lr.sw,lr.sg,Gt.e,Gt.E,Gt.f,lr.fr,lr.fa,lr.fq,lr.ft,lr.fx,lr.fv,lr.fg,Gt.a,Gt.q,Gt.Q,lr.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,lr.hk,lr.ho,lr.hl,Gt.y,Gt.n,lr.nj,lr.np,lr.nl,Gt.b,Gt.m,lr.ml,Gt.l]);function eW(...s){return function(e,t){for(let i=0,n=s.length;i0?[{start:0,end:e.length}]:[]:null}function Iae(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t===-1?null:[{start:t,end:t+s.length}]}function Zje(s,e){return s_e(s.toLowerCase(),e.toLowerCase(),0,0)}function s_e(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=s_e(s,e,t+1,i+1))?tRe({start:i,end:i+1},n):null}return s_e(s,e,t,i+1)}function ZLe(s){return B.a<=s&&s<=B.z}function E6(s){return B.A<=s&&s<=B.Z}function eRe(s){return B.Digit0<=s&&s<=B.Digit9}function eYe(s){return s===B.Space||s===B.Tab||s===B.LineFeed||s===B.CarriageReturn}const tYe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(s=>tYe.add(s.charCodeAt(0)));function QY(s){return eYe(s)||tYe.has(s)}function P2e(s,e){return s===e||QY(s)&&QY(e)}const Nhe=new Map;function F2e(s){if(Nhe.has(s))return Nhe.get(s);let e;const t=vSt(s);return t&&(e=t),Nhe.set(s,e),e}function iYe(s){return ZLe(s)||E6(s)||eRe(s)}function tRe(s,e){return e.length===0?e=[s]:s.end===e[0].start?e[0].start=s.start:e.unshift(s),e}function nYe(s,e){for(let t=e;t0&&!iYe(s.charCodeAt(t-1)))return t}return s.length}function r_e(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,r=i+1;for(n=r_e(s,e,t+1,i+1);!n&&(r=nYe(e,r)).6}function SSt(s){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=s;return t>.2&&e<.8&&i>.6&&n<.2}function ASt(s){let e=0,t=0,i=0,n=0;for(let r=0;r60&&(e=e.substring(0,60));const t=ySt(e);if(!SSt(t)){if(!CSt(t))return null;e=e.toLowerCase()}let i=null,n=0;for(s=s.toLowerCase();n0&&QY(s.charCodeAt(t-1)))return t;return s.length}const ESt=eW(kM,jY,Iae),xSt=eW(kM,jY,Zje),O2e=new pm(1e4);function YY(s,e,t=!1){if(typeof s!="string"||typeof e!="string")return null;let i=O2e.get(s);i||(i=new RegExp(Lct(s),"i"),O2e.set(s,i));const n=i.exec(e);return n?[{start:n.index,end:n.index+n[0].length}]:t?xSt(s,e):ESt(s,e)}function rYe(s,e){const t=qk(s,s.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?NU(t):null}function DSt(s,e,t,i,n,r){const o=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,r=e[e.length-1];r&&r.end===n?r.end=n+1:e.push({start:n,end:n+1})}return e}const Rx=128;function iRe(){const s=[],e=[];for(let t=0;t<=Rx;t++)e[t]=0;for(let t=0;t<=Rx;t++)s.push(e.slice(0));return s}function oYe(s){const e=[];for(let t=0;t<=s;t++)e[t]=0;return e}const aYe=oYe(2*Rx),a_e=oYe(2*Rx),SC=iRe(),$I=iRe(),sK=iRe();function rK(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!!xTe(t)}}function B2e(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 Gq(s,e,t){return e[s]!==t[s]}function cYe(s,e,t,i,n,r,o=!1){for(;eRx?Rx:s.length,c=i.length>Rx?Rx:i.length;if(t>=a||r>=c||a-t>c-r||!cYe(e,t,a,n,r,c,!0))return;kSt(a,c,t,r,e,n);let l=1,d=1,h=t,u=r;const f=[!1];for(l=1,h=t;hw,R=P?$I[l][d-1]+(SC[l][d-1]>0?-5:0):0,z=u>w+1&&SC[l][d-1]>0,G=z?$I[l][d-2]+(SC[l][d-2]>0?-5:0):0;if(z&&(!P||G>=R)&&(!L||G>=k))$I[l][d]=G,sK[l][d]=Z0.LeftLeft,SC[l][d]=0;else if(P&&(!L||R>=k))$I[l][d]=R,sK[l][d]=Z0.Left,SC[l][d]=0;else if(L)$I[l][d]=k,sK[l][d]=Z0.Diag,SC[l][d]=SC[l-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!o.firstMatchCanBeWeak)return;l--,d--;const p=[$I[l][d],r];let m=0,v=0;for(;l>=1;){let w=d;do{const y=sK[l][w];if(y===Z0.LeftLeft)w=w-2;else if(y===Z0.Left)w=w-1;else break}while(w>=1);m>1&&e[t+l-1]===n[r+d-1]&&!Gq(w+r-1,i,n)&&m+1>SC[l][w]&&(w=d),w===d?m++:m=1,v||(v=w),l--,d=w-1,p.push(d)}c-r===a&&o.boostFullMatch&&(p[0]+=2);const b=v-a;return p[0]-=b,p}function kSt(s,e,t,i,n,r){let o=s-1,a=e-1;for(;o>=t&&a>=i;)n[o]===r[a]&&(a_e[o]=a,o--),a--}function ISt(s,e,t,i,n,r,o,a,c,l,d){if(e[t]!==r[o])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return o===t-i?h=s[t]===n[o]?7:5:Gq(o,n,r)&&(o===0||!Gq(o-1,n,r))?(h=s[t]===n[o]?7:5,u=!0):rK(r,o)&&(o===0||!rK(r,o-1))?h=5:(rK(r,o-1)||B2e(r,o-1))&&(h=5,u=!0),h>1&&t===i&&(d[0]=!0),u||(u=Gq(o,n,r)||rK(r,o-1)||B2e(r,o-1)),t===i?o>c&&(h-=u?3:5):l?h+=u?2:0:h+=u?0:1,o+1===a&&(h-=u?3:5),h}function TSt(s,e,t,i,n,r,o){return LSt(s,e,t,i,n,r,!0,o)}function LSt(s,e,t,i,n,r,o,a){let c=qk(s,e,t,i,n,r,a);if(c&&!o)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 RSt(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 MSt="$(",nRe=new RegExp(`\\$\\(${He.iconNameExpression}(?:${He.iconModifierExpression})?\\)`,"g"),NSt=new RegExp(`(\\\\)?${nRe.source}`,"g");function PSt(s){return s.replace(NSt,(e,t)=>t?e:`\\${e}`)}const FSt=new RegExp(`\\\\${nRe.source}`,"g");function OSt(s){return s.replace(FSt,e=>`\\${e}`)}const BSt=new RegExp(`(\\s)?(\\\\)?${nRe.source}(\\s)?`,"g");function Tae(s){return s.indexOf(MSt)===-1?s:s.replace(BSt,(e,t,i,n)=>i?e:t||n||"")}function lYe(s){return s?s.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const Phe=new RegExp(`\\$\\(${He.iconNameCharacter}+\\)`,"g");function pF(s){Phe.lastIndex=0;let e="";const t=[];let i=0;for(;;){const n=Phe.lastIndex,r=Phe.exec(s),o=s.substring(n,r?.index);if(o.length>0){e+=o;for(let a=0;a" ".repeat(n.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===JY.Break?`\\ +`)n.type===_a.Text&&(n=r.pop()),n.children.push({type:_a.NewLine});else if(n.type!==_a.Text){const l={type:_a.Text,content:a};n.children.push(l),r.push(n),n=l}else n.content+=a}return n.type===_a.Text&&(n=r.pop()),t}function mSt(s,e){return n_e(s,e)!==_a.Invalid}function n_e(s,e){switch(s){case"*":return _a.Bold;case"_":return _a.Italics;case"[":return _a.Action;case"]":return _a.ActionClose;case"`":return e?_a.Code:_a.Invalid;default:return _a.Invalid}}const _St=new RegExp(`(\\\\)?\\$\\((${He.iconNameExpression}(?:${He.iconModifierExpression})?)\\)`,"g");function Ib(s){const e=new Array;let t,i=0,n=0;for(;(t=_St.exec(s))!==null;){n=t.index||0,i0)return new Uint32Array(e)}let Rf=0;const rx=new Uint32Array(10);function bSt(s){if(Rf=0,Jb(s,Lhe,Ul.InitialConsonant),Rf>0||(Jb(s,Rhe,Ul.Vowel),Rf>0)||(Jb(s,Mhe,Ul.FinalConsonant),Rf>0)||(Jb(s,zI,Ul.CompatibilityJamo),Rf))return rx.subarray(0,Rf);if(s>=44032&&s<=55203){const e=s-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),r=t%28-1;if(i=0&&(r0)return rx.subarray(0,Rf)}}function Jb(s,e,t){s>=t&&s>8&&(rx[Rf++]=s>>8&255),s>>16&&(rx[Rf++]=s>>16&255))}var Ul;(function(s){s[s.InitialConsonant=4352]="InitialConsonant",s[s.Vowel=4449]="Vowel",s[s.FinalConsonant=4520]="FinalConsonant",s[s.CompatibilityJamo=12593]="CompatibilityJamo"})(Ul||(Ul={}));var Gt;(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"})(Gt||(Gt={}));var lr;(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"})(lr||(lr={}));const Lhe=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]),Rhe=new Uint16Array([Gt.k,Gt.o,Gt.i,Gt.O,Gt.j,Gt.p,Gt.u,Gt.P,Gt.h,lr.hk,lr.ho,lr.hl,Gt.y,Gt.n,lr.nj,lr.np,lr.nl,Gt.b,Gt.m,lr.ml,Gt.l]),Mhe=new Uint16Array([Gt.r,Gt.R,lr.rt,Gt.s,lr.sw,lr.sg,Gt.e,Gt.f,lr.fr,lr.fa,lr.fq,lr.ft,lr.fx,lr.fv,lr.fg,Gt.a,Gt.q,lr.qt,Gt.t,Gt.T,Gt.d,Gt.w,Gt.c,Gt.z,Gt.x,Gt.v,Gt.g]),zI=new Uint16Array([Gt.r,Gt.R,lr.rt,Gt.s,lr.sw,lr.sg,Gt.e,Gt.E,Gt.f,lr.fr,lr.fa,lr.fq,lr.ft,lr.fx,lr.fv,lr.fg,Gt.a,Gt.q,Gt.Q,lr.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,lr.hk,lr.ho,lr.hl,Gt.y,Gt.n,lr.nj,lr.np,lr.nl,Gt.b,Gt.m,lr.ml,Gt.l]);function eW(...s){return function(e,t){for(let i=0,n=s.length;i0?[{start:0,end:e.length}]:[]:null}function Iae(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t===-1?null:[{start:t,end:t+s.length}]}function Zje(s,e){return s_e(s.toLowerCase(),e.toLowerCase(),0,0)}function s_e(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=s_e(s,e,t+1,i+1))?tRe({start:i,end:i+1},n):null}return s_e(s,e,t,i+1)}function ZLe(s){return B.a<=s&&s<=B.z}function E6(s){return B.A<=s&&s<=B.Z}function eRe(s){return B.Digit0<=s&&s<=B.Digit9}function eYe(s){return s===B.Space||s===B.Tab||s===B.LineFeed||s===B.CarriageReturn}const tYe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(s=>tYe.add(s.charCodeAt(0)));function QY(s){return eYe(s)||tYe.has(s)}function P2e(s,e){return s===e||QY(s)&&QY(e)}const Nhe=new Map;function F2e(s){if(Nhe.has(s))return Nhe.get(s);let e;const t=vSt(s);return t&&(e=t),Nhe.set(s,e),e}function iYe(s){return ZLe(s)||E6(s)||eRe(s)}function tRe(s,e){return e.length===0?e=[s]:s.end===e[0].start?e[0].start=s.start:e.unshift(s),e}function nYe(s,e){for(let t=e;t0&&!iYe(s.charCodeAt(t-1)))return t}return s.length}function r_e(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,r=i+1;for(n=r_e(s,e,t+1,i+1);!n&&(r=nYe(e,r)).6}function SSt(s){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=s;return t>.2&&e<.8&&i>.6&&n<.2}function ASt(s){let e=0,t=0,i=0,n=0;for(let r=0;r60&&(e=e.substring(0,60));const t=ySt(e);if(!SSt(t)){if(!CSt(t))return null;e=e.toLowerCase()}let i=null,n=0;for(s=s.toLowerCase();n0&&QY(s.charCodeAt(t-1)))return t;return s.length}const ESt=eW(kM,jY,Iae),xSt=eW(kM,jY,Zje),O2e=new pm(1e4);function YY(s,e,t=!1){if(typeof s!="string"||typeof e!="string")return null;let i=O2e.get(s);i||(i=new RegExp(Lct(s),"i"),O2e.set(s,i));const n=i.exec(e);return n?[{start:n.index,end:n.index+n[0].length}]:t?xSt(s,e):ESt(s,e)}function rYe(s,e){const t=qk(s,s.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?NU(t):null}function DSt(s,e,t,i,n,r){const o=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,r=e[e.length-1];r&&r.end===n?r.end=n+1:e.push({start:n,end:n+1})}return e}const Rx=128;function iRe(){const s=[],e=[];for(let t=0;t<=Rx;t++)e[t]=0;for(let t=0;t<=Rx;t++)s.push(e.slice(0));return s}function oYe(s){const e=[];for(let t=0;t<=s;t++)e[t]=0;return e}const aYe=oYe(2*Rx),a_e=oYe(2*Rx),SC=iRe(),$I=iRe(),sK=iRe();function rK(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!!xTe(t)}}function B2e(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 Gq(s,e,t){return e[s]!==t[s]}function cYe(s,e,t,i,n,r,o=!1){for(;eRx?Rx:s.length,c=i.length>Rx?Rx:i.length;if(t>=a||r>=c||a-t>c-r||!cYe(e,t,a,n,r,c,!0))return;kSt(a,c,t,r,e,n);let l=1,d=1,h=t,u=r;const f=[!1];for(l=1,h=t;hw,R=P?$I[l][d-1]+(SC[l][d-1]>0?-5:0):0,z=u>w+1&&SC[l][d-1]>0,G=z?$I[l][d-2]+(SC[l][d-2]>0?-5:0):0;if(z&&(!P||G>=R)&&(!L||G>=k))$I[l][d]=G,sK[l][d]=Z0.LeftLeft,SC[l][d]=0;else if(P&&(!L||R>=k))$I[l][d]=R,sK[l][d]=Z0.Left,SC[l][d]=0;else if(L)$I[l][d]=k,sK[l][d]=Z0.Diag,SC[l][d]=SC[l-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!o.firstMatchCanBeWeak)return;l--,d--;const p=[$I[l][d],r];let m=0,v=0;for(;l>=1;){let w=d;do{const y=sK[l][w];if(y===Z0.LeftLeft)w=w-2;else if(y===Z0.Left)w=w-1;else break}while(w>=1);m>1&&e[t+l-1]===n[r+d-1]&&!Gq(w+r-1,i,n)&&m+1>SC[l][w]&&(w=d),w===d?m++:m=1,v||(v=w),l--,d=w-1,p.push(d)}c-r===a&&o.boostFullMatch&&(p[0]+=2);const b=v-a;return p[0]-=b,p}function kSt(s,e,t,i,n,r){let o=s-1,a=e-1;for(;o>=t&&a>=i;)n[o]===r[a]&&(a_e[o]=a,o--),a--}function ISt(s,e,t,i,n,r,o,a,c,l,d){if(e[t]!==r[o])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return o===t-i?h=s[t]===n[o]?7:5:Gq(o,n,r)&&(o===0||!Gq(o-1,n,r))?(h=s[t]===n[o]?7:5,u=!0):rK(r,o)&&(o===0||!rK(r,o-1))?h=5:(rK(r,o-1)||B2e(r,o-1))&&(h=5,u=!0),h>1&&t===i&&(d[0]=!0),u||(u=Gq(o,n,r)||rK(r,o-1)||B2e(r,o-1)),t===i?o>c&&(h-=u?3:5):l?h+=u?2:0:h+=u?0:1,o+1===a&&(h-=u?3:5),h}function TSt(s,e,t,i,n,r,o){return LSt(s,e,t,i,n,r,!0,o)}function LSt(s,e,t,i,n,r,o,a){let c=qk(s,e,t,i,n,r,a);if(c&&!o)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 RSt(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 MSt="$(",nRe=new RegExp(`\\$\\(${He.iconNameExpression}(?:${He.iconModifierExpression})?\\)`,"g"),NSt=new RegExp(`(\\\\)?${nRe.source}`,"g");function PSt(s){return s.replace(NSt,(e,t)=>t?e:`\\${e}`)}const FSt=new RegExp(`\\\\${nRe.source}`,"g");function OSt(s){return s.replace(FSt,e=>`\\${e}`)}const BSt=new RegExp(`(\\s)?(\\\\)?${nRe.source}(\\s)?`,"g");function Tae(s){return s.indexOf(MSt)===-1?s:s.replace(BSt,(e,t,i,n)=>i?e:t||n||"")}function lYe(s){return s?s.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const Phe=new RegExp(`\\$\\(${He.iconNameCharacter}+\\)`,"g");function pF(s){Phe.lastIndex=0;let e="";const t=[];let i=0;for(;;){const n=Phe.lastIndex,r=Phe.exec(s),o=s.substring(n,r?.index);if(o.length>0){e+=o;for(let a=0;a" ".repeat(n.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===JY.Break?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=` @@ -223,10 +223,10 @@ Please report this to https://github.com/markedjs/marked.`,e.silent)return"

An ${e}`)}function $At(s){return II(s,"`")}function GAt(s){return II(s,"*")}function KAt(s){return II(s,"_")}function qAt(s){return II(s,")")}function QAt(s){return II(s,'")')}function jAt(s){return II(s,"](https://microsoft.com)")}function YAt(s){return II(s,"**")}function JAt(s){return II(s,"__")}function II(s,e){const t=v3(Array.isArray(s)?s:[s]);return Ku.lexer(t+e)[0]}function XAt(s){const e=v3(s),t=e.split(` `);let i,n=!1;for(let r=0;r"u"&&o.match(/^\s*\|/)){const a=o.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(o.match(/^\s*\|/)){if(r!==t.length-1)return;n=!0}else return}if(typeof i=="number"&&i>0){const r=n?t.slice(0,-1).join(` `):e,o=!!r.match(/\|\s*$/),a=r+(o?"":"|")+` -|${" --- |".repeat(i)}`;return Ku.lexer(a)}}function q2e(s,e){return oqe(s,e),Ee(()=>aqe(s))}var ZAt=".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}";gt(ZAt,{});var u_e,pL;let Z_=(pL=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,r=n.add(x6(e,{...this._getRenderOptions(e,n),...t},i));return r.element.classList.add("rendered-markdown"),{element:r.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{let r;i?r=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(r=this._options.editor.getModel()?.getLanguageId()),r||(r=Sa);const o=await Zyt(this._languageService,n,r),a=document.createElement("span");if(a.innerHTML=u_e._ttpTokenizer?.createHTML(o)??o,this._options.editor){const c=this._options.editor.getOption(x.fontInfo);kl(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=>Rae(this._openerService,i,e.isTrusted),disposables:t}}}},u_e=pL,pL._ttpTokenizer=ZA("tokenizeToString",{createHTML(e){return e}}),pL);Z_=u_e=D([_(1,Di),_(2,Ar)],Z_);async function Rae(s,e,t){try{return await s.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:eEt(t)})}catch(i){return bt(i),!1}}function eEt(s){return s===!0?!0:s&&Array.isArray(s.enabledCommands)?s.enabledCommands:!1}const Xb=fe;var Uo;(function(s){s[s.PointerSize=3]="PointerSize",s[s.HoverBorderWidth=2]="HoverBorderWidth",s[s.HoverWindowEdgeMargin=2]="HoverWindowEdgeMargin"})(Uo||(Uo={}));let g_e=class extends _d{get _targetWindow(){return lt(this._target.targetElements[0])}get _targetDocumentElement(){return lt(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===vr.BELOW?Gf.BELOW:Gf.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,r,o){super(),this._keybindingService=t,this._configurationService=i,this._openerService=n,this._instantiationService=r,this._accessibilityService=o,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=>Rae(this._openerService,u,ud(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new tEt(e.target),this._hoverPointer=e.appearance?.showPointer?Xb("div.workbench-hover-pointer"):void 0,this._hover=this._register(new jLe),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??vr.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=Xb("div.hover-row.markdown-hover"),c=Xb("div.hover-contents");if(typeof e.content=="string")c.textContent=e.content,c.style.whiteSpace="pre-wrap";else if(Jo(e.content))c.appendChild(e.content),c.classList.add("html-hover-contents");else{const u=e.content,f=this._instantiationService.createInstance(Z_,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||dd.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=Xb("div.hover-row.status-bar"),f=Xb("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=Xb("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"||ud(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):l=e.persistence.hideOnHover,l&&e.appearance?.showHoverHint){const u=Xb("div.hover-row.status-bar"),f=Xb("div.info");f.textContent=g(4885,"Hold {0} key to mouse over",jt?"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 Q2e(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),l){const u=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new Q2e(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=nae(this._hoverContainer,Xb("div")),n=oe(this._hoverContainer,Xb("div"));i.tabIndex=0,n.tabIndex=0,this._register(ue(n,"focus",r=>{e.focus(),r.preventDefault()})),this._register(ue(i,"focus",r=>{t.focus(),r.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return r}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&Qje(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());i&&xh(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=dqe(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:r,left:o}=t[0],a=n-o,c=r-i,l={top:i,right:n,bottom:r,left:o,width:a,height:c,center:{x:o+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 vr.RIGHT:l.left+=Uo.PointerSize,l.right+=Uo.PointerSize,this._hoverContainer.style.paddingLeft=`${Uo.PointerSize}px`,this._hoverContainer.style.marginLeft=`${-Uo.PointerSize}px`;break;case vr.LEFT:l.left-=Uo.PointerSize,l.right-=Uo.PointerSize,this._hoverContainer.style.paddingRight=`${Uo.PointerSize}px`,this._hoverContainer.style.marginRight=`${-Uo.PointerSize}px`;break;case vr.BELOW:l.top+=Uo.PointerSize,l.bottom+=Uo.PointerSize,this._hoverContainer.style.paddingTop=`${Uo.PointerSize}px`,this._hoverContainer.style.marginTop=`${-Uo.PointerSize}px`;break;case vr.ABOVE:l.top-=Uo.PointerSize,l.bottom-=Uo.PointerSize,this._hoverContainer.style.paddingBottom=`${Uo.PointerSize}px`,this._hoverContainer.style.marginBottom=`${-Uo.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+Uo.HoverBorderWidth;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===vr.RIGHT?this._x=e.right:this._hoverPosition===vr.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-Uo.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?Uo.PointerSize:0;if(this._forcePosition){const i=t+Uo.HoverBorderWidth;this._hoverPosition===vr.RIGHT?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===vr.LEFT&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===vr.RIGHT?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=vr.LEFT:this._hoverPosition=vr.BELOW):this._hoverPosition===vr.LEFT&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=vr.RIGHT:this._hoverPosition=vr.BELOW),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=vr.RIGHT))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?Uo.PointerSize:0;this._hoverPosition===vr.ABOVE?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=vr.BELOW):this._hoverPosition===vr.BELOW&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=vr.ABOVE)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=(this._hoverPointer?Uo.PointerSize:0)+Uo.HoverBorderWidth;this._hoverPosition===vr.ABOVE?t=Math.min(t,e.top-i):this._hoverPosition===vr.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)-Uo.PointerSize}px`:this._hoverPointer.style.top=`${Math.round(t/2)-Uo.PointerSize}px`;break}case vr.ABOVE:case vr.BELOW:{this._hoverPointer.classList.add(this._hoverPosition===vr.ABOVE?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-Uo.PointerSize;const n=this._x+i;(ne.right)&&(i=e.center.x-this._x-Uo.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}};g_e=D([_(1,Vt),_(2,Te),_(3,Ar),_(4,we),_(5,_o)],g_e);class Q2e extends _d{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=lt(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(lt(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class tEt{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var of;(function(s){s[s.NoMatchingKb=0]="NoMatchingKb",s[s.MoreChordsNeeded=1]="MoreChordsNeeded",s[s.KbFound=2]="KbFound"})(of||(of={}));const ZY={kind:of.NoMatchingKb},iEt={kind:of.MoreChordsNeeded};function nEt(s,e,t){return{kind:of.KbFound,commandId:s,commandArgs:e,isBubble:t}}class YO{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const n of e){const r=n.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=YO.handleRemovals([].concat(e).concat(t));for(let n=0,r=this._keybindings.length;n"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const r=i[n];if(r.command===t.command)continue;let o=!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 r=t.length-1;r>=0;r--)i[n++]=t[r];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 r=i[n];if(t.contextMatchesRules(r.when))return r}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const r=this._map.get(n[0]);if(r===void 0)return this._log("\\ No keybinding entries."),ZY;let o=null;if(n.length<2)o=r;else{o=[];for(let c=0,l=r.length;cd.chords.length)continue;let h=!0;for(let u=1;u=0;i--){const n=t[i];if(YO._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function j2e(s){return s?`${s.serialize()}`:"no when condition"}function Y2e(s){return s.extensionId?s.isBuiltinExtension?`built-in extension ${s.extensionId}`:`user extension ${s.extensionId}`:s.isDefault?"built-in":"user"}let eJ=class extends V{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new i_e(this.layoutService.mainContainer,qw.ABSOLUTE)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(lt(t))?n=qw.ABSOLUTE:i?n=qw.FIXED_SHADOW:n=qw.FIXED:n=qw.ABSOLUTE,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const r={close:()=>{this.openContextView===r&&this.hideContextView()}};return this.openContextView=r,r}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};eJ=D([_(0,_u)],eJ);class sEt extends eJ{getContextViewElement(){return this.contextView.getViewElement()}}class rEt{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||Rt(e)||Jo(e))n=e;else if(!I2(e.markdown))n=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(g(4884,"Loading..."),t,i),this._cancellationTokenSource=new li;const r=this._cancellationTokenSource.token;if(n=await e.markdown(r),n===void 0&&(n=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const r={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n},position:{hoverPosition:vr.BELOW},...i};this._hoverWidget=this.hoverDelegate.showHover(r,t)}n?.dispose()}hasContent(e){return e?ud(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}let f_e=class extends V{constructor(e,t,i,n,r){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=n,this._accessibilityService=r,this._managedHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new eJ(this._layoutService))}showHover(e,t,i){if(J2e(this._currentHoverOptions)===J2e(e)||this._currentHover&&this._currentHoverOptions?.persistence?.sticky)return;this._currentHoverOptions=e,this._lastHoverOptions=e;const n=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),r=Wc();i||(n&&r?r.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=r):this._lastFocusedElementBeforeOpen=void 0);const o=new Z,a=this._instantiationService.createInstance(g_e,e);if(e.persistence?.sticky&&(a.isLocked=!0),a.onDispose(()=>{this._currentHover?.domNode&&FTe(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),o.dispose()},void 0,o),!e.container){const c=Jo(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(lt(c))}if(this._contextViewHandler.showContextView(new oEt(a,t),e.container),a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,o),e.persistence?.sticky)o.add(ue(lt(e.container).document,ke.MOUSE_DOWN,c=>{yc(c.target,a.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const l of e.target.targetElements)o.add(ue(l,ke.CLICK,()=>this.hideHover()));else o.add(ue(e.target,ke.CLICK,()=>this.hideHover()));const c=Wc();if(c){const l=lt(c).document;o.add(ue(c,ke.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),o.add(ue(l,ke.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),o.add(ue(c,ke.KEY_UP,d=>this._keyUp(d,a))),o.add(ue(l,ke.KEY_UP,d=>this._keyUp(d,a)))}}if("IntersectionObserver"in ri){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),o.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 xn(e);this._keybindingService.resolveKeyboardEvent(n).getSingleModifierDispatchChords().some(o=>!!o)||this._keybindingService.softDispatch(n,n.target).kind!==of.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 r,o;const a=(y,C)=>{const A=o!==void 0;y&&(o?.dispose(),o=void 0),C&&(r?.dispose(),r=void 0),A&&(e.onDidHideHover?.(),o=void 0)},c=(y,C,A,L)=>new Em(async()=>{(!o||o.isDisposed)&&(o=new rEt(e,A||t,y>0),await o.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(r)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,Jo(k.target)&&X2e(k.target,t)!==t&&a(!0,!0)};C.add(ue(t,ke.MOUSE_MOVE,L,!0))}r=C,!(Jo(y.target)&&X2e(y.target,t)!==t)&&C.add(c(e.delay,!1,A))},p=ue(t,ke.MOUSE_OVER,f,!0),m=()=>{if(l||r)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)),r=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 o?.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()}};f_e=D([_(0,we),_(1,lo),_(2,Vt),_(3,_u),_(4,_o)],f_e);function J2e(s){if(s!==void 0)return s?.id??s}class oEt{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 X2e(s,e){for(e=e??lt(s).document.body;!s.hasAttribute("custom-hover")&&s!==e;)s=s.parentElement;return s}ce(tc,f_e,Qt.Delayed);Ep((s,e)=>{const t=s.getColor(yQe);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 UN=ae("IWorkspaceEditService");class Mae{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(rA.is(t))return rA.lift(t);if(hp.is(t))return hp.lift(t);throw new Error("Unsupported edit")})}}class rA extends Mae{static is(e){return e instanceof rA?!0:In(e)&&N.isUri(e.resource)&&In(e.textEdit)}static lift(e){return e instanceof rA?e:new rA(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 hp extends Mae{static is(e){return e instanceof hp?!0:In(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof hp?e:new hp(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 Wl={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},Kb=Object.freeze({id:"editor",order:5,type:"object",title:g(1209,"Editor"),scope:ct.LANGUAGE_OVERRIDABLE}),tJ={...Kb,properties:{"editor.tabSize":{type:"number",default:$d.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:$d.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:$d.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:$d.trimAutoWhitespace,description:g(1214,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:$d.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:Wl.maxComputationTime,description:g(1234,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Wl.maxFileSize,description:g(1235,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Wl.renderSideBySide,description:g(1236,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Wl.renderSideBySideInlineBreakpoint,description:g(1237,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Wl.useInlineViewWhenSpaceIsLimited,description:g(1238,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Wl.renderMarginRevertIcon,description:g(1239,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Wl.renderGutterMenu,description:g(1240,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Wl.ignoreTrimWhitespace,description:g(1241,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Wl.renderIndicators,description:g(1242,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Wl.diffCodeLens,description:g(1243,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Wl.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:Wl.diffAlgorithm,markdownEnumDescriptions:[g(1247,"Uses the legacy diffing algorithm."),g(1248,"Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Wl.hideUnchangedRegions.enabled,markdownDescription:g(1249,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Wl.hideUnchangedRegions.revealLineCount,markdownDescription:g(1250,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Wl.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:Wl.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:Wl.experimental.showMoves,markdownDescription:g(1253,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Wl.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:Wl.experimental.useTrueInlineView,description:g(1255,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function aEt(s){return typeof s.type<"u"||typeof s.anyOf<"u"}for(const s of nF){const e=s.schema;if(typeof e<"u")if(aEt(e))tJ.properties[`editor.${s.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(tJ.properties[t]=e[t])}let dK=null;function EYe(){return dK===null&&(dK=Object.create(null),Object.keys(tJ.properties).forEach(s=>{dK[s]=!0})),dK}function cEt(s){return EYe()[`editor.${s}`]||!1}function lEt(s){return EYe()[`diffEditor.${s}`]||!1}const dEt=je.as(Pn.Configuration);dEt.registerConfiguration(tJ);var Cl;(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"})(Cl||(Cl={}));var pt;(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"})(pt||(pt={}));var Hr;(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"})(Hr||(Hr={}));var b3;(function(s){s.DEFAULT={allowTrailingComma:!0}})(b3||(b3={}));function sRe(s,e=!1){let t=0;const i=s.length;let n="",r=0,o=pt.Unknown,a=Cl.None;function c(m){let v=0,b=0;for(;v=ii._0&&w<=ii._9)b=b*16+w-ii._0;else if(w>=ii.A&&w<=ii.F)b=b*16+w-ii.A+10;else if(w>=ii.a&&w<=ii.f)b=b*16+w-ii.a+10;else break;t++,v++}return v=i){m+=s.substring(v,t),a=Cl.UnexpectedEndOfString;break}const b=s.charCodeAt(t);if(b===ii.doubleQuote){m+=s.substring(v,t),t++;break}if(b===ii.backslash){if(m+=s.substring(v,t),t++,t>=i){a=Cl.UnexpectedEndOfString;break}switch(s.charCodeAt(t++)){case ii.doubleQuote:m+='"';break;case ii.backslash:m+="\\";break;case ii.slash:m+="/";break;case ii.b:m+="\b";break;case ii.f:m+="\f";break;case ii.n:m+=` -`;break;case ii.r:m+="\r";break;case ii.t:m+=" ";break;case ii.u:{const y=c(4);y>=0?m+=String.fromCharCode(y):a=Cl.InvalidUnicode;break}default:a=Cl.InvalidEscapeCharacter}v=t;continue}if(b>=0&&b<=31)if(hK(b)){m+=s.substring(v,t),a=Cl.UnexpectedEndOfString;break}else a=Cl.InvalidCharacter;t++}return m}function u(){if(n="",a=Cl.None,r=t,t>=i)return r=i,o=pt.EOF;let m=s.charCodeAt(t);if(Hhe(m)){do t++,n+=String.fromCharCode(m),m=s.charCodeAt(t);while(Hhe(m));return o=pt.Trivia}if(hK(m))return t++,n+=String.fromCharCode(m),m===ii.carriageReturn&&s.charCodeAt(t)===ii.lineFeed&&(t++,n+=` -`),o=pt.LineBreakTrivia;switch(m){case ii.openBrace:return t++,o=pt.OpenBraceToken;case ii.closeBrace:return t++,o=pt.CloseBraceToken;case ii.openBracket:return t++,o=pt.OpenBracketToken;case ii.closeBracket:return t++,o=pt.CloseBracketToken;case ii.colon:return t++,o=pt.ColonToken;case ii.comma:return t++,o=pt.CommaToken;case ii.doubleQuote:return t++,n=h(),o=pt.StringLiteral;case ii.slash:{const v=t-1;if(s.charCodeAt(t+1)===ii.slash){for(t+=2;t=pt.LineCommentTrivia&&m<=pt.Trivia);return m}return{setPosition:l,getPosition:()=>t,scan:e?p:u,getToken:()=>o,getTokenValue:()=>n,getTokenOffset:()=>r,getTokenLength:()=>t-r,getTokenError:()=>a}}function Hhe(s){return s===ii.space||s===ii.tab||s===ii.verticalTab||s===ii.formFeed||s===ii.nonBreakingSpace||s===ii.ogham||s>=ii.enQuad&&s<=ii.zeroWidthSpace||s===ii.narrowNoBreakSpace||s===ii.mathematicalSpace||s===ii.ideographicSpace||s===ii.byteOrderMark}function hK(s){return s===ii.lineFeed||s===ii.carriageReturn||s===ii.lineSeparator||s===ii.paragraphSeparator}function _P(s){return s>=ii._0&&s<=ii._9}var ii;(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"})(ii||(ii={}));function af(s,e=[],t=b3.DEFAULT){let i=null,n=[];const r=[];function o(c){Array.isArray(n)?n.push(c):i!==null&&(n[i]=c)}return oRe(s,{onObjectBegin:()=>{const c={};o(c),r.push(n),n=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{n=r.pop()},onArrayBegin:()=>{const c=[];o(c),r.push(n),n=c,i=null},onArrayEnd:()=>{n=r.pop()},onLiteralValue:o,onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t),n[0]}function rRe(s,e=[],t=b3.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 r(c){return i.children.push(c),c}oRe(s,{onObjectBegin:c=>{i=r({type:"object",offset:c,length:-1,parent:i,children:[]})},onObjectProperty:(c,l,d)=>{i=r({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=r({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)=>{r({type:dD(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 p_e(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 r of t.children)if(Array.isArray(r.children)&&r.children[0].value===i){t=r.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 oRe(s,e,t=b3.DEFAULT){const i=sRe(s,!1);function n(R){return R?()=>R(i.getTokenOffset(),i.getTokenLength()):()=>!0}function r(R){return R?z=>R(z,i.getTokenOffset(),i.getTokenLength()):()=>!0}const o=n(e.onObjectBegin),a=r(e.onObjectProperty),c=n(e.onObjectEnd),l=n(e.onArrayBegin),d=n(e.onArrayEnd),h=r(e.onLiteralValue),u=r(e.onSeparator),f=n(e.onComment),p=r(e.onError),m=t&&t.disallowComments,v=t&&t.allowTrailingComma;function b(){for(;;){const R=i.scan();switch(i.getTokenError()){case Cl.InvalidUnicode:w(Hr.InvalidUnicode);break;case Cl.InvalidEscapeCharacter:w(Hr.InvalidEscapeCharacter);break;case Cl.UnexpectedEndOfNumber:w(Hr.UnexpectedEndOfNumber);break;case Cl.UnexpectedEndOfComment:m||w(Hr.UnexpectedEndOfComment);break;case Cl.UnexpectedEndOfString:w(Hr.UnexpectedEndOfString);break;case Cl.InvalidCharacter:w(Hr.InvalidCharacter);break}switch(R){case pt.LineCommentTrivia:case pt.BlockCommentTrivia:m?w(Hr.InvalidCommentToken):f();break;case pt.Unknown:w(Hr.InvalidSymbol);break;case pt.Trivia:case pt.LineBreakTrivia:break;default:return R}}}function w(R,z=[],G=[]){if(p(R),z.length+G.length>0){let Y=i.getToken();for(;Y!==pt.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 pt.NumericLiteral:{let R=0;try{R=JSON.parse(i.getTokenValue()),typeof R!="number"&&(w(Hr.InvalidNumberFormat),R=0)}catch{w(Hr.InvalidNumberFormat)}h(R);break}case pt.NullKeyword:h(null);break;case pt.TrueKeyword:h(!0);break;case pt.FalseKeyword:h(!1);break;default:return!1}return b(),!0}function A(){return i.getToken()!==pt.StringLiteral?(w(Hr.PropertyNameExpected,[],[pt.CloseBraceToken,pt.CommaToken]),!1):(y(!1),i.getToken()===pt.ColonToken?(u(":"),b(),P()||w(Hr.ValueExpected,[],[pt.CloseBraceToken,pt.CommaToken])):w(Hr.ColonExpected,[],[pt.CloseBraceToken,pt.CommaToken]),!0)}function L(){o(),b();let R=!1;for(;i.getToken()!==pt.CloseBraceToken&&i.getToken()!==pt.EOF;){if(i.getToken()===pt.CommaToken){if(R||w(Hr.ValueExpected,[],[]),u(","),b(),i.getToken()===pt.CloseBraceToken&&v)break}else R&&w(Hr.CommaExpected,[],[]);A()||w(Hr.ValueExpected,[],[pt.CloseBraceToken,pt.CommaToken]),R=!0}return c(),i.getToken()!==pt.CloseBraceToken?w(Hr.CloseBraceExpected,[pt.CloseBraceToken],[]):b(),!0}function k(){l(),b();let R=!1;for(;i.getToken()!==pt.CloseBracketToken&&i.getToken()!==pt.EOF;){if(i.getToken()===pt.CommaToken){if(R||w(Hr.ValueExpected,[],[]),u(","),b(),i.getToken()===pt.CloseBracketToken&&v)break}else R&&w(Hr.CommaExpected,[],[]);P()||w(Hr.ValueExpected,[],[pt.CloseBracketToken,pt.CommaToken]),R=!0}return d(),i.getToken()!==pt.CloseBracketToken?w(Hr.CloseBracketExpected,[pt.CloseBracketToken],[]):b(),!0}function P(){switch(i.getToken()){case pt.OpenBracketToken:return k();case pt.OpenBraceToken:return L();case pt.StringLiteral:return y(!0);default:return C()}}return b(),i.getToken()===pt.EOF?t.allowEmptyContent?!0:(w(Hr.ValueExpected,[],[]),!1):P()?(i.getToken()!==pt.EOF&&w(Hr.EndOfFileExpected,[],[]),!0):(w(Hr.ValueExpected,[],[]),!1)}function dD(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 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===B.Slash||this._splitOnBackslash&&i===B.Backslash))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Ih(new gEt(e,t))}static forPaths(e=!1){return new Ih(new I5(void 0,!e))}static forStrings(){return new Ih(new hEt)}static forConfigKeys(){return new Ih(new uEt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){const i=t.slice(0);zFe(i);for(const n of i)this.set(n,e)}else{const i=e.slice(0);zFe(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 uK,this._root.segment=i.value());const r=[];for(n=this._root;;){const a=i.cmp(n.segment);if(a>0)n.left||(n.left=new uK,n.left.segment=i.value()),r.push([sc.Left,n]),n=n.left;else if(a<0)n.right||(n.right=new uK,n.right.segment=i.value()),r.push([sc.Right,n]),n=n.right;else if(i.hasNext())i.next(),n.mid||(n.mid=new uK,n.mid.segment=i.value()),r.push([sc.Mid,n]),n=n.mid;else break}const o=n.value;n.value=t,n.key=e;for(let a=r.length-1;a>=0;a--){const c=r[a][1];c.updateHeight();const l=c.balanceFactor();if(l<-1||l>1){const d=r[a][0],h=r[a+1][0];if(d===sc.Right&&h===sc.Right)r[a][1]=c.rotateLeft();else if(d===sc.Left&&h===sc.Left)r[a][1]=c.rotateRight();else if(d===sc.Right&&h===sc.Left)c.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=c.rotateLeft();else if(d===sc.Left&&h===sc.Right)c.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=c.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case sc.Left:r[a-1][1].left=r[a][1];break;case sc.Right:r[a-1][1].right=r[a][1];break;case sc.Mid:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return o}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 r=this._root;for(;r;){const o=i.cmp(r.segment);if(o>0)n.push([sc.Left,r]),r=r.left;else if(o<0)n.push([sc.Right,r]),r=r.right;else if(i.hasNext())i.next(),n.push([sc.Mid,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const o=this._min(r.right);if(o.key){const{key:a,value:c,segment:l}=o;this._delete(o.key,!1),r.key=a,r.value=c,r.segment=l}}else{const o=r.left??r.right;if(n.length>0){const[a,c]=n[n.length-1];switch(a){case sc.Left:c.left=o;break;case sc.Mid:c.mid=o;break;case sc.Right:c.right=o;break}}else this._root=o}for(let o=n.length-1;o>=0;o--){const a=n[o][1];a.updateHeight();const c=a.balanceFactor();if(c>1?(a.right.balanceFactor()>=0||(a.right=a.right.rotateRight()),n[o][1]=a.rotateLeft()):c<-1&&(a.left.balanceFactor()<=0||(a.left=a.left.rotateLeft()),n[o][1]=a.rotateRight()),o>0)switch(n[o-1][0]){case sc.Left:n[o-1][1].left=n[o][1];break;case sc.Right:n[o-1][1].right=n[o][1];break;case sc.Mid:n[o-1][1].mid=n[o][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 r=t.cmp(i.segment);if(r>0)i=i.left;else if(r<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 r=i.cmp(n.segment);if(r>0)n=n.left;else if(r<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 rn;(function(s){s[s.Unknown=0]="Unknown",s[s.File=1]="File",s[s.Directory=2]="Directory",s[s.SymbolicLink=64]="SymbolicLink"})(rn||(rn={}));var up;(function(s){s[s.Readonly=1]="Readonly",s[s.Locked=2]="Locked"})(up||(up={}));var FE;(function(s){s[s.UPDATED=2]="UPDATED",s[s.ADDED=4]="ADDED",s[s.DELETED=8]="DELETED"})(FE||(FE={}));var zn;(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"})(zn||(zn={}));function Km(s){return!!(s.capabilities&zn.FileReadWrite)}function Z2e(s){return!!(s.capabilities&zn.FileFolderCopy)}function fEt(s){return!!(s.capabilities&zn.FileClone)}function mE(s){return!!(s.capabilities&zn.FileOpenReadWriteClose)}function qq(s){return!!(s.capabilities&zn.FileReadStream)}function Uhe(s){return Km(s)?!!(s.capabilities&zn.FileAtomicRead):!1}function eWe(s){return Km(s)?!!(s.capabilities&zn.FileAtomicWrite):!1}function pEt(s){return!!(s.capabilities&zn.FileAtomicDelete)}function mEt(s){return!!(s.capabilities&zn.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 LA extends Error{static create(e,t){const i=new LA(e.toString(),t);return xYe(i,t),i}constructor(e,t){super(e),this.code=t}}function gs(s,e){return LA.create(s,e)}function d0(s){return s||gs(g(0,"Unknown Error"),ot.Unknown)}function xYe(s,e){return s.name=e?`${e} (FileSystemError)`:"FileSystemError",s}function Qk(s){if(!s)return ot.Unknown;if(s instanceof LA)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 Qw(s){if(s instanceof Rd)return s.fileOperationResult;switch(Qk(s)){case ot.FileNotFound:return ji.FILE_NOT_FOUND;case ot.FileIsADirectory:return ji.FILE_IS_DIRECTORY;case ot.FileNotADirectory:return ji.FILE_NOT_DIRECTORY;case ot.FileWriteLocked:return ji.FILE_WRITE_LOCKED;case ot.NoPermissions:return ji.FILE_PERMISSION_DENIED;case ot.FileExists:return ji.FILE_MOVE_CONFLICT;case ot.FileTooLarge:return ji.FILE_TOO_LARGE;default:return ji.FILE_OTHER_ERROR}}var Ei;(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"})(Ei||(Ei={}));class vP{constructor(e,t,i){this.resource=e,this.operation=t,this.target=i}isOperation(e){return this.operation===e}}var Tr;(function(s){s[s.UPDATED=0]="UPDATED",s[s.ADDED=1]="ADDED",s[s.DELETED=2]="DELETED"})(Tr||(Tr={}));const iO=class iO{constructor(e,t){this.ignorePathCasing=t,this.correlationId=void 0,this.added=new Ca(()=>{const i=Ih.forUris(()=>this.ignorePathCasing);return i.fill(this.rawAdded.map(n=>[n,!0])),i}),this.updated=new Ca(()=>{const i=Ih.forUris(()=>this.ignorePathCasing);return i.fill(this.rawUpdated.map(n=>[n,!0])),i}),this.deleted=new Ca(()=>{const i=Ih.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 Tr.ADDED:this.rawAdded.push(i.resource);break;case Tr.UPDATED:this.rawUpdated.push(i.resource);break;case Tr.DELETED:this.rawDeleted.push(i.resource);break}this.correlationId!==iO.MIXED_CORRELATION&&(typeof i.cId=="number"?this.correlationId===void 0?this.correlationId=i.cId:this.correlationId!==i.cId&&(this.correlationId=iO.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=iO.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(Tr.ADDED))&&(this.added.value.get(e)||t.includeChildren&&this.added.value.findSuperstr(e))||(!n||i.includes(Tr.UPDATED))&&(this.updated.value.get(e)||t.includeChildren&&this.updated.value.findSuperstr(e))||(!n||i.includes(Tr.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"}};iO.MIXED_CORRELATION=null;let iJ=iO;class Rd extends Error{constructor(e,t,i){super(e),this.fileOperationResult=t,this.options=i}}class Qq extends Rd{constructor(e,t,i,n){super(e,t,n),this.fileOperationResult=t,this.size=i}}class T5 extends Rd{constructor(e,t,i){super(e,ji.FILE_NOT_MODIFIED_SINCE,i),this.stat=t}}var ji;(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"})(ji||(ji={}));const il={OFF:"off",AFTER_DELAY:"afterDelay",ON_FOCUS_CHANGE:"onFocusChange",ON_WINDOW_CHANGE:"onWindowChange"},Du={OFF:"off",ON_EXIT:"onExit",ON_EXIT_AND_WINDOW_CLOSE:"onExitAndWindowClose"},aRe="files.associations",_Et="files.exclude",DYe="files.readonlyInclude",kYe="files.readonlyExclude",vEt="files.readonlyFromPermissions";var wa;(function(s){s[s.FILE=0]="FILE",s[s.FOLDER=1]="FOLDER",s[s.ROOT_FOLDER=2]="ROOT_FOLDER"})(wa||(wa={}));const x_="";function nJ(s){if(!(typeof s.size!="number"||typeof s.mtime!="number"))return s.mtime.toString(29)+s.size.toString(31)}async function IYe(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 Kl=class Kl{static formatSize(e){return dc(e)||(e=0),e{if(t instanceof cs)return t;const i=new RA("",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?aY(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return gV(i.rawConfiguration.getValue(e))},get override(){return t?gV(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return gV(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const n=[];for(const{contents:r,identifiers:o,keys:a}of i.rawConfiguration.overrides){const c=new cs(r,a,[],void 0,i.logService).getValue(e);c!==void 0&&n.push({identifiers:o,value:c})}return n.length?gV(n):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?aY(i,e):i:void 0}getKeysForOverrideIdentifier(e){const t=[];for(const i of this.overrides)i.identifiers.includes(e)&&t.push(...i.keys);return Ya(t)}getAllOverrideIdentifiers(){const e=[];for(const t of this.overrides)e.push(...t.identifiers);return Ya(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=Ds(this.contents),i=Ds(this.overrides),n=[...this.keys],r=this.raw?.length?[...this.raw]:[this];for(const o of e)if(r.push(...o.raw?.length?o.raw:[o]),!o.isEmpty()){this.mergeContents(t,o.contents);for(const a of o.overrides){const[c]=i.filter(l=>ns(l.identifiers,a.identifiers));c?(this.mergeContents(c.contents,a.contents),c.keys.push(...a.keys),c.keys=Ya(c.keys)):i.push(Ds(a))}for(const a of o.keys)n.indexOf(a)===-1&&n.push(a)}return new cs(t,n,i,r.every(o=>o instanceof cs)?void 0:r,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 Ya([...Object.keys(this.contents),...Object.keys(t)])){let r=this.contents[n];const o=t[n];o&&(typeof r=="object"&&typeof o=="object"?(r=Ds(r),this.mergeContents(r,o)):r=o),i[n]=r}return new cs(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&In(e[i])&&In(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Ds(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=r=>{r&&(i?this.mergeContents(i,r):i=Ds(r))};for(const r of this.overrides)r.identifiers.length===1&&r.identifiers[0]===e?t=r.contents:r.identifiers.includes(e)&&n(r.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),xgt(this.contents,e),rf.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>ns(i.identifiers,U8(e))),1))}updateValue(e,t,i){if(Wqe(this.contents,e,t,n=>this.logService.error(n)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),rf.test(e)){const n=U8(e),r={identifiers:n,keys:Object.keys(this.contents[e]),contents:H8(this.contents[e],a=>this.logService.error(a))},o=this.overrides.findIndex(a=>ns(a.identifiers,n));o!==-1?this.overrides[o]=r:this.overrides.push(r)}}}class RA{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||cs.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!aa(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:r,restricted:o,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new cs(i,n,r,a?[e]:void 0,this.logService),this._restrictedConfigurations=o||[]}doParseContent(e){let t={},i=null,n=[];const r=[];function o(c){Array.isArray(n)?n.push(c):i!==null&&(n[i]=c)}const a={onObjectBegin:()=>{const c={};o(c),r.push(n),n=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{n=r.pop()},onArrayBegin:()=>{const c=[];o(c),r.push(n),n=c,i=null},onArrayEnd:()=>{n=r.pop()},onLiteralValue:o,onError:(c,l,d)=>{}};if(e)try{oRe(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=je.as(Pn.Configuration).getConfigurationProperties(),n=this.filter(e,i,!0,t);e=n.raw;const r=H8(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`)),o=Object.keys(e),a=this.toOverrides(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`));return{contents:r,keys:o,overrides:a,restricted:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){let r=!1;if(!n?.scopes&&!n?.skipRestricted&&!n?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:r};const o={},a=[];for(const c in e)if(rf.test(c)&&i){const l=this.filter(e[c],t,!1,n);o[c]=l.raw,r=r||l.hasExcludedProperties,a.push(...l.restricted)}else{const l=t[c],d=l?typeof l.scope<"u"?l.scope:ct.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))?o[c]=e[c]:r=!0}return{raw:o,restricted:a,hasExcludedProperties:r}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(rf.test(n)){const r={};for(const o in e[n])r[o]=e[n][o];i.push({identifiers:U8(n),keys:Object.keys(r),contents:H8(r,t)})}return i}}class TYe extends V{constructor(e,t,i,n,r){super(),this.userSettingsResource=e,this.parseOptions=t,this.fileService=n,this.logService=r,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.parser=new RA(this.userSettingsResource.toString(),r),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,o=>o.contains(this.userSettingsResource)),M.filter(this.fileService.onDidRunOperation,o=>(o.isOperation(Ei.CREATE)||o.isOperation(Ei.COPY)||o.isOperation(Ei.DELETE)||o.isOperation(Ei.WRITE))&&i.isEqual(o.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 cs.createEmptyModel(this.logService)}}reparse(e){return e&&(this.parseOptions=e),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}}class wEt{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=r,this.policyConfiguration=o,this.applicationConfiguration=a,this.userConfiguration=c,this.localUserConfiguration=l,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=f}get value(){return gV(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 w3=class LYe{constructor(e,t,i,n,r,o,a,c,l,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=r,this._workspaceConfiguration=o,this._folderConfigurations=a,this._memoryConfiguration=c,this._memoryConfigurationByResource=l,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new gi,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=cs.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),r=this.getFolderConfigurationModelForResource(t.resource,i),o=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 wEt(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,r||void 0,o)}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:r,removed:o}=_E(this._defaultConfiguration,e);t=[...n,...r,...o]}for(const n of t)for(const r of U8(n)){const o=this._defaultConfiguration.getKeysForOverrideIdentifier(r),a=e.getKeysForOverrideIdentifier(r),c=[...a.filter(l=>o.indexOf(l)===-1),...o.filter(l=>a.indexOf(l)===-1),...o.filter(l=>!Js(this._defaultConfiguration.override(r).getValue(l),e.override(r).getValue(l)))];i.push([r,c])}return this.updateDefaultConfiguration(e),{keys:t,overrides:i}}compareAndUpdatePolicyConfiguration(e){const{added:t,updated:i,removed:n}=_E(this._policyConfiguration,e),r=[...t,...i,...n];return r.length&&this.updatePolicyConfiguration(e),{keys:r,overrides:[]}}compareAndUpdateApplicationConfiguration(e){const{added:t,updated:i,removed:n,overrides:r}=_E(this.applicationConfiguration,e),o=[...t,...i,...n];return o.length&&this.updateApplicationConfiguration(e),{keys:o,overrides:r}}compareAndUpdateLocalUserConfiguration(e){const{added:t,updated:i,removed:n,overrides:r}=_E(this.localUserConfiguration,e),o=[...t,...i,...n];return o.length&&this.updateLocalUserConfiguration(e),{keys:o,overrides:r}}compareAndUpdateRemoteUserConfiguration(e){const{added:t,updated:i,removed:n,overrides:r}=_E(this.remoteUserConfiguration,e),o=[...t,...i,...n];return o.length&&this.updateRemoteUserConfiguration(e),{keys:o,overrides:r}}compareAndUpdateWorkspaceConfiguration(e){const{added:t,updated:i,removed:n,overrides:r}=_E(this.workspaceConfiguration,e),o=[...t,...i,...n];return o.length&&this.updateWorkspaceConfiguration(e),{keys:o,overrides:r}}compareAndUpdateFolderConfiguration(e,t){const i=this.folderConfigurations.get(e),{added:n,updated:r,removed:o,overrides:a}=_E(i,t),c=[...n,...r,...o];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:r,overrides:o}=_E(t,void 0);return{keys:[...i,...n,...r],overrides:o}}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 r=this._memoryConfigurationByResource.get(e);r&&(i=i.merge(r))}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:r}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:r}]),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),r=this.parseConfigurationModel(e.application,t),o=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 gi);return new LYe(i,n,r,o,cs.createEmptyModel(t),a,c,cs.createEmptyModel(t),new gi,t)}static parseConfigurationModel(e,t){return new cs(e.contents,e.keys,e.overrides,void 0,t)}};function tWe(...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(r=>e.add(r)),n.overrides.forEach(([r,o])=>{const a=Pj(t,r,new Set);o.forEach(c=>a.add(c))});const i=[];return t.forEach((n,r)=>i.push([r,[...n.values()]])),{keys:[...e.values()],overrides:i}}class cRe{constructor(e,t,i,n,r){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this.logService=r,this._marker=` -`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const a of o)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=w3.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 r=n+i.length;if(r>=this._affectsConfigStr.length)return!1;const o=this._affectsConfigStr.charCodeAt(r);if(o!==this._markerCode1&&o!==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!Js(a,c)}return!0}}function _E(s,e){const{added:t,removed:i,updated:n}=iWe(e?.rawConfiguration,s?.rawConfiguration),r=[],o=s?.getAllOverrideIdentifiers()||[],a=e?.getAllOverrideIdentifiers()||[];if(e){const c=a.filter(l=>!o.includes(l));for(const l of c)r.push([l,e.getKeysForOverrideIdentifier(l)])}if(s){const c=o.filter(l=>!a.includes(l));for(const l of c)r.push([l,s.getKeysForOverrideIdentifier(l)])}if(e&&s){for(const c of o)if(a.includes(c)){const l=iWe({contents:s.getOverrideValue(void 0,c)||{},keys:s.getKeysForOverrideIdentifier(c)},{contents:e.getOverrideValue(void 0,c)||{},keys:e.getKeysForOverrideIdentifier(c)});r.push([c,[...l.added,...l.removed,...l.updated]])}}return{added:t,removed:i,updated:n,overrides:r}}function iWe(s,e){const t=s?e?s.keys.filter(r=>e.keys.indexOf(r)===-1):[...s.keys]:[],i=e?s?e.keys.filter(r=>s.keys.indexOf(r)===-1):[...e.keys]:[],n=[];if(s&&e){for(const r of e.keys)if(s.keys.indexOf(r)!==-1){const o=aY(e.contents,r),a=aY(s.contents,r);Js(o,a)||n.push(r)}}return{added:t,removed:i,updated:n}}const yEt=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class RYe extends V{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:M.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,r){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=r,this._onDidUpdateKeybindings=this._register(new I),this._currentChords=[],this._currentChordChecker=new l6,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=mF.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Em,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 Oi(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"),ZY;const[n]=i.getDispatchChords();if(n===null)return this._log("\\ Keyboard event cannot be dispatched"),ZY;const r=this._contextKeyService.getContext(t),o=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(r,o,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 Voe("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(),m5.enabled&&m5.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],m5.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=mF.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=mF.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[r]=i.getChords();return this._ignoreSingleModifiers=new mF(r),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 r=null,o=null;if(i){const[d]=e.getSingleModifierDispatchChords();r=d,o=d?[d]:[]}else[r]=e.getDispatchChords(),o=this._currentChords.map(({keypress:d})=>d);if(r===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,o,r);switch(l.kind){case of.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 of.MoreChordsNeeded:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),n=!0,this._expectAnotherChord(r,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),n;case of.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}yEt.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 Ase=class Ase{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}}};Ase.EMPTY=new Ase(null);let mF=Ase;class Mx{constructor(e,t,i,n,r,o,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?sJ(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=sJ(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=r,this.extensionId=o,this.isBuiltinExtension=a}}function sJ(s){const e=[];for(let t=0,i=s.length;tthis._getLabel(e))}getAriaLabel(){return MYe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:CEt.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return lRe.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 xdt(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 nW extends dRe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===ks.Macintosh)switch(e){case S.LeftArrow:return"←";case S.UpArrow:return"↑";case S.RightArrow:return"→";case S.DownArrow:return"↓"}return Ta.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Ta.toString(e.keyCode)}_getElectronAccelerator(e){return Ta.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Ta.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_isWYSIWYG(){return!0}_getChordDispatch(e){return nW.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+=Ta.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=Gg[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 Lh)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===S.Unknown?null:new Lh(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=sJ(e.chords.map(n=>this._toKeyCodeChord(n)));return i.length>0?[new nW(i,t)]:[]}}const Os=ae("labelService"),hg=ae("progressService"),nE=ae("editorProgressService"),NYe="telemetry.telemetryLevel",AEt="telemetry.enableCrashReporter",PYe="telemetry.enableTelemetry";var jg;(function(s){s[s.NONE=0]="NONE",s[s.CRASH=1]="CRASH",s[s.ERROR=2]="ERROR",s[s.USAGE=3]="USAGE"})(jg||(jg={}));var e1;(function(s){s.OFF="off",s.CRASH="crash",s.ERROR="error",s.ON="all"})(e1||(e1={}));function B_(s){const e=s;return typeof e?.id=="string"&&N.isUri(e.uri)}function EEt(s){return typeof s?.id=="string"&&!B_(s)&&!oA(s)}const hRe={id:"empty-window"};function JO(s,e){if(typeof s=="string"||typeof s>"u")return typeof s=="string"?{id:Kr(s)}:hRe;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 oA(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 m_e(s){const e=s;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&Array.isArray(e.folders))}function FYe(s){const e=s;return!!(e&&typeof e=="object"&&N.isUri(e.uri)&&typeof e.name=="string"&&typeof e.toResource=="function")}let OYe=class{constructor(e,t,i,n,r){this._id=e,this._transient=i,this._configuration=n,this._ignorePathCasing=r,this._foldersMap=Ih.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=Ih.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 Ft(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};function rJ(s){return new Pae({uri:s,index:0,name:TA(s)},{uri:s.toString()})}const Tb="code-workspace",BYe=`.${Tb}`,xEt=[{name:g(792,"Code Workspace"),extensions:[Tb]}];function y3(s,e){return qKe.isEqualOrParent(s,e.untitledWorkspacesHome)}function Wy(s){let e;return N.isUri(s)?e=s:e=s.configuration,e?.scheme===pe.tmp}const WYe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function DEt(s){return s.id===WYe}function __e(s,e){return!y3(s,e)&&!Wy(s)}function Fae(s){return(typeof s=="string"?jy(s):xU(s))===BYe}const Ci=ae("contextService");var Lg;(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.","")})(Lg||(Lg={}));var nWe;(function(s){s.inspectTokensAction=g(1281,"Developer: Inspect Tokens")})(nWe||(nWe={}));var oJ;(function(s){s.editorViewAccessibleLabel=g(1288,"Editor content"),s.accessibilityHelpMessage=g(1289,"Press Alt+F1 for Accessibility Options.")})(oJ||(oJ={}));var sWe;(function(s){s.toggleHighContrast=g(1290,"Toggle High Contrast Theme")})(sWe||(sWe={}));var v_e;(function(s){s.bulkEditServiceSummary=g(1291,"Made {0} edits in {1} files")})(v_e||(v_e={}));const Oae=ae("workspaceTrustEnablementService"),mC=ae("workspaceTrustManagementService"),Bae=ae("workspaceTrustRequestService");let jk=[],uRe=[],gRe=[];function gK(s,e=!1){HYe(s,!1,e)}function kEt(s){HYe(s,!0,!1)}function HYe(s,e,t){const i=IEt(s,e);jk.push(i),i.userConfigured?gRe.push(i):uRe.push(i),t&&!i.userConfigured&&jk.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 IEt(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?X_(s.filepattern.toLowerCase()):void 0,filepatternOnPath:s.filepattern?s.filepattern.indexOf(zi.sep)>=0:!1}}function TEt(){jk=jk.filter(s=>s.userConfigured),uRe=[]}function LEt(){jk=jk.filter(s=>!s.userConfigured),gRe=[]}function REt(s,e){return MEt(s,e).map(t=>t.id)}function MEt(s,e){let t;if(s)switch(s.scheme){case pe.file:t=s.fsPath;break;case pe.data:{t=Wk.parseMetaData(s).get(Wk.META_DATA_LABEL);break}case pe.vscodeNotebookCell:t=void 0;break;default:t=s.path}if(!t)return[{id:"unknown",mime:Vs.unknown}];t=t.toLowerCase();const i=Kr(t),n=rWe(t,i,gRe);if(n)return[n,{id:Sa,mime:Vs.text}];const r=rWe(t,i,uRe);if(r)return[r,{id:Sa,mime:Vs.text}];if(e){const o=NEt(e);if(o)return[o,{id:Sa,mime:Vs.text}]}return[{id:"unknown",mime:Vs.unknown}]}function rWe(s,e,t){let i,n,r;for(let o=t.length-1;o>=0;o--){const a=t[o];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&&(!r||a.extension.length>r.extension.length)&&e.endsWith(a.extensionLowercase)&&(r=a)}if(i)return i;if(n)return n;if(r)return r}function NEt(s){if(DTe(s)&&(s=s.substr(1)),s.length>0)for(let e=jk.length-1;e>=0;e--){const t=jk[e];if(!t.firstline)continue;const i=s.match(t.firstline);if(i&&i.length>0)return t}}const mv=Object.prototype.hasOwnProperty,oWe="vs.editor.nullLanguage";class PEt{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(oWe,ST.Null),this._register(Sa,ST.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)||ST.Null}decodeLanguageId(e){return this._languageIdToLanguage[e]||oWe}}const Gz=class Gz extends V{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,Gz.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new PEt,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(xT.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Gz.instanceCount--,super.dispose()}setDynamicLanguages(e){this._dynamicLanguages=e,this._initializeFromRegistry()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},TEt();const e=[].concat(xT.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}registerLanguage(e){return xT.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})}),je.as(Pn.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;mv.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)gK({id:i,mime:n,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)gK({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)gK({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);ATe(c)||gK({id:i,mime:n,firstline:c},this._warnOnOverwrite)}catch(c){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,c)}}e.aliases.push(i);let r=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?r=[null]:r=t.aliases),r!==null)for(const a of r)!a||a.length===0||e.aliases.push(a);const o=r!==null&&r.length>0;if(!(o&&r[0]===null)){const a=(o?r[0]:null)||i;(o||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?mv.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getSortedRegisteredLanguageNames(){const e=[];for(const t in this._nameMap)mv.call(this._nameMap,t)&&e.push({languageName:t,languageId:this._nameMap[t]});return e.sort((t,i)=>AS(t.languageName,i.languageName)),e}getLanguageName(e){return mv.call(this._languages,e)?this._languages[e].name:null}getMimeType(e){return mv.call(this._languages,e)&&this._languages[e].mimetypes[0]||null}getExtensions(e){return mv.call(this._languages,e)?this._languages[e].extensions:[]}getFilenames(e){return mv.call(this._languages,e)?this._languages[e].filenames:[]}getIcon(e){return mv.call(this._languages,e)&&this._languages[e].icons[0]||null}getConfigurationFiles(e){return mv.call(this._languages,e)?this._languages[e].configurationFiles||[]:[]}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return mv.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&mv.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:REt(e,t)}};Gz.instanceCount=0;let b_e=Gz;const Kz=class Kz 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,Kz.instanceCount++,this._registry=this._register(new b_e(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Kz.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 um(i,null)}createById(e){return new Vhe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByMimeType(e){return new Vhe(this.onDidChange,()=>{const t=this.getLanguageIdByMimeType(e);return this._createAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new Vhe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Sa),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),La.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};Kz.instanceCount=0;let aJ=Kz;class Vhe{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 FEt 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 ap={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Vs.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},OEt=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let Wae=OEt;const BEt=new Ca(()=>Wae("mouse",!1)),WEt=new Ca(()=>Wae("element",!1));function UYe(s){Wae=s}function Fo(s){return s==="element"?WEt.value:BEt.value}function Yk(){return Wae("element",!0)}class HEt{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}function VYe(s){return(e,t,i)=>{let n=null,r=null;if(typeof i.value=="function"?(n="value",r=i.value):typeof i.get=="function"&&(n="get",r=i.get),!r)throw new Error("not supported");i[n]=s(r,t)}}function ei(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 r=`$memoize$${e}`;t[i]=function(...o){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:n.apply(this,o)}),this[r]}}function fRe(s,e,t){return VYe((i,n)=>{const r=`$debounce$${n}`,o=`$debounce$result$${n}`;return function(...a){this[o]||(this[o]=void 0),clearTimeout(this[r]),this[r]=setTimeout(()=>{i.apply(this,a),this[o]=void 0},s)}})}function UEt(s,e,t){return VYe((i,n)=>{const r=`$throttle$timer$${n}`,o=`$throttle$result$${n}`,a=`$throttle$lastRun$${n}`,c=`$throttle$pending$${n}`;return function(...l){if(this[o]||(this[o]=t?t():void 0),(this[a]===null||this[a]===void 0)&&(this[a]=-Number.MAX_VALUE),e&&(this[o]=e(this[o],...l)),this[c])return;const d=this[a]+s;d<=Date.now()?(this[a]=Date.now(),i.apply(this,[this[o]]),this[o]=t?t():void 0):(this[c]=!0,this[r]=setTimeout(()=>{this[c]=!1,this[a]=Date.now(),i.apply(this,[this[o]]),this[o]=t?t():void 0},d-Date.now()))}})}var VEt=".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}";gt(VEt,{});var F1;(function(s){s[s.Copy=0]="Copy",s[s.Move=1]="Move"})(F1||(F1={}));var Sy;(function(s){s.Over="drop-target",s.Before="drop-target-before",s.After="drop-target-after"})(Sy||(Sy={}));class GI extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function aWe(s,e){const t=[];for(const i of e){if(s.start>=i.range.end)continue;if(s.ende.concat(t),[]))}class GEt{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,r=aWe({start:0,end:e},this.groups),o=aWe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(c=>({range:w_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=$Et(r,a,o),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 KI={CurrentDragAndDropData:void 0};var MC;(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"})(MC||(MC={}));const Zb={useShadows:!0,verticalScrollMode:Cr.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 k6{get context(){return this._context}set context(e){this._context=e}constructor(e){this.elements=e}update(){}getData(){return this.elements}}class zYe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class y_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 Ese=class Ese{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:a5(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=Zb){if(this.virtualDelegate=t,this.domId=`list_id_${++Ese.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Ph(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 o of i)this.renderers.set(o.templateId,o);this.cache=this.disposables.add(new KEt(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??Zb.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof n.paddingBottom>"u"?0:n.paddingBottom,this.accessibilityProvider=new QEt(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(n.transformOptimization??Zb.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(md.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new DN({forceIntegerValues:!0,smoothScrollDuration:n.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:o=>Ml(lt(this.domNode),o)})),this.scrollableElement=this.disposables.add(new y6(this.rowsContainer,{alwaysConsumeMouseWheel:n.alwaysConsumeMouseWheel??Zb.alwaysConsumeMouseWheel,horizontal:Cr.Auto,vertical:n.verticalScrollMode??Zb.verticalScrollMode,useShadows:n.useShadows??Zb.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,ur.Change,o=>this.onTouchChange(o))),this.disposables.add(ue(this.scrollableElement.getDomNode(),"scroll",o=>o.target.scrollTop=0)),this.disposables.add(ue(this.domNode,"dragover",o=>this.onDragOver(this.toDragEvent(o)))),this.disposables.add(ue(this.domNode,"drop",o=>this.onDrop(this.toDragEvent(o)))),this.disposables.add(ue(this.domNode,"dragleave",o=>this.onDragLeave(this.toDragEvent(o)))),this.disposables.add(ue(this.domNode,"dragend",o=>this.onDragEnd(o))),this.setRowLineHeight=n.setRowLineHeight??Zb.setRowLineHeight,this.setRowHeight=n.setRowHeight??Zb.setRowHeight,this.supportDynamicHeights=n.supportDynamicHeights??Zb.supportDynamicHeights,this.dnd=n.dnd??this.disposables.add(Zb.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 r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);let o=0;ee&&i=o.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=Pd.intersect(c,n),d=Pd.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=w_e(l,f),v=Pd.intersect(p,m);for(let A=v.start;Aw_e(A,f)),C=[{start:e,end:e+i.length},...w].map(A=>Pd.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=Ml(lt(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:PTe(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:a5(this.domNode)})}render(e,t,i,n,r,o=!1){const a=this.getRenderRange(t,i),c=Pd.relativeComplement(a,e).reverse(),l=Pd.relativeComplement(e,a);if(o){const d=Pd.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&&r!==void 0&&(this.rowsContainer.style.width=`${Math.max(r,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 r=this.accessibilityProvider.isChecked(i.element);if(typeof r=="boolean")i.row.domNode.setAttribute("aria-checked",String(!!r));else if(r){const c=l=>i.row.domNode.setAttribute("aria-checked",String(!!l));c(r.value),i.checkedDisposable=r.onDidChange(()=>c(r.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 o=this.renderers.get(i.templateId);if(!o)throw new Error(`No renderer found for template id ${i.templateId}`);o?.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=a5(e.row.domNode);const t=lt(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 ni(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return M.map(this.disposables.add(new ni(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return M.filter(M.map(this.disposables.add(new ni(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 ni(this.domNode,"mouseup")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDown(){return M.map(this.disposables.add(new ni(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return M.map(this.disposables.add(new ni(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMove(){return M.map(this.disposables.add(new ni(this.domNode,"mousemove")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return M.map(this.disposables.add(new ni(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return M.any(M.map(this.disposables.add(new ni(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),M.map(this.disposables.add(new ni(this.domNode,ur.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return M.map(this.disposables.add(new ni(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return M.map(this.disposables.add(new ni(this.rowsContainer,ur.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,r=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:n,sector:r}}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(ap.TEXT,t),i.dataTransfer.setDragImage){let r;this.dnd.getDragLabel&&(r=this.dnd.getDragLabel(n,i)),typeof r>"u"&&(r=String(n.length));const o=fe(".monaco-drag-image");o.textContent=r,(l=>{for(;l&&!l.classList.contains("monaco-workbench");)l=l.parentElement;return l||this.domNode.ownerDocument})(this.domNode).appendChild(o),i.dataTransfer.setDragImage(o,-10,-10),setTimeout(()=>o.remove(),0)}this.domNode.classList.add("dragging"),this.currentDragData=new k6(n),KI.CurrentDragAndDropData=new zYe(n),this.dnd.onDragStart?.(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),KI.CurrentDragAndDropData&&KI.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(KI.CurrentDragAndDropData)this.currentDragData=KI.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new y_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===F1.Copy?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=Ya(i).filter(r=>r>=-1&&rr-o),i=i[0]===-1?[-1]:i;let n=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:Sy.Over;if(qEt(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!==Sy.Over)throw new Error("Can't use multiple feedbacks with position different than 'over'");n===Sy.After&&i[0]{for(const r of i){const o=this.items[r];o.dropTarget=!1,o.row?.domNode.classList.remove(n)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Zy(()=>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,KI.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,KI.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=tY(this.domNode).top;this.dragOverAnimationDisposable=lut(lt(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Zy(()=>{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 qa(n,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(Jo(i)||nut(i))&&i!==this.rowsContainer&&t.contains(i);){const n=i.getAttribute("data-index");if(n){const r=Number(n);if(!isNaN(r))return r}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 r,o;e===this.elementTop(n.start)?(r=n.start,o=0):n.end-n.start>1&&(r=n.start+1,o=this.elementTop(r)-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 sW(s=wp){return(e,t)=>ns(e,t,s)}function jEt(){return(s,e)=>s.equals(e)}function jq(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,r)=>n==null||r===void 0||r===null?r===n:i(n,r)}}function cJ(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 r=pRe(n);if(r!==void 0)return r;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},r=>n(this.read(r),r))}flatten(){return A_e({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(GYe(this,t)),this}keepObserved(e){return e.add(KYe(this)),this}get debugValue(){return this.get()}}class OU extends qYe{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 is(s,e){const t=new BU(s,e);try{s(t)}finally{t.finish()}}let fK;function fV(s){if(fK)s(fK);else{const e=new BU(s,void 0);fK=e;try{s(e)}finally{e.finish(),fK=void 0}}}async function QYe(s,e){const t=new BU(s,e);try{await s(t)}finally{t.finish()}}function IM(s,e,t){s?e(s):is(e,t)}class BU{constructor(e,t){this._fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():pRe(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 r=this._value;this._setValue(e),$Ye()?.handleObservableChanged(this,{oldValue:r,newValue:e,change:i,didChange:!0,hadValue:!0});for(const o of this.observers)t.updateObserver(o,this),o.handleChange(this,i)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function C3(s,e){let t;return typeof s=="string"?t=new Xd(void 0,s,void 0):t=new Xd(s,void 0,void 0),new axt(t,e,wp)}class axt extends mRe{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}function et(s,e){return e!==void 0?new TM(new Xd(s,void 0,e),e,void 0,void 0,void 0,wp):new TM(new Xd(void 0,void 0,s),s,void 0,void 0,void 0,wp)}function I6(s,e,t){return new cxt(new Xd(s,void 0,e),e,void 0,void 0,void 0,wp,t)}function Zh(s,e){return new TM(new Xd(s.owner,s.debugName,s.debugReferenceFn),e,void 0,void 0,s.onLastObserverRemoved,s.equalsFn??wp)}oxt(Zh);function jYe(s,e){return new TM(new Xd(s.owner,s.debugName,void 0),e,s.createEmptyChangeSummary,s.handleChange,void 0,s.equalityComparer??wp)}function TI(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);const n=new Z;return new TM(new Xd(i,void 0,t),r=>(n.clear(),t(r,n)),void 0,void 0,()=>n.dispose(),wp)}function vh(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);let n;return new TM(new Xd(i,void 0,t),r=>{n?n.clear():n=new Z;const o=t(r);return o&&n.add(o),o},void 0,void 0,()=>{n&&(n.dispose(),n=void 0)},wp)}var Ed;(function(s){s[s.initial=0]="initial",s[s.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",s[s.stale=2]="stale",s[s.upToDate=3]="upToDate"})(Ed||(Ed={}));class TM extends OU{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n,r=void 0,o){super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=n,this._handleLastObserverRemoved=r,this._equalityComparator=o,this.state=Ed.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=Ed.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===Ed.dependenciesMightHaveChanged){for(const e of this.dependencies)if(e.reportChanges(),this.state===Ed.stale)break}this.state===Ed.dependenciesMightHaveChanged&&(this.state=Ed.upToDate),this._recomputeIfNeeded()}while(this.state!==Ed.upToDate);return this.value}}_recomputeIfNeeded(){if(this.state===Ed.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e;const t=this.state!==Ed.initial,i=this.value;this.state=Ed.upToDate;const n=this.changeSummary;this.changeSummary=this.createChangeSummary?.();try{this.value=this._computeFn(this,n)}finally{for(const o of this.dependenciesToBeRemoved)o.removeObserver(this);this.dependenciesToBeRemoved.clear()}if(t&&!this._equalityComparator(i,this.value))for(const o of this.observers)o.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===Ed.upToDate&&(this.state=Ed.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)}Q_(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===Ed.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=Ed.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:r=>r===e},this.changeSummary):!0,n=this.state===Ed.upToDate;if(i&&(this.state===Ed.dependenciesMightHaveChanged||n)&&(this.state=Ed.stale,n))for(const r of this.observers)r.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 cxt extends TM{constructor(e,t,i,n,r=void 0,o,a){super(e,t,i,n,r,o),this.set=a}}function ci(s){return new Hae(new Xd(void 0,void 0,s),s,void 0,void 0)}function T6(s,e){return new Hae(new Xd(s.owner,s.debugName,s.debugReferenceFn??e),e,void 0,void 0)}function WU(s,e){return new Hae(new Xd(s.owner,s.debugName,s.debugReferenceFn??e),e,s.createEmptyChangeSummary,s.handleChange)}function lxt(s,e){const t=new Z,i=WU({owner:s.owner,debugName:s.debugName,debugReferenceFn:s.debugReferenceFn??e,createEmptyChangeSummary:s.createEmptyChangeSummary,handleChange:s.handleChange},(n,r)=>{t.clear(),e(n,r,t)});return Ee(()=>{i.dispose(),t.dispose()})}function du(s){const e=new Z,t=T6({owner:void 0,debugName:void 0,debugReferenceFn:s},i=>{e.clear(),s(i,e)});return Ee(()=>{t.dispose(),e.dispose()})}var If;(function(s){s[s.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",s[s.stale=2]="stale",s[s.upToDate=3]="upToDate"})(If||(If={}));class Hae{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=If.stale,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=this.createChangeSummary?.(),this._runIfNeeded(),yU(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),CU(this)}_runIfNeeded(){if(this.state===If.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e,this.state=If.upToDate;const t=this.disposed;try{if(!t){$Ye()?.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===If.upToDate&&(this.state=If.dependenciesMightHaveChanged),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===If.dependenciesMightHaveChanged){this.state=If.upToDate;for(const e of this.dependencies)if(e.reportChanges(),this.state===If.stale)break}this._runIfNeeded()}while(this.state!==If.upToDate);this.updateCount--,Q_(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===If.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=If.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=If.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=Hae})(ci||(ci={}));function rd(s){return new dxt(s)}class dxt extends qYe{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 qn(...s){let e,t,i;return s.length===3?[e,t,i]=s:[t,i]=s,new Nx(new Xd(e,void 0,i),t,i,()=>Nx.globalTransaction,wp)}function hxt(s,e,t){return new Nx(new Xd(s.owner,s.debugName,s.debugReferenceFn??t),e,t,()=>Nx.globalTransaction,s.equalsFn??wp)}class Nx extends OU{constructor(e,t,i,n,r){super(),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=n,this._equalityComparator=r,this.hasValue=!1,this.handleEvent=o=>{const a=this._getValue(o),c=this.value;(!this.hasValue||!this._equalityComparator(c,a))&&(this.value=a,this.hasValue&&IM(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=Nx;function e(t,i){let n=!1;Nx.globalTransaction===void 0&&(Nx.globalTransaction=t,n=!0);try{i()}finally{n&&(Nx.globalTransaction=void 0)}}s.batchEventsGlobally=e})(qn||(qn={}));function sd(s,e){return new uxt(s,e)}class uxt extends OU{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{is(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 _C(s){return typeof s=="string"?new uWe(s):new uWe(void 0,s)}class uWe extends OU{get debugName(){return new Xd(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){is(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 Yq(s){const e=new YYe(!1,void 0);return s.addObserver(e),Ee(()=>{s.removeObserver(e)})}rxt(Yq);function VN(s,e){const t=new YYe(!0,e);return s.addObserver(t),e?e(s.get()):s.reportChanges(),Ee(()=>{s.removeObserver(t)})}sxt(VN);class YYe{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 L6(s,e){let t;return Zh({owner:s,debugReferenceFn:e},n=>(t=e(n,t),t))}function gxt(s,e){let t;const i=_C("derivedObservableWithWritableCache"),n=et(s,r=>(i.read(r),t=e(r,t),t));return Object.assign(n,{clearCache:r=>{t=void 0,i.trigger(r)},setCache:(r,o)=>{t=r,i.trigger(o)}})}function lJ(s,e,t,i){let n=new gWe(t,i);return Zh({debugReferenceFn:t,owner:s,onLastObserverRemoved:()=>{n.dispose(),n=new gWe(t)}},o=>(n.setItems(e.read(o)),n.getItems()))}class gWe{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 r=this._keySelector?this._keySelector(n):n;let o=this._cache.get(r);if(o)i.delete(r);else{const a=new Z;o={out:this._map(n,a),store:a},this._cache.set(r,o)}t.push(o.out)}for(const n of i)this._cache.get(n).store.dispose(),this._cache.delete(n);this._items=t}getItems(){return this._items}}class _Re{constructor(e){this.observable=e}get onDidChange(){return M.fromObservableLight(this.observable)}get value(){return this.observable.get()}}function JYe(s,e){return e instanceof _Re?e.observable:qn(s,e.onDidChange,()=>e.value)}function fxt(s,e){return L6(s,(t,i)=>i??e(t))}class pxt{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(r=>r.templateData===i);if(n>=0){const r=this.renderedElements[n];this.trait.unrender(i),r.index=t}else{const r={index:t,templateData:i};this.renderedElements.push(r)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const r of this.renderedElements)r.index=e+t&&n.push({index:r.index+i-t,templateData:r.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 S3=class{get name(){return this._trait}get renderer(){return new pxt(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,r=e+t,o=[];let a=0;for(;a=r;)o.push(this.sortedIndexes[a++]+n);this.renderer.splice(e,t,i.length),this._set(o,o)}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(pWe),t)}_set(e,t,i){const n=this.indexes,r=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const o=x_e(r,e);return this.renderer.renderIndexes(o),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return k2(this.sortedIndexes,e,pWe)>=0}dispose(){wt(this._onChange)}};S3.__decorator=D([ei],S3.prototype,"renderer",null);class mxt extends S3{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 zhe{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 r=new Set(n),o=i.map(a=>r.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,o)}}function aA(s){return s.tagName==="INPUT"||s.tagName==="TEXTAREA"}function R6(s,e){return s.classList.contains(e)?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:R6(s.parentElement,e)}function pV(s){return R6(s,"monaco-editor")}function _xt(s){return R6(s,"monaco-custom-toggle")}function vxt(s){return R6(s,"action-item")}function L5(s){return R6(s,"monaco-tree-sticky-row")}function A3(s){return s.classList.contains("monaco-tree-sticky-container")}function XYe(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:XYe(s.parentElement)}class E_e{get onKeyDown(){return M.chain(this.disposables.add(new ni(this.view.domNode,"keydown")).event,e=>e.filter(t=>!aA(t.target)).map(t=>new xn(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&&(jt?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(xu(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()}}E_e.__decorator=D([ei],E_e.prototype,"onKeyDown",null);var jw;(function(s){s[s.Automatic=0]="Automatic",s[s.Trigger=1]="Trigger"})(jw||(jw={}));var _F;(function(s){s[s.Idle=0]="Idle",s[s.Typing=1]="Typing"})(_F||(_F={}));const bxt=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 wxt{constructor(e,t,i,n,r){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=r,this.enabled=!1,this.state=_F.Idle,this.mode=jw.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??jw.Automatic}trigger(){this.triggered=!this.triggered}enable(){if(this.enabled)return;let e=!1;const t=M.chain(this.enabledDisposables.add(new ni(this.view.domNode,"keydown")).event,r=>r.filter(o=>!aA(o.target)).filter(()=>this.mode===jw.Automatic||this.triggered).map(o=>new xn(o)).filter(o=>e||this.keyboardNavigationEventFilter(o)).filter(o=>this.delegate.mightProducePrintableCharacter(o)).forEach(o=>tn.stop(o,!0)).map(o=>o.browserEvent.key)),i=M.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);M.reduce(M.any(t,i),(r,o)=>o===null?null:(r||"")+o,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"?No(t):t&&No(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=_F.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===_F.Idle?1:0;this.state=_F.Typing;for(let r=0;r1&&l.length===1){this.previouslyFocused=i,this.list.setFocus([o]),this.list.reveal(o);return}}}else if(typeof c>"u"||kM(e,c)){this.previouslyFocused=i,this.list.setFocus([o]),this.list.reveal(o);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class yxt{constructor(e,t){this.list=e,this.view=t,this.disposables=new Z;const i=M.chain(this.disposables.add(new ni(t.domNode,"keydown")).event,r=>r.filter(o=>!aA(o.target)).map(o=>new xn(o)));M.chain(i,r=>r.filter(o=>o.keyCode===S.Tab&&!o.ctrlKey&&!o.metaKey&&!o.shiftKey&&!o.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||!Jo(n)||n.tabIndex===-1)return;const r=lt(n).getComputedStyle(n);r.visibility==="hidden"||r.display==="none"||(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function ZYe(s){return jt?s.browserEvent.metaKey:s.browserEvent.ctrlKey}function eJe(s){return s.browserEvent.shiftKey}function Cxt(s){return BTe(s)&&s.button===2}const fWe={isSelectionSingleChangeEvent:ZYe,isSelectionRangeChangeEvent:eJe};class tJe{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||fWe),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(md.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||fWe))}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){pV(e.browserEvent.target)||Wc()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(aA(e.browserEvent.target)||pV(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||aA(e.browserEvent.target)||pV(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),Cxt(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(aA(e.browserEvent.target)||pV(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),r=Math.max(i,t),o=xu(n,r+1),a=this.list.getSelection(),c=Ext(x_e(a,[i]),i);if(c.length===0)return;const l=x_e(o,xxt(a,c));this.list.setSelection(l,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const n=this.list.getSelection(),r=n.filter(o=>o!==t);this.list.setFocus([t]),this.list.setAnchor(t),n.length===r.length?this.list.setSelection([...r,t],e.browserEvent):this.list.setSelection(r,e.browserEvent)}}dispose(){this.disposables.dispose()}}class iJe{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 Ku.lexer(a)}}function q2e(s,e){return oqe(s,e),Ee(()=>aqe(s))}var ZAt=".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}";gt(ZAt,{});var u_e,pL;let Z_=(pL=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,r=n.add(x6(e,{...this._getRenderOptions(e,n),...t},i));return r.element.classList.add("rendered-markdown"),{element:r.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{let r;i?r=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(r=this._options.editor.getModel()?.getLanguageId()),r||(r=Sa);const o=await Zyt(this._languageService,n,r),a=document.createElement("span");if(a.innerHTML=u_e._ttpTokenizer?.createHTML(o)??o,this._options.editor){const c=this._options.editor.getOption(x.fontInfo);Il(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=>Rae(this._openerService,i,e.isTrusted),disposables:t}}}},u_e=pL,pL._ttpTokenizer=ZA("tokenizeToString",{createHTML(e){return e}}),pL);Z_=u_e=D([_(1,Di),_(2,Ar)],Z_);async function Rae(s,e,t){try{return await s.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:eEt(t)})}catch(i){return bt(i),!1}}function eEt(s){return s===!0?!0:s&&Array.isArray(s.enabledCommands)?s.enabledCommands:!1}const Xb=fe;var Uo;(function(s){s[s.PointerSize=3]="PointerSize",s[s.HoverBorderWidth=2]="HoverBorderWidth",s[s.HoverWindowEdgeMargin=2]="HoverWindowEdgeMargin"})(Uo||(Uo={}));let g_e=class extends _d{get _targetWindow(){return lt(this._target.targetElements[0])}get _targetDocumentElement(){return lt(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===vr.BELOW?Gf.BELOW:Gf.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,r,o){super(),this._keybindingService=t,this._configurationService=i,this._openerService=n,this._instantiationService=r,this._accessibilityService=o,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=>Rae(this._openerService,u,ud(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new tEt(e.target),this._hoverPointer=e.appearance?.showPointer?Xb("div.workbench-hover-pointer"):void 0,this._hover=this._register(new jLe),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??vr.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=Xb("div.hover-row.markdown-hover"),c=Xb("div.hover-contents");if(typeof e.content=="string")c.textContent=e.content,c.style.whiteSpace="pre-wrap";else if(Jo(e.content))c.appendChild(e.content),c.classList.add("html-hover-contents");else{const u=e.content,f=this._instantiationService.createInstance(Z_,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||dd.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=Xb("div.hover-row.status-bar"),f=Xb("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=Xb("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"||ud(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):l=e.persistence.hideOnHover,l&&e.appearance?.showHoverHint){const u=Xb("div.hover-row.status-bar"),f=Xb("div.info");f.textContent=g(4885,"Hold {0} key to mouse over",jt?"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 Q2e(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),l){const u=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new Q2e(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=nae(this._hoverContainer,Xb("div")),n=oe(this._hoverContainer,Xb("div"));i.tabIndex=0,n.tabIndex=0,this._register(ue(n,"focus",r=>{e.focus(),r.preventDefault()})),this._register(ue(i,"focus",r=>{t.focus(),r.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return r}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&Qje(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());i&&xh(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=dqe(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:r,left:o}=t[0],a=n-o,c=r-i,l={top:i,right:n,bottom:r,left:o,width:a,height:c,center:{x:o+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 vr.RIGHT:l.left+=Uo.PointerSize,l.right+=Uo.PointerSize,this._hoverContainer.style.paddingLeft=`${Uo.PointerSize}px`,this._hoverContainer.style.marginLeft=`${-Uo.PointerSize}px`;break;case vr.LEFT:l.left-=Uo.PointerSize,l.right-=Uo.PointerSize,this._hoverContainer.style.paddingRight=`${Uo.PointerSize}px`,this._hoverContainer.style.marginRight=`${-Uo.PointerSize}px`;break;case vr.BELOW:l.top+=Uo.PointerSize,l.bottom+=Uo.PointerSize,this._hoverContainer.style.paddingTop=`${Uo.PointerSize}px`,this._hoverContainer.style.marginTop=`${-Uo.PointerSize}px`;break;case vr.ABOVE:l.top-=Uo.PointerSize,l.bottom-=Uo.PointerSize,this._hoverContainer.style.paddingBottom=`${Uo.PointerSize}px`,this._hoverContainer.style.marginBottom=`${-Uo.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+Uo.HoverBorderWidth;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===vr.RIGHT?this._x=e.right:this._hoverPosition===vr.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-Uo.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?Uo.PointerSize:0;if(this._forcePosition){const i=t+Uo.HoverBorderWidth;this._hoverPosition===vr.RIGHT?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===vr.LEFT&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===vr.RIGHT?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=vr.LEFT:this._hoverPosition=vr.BELOW):this._hoverPosition===vr.LEFT&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=vr.RIGHT:this._hoverPosition=vr.BELOW),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=vr.RIGHT))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?Uo.PointerSize:0;this._hoverPosition===vr.ABOVE?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=vr.BELOW):this._hoverPosition===vr.BELOW&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=vr.ABOVE)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=(this._hoverPointer?Uo.PointerSize:0)+Uo.HoverBorderWidth;this._hoverPosition===vr.ABOVE?t=Math.min(t,e.top-i):this._hoverPosition===vr.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)-Uo.PointerSize}px`:this._hoverPointer.style.top=`${Math.round(t/2)-Uo.PointerSize}px`;break}case vr.ABOVE:case vr.BELOW:{this._hoverPointer.classList.add(this._hoverPosition===vr.ABOVE?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-Uo.PointerSize;const n=this._x+i;(ne.right)&&(i=e.center.x-this._x-Uo.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}};g_e=D([_(1,Vt),_(2,Te),_(3,Ar),_(4,we),_(5,_o)],g_e);class Q2e extends _d{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=lt(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(lt(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class tEt{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var of;(function(s){s[s.NoMatchingKb=0]="NoMatchingKb",s[s.MoreChordsNeeded=1]="MoreChordsNeeded",s[s.KbFound=2]="KbFound"})(of||(of={}));const ZY={kind:of.NoMatchingKb},iEt={kind:of.MoreChordsNeeded};function nEt(s,e,t){return{kind:of.KbFound,commandId:s,commandArgs:e,isBubble:t}}class YO{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const n of e){const r=n.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=YO.handleRemovals([].concat(e).concat(t));for(let n=0,r=this._keybindings.length;n"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const r=i[n];if(r.command===t.command)continue;let o=!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 r=t.length-1;r>=0;r--)i[n++]=t[r];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 r=i[n];if(t.contextMatchesRules(r.when))return r}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const r=this._map.get(n[0]);if(r===void 0)return this._log("\\ No keybinding entries."),ZY;let o=null;if(n.length<2)o=r;else{o=[];for(let c=0,l=r.length;cd.chords.length)continue;let h=!0;for(let u=1;u=0;i--){const n=t[i];if(YO._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function j2e(s){return s?`${s.serialize()}`:"no when condition"}function Y2e(s){return s.extensionId?s.isBuiltinExtension?`built-in extension ${s.extensionId}`:`user extension ${s.extensionId}`:s.isDefault?"built-in":"user"}let eJ=class extends V{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new i_e(this.layoutService.mainContainer,qw.ABSOLUTE)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(lt(t))?n=qw.ABSOLUTE:i?n=qw.FIXED_SHADOW:n=qw.FIXED:n=qw.ABSOLUTE,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const r={close:()=>{this.openContextView===r&&this.hideContextView()}};return this.openContextView=r,r}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};eJ=D([_(0,_u)],eJ);class sEt extends eJ{getContextViewElement(){return this.contextView.getViewElement()}}class rEt{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||Rt(e)||Jo(e))n=e;else if(!I2(e.markdown))n=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(g(4884,"Loading..."),t,i),this._cancellationTokenSource=new li;const r=this._cancellationTokenSource.token;if(n=await e.markdown(r),n===void 0&&(n=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const r={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n},position:{hoverPosition:vr.BELOW},...i};this._hoverWidget=this.hoverDelegate.showHover(r,t)}n?.dispose()}hasContent(e){return e?ud(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}let f_e=class extends V{constructor(e,t,i,n,r){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=n,this._accessibilityService=r,this._managedHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new eJ(this._layoutService))}showHover(e,t,i){if(J2e(this._currentHoverOptions)===J2e(e)||this._currentHover&&this._currentHoverOptions?.persistence?.sticky)return;this._currentHoverOptions=e,this._lastHoverOptions=e;const n=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),r=Wc();i||(n&&r?r.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=r):this._lastFocusedElementBeforeOpen=void 0);const o=new Z,a=this._instantiationService.createInstance(g_e,e);if(e.persistence?.sticky&&(a.isLocked=!0),a.onDispose(()=>{this._currentHover?.domNode&&FTe(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),o.dispose()},void 0,o),!e.container){const c=Jo(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(lt(c))}if(this._contextViewHandler.showContextView(new oEt(a,t),e.container),a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,o),e.persistence?.sticky)o.add(ue(lt(e.container).document,ke.MOUSE_DOWN,c=>{yc(c.target,a.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const l of e.target.targetElements)o.add(ue(l,ke.CLICK,()=>this.hideHover()));else o.add(ue(e.target,ke.CLICK,()=>this.hideHover()));const c=Wc();if(c){const l=lt(c).document;o.add(ue(c,ke.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),o.add(ue(l,ke.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),o.add(ue(c,ke.KEY_UP,d=>this._keyUp(d,a))),o.add(ue(l,ke.KEY_UP,d=>this._keyUp(d,a)))}}if("IntersectionObserver"in ri){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),o.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 xn(e);this._keybindingService.resolveKeyboardEvent(n).getSingleModifierDispatchChords().some(o=>!!o)||this._keybindingService.softDispatch(n,n.target).kind!==of.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 r,o;const a=(y,C)=>{const A=o!==void 0;y&&(o?.dispose(),o=void 0),C&&(r?.dispose(),r=void 0),A&&(e.onDidHideHover?.(),o=void 0)},c=(y,C,A,L)=>new Em(async()=>{(!o||o.isDisposed)&&(o=new rEt(e,A||t,y>0),await o.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(r)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,Jo(k.target)&&X2e(k.target,t)!==t&&a(!0,!0)};C.add(ue(t,ke.MOUSE_MOVE,L,!0))}r=C,!(Jo(y.target)&&X2e(y.target,t)!==t)&&C.add(c(e.delay,!1,A))},p=ue(t,ke.MOUSE_OVER,f,!0),m=()=>{if(l||r)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)),r=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 o?.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()}};f_e=D([_(0,we),_(1,lo),_(2,Vt),_(3,_u),_(4,_o)],f_e);function J2e(s){if(s!==void 0)return s?.id??s}class oEt{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 X2e(s,e){for(e=e??lt(s).document.body;!s.hasAttribute("custom-hover")&&s!==e;)s=s.parentElement;return s}ce(tc,f_e,Qt.Delayed);Ep((s,e)=>{const t=s.getColor(yQe);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 UN=ae("IWorkspaceEditService");class Mae{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(rA.is(t))return rA.lift(t);if(hp.is(t))return hp.lift(t);throw new Error("Unsupported edit")})}}class rA extends Mae{static is(e){return e instanceof rA?!0:In(e)&&N.isUri(e.resource)&&In(e.textEdit)}static lift(e){return e instanceof rA?e:new rA(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 hp extends Mae{static is(e){return e instanceof hp?!0:In(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof hp?e:new hp(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 Hl={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},Kb=Object.freeze({id:"editor",order:5,type:"object",title:g(1209,"Editor"),scope:ct.LANGUAGE_OVERRIDABLE}),tJ={...Kb,properties:{"editor.tabSize":{type:"number",default:$d.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:$d.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:$d.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:$d.trimAutoWhitespace,description:g(1214,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:$d.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:Hl.maxComputationTime,description:g(1234,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Hl.maxFileSize,description:g(1235,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Hl.renderSideBySide,description:g(1236,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Hl.renderSideBySideInlineBreakpoint,description:g(1237,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Hl.useInlineViewWhenSpaceIsLimited,description:g(1238,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Hl.renderMarginRevertIcon,description:g(1239,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Hl.renderGutterMenu,description:g(1240,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Hl.ignoreTrimWhitespace,description:g(1241,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Hl.renderIndicators,description:g(1242,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Hl.diffCodeLens,description:g(1243,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Hl.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:Hl.diffAlgorithm,markdownEnumDescriptions:[g(1247,"Uses the legacy diffing algorithm."),g(1248,"Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Hl.hideUnchangedRegions.enabled,markdownDescription:g(1249,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Hl.hideUnchangedRegions.revealLineCount,markdownDescription:g(1250,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Hl.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:Hl.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:Hl.experimental.showMoves,markdownDescription:g(1253,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Hl.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:Hl.experimental.useTrueInlineView,description:g(1255,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function aEt(s){return typeof s.type<"u"||typeof s.anyOf<"u"}for(const s of nF){const e=s.schema;if(typeof e<"u")if(aEt(e))tJ.properties[`editor.${s.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(tJ.properties[t]=e[t])}let dK=null;function EYe(){return dK===null&&(dK=Object.create(null),Object.keys(tJ.properties).forEach(s=>{dK[s]=!0})),dK}function cEt(s){return EYe()[`editor.${s}`]||!1}function lEt(s){return EYe()[`diffEditor.${s}`]||!1}const dEt=je.as(Pn.Configuration);dEt.registerConfiguration(tJ);var Sl;(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"})(Sl||(Sl={}));var pt;(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"})(pt||(pt={}));var Hr;(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"})(Hr||(Hr={}));var b3;(function(s){s.DEFAULT={allowTrailingComma:!0}})(b3||(b3={}));function sRe(s,e=!1){let t=0;const i=s.length;let n="",r=0,o=pt.Unknown,a=Sl.None;function c(m){let v=0,b=0;for(;v=ii._0&&w<=ii._9)b=b*16+w-ii._0;else if(w>=ii.A&&w<=ii.F)b=b*16+w-ii.A+10;else if(w>=ii.a&&w<=ii.f)b=b*16+w-ii.a+10;else break;t++,v++}return v=i){m+=s.substring(v,t),a=Sl.UnexpectedEndOfString;break}const b=s.charCodeAt(t);if(b===ii.doubleQuote){m+=s.substring(v,t),t++;break}if(b===ii.backslash){if(m+=s.substring(v,t),t++,t>=i){a=Sl.UnexpectedEndOfString;break}switch(s.charCodeAt(t++)){case ii.doubleQuote:m+='"';break;case ii.backslash:m+="\\";break;case ii.slash:m+="/";break;case ii.b:m+="\b";break;case ii.f:m+="\f";break;case ii.n:m+=` +`;break;case ii.r:m+="\r";break;case ii.t:m+=" ";break;case ii.u:{const y=c(4);y>=0?m+=String.fromCharCode(y):a=Sl.InvalidUnicode;break}default:a=Sl.InvalidEscapeCharacter}v=t;continue}if(b>=0&&b<=31)if(hK(b)){m+=s.substring(v,t),a=Sl.UnexpectedEndOfString;break}else a=Sl.InvalidCharacter;t++}return m}function u(){if(n="",a=Sl.None,r=t,t>=i)return r=i,o=pt.EOF;let m=s.charCodeAt(t);if(Hhe(m)){do t++,n+=String.fromCharCode(m),m=s.charCodeAt(t);while(Hhe(m));return o=pt.Trivia}if(hK(m))return t++,n+=String.fromCharCode(m),m===ii.carriageReturn&&s.charCodeAt(t)===ii.lineFeed&&(t++,n+=` +`),o=pt.LineBreakTrivia;switch(m){case ii.openBrace:return t++,o=pt.OpenBraceToken;case ii.closeBrace:return t++,o=pt.CloseBraceToken;case ii.openBracket:return t++,o=pt.OpenBracketToken;case ii.closeBracket:return t++,o=pt.CloseBracketToken;case ii.colon:return t++,o=pt.ColonToken;case ii.comma:return t++,o=pt.CommaToken;case ii.doubleQuote:return t++,n=h(),o=pt.StringLiteral;case ii.slash:{const v=t-1;if(s.charCodeAt(t+1)===ii.slash){for(t+=2;t=pt.LineCommentTrivia&&m<=pt.Trivia);return m}return{setPosition:l,getPosition:()=>t,scan:e?p:u,getToken:()=>o,getTokenValue:()=>n,getTokenOffset:()=>r,getTokenLength:()=>t-r,getTokenError:()=>a}}function Hhe(s){return s===ii.space||s===ii.tab||s===ii.verticalTab||s===ii.formFeed||s===ii.nonBreakingSpace||s===ii.ogham||s>=ii.enQuad&&s<=ii.zeroWidthSpace||s===ii.narrowNoBreakSpace||s===ii.mathematicalSpace||s===ii.ideographicSpace||s===ii.byteOrderMark}function hK(s){return s===ii.lineFeed||s===ii.carriageReturn||s===ii.lineSeparator||s===ii.paragraphSeparator}function _P(s){return s>=ii._0&&s<=ii._9}var ii;(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"})(ii||(ii={}));function af(s,e=[],t=b3.DEFAULT){let i=null,n=[];const r=[];function o(c){Array.isArray(n)?n.push(c):i!==null&&(n[i]=c)}return oRe(s,{onObjectBegin:()=>{const c={};o(c),r.push(n),n=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{n=r.pop()},onArrayBegin:()=>{const c=[];o(c),r.push(n),n=c,i=null},onArrayEnd:()=>{n=r.pop()},onLiteralValue:o,onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t),n[0]}function rRe(s,e=[],t=b3.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 r(c){return i.children.push(c),c}oRe(s,{onObjectBegin:c=>{i=r({type:"object",offset:c,length:-1,parent:i,children:[]})},onObjectProperty:(c,l,d)=>{i=r({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=r({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)=>{r({type:dD(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 p_e(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 r of t.children)if(Array.isArray(r.children)&&r.children[0].value===i){t=r.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 oRe(s,e,t=b3.DEFAULT){const i=sRe(s,!1);function n(R){return R?()=>R(i.getTokenOffset(),i.getTokenLength()):()=>!0}function r(R){return R?z=>R(z,i.getTokenOffset(),i.getTokenLength()):()=>!0}const o=n(e.onObjectBegin),a=r(e.onObjectProperty),c=n(e.onObjectEnd),l=n(e.onArrayBegin),d=n(e.onArrayEnd),h=r(e.onLiteralValue),u=r(e.onSeparator),f=n(e.onComment),p=r(e.onError),m=t&&t.disallowComments,v=t&&t.allowTrailingComma;function b(){for(;;){const R=i.scan();switch(i.getTokenError()){case Sl.InvalidUnicode:w(Hr.InvalidUnicode);break;case Sl.InvalidEscapeCharacter:w(Hr.InvalidEscapeCharacter);break;case Sl.UnexpectedEndOfNumber:w(Hr.UnexpectedEndOfNumber);break;case Sl.UnexpectedEndOfComment:m||w(Hr.UnexpectedEndOfComment);break;case Sl.UnexpectedEndOfString:w(Hr.UnexpectedEndOfString);break;case Sl.InvalidCharacter:w(Hr.InvalidCharacter);break}switch(R){case pt.LineCommentTrivia:case pt.BlockCommentTrivia:m?w(Hr.InvalidCommentToken):f();break;case pt.Unknown:w(Hr.InvalidSymbol);break;case pt.Trivia:case pt.LineBreakTrivia:break;default:return R}}}function w(R,z=[],G=[]){if(p(R),z.length+G.length>0){let Y=i.getToken();for(;Y!==pt.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 pt.NumericLiteral:{let R=0;try{R=JSON.parse(i.getTokenValue()),typeof R!="number"&&(w(Hr.InvalidNumberFormat),R=0)}catch{w(Hr.InvalidNumberFormat)}h(R);break}case pt.NullKeyword:h(null);break;case pt.TrueKeyword:h(!0);break;case pt.FalseKeyword:h(!1);break;default:return!1}return b(),!0}function A(){return i.getToken()!==pt.StringLiteral?(w(Hr.PropertyNameExpected,[],[pt.CloseBraceToken,pt.CommaToken]),!1):(y(!1),i.getToken()===pt.ColonToken?(u(":"),b(),P()||w(Hr.ValueExpected,[],[pt.CloseBraceToken,pt.CommaToken])):w(Hr.ColonExpected,[],[pt.CloseBraceToken,pt.CommaToken]),!0)}function L(){o(),b();let R=!1;for(;i.getToken()!==pt.CloseBraceToken&&i.getToken()!==pt.EOF;){if(i.getToken()===pt.CommaToken){if(R||w(Hr.ValueExpected,[],[]),u(","),b(),i.getToken()===pt.CloseBraceToken&&v)break}else R&&w(Hr.CommaExpected,[],[]);A()||w(Hr.ValueExpected,[],[pt.CloseBraceToken,pt.CommaToken]),R=!0}return c(),i.getToken()!==pt.CloseBraceToken?w(Hr.CloseBraceExpected,[pt.CloseBraceToken],[]):b(),!0}function k(){l(),b();let R=!1;for(;i.getToken()!==pt.CloseBracketToken&&i.getToken()!==pt.EOF;){if(i.getToken()===pt.CommaToken){if(R||w(Hr.ValueExpected,[],[]),u(","),b(),i.getToken()===pt.CloseBracketToken&&v)break}else R&&w(Hr.CommaExpected,[],[]);P()||w(Hr.ValueExpected,[],[pt.CloseBracketToken,pt.CommaToken]),R=!0}return d(),i.getToken()!==pt.CloseBracketToken?w(Hr.CloseBracketExpected,[pt.CloseBracketToken],[]):b(),!0}function P(){switch(i.getToken()){case pt.OpenBracketToken:return k();case pt.OpenBraceToken:return L();case pt.StringLiteral:return y(!0);default:return C()}}return b(),i.getToken()===pt.EOF?t.allowEmptyContent?!0:(w(Hr.ValueExpected,[],[]),!1):P()?(i.getToken()!==pt.EOF&&w(Hr.EndOfFileExpected,[],[]),!0):(w(Hr.ValueExpected,[],[]),!1)}function dD(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 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===B.Slash||this._splitOnBackslash&&i===B.Backslash))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Ih(new gEt(e,t))}static forPaths(e=!1){return new Ih(new I5(void 0,!e))}static forStrings(){return new Ih(new hEt)}static forConfigKeys(){return new Ih(new uEt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){const i=t.slice(0);zFe(i);for(const n of i)this.set(n,e)}else{const i=e.slice(0);zFe(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 uK,this._root.segment=i.value());const r=[];for(n=this._root;;){const a=i.cmp(n.segment);if(a>0)n.left||(n.left=new uK,n.left.segment=i.value()),r.push([sc.Left,n]),n=n.left;else if(a<0)n.right||(n.right=new uK,n.right.segment=i.value()),r.push([sc.Right,n]),n=n.right;else if(i.hasNext())i.next(),n.mid||(n.mid=new uK,n.mid.segment=i.value()),r.push([sc.Mid,n]),n=n.mid;else break}const o=n.value;n.value=t,n.key=e;for(let a=r.length-1;a>=0;a--){const c=r[a][1];c.updateHeight();const l=c.balanceFactor();if(l<-1||l>1){const d=r[a][0],h=r[a+1][0];if(d===sc.Right&&h===sc.Right)r[a][1]=c.rotateLeft();else if(d===sc.Left&&h===sc.Left)r[a][1]=c.rotateRight();else if(d===sc.Right&&h===sc.Left)c.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=c.rotateLeft();else if(d===sc.Left&&h===sc.Right)c.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=c.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case sc.Left:r[a-1][1].left=r[a][1];break;case sc.Right:r[a-1][1].right=r[a][1];break;case sc.Mid:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return o}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 r=this._root;for(;r;){const o=i.cmp(r.segment);if(o>0)n.push([sc.Left,r]),r=r.left;else if(o<0)n.push([sc.Right,r]),r=r.right;else if(i.hasNext())i.next(),n.push([sc.Mid,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const o=this._min(r.right);if(o.key){const{key:a,value:c,segment:l}=o;this._delete(o.key,!1),r.key=a,r.value=c,r.segment=l}}else{const o=r.left??r.right;if(n.length>0){const[a,c]=n[n.length-1];switch(a){case sc.Left:c.left=o;break;case sc.Mid:c.mid=o;break;case sc.Right:c.right=o;break}}else this._root=o}for(let o=n.length-1;o>=0;o--){const a=n[o][1];a.updateHeight();const c=a.balanceFactor();if(c>1?(a.right.balanceFactor()>=0||(a.right=a.right.rotateRight()),n[o][1]=a.rotateLeft()):c<-1&&(a.left.balanceFactor()<=0||(a.left=a.left.rotateLeft()),n[o][1]=a.rotateRight()),o>0)switch(n[o-1][0]){case sc.Left:n[o-1][1].left=n[o][1];break;case sc.Right:n[o-1][1].right=n[o][1];break;case sc.Mid:n[o-1][1].mid=n[o][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 r=t.cmp(i.segment);if(r>0)i=i.left;else if(r<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 r=i.cmp(n.segment);if(r>0)n=n.left;else if(r<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 rn;(function(s){s[s.Unknown=0]="Unknown",s[s.File=1]="File",s[s.Directory=2]="Directory",s[s.SymbolicLink=64]="SymbolicLink"})(rn||(rn={}));var up;(function(s){s[s.Readonly=1]="Readonly",s[s.Locked=2]="Locked"})(up||(up={}));var FE;(function(s){s[s.UPDATED=2]="UPDATED",s[s.ADDED=4]="ADDED",s[s.DELETED=8]="DELETED"})(FE||(FE={}));var zn;(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"})(zn||(zn={}));function Km(s){return!!(s.capabilities&zn.FileReadWrite)}function Z2e(s){return!!(s.capabilities&zn.FileFolderCopy)}function fEt(s){return!!(s.capabilities&zn.FileClone)}function mE(s){return!!(s.capabilities&zn.FileOpenReadWriteClose)}function qq(s){return!!(s.capabilities&zn.FileReadStream)}function Uhe(s){return Km(s)?!!(s.capabilities&zn.FileAtomicRead):!1}function eWe(s){return Km(s)?!!(s.capabilities&zn.FileAtomicWrite):!1}function pEt(s){return!!(s.capabilities&zn.FileAtomicDelete)}function mEt(s){return!!(s.capabilities&zn.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 LA extends Error{static create(e,t){const i=new LA(e.toString(),t);return xYe(i,t),i}constructor(e,t){super(e),this.code=t}}function gs(s,e){return LA.create(s,e)}function d0(s){return s||gs(g(0,"Unknown Error"),ot.Unknown)}function xYe(s,e){return s.name=e?`${e} (FileSystemError)`:"FileSystemError",s}function Qk(s){if(!s)return ot.Unknown;if(s instanceof LA)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 Qw(s){if(s instanceof Rd)return s.fileOperationResult;switch(Qk(s)){case ot.FileNotFound:return ji.FILE_NOT_FOUND;case ot.FileIsADirectory:return ji.FILE_IS_DIRECTORY;case ot.FileNotADirectory:return ji.FILE_NOT_DIRECTORY;case ot.FileWriteLocked:return ji.FILE_WRITE_LOCKED;case ot.NoPermissions:return ji.FILE_PERMISSION_DENIED;case ot.FileExists:return ji.FILE_MOVE_CONFLICT;case ot.FileTooLarge:return ji.FILE_TOO_LARGE;default:return ji.FILE_OTHER_ERROR}}var Ei;(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"})(Ei||(Ei={}));class vP{constructor(e,t,i){this.resource=e,this.operation=t,this.target=i}isOperation(e){return this.operation===e}}var Tr;(function(s){s[s.UPDATED=0]="UPDATED",s[s.ADDED=1]="ADDED",s[s.DELETED=2]="DELETED"})(Tr||(Tr={}));const iO=class iO{constructor(e,t){this.ignorePathCasing=t,this.correlationId=void 0,this.added=new Ca(()=>{const i=Ih.forUris(()=>this.ignorePathCasing);return i.fill(this.rawAdded.map(n=>[n,!0])),i}),this.updated=new Ca(()=>{const i=Ih.forUris(()=>this.ignorePathCasing);return i.fill(this.rawUpdated.map(n=>[n,!0])),i}),this.deleted=new Ca(()=>{const i=Ih.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 Tr.ADDED:this.rawAdded.push(i.resource);break;case Tr.UPDATED:this.rawUpdated.push(i.resource);break;case Tr.DELETED:this.rawDeleted.push(i.resource);break}this.correlationId!==iO.MIXED_CORRELATION&&(typeof i.cId=="number"?this.correlationId===void 0?this.correlationId=i.cId:this.correlationId!==i.cId&&(this.correlationId=iO.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=iO.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(Tr.ADDED))&&(this.added.value.get(e)||t.includeChildren&&this.added.value.findSuperstr(e))||(!n||i.includes(Tr.UPDATED))&&(this.updated.value.get(e)||t.includeChildren&&this.updated.value.findSuperstr(e))||(!n||i.includes(Tr.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"}};iO.MIXED_CORRELATION=null;let iJ=iO;class Rd extends Error{constructor(e,t,i){super(e),this.fileOperationResult=t,this.options=i}}class Qq extends Rd{constructor(e,t,i,n){super(e,t,n),this.fileOperationResult=t,this.size=i}}class T5 extends Rd{constructor(e,t,i){super(e,ji.FILE_NOT_MODIFIED_SINCE,i),this.stat=t}}var ji;(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"})(ji||(ji={}));const il={OFF:"off",AFTER_DELAY:"afterDelay",ON_FOCUS_CHANGE:"onFocusChange",ON_WINDOW_CHANGE:"onWindowChange"},Du={OFF:"off",ON_EXIT:"onExit",ON_EXIT_AND_WINDOW_CLOSE:"onExitAndWindowClose"},aRe="files.associations",_Et="files.exclude",DYe="files.readonlyInclude",kYe="files.readonlyExclude",vEt="files.readonlyFromPermissions";var wa;(function(s){s[s.FILE=0]="FILE",s[s.FOLDER=1]="FOLDER",s[s.ROOT_FOLDER=2]="ROOT_FOLDER"})(wa||(wa={}));const x_="";function nJ(s){if(!(typeof s.size!="number"||typeof s.mtime!="number"))return s.mtime.toString(29)+s.size.toString(31)}async function IYe(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 Kl=class Kl{static formatSize(e){return dc(e)||(e=0),e{if(t instanceof cs)return t;const i=new RA("",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?aY(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return gV(i.rawConfiguration.getValue(e))},get override(){return t?gV(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return gV(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const n=[];for(const{contents:r,identifiers:o,keys:a}of i.rawConfiguration.overrides){const c=new cs(r,a,[],void 0,i.logService).getValue(e);c!==void 0&&n.push({identifiers:o,value:c})}return n.length?gV(n):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?aY(i,e):i:void 0}getKeysForOverrideIdentifier(e){const t=[];for(const i of this.overrides)i.identifiers.includes(e)&&t.push(...i.keys);return Ya(t)}getAllOverrideIdentifiers(){const e=[];for(const t of this.overrides)e.push(...t.identifiers);return Ya(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=Ds(this.contents),i=Ds(this.overrides),n=[...this.keys],r=this.raw?.length?[...this.raw]:[this];for(const o of e)if(r.push(...o.raw?.length?o.raw:[o]),!o.isEmpty()){this.mergeContents(t,o.contents);for(const a of o.overrides){const[c]=i.filter(l=>ns(l.identifiers,a.identifiers));c?(this.mergeContents(c.contents,a.contents),c.keys.push(...a.keys),c.keys=Ya(c.keys)):i.push(Ds(a))}for(const a of o.keys)n.indexOf(a)===-1&&n.push(a)}return new cs(t,n,i,r.every(o=>o instanceof cs)?void 0:r,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 Ya([...Object.keys(this.contents),...Object.keys(t)])){let r=this.contents[n];const o=t[n];o&&(typeof r=="object"&&typeof o=="object"?(r=Ds(r),this.mergeContents(r,o)):r=o),i[n]=r}return new cs(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&In(e[i])&&In(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Ds(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=r=>{r&&(i?this.mergeContents(i,r):i=Ds(r))};for(const r of this.overrides)r.identifiers.length===1&&r.identifiers[0]===e?t=r.contents:r.identifiers.includes(e)&&n(r.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),xgt(this.contents,e),rf.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>ns(i.identifiers,U8(e))),1))}updateValue(e,t,i){if(Wqe(this.contents,e,t,n=>this.logService.error(n)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),rf.test(e)){const n=U8(e),r={identifiers:n,keys:Object.keys(this.contents[e]),contents:H8(this.contents[e],a=>this.logService.error(a))},o=this.overrides.findIndex(a=>ns(a.identifiers,n));o!==-1?this.overrides[o]=r:this.overrides.push(r)}}}class RA{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||cs.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!aa(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:r,restricted:o,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new cs(i,n,r,a?[e]:void 0,this.logService),this._restrictedConfigurations=o||[]}doParseContent(e){let t={},i=null,n=[];const r=[];function o(c){Array.isArray(n)?n.push(c):i!==null&&(n[i]=c)}const a={onObjectBegin:()=>{const c={};o(c),r.push(n),n=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{n=r.pop()},onArrayBegin:()=>{const c=[];o(c),r.push(n),n=c,i=null},onArrayEnd:()=>{n=r.pop()},onLiteralValue:o,onError:(c,l,d)=>{}};if(e)try{oRe(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=je.as(Pn.Configuration).getConfigurationProperties(),n=this.filter(e,i,!0,t);e=n.raw;const r=H8(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`)),o=Object.keys(e),a=this.toOverrides(e,c=>this.logService.error(`Conflict in settings file ${this._name}: ${c}`));return{contents:r,keys:o,overrides:a,restricted:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){let r=!1;if(!n?.scopes&&!n?.skipRestricted&&!n?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:r};const o={},a=[];for(const c in e)if(rf.test(c)&&i){const l=this.filter(e[c],t,!1,n);o[c]=l.raw,r=r||l.hasExcludedProperties,a.push(...l.restricted)}else{const l=t[c],d=l?typeof l.scope<"u"?l.scope:ct.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))?o[c]=e[c]:r=!0}return{raw:o,restricted:a,hasExcludedProperties:r}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(rf.test(n)){const r={};for(const o in e[n])r[o]=e[n][o];i.push({identifiers:U8(n),keys:Object.keys(r),contents:H8(r,t)})}return i}}class TYe extends V{constructor(e,t,i,n,r){super(),this.userSettingsResource=e,this.parseOptions=t,this.fileService=n,this.logService=r,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.parser=new RA(this.userSettingsResource.toString(),r),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,o=>o.contains(this.userSettingsResource)),M.filter(this.fileService.onDidRunOperation,o=>(o.isOperation(Ei.CREATE)||o.isOperation(Ei.COPY)||o.isOperation(Ei.DELETE)||o.isOperation(Ei.WRITE))&&i.isEqual(o.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 cs.createEmptyModel(this.logService)}}reparse(e){return e&&(this.parseOptions=e),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}}class wEt{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=r,this.policyConfiguration=o,this.applicationConfiguration=a,this.userConfiguration=c,this.localUserConfiguration=l,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=f}get value(){return gV(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 w3=class LYe{constructor(e,t,i,n,r,o,a,c,l,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=r,this._workspaceConfiguration=o,this._folderConfigurations=a,this._memoryConfiguration=c,this._memoryConfigurationByResource=l,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new gi,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=cs.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),r=this.getFolderConfigurationModelForResource(t.resource,i),o=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 wEt(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,r||void 0,o)}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:r,removed:o}=_E(this._defaultConfiguration,e);t=[...n,...r,...o]}for(const n of t)for(const r of U8(n)){const o=this._defaultConfiguration.getKeysForOverrideIdentifier(r),a=e.getKeysForOverrideIdentifier(r),c=[...a.filter(l=>o.indexOf(l)===-1),...o.filter(l=>a.indexOf(l)===-1),...o.filter(l=>!Js(this._defaultConfiguration.override(r).getValue(l),e.override(r).getValue(l)))];i.push([r,c])}return this.updateDefaultConfiguration(e),{keys:t,overrides:i}}compareAndUpdatePolicyConfiguration(e){const{added:t,updated:i,removed:n}=_E(this._policyConfiguration,e),r=[...t,...i,...n];return r.length&&this.updatePolicyConfiguration(e),{keys:r,overrides:[]}}compareAndUpdateApplicationConfiguration(e){const{added:t,updated:i,removed:n,overrides:r}=_E(this.applicationConfiguration,e),o=[...t,...i,...n];return o.length&&this.updateApplicationConfiguration(e),{keys:o,overrides:r}}compareAndUpdateLocalUserConfiguration(e){const{added:t,updated:i,removed:n,overrides:r}=_E(this.localUserConfiguration,e),o=[...t,...i,...n];return o.length&&this.updateLocalUserConfiguration(e),{keys:o,overrides:r}}compareAndUpdateRemoteUserConfiguration(e){const{added:t,updated:i,removed:n,overrides:r}=_E(this.remoteUserConfiguration,e),o=[...t,...i,...n];return o.length&&this.updateRemoteUserConfiguration(e),{keys:o,overrides:r}}compareAndUpdateWorkspaceConfiguration(e){const{added:t,updated:i,removed:n,overrides:r}=_E(this.workspaceConfiguration,e),o=[...t,...i,...n];return o.length&&this.updateWorkspaceConfiguration(e),{keys:o,overrides:r}}compareAndUpdateFolderConfiguration(e,t){const i=this.folderConfigurations.get(e),{added:n,updated:r,removed:o,overrides:a}=_E(i,t),c=[...n,...r,...o];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:r,overrides:o}=_E(t,void 0);return{keys:[...i,...n,...r],overrides:o}}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 r=this._memoryConfigurationByResource.get(e);r&&(i=i.merge(r))}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:r}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:r}]),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),r=this.parseConfigurationModel(e.application,t),o=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 gi);return new LYe(i,n,r,o,cs.createEmptyModel(t),a,c,cs.createEmptyModel(t),new gi,t)}static parseConfigurationModel(e,t){return new cs(e.contents,e.keys,e.overrides,void 0,t)}};function tWe(...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(r=>e.add(r)),n.overrides.forEach(([r,o])=>{const a=Pj(t,r,new Set);o.forEach(c=>a.add(c))});const i=[];return t.forEach((n,r)=>i.push([r,[...n.values()]])),{keys:[...e.values()],overrides:i}}class cRe{constructor(e,t,i,n,r){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this.logService=r,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const a of o)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=w3.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 r=n+i.length;if(r>=this._affectsConfigStr.length)return!1;const o=this._affectsConfigStr.charCodeAt(r);if(o!==this._markerCode1&&o!==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!Js(a,c)}return!0}}function _E(s,e){const{added:t,removed:i,updated:n}=iWe(e?.rawConfiguration,s?.rawConfiguration),r=[],o=s?.getAllOverrideIdentifiers()||[],a=e?.getAllOverrideIdentifiers()||[];if(e){const c=a.filter(l=>!o.includes(l));for(const l of c)r.push([l,e.getKeysForOverrideIdentifier(l)])}if(s){const c=o.filter(l=>!a.includes(l));for(const l of c)r.push([l,s.getKeysForOverrideIdentifier(l)])}if(e&&s){for(const c of o)if(a.includes(c)){const l=iWe({contents:s.getOverrideValue(void 0,c)||{},keys:s.getKeysForOverrideIdentifier(c)},{contents:e.getOverrideValue(void 0,c)||{},keys:e.getKeysForOverrideIdentifier(c)});r.push([c,[...l.added,...l.removed,...l.updated]])}}return{added:t,removed:i,updated:n,overrides:r}}function iWe(s,e){const t=s?e?s.keys.filter(r=>e.keys.indexOf(r)===-1):[...s.keys]:[],i=e?s?e.keys.filter(r=>s.keys.indexOf(r)===-1):[...e.keys]:[],n=[];if(s&&e){for(const r of e.keys)if(s.keys.indexOf(r)!==-1){const o=aY(e.contents,r),a=aY(s.contents,r);Js(o,a)||n.push(r)}}return{added:t,removed:i,updated:n}}const yEt=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class RYe extends V{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:M.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,r){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=r,this._onDidUpdateKeybindings=this._register(new I),this._currentChords=[],this._currentChordChecker=new l6,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=mF.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Em,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 Oi(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"),ZY;const[n]=i.getDispatchChords();if(n===null)return this._log("\\ Keyboard event cannot be dispatched"),ZY;const r=this._contextKeyService.getContext(t),o=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(r,o,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 Voe("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(),m5.enabled&&m5.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],m5.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=mF.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=mF.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[r]=i.getChords();return this._ignoreSingleModifiers=new mF(r),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 r=null,o=null;if(i){const[d]=e.getSingleModifierDispatchChords();r=d,o=d?[d]:[]}else[r]=e.getDispatchChords(),o=this._currentChords.map(({keypress:d})=>d);if(r===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,o,r);switch(l.kind){case of.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 of.MoreChordsNeeded:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),n=!0,this._expectAnotherChord(r,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),n;case of.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}yEt.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 Ase=class Ase{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}}};Ase.EMPTY=new Ase(null);let mF=Ase;class Mx{constructor(e,t,i,n,r,o,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?sJ(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=sJ(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=r,this.extensionId=o,this.isBuiltinExtension=a}}function sJ(s){const e=[];for(let t=0,i=s.length;tthis._getLabel(e))}getAriaLabel(){return MYe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:CEt.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return lRe.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 xdt(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 nW extends dRe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===ks.Macintosh)switch(e){case S.LeftArrow:return"←";case S.UpArrow:return"↑";case S.RightArrow:return"→";case S.DownArrow:return"↓"}return Ta.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Ta.toString(e.keyCode)}_getElectronAccelerator(e){return Ta.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Ta.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_isWYSIWYG(){return!0}_getChordDispatch(e){return nW.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+=Ta.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=Gg[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 Lh)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===S.Unknown?null:new Lh(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=sJ(e.chords.map(n=>this._toKeyCodeChord(n)));return i.length>0?[new nW(i,t)]:[]}}const Os=ae("labelService"),hg=ae("progressService"),nE=ae("editorProgressService"),NYe="telemetry.telemetryLevel",AEt="telemetry.enableCrashReporter",PYe="telemetry.enableTelemetry";var jg;(function(s){s[s.NONE=0]="NONE",s[s.CRASH=1]="CRASH",s[s.ERROR=2]="ERROR",s[s.USAGE=3]="USAGE"})(jg||(jg={}));var e1;(function(s){s.OFF="off",s.CRASH="crash",s.ERROR="error",s.ON="all"})(e1||(e1={}));function B_(s){const e=s;return typeof e?.id=="string"&&N.isUri(e.uri)}function EEt(s){return typeof s?.id=="string"&&!B_(s)&&!oA(s)}const hRe={id:"empty-window"};function JO(s,e){if(typeof s=="string"||typeof s>"u")return typeof s=="string"?{id:Kr(s)}:hRe;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 oA(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 m_e(s){const e=s;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&Array.isArray(e.folders))}function FYe(s){const e=s;return!!(e&&typeof e=="object"&&N.isUri(e.uri)&&typeof e.name=="string"&&typeof e.toResource=="function")}let OYe=class{constructor(e,t,i,n,r){this._id=e,this._transient=i,this._configuration=n,this._ignorePathCasing=r,this._foldersMap=Ih.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=Ih.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 Ft(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};function rJ(s){return new Pae({uri:s,index:0,name:TA(s)},{uri:s.toString()})}const Tb="code-workspace",BYe=`.${Tb}`,xEt=[{name:g(792,"Code Workspace"),extensions:[Tb]}];function y3(s,e){return qKe.isEqualOrParent(s,e.untitledWorkspacesHome)}function Wy(s){let e;return N.isUri(s)?e=s:e=s.configuration,e?.scheme===pe.tmp}const WYe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function DEt(s){return s.id===WYe}function __e(s,e){return!y3(s,e)&&!Wy(s)}function Fae(s){return(typeof s=="string"?jy(s):xU(s))===BYe}const Ci=ae("contextService");var Lg;(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.","")})(Lg||(Lg={}));var nWe;(function(s){s.inspectTokensAction=g(1281,"Developer: Inspect Tokens")})(nWe||(nWe={}));var oJ;(function(s){s.editorViewAccessibleLabel=g(1288,"Editor content"),s.accessibilityHelpMessage=g(1289,"Press Alt+F1 for Accessibility Options.")})(oJ||(oJ={}));var sWe;(function(s){s.toggleHighContrast=g(1290,"Toggle High Contrast Theme")})(sWe||(sWe={}));var v_e;(function(s){s.bulkEditServiceSummary=g(1291,"Made {0} edits in {1} files")})(v_e||(v_e={}));const Oae=ae("workspaceTrustEnablementService"),mC=ae("workspaceTrustManagementService"),Bae=ae("workspaceTrustRequestService");let jk=[],uRe=[],gRe=[];function gK(s,e=!1){HYe(s,!1,e)}function kEt(s){HYe(s,!0,!1)}function HYe(s,e,t){const i=IEt(s,e);jk.push(i),i.userConfigured?gRe.push(i):uRe.push(i),t&&!i.userConfigured&&jk.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 IEt(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?X_(s.filepattern.toLowerCase()):void 0,filepatternOnPath:s.filepattern?s.filepattern.indexOf(zi.sep)>=0:!1}}function TEt(){jk=jk.filter(s=>s.userConfigured),uRe=[]}function LEt(){jk=jk.filter(s=>!s.userConfigured),gRe=[]}function REt(s,e){return MEt(s,e).map(t=>t.id)}function MEt(s,e){let t;if(s)switch(s.scheme){case pe.file:t=s.fsPath;break;case pe.data:{t=Wk.parseMetaData(s).get(Wk.META_DATA_LABEL);break}case pe.vscodeNotebookCell:t=void 0;break;default:t=s.path}if(!t)return[{id:"unknown",mime:Vs.unknown}];t=t.toLowerCase();const i=Kr(t),n=rWe(t,i,gRe);if(n)return[n,{id:Sa,mime:Vs.text}];const r=rWe(t,i,uRe);if(r)return[r,{id:Sa,mime:Vs.text}];if(e){const o=NEt(e);if(o)return[o,{id:Sa,mime:Vs.text}]}return[{id:"unknown",mime:Vs.unknown}]}function rWe(s,e,t){let i,n,r;for(let o=t.length-1;o>=0;o--){const a=t[o];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&&(!r||a.extension.length>r.extension.length)&&e.endsWith(a.extensionLowercase)&&(r=a)}if(i)return i;if(n)return n;if(r)return r}function NEt(s){if(DTe(s)&&(s=s.substr(1)),s.length>0)for(let e=jk.length-1;e>=0;e--){const t=jk[e];if(!t.firstline)continue;const i=s.match(t.firstline);if(i&&i.length>0)return t}}const mv=Object.prototype.hasOwnProperty,oWe="vs.editor.nullLanguage";class PEt{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(oWe,ST.Null),this._register(Sa,ST.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)||ST.Null}decodeLanguageId(e){return this._languageIdToLanguage[e]||oWe}}const Gz=class Gz extends V{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,Gz.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new PEt,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(xT.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Gz.instanceCount--,super.dispose()}setDynamicLanguages(e){this._dynamicLanguages=e,this._initializeFromRegistry()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},TEt();const e=[].concat(xT.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}registerLanguage(e){return xT.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})}),je.as(Pn.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;mv.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)gK({id:i,mime:n,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)gK({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)gK({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);ATe(c)||gK({id:i,mime:n,firstline:c},this._warnOnOverwrite)}catch(c){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,c)}}e.aliases.push(i);let r=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?r=[null]:r=t.aliases),r!==null)for(const a of r)!a||a.length===0||e.aliases.push(a);const o=r!==null&&r.length>0;if(!(o&&r[0]===null)){const a=(o?r[0]:null)||i;(o||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?mv.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getSortedRegisteredLanguageNames(){const e=[];for(const t in this._nameMap)mv.call(this._nameMap,t)&&e.push({languageName:t,languageId:this._nameMap[t]});return e.sort((t,i)=>AS(t.languageName,i.languageName)),e}getLanguageName(e){return mv.call(this._languages,e)?this._languages[e].name:null}getMimeType(e){return mv.call(this._languages,e)&&this._languages[e].mimetypes[0]||null}getExtensions(e){return mv.call(this._languages,e)?this._languages[e].extensions:[]}getFilenames(e){return mv.call(this._languages,e)?this._languages[e].filenames:[]}getIcon(e){return mv.call(this._languages,e)&&this._languages[e].icons[0]||null}getConfigurationFiles(e){return mv.call(this._languages,e)?this._languages[e].configurationFiles||[]:[]}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return mv.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&mv.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:REt(e,t)}};Gz.instanceCount=0;let b_e=Gz;const Kz=class Kz 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,Kz.instanceCount++,this._registry=this._register(new b_e(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Kz.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 um(i,null)}createById(e){return new Vhe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByMimeType(e){return new Vhe(this.onDidChange,()=>{const t=this.getLanguageIdByMimeType(e);return this._createAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new Vhe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Sa),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),La.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};Kz.instanceCount=0;let aJ=Kz;class Vhe{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 FEt 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 ap={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Vs.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},OEt=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let Wae=OEt;const BEt=new Ca(()=>Wae("mouse",!1)),WEt=new Ca(()=>Wae("element",!1));function UYe(s){Wae=s}function Fo(s){return s==="element"?WEt.value:BEt.value}function Yk(){return Wae("element",!0)}class HEt{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}function VYe(s){return(e,t,i)=>{let n=null,r=null;if(typeof i.value=="function"?(n="value",r=i.value):typeof i.get=="function"&&(n="get",r=i.get),!r)throw new Error("not supported");i[n]=s(r,t)}}function ei(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 r=`$memoize$${e}`;t[i]=function(...o){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:n.apply(this,o)}),this[r]}}function fRe(s,e,t){return VYe((i,n)=>{const r=`$debounce$${n}`,o=`$debounce$result$${n}`;return function(...a){this[o]||(this[o]=void 0),clearTimeout(this[r]),this[r]=setTimeout(()=>{i.apply(this,a),this[o]=void 0},s)}})}function UEt(s,e,t){return VYe((i,n)=>{const r=`$throttle$timer$${n}`,o=`$throttle$result$${n}`,a=`$throttle$lastRun$${n}`,c=`$throttle$pending$${n}`;return function(...l){if(this[o]||(this[o]=t?t():void 0),(this[a]===null||this[a]===void 0)&&(this[a]=-Number.MAX_VALUE),e&&(this[o]=e(this[o],...l)),this[c])return;const d=this[a]+s;d<=Date.now()?(this[a]=Date.now(),i.apply(this,[this[o]]),this[o]=t?t():void 0):(this[c]=!0,this[r]=setTimeout(()=>{this[c]=!1,this[a]=Date.now(),i.apply(this,[this[o]]),this[o]=t?t():void 0},d-Date.now()))}})}var VEt=".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}";gt(VEt,{});var F1;(function(s){s[s.Copy=0]="Copy",s[s.Move=1]="Move"})(F1||(F1={}));var Sy;(function(s){s.Over="drop-target",s.Before="drop-target-before",s.After="drop-target-after"})(Sy||(Sy={}));class GI extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function aWe(s,e){const t=[];for(const i of e){if(s.start>=i.range.end)continue;if(s.ende.concat(t),[]))}class GEt{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,r=aWe({start:0,end:e},this.groups),o=aWe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(c=>({range:w_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=$Et(r,a,o),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 KI={CurrentDragAndDropData:void 0};var MC;(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"})(MC||(MC={}));const Zb={useShadows:!0,verticalScrollMode:Cr.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 k6{get context(){return this._context}set context(e){this._context=e}constructor(e){this.elements=e}update(){}getData(){return this.elements}}class zYe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class y_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 Ese=class Ese{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:a5(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=Zb){if(this.virtualDelegate=t,this.domId=`list_id_${++Ese.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Ph(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 o of i)this.renderers.set(o.templateId,o);this.cache=this.disposables.add(new KEt(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??Zb.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof n.paddingBottom>"u"?0:n.paddingBottom,this.accessibilityProvider=new QEt(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(n.transformOptimization??Zb.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(md.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new DN({forceIntegerValues:!0,smoothScrollDuration:n.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:o=>Nl(lt(this.domNode),o)})),this.scrollableElement=this.disposables.add(new y6(this.rowsContainer,{alwaysConsumeMouseWheel:n.alwaysConsumeMouseWheel??Zb.alwaysConsumeMouseWheel,horizontal:Cr.Auto,vertical:n.verticalScrollMode??Zb.verticalScrollMode,useShadows:n.useShadows??Zb.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,ur.Change,o=>this.onTouchChange(o))),this.disposables.add(ue(this.scrollableElement.getDomNode(),"scroll",o=>o.target.scrollTop=0)),this.disposables.add(ue(this.domNode,"dragover",o=>this.onDragOver(this.toDragEvent(o)))),this.disposables.add(ue(this.domNode,"drop",o=>this.onDrop(this.toDragEvent(o)))),this.disposables.add(ue(this.domNode,"dragleave",o=>this.onDragLeave(this.toDragEvent(o)))),this.disposables.add(ue(this.domNode,"dragend",o=>this.onDragEnd(o))),this.setRowLineHeight=n.setRowLineHeight??Zb.setRowLineHeight,this.setRowHeight=n.setRowHeight??Zb.setRowHeight,this.supportDynamicHeights=n.supportDynamicHeights??Zb.supportDynamicHeights,this.dnd=n.dnd??this.disposables.add(Zb.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 r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);let o=0;ee&&i=o.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=Pd.intersect(c,n),d=Pd.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=w_e(l,f),v=Pd.intersect(p,m);for(let A=v.start;Aw_e(A,f)),C=[{start:e,end:e+i.length},...w].map(A=>Pd.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=Nl(lt(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:PTe(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:a5(this.domNode)})}render(e,t,i,n,r,o=!1){const a=this.getRenderRange(t,i),c=Pd.relativeComplement(a,e).reverse(),l=Pd.relativeComplement(e,a);if(o){const d=Pd.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&&r!==void 0&&(this.rowsContainer.style.width=`${Math.max(r,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 r=this.accessibilityProvider.isChecked(i.element);if(typeof r=="boolean")i.row.domNode.setAttribute("aria-checked",String(!!r));else if(r){const c=l=>i.row.domNode.setAttribute("aria-checked",String(!!l));c(r.value),i.checkedDisposable=r.onDidChange(()=>c(r.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 o=this.renderers.get(i.templateId);if(!o)throw new Error(`No renderer found for template id ${i.templateId}`);o?.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=a5(e.row.domNode);const t=lt(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 ni(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return M.map(this.disposables.add(new ni(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return M.filter(M.map(this.disposables.add(new ni(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 ni(this.domNode,"mouseup")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDown(){return M.map(this.disposables.add(new ni(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return M.map(this.disposables.add(new ni(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMove(){return M.map(this.disposables.add(new ni(this.domNode,"mousemove")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return M.map(this.disposables.add(new ni(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return M.any(M.map(this.disposables.add(new ni(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),M.map(this.disposables.add(new ni(this.domNode,ur.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return M.map(this.disposables.add(new ni(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return M.map(this.disposables.add(new ni(this.rowsContainer,ur.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,r=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:n,sector:r}}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(ap.TEXT,t),i.dataTransfer.setDragImage){let r;this.dnd.getDragLabel&&(r=this.dnd.getDragLabel(n,i)),typeof r>"u"&&(r=String(n.length));const o=fe(".monaco-drag-image");o.textContent=r,(l=>{for(;l&&!l.classList.contains("monaco-workbench");)l=l.parentElement;return l||this.domNode.ownerDocument})(this.domNode).appendChild(o),i.dataTransfer.setDragImage(o,-10,-10),setTimeout(()=>o.remove(),0)}this.domNode.classList.add("dragging"),this.currentDragData=new k6(n),KI.CurrentDragAndDropData=new zYe(n),this.dnd.onDragStart?.(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),KI.CurrentDragAndDropData&&KI.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(KI.CurrentDragAndDropData)this.currentDragData=KI.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new y_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===F1.Copy?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=Ya(i).filter(r=>r>=-1&&rr-o),i=i[0]===-1?[-1]:i;let n=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:Sy.Over;if(qEt(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!==Sy.Over)throw new Error("Can't use multiple feedbacks with position different than 'over'");n===Sy.After&&i[0]{for(const r of i){const o=this.items[r];o.dropTarget=!1,o.row?.domNode.classList.remove(n)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Zy(()=>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,KI.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,KI.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=tY(this.domNode).top;this.dragOverAnimationDisposable=lut(lt(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Zy(()=>{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 Qa(n,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(Jo(i)||nut(i))&&i!==this.rowsContainer&&t.contains(i);){const n=i.getAttribute("data-index");if(n){const r=Number(n);if(!isNaN(r))return r}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 r,o;e===this.elementTop(n.start)?(r=n.start,o=0):n.end-n.start>1&&(r=n.start+1,o=this.elementTop(r)-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 sW(s=wp){return(e,t)=>ns(e,t,s)}function jEt(){return(s,e)=>s.equals(e)}function jq(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,r)=>n==null||r===void 0||r===null?r===n:i(n,r)}}function cJ(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 r=pRe(n);if(r!==void 0)return r;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},r=>n(this.read(r),r))}flatten(){return A_e({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(GYe(this,t)),this}keepObserved(e){return e.add(KYe(this)),this}get debugValue(){return this.get()}}class OU extends qYe{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 is(s,e){const t=new BU(s,e);try{s(t)}finally{t.finish()}}let fK;function fV(s){if(fK)s(fK);else{const e=new BU(s,void 0);fK=e;try{s(e)}finally{e.finish(),fK=void 0}}}async function QYe(s,e){const t=new BU(s,e);try{await s(t)}finally{t.finish()}}function IM(s,e,t){s?e(s):is(e,t)}class BU{constructor(e,t){this._fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():pRe(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 r=this._value;this._setValue(e),$Ye()?.handleObservableChanged(this,{oldValue:r,newValue:e,change:i,didChange:!0,hadValue:!0});for(const o of this.observers)t.updateObserver(o,this),o.handleChange(this,i)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function C3(s,e){let t;return typeof s=="string"?t=new Xd(void 0,s,void 0):t=new Xd(s,void 0,void 0),new axt(t,e,wp)}class axt extends mRe{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}function et(s,e){return e!==void 0?new TM(new Xd(s,void 0,e),e,void 0,void 0,void 0,wp):new TM(new Xd(void 0,void 0,s),s,void 0,void 0,void 0,wp)}function I6(s,e,t){return new cxt(new Xd(s,void 0,e),e,void 0,void 0,void 0,wp,t)}function Zh(s,e){return new TM(new Xd(s.owner,s.debugName,s.debugReferenceFn),e,void 0,void 0,s.onLastObserverRemoved,s.equalsFn??wp)}oxt(Zh);function jYe(s,e){return new TM(new Xd(s.owner,s.debugName,void 0),e,s.createEmptyChangeSummary,s.handleChange,void 0,s.equalityComparer??wp)}function TI(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);const n=new Z;return new TM(new Xd(i,void 0,t),r=>(n.clear(),t(r,n)),void 0,void 0,()=>n.dispose(),wp)}function vh(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);let n;return new TM(new Xd(i,void 0,t),r=>{n?n.clear():n=new Z;const o=t(r);return o&&n.add(o),o},void 0,void 0,()=>{n&&(n.dispose(),n=void 0)},wp)}var Ed;(function(s){s[s.initial=0]="initial",s[s.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",s[s.stale=2]="stale",s[s.upToDate=3]="upToDate"})(Ed||(Ed={}));class TM extends OU{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n,r=void 0,o){super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=n,this._handleLastObserverRemoved=r,this._equalityComparator=o,this.state=Ed.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=Ed.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===Ed.dependenciesMightHaveChanged){for(const e of this.dependencies)if(e.reportChanges(),this.state===Ed.stale)break}this.state===Ed.dependenciesMightHaveChanged&&(this.state=Ed.upToDate),this._recomputeIfNeeded()}while(this.state!==Ed.upToDate);return this.value}}_recomputeIfNeeded(){if(this.state===Ed.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e;const t=this.state!==Ed.initial,i=this.value;this.state=Ed.upToDate;const n=this.changeSummary;this.changeSummary=this.createChangeSummary?.();try{this.value=this._computeFn(this,n)}finally{for(const o of this.dependenciesToBeRemoved)o.removeObserver(this);this.dependenciesToBeRemoved.clear()}if(t&&!this._equalityComparator(i,this.value))for(const o of this.observers)o.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===Ed.upToDate&&(this.state=Ed.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)}Q_(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===Ed.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=Ed.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:r=>r===e},this.changeSummary):!0,n=this.state===Ed.upToDate;if(i&&(this.state===Ed.dependenciesMightHaveChanged||n)&&(this.state=Ed.stale,n))for(const r of this.observers)r.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 cxt extends TM{constructor(e,t,i,n,r=void 0,o,a){super(e,t,i,n,r,o),this.set=a}}function ci(s){return new Hae(new Xd(void 0,void 0,s),s,void 0,void 0)}function T6(s,e){return new Hae(new Xd(s.owner,s.debugName,s.debugReferenceFn??e),e,void 0,void 0)}function WU(s,e){return new Hae(new Xd(s.owner,s.debugName,s.debugReferenceFn??e),e,s.createEmptyChangeSummary,s.handleChange)}function lxt(s,e){const t=new Z,i=WU({owner:s.owner,debugName:s.debugName,debugReferenceFn:s.debugReferenceFn??e,createEmptyChangeSummary:s.createEmptyChangeSummary,handleChange:s.handleChange},(n,r)=>{t.clear(),e(n,r,t)});return Ee(()=>{i.dispose(),t.dispose()})}function du(s){const e=new Z,t=T6({owner:void 0,debugName:void 0,debugReferenceFn:s},i=>{e.clear(),s(i,e)});return Ee(()=>{t.dispose(),e.dispose()})}var If;(function(s){s[s.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",s[s.stale=2]="stale",s[s.upToDate=3]="upToDate"})(If||(If={}));class Hae{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=If.stale,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=this.createChangeSummary?.(),this._runIfNeeded(),yU(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),CU(this)}_runIfNeeded(){if(this.state===If.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e,this.state=If.upToDate;const t=this.disposed;try{if(!t){$Ye()?.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===If.upToDate&&(this.state=If.dependenciesMightHaveChanged),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===If.dependenciesMightHaveChanged){this.state=If.upToDate;for(const e of this.dependencies)if(e.reportChanges(),this.state===If.stale)break}this._runIfNeeded()}while(this.state!==If.upToDate);this.updateCount--,Q_(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===If.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=If.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=If.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=Hae})(ci||(ci={}));function rd(s){return new dxt(s)}class dxt extends qYe{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 qn(...s){let e,t,i;return s.length===3?[e,t,i]=s:[t,i]=s,new Nx(new Xd(e,void 0,i),t,i,()=>Nx.globalTransaction,wp)}function hxt(s,e,t){return new Nx(new Xd(s.owner,s.debugName,s.debugReferenceFn??t),e,t,()=>Nx.globalTransaction,s.equalsFn??wp)}class Nx extends OU{constructor(e,t,i,n,r){super(),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=n,this._equalityComparator=r,this.hasValue=!1,this.handleEvent=o=>{const a=this._getValue(o),c=this.value;(!this.hasValue||!this._equalityComparator(c,a))&&(this.value=a,this.hasValue&&IM(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=Nx;function e(t,i){let n=!1;Nx.globalTransaction===void 0&&(Nx.globalTransaction=t,n=!0);try{i()}finally{n&&(Nx.globalTransaction=void 0)}}s.batchEventsGlobally=e})(qn||(qn={}));function sd(s,e){return new uxt(s,e)}class uxt extends OU{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{is(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 _C(s){return typeof s=="string"?new uWe(s):new uWe(void 0,s)}class uWe extends OU{get debugName(){return new Xd(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){is(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 Yq(s){const e=new YYe(!1,void 0);return s.addObserver(e),Ee(()=>{s.removeObserver(e)})}rxt(Yq);function VN(s,e){const t=new YYe(!0,e);return s.addObserver(t),e?e(s.get()):s.reportChanges(),Ee(()=>{s.removeObserver(t)})}sxt(VN);class YYe{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 L6(s,e){let t;return Zh({owner:s,debugReferenceFn:e},n=>(t=e(n,t),t))}function gxt(s,e){let t;const i=_C("derivedObservableWithWritableCache"),n=et(s,r=>(i.read(r),t=e(r,t),t));return Object.assign(n,{clearCache:r=>{t=void 0,i.trigger(r)},setCache:(r,o)=>{t=r,i.trigger(o)}})}function lJ(s,e,t,i){let n=new gWe(t,i);return Zh({debugReferenceFn:t,owner:s,onLastObserverRemoved:()=>{n.dispose(),n=new gWe(t)}},o=>(n.setItems(e.read(o)),n.getItems()))}class gWe{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 r=this._keySelector?this._keySelector(n):n;let o=this._cache.get(r);if(o)i.delete(r);else{const a=new Z;o={out:this._map(n,a),store:a},this._cache.set(r,o)}t.push(o.out)}for(const n of i)this._cache.get(n).store.dispose(),this._cache.delete(n);this._items=t}getItems(){return this._items}}class _Re{constructor(e){this.observable=e}get onDidChange(){return M.fromObservableLight(this.observable)}get value(){return this.observable.get()}}function JYe(s,e){return e instanceof _Re?e.observable:qn(s,e.onDidChange,()=>e.value)}function fxt(s,e){return L6(s,(t,i)=>i??e(t))}class pxt{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(r=>r.templateData===i);if(n>=0){const r=this.renderedElements[n];this.trait.unrender(i),r.index=t}else{const r={index:t,templateData:i};this.renderedElements.push(r)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const r of this.renderedElements)r.index=e+t&&n.push({index:r.index+i-t,templateData:r.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 S3=class{get name(){return this._trait}get renderer(){return new pxt(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,r=e+t,o=[];let a=0;for(;a=r;)o.push(this.sortedIndexes[a++]+n);this.renderer.splice(e,t,i.length),this._set(o,o)}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(pWe),t)}_set(e,t,i){const n=this.indexes,r=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const o=x_e(r,e);return this.renderer.renderIndexes(o),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return k2(this.sortedIndexes,e,pWe)>=0}dispose(){wt(this._onChange)}};S3.__decorator=D([ei],S3.prototype,"renderer",null);class mxt extends S3{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 zhe{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 r=new Set(n),o=i.map(a=>r.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,o)}}function aA(s){return s.tagName==="INPUT"||s.tagName==="TEXTAREA"}function R6(s,e){return s.classList.contains(e)?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:R6(s.parentElement,e)}function pV(s){return R6(s,"monaco-editor")}function _xt(s){return R6(s,"monaco-custom-toggle")}function vxt(s){return R6(s,"action-item")}function L5(s){return R6(s,"monaco-tree-sticky-row")}function A3(s){return s.classList.contains("monaco-tree-sticky-container")}function XYe(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:XYe(s.parentElement)}class E_e{get onKeyDown(){return M.chain(this.disposables.add(new ni(this.view.domNode,"keydown")).event,e=>e.filter(t=>!aA(t.target)).map(t=>new xn(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&&(jt?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(xu(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()}}E_e.__decorator=D([ei],E_e.prototype,"onKeyDown",null);var jw;(function(s){s[s.Automatic=0]="Automatic",s[s.Trigger=1]="Trigger"})(jw||(jw={}));var _F;(function(s){s[s.Idle=0]="Idle",s[s.Typing=1]="Typing"})(_F||(_F={}));const bxt=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 wxt{constructor(e,t,i,n,r){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=r,this.enabled=!1,this.state=_F.Idle,this.mode=jw.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??jw.Automatic}trigger(){this.triggered=!this.triggered}enable(){if(this.enabled)return;let e=!1;const t=M.chain(this.enabledDisposables.add(new ni(this.view.domNode,"keydown")).event,r=>r.filter(o=>!aA(o.target)).filter(()=>this.mode===jw.Automatic||this.triggered).map(o=>new xn(o)).filter(o=>e||this.keyboardNavigationEventFilter(o)).filter(o=>this.delegate.mightProducePrintableCharacter(o)).forEach(o=>tn.stop(o,!0)).map(o=>o.browserEvent.key)),i=M.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);M.reduce(M.any(t,i),(r,o)=>o===null?null:(r||"")+o,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"?No(t):t&&No(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=_F.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===_F.Idle?1:0;this.state=_F.Typing;for(let r=0;r1&&l.length===1){this.previouslyFocused=i,this.list.setFocus([o]),this.list.reveal(o);return}}}else if(typeof c>"u"||kM(e,c)){this.previouslyFocused=i,this.list.setFocus([o]),this.list.reveal(o);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class yxt{constructor(e,t){this.list=e,this.view=t,this.disposables=new Z;const i=M.chain(this.disposables.add(new ni(t.domNode,"keydown")).event,r=>r.filter(o=>!aA(o.target)).map(o=>new xn(o)));M.chain(i,r=>r.filter(o=>o.keyCode===S.Tab&&!o.ctrlKey&&!o.metaKey&&!o.shiftKey&&!o.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||!Jo(n)||n.tabIndex===-1)return;const r=lt(n).getComputedStyle(n);r.visibility==="hidden"||r.display==="none"||(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function ZYe(s){return jt?s.browserEvent.metaKey:s.browserEvent.ctrlKey}function eJe(s){return s.browserEvent.shiftKey}function Cxt(s){return BTe(s)&&s.button===2}const fWe={isSelectionSingleChangeEvent:ZYe,isSelectionRangeChangeEvent:eJe};class tJe{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||fWe),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(md.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||fWe))}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){pV(e.browserEvent.target)||Wc()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(aA(e.browserEvent.target)||pV(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||aA(e.browserEvent.target)||pV(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),Cxt(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(aA(e.browserEvent.target)||pV(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),r=Math.max(i,t),o=xu(n,r+1),a=this.list.getSelection(),c=Ext(x_e(a,[i]),i);if(c.length===0)return;const l=x_e(o,xxt(a,c));this.list.setSelection(l,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const n=this.list.getSelection(),r=n.filter(o=>o!==t);this.list.setFocus([t]),this.list.setAnchor(t),n.length===r.length?this.list.setSelection([...r,t],e.browserEvent):this.list.setSelection(r,e.browserEvent)}}dispose(){this.disposables.dispose()}}class iJe{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(` @@ -269,9 +269,9 @@ ${e}`)}function $At(s){return II(s,"`")}function GAt(s){return II(s,"*")}functio background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=i.join(` -`)}}const Sxt={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},Axt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Ext(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 Dxt{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 r=0;for(const o of this.renderers)o.renderElement(e,t,i[r++],n)}disposeElement(e,t,i,n){let r=0;for(const o of this.renderers)o.disposeElement?.(e,t,i[r],n),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class kxt{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),r=n&&typeof n!="string"?n:rd(n);i.disposables.add(ci(a=>{this.setAriaLabel(a.readObservable(r),i.container)}));const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.container.setAttribute("aria-level",`${o}`):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 Ixt{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,r){return this.dnd.onDragOver(e,t,i,n,r)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,r){this.dnd.drop(e,t,i,n,r)}dispose(){this.dnd.dispose()}}class Za{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 ni(this.view.domNode,"keydown")).event,r=>r.map(o=>new xn(o)).filter(o=>e=o.keyCode===S.ContextMenu||o.shiftKey&&o.keyCode===S.F10).map(o=>tn.stop(o,!0)).filter(()=>!1)),i=M.chain(this.disposables.add(new ni(this.view.domNode,"keyup")).event,r=>r.forEach(()=>e=!1).map(o=>new xn(o)).filter(o=>o.keyCode===S.ContextMenu||o.shiftKey&&o.keyCode===S.F10).map(o=>tn.stop(o,!0)).map(({browserEvent:o})=>{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:o}})),n=M.chain(this.view.onContextMenu,r=>r.filter(o=>!e).map(({element:o,index:a,browserEvent:c})=>({element:o,index:a,anchor:new Dh(lt(this.view.domNode),c),browserEvent:c})));return M.any(t,i,n)}get onKeyDown(){return this.disposables.add(new ni(this.view.domNode,"keydown")).event}get onKeyUp(){return this.disposables.add(new ni(this.view.domNode,"keyup")).event}get onKeyPress(){return this.disposables.add(new ni(this.view.domNode,"keypress")).event}get onDidFocus(){return M.signal(this.disposables.add(new ni(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return M.signal(this.disposables.add(new ni(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,r=Axt){this.user=e,this._options=r,this.focus=new S3("focused"),this.anchor=new S3("anchor"),this.eventBufferer=new Q7,this._ariaLabel="",this.disposables=new Z,this._onDidDispose=new I,this.onDidDispose=this._onDidDispose.event;const o=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():"list";this.selection=new mxt(o!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=r.accessibilityProvider,this.accessibilityProvider&&(a.push(new kxt(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(l=>new Dxt(l.templateId,[...a,l]));const c={...r,dnd:r.dnd&&new Ixt(this,r.dnd)};if(this.view=this.createListView(t,i,n,c),this.view.domNode.setAttribute("role",o),r.styleController)this.styleController=r.styleController(this.view.domId);else{const l=fl(this.view.domNode);this.styleController=new iJe(l,this.view.domId)}if(this.spliceable=new HEt([new zhe(this.focus,this.view,r.identityProvider),new zhe(this.selection,this.view,r.identityProvider),new zhe(this.anchor,this.view,r.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 yxt(this,this.view)),(typeof r.keyboardSupport!="boolean"||r.keyboardSupport)&&(this.keyboardController=new E_e(this,this.view,r),this.disposables.add(this.keyboardController)),r.keyboardNavigationLabelProvider){const l=r.keyboardNavigationDelegate||bxt;this.typeNavigationController=new wxt(this,this.view,r.keyboardNavigationLabelProvider,r.keyboardNavigationEventFilter??(()=>!0),l),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(r),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 fc(e,t,i,n)}createMouseController(e){return new tJe(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 GI(this.user,`Invalid start index: ${e}`);if(t<0)throw new GI(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 GI(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 GI(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return um(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 GI(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(this.length===0)return;const r=this.focus.get(),o=this.findNextIndex(r.length>0?r[0]+e:0,t,n);o>-1&&this.setFocus([o],i)}focusPrevious(e=1,t=!1,i,n){if(this.length===0)return;const r=this.focus.get(),o=this.findPreviousIndex(r.length>0?r[0]-e:0,t,n);o>-1&&this.setFocus([o],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 r=this.findPreviousIndex(i,!1,t);r>-1&&n!==r?this.setFocus([r],e):this.setFocus([i],e)}else{const r=this.view.getScrollTop();let o=r+this.view.renderHeight;i>n&&(o-=this.view.elementHeight(i)),this.view.setScrollTop(o),this.view.getScrollTop()!==r&&(this.setFocus([]),await Ao(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;const r=i(),o=this.view.getScrollTop()+r;o===0?n=this.view.indexAt(o):n=this.view.indexAfter(o-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=o;this.view.setScrollTop(o-this.view.renderHeight-r),this.view.getScrollTop()+i()!==c&&(this.setFocus([]),await Ao(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 GI(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),r=this.view.elementTop(e),o=this.view.elementHeight(e);if(dc(t)){const a=o-this.view.renderHeight+i;this.view.setScrollTop(a*qa(t,0,1)+r-i)}else{const a=r+o,c=n+this.view.renderHeight;r=c||(r=c&&o>=this.view.renderHeight?this.view.setScrollTop(r-i):a>=c&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new GI(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),r=this.view.elementHeight(e);if(ni+this.view.renderHeight)return null;const o=r-this.view.renderHeight+t;return Math.abs((i+t-n)/o)}isDOMFocused(){return dv(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()}}Za.__decorator=D([ei],Za.prototype,"onDidChangeFocus",null);Za.__decorator=D([ei],Za.prototype,"onDidChangeSelection",null);Za.__decorator=D([ei],Za.prototype,"onContextMenu",null);Za.__decorator=D([ei],Za.prototype,"onKeyDown",null);Za.__decorator=D([ei],Za.prototype,"onKeyUp",null);Za.__decorator=D([ei],Za.prototype,"onKeyPress",null);Za.__decorator=D([ei],Za.prototype,"onDidFocus",null);Za.__decorator=D([ei],Za.prototype,"onDidBlur",null);let nJe={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>null,showManagedHover:()=>{}};function sJe(s){nJe=s}function xm(){return nJe}var Txt=".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}";gt(Txt,{});const O1=fe,rJe="selectOption.entry.template";class Lxt{get templateId(){return rJe}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=oe(e,O1(".option-text")),t.detail=oe(e,O1(".option-detail")),t.decoratorRight=oe(e,O1(".option-decorator-right")),t}renderElement(e,t,i){const n=i,r=e.text,o=e.detail,a=e.decoratorRight,c=e.isDisabled;n.text.textContent=r,n.detail.textContent=o||"",n.decoratorRight.innerText=a||"",c?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}const Ew=class Ew extends V{constructor(e,t,i,n,r){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=r||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Ew.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(xm().setupManagedHover(Fo("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return rJe}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=fe(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=oe(this.selectDropDownContainer,O1(".select-box-details-pane"));const t=oe(this.selectDropDownContainer,O1(".select-box-dropdown-container-width-control")),i=oe(t,O1(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",oe(i,this.widthControlElement),this._dropDownPosition=Gf.BELOW,this.styleElement=fl(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ue(this.selectDropDownContainer,ke.DRAG_START,n=>{tn.stop(n,!0)}))}registerListeners(){this._register(Rr(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=>{tn.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ue(this.selectElement,ke.MOUSE_DOWN,t=>{tn.stop(t)}));let e;this._register(ue(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ue(this.selectElement,"touchend",t=>{tn.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ue(this.selectElement,ke.KEY_DOWN,t=>{const i=new xn(t);let n=!1;jt?(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(),tn.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){ns(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=My(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=lt(this.selectElement),i=So(this.selectElement),n=lt(this.selectElement).getComputedStyle(this.selectElement),r=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),o=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-Ew.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+r+u,p=Math.floor((o-r-u)/this.getHeight()),m=Math.floor((a-r-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topp&&this.options.length>p?(this._dropDownPosition=Gf.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=Gf.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.topo&&(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+r+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+r+"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((r,o)=>{const a=r.detail?r.detail.length:0,c=r.decoratorRight?r.decoratorRight.length:0,l=r.text.length+a+c;l>n&&(i=o,n=l)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=Od(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=oe(e,O1(".select-box-dropdown-list-container")),this.listRenderer=new Lxt,this.selectList=this._register(new Za("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:Cr.Visible,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:n=>{let r=n.text;return n.detail&&(r+=`. ${n.detail}`),n.decoratorRight&&(r+=`. ${n.decoratorRight}`),n.description&&(r+=`. ${n.description}`),r},getWidgetAriaLabel:()=>g(10917,"Select Box"),getRole:()=>jt?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new ni(this.selectDropDownListContainer,"keydown")),i=M.chain(t.event,n=>n.filter(()=>this.selectList.length>0).map(r=>new xn(r)));this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.Enter))(this.onEnter,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.Tab))(this.onEnter,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.Escape))(this.onEscape,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.UpArrow))(this.onUpArrow,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.DownArrow))(this.onDownArrow,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.PageDown))(this.onPageDown,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.PageUp))(this.onPageUp,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.Home))(this.onHome,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.End))(this.onEnd,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode>=S.Digit0&&r.keyCode<=S.KeyZ||r.keyCode>=S.Semicolon&&r.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||yc(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;tn.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")),r=i.classList.contains("option-disabled");n>=0&&n{for(let o=0;othis.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&&(tn.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){tn.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){tn.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){tn.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=Ta.toString(e.keyCode);let i=-1;for(let n=0;n{this._register(ue(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Rr(this.selectElement,"click",e=>{tn.stop(e,!0)})),this._register(Rr(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Rr(this.selectElement,"keydown",e=>{let t=!1;jt?(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||!ns(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 q_)),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(md.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,lf&&this._register(ue(e,ke.DRAG_START,n=>n.dataTransfer?.setData(ap.TEXT,this._action.label)))),this._register(ue(t,ur.Tap,n=>this.onClick(n,!0))),this._register(ue(t,ke.MOUSE_DOWN,n=>{i||tn.stop(n,!0),this._action.enabled&&n.button===0&&t.classList.add("active")})),jt&&this._register(ue(t,ke.CONTEXT_MENU,n=>{n.button===0&&n.ctrlKey===!0&&this.onClick(n)})),this._register(ue(t,ke.CLICK,n=>{tn.stop(n,!0),this.options&&this.options.isMenu||this.onClick(n)})),this._register(ue(t,ke.DBLCLICK,n=>{tn.stop(n,!0)})),[ke.MOUSE_UP,ke.MOUSE_OUT].forEach(n=>{this._register(ue(t,n,r=>{tn.stop(r),t.classList.remove("active")}))})}onClick(e,t=!1){tn.stop(e,!0);const i=aa(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??Fo("element");this.customHover=this._store.add(xm().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 tC extends Kf{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),Lt(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===Eo.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 oJe extends Kf{constructor(e,t,i,n,r,o,a){super(e,t),this.selectBox=new Nxt(i,n,r,o,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 Fxt=".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}";gt(Fxt,{});class Oxt extends q_{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=oe(e,fe(".monaco-dropdown")),this._label=oe(this._element,fe(".dropdown-label"));let i=t.labelRenderer;i||(i=r=>(r.textContent=t.label||"",null));for(const r of[ke.CLICK,ke.MOUSE_DOWN,ur.Tap])this._register(ue(this.element,r,o=>tn.stop(o,!0)));for(const r of[ke.MOUSE_DOWN,ur.Tap])this._register(ue(this._label,r,o=>{BTe(o)&&(o.detail>1||o.button!==0)||(this.visible?this.hide():this.show())}));this._register(ue(this._label,ke.KEY_UP,r=>{const o=new xn(r);(o.equals(S.Enter)||o.equals(S.Space))&&(tn.stop(r,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(md.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(xm().setupManagedHover(Fo("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 Bxt extends Oxt{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:Cb.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 cA extends Kf{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=r=>{this.element=oe(r,fe("a.action-label"));let o=[];return typeof this.options.classNames=="string"?o=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(o=this.options.classNames),o.find(a=>a==="icon")||o.push("codicon"),this.element.classList.add(...o),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(xm().setupManagedHover(this.options.hoverDelegate??Fo("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 Bxt(e,n)),this._register(this.dropdownMenu.onDidChangeVisibility(r=>{this.element?.setAttribute("aria-expanded",`${r}`),this._onDidChangeVisibility.fire(r)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const r=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return r.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 Wxt='.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}';gt(Wxt,{});const Ba=ae("menuService");function vRe(s){return s&&typeof s=="object"&&typeof s.original=="string"&&typeof s.value=="string"}function Hxt(s){return s?s.condition!==void 0:!1}const R5={exports:{}};(function(){function s(n){const r=[];typeof n=="number"&&r.push("code/timeOrigin",n);function o(c){r.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===Lv.Closed)return;let i=!1;aa(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===Lv.None&&(this.state=Lv.Initialized,this.options.hint!==hD.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){const i=this.cache.get(e);return aa(i)?t:i}getBoolean(e,t){const i=this.get(e);return aa(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return aa(i)?t:parseInt(i,10)}getObject(e,t){const i=this.get(e);return aa(i)?t:iW(i)}async set(e,t,i=!1){if(this.state===Lv.Closed)return;if(aa(t))return this.delete(e,i);const n=In(t)||Array.isArray(t)?CYe(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===Lv.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!==Lv.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=Lv.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===Lv.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===hD.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===hD.STORAGE_IN_MEMORY}};xse.DEFAULT_FLUSH_DELAY=100;let lA=xse;class Jq{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 Xt=ae("fileService"),Is=ae("IUriIdentityService"),zxt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function $xt(s){return zxt.test(s)}const ao=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(r.emptyWindows)for(const[o,a]of Object.entries(r.emptyWindows)){const c=t.find(l=>l.id===a);c&&n.set(o,c)}}catch(r){this.logService.error(r)}this._profilesObject={profiles:t,workspaces:i,emptyWindows:n}}return this._profilesObject}createDefaultProfile(){const e=mV("__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(`${Nh(t)}\\s(\\d+)`);let n=0;for(const o of this.profiles){const a=i.exec(o.name),c=a?parseInt(a[1]):0;n=c>n?c:n}const r=`${t} ${n+1}`;return this.createProfile(Hc(ao()).toString(16),r,{transient:!0},e)}async createNamedProfile(e,t,i){return this.createProfile(Hc(ao()).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 r=await this.doCreateProfile(e,t,i);return n&&await this.setProfileForWorkspace(n,r),r}async doCreateProfile(e,t,i){if(!Rt(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 o=mV(e,t,Ft(this.profilesHome,e),this.profilesCacheHome,i,this.defaultProfile);await this.fileService.createFolder(o.location);const a=[];return this._onWillCreateProfile.fire({profile:o,join(c){a.push(c)}}),await er.settled(a),this.updateProfiles([o],[],[]),o}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=mV(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){Qw(n)!==ji.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||(B_(e)?this.transientProfilesObject.folders.get(e.uri):oA(e)?this.transientProfilesObject.workspaces.get(e.configPath):this.transientProfilesObject.emptyWindows.get(e.id))}getWorkspace(e){return B_(e)?e.uri:oA(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],r=[],o=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=o.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}}r.push({location:a.location,name:a.name,shortName:a.shortName,icon:a.icon,useDefaultFlags:a.useDefaultFlags})}}this.saveStoredProfiles(r),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)B_(e)?(this.transientProfilesObject.folders.delete(e.uri),t&&this.transientProfilesObject.folders.set(e.uri,t)):oA(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[r,o]of Object.entries(e.workspaces)){const a=N.parse(o);t[r]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}const n={};if(e.emptyWindows)for(const[r,o]of Object.entries(e.emptyWindows)){const a=N.parse(o);n[r]=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(){}},mL.PROFILES_KEY="userDataProfiles",mL.PROFILE_ASSOCIATIONS_KEY="profileAssociations",mL);_We=D([_(0,ec),_(1,Xt),_(2,Is),_(3,Ke)],_We);const Xq="__$__isNewStorageMarker",Zq="__$__targetStorageMarker";var Ay;(function(s){s[s.NONE=0]="NONE",s[s.SHUTDOWN=1]="SHUTDOWN"})(Ay||(Ay={}));var Ie;(function(s){s[s.APPLICATION=-1]="APPLICATION",s[s.PROFILE=0]="PROFILE",s[s.WORKSPACE=1]="WORKSPACE"})(Ie||(Ie={}));var cn;(function(s){s[s.USER=0]="USER",s[s.MACHINE=1]="MACHINE"})(cn||(cn={}));function Gxt(s){const e=s.get(Zq);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const Dse=class Dse extends V{constructor(e={flushInterval:Dse.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Nk),this._onDidChangeTarget=this._register(new Nk),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new I),this.onWillSaveState=this._onWillSaveState.event,this.flushWhenIdleScheduler=this._register(new ln(()=>this.doFlushWhenIdle(),this.options.flushInterval)),this.runFlushWhenIdle=this._register(new yn),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=U2(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){wt([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{ls("code/willInitStorage");try{await this.doInitialize()}finally{ls("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===Zq){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,r=!1){if(aa(t)){this.remove(e,i,r);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,n),this.getStorage(i)?.set(e,t,r)})}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 r of Object.keys(n))n[r]===t&&i.push(r);return i}updateKeyTarget(e,t,i,n=!1){const r=this.getKeyTargets(t);typeof i=="number"?r[e]!==i&&(r[e]=i,this.getStorage(t)?.set(Zq,JSON.stringify(r),n)):typeof r[e]=="number"&&(delete r[e],this.getStorage(t)?.set(Zq,JSON.stringify(r),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?Gxt(t):Object.create(null)}isNew(e){return this.getBoolean(Xq,e)===!0}async flush(e=Ay.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 Ay.NONE:await er.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve()]);break;case Ay.SHUTDOWN:await er.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 qxt(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(Ay.NONE),aJe(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||k_e(t)&&k_e(e))}switchData(e,t,i){this.withPausedEmitters(()=>{const n=new Set;for(const[r,o]of e)n.add(r),t.get(r)!==o&&this.emitDidChangeValue(i,{key:r,external:!0});for(const[r]of t.items)n.has(r)||this.emitDidChangeValue(i,{key:r,external:!0})})}};Dse.DEFAULT_FLUSH_INTERVAL=60*1e3;let rW=Dse;function k_e(s){return s.isDefault||!!s.useDefaultFlags?.globalState}class Kxt extends rW{constructor(){super(),this.applicationStorage=this._register(new lA(new Jq,{hint:hD.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new lA(new Jq,{hint:hD.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new lA(new Jq,{hint:hD.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 qxt(s,e,t,i,n,r){const o=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,o(m))});const l=new Map,d=new Map;e.forEach((m,v)=>{l.set(v,m),d.set(v,o(m))});const h=new Map,u=new Map;t.forEach((m,v)=>{h.set(v,m),u.set(v,o(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: ${r})`);const p=[];h.forEach((m,v)=>{p.push({key:v,value:m})}),console.table(p),console.groupEnd(),console.log(u)}const Gi=ae("storageService");function Qxt(s,e){const t={...e};for(const i in s){const n=s[i];t[i]=n!==void 0?$e(n):void 0}return t}const I_e={keybindingLabelBackground:$e(ymt),keybindingLabelForeground:$e(Cmt),keybindingLabelBorder:$e(Smt),keybindingLabelBottomBorder:$e(Amt),keybindingLabelShadow:$e(kI)},M6={buttonForeground:$e(EM),buttonSeparator:$e(kQe),buttonBackground:$e(yy),buttonHoverBackground:$e(X8),buttonSecondaryForeground:$e(dmt),buttonSecondaryBackground:$e(lme),buttonSecondaryHoverBackground:$e(hmt),buttonBorder:$e(lmt)},cJe={progressBarBackground:$e(xpt)},dJ={inputActiveOptionBorder:$e(uae),inputActiveOptionForeground:$e(gae),inputActiveOptionBackground:$e(b6)};$e(aV),$e(umt),$e(gmt),$e(fmt),$e(pmt),$e(mmt),$e(_mt);$e(vmt),$e(wmt),$e(bmt);$e(kh),$e(PN),$e(kI),$e(yt),$e(Kpt),$e(qpt),$e(Qpt),$e(iLe);const LM={inputBackground:$e(Y2),inputForeground:$e(AQe),inputBorder:$e(g5),inputValidationInfoBorder:$e(smt),inputValidationInfoBackground:$e(imt),inputValidationInfoForeground:$e(nmt),inputValidationWarningBorder:$e(amt),inputValidationWarningBackground:$e(rmt),inputValidationWarningForeground:$e(omt),inputValidationErrorBorder:$e(DQe),inputValidationErrorBackground:$e(EQe),inputValidationErrorForeground:$e(xQe)},jxt={listFilterWidgetBackground:$e(Fmt),listFilterWidgetOutline:$e(Omt),listFilterWidgetNoMatchesOutline:$e(Bmt),listFilterWidgetShadow:$e(Wmt),inputBoxStyles:LM,toggleStyles:dJ},lJe={badgeBackground:$e(DT),badgeForeground:$e(dae),badgeBorder:$e(yt)};$e($pt),$e(zpt),$e(_Be),$e(_Be),$e(Gpt);const zN={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:$e(Emt),listFocusForeground:$e(xmt),listFocusOutline:$e(dme),listActiveSelectionBackground:$e(Cy),listActiveSelectionForeground:$e(Z8),listActiveSelectionIconForeground:$e(IQe),listFocusAndSelectionOutline:$e(Dmt),listFocusAndSelectionBackground:$e(Cy),listFocusAndSelectionForeground:$e(Z8),listInactiveSelectionBackground:$e(hme),listInactiveSelectionIconForeground:$e(Imt),listInactiveSelectionForeground:$e(kmt),listInactiveFocusBackground:$e(Tmt),listInactiveFocusOutline:$e(Lmt),listHoverBackground:$e(TQe),listHoverForeground:$e(LQe),listDropOverBackground:$e(Rmt),listDropBetweenBackground:$e(Mmt),listSelectionOutline:$e(Xs),listHoverOutline:$e(Xs),treeIndentGuidesStroke:$e(bY),treeInactiveIndentGuidesStroke:$e(Umt),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:$e(_6),tableColumnsBorder:$e(Vmt),tableOddRowsBackgroundColor:$e(zmt)};function $N(s){return Qxt(s,zN)}const dJe={selectBackground:$e(fae),selectListBackground:$e(cmt),selectForeground:$e(aLe),decoratorRightForeground:$e(RQe),selectBorder:$e(cLe),focusBorder:$e(bp),listFocusBackground:$e(t3),listInactiveSelectionIconForeground:$e(lLe),listFocusForeground:$e(e3),listFocusOutline:ime(Xs,me.transparent.toString()),listHoverBackground:$e(TQe),listHoverForeground:$e(LQe),listHoverOutline:$e(Xs),selectListBorder:$e(v6),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},Yxt={shadowColor:$e(kI),borderColor:$e($mt),foregroundColor:$e(Gmt),backgroundColor:$e(Kmt),selectionForegroundColor:$e(qmt),selectionBackgroundColor:$e(Qmt),selectionBorderColor:$e(jmt),separatorColor:$e(Ymt),scrollbarShadow:$e(_6),scrollbarSliderBackground:$e(_Qe),scrollbarSliderHoverBackground:$e(vQe),scrollbarSliderActiveBackground:$e(bQe)};function hJe(s,e,t,i){let n,r,o;if(Array.isArray(s))o=s,n=e,r=t;else{const l=e;o=s.getActions(l),n=t,r=i}const a=bb.getInstance(),c=a.keyStatus.altKey||(jn||mo)&&a.keyStatus.shiftKey;uJe(o,n,c,r?l=>l===r:l=>l==="navigation")}function vC(s,e,t,i,n,r){let o,a,c,l,d;if(Array.isArray(s))d=s,o=e,a=t,c=i,l=n;else{const u=e;d=s.getActions(u),o=t,a=i,c=n,l=r}uJe(d,o,!1,typeof a=="string"?u=>u===a:a,c,l)}function uJe(s,e,t,i=o=>o==="navigation",n=()=>!1,r=!1){let o,a;Array.isArray(e)?(o=e,a=e):(o=e.primary,a=e.secondary);const c=new Set;for(const[l,d]of s){let h;i(l)?(h=o,h.length>0&&r&&h.push(new Eo)):(h=a,h.length>0&&h.push(new Eo));for(let u of d){t&&(u=u instanceof Ac&&u.alt?u.alt:u);const f=h.push(u);u instanceof Hk&&c.add({group:l,action:u,index:f-1})}}for(const{group:l,action:d,index:h}of c){const u=i(l)?o:a,f=d.actions;n(d,l,u.length)&&u.splice(h,1,...f)}}let Pb=class extends tC{constructor(e,t,i,n,r,o,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=r,this._themeService=o,this._contextMenuService=a,this._accessibilityService=c,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new yn),this._altKey=bb.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 r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,o=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),a=o&&o.getLabel(),c=a?g(4886,"{0} ({1})",r,a):r;n=g(4887,`{0} -[{1}] {2}`,n,D6.modifierLabels[pr].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&&Hxt(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(He.isThemeIcon(n)){const r=He.asClassNameArray(n);i.classList.add(...r),this._itemClassDispose.value=Ee(()=>{i.classList.remove(...r)})}else i.style.backgroundImage=_ae(this._themeService.getColorTheme().type)?ig(n.dark):ig(n.light),i.classList.add("icon"),this._itemClassDispose.value=Yo(Ee(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};Pb=D([_(2,Vt),_(3,wi),_(4,Le),_(5,mn),_(6,lo),_(7,_o)],Pb);class N6 extends Pb{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=N6._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 E3=class extends cA{constructor(e,t,i,n,r){const o={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(He.isThemeIcon(e.item.icon)?He.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},n,o),this._keybindingService=i,this._contextMenuService=n,this._themeService=r}render(e){super.render(e),Lt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!He.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=_ae(this._themeService.getColorTheme().type)?ig(i.dark):ig(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};E3=D([_(2,Vt),_(3,lo),_(4,mn)],E3);let T_e=class extends Kf{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,n,r,o,a,c){super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=r,this._menuService=o,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(Pb,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 q_};this._dropdown=new cA(e,e.actions,this._contextMenuService,h),this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof Ac&&this.update(u.action)}))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,Ie.WORKSPACE,cn.MACHINE),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Pb,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends q_{async runAction(t,i){await t.run(void 0)}},this._container&&this._defaultAction.render(nae(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(oe(this._container,t)),this._register(ue(t,ke.KEY_DOWN,n=>{const r=new xn(n);r.equals(S.RightArrow)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),r.stopPropagation())}));const i=fe(".dropdown-action-container");this._dropdown.render(oe(this._container,i)),this._register(ue(i,ke.KEY_DOWN,n=>{const r=new xn(n);r.equals(S.LeftArrow)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._defaultAction.element?.focus(),r.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()}};T_e=D([_(2,Vt),_(3,wi),_(4,lo),_(5,Ba),_(6,we),_(7,Gi)],T_e);let L_e=class extends oJe{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Eo.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,dJe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=$e(cLe)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};L_e=D([_(1,bf)],L_e);function GN(s,e,t){return e instanceof Ac?s.createInstance(Pb,e,t):e instanceof Ny?e.item.isSelection?s.createInstance(L_e,e):e.item.rememberDefaultAction?s.createInstance(T_e,e,{...t,persistLastActionId:!0}):s.createInstance(E3,e,t):void 0}var W_;(function(s){s[s.HORIZONTAL=0]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL"})(W_||(W_={}));class gd extends V{constructor(e,t={}){super(),this._actionRunnerDisposables=this._register(new Z),this.viewItemDisposables=this._register(new mr),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??W_.HORIZONTAL,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[S.Enter,S.Space]},this._hoverDelegate=t.hoverDelegate??this._register(Yk()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new q_,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(r=>this._onDidRun.fire(r))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(r=>this._onWillRun.fire(r))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,n;switch(this._orientation){case W_.HORIZONTAL:i=[S.LeftArrow],n=[S.RightArrow];break;case W_.VERTICAL:i=[S.UpArrow],n=[S.DownArrow],this.domNode.className+=" vertical";break}this._register(ue(this.domNode,ke.KEY_DOWN,r=>{const o=new xn(r);let a=!0;const c=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(o.equals(i[0])||o.equals(i[1]))?a=this.focusPrevious():n&&(o.equals(n[0])||o.equals(n[1]))?a=this.focusNext():o.equals(S.Escape)&&this.cancelHasListener?this._onDidCancel.fire():o.equals(S.Home)?a=this.focusFirst():o.equals(S.End)?a=this.focusLast():o.equals(S.Tab)&&c instanceof Kf&&c.trapsArrowNavigation?a=this.focusNext():this.isTriggerKeyEvent(o)?this._triggerKeys.keyDown?this.doTrigger(o):this.triggerKeyDown=!0:a=!1,a&&(o.preventDefault(),o.stopPropagation())})),this._register(ue(this.domNode,ke.KEY_UP,r=>{const o=new xn(r);this.isTriggerKeyEvent(o)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(o)),o.preventDefault(),o.stopPropagation()):(o.equals(S.Tab)||o.equals(U.Shift|S.Tab)||o.equals(S.UpArrow)||o.equals(S.DownArrow)||o.equals(S.LeftArrow)||o.equals(S.RightArrow))&&this.updateFocusedItem()})),this.focusTracker=this._register(Ec(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Wc()===this.domNode||!yc(Wc(),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 Kf&&i.isEnabled());t instanceof Kf&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Kf&&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(Jo(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t{const o=document.createElement("li");o.className="action-item",o.setAttribute("role","presentation");let a;const c={hoverDelegate:this._hoverDelegate,...t,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(r,c)),a||(a=new tC(this.context,r,c)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ue(o,ke.CONTEXT_MENU,l=>{tn.stop(l,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(o),this.focusable&&a instanceof Kf&&this.viewItems.length===0&&a.setFocusable(!0),n===null||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(o),this.viewItems.push(a)):(this.actionsList.insertBefore(o,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(r=>r.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===Eo.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===Eo.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 r=!0;I2(n.focus)||(r=!1),this.options.focusOnlyEnabledItems&&I2(n.isEnabled)&&!n.isEnabled()&&(r=!1),n.action.id===Eo.ID&&(r=!1),r?(i||this.previouslyFocusedItem!==this.focusedItem)&&(n.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),r&&n.showHover?.()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Kf){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=wt(this.viewItems),this.getContainer().remove(),super.dispose()}}function vWe(s){if(!s.length)return s;let e=-1;for(let i=0;i=0&&s[i].id===Eo.ID;i--)s.splice(i,1);let t=!1;for(let i=s.length-1;i>=0;i--){const n=s[i].id===Eo.ID;n&&!t?s.splice(i,1):n?n&&(t=!1):t=!0}return s}const R_e=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,$he=/(&)?(&)([^\s&])/g;var hJ;(function(s){s[s.Right=0]="Right",s[s.Left=1]="Left"})(hJ||(hJ={}));var M_e;(function(s){s[s.Above=0]="Above",s[s.Below=1]="Below"})(M_e||(M_e={}));let gJe=class eQ extends gd{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const r=document.createElement("div");r.classList.add("monaco-menu"),r.setAttribute("role","presentation"),super(r,{orientation:W_.VERTICAL,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[S.Enter,...jt||mo?[S.Space]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=r,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(md.addTarget(r)),this._register(ue(r,ke.KEY_DOWN,l=>{new xn(l).equals(S.Tab)&&l.preventDefault()})),i.enableMnemonics&&this._register(ue(r,ke.KEY_DOWN,l=>{const d=l.key.toLocaleLowerCase();if(this.mnemonics.has(d)){tn.stop(l,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof Ghe&&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)}}})),mo&&this._register(ue(r,ke.KEY_DOWN,l=>{const d=new xn(l);d.equals(S.Home)||d.equals(S.PageUp)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),tn.stop(l,!0)):(d.equals(S.End)||d.equals(S.PageDown))&&(this.focusedItem=0,this.focusPrevious(),tn.stop(l,!0))})),this._register(ue(this.domNode,ke.MOUSE_OUT,l=>{const d=l.relatedTarget;yc(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||!yc(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(md.addTarget(this.actionsList)),this._register(ue(this.actionsList,ur.Tap,l=>{let d=l.initialTarget;if(!(!d||!yc(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 o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new MU(r,{alwaysConsumeMouseWheel:!0,horizontal:Cr.Hidden,vertical:Cr.Visible,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,n),this._register(ue(r,ur.Change,l=>{tn.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=lt(e);r.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 Eo&&(d===t.length-1||d===0||t[d-1]instanceof Eo))),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof bWe)).forEach((l,d,h)=>{l.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(F8(e)?this.styleSheet=fl(e):(eQ.globalStyleSheet||(eQ.globalStyleSheet=fl()),this.styleSheet=eQ.globalStyleSheet)),this.styleSheet.textContent=Xxt(t,F8(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",n=t.backgroundColor??"",r=t.borderColor?`1px solid ${t.borderColor}`:"",o="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=r,e.style.borderRadius=o,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 Ghe)super.focus(e),t.open(!0);else if(t instanceof N_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,r=>{if(tn.stop(r,!0),lf){if(new Dh(lt(this.element),r).rightButton)return;this.onClick(r)}else setTimeout(()=>{this.onClick(r)},0)})),this._register(ue(this.element,ke.CONTEXT_MENU,r=>{tn.stop(r,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=oe(this.element,fe("a.action-menu-item")),this._action.id===Eo.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=oe(this.item,fe("span.menu-item-check"+He.asCSSSelector(ve.menuSelection))),this.check.setAttribute("role","none"),this.label=oe(this.item,fe("span.action-label")),this.options.label&&this.options.keybinding&&(oe(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){Ns(this.label);let e=Tae(this.action.label);if(e){const t=Jxt(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=R_e.exec(e);if(i){e=wT(e),$he.lastIndex=0;let n=$he.exec(e);for(;n&&n[1];)n=$he.exec(e);const r=o=>o.replace(/&&/g,"&");n?this.label.append(SU(r(e.substr(0,n.index))," "),fe("u",{"aria-hidden":"true"},n[3]),qy(r(e.substr(n.index+n[0].length))," ")):this.label.innerText=r(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}`:"",r=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=r),this.check&&(this.check.style.color=t??"")}}class Ghe extends N_e{constructor(e,t,i,n,r){super(e,e,n,r),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:hJ.Right,vertical:M_e.Below},this.showScheduler=new ln(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new ln(()=>{this.element&&!yc(Wc(),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=oe(this.item,fe("span.submenu-indicator"+He.asCSSSelector(ve.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ue(this.element,ke.KEY_UP,t=>{const i=new xn(t);(i.equals(S.RightArrow)||i.equals(S.Enter))&&(tn.stop(t,!0),this.createSubmenu(!0))})),this._register(ue(this.element,ke.KEY_DOWN,t=>{const i=new xn(t);Wc()===this.item&&(i.equals(S.RightArrow)||i.equals(S.Enter))&&tn.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&&!yc(Wc(),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){tn.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 r={top:0,left:0};return r.left=fF(e.width,t.width,{position:n.horizontal===hJ.Right?Ff.Before:Ff.After,offset:i.left,size:i.width}),r.left>=i.left&&r.left{new xn(d).equals(S.LeftArrow)&&(tn.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ue(this.submenuContainer,ke.KEY_DOWN,d=>{new xn(d).equals(S.LeftArrow)&&tn.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 bWe extends tC{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 Jxt(s){const e=R_e,t=e.exec(s);if(!t)return s;const i=!t[1];return s.replace(e,i?"$2$3":"").trim()}function wWe(s){const e=FKe()[s.id];return`.codicon-${s.id}:before { content: '\\${e.toString(16)}'; }`}function Xxt(s,e){let t=` +`)}}const Sxt={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},Axt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Ext(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 Dxt{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 r=0;for(const o of this.renderers)o.renderElement(e,t,i[r++],n)}disposeElement(e,t,i,n){let r=0;for(const o of this.renderers)o.disposeElement?.(e,t,i[r],n),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class kxt{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),r=n&&typeof n!="string"?n:rd(n);i.disposables.add(ci(a=>{this.setAriaLabel(a.readObservable(r),i.container)}));const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.container.setAttribute("aria-level",`${o}`):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 Ixt{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,r){return this.dnd.onDragOver(e,t,i,n,r)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,r){this.dnd.drop(e,t,i,n,r)}dispose(){this.dnd.dispose()}}class Za{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 ni(this.view.domNode,"keydown")).event,r=>r.map(o=>new xn(o)).filter(o=>e=o.keyCode===S.ContextMenu||o.shiftKey&&o.keyCode===S.F10).map(o=>tn.stop(o,!0)).filter(()=>!1)),i=M.chain(this.disposables.add(new ni(this.view.domNode,"keyup")).event,r=>r.forEach(()=>e=!1).map(o=>new xn(o)).filter(o=>o.keyCode===S.ContextMenu||o.shiftKey&&o.keyCode===S.F10).map(o=>tn.stop(o,!0)).map(({browserEvent:o})=>{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:o}})),n=M.chain(this.view.onContextMenu,r=>r.filter(o=>!e).map(({element:o,index:a,browserEvent:c})=>({element:o,index:a,anchor:new Dh(lt(this.view.domNode),c),browserEvent:c})));return M.any(t,i,n)}get onKeyDown(){return this.disposables.add(new ni(this.view.domNode,"keydown")).event}get onKeyUp(){return this.disposables.add(new ni(this.view.domNode,"keyup")).event}get onKeyPress(){return this.disposables.add(new ni(this.view.domNode,"keypress")).event}get onDidFocus(){return M.signal(this.disposables.add(new ni(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return M.signal(this.disposables.add(new ni(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,r=Axt){this.user=e,this._options=r,this.focus=new S3("focused"),this.anchor=new S3("anchor"),this.eventBufferer=new Q7,this._ariaLabel="",this.disposables=new Z,this._onDidDispose=new I,this.onDidDispose=this._onDidDispose.event;const o=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():"list";this.selection=new mxt(o!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=r.accessibilityProvider,this.accessibilityProvider&&(a.push(new kxt(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(l=>new Dxt(l.templateId,[...a,l]));const c={...r,dnd:r.dnd&&new Ixt(this,r.dnd)};if(this.view=this.createListView(t,i,n,c),this.view.domNode.setAttribute("role",o),r.styleController)this.styleController=r.styleController(this.view.domId);else{const l=fl(this.view.domNode);this.styleController=new iJe(l,this.view.domId)}if(this.spliceable=new HEt([new zhe(this.focus,this.view,r.identityProvider),new zhe(this.selection,this.view,r.identityProvider),new zhe(this.anchor,this.view,r.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 yxt(this,this.view)),(typeof r.keyboardSupport!="boolean"||r.keyboardSupport)&&(this.keyboardController=new E_e(this,this.view,r),this.disposables.add(this.keyboardController)),r.keyboardNavigationLabelProvider){const l=r.keyboardNavigationDelegate||bxt;this.typeNavigationController=new wxt(this,this.view,r.keyboardNavigationLabelProvider,r.keyboardNavigationEventFilter??(()=>!0),l),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(r),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 fc(e,t,i,n)}createMouseController(e){return new tJe(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 GI(this.user,`Invalid start index: ${e}`);if(t<0)throw new GI(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 GI(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 GI(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return um(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 GI(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(this.length===0)return;const r=this.focus.get(),o=this.findNextIndex(r.length>0?r[0]+e:0,t,n);o>-1&&this.setFocus([o],i)}focusPrevious(e=1,t=!1,i,n){if(this.length===0)return;const r=this.focus.get(),o=this.findPreviousIndex(r.length>0?r[0]-e:0,t,n);o>-1&&this.setFocus([o],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 r=this.findPreviousIndex(i,!1,t);r>-1&&n!==r?this.setFocus([r],e):this.setFocus([i],e)}else{const r=this.view.getScrollTop();let o=r+this.view.renderHeight;i>n&&(o-=this.view.elementHeight(i)),this.view.setScrollTop(o),this.view.getScrollTop()!==r&&(this.setFocus([]),await Ao(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;const r=i(),o=this.view.getScrollTop()+r;o===0?n=this.view.indexAt(o):n=this.view.indexAfter(o-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=o;this.view.setScrollTop(o-this.view.renderHeight-r),this.view.getScrollTop()+i()!==c&&(this.setFocus([]),await Ao(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 GI(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),r=this.view.elementTop(e),o=this.view.elementHeight(e);if(dc(t)){const a=o-this.view.renderHeight+i;this.view.setScrollTop(a*Qa(t,0,1)+r-i)}else{const a=r+o,c=n+this.view.renderHeight;r=c||(r=c&&o>=this.view.renderHeight?this.view.setScrollTop(r-i):a>=c&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new GI(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),r=this.view.elementHeight(e);if(ni+this.view.renderHeight)return null;const o=r-this.view.renderHeight+t;return Math.abs((i+t-n)/o)}isDOMFocused(){return dv(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()}}Za.__decorator=D([ei],Za.prototype,"onDidChangeFocus",null);Za.__decorator=D([ei],Za.prototype,"onDidChangeSelection",null);Za.__decorator=D([ei],Za.prototype,"onContextMenu",null);Za.__decorator=D([ei],Za.prototype,"onKeyDown",null);Za.__decorator=D([ei],Za.prototype,"onKeyUp",null);Za.__decorator=D([ei],Za.prototype,"onKeyPress",null);Za.__decorator=D([ei],Za.prototype,"onDidFocus",null);Za.__decorator=D([ei],Za.prototype,"onDidBlur",null);let nJe={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>null,showManagedHover:()=>{}};function sJe(s){nJe=s}function xm(){return nJe}var Txt=".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}";gt(Txt,{});const O1=fe,rJe="selectOption.entry.template";class Lxt{get templateId(){return rJe}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=oe(e,O1(".option-text")),t.detail=oe(e,O1(".option-detail")),t.decoratorRight=oe(e,O1(".option-decorator-right")),t}renderElement(e,t,i){const n=i,r=e.text,o=e.detail,a=e.decoratorRight,c=e.isDisabled;n.text.textContent=r,n.detail.textContent=o||"",n.decoratorRight.innerText=a||"",c?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}const Ew=class Ew extends V{constructor(e,t,i,n,r){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=r||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Ew.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(xm().setupManagedHover(Fo("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return rJe}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=fe(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=oe(this.selectDropDownContainer,O1(".select-box-details-pane"));const t=oe(this.selectDropDownContainer,O1(".select-box-dropdown-container-width-control")),i=oe(t,O1(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",oe(i,this.widthControlElement),this._dropDownPosition=Gf.BELOW,this.styleElement=fl(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ue(this.selectDropDownContainer,ke.DRAG_START,n=>{tn.stop(n,!0)}))}registerListeners(){this._register(Rr(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=>{tn.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ue(this.selectElement,ke.MOUSE_DOWN,t=>{tn.stop(t)}));let e;this._register(ue(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ue(this.selectElement,"touchend",t=>{tn.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ue(this.selectElement,ke.KEY_DOWN,t=>{const i=new xn(t);let n=!1;jt?(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(),tn.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){ns(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=My(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=lt(this.selectElement),i=So(this.selectElement),n=lt(this.selectElement).getComputedStyle(this.selectElement),r=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),o=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-Ew.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+r+u,p=Math.floor((o-r-u)/this.getHeight()),m=Math.floor((a-r-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topp&&this.options.length>p?(this._dropDownPosition=Gf.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=Gf.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.topo&&(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+r+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+r+"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((r,o)=>{const a=r.detail?r.detail.length:0,c=r.decoratorRight?r.decoratorRight.length:0,l=r.text.length+a+c;l>n&&(i=o,n=l)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=Od(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=oe(e,O1(".select-box-dropdown-list-container")),this.listRenderer=new Lxt,this.selectList=this._register(new Za("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:Cr.Visible,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:n=>{let r=n.text;return n.detail&&(r+=`. ${n.detail}`),n.decoratorRight&&(r+=`. ${n.decoratorRight}`),n.description&&(r+=`. ${n.description}`),r},getWidgetAriaLabel:()=>g(10917,"Select Box"),getRole:()=>jt?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new ni(this.selectDropDownListContainer,"keydown")),i=M.chain(t.event,n=>n.filter(()=>this.selectList.length>0).map(r=>new xn(r)));this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.Enter))(this.onEnter,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.Tab))(this.onEnter,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.Escape))(this.onEscape,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.UpArrow))(this.onUpArrow,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.DownArrow))(this.onDownArrow,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.PageDown))(this.onPageDown,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.PageUp))(this.onPageUp,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.Home))(this.onHome,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode===S.End))(this.onEnd,this)),this._register(M.chain(i,n=>n.filter(r=>r.keyCode>=S.Digit0&&r.keyCode<=S.KeyZ||r.keyCode>=S.Semicolon&&r.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||yc(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;tn.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")),r=i.classList.contains("option-disabled");n>=0&&n{for(let o=0;othis.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&&(tn.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){tn.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){tn.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){tn.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=Ta.toString(e.keyCode);let i=-1;for(let n=0;n{this._register(ue(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Rr(this.selectElement,"click",e=>{tn.stop(e,!0)})),this._register(Rr(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Rr(this.selectElement,"keydown",e=>{let t=!1;jt?(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||!ns(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 q_)),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(md.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,lf&&this._register(ue(e,ke.DRAG_START,n=>n.dataTransfer?.setData(ap.TEXT,this._action.label)))),this._register(ue(t,ur.Tap,n=>this.onClick(n,!0))),this._register(ue(t,ke.MOUSE_DOWN,n=>{i||tn.stop(n,!0),this._action.enabled&&n.button===0&&t.classList.add("active")})),jt&&this._register(ue(t,ke.CONTEXT_MENU,n=>{n.button===0&&n.ctrlKey===!0&&this.onClick(n)})),this._register(ue(t,ke.CLICK,n=>{tn.stop(n,!0),this.options&&this.options.isMenu||this.onClick(n)})),this._register(ue(t,ke.DBLCLICK,n=>{tn.stop(n,!0)})),[ke.MOUSE_UP,ke.MOUSE_OUT].forEach(n=>{this._register(ue(t,n,r=>{tn.stop(r),t.classList.remove("active")}))})}onClick(e,t=!1){tn.stop(e,!0);const i=aa(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??Fo("element");this.customHover=this._store.add(xm().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 tC extends Kf{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),Lt(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===Eo.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 oJe extends Kf{constructor(e,t,i,n,r,o,a){super(e,t),this.selectBox=new Nxt(i,n,r,o,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 Fxt=".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}";gt(Fxt,{});class Oxt extends q_{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=oe(e,fe(".monaco-dropdown")),this._label=oe(this._element,fe(".dropdown-label"));let i=t.labelRenderer;i||(i=r=>(r.textContent=t.label||"",null));for(const r of[ke.CLICK,ke.MOUSE_DOWN,ur.Tap])this._register(ue(this.element,r,o=>tn.stop(o,!0)));for(const r of[ke.MOUSE_DOWN,ur.Tap])this._register(ue(this._label,r,o=>{BTe(o)&&(o.detail>1||o.button!==0)||(this.visible?this.hide():this.show())}));this._register(ue(this._label,ke.KEY_UP,r=>{const o=new xn(r);(o.equals(S.Enter)||o.equals(S.Space))&&(tn.stop(r,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(md.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(xm().setupManagedHover(Fo("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 Bxt extends Oxt{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:Cb.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 cA extends Kf{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=r=>{this.element=oe(r,fe("a.action-label"));let o=[];return typeof this.options.classNames=="string"?o=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(o=this.options.classNames),o.find(a=>a==="icon")||o.push("codicon"),this.element.classList.add(...o),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(xm().setupManagedHover(this.options.hoverDelegate??Fo("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 Bxt(e,n)),this._register(this.dropdownMenu.onDidChangeVisibility(r=>{this.element?.setAttribute("aria-expanded",`${r}`),this._onDidChangeVisibility.fire(r)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const r=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return r.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 Wxt='.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}';gt(Wxt,{});const Wa=ae("menuService");function vRe(s){return s&&typeof s=="object"&&typeof s.original=="string"&&typeof s.value=="string"}function Hxt(s){return s?s.condition!==void 0:!1}const R5={exports:{}};(function(){function s(n){const r=[];typeof n=="number"&&r.push("code/timeOrigin",n);function o(c){r.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===Lv.Closed)return;let i=!1;aa(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===Lv.None&&(this.state=Lv.Initialized,this.options.hint!==hD.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){const i=this.cache.get(e);return aa(i)?t:i}getBoolean(e,t){const i=this.get(e);return aa(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return aa(i)?t:parseInt(i,10)}getObject(e,t){const i=this.get(e);return aa(i)?t:iW(i)}async set(e,t,i=!1){if(this.state===Lv.Closed)return;if(aa(t))return this.delete(e,i);const n=In(t)||Array.isArray(t)?CYe(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===Lv.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!==Lv.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=Lv.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===Lv.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===hD.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===hD.STORAGE_IN_MEMORY}};xse.DEFAULT_FLUSH_DELAY=100;let lA=xse;class Jq{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 Xt=ae("fileService"),Is=ae("IUriIdentityService"),zxt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function $xt(s){return zxt.test(s)}const ao=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(r.emptyWindows)for(const[o,a]of Object.entries(r.emptyWindows)){const c=t.find(l=>l.id===a);c&&n.set(o,c)}}catch(r){this.logService.error(r)}this._profilesObject={profiles:t,workspaces:i,emptyWindows:n}}return this._profilesObject}createDefaultProfile(){const e=mV("__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(`${Nh(t)}\\s(\\d+)`);let n=0;for(const o of this.profiles){const a=i.exec(o.name),c=a?parseInt(a[1]):0;n=c>n?c:n}const r=`${t} ${n+1}`;return this.createProfile(Hc(ao()).toString(16),r,{transient:!0},e)}async createNamedProfile(e,t,i){return this.createProfile(Hc(ao()).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 r=await this.doCreateProfile(e,t,i);return n&&await this.setProfileForWorkspace(n,r),r}async doCreateProfile(e,t,i){if(!Rt(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 o=mV(e,t,Ft(this.profilesHome,e),this.profilesCacheHome,i,this.defaultProfile);await this.fileService.createFolder(o.location);const a=[];return this._onWillCreateProfile.fire({profile:o,join(c){a.push(c)}}),await er.settled(a),this.updateProfiles([o],[],[]),o}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=mV(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){Qw(n)!==ji.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||(B_(e)?this.transientProfilesObject.folders.get(e.uri):oA(e)?this.transientProfilesObject.workspaces.get(e.configPath):this.transientProfilesObject.emptyWindows.get(e.id))}getWorkspace(e){return B_(e)?e.uri:oA(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],r=[],o=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=o.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}}r.push({location:a.location,name:a.name,shortName:a.shortName,icon:a.icon,useDefaultFlags:a.useDefaultFlags})}}this.saveStoredProfiles(r),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)B_(e)?(this.transientProfilesObject.folders.delete(e.uri),t&&this.transientProfilesObject.folders.set(e.uri,t)):oA(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[r,o]of Object.entries(e.workspaces)){const a=N.parse(o);t[r]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}const n={};if(e.emptyWindows)for(const[r,o]of Object.entries(e.emptyWindows)){const a=N.parse(o);n[r]=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(){}},mL.PROFILES_KEY="userDataProfiles",mL.PROFILE_ASSOCIATIONS_KEY="profileAssociations",mL);_We=D([_(0,ec),_(1,Xt),_(2,Is),_(3,Ke)],_We);const Xq="__$__isNewStorageMarker",Zq="__$__targetStorageMarker";var Ay;(function(s){s[s.NONE=0]="NONE",s[s.SHUTDOWN=1]="SHUTDOWN"})(Ay||(Ay={}));var Ie;(function(s){s[s.APPLICATION=-1]="APPLICATION",s[s.PROFILE=0]="PROFILE",s[s.WORKSPACE=1]="WORKSPACE"})(Ie||(Ie={}));var cn;(function(s){s[s.USER=0]="USER",s[s.MACHINE=1]="MACHINE"})(cn||(cn={}));function Gxt(s){const e=s.get(Zq);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const Dse=class Dse extends V{constructor(e={flushInterval:Dse.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Nk),this._onDidChangeTarget=this._register(new Nk),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new I),this.onWillSaveState=this._onWillSaveState.event,this.flushWhenIdleScheduler=this._register(new ln(()=>this.doFlushWhenIdle(),this.options.flushInterval)),this.runFlushWhenIdle=this._register(new yn),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=U2(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){wt([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{ls("code/willInitStorage");try{await this.doInitialize()}finally{ls("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===Zq){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,r=!1){if(aa(t)){this.remove(e,i,r);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,n),this.getStorage(i)?.set(e,t,r)})}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 r of Object.keys(n))n[r]===t&&i.push(r);return i}updateKeyTarget(e,t,i,n=!1){const r=this.getKeyTargets(t);typeof i=="number"?r[e]!==i&&(r[e]=i,this.getStorage(t)?.set(Zq,JSON.stringify(r),n)):typeof r[e]=="number"&&(delete r[e],this.getStorage(t)?.set(Zq,JSON.stringify(r),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?Gxt(t):Object.create(null)}isNew(e){return this.getBoolean(Xq,e)===!0}async flush(e=Ay.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 Ay.NONE:await er.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve()]);break;case Ay.SHUTDOWN:await er.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 qxt(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(Ay.NONE),aJe(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||k_e(t)&&k_e(e))}switchData(e,t,i){this.withPausedEmitters(()=>{const n=new Set;for(const[r,o]of e)n.add(r),t.get(r)!==o&&this.emitDidChangeValue(i,{key:r,external:!0});for(const[r]of t.items)n.has(r)||this.emitDidChangeValue(i,{key:r,external:!0})})}};Dse.DEFAULT_FLUSH_INTERVAL=60*1e3;let rW=Dse;function k_e(s){return s.isDefault||!!s.useDefaultFlags?.globalState}class Kxt extends rW{constructor(){super(),this.applicationStorage=this._register(new lA(new Jq,{hint:hD.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new lA(new Jq,{hint:hD.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new lA(new Jq,{hint:hD.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 qxt(s,e,t,i,n,r){const o=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,o(m))});const l=new Map,d=new Map;e.forEach((m,v)=>{l.set(v,m),d.set(v,o(m))});const h=new Map,u=new Map;t.forEach((m,v)=>{h.set(v,m),u.set(v,o(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: ${r})`);const p=[];h.forEach((m,v)=>{p.push({key:v,value:m})}),console.table(p),console.groupEnd(),console.log(u)}const Gi=ae("storageService");function Qxt(s,e){const t={...e};for(const i in s){const n=s[i];t[i]=n!==void 0?$e(n):void 0}return t}const I_e={keybindingLabelBackground:$e(ymt),keybindingLabelForeground:$e(Cmt),keybindingLabelBorder:$e(Smt),keybindingLabelBottomBorder:$e(Amt),keybindingLabelShadow:$e(kI)},M6={buttonForeground:$e(EM),buttonSeparator:$e(kQe),buttonBackground:$e(yy),buttonHoverBackground:$e(X8),buttonSecondaryForeground:$e(dmt),buttonSecondaryBackground:$e(lme),buttonSecondaryHoverBackground:$e(hmt),buttonBorder:$e(lmt)},cJe={progressBarBackground:$e(xpt)},dJ={inputActiveOptionBorder:$e(uae),inputActiveOptionForeground:$e(gae),inputActiveOptionBackground:$e(b6)};$e(aV),$e(umt),$e(gmt),$e(fmt),$e(pmt),$e(mmt),$e(_mt);$e(vmt),$e(wmt),$e(bmt);$e(kh),$e(PN),$e(kI),$e(yt),$e(Kpt),$e(qpt),$e(Qpt),$e(iLe);const LM={inputBackground:$e(Y2),inputForeground:$e(AQe),inputBorder:$e(g5),inputValidationInfoBorder:$e(smt),inputValidationInfoBackground:$e(imt),inputValidationInfoForeground:$e(nmt),inputValidationWarningBorder:$e(amt),inputValidationWarningBackground:$e(rmt),inputValidationWarningForeground:$e(omt),inputValidationErrorBorder:$e(DQe),inputValidationErrorBackground:$e(EQe),inputValidationErrorForeground:$e(xQe)},jxt={listFilterWidgetBackground:$e(Fmt),listFilterWidgetOutline:$e(Omt),listFilterWidgetNoMatchesOutline:$e(Bmt),listFilterWidgetShadow:$e(Wmt),inputBoxStyles:LM,toggleStyles:dJ},lJe={badgeBackground:$e(DT),badgeForeground:$e(dae),badgeBorder:$e(yt)};$e($pt),$e(zpt),$e(_Be),$e(_Be),$e(Gpt);const zN={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:$e(Emt),listFocusForeground:$e(xmt),listFocusOutline:$e(dme),listActiveSelectionBackground:$e(Cy),listActiveSelectionForeground:$e(Z8),listActiveSelectionIconForeground:$e(IQe),listFocusAndSelectionOutline:$e(Dmt),listFocusAndSelectionBackground:$e(Cy),listFocusAndSelectionForeground:$e(Z8),listInactiveSelectionBackground:$e(hme),listInactiveSelectionIconForeground:$e(Imt),listInactiveSelectionForeground:$e(kmt),listInactiveFocusBackground:$e(Tmt),listInactiveFocusOutline:$e(Lmt),listHoverBackground:$e(TQe),listHoverForeground:$e(LQe),listDropOverBackground:$e(Rmt),listDropBetweenBackground:$e(Mmt),listSelectionOutline:$e(Xs),listHoverOutline:$e(Xs),treeIndentGuidesStroke:$e(bY),treeInactiveIndentGuidesStroke:$e(Umt),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:$e(_6),tableColumnsBorder:$e(Vmt),tableOddRowsBackgroundColor:$e(zmt)};function $N(s){return Qxt(s,zN)}const dJe={selectBackground:$e(fae),selectListBackground:$e(cmt),selectForeground:$e(aLe),decoratorRightForeground:$e(RQe),selectBorder:$e(cLe),focusBorder:$e(bp),listFocusBackground:$e(t3),listInactiveSelectionIconForeground:$e(lLe),listFocusForeground:$e(e3),listFocusOutline:ime(Xs,me.transparent.toString()),listHoverBackground:$e(TQe),listHoverForeground:$e(LQe),listHoverOutline:$e(Xs),selectListBorder:$e(v6),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},Yxt={shadowColor:$e(kI),borderColor:$e($mt),foregroundColor:$e(Gmt),backgroundColor:$e(Kmt),selectionForegroundColor:$e(qmt),selectionBackgroundColor:$e(Qmt),selectionBorderColor:$e(jmt),separatorColor:$e(Ymt),scrollbarShadow:$e(_6),scrollbarSliderBackground:$e(_Qe),scrollbarSliderHoverBackground:$e(vQe),scrollbarSliderActiveBackground:$e(bQe)};function hJe(s,e,t,i){let n,r,o;if(Array.isArray(s))o=s,n=e,r=t;else{const l=e;o=s.getActions(l),n=t,r=i}const a=bb.getInstance(),c=a.keyStatus.altKey||(jn||mo)&&a.keyStatus.shiftKey;uJe(o,n,c,r?l=>l===r:l=>l==="navigation")}function vC(s,e,t,i,n,r){let o,a,c,l,d;if(Array.isArray(s))d=s,o=e,a=t,c=i,l=n;else{const u=e;d=s.getActions(u),o=t,a=i,c=n,l=r}uJe(d,o,!1,typeof a=="string"?u=>u===a:a,c,l)}function uJe(s,e,t,i=o=>o==="navigation",n=()=>!1,r=!1){let o,a;Array.isArray(e)?(o=e,a=e):(o=e.primary,a=e.secondary);const c=new Set;for(const[l,d]of s){let h;i(l)?(h=o,h.length>0&&r&&h.push(new Eo)):(h=a,h.length>0&&h.push(new Eo));for(let u of d){t&&(u=u instanceof Ac&&u.alt?u.alt:u);const f=h.push(u);u instanceof Hk&&c.add({group:l,action:u,index:f-1})}}for(const{group:l,action:d,index:h}of c){const u=i(l)?o:a,f=d.actions;n(d,l,u.length)&&u.splice(h,1,...f)}}let Pb=class extends tC{constructor(e,t,i,n,r,o,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=r,this._themeService=o,this._contextMenuService=a,this._accessibilityService=c,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new yn),this._altKey=bb.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 r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,o=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),a=o&&o.getLabel(),c=a?g(4886,"{0} ({1})",r,a):r;n=g(4887,`{0} +[{1}] {2}`,n,D6.modifierLabels[pr].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&&Hxt(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(He.isThemeIcon(n)){const r=He.asClassNameArray(n);i.classList.add(...r),this._itemClassDispose.value=Ee(()=>{i.classList.remove(...r)})}else i.style.backgroundImage=_ae(this._themeService.getColorTheme().type)?ig(n.dark):ig(n.light),i.classList.add("icon"),this._itemClassDispose.value=Yo(Ee(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};Pb=D([_(2,Vt),_(3,wi),_(4,Le),_(5,mn),_(6,lo),_(7,_o)],Pb);class N6 extends Pb{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=N6._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 E3=class extends cA{constructor(e,t,i,n,r){const o={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(He.isThemeIcon(e.item.icon)?He.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},n,o),this._keybindingService=i,this._contextMenuService=n,this._themeService=r}render(e){super.render(e),Lt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!He.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=_ae(this._themeService.getColorTheme().type)?ig(i.dark):ig(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};E3=D([_(2,Vt),_(3,lo),_(4,mn)],E3);let T_e=class extends Kf{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,n,r,o,a,c){super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=r,this._menuService=o,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(Pb,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 q_};this._dropdown=new cA(e,e.actions,this._contextMenuService,h),this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof Ac&&this.update(u.action)}))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,Ie.WORKSPACE,cn.MACHINE),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Pb,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends q_{async runAction(t,i){await t.run(void 0)}},this._container&&this._defaultAction.render(nae(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(oe(this._container,t)),this._register(ue(t,ke.KEY_DOWN,n=>{const r=new xn(n);r.equals(S.RightArrow)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),r.stopPropagation())}));const i=fe(".dropdown-action-container");this._dropdown.render(oe(this._container,i)),this._register(ue(i,ke.KEY_DOWN,n=>{const r=new xn(n);r.equals(S.LeftArrow)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._defaultAction.element?.focus(),r.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()}};T_e=D([_(2,Vt),_(3,wi),_(4,lo),_(5,Wa),_(6,we),_(7,Gi)],T_e);let L_e=class extends oJe{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Eo.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,dJe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=$e(cLe)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};L_e=D([_(1,bf)],L_e);function GN(s,e,t){return e instanceof Ac?s.createInstance(Pb,e,t):e instanceof Ny?e.item.isSelection?s.createInstance(L_e,e):e.item.rememberDefaultAction?s.createInstance(T_e,e,{...t,persistLastActionId:!0}):s.createInstance(E3,e,t):void 0}var W_;(function(s){s[s.HORIZONTAL=0]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL"})(W_||(W_={}));class gd extends V{constructor(e,t={}){super(),this._actionRunnerDisposables=this._register(new Z),this.viewItemDisposables=this._register(new mr),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??W_.HORIZONTAL,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[S.Enter,S.Space]},this._hoverDelegate=t.hoverDelegate??this._register(Yk()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new q_,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(r=>this._onDidRun.fire(r))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(r=>this._onWillRun.fire(r))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,n;switch(this._orientation){case W_.HORIZONTAL:i=[S.LeftArrow],n=[S.RightArrow];break;case W_.VERTICAL:i=[S.UpArrow],n=[S.DownArrow],this.domNode.className+=" vertical";break}this._register(ue(this.domNode,ke.KEY_DOWN,r=>{const o=new xn(r);let a=!0;const c=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(o.equals(i[0])||o.equals(i[1]))?a=this.focusPrevious():n&&(o.equals(n[0])||o.equals(n[1]))?a=this.focusNext():o.equals(S.Escape)&&this.cancelHasListener?this._onDidCancel.fire():o.equals(S.Home)?a=this.focusFirst():o.equals(S.End)?a=this.focusLast():o.equals(S.Tab)&&c instanceof Kf&&c.trapsArrowNavigation?a=this.focusNext():this.isTriggerKeyEvent(o)?this._triggerKeys.keyDown?this.doTrigger(o):this.triggerKeyDown=!0:a=!1,a&&(o.preventDefault(),o.stopPropagation())})),this._register(ue(this.domNode,ke.KEY_UP,r=>{const o=new xn(r);this.isTriggerKeyEvent(o)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(o)),o.preventDefault(),o.stopPropagation()):(o.equals(S.Tab)||o.equals(U.Shift|S.Tab)||o.equals(S.UpArrow)||o.equals(S.DownArrow)||o.equals(S.LeftArrow)||o.equals(S.RightArrow))&&this.updateFocusedItem()})),this.focusTracker=this._register(Ec(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Wc()===this.domNode||!yc(Wc(),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 Kf&&i.isEnabled());t instanceof Kf&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Kf&&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(Jo(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t{const o=document.createElement("li");o.className="action-item",o.setAttribute("role","presentation");let a;const c={hoverDelegate:this._hoverDelegate,...t,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(r,c)),a||(a=new tC(this.context,r,c)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ue(o,ke.CONTEXT_MENU,l=>{tn.stop(l,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(o),this.focusable&&a instanceof Kf&&this.viewItems.length===0&&a.setFocusable(!0),n===null||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(o),this.viewItems.push(a)):(this.actionsList.insertBefore(o,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(r=>r.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===Eo.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===Eo.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 r=!0;I2(n.focus)||(r=!1),this.options.focusOnlyEnabledItems&&I2(n.isEnabled)&&!n.isEnabled()&&(r=!1),n.action.id===Eo.ID&&(r=!1),r?(i||this.previouslyFocusedItem!==this.focusedItem)&&(n.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),r&&n.showHover?.()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Kf){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=wt(this.viewItems),this.getContainer().remove(),super.dispose()}}function vWe(s){if(!s.length)return s;let e=-1;for(let i=0;i=0&&s[i].id===Eo.ID;i--)s.splice(i,1);let t=!1;for(let i=s.length-1;i>=0;i--){const n=s[i].id===Eo.ID;n&&!t?s.splice(i,1):n?n&&(t=!1):t=!0}return s}const R_e=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,$he=/(&)?(&)([^\s&])/g;var hJ;(function(s){s[s.Right=0]="Right",s[s.Left=1]="Left"})(hJ||(hJ={}));var M_e;(function(s){s[s.Above=0]="Above",s[s.Below=1]="Below"})(M_e||(M_e={}));let gJe=class eQ extends gd{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const r=document.createElement("div");r.classList.add("monaco-menu"),r.setAttribute("role","presentation"),super(r,{orientation:W_.VERTICAL,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[S.Enter,...jt||mo?[S.Space]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=r,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(md.addTarget(r)),this._register(ue(r,ke.KEY_DOWN,l=>{new xn(l).equals(S.Tab)&&l.preventDefault()})),i.enableMnemonics&&this._register(ue(r,ke.KEY_DOWN,l=>{const d=l.key.toLocaleLowerCase();if(this.mnemonics.has(d)){tn.stop(l,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof Ghe&&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)}}})),mo&&this._register(ue(r,ke.KEY_DOWN,l=>{const d=new xn(l);d.equals(S.Home)||d.equals(S.PageUp)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),tn.stop(l,!0)):(d.equals(S.End)||d.equals(S.PageDown))&&(this.focusedItem=0,this.focusPrevious(),tn.stop(l,!0))})),this._register(ue(this.domNode,ke.MOUSE_OUT,l=>{const d=l.relatedTarget;yc(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||!yc(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(md.addTarget(this.actionsList)),this._register(ue(this.actionsList,ur.Tap,l=>{let d=l.initialTarget;if(!(!d||!yc(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 o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new MU(r,{alwaysConsumeMouseWheel:!0,horizontal:Cr.Hidden,vertical:Cr.Visible,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,n),this._register(ue(r,ur.Change,l=>{tn.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=lt(e);r.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 Eo&&(d===t.length-1||d===0||t[d-1]instanceof Eo))),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof bWe)).forEach((l,d,h)=>{l.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(F8(e)?this.styleSheet=fl(e):(eQ.globalStyleSheet||(eQ.globalStyleSheet=fl()),this.styleSheet=eQ.globalStyleSheet)),this.styleSheet.textContent=Xxt(t,F8(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",n=t.backgroundColor??"",r=t.borderColor?`1px solid ${t.borderColor}`:"",o="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=r,e.style.borderRadius=o,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 Ghe)super.focus(e),t.open(!0);else if(t instanceof N_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,r=>{if(tn.stop(r,!0),lf){if(new Dh(lt(this.element),r).rightButton)return;this.onClick(r)}else setTimeout(()=>{this.onClick(r)},0)})),this._register(ue(this.element,ke.CONTEXT_MENU,r=>{tn.stop(r,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=oe(this.element,fe("a.action-menu-item")),this._action.id===Eo.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=oe(this.item,fe("span.menu-item-check"+He.asCSSSelector(ve.menuSelection))),this.check.setAttribute("role","none"),this.label=oe(this.item,fe("span.action-label")),this.options.label&&this.options.keybinding&&(oe(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){Ns(this.label);let e=Tae(this.action.label);if(e){const t=Jxt(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=R_e.exec(e);if(i){e=wT(e),$he.lastIndex=0;let n=$he.exec(e);for(;n&&n[1];)n=$he.exec(e);const r=o=>o.replace(/&&/g,"&");n?this.label.append(SU(r(e.substr(0,n.index))," "),fe("u",{"aria-hidden":"true"},n[3]),qy(r(e.substr(n.index+n[0].length))," ")):this.label.innerText=r(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}`:"",r=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=r),this.check&&(this.check.style.color=t??"")}}class Ghe extends N_e{constructor(e,t,i,n,r){super(e,e,n,r),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:hJ.Right,vertical:M_e.Below},this.showScheduler=new ln(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new ln(()=>{this.element&&!yc(Wc(),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=oe(this.item,fe("span.submenu-indicator"+He.asCSSSelector(ve.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ue(this.element,ke.KEY_UP,t=>{const i=new xn(t);(i.equals(S.RightArrow)||i.equals(S.Enter))&&(tn.stop(t,!0),this.createSubmenu(!0))})),this._register(ue(this.element,ke.KEY_DOWN,t=>{const i=new xn(t);Wc()===this.item&&(i.equals(S.RightArrow)||i.equals(S.Enter))&&tn.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&&!yc(Wc(),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){tn.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 r={top:0,left:0};return r.left=fF(e.width,t.width,{position:n.horizontal===hJ.Right?Ff.Before:Ff.After,offset:i.left,size:i.width}),r.left>=i.left&&r.left{new xn(d).equals(S.LeftArrow)&&(tn.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ue(this.submenuContainer,ke.KEY_DOWN,d=>{new xn(d).equals(S.LeftArrow)&&tn.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 bWe extends tC{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 Jxt(s){const e=R_e,t=e.exec(s);if(!t)return s;const i=!t[1];return s.replace(e,i?"$2$3":"").trim()}function wWe(s){const e=FKe()[s.id];return`.codicon-${s.id}:before { content: '\\${e.toString(16)}'; }`}function Xxt(s,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; @@ -636,21 +636,21 @@ ${wWe(ve.menuSubmenu)} .monaco-scrollable-element > .scrollbar > .slider.active { background: ${o}; } - `)}return t}class Zxt{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=Wc();let i;const n=Jo(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:r=>{this.lastContainer=r;const o=e.getMenuClassName?e.getMenuClassName():"";o&&(r.className+=" "+o),this.options.blockMouse&&(this.block=r.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 q_;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),c.onDidRun(this.onDidActionRun,this,a),i=new gJe(r,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},Yxt),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const l=lt(r);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 Dh(l,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===r)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),Yo(a,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:r=>{e.onHide?.(!!r),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(Wc()===this.lastContainer||yc(Wc(),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&&!Oo(e.error)&&this.notificationService.error(e.error)}}let P_e=class extends V{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Zxt(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,r,o){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=r,this.contextKeyService=o,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=F_e.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),bb.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};P_e=D([_(0,Ji),_(1,wi),_(2,bf),_(3,Vt),_(4,Ba),_(5,Le)],P_e);var F_e;(function(s){function e(i){return i&&i.menuId instanceof _e}function t(i,n,r){if(!e(i))return i;const{menuId:o,menuActionOptions:a,contextKeyService:c}=i;return{...i,getActions:()=>{const l=[];if(o){const d=n.getMenuActions(o,c??r,a);hJe(d,l)}return i.getActions?Eo.join(i.getActions(),l):l}}}s.transform=t})(F_e||(F_e={}));function yWe(s){const e=s;return typeof e?.resolve=="function"&&typeof e?.isResolved=="function"}var Jk;(function(s){s[s.ACTIVATE=1]="ACTIVATE",s[s.RESTORE=2]="RESTORE",s[s.PRESERVE=3]="PRESERVE"})(Jk||(Jk={}));var O_e;(function(s){s[s.PICK=0]="PICK",s[s.EXCLUSIVE_ONLY=1]="EXCLUSIVE_ONLY"})(O_e||(O_e={}));var x3;(function(s){s[s.API=0]="API",s[s.USER=1]="USER"})(x3||(x3={}));var dA;(function(s){s[s.Center=0]="Center",s[s.CenterIfOutsideViewport=1]="CenterIfOutsideViewport",s[s.NearTop=2]="NearTop",s[s.NearTopIfOutsideViewport=3]="NearTopIfOutsideViewport"})(dA||(dA={}));var Lb;(function(s){s.PROGRAMMATIC="api",s.NAVIGATION="code.navigation",s.JUMP="code.jump"})(Lb||(Lb={}));function bRe(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 B_e=class{constructor(e){this._commandService=e}async open(e,t){if(!IA(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=iW(decodeURIComponent(e.query))}catch{try{i=iW(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};B_e=D([_(0,bi)],B_e);let W_e=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=N.parse(e));const{selection:i,uri:n}=bRe(e);return e=n,e.scheme===pe.file&&(e=QKe(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?x3.USER:x3.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};W_e=D([_(0,qt)],W_e);let H_e=class{constructor(e,t){this._openers=new ul,this._validators=new ul,this._resolvers=new ul,this._resolvedUriTargets=new gi(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new ul,this._defaultExternalOpener={openExternal:async i=>(R8(i,pe.http,pe.https)?vqe(i):ri.location.href=i,!0)},this._openers.push({open:async(i,n)=>n?.openExternal||R8(i,pe.mailto,pe.http,pe.https,pe.vsls)?(await this._doOpenExternal(i,n),!0):!1}),this._openers.push(new B_e(t)),this._openers.push(new W_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 r of this._validators)if(!await r.shouldOpen(n,t))return!1;for(const r of this._openers)if(await r.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 r;if(typeof e=="string"&&i.toString()===n.toString()?r=e:r=encodeURI(n.toString(!0)),t?.allowContributedOpeners){const o=typeof t?.allowContributedOpeners=="string"?t?.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(r,{sourceUri:i,preferredOpenerId:o},Ue.None))return!0}return this._defaultExternalOpener.openExternal(r,{sourceUri:i},Ue.None)}dispose(){this._validators.clear()}};H_e=D([_(0,qt),_(1,bi)],H_e);const Pl=ae("editorWorkerService");var p_;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(p_||(p_={}));var Hs;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Hs||(Hs={}));(function(s){function e(o,a){return a-o}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(o){return t[o]||""}s.toString=i;function n(o){switch(o){case Ze.Error:return s.Error;case Ze.Warning:return s.Warning;case Ze.Info:return s.Info;case Ze.Ignore:return s.Hint}}s.fromSeverity=n;function r(o){switch(o){case s.Error:return Ze.Error;case s.Warning:return Ze.Warning;case s.Info:return Ze.Info;case s.Hint:return Ze.Ignore}}s.toSeverity=r})(Hs||(Hs={}));var uJ;(function(s){const e="";function t(n){return i(n,!0)}s.makeKey=t;function i(n,r){const o=[e];return n.source?o.push(n.source.replace("¦","\\¦")):o.push(e),n.code?typeof n.code=="string"?o.push(n.code.replace("¦","\\¦")):o.push(n.code.value.replace("¦","\\¦")):o.push(e),n.severity!==void 0&&n.severity!==null?o.push(Hs.toString(n.severity)):o.push(e),n.message&&r?o.push(n.message.replace("¦","\\¦")):o.push(e),n.startLineNumber!==void 0&&n.startLineNumber!==null?o.push(n.startLineNumber.toString()):o.push(e),n.startColumn!==void 0&&n.startColumn!==null?o.push(n.startColumn.toString()):o.push(e),n.endLineNumber!==void 0&&n.endLineNumber!==null?o.push(n.endLineNumber.toString()):o.push(e),n.endColumn!==void 0&&n.endColumn!==null?o.push(n.endColumn.toString()):o.push(e),o.push(e),o.join("¦")}s.makeKeyOptionalMessage=i})(uJ||(uJ={}));const Dm=ae("markerService");let U_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 gi,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 eDt(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)}};U_e=D([_(0,fi),_(1,Dm)],U_e);class eDt extends V{constructor(e){super(),this.model=e,this._map=new nct,this._register(Ee(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=zoe(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)),r=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),o=this.model.deltaDecorations(n,r);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===Hs.Hint&&!this._hasMarkerTag(t,p_.Unnecessary)&&!this._hasMarkerTag(t,p_.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 r=e.getWordAtPosition(i.getStartPosition());r&&(i=new F(i.startLineNumber,r.startColumn,i.endLineNumber,r.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 h0;function vE(s){return s.toString()}class tDt{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 iDt=mo||jt?Db.LF:Db.CRLF;class nDt{constructor(e,t,i,n,r,o,a,c){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=r,this.sha1=o,this.versionId=a,this.alternativeVersionId=c}}var _L;let V_e=(_L=class extends V{constructor(e,t,i,n,r){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=n,this._languageConfigurationService=r,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(o=>this._updateModelOptions(o))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){let i=$d.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 r=$d.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let o=iDt;const a=e.eol;a===`\r + `)}return t}class Zxt{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=Wc();let i;const n=Jo(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:r=>{this.lastContainer=r;const o=e.getMenuClassName?e.getMenuClassName():"";o&&(r.className+=" "+o),this.options.blockMouse&&(this.block=r.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 q_;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),c.onDidRun(this.onDidActionRun,this,a),i=new gJe(r,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},Yxt),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const l=lt(r);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 Dh(l,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===r)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),Yo(a,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:r=>{e.onHide?.(!!r),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(Wc()===this.lastContainer||yc(Wc(),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&&!Oo(e.error)&&this.notificationService.error(e.error)}}let P_e=class extends V{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Zxt(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,r,o){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=r,this.contextKeyService=o,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=F_e.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),bb.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};P_e=D([_(0,Ji),_(1,wi),_(2,bf),_(3,Vt),_(4,Wa),_(5,Le)],P_e);var F_e;(function(s){function e(i){return i&&i.menuId instanceof _e}function t(i,n,r){if(!e(i))return i;const{menuId:o,menuActionOptions:a,contextKeyService:c}=i;return{...i,getActions:()=>{const l=[];if(o){const d=n.getMenuActions(o,c??r,a);hJe(d,l)}return i.getActions?Eo.join(i.getActions(),l):l}}}s.transform=t})(F_e||(F_e={}));function yWe(s){const e=s;return typeof e?.resolve=="function"&&typeof e?.isResolved=="function"}var Jk;(function(s){s[s.ACTIVATE=1]="ACTIVATE",s[s.RESTORE=2]="RESTORE",s[s.PRESERVE=3]="PRESERVE"})(Jk||(Jk={}));var O_e;(function(s){s[s.PICK=0]="PICK",s[s.EXCLUSIVE_ONLY=1]="EXCLUSIVE_ONLY"})(O_e||(O_e={}));var x3;(function(s){s[s.API=0]="API",s[s.USER=1]="USER"})(x3||(x3={}));var dA;(function(s){s[s.Center=0]="Center",s[s.CenterIfOutsideViewport=1]="CenterIfOutsideViewport",s[s.NearTop=2]="NearTop",s[s.NearTopIfOutsideViewport=3]="NearTopIfOutsideViewport"})(dA||(dA={}));var Lb;(function(s){s.PROGRAMMATIC="api",s.NAVIGATION="code.navigation",s.JUMP="code.jump"})(Lb||(Lb={}));function bRe(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 B_e=class{constructor(e){this._commandService=e}async open(e,t){if(!IA(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=iW(decodeURIComponent(e.query))}catch{try{i=iW(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};B_e=D([_(0,bi)],B_e);let W_e=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=N.parse(e));const{selection:i,uri:n}=bRe(e);return e=n,e.scheme===pe.file&&(e=QKe(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?x3.USER:x3.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};W_e=D([_(0,qt)],W_e);let H_e=class{constructor(e,t){this._openers=new ul,this._validators=new ul,this._resolvers=new ul,this._resolvedUriTargets=new gi(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new ul,this._defaultExternalOpener={openExternal:async i=>(R8(i,pe.http,pe.https)?vqe(i):ri.location.href=i,!0)},this._openers.push({open:async(i,n)=>n?.openExternal||R8(i,pe.mailto,pe.http,pe.https,pe.vsls)?(await this._doOpenExternal(i,n),!0):!1}),this._openers.push(new B_e(t)),this._openers.push(new W_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 r of this._validators)if(!await r.shouldOpen(n,t))return!1;for(const r of this._openers)if(await r.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 r;if(typeof e=="string"&&i.toString()===n.toString()?r=e:r=encodeURI(n.toString(!0)),t?.allowContributedOpeners){const o=typeof t?.allowContributedOpeners=="string"?t?.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(r,{sourceUri:i,preferredOpenerId:o},Ue.None))return!0}return this._defaultExternalOpener.openExternal(r,{sourceUri:i},Ue.None)}dispose(){this._validators.clear()}};H_e=D([_(0,qt),_(1,bi)],H_e);const Fl=ae("editorWorkerService");var p_;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(p_||(p_={}));var Hs;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Hs||(Hs={}));(function(s){function e(o,a){return a-o}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(o){return t[o]||""}s.toString=i;function n(o){switch(o){case Ze.Error:return s.Error;case Ze.Warning:return s.Warning;case Ze.Info:return s.Info;case Ze.Ignore:return s.Hint}}s.fromSeverity=n;function r(o){switch(o){case s.Error:return Ze.Error;case s.Warning:return Ze.Warning;case s.Info:return Ze.Info;case s.Hint:return Ze.Ignore}}s.toSeverity=r})(Hs||(Hs={}));var uJ;(function(s){const e="";function t(n){return i(n,!0)}s.makeKey=t;function i(n,r){const o=[e];return n.source?o.push(n.source.replace("¦","\\¦")):o.push(e),n.code?typeof n.code=="string"?o.push(n.code.replace("¦","\\¦")):o.push(n.code.value.replace("¦","\\¦")):o.push(e),n.severity!==void 0&&n.severity!==null?o.push(Hs.toString(n.severity)):o.push(e),n.message&&r?o.push(n.message.replace("¦","\\¦")):o.push(e),n.startLineNumber!==void 0&&n.startLineNumber!==null?o.push(n.startLineNumber.toString()):o.push(e),n.startColumn!==void 0&&n.startColumn!==null?o.push(n.startColumn.toString()):o.push(e),n.endLineNumber!==void 0&&n.endLineNumber!==null?o.push(n.endLineNumber.toString()):o.push(e),n.endColumn!==void 0&&n.endColumn!==null?o.push(n.endColumn.toString()):o.push(e),o.push(e),o.join("¦")}s.makeKeyOptionalMessage=i})(uJ||(uJ={}));const Dm=ae("markerService");let U_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 gi,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 eDt(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)}};U_e=D([_(0,fi),_(1,Dm)],U_e);class eDt extends V{constructor(e){super(),this.model=e,this._map=new nct,this._register(Ee(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=zoe(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)),r=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),o=this.model.deltaDecorations(n,r);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===Hs.Hint&&!this._hasMarkerTag(t,p_.Unnecessary)&&!this._hasMarkerTag(t,p_.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 r=e.getWordAtPosition(i.getStartPosition());r&&(i=new F(i.startLineNumber,r.startColumn,i.endLineNumber,r.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 h0;function vE(s){return s.toString()}class tDt{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 iDt=mo||jt?Db.LF:Db.CRLF;class nDt{constructor(e,t,i,n,r,o,a,c){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=r,this.sha1=o,this.versionId=a,this.alternativeVersionId=c}}var _L;let V_e=(_L=class extends V{constructor(e,t,i,n,r){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=n,this._languageConfigurationService=r,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(o=>this._updateModelOptions(o))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){let i=$d.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 r=$d.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let o=iDt;const a=e.eol;a===`\r `?o=Db.CRLF:a===` `&&(o=Db.LF);let c=$d.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let l=$d.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(l=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=$d.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=$d.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:r,detectIndentation:l,defaultEOL:o,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:pr===ks.Linux||pr===ks.Macintosh?` `:`\r `}_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 r=this._modelCreationOptionsByLanguageAndResource[n+t];if(!r){const o=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);r=h0._readModelOptions({editor:o,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=r}return r}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,r=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 r=this.getCreationOptions(t,i,n),o=new E_(e,t,r,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(vE(i))){const l=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(o)?h.computeSHA1(o)===l.sha1:!1;if(u||l.sharesUndoRedoStack){for(const f of d.past)JC(f)&&f.matchesResource(i)&&f.setModel(o);for(const f of d.future)JC(f)&&f.matchesResource(i)&&f.setModel(o);this._undoRedoService.setElementsValidFlag(i,!0,f=>JC(f)&&f.matchesResource(i)),u&&(o._overwriteVersionId(l.versionId),o._overwriteAlternativeVersionId(l.alternativeVersionId),o._overwriteInitialUndoRedoSnapshot(l.initialUndoRedoSnapshot))}else l.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(l.initialUndoRedoSnapshot)}const a=vE(o.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const c=new tDt(o,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:r}=Vme(t,i.defaultEOL);if(e.equalsTextBuffer(n)){r.dispose();return}e.pushStackElement(),e.pushEOL(n.getEOL()===`\r `?Eh.CRLF:Eh.LF),e.pushEditOperations([],h0._computeEdits(e,n),()=>[]),e.pushStackElement(),r.dispose()}static _commonPrefix(e,t,i,n,r,o){const a=Math.min(t,r);let c=0;for(let l=0;l0?(a=new F(r+1,1,i-o+1,1),c=new F(r+1,1,n-o+1,1)):r>0?(a=new F(r,e.getLineMaxColumn(r),i,e.getLineMaxColumn(i)),c=new F(r,1+t.getLineLength(r),n,1+t.getLineLength(n))):(a=new F(1,1,i,e.getLineMaxColumn(i)),c=new F(1,1,n,1+t.getLineLength(n))),[es.replaceMove(a,t.getValueInRange(c,gr.TextDefined))]}createModel(e,t,i,n=!1){let r;return t?r=this._createModelData(e,t,i,n):r=this._createModelData(e,Sa,i,n),this._onModelAdded.fire(r.model),r.model}destroyModel(e){const t=this._models[vE(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)JC(d)&&d.matchesResource(e.uri)&&(r=!0,o+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of l.future)JC(d)&&d.matchesResource(e.uri)&&(r=!0,o+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=h0.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,c=this._getSHA1Computer();if(r)if(!n&&(o>a||!c.canComputeSHA1(e))){const l=i.model.getInitialUndoRedoSnapshot();l!==null&&this._undoRedoService.restoreSnapshot(l)}else this._ensureDisposedModelsHeapSize(a-o),this._undoRedoService.setElementsValidFlag(e.uri,!1,l=>JC(l)&&l.matchesResource(e.uri)),this._insertDisposedModel(new nDt(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,o,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(),r=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),o=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);h0._setModelOptionsForModel(e,o,r),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new oW}},h0=_L,_L.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,_L);V_e=h0=D([_(0,Te),_(1,jTe),_(2,iE),_(3,Di),_(4,zs)],V_e);const kse=class kse{canComputeSHA1(e){return e.getValueLength()<=kse.MAX_MODEL_SIZE}computeSHA1(e){const t=new Npe,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}};kse.MAX_MODEL_SIZE=10*1024*1024;let oW=kse;var sDt=".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}";gt(sDt,{});var gJ;(function(s){s[s.PRESERVE=0]="PRESERVE",s[s.LAST=1]="LAST"})(gJ||(gJ={}));const HU={Quickaccess:"workbench.contributions.quickaccess"};class rDt{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 Oi([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}}}je.add(HU.Quickaccess,new rDt);const oDt={ctrlCmd:!1,alt:!1};var aW;(function(s){s[s.Blur=1]="Blur",s[s.Gesture=2]="Gesture",s[s.Other=3]="Other"})(aW||(aW={}));var cW;(function(s){s.QuickPick="quickPick",s.InputBox="inputBox",s.QuickWidget="quickWidget"})(cW||(cW={}));var zf;(function(s){s[s.NONE=0]="NONE",s[s.FIRST=1]="FIRST",s[s.SECOND=2]="SECOND",s[s.LAST=3]="LAST"})(zf||(zf={}));var wr;(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"})(wr||(wr={}));var fJ;(function(s){s[s.Title=1]="Title",s[s.Inline=2]="Inline"})(fJ||(fJ={}));class aDt{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 CWe=new aDt,Tn=ae("quickInputService");let z_e=class extends V{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=je.as(HU.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,r]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes),o=this.visibleQuickAccess,a=o?.descriptor;if(o&&r&&a===r){e!==r.prefix&&!i?.preserveValue&&(o.picker.value=e),this.adjustValueSelection(o.picker,r,i);return}if(r&&!i?.preserveValue){let p;if(o&&a&&a!==r){const m=o.value.substr(a.prefix.length);m&&(p=`${r.prefix}${m}`)}if(!p){const m=n?.defaultFilterValue;m===gJ.LAST?p=this.lastAcceptedPickerValues.get(r):typeof m=="string"&&(p=`${r.prefix}${m}`)}typeof p=="string"&&(e=p)}const c=o?.picker?.valueSelection,l=o?.picker?.value,d=new Z,h=d.add(this.quickInputService.createQuickPick());h.value=e,this.adjustValueSelection(h,r,i),h.placeholder=i?.placeholder??r?.placeholder,h.quickNavigate=i?.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!o,(typeof i?.itemActivation=="number"||i?.quickNavigateConfiguration)&&(h.itemActivation=i?.itemActivation??zf.SECOND),h.contextKey=r?.contextKey,h.filterValue=p=>p.substring(r?r.prefix.length:0);let u;t&&(u=new hc,d.add(M.once(h.onWillAccept)(p=>{p.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,n,r,e,i));const f=d.add(new li);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,r){const o=new Z,a=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return o.add(Ee(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),o.add(e.onDidChangeValue(c=>{const[l]=this.getOrInstantiateProvider(c,r?.enabledProviderPrefixes);l!==t?this.show(c,{enabledProviderPrefixes:r?.enabledProviderPrefixes,preserveValue:!0,providerOptions:r?.providerOptions}):a.value=c})),i&&o.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),o}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]}};z_e=D([_(0,Tn),_(1,we)],z_e);var cDt=".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}";gt(cDt,{});const fJe={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class sE extends _d{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(...He.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(xm().setupManagedHover(e.hoverDelegate??Fo("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(...He.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...He.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 Ise=class Ise extends _d{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 sE({title:this.title,isChecked:this.isChecked,icon:ve.check,actionClassName:Ise.CLASS_NAME,...fJe})),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 dv(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||""}};Ise.CLASS_NAME="monaco-checkbox";let SWe=Ise;var lDt='.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}';gt(lDt,{});class $_e{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}$_e.__decorator=D([ei],$_e.prototype,"toString",null);const dDt=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function pJe(s){const e=[];let t=0,i;for(;i=dDt.exec(s);){i.index-t>0&&e.push(s.substring(t,i.index));const[,n,r,,o]=i;o?e.push({label:n,href:r,title:o}):e.push({label:n,href:r}),t=i.index+i[0].length}return t{rut(f)&&tn.stop(f,!0),t.callback(r.href)},l=t.disposables.add(new ni(a,ke.CLICK)).event,d=t.disposables.add(new ni(a,ke.KEY_DOWN)).event,h=M.chain(d,f=>f.filter(p=>{const m=new xn(p);return m.equals(S.Space)||m.equals(S.Enter)}));t.disposables.add(md.addTarget(a));const u=t.disposables.add(new ni(a,ur.Tap)).event;M.any(l,u,h)(c,null,t.disposables),e.appendChild(a)}}let RM=class extends V{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},n,r){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=r,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(o=>{o.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=Jo(e.target)?[e.target]:e.target.targetElements;for(const o of n)this.hoverDisposables.add(Rr(o,"keydown",a=>{a.equals(S.Escape)&&this.hoverService.hideHover()}));const r=Jo(e.content)?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:r,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTimet===pJ),this._rightButtons=e.filter(t=>t!==pJ&&t.location!==fJ.Inline),this._inlineButtons=e.filter(t=>t.location===fJ.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=aW.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=aW.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?ca(this.ui.widget,this._widget):ca(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Em,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)=>M5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.leftActionBar.push(n,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const r=this._rightButtons.map((a,c)=>M5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.rightActionBar.push(r,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const o=this._inlineButtons.map((a,c)=>M5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.inlineActionBar.push(o,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const n=this.toggles?.filter(r=>r instanceof sE)??[];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,ca(this.ui.message),gDt(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!==Ze.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()}};Tse.noPromptMessage=g(5275,"Press 'Enter' to confirm your input or 'Escape' to cancel");let lW=Tse;const Lse=class Lse extends lW{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=zf.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 Q7,this.type=cW.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?oDt: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(wr.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&&ns(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&&ns(e,this._selectedItems,(i,n)=>i===n)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(BTe(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&ns(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 xn(e),i=t.keyCode;this._quickNavigate.keybindings.some(o=>{const a=o.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||Lse.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 zf.NONE:this._itemActivation=zf.FIRST;break;case zf.SECOND:this.ui.list.focus(wr.Second),this._itemActivation=zf.FIRST;break;case zf.LAST:this.ui.list.focus(wr.Last),this._itemActivation=zf.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(wr.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))}};Lse.DEFAULT_ARIA_LABEL=g(5277,"Type to narrow down results.");let vF=Lse,bDt=class extends lW{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=cW.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):lW.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 wDt extends lW{constructor(){super(...arguments),this.type=cW.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 G_e=class extends RM{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(Jo(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` -`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};G_e=D([_(0,Te),_(1,tc)],G_e);var yDt=".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)}";gt(yDt,{});me.white.toString(),me.white.toString();class Zd 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(md.addTarget(this._element)),[ke.CLICK,ur.Tap].forEach(r=>{this._register(ue(this._element,r,o=>{if(!this.enabled){tn.stop(o);return}this._onDidClick.fire(o)}))}),this._register(ue(this._element,ke.KEY_DOWN,r=>{const o=new xn(r);let a=!1;this.enabled&&(o.equals(S.Enter)||o.equals(S.Space))?(this._onDidClick.fire(r),a=!0):o.equals(S.Escape)&&(this._onDidEscape.fire(r),this._element.blur(),a=!0),a&&tn.stop(o,!0)})),this._register(ue(this._element,ke.MOUSE_OVER,r=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ue(this._element,ke.MOUSE_OUT,r=>{this.updateBackground(!1)})),this.focusTracker=this._register(Ec(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 Ib(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||ud(this._label)&&ud(e)&&WSt(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(ud(e)){const n=x6(e,{inline:!0});n.dispose();const r=n.element.querySelector("p")?.innerHTML;if(r){const o=rqe(r,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});t.innerHTML=o}else ca(t)}else this.options.supportIcons?ca(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=SYe(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?ca(this._labelShortElement,...this.getContentElements(e)):this._labelShortElement.textContent=e)}set icon(e){this._element.classList.add(...He.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(xm().setupManagedHover(this.options.hoverDelegate??Fo("mouse"),this._element,e)):this._hover&&this._hover.update(e)}focus(){this._element.focus()}hasFocus(){return dv(this._element)}}class CDt 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 Zd(this.element,t)),this._register(this.button.onDidClick(r=>this._onDidClick.fire(r))),this.action=this._register(new an("primaryAction",SYe(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 Zd(this.element,{...t,title:!1,supportIcons:!0})),this._register(xm().setupManagedHover(Fo("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(r=>{const o=Array.isArray(t.actions)?t.actions:t.actions.getActions();t.contextMenuProvider.showContextMenu({getAnchor:()=>this.dropdownButton.element,getActions:()=>t.addPrimaryActionToDropdown===!1?[...o]:[this.action,...o],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 SDt{constructor(e,t){this.options=t,this._element=document.createElement("div"),this._element.classList.add("monaco-description-button"),this._button=new Zd(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?ca(this._descriptionElement,...Ib(e)):this._descriptionElement.textContent=e}}class ADt{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 Zd(this.container,e));return this.pushButton(t),t}addButtonWithDescription(e){const t=this._buttonStore.add(new SDt(this.container,e));return this.pushButton(t),t}addButtonWithDropdown(e){const t=this._buttonStore.add(new CDt(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 xn(i);let r=!0,o;n.equals(S.LeftArrow)?o=t>0?t-1:this._buttons.length-1:n.equals(S.RightArrow)?o=t===this._buttons.length-1?0:t+1:r=!1,r&&typeof o=="number"&&(this._buttons[o].focus(),tn.stop(i,!0))}))}}var EDt=".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}";gt(EDt,{});class K_e{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=oe(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=qp(this.countFormat,this.count),this.element.title=qp(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 xDt=()=>({msLoopTime:-1,msDelayTime:-1,dispose:()=>{}});let DDt=xDt;function kDt(s,e){return DDt()}var IDt=".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)}}";gt(IDt,{});const qhe="done",Qhe="active",pK="infinite",mK="infinite-long-running",jhe="discrete",qz=class qz extends V{constructor(e,t){super(),this.progressSignal=this._register(new yn),this.workedVal=0,this.showDelayedScheduler=this._register(new ln(()=>Xh(this.element),0)),this.longRunningScheduler=this._register(new ln(()=>this.infiniteLongRunning(),qz.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(Qhe,pK,mK,jhe),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(qhe),this.element.classList.contains(pK)?(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(jhe,qhe,mK),this.element.classList.add(Qhe,pK),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(mK)}total(e){return this.workedVal=0,this.totalWork=e,this.element.setAttribute("aria-valuemax",e.toString()),this}hasTotal(){return dc(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(pK,mK,qhe),this.element.classList.add(Qhe,jhe),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=kDt(),typeof e=="number"?this.showDelayedScheduler.schedule(e):Xh(this.element)}hide(){Gd(this.element),this.showDelayedScheduler.cancel(),this.progressSignal.clear()}};qz.LONG_RUNNING_INFINITE_THRESHOLD=1e4,qz.PROGRESS_SIGNAL_DEFAULT_DELAY=3e3;let mJ=qz;const TDt=g(9871,"Match Case"),LDt=g(9872,"Match Whole Word"),RDt=g(9873,"Use Regular Expression");class bJe extends sE{constructor(e){super({icon:ve.caseSensitive,title:TDt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class wJe extends sE{constructor(e){super({icon:ve.wholeWord,title:LDt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class yJe extends sE{constructor(e){super({icon:ve.regex,title:RDt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class MDt{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 NDt{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 MDt(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 AWe{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 Zat([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 PDt=".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}";gt(PDt,{});const A4=fe;var ed;(function(s){s[s.INFO=1]="INFO",s[s.WARNING=2]="WARNING",s[s.ERROR=3]="ERROR"})(ed||(ed={}));const FDt={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 CJe extends _d{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=oe(e,A4(".monaco-inputbox.idle"));const n=this.options.flexibleHeight?"textarea":"input",r=oe(this.element,A4(".ibwrapper"));if(this.input=oe(r,A4(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=oe(r,A4("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new $Qe(this.element,{vertical:Cr.Auto}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),oe(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const o=this._register(new ni(e.ownerDocument,"selectionchange")),a=M.filter(o.event,()=>e.ownerDocument.getSelection()?.anchorNode===r);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 gd(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(xm().setupManagedHover(Fo("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:vb(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return dv(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 Od(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"&&Js(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 ${My(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 ed.INFO:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case ed.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 ed.INFO:return"info";case ed.WARNING:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=Od(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:Cb.RIGHT,render:n=>{if(!this.message)return null;e=oe(n,A4(".monaco-inputbox-container")),t();const r={inline:!0,className:"monaco-inputbox-message"},o=this.message.formatContent?JLe(this.message.content,r):gSt(this.message.content,r);o.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return o.style.backgroundColor=a.background??"",o.style.color=a.foreground??"",o.style.border=a.border?`1px solid ${a.border}`:"",oe(e,o),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===ed.ERROR?i=g(9834,"Error: {0}",this.message.content):this.message.type===ed.WARNING?i=g(9835,"Warning: {0}",this.message.content):i=g(9836,"Info: {0}",this.message.content),No(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 ${My(n,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=vb(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,r=t.value;i!==null&&n!==null&&(this.value=r.substr(0,i)+e+r.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}}class wRe extends CJe{constructor(e,t,i){const n=g(9837," or {0} for history","⇅"),r=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 NDt(i.history,100);const o=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(r)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?n:r,c=this.placeholder+a;i.showPlaceholderOnFocus&&!dv(this.input)?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((a,c)=>{a.forEach(l=>{l.target.textContent||o()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>o()),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(r)||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??"",xh(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,xh(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 ODt=".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}}";gt(ODt,{});const BDt=g(9833,"input"),IFe=class IFe extends _d{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new yn),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||BDt,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",r=i.appendWholeWordsLabel||"",o=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 wRe(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(Yk());if(this.showCommonFindToggles){this.regex=this._register(new yJe({appendTitle:o,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 wJe({appendTitle:r,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 bJe({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(),tn.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 D3=IFe;const WDt=fe;class HDt extends V{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=r=>Rr(this.findInput.inputBox.inputElement,ke.KEY_DOWN,r),this.onMouseDown=r=>Rr(this.findInput.inputBox.inputElement,ke.MOUSE_DOWN,r),this.onDidChange=r=>this.findInput.onDidChange(r),this.container=oe(this.parent,WDt(".quick-input-box")),this.findInput=this._register(new D3(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===Ze.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Ze.Info?ed.INFO:e===Ze.Warning?ed.WARNING:ed.ERROR,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Ze.Info?ed.INFO:e===Ze.Warning?ed.WARNING:ed.ERROR)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class UDt{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 r=this.modelProvider();if(r.isResolved(e))return this.renderer.renderElement(r.get(e),e,i.data,n);const o=new li,a=r.resolve(e,o.token);i.disposable={dispose:()=>o.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 VDt{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 zDt(s,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new VDt(s,e.accessibilityProvider)}}class $Dt{constructor(e,t,i,n,r={}){const o=()=>this.model,a=n.map(c=>new UDt(c,o));this.list=new Za(e,t,i,a,zDt(o,r))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}isDOMFocused(){return dv(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,xu(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 GDt=':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}';gt(GDt,{});const KDt=!1;var _J;(function(s){s.North="north",s.South="south",s.East="east",s.West="west"})(_J||(_J={}));var pi;(function(s){s[s.VERTICAL=0]="VERTICAL",s[s.HORIZONTAL=1]="HORIZONTAL"})(pi||(pi={}));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 qDt=4;const QDt=new I;let jDt=300;const YDt=new I;class k3{constructor(e){this.el=e,this.disposables=new Z}get onPointerMove(){return this.disposables.add(new ni(lt(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new ni(lt(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}k3.__decorator=D([ei],k3.prototype,"onPointerMove",null);k3.__decorator=D([ei],k3.prototype,"onPointerUp",null);class I3{get onPointerMove(){return this.disposables.add(new ni(this.el,ur.Change)).event}get onPointerUp(){return this.disposables.add(new ni(this.el,ur.End)).event}constructor(e){this.el=e,this.disposables=new Z}dispose(){this.disposables.dispose()}}I3.__decorator=D([ei],I3.prototype,"onPointerMove",null);I3.__decorator=D([ei],I3.prototype,"onPointerUp",null);class dW{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}dW.__decorator=D([ei],dW.prototype,"onPointerMove",null);dW.__decorator=D([ei],dW.prototype,"onPointerUp",null);const EWe="pointer-events-disabled";class Wd 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=oe(this.el,fe(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ee(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new ni(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Wd.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new ni(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Wd.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=oe(this.el,fe(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ee(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new ni(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Wd.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new ni(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Wd.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=jDt,this.hoverDelayer=this._register(new Ph(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=oe(e,fe(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),jt&&this.el.classList.add("mac");const n=this._register(new ni(this.el,"mousedown")).event;this._register(n(h=>this.onPointerStart(h,new k3(e)),this));const r=this._register(new ni(this.el,"dblclick")).event;this._register(r(this.onPointerDoublePress,this));const o=this._register(new ni(this.el,"mouseenter")).event;this._register(o(()=>Wd.onMouseEnter(this)));const a=this._register(new ni(this.el,"mouseleave")).event;this._register(a(()=>Wd.onMouseLeave(this))),this._register(md.addTarget(this.el));const c=this._register(new ni(this.el,ur.Start)).event;this._register(c(h=>this.onPointerStart(h,new I3(this.el)),this));const l=this._register(new ni(this.el,ur.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===pi.VERTICAL?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=qDt,this._register(QDt.event(h=>{this.size=h,this.layout()}))),this._register(YDt.event(h=>this.hoverDelay=h)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||pi.VERTICAL,this.orientation===pi.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",KDt),this.layout()}onPointerStart(e,t){tn.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const p=this.getOrthogonalSash(e);p&&(i=!0,e.__orthogonalSashEvent=!0,p.onPointerStart(e,new dW(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new dW(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const p of n)p.classList.add(EWe);const r=e.pageX,o=e.pageY,a=e.altKey,c={startX:r,currentX:r,startY:o,currentY:o,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(c);const l=fl(this.el),d=()=>{let p="";i?p="all-scroll":this.orientation===pi.HORIZONTAL?this.state===oa.AtMinimum?p="s-resize":this.state===oa.AtMaximum?p="n-resize":p=jt?"row-resize":"ns-resize":this.state===oa.AtMinimum?p="e-resize":this.state===oa.AtMaximum?p="w-resize":p=jt?"col-resize":"ew-resize",l.textContent=`* { cursor: ${p} !important; }`},h=new Z;d(),i||this.onDidEnablementChange.event(d,null,h);const u=p=>{tn.stop(p,!1);const m={startX:r,currentX:p.pageX,startY:o,currentY:p.pageY,altKey:a};this._onDidChange.fire(m)},f=p=>{tn.stop(p,!1),l.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const m of n)m.classList.remove(EWe)};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&&Wd.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Wd.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Wd.onMouseLeave(this)}layout(){if(this.orientation===pi.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||!Jo(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}var JDt='.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%}';gt(JDt,{});const XDt={separatorBorder:me.transparent};var pw;(function(s){s[s.Normal=0]="Normal",s[s.Low=1]="Low",s[s.High=2]="High"})(pw||(pw={}));class SJe{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=qa(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 ZDt extends SJe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class ekt extends SJe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Wh;(function(s){s[s.Idle=0]="Idle",s[s.Busy=1]="Busy"})(Wh||(Wh={}));var Xk;(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})(Xk||(Xk={}));class T3 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=Wh.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??pi.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===pi.VERTICAL?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=oe(this.el,fe(".sash-container")),this.viewContainer=fe(".split-view-container"),this.scrollable=this._register(new DN({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>Ml(lt(this.el),n)})),this.scrollableElement=this._register(new y6(this.viewContainer,{vertical:this.orientation===pi.VERTICAL?t.scrollbarVisibility??Cr.Auto:Cr.Hidden,horizontal:this.orientation===pi.HORIZONTAL?t.scrollbarVisibility??Cr.Auto:Cr.Hidden},this.scrollable));const i=this._register(new ni(this.viewContainer,"scroll")).event;this._register(i(n=>{const r=this.scrollableElement.getScrollPosition(),o=Math.abs(this.viewContainer.scrollLeft-r.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-r.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(o!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:o,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)})),oe(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||XDt),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((n,r)=>{const o=Ja(n.visible)||n.visible?n.size:{type:"invisible",cachedVisibleSize:n.size},a=n.view;this.doAddView(a,o,r,!0)}),this._contentSize=this.viewItems.reduce((n,r)=>n+r.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!==Wh.Idle)throw new Error("Cant modify splitview");this.state=Wh.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 o=Math.max(e-1,0);this.sashItems.splice(o,1)[0].disposable.dispose()}this.relayout(),t?.type==="distribute"&&this.distributeViewSizes();const r=n.view;return n.dispose(),r}finally{this.state=Wh.Idle}}removeAllViews(){if(this.state!==Wh.Idle)throw new Error("Cant modify splitview");this.state=Wh.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=Wh.Idle}}moveView(e,t){if(this.state!==Wh.Idle)throw new Error("Cant modify splitview");const i=this.getViewCachedVisibleSize(e),n=typeof i>"u"?this.getViewSize(e):Xk.Invisible(i),r=this.removeView(e);this.addView(r,n,t)}swapViews(e,t){if(this.state!==Wh.Idle)throw new Error("Cant modify splitview");if(e>t)return this.swapViews(t,e);const i=this.getViewSize(e),n=this.getViewSize(t),r=this.removeView(t),o=this.removeView(e);this.addView(r,i,e),this.addView(o,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 r=0;r0&&(o.size=qa(Math.round(a*e/n),o.minimumSize,o.maximumSize))}}else{const n=xu(this.viewItems.length),r=n.filter(a=>this.viewItems[a].priority===pw.Low),o=n.filter(a=>this.viewItems[a].priority===pw.High);this.resize(this.viewItems.length-1,e-i,void 0,r,o)}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),r=Yo(ue(this.el.ownerDocument.body,"keydown",a=>o(this.sashDragState.current,a.altKey)),ue(this.el.ownerDocument.body,"keyup",()=>o(this.sashDragState.current,!1))),o=(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=xu(n,-1),m=xu(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:r}};o(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:r,minDelta:o,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,o,a,c,l);if(r){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=qa(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!==Wh.Idle)throw new Error("Cant modify splitview");this.state=Wh.Busy;try{const i=xu(this.viewItems.length).filter(a=>a!==e),n=[...i.filter(a=>this.viewItems[a].priority===pw.Low),e],r=i.filter(a=>this.viewItems[a].priority===pw.High),o=this.viewItems[e];t=Math.round(t),t=qa(t,o.minimumSize,Math.min(o.maximumSize,this.size)),o.size=t,this.relayout(n,r)}finally{this.state=Wh.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=qa(i,a.minimumSize,a.maximumSize);const n=xu(this.viewItems.length),r=n.filter(a=>this.viewItems[a].priority===pw.Low),o=n.filter(a=>this.viewItems[a].priority===pw.High);this.relayout(r,o)}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!==Wh.Idle)throw new Error("Cant modify splitview");this.state=Wh.Busy;try{const r=fe(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(r):this.viewContainer.insertBefore(r,this.viewContainer.children.item(i));const o=e.onDidChange(u=>this.onViewChange(d,u)),a=Ee(()=>r.remove()),c=Yo(o,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===pi.VERTICAL?new ZDt(r,e,l,c):new ekt(r,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===pi.VERTICAL?new Wd(this.sashContainer,{getHorizontalSashTop:P=>this.getSashPosition(P),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:pi.HORIZONTAL}):new Wd(this.sashContainer,{getVerticalSashLeft:P=>this.getSashPosition(P),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:pi.VERTICAL}),p=this.orientation===pi.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=xu(P,-1),z=xu(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=Yo(v,w,C,A,f),k={sash:f,disposable:L};this.sashItems.splice(i-1,0,k)}r.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=Wh.Idle}}relayout(e,t){const i=this.viewItems.reduce((n,r)=>n+r.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,r,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,c,l){if(e<0||e>=this.viewItems.length)return 0;const d=xu(e,-1),h=xu(e+1,this.viewItems.length);if(r)for(const k of r)Nde(d,k),Nde(h,k);if(n)for(const k of n)TG(d,k),TG(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,o),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=xu(this.viewItems.length-1,-1),r=n.filter(a=>this.viewItems[a].priority===pw.Low),o=n.filter(a=>this.viewItems[a].priority===pw.High);for(const a of o)Nde(n,a);for(const a of r)TG(n,a);typeof e=="number"&&TG(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===pi.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 r=n.map(c=>e=c.size-c.minimumSize>0||e).reverse();e=!1;const o=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(),wt(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}var tkt='.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}';gt(tkt,{});const Rse=class Rse{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=Rse.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(r=>[r.templateId,r]));this.renderers=[];for(const r of e){const o=n.get(r.templateId);if(!o)throw new Error(`Table cell renderer for template id ${r.templateId} not found.`);this.renderers.push(o)}}renderTemplate(e){const t=oe(e,fe(".monaco-table-tr")),i=[],n=[];for(let o=0;othis.disposables.add(new nkt(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 T3(this.domNode,{orientation:pi.HORIZONTAL,scrollbarVisibility:Cr.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 vJ(n,r,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Za(e,this.domNode,ikt(i),[l],o)),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=fl(this.domNode),this.style(Sxt)}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??PTe(this.domNode),t=t??a5(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 { +`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};G_e=D([_(0,Te),_(1,tc)],G_e);var yDt=".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)}";gt(yDt,{});me.white.toString(),me.white.toString();class Zd 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(md.addTarget(this._element)),[ke.CLICK,ur.Tap].forEach(r=>{this._register(ue(this._element,r,o=>{if(!this.enabled){tn.stop(o);return}this._onDidClick.fire(o)}))}),this._register(ue(this._element,ke.KEY_DOWN,r=>{const o=new xn(r);let a=!1;this.enabled&&(o.equals(S.Enter)||o.equals(S.Space))?(this._onDidClick.fire(r),a=!0):o.equals(S.Escape)&&(this._onDidEscape.fire(r),this._element.blur(),a=!0),a&&tn.stop(o,!0)})),this._register(ue(this._element,ke.MOUSE_OVER,r=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ue(this._element,ke.MOUSE_OUT,r=>{this.updateBackground(!1)})),this.focusTracker=this._register(Ec(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 Ib(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||ud(this._label)&&ud(e)&&WSt(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(ud(e)){const n=x6(e,{inline:!0});n.dispose();const r=n.element.querySelector("p")?.innerHTML;if(r){const o=rqe(r,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});t.innerHTML=o}else ca(t)}else this.options.supportIcons?ca(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=SYe(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?ca(this._labelShortElement,...this.getContentElements(e)):this._labelShortElement.textContent=e)}set icon(e){this._element.classList.add(...He.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(xm().setupManagedHover(this.options.hoverDelegate??Fo("mouse"),this._element,e)):this._hover&&this._hover.update(e)}focus(){this._element.focus()}hasFocus(){return dv(this._element)}}class CDt 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 Zd(this.element,t)),this._register(this.button.onDidClick(r=>this._onDidClick.fire(r))),this.action=this._register(new an("primaryAction",SYe(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 Zd(this.element,{...t,title:!1,supportIcons:!0})),this._register(xm().setupManagedHover(Fo("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(r=>{const o=Array.isArray(t.actions)?t.actions:t.actions.getActions();t.contextMenuProvider.showContextMenu({getAnchor:()=>this.dropdownButton.element,getActions:()=>t.addPrimaryActionToDropdown===!1?[...o]:[this.action,...o],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 SDt{constructor(e,t){this.options=t,this._element=document.createElement("div"),this._element.classList.add("monaco-description-button"),this._button=new Zd(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?ca(this._descriptionElement,...Ib(e)):this._descriptionElement.textContent=e}}class ADt{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 Zd(this.container,e));return this.pushButton(t),t}addButtonWithDescription(e){const t=this._buttonStore.add(new SDt(this.container,e));return this.pushButton(t),t}addButtonWithDropdown(e){const t=this._buttonStore.add(new CDt(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 xn(i);let r=!0,o;n.equals(S.LeftArrow)?o=t>0?t-1:this._buttons.length-1:n.equals(S.RightArrow)?o=t===this._buttons.length-1?0:t+1:r=!1,r&&typeof o=="number"&&(this._buttons[o].focus(),tn.stop(i,!0))}))}}var EDt=".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}";gt(EDt,{});class K_e{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=oe(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=qp(this.countFormat,this.count),this.element.title=qp(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 xDt=()=>({msLoopTime:-1,msDelayTime:-1,dispose:()=>{}});let DDt=xDt;function kDt(s,e){return DDt()}var IDt=".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)}}";gt(IDt,{});const qhe="done",Qhe="active",pK="infinite",mK="infinite-long-running",jhe="discrete",qz=class qz extends V{constructor(e,t){super(),this.progressSignal=this._register(new yn),this.workedVal=0,this.showDelayedScheduler=this._register(new ln(()=>Xh(this.element),0)),this.longRunningScheduler=this._register(new ln(()=>this.infiniteLongRunning(),qz.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(Qhe,pK,mK,jhe),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(qhe),this.element.classList.contains(pK)?(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(jhe,qhe,mK),this.element.classList.add(Qhe,pK),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(mK)}total(e){return this.workedVal=0,this.totalWork=e,this.element.setAttribute("aria-valuemax",e.toString()),this}hasTotal(){return dc(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(pK,mK,qhe),this.element.classList.add(Qhe,jhe),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=kDt(),typeof e=="number"?this.showDelayedScheduler.schedule(e):Xh(this.element)}hide(){Gd(this.element),this.showDelayedScheduler.cancel(),this.progressSignal.clear()}};qz.LONG_RUNNING_INFINITE_THRESHOLD=1e4,qz.PROGRESS_SIGNAL_DEFAULT_DELAY=3e3;let mJ=qz;const TDt=g(9871,"Match Case"),LDt=g(9872,"Match Whole Word"),RDt=g(9873,"Use Regular Expression");class bJe extends sE{constructor(e){super({icon:ve.caseSensitive,title:TDt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class wJe extends sE{constructor(e){super({icon:ve.wholeWord,title:LDt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class yJe extends sE{constructor(e){super({icon:ve.regex,title:RDt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class MDt{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 NDt{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 MDt(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 AWe{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 Zat([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 PDt=".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}";gt(PDt,{});const A4=fe;var ed;(function(s){s[s.INFO=1]="INFO",s[s.WARNING=2]="WARNING",s[s.ERROR=3]="ERROR"})(ed||(ed={}));const FDt={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 CJe extends _d{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=oe(e,A4(".monaco-inputbox.idle"));const n=this.options.flexibleHeight?"textarea":"input",r=oe(this.element,A4(".ibwrapper"));if(this.input=oe(r,A4(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=oe(r,A4("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new $Qe(this.element,{vertical:Cr.Auto}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),oe(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const o=this._register(new ni(e.ownerDocument,"selectionchange")),a=M.filter(o.event,()=>e.ownerDocument.getSelection()?.anchorNode===r);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 gd(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(xm().setupManagedHover(Fo("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:vb(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return dv(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 Od(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"&&Js(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 ${My(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 ed.INFO:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case ed.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 ed.INFO:return"info";case ed.WARNING:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=Od(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:Cb.RIGHT,render:n=>{if(!this.message)return null;e=oe(n,A4(".monaco-inputbox-container")),t();const r={inline:!0,className:"monaco-inputbox-message"},o=this.message.formatContent?JLe(this.message.content,r):gSt(this.message.content,r);o.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return o.style.backgroundColor=a.background??"",o.style.color=a.foreground??"",o.style.border=a.border?`1px solid ${a.border}`:"",oe(e,o),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===ed.ERROR?i=g(9834,"Error: {0}",this.message.content):this.message.type===ed.WARNING?i=g(9835,"Warning: {0}",this.message.content):i=g(9836,"Info: {0}",this.message.content),No(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 ${My(n,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=vb(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,r=t.value;i!==null&&n!==null&&(this.value=r.substr(0,i)+e+r.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}}class wRe extends CJe{constructor(e,t,i){const n=g(9837," or {0} for history","⇅"),r=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 NDt(i.history,100);const o=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(r)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?n:r,c=this.placeholder+a;i.showPlaceholderOnFocus&&!dv(this.input)?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((a,c)=>{a.forEach(l=>{l.target.textContent||o()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>o()),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(r)||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??"",xh(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,xh(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 ODt=".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}}";gt(ODt,{});const BDt=g(9833,"input"),IFe=class IFe extends _d{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new yn),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||BDt,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",r=i.appendWholeWordsLabel||"",o=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 wRe(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(Yk());if(this.showCommonFindToggles){this.regex=this._register(new yJe({appendTitle:o,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 wJe({appendTitle:r,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 bJe({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(),tn.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 D3=IFe;const WDt=fe;class HDt extends V{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=r=>Rr(this.findInput.inputBox.inputElement,ke.KEY_DOWN,r),this.onMouseDown=r=>Rr(this.findInput.inputBox.inputElement,ke.MOUSE_DOWN,r),this.onDidChange=r=>this.findInput.onDidChange(r),this.container=oe(this.parent,WDt(".quick-input-box")),this.findInput=this._register(new D3(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===Ze.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Ze.Info?ed.INFO:e===Ze.Warning?ed.WARNING:ed.ERROR,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Ze.Info?ed.INFO:e===Ze.Warning?ed.WARNING:ed.ERROR)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class UDt{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 r=this.modelProvider();if(r.isResolved(e))return this.renderer.renderElement(r.get(e),e,i.data,n);const o=new li,a=r.resolve(e,o.token);i.disposable={dispose:()=>o.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 VDt{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 zDt(s,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new VDt(s,e.accessibilityProvider)}}class $Dt{constructor(e,t,i,n,r={}){const o=()=>this.model,a=n.map(c=>new UDt(c,o));this.list=new Za(e,t,i,a,zDt(o,r))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}isDOMFocused(){return dv(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,xu(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 GDt=':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}';gt(GDt,{});const KDt=!1;var _J;(function(s){s.North="north",s.South="south",s.East="east",s.West="west"})(_J||(_J={}));var pi;(function(s){s[s.VERTICAL=0]="VERTICAL",s[s.HORIZONTAL=1]="HORIZONTAL"})(pi||(pi={}));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 qDt=4;const QDt=new I;let jDt=300;const YDt=new I;class k3{constructor(e){this.el=e,this.disposables=new Z}get onPointerMove(){return this.disposables.add(new ni(lt(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new ni(lt(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}k3.__decorator=D([ei],k3.prototype,"onPointerMove",null);k3.__decorator=D([ei],k3.prototype,"onPointerUp",null);class I3{get onPointerMove(){return this.disposables.add(new ni(this.el,ur.Change)).event}get onPointerUp(){return this.disposables.add(new ni(this.el,ur.End)).event}constructor(e){this.el=e,this.disposables=new Z}dispose(){this.disposables.dispose()}}I3.__decorator=D([ei],I3.prototype,"onPointerMove",null);I3.__decorator=D([ei],I3.prototype,"onPointerUp",null);class dW{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}dW.__decorator=D([ei],dW.prototype,"onPointerMove",null);dW.__decorator=D([ei],dW.prototype,"onPointerUp",null);const EWe="pointer-events-disabled";class Wd 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=oe(this.el,fe(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ee(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new ni(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Wd.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new ni(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Wd.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=oe(this.el,fe(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ee(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new ni(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Wd.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new ni(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Wd.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=jDt,this.hoverDelayer=this._register(new Ph(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=oe(e,fe(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),jt&&this.el.classList.add("mac");const n=this._register(new ni(this.el,"mousedown")).event;this._register(n(h=>this.onPointerStart(h,new k3(e)),this));const r=this._register(new ni(this.el,"dblclick")).event;this._register(r(this.onPointerDoublePress,this));const o=this._register(new ni(this.el,"mouseenter")).event;this._register(o(()=>Wd.onMouseEnter(this)));const a=this._register(new ni(this.el,"mouseleave")).event;this._register(a(()=>Wd.onMouseLeave(this))),this._register(md.addTarget(this.el));const c=this._register(new ni(this.el,ur.Start)).event;this._register(c(h=>this.onPointerStart(h,new I3(this.el)),this));const l=this._register(new ni(this.el,ur.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===pi.VERTICAL?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=qDt,this._register(QDt.event(h=>{this.size=h,this.layout()}))),this._register(YDt.event(h=>this.hoverDelay=h)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||pi.VERTICAL,this.orientation===pi.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",KDt),this.layout()}onPointerStart(e,t){tn.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const p=this.getOrthogonalSash(e);p&&(i=!0,e.__orthogonalSashEvent=!0,p.onPointerStart(e,new dW(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new dW(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const p of n)p.classList.add(EWe);const r=e.pageX,o=e.pageY,a=e.altKey,c={startX:r,currentX:r,startY:o,currentY:o,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(c);const l=fl(this.el),d=()=>{let p="";i?p="all-scroll":this.orientation===pi.HORIZONTAL?this.state===oa.AtMinimum?p="s-resize":this.state===oa.AtMaximum?p="n-resize":p=jt?"row-resize":"ns-resize":this.state===oa.AtMinimum?p="e-resize":this.state===oa.AtMaximum?p="w-resize":p=jt?"col-resize":"ew-resize",l.textContent=`* { cursor: ${p} !important; }`},h=new Z;d(),i||this.onDidEnablementChange.event(d,null,h);const u=p=>{tn.stop(p,!1);const m={startX:r,currentX:p.pageX,startY:o,currentY:p.pageY,altKey:a};this._onDidChange.fire(m)},f=p=>{tn.stop(p,!1),l.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const m of n)m.classList.remove(EWe)};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&&Wd.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Wd.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Wd.onMouseLeave(this)}layout(){if(this.orientation===pi.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||!Jo(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}var JDt='.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%}';gt(JDt,{});const XDt={separatorBorder:me.transparent};var pw;(function(s){s[s.Normal=0]="Normal",s[s.Low=1]="Low",s[s.High=2]="High"})(pw||(pw={}));class SJe{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=Qa(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 ZDt extends SJe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class ekt extends SJe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Wh;(function(s){s[s.Idle=0]="Idle",s[s.Busy=1]="Busy"})(Wh||(Wh={}));var Xk;(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})(Xk||(Xk={}));class T3 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=Wh.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??pi.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===pi.VERTICAL?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=oe(this.el,fe(".sash-container")),this.viewContainer=fe(".split-view-container"),this.scrollable=this._register(new DN({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>Nl(lt(this.el),n)})),this.scrollableElement=this._register(new y6(this.viewContainer,{vertical:this.orientation===pi.VERTICAL?t.scrollbarVisibility??Cr.Auto:Cr.Hidden,horizontal:this.orientation===pi.HORIZONTAL?t.scrollbarVisibility??Cr.Auto:Cr.Hidden},this.scrollable));const i=this._register(new ni(this.viewContainer,"scroll")).event;this._register(i(n=>{const r=this.scrollableElement.getScrollPosition(),o=Math.abs(this.viewContainer.scrollLeft-r.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-r.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(o!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:o,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)})),oe(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||XDt),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((n,r)=>{const o=Ja(n.visible)||n.visible?n.size:{type:"invisible",cachedVisibleSize:n.size},a=n.view;this.doAddView(a,o,r,!0)}),this._contentSize=this.viewItems.reduce((n,r)=>n+r.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!==Wh.Idle)throw new Error("Cant modify splitview");this.state=Wh.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 o=Math.max(e-1,0);this.sashItems.splice(o,1)[0].disposable.dispose()}this.relayout(),t?.type==="distribute"&&this.distributeViewSizes();const r=n.view;return n.dispose(),r}finally{this.state=Wh.Idle}}removeAllViews(){if(this.state!==Wh.Idle)throw new Error("Cant modify splitview");this.state=Wh.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=Wh.Idle}}moveView(e,t){if(this.state!==Wh.Idle)throw new Error("Cant modify splitview");const i=this.getViewCachedVisibleSize(e),n=typeof i>"u"?this.getViewSize(e):Xk.Invisible(i),r=this.removeView(e);this.addView(r,n,t)}swapViews(e,t){if(this.state!==Wh.Idle)throw new Error("Cant modify splitview");if(e>t)return this.swapViews(t,e);const i=this.getViewSize(e),n=this.getViewSize(t),r=this.removeView(t),o=this.removeView(e);this.addView(r,i,e),this.addView(o,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 r=0;r0&&(o.size=Qa(Math.round(a*e/n),o.minimumSize,o.maximumSize))}}else{const n=xu(this.viewItems.length),r=n.filter(a=>this.viewItems[a].priority===pw.Low),o=n.filter(a=>this.viewItems[a].priority===pw.High);this.resize(this.viewItems.length-1,e-i,void 0,r,o)}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),r=Yo(ue(this.el.ownerDocument.body,"keydown",a=>o(this.sashDragState.current,a.altKey)),ue(this.el.ownerDocument.body,"keyup",()=>o(this.sashDragState.current,!1))),o=(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=xu(n,-1),m=xu(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:r}};o(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:r,minDelta:o,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,o,a,c,l);if(r){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=Qa(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!==Wh.Idle)throw new Error("Cant modify splitview");this.state=Wh.Busy;try{const i=xu(this.viewItems.length).filter(a=>a!==e),n=[...i.filter(a=>this.viewItems[a].priority===pw.Low),e],r=i.filter(a=>this.viewItems[a].priority===pw.High),o=this.viewItems[e];t=Math.round(t),t=Qa(t,o.minimumSize,Math.min(o.maximumSize,this.size)),o.size=t,this.relayout(n,r)}finally{this.state=Wh.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=Qa(i,a.minimumSize,a.maximumSize);const n=xu(this.viewItems.length),r=n.filter(a=>this.viewItems[a].priority===pw.Low),o=n.filter(a=>this.viewItems[a].priority===pw.High);this.relayout(r,o)}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!==Wh.Idle)throw new Error("Cant modify splitview");this.state=Wh.Busy;try{const r=fe(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(r):this.viewContainer.insertBefore(r,this.viewContainer.children.item(i));const o=e.onDidChange(u=>this.onViewChange(d,u)),a=Ee(()=>r.remove()),c=Yo(o,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===pi.VERTICAL?new ZDt(r,e,l,c):new ekt(r,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===pi.VERTICAL?new Wd(this.sashContainer,{getHorizontalSashTop:P=>this.getSashPosition(P),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:pi.HORIZONTAL}):new Wd(this.sashContainer,{getVerticalSashLeft:P=>this.getSashPosition(P),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:pi.VERTICAL}),p=this.orientation===pi.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=xu(P,-1),z=xu(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=Yo(v,w,C,A,f),k={sash:f,disposable:L};this.sashItems.splice(i-1,0,k)}r.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=Wh.Idle}}relayout(e,t){const i=this.viewItems.reduce((n,r)=>n+r.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,r,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,c,l){if(e<0||e>=this.viewItems.length)return 0;const d=xu(e,-1),h=xu(e+1,this.viewItems.length);if(r)for(const k of r)Nde(d,k),Nde(h,k);if(n)for(const k of n)TG(d,k),TG(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,o),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=xu(this.viewItems.length-1,-1),r=n.filter(a=>this.viewItems[a].priority===pw.Low),o=n.filter(a=>this.viewItems[a].priority===pw.High);for(const a of o)Nde(n,a);for(const a of r)TG(n,a);typeof e=="number"&&TG(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===pi.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 r=n.map(c=>e=c.size-c.minimumSize>0||e).reverse();e=!1;const o=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(),wt(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}var tkt='.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}';gt(tkt,{});const Rse=class Rse{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=Rse.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(r=>[r.templateId,r]));this.renderers=[];for(const r of e){const o=n.get(r.templateId);if(!o)throw new Error(`Table cell renderer for template id ${r.templateId} not found.`);this.renderers.push(o)}}renderTemplate(e){const t=oe(e,fe(".monaco-table-tr")),i=[],n=[];for(let o=0;othis.disposables.add(new nkt(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 T3(this.domNode,{orientation:pi.HORIZONTAL,scrollbarVisibility:Cr.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 vJ(n,r,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Za(e,this.domNode,ikt(i),[l],o)),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=fl(this.domNode),this.style(Sxt)}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??PTe(this.domNode),t=t??a5(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()}};Mse.InstanceCount=0;let q_e=Mse;var Qs;(function(s){s[s.Hidden=0]="Hidden",s[s.Visible=1]="Visible",s[s.Recurse=2]="Recurse"})(Qs||(Qs={}));var Of;(function(s){s[s.Expanded=0]="Expanded",s[s.Collapsed=1]="Collapsed",s[s.PreserveOrExpanded=2]="PreserveOrExpanded",s[s.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Of||(Of={}));var B1;(function(s){s[s.Unknown=0]="Unknown",s[s.Twistie=1]="Twistie",s[s.Element=2]="Element",s[s.Filter=3]="Filter"})(B1||(B1={}));var W1;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(W1||(W1={}));class td extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class yRe{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 CRe(s){return typeof s=="object"&&"visibility"in s&&"data"in s}function L3(s){switch(s){case!0:return Qs.Visible;case!1:return Qs.Hidden;default:return s}}function Yhe(s){return typeof s.collapsible=="boolean"}class skt{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Q7,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 Ph(YKe),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=ui.empty(),n={}){if(e.length===0)throw new td(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=ui.empty(),r,o=r.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,r);const c=[...n],l=t[t.length-1],d=new Kw({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,r);const h=t.slice(0,-1),u=(m,v,b)=>{if(o>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,ui.slice(c,p,p+m.modifiedLength),r);u(f,p,f)}spliceSimple(e,t,i=ui.empty(),{onDidCreateNode:n,onDidDeleteNode:r,diffIdentityProvider:o}){const{parentNode:a,listIndex:c,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=ui.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&&Ao.getId(A.element).toString())):a.lastDiffIds=a.children.map(A=>o.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&&r){const A=L=>{r(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 td(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 td(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 r={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:r}=this.getTreeNodeWithListIndex(e),o=this._setListNodeCollapseState(i,n,r,t);if(i!==this.root&&this.autoExpandSingleChildren&&o&&!Yhe(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 o}_setListNodeCollapseState(e,t,i,n){const r=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!r)return r;const o=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),c=o-(t===-1?0:1);return this.list.splice(t+1,c,a.slice(1)),r}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(Yhe(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})),!Yhe(t)&&t.recursive)for(const r of e.children)n=this._setNodeCollapseState(r,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,r,o){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&&r.push(a);const l=e.children||ui.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,r,o);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&&r.pop()),o?.(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 r;if(e!==this.root){if(r=this._filterNode(e,t),r===Qs.Hidden)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const o=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||r!==Qs.Hidden){let c=0;for(const l of e.children)a=this._updateNodeAfterFilterChange(l,r,i,n&&!e.collapsed)||a,l.visible&&(l.visibleChildIndex=c++);e.visibleChildrenCount=c}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=r===Qs.Recurse?a:r===Qs.Visible,e.visibility=r),e.visible?e.collapsed||(e.renderNodeCount+=i.length-o):(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):CRe(i)?(e.filterData=i.data,L3(i.visibility)):(e.filterData=void 0,L3(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 td(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:r}=this.getParentNodeWithListIndex(e),o=e[e.length-1];if(o<0||o>t.children.length)throw new td(this.user,"Invalid tree location");const a=t.children[o];return{node:a,listIndex:i,revealed:n,visible:r&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,r=!0){const[o,...a]=e;if(o<0||o>t.children.length)throw new td(this.user,"Invalid tree location");for(let c=0;ct.element)),this.data=e}}function Jhe(s){return s instanceof k6?new okt(s):s}class akt{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?.(Jhe(e),t)}onDragOver(e,t,i,n,r,o=!0){const a=this.dnd.onDragOver(Jhe(e),t&&t.element,i,n,r),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=Zy(()=>{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(!o){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===W1.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,r,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),h=l.getListIndex(d),u=l.getListRenderCount(d);return{...a,feedback:xu(h,h+u)}}drop(e,t,i,n,r){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(Jhe(e),t&&t.element,i,n,r)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function ckt(s,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new akt(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),r=i.getParentNodeLocation(n);return i.getNode(r).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 SRe{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 N5{static lift(e){return e instanceof N5?e:new N5(e)}static empty(e=0){return new N5({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 hW;(function(s){s.None="none",s.OnHover="onHover",s.Always="always"})(hW||(hW={}));class lkt{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 Qz=class Qz{constructor(e,t,i,n,r,o={}){this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=r,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Qz.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(o),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=qa(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!==hW.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=oe(e,fe(".monaco-tl-row")),i=oe(t,fe(".monaco-tl-indent")),n=oe(t,fe(".monaco-tl-twistie")),r=oe(t,fe(".monaco-tl-contents")),o=this.renderer.renderTemplate(r);return{container:e,indent:i,twistie:n,indentGuidesDisposable:V.None,templateData:o}}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=Qz.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(...He.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(...He.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(Ns(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Z,n=this.modelProvider();for(;;){const r=n.getNodeLocation(e),o=n.getParentNodeLocation(r);if(!o)break;const a=n.getNode(o),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 r=i.getNodeLocation(n);try{const o=i.getParentNodeLocation(r);n.collapsible&&n.children.length>0&&!n.collapsed?t.add(n):o&&t.add(i.getNode(o))}catch{}}),this.activeIndentNodes.forEach(n=>{t.has(n)||this.renderedIndentGuides.forEach(n,r=>r.classList.remove("active"))}),t.forEach(n=>{this.activeIndentNodes.has(n)||this.renderedIndentGuides.forEach(n,r=>r.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),wt(this.disposables)}};Qz.DefaultIndent=8;let Q_e=Qz;class dkt{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 o=this._filter.filter(e,t);if(typeof o=="boolean"?i=o?Qs.Visible:Qs.Hidden:CRe(o)?i=L3(o.visibility):i=o,i===Qs.Hidden)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:O_.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),r=Array.isArray(n)?n:[n];for(const o of r){const a=o&&o.toString();if(typeof a>"u")return{data:O_.Default,visibility:i};let c;if(this.tree.findMatchType===Sb.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=qk(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(c)return this._matchCount++,r.length===1?{data:c,visibility:i}:{data:{label:a,score:c},visibility:i}}return this.tree.findMode===ip.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):Qs.Recurse:{data:O_.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){wt(this.disposables)}}class hkt extends sE{constructor(e){super({icon:ve.listFilter,title:g(4961,"Filter"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class ukt extends sE{constructor(e){super({icon:ve.searchFuzzy,title:g(4962,"Fuzzy Match"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const gkt={inputBoxStyles:FDt,toggleStyles:fJe,listFilterWidgetBackground:void 0,listFilterWidgetNoMatchesOutline:void 0,listFilterWidgetOutline:void 0,listFilterWidgetShadow:void 0};var ip;(function(s){s[s.Highlight=0]="Highlight",s[s.Filter=1]="Filter"})(ip||(ip={}));var Sb;(function(s){s[s.Fuzzy=0]="Fuzzy",s[s.Contiguous=1]="Contiguous"})(Sb||(Sb={}));let fkt=class extends V{set mode(e){this.modeToggle.checked=e===ip.Filter,this.findInput.inputBox.setPlaceHolder(e===ip.Filter?g(4963,"Type to filter"):g(4964,"Type to search"))}set matchType(e){this.matchTypeToggle.checked=e===Sb.Fuzzy}get value(){return this.findInput.inputBox.value}set value(e){this.findInput.inputBox.value=e}constructor(e,t,i,n,r,o){super(),this.tree=t,this.elements=Wt(".monaco-tree-type-filter",[Wt(".monaco-tree-type-filter-grab.codicon.codicon-debug-gripper@grab",{tabIndex:0}),Wt(".monaco-tree-type-filter-input@findInput"),Wt(".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=o?.styles??gkt;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(Yk());this.modeToggle=this._register(new hkt({...a.toggleStyles,isChecked:n===ip.Filter,hoverDelegate:c})),this.matchTypeToggle=this._register(new ukt({...a.toggleStyles,isChecked:r===Sb.Fuzzy,hoverDelegate:c})),this.onDidChangeMode=M.map(this.modeToggle.onChange,()=>this.modeToggle.checked?ip.Filter:ip.Highlight,this._store),this.onDidChangeMatchType=M.map(this.matchTypeToggle.onChange,()=>this.matchTypeToggle.checked?Sb.Fuzzy:Sb.Contiguous,this._store),this.findInput=this._register(new D3(this.elements.findInput,i,{label:g(4964,"Type to search"),additionalToggles:[this.modeToggle,this.matchTypeToggle],showCommonFindToggles:!1,inputBoxStyles:a.inputBoxStyles,toggleStyles:a.toggleStyles,history:o?.history})),this.actionbar=this._register(new gd(this.elements.actionbar)),this.mode=n;const l=this._register(new ni(this.findInput.inputBox.inputElement,"keydown")),d=M.chain(l.event,p=>p.map(m=>new xn(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 an("close",g(4965,"Close"),"codicon codicon-close",!0,()=>this.dispose()));this.actionbar.push(h,{icon:!0,label:!1});const u=this._register(new ni(this.elements.grab,"mousedown"));this._register(u.event(p=>{const m=new Z,v=m.add(new ni(lt(p),"mousemove")),b=m.add(new ni(lt(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 ni(this.elements.grab,"keydown")).event,p=>p.map(m=>new xn(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=qa(this.right,0,Math.max(0,e-212)),this.elements.root.style.right=`${this.right}px`,this.top=qa(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 Ao(300),super.dispose()}},pkt=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,r,o={}){this.tree=e,this.view=i,this.filter=n,this.contextViewProvider=r,this.options=o,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??ip.Highlight,this._matchType=e.options.defaultFindMatchType??Sb.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 fkt(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=>!O_.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:ed.WARNING,content:g(4966,"No elements found.")}):this.widget?.showMessage({type:ed.WARNING}):this.widget?.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!O_.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 mkt(s,e){return s.position===e.position&&AJe(s,e)}function AJe(s,e){return s.node.element===e.node.element&&s.startIndex===e.startIndex&&s.height===e.height&&s.endIndex===e.endIndex}class _kt{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return ns(this.stickyNodes,e.stickyNodes,mkt)}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(!ns(this.stickyNodes,e.stickyNodes,AJe)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class vkt{constrainStickyScrollNodes(e,t,i){for(let n=0;ni||n>=t)return e.slice(0,n)}return e}}let xWe=class extends V{constructor(e,t,i,n,r,o={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=r,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(o);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=o.stickyScrollDelegate??new vkt,this._widget=this._register(new bkt(i.getScrollableElement(),i,e,n,r,o.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,r=this.getNextStickyNode(i,void 0,n);for(;r&&(t.push(r),n+=r.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(r),!i)));)r=this.getNextStickyNode(i,r.node,n);const o=this.constrainStickyNodes(t);return o.length?new _kt(o):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),r=t;return this.view.scrollTop===n-r}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:r}=this.getNodeRange(e),o=this.calculateStickyNodePosition(r,t,i);return{node:e,position:o,height:i,startIndex:n,endIndex:r}}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 r=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||r.position+r.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),r=i+n-1;return{startIndex:i,endIndex:r}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let r=0;rt.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 r=Array(e.count);for(let o=e.count-1;o>=0;o--){const a=e.stickyNodes[o],{element:c,disposable:l}=this.createElement(a,o,e.count);r[o]=c,this._rootDomNode.appendChild(c),this._previousStateDisposables.add(l)}this.stickyScrollFocus.updateElements(r,e),this._previousElements=r}this._previousState=e,this._rootDomNode.style.height=`${n.position+n.height}px`}createElement(e,t,i){const n=e.startIndex,r=document.createElement("div");r.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(r.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(r.style.lineHeight=`${e.height}px`),r.classList.add("monaco-tree-sticky-row"),r.classList.add("monaco-list-row"),r.setAttribute("data-index",`${n}`),r.setAttribute("data-parity",n%2===0?"even":"odd"),r.setAttribute("id",this.view.getElementID(n));const o=this.setAccessibilityAttributes(r,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(r);c.renderElement(l,e.startIndex,d,e.height);const h=Ee(()=>{o.dispose(),c.disposeElement(l,e.startIndex,d,e.height),c.disposeTemplate(d),r.remove()});return{element:r,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 r=this.accessibilityProvider.getAriaLabel(t),o=r&&typeof r!="string"?r:rd(r),a=ci(l=>{const d=l.readObservable(o);d?e.setAttribute("aria-label",d):e.removeAttribute("aria-label")});typeof r=="string"||r&&e.setAttribute("aria-label",r.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 wkt 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(!A3(t)&&!L5(t)){this.focusedLast()&&this.view.domFocus();return}if(!g_(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const o=this.state.stickyNodes.findIndex(a=>a.node.element===e.element?.element);if(o===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(o);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,r=this.elements[this.focusedIndex];this._onContextMenu.fire({element:n,anchor:r,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;!A3(t)&&!L5(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=qa(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,r=this.view.getElementTop(e),o=n?n.position+n.height+i.height:i.height;this.view.scrollTop=r-o}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 bP(s){let e=B1.Unknown;return kq(s.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=B1.Twistie:kq(s.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=B1.Element:kq(s.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=B1.Filter),{browserEvent:s.browserEvent,element:s.element?s.element.element:null,target:e}}function ykt(s){const e=A3(s.browserEvent.target);return{element:s.element?s.element.element:null,browserEvent:s.browserEvent,anchor:s.anchor,isStickyScroll:e}}function tQ(s,e){e(s),s.children.forEach(t=>tQ(t,e))}class Xhe{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&&ns(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=>tQ(d,l)),this.set([...c.values()]);return}const i=new Set,n=c=>i.add(this.identityProvider.getId(c.element).toString());t.forEach(c=>tQ(c,n));const r=new Map,o=c=>r.set(this.identityProvider.getId(c.element).toString(),c);e.forEach(c=>tQ(c,o));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=r.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 Ckt extends tJe{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(XYe(e.browserEvent.target)||aA(e.browserEvent.target)||pV(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,r=L5(e.browserEvent.target);let o=!1;if(r?o=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,r)this.handleStickyScrollMouseEvent(e,t);else{if(o&&!n&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!r||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}}r||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(_xt(e.browserEvent.target)||vxt(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),r=this.list.getElementTop(n),o=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=r-o,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(!A3(t)&&!L5(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!A3(t)&&!L5(t)){super.onContextMenu(e);return}}}class Skt extends Za{constructor(e,t,i,n,r,o,a,c){super(e,t,i,n,c),this.focusTrait=r,this.selectionTrait=o,this.anchorTrait=a}createMouseController(e){return new Ckt(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const n=[],r=[];let o;i.forEach((a,c)=>{this.focusTrait.has(a)&&n.push(e+c),this.selectionTrait.has(a)&&r.push(e+c),this.anchorTrait.has(a)&&(o=e+c)}),n.length>0&&super.setFocus(Ya([...super.getFocus(),...n])),r.length>0&&super.setSelection(Ya([...super.getSelection(),...r])),typeof o=="number"&&super.setAnchor(o)}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 uW;(function(s){s[s.Tree=0]="Tree",s[s.StickyScroll=1]="StickyScroll"})(uW||(uW={}));class EJe{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,bP)}get onMouseDblClick(){return M.filter(M.map(this.view.onMouseDblClick,bP),e=>e.target!==B1.Filter)}get onMouseOver(){return M.map(this.view.onMouseOver,bP)}get onMouseOut(){return M.map(this.view.onMouseOut,bP)}get onContextMenu(){return M.any(M.filter(M.map(this.view.onContextMenu,ykt),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??M.None)}get onTap(){return M.map(this.view.onTap,bP)}get onPointer(){return M.map(this.view.onPointer,bP)}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??ip.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){return this.findController?.matchType??Sb.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,r={}){this._user=e,this._options=r,this.eventBufferer=new Q7,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 SRe(i);const o=new vfe,a=new vfe,c=this.disposables.add(new lkt(a.event)),l=new q7;this.renderers=n.map(p=>new Q_e(p,()=>this.model,o.event,c,l,r));for(const p of this.renderers)this.disposables.add(p);let d;r.keyboardNavigationLabelProvider&&(d=new dkt(this,r.keyboardNavigationLabelProvider,r.filter),r={...r,filter:d},this.disposables.add(d)),this.focus=new Xhe(()=>this.view.getFocusedElements()[0],r.identityProvider),this.selection=new Xhe(()=>this.view.getSelectedElements()[0],r.identityProvider),this.anchor=new Xhe(()=>this.view.getAnchorElement(),r.identityProvider),this.view=new Skt(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...ckt(()=>this.model,r),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,r),o.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 Ph(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,r.keyboardSupport!==!1){const p=M.chain(this.view.onKeyDown,m=>m.filter(v=>!aA(v.target)).map(v=>new xn(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((r.findWidgetEnabled??!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider){const p=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new pkt(this,this.model,this.view,d,r.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;r.enableStickyScroll&&(this.stickyScrollController=new xWe(this,this.model,this.view,this.renderers,this.treeDelegate,r),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=fl(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===hW.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===hW.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new xWe(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 dv(this.getHTMLElement())}layout(e,t){this.view.layout(e,t),dc(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 r=My(e.listFocusAndSelectionOutline,My(e.listSelectionOutline,e.listFocusOutline??""));r&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; 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.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()}};Mse.InstanceCount=0;let q_e=Mse;var Qs;(function(s){s[s.Hidden=0]="Hidden",s[s.Visible=1]="Visible",s[s.Recurse=2]="Recurse"})(Qs||(Qs={}));var Of;(function(s){s[s.Expanded=0]="Expanded",s[s.Collapsed=1]="Collapsed",s[s.PreserveOrExpanded=2]="PreserveOrExpanded",s[s.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Of||(Of={}));var B1;(function(s){s[s.Unknown=0]="Unknown",s[s.Twistie=1]="Twistie",s[s.Element=2]="Element",s[s.Filter=3]="Filter"})(B1||(B1={}));var W1;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(W1||(W1={}));class td extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class yRe{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 CRe(s){return typeof s=="object"&&"visibility"in s&&"data"in s}function L3(s){switch(s){case!0:return Qs.Visible;case!1:return Qs.Hidden;default:return s}}function Yhe(s){return typeof s.collapsible=="boolean"}class skt{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Q7,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 Ph(YKe),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=ui.empty(),n={}){if(e.length===0)throw new td(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=ui.empty(),r,o=r.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,r);const c=[...n],l=t[t.length-1],d=new Kw({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,r);const h=t.slice(0,-1),u=(m,v,b)=>{if(o>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,ui.slice(c,p,p+m.modifiedLength),r);u(f,p,f)}spliceSimple(e,t,i=ui.empty(),{onDidCreateNode:n,onDidDeleteNode:r,diffIdentityProvider:o}){const{parentNode:a,listIndex:c,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=ui.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&&Ao.getId(A.element).toString())):a.lastDiffIds=a.children.map(A=>o.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&&r){const A=L=>{r(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 td(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 td(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 r={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:r}=this.getTreeNodeWithListIndex(e),o=this._setListNodeCollapseState(i,n,r,t);if(i!==this.root&&this.autoExpandSingleChildren&&o&&!Yhe(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 o}_setListNodeCollapseState(e,t,i,n){const r=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!r)return r;const o=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),c=o-(t===-1?0:1);return this.list.splice(t+1,c,a.slice(1)),r}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(Yhe(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})),!Yhe(t)&&t.recursive)for(const r of e.children)n=this._setNodeCollapseState(r,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,r,o){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&&r.push(a);const l=e.children||ui.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,r,o);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&&r.pop()),o?.(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 r;if(e!==this.root){if(r=this._filterNode(e,t),r===Qs.Hidden)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const o=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||r!==Qs.Hidden){let c=0;for(const l of e.children)a=this._updateNodeAfterFilterChange(l,r,i,n&&!e.collapsed)||a,l.visible&&(l.visibleChildIndex=c++);e.visibleChildrenCount=c}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=r===Qs.Recurse?a:r===Qs.Visible,e.visibility=r),e.visible?e.collapsed||(e.renderNodeCount+=i.length-o):(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):CRe(i)?(e.filterData=i.data,L3(i.visibility)):(e.filterData=void 0,L3(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 td(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:r}=this.getParentNodeWithListIndex(e),o=e[e.length-1];if(o<0||o>t.children.length)throw new td(this.user,"Invalid tree location");const a=t.children[o];return{node:a,listIndex:i,revealed:n,visible:r&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,r=!0){const[o,...a]=e;if(o<0||o>t.children.length)throw new td(this.user,"Invalid tree location");for(let c=0;ct.element)),this.data=e}}function Jhe(s){return s instanceof k6?new okt(s):s}class akt{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?.(Jhe(e),t)}onDragOver(e,t,i,n,r,o=!0){const a=this.dnd.onDragOver(Jhe(e),t&&t.element,i,n,r),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=Zy(()=>{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(!o){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===W1.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,r,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),h=l.getListIndex(d),u=l.getListRenderCount(d);return{...a,feedback:xu(h,h+u)}}drop(e,t,i,n,r){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(Jhe(e),t&&t.element,i,n,r)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function ckt(s,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new akt(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),r=i.getParentNodeLocation(n);return i.getNode(r).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 SRe{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 N5{static lift(e){return e instanceof N5?e:new N5(e)}static empty(e=0){return new N5({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 hW;(function(s){s.None="none",s.OnHover="onHover",s.Always="always"})(hW||(hW={}));class lkt{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 Qz=class Qz{constructor(e,t,i,n,r,o={}){this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=r,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Qz.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(o),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=Qa(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!==hW.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=oe(e,fe(".monaco-tl-row")),i=oe(t,fe(".monaco-tl-indent")),n=oe(t,fe(".monaco-tl-twistie")),r=oe(t,fe(".monaco-tl-contents")),o=this.renderer.renderTemplate(r);return{container:e,indent:i,twistie:n,indentGuidesDisposable:V.None,templateData:o}}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=Qz.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(...He.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(...He.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(Ns(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Z,n=this.modelProvider();for(;;){const r=n.getNodeLocation(e),o=n.getParentNodeLocation(r);if(!o)break;const a=n.getNode(o),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 r=i.getNodeLocation(n);try{const o=i.getParentNodeLocation(r);n.collapsible&&n.children.length>0&&!n.collapsed?t.add(n):o&&t.add(i.getNode(o))}catch{}}),this.activeIndentNodes.forEach(n=>{t.has(n)||this.renderedIndentGuides.forEach(n,r=>r.classList.remove("active"))}),t.forEach(n=>{this.activeIndentNodes.has(n)||this.renderedIndentGuides.forEach(n,r=>r.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),wt(this.disposables)}};Qz.DefaultIndent=8;let Q_e=Qz;class dkt{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 o=this._filter.filter(e,t);if(typeof o=="boolean"?i=o?Qs.Visible:Qs.Hidden:CRe(o)?i=L3(o.visibility):i=o,i===Qs.Hidden)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:O_.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),r=Array.isArray(n)?n:[n];for(const o of r){const a=o&&o.toString();if(typeof a>"u")return{data:O_.Default,visibility:i};let c;if(this.tree.findMatchType===Sb.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=qk(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(c)return this._matchCount++,r.length===1?{data:c,visibility:i}:{data:{label:a,score:c},visibility:i}}return this.tree.findMode===ip.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):Qs.Recurse:{data:O_.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){wt(this.disposables)}}class hkt extends sE{constructor(e){super({icon:ve.listFilter,title:g(4961,"Filter"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class ukt extends sE{constructor(e){super({icon:ve.searchFuzzy,title:g(4962,"Fuzzy Match"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const gkt={inputBoxStyles:FDt,toggleStyles:fJe,listFilterWidgetBackground:void 0,listFilterWidgetNoMatchesOutline:void 0,listFilterWidgetOutline:void 0,listFilterWidgetShadow:void 0};var ip;(function(s){s[s.Highlight=0]="Highlight",s[s.Filter=1]="Filter"})(ip||(ip={}));var Sb;(function(s){s[s.Fuzzy=0]="Fuzzy",s[s.Contiguous=1]="Contiguous"})(Sb||(Sb={}));let fkt=class extends V{set mode(e){this.modeToggle.checked=e===ip.Filter,this.findInput.inputBox.setPlaceHolder(e===ip.Filter?g(4963,"Type to filter"):g(4964,"Type to search"))}set matchType(e){this.matchTypeToggle.checked=e===Sb.Fuzzy}get value(){return this.findInput.inputBox.value}set value(e){this.findInput.inputBox.value=e}constructor(e,t,i,n,r,o){super(),this.tree=t,this.elements=Wt(".monaco-tree-type-filter",[Wt(".monaco-tree-type-filter-grab.codicon.codicon-debug-gripper@grab",{tabIndex:0}),Wt(".monaco-tree-type-filter-input@findInput"),Wt(".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=o?.styles??gkt;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(Yk());this.modeToggle=this._register(new hkt({...a.toggleStyles,isChecked:n===ip.Filter,hoverDelegate:c})),this.matchTypeToggle=this._register(new ukt({...a.toggleStyles,isChecked:r===Sb.Fuzzy,hoverDelegate:c})),this.onDidChangeMode=M.map(this.modeToggle.onChange,()=>this.modeToggle.checked?ip.Filter:ip.Highlight,this._store),this.onDidChangeMatchType=M.map(this.matchTypeToggle.onChange,()=>this.matchTypeToggle.checked?Sb.Fuzzy:Sb.Contiguous,this._store),this.findInput=this._register(new D3(this.elements.findInput,i,{label:g(4964,"Type to search"),additionalToggles:[this.modeToggle,this.matchTypeToggle],showCommonFindToggles:!1,inputBoxStyles:a.inputBoxStyles,toggleStyles:a.toggleStyles,history:o?.history})),this.actionbar=this._register(new gd(this.elements.actionbar)),this.mode=n;const l=this._register(new ni(this.findInput.inputBox.inputElement,"keydown")),d=M.chain(l.event,p=>p.map(m=>new xn(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 an("close",g(4965,"Close"),"codicon codicon-close",!0,()=>this.dispose()));this.actionbar.push(h,{icon:!0,label:!1});const u=this._register(new ni(this.elements.grab,"mousedown"));this._register(u.event(p=>{const m=new Z,v=m.add(new ni(lt(p),"mousemove")),b=m.add(new ni(lt(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 ni(this.elements.grab,"keydown")).event,p=>p.map(m=>new xn(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=Qa(this.right,0,Math.max(0,e-212)),this.elements.root.style.right=`${this.right}px`,this.top=Qa(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 Ao(300),super.dispose()}},pkt=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,r,o={}){this.tree=e,this.view=i,this.filter=n,this.contextViewProvider=r,this.options=o,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??ip.Highlight,this._matchType=e.options.defaultFindMatchType??Sb.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 fkt(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=>!O_.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:ed.WARNING,content:g(4966,"No elements found.")}):this.widget?.showMessage({type:ed.WARNING}):this.widget?.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!O_.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 mkt(s,e){return s.position===e.position&&AJe(s,e)}function AJe(s,e){return s.node.element===e.node.element&&s.startIndex===e.startIndex&&s.height===e.height&&s.endIndex===e.endIndex}class _kt{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return ns(this.stickyNodes,e.stickyNodes,mkt)}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(!ns(this.stickyNodes,e.stickyNodes,AJe)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class vkt{constrainStickyScrollNodes(e,t,i){for(let n=0;ni||n>=t)return e.slice(0,n)}return e}}let xWe=class extends V{constructor(e,t,i,n,r,o={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=r,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(o);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=o.stickyScrollDelegate??new vkt,this._widget=this._register(new bkt(i.getScrollableElement(),i,e,n,r,o.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,r=this.getNextStickyNode(i,void 0,n);for(;r&&(t.push(r),n+=r.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(r),!i)));)r=this.getNextStickyNode(i,r.node,n);const o=this.constrainStickyNodes(t);return o.length?new _kt(o):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),r=t;return this.view.scrollTop===n-r}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:r}=this.getNodeRange(e),o=this.calculateStickyNodePosition(r,t,i);return{node:e,position:o,height:i,startIndex:n,endIndex:r}}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 r=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||r.position+r.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),r=i+n-1;return{startIndex:i,endIndex:r}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let r=0;rt.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 r=Array(e.count);for(let o=e.count-1;o>=0;o--){const a=e.stickyNodes[o],{element:c,disposable:l}=this.createElement(a,o,e.count);r[o]=c,this._rootDomNode.appendChild(c),this._previousStateDisposables.add(l)}this.stickyScrollFocus.updateElements(r,e),this._previousElements=r}this._previousState=e,this._rootDomNode.style.height=`${n.position+n.height}px`}createElement(e,t,i){const n=e.startIndex,r=document.createElement("div");r.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(r.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(r.style.lineHeight=`${e.height}px`),r.classList.add("monaco-tree-sticky-row"),r.classList.add("monaco-list-row"),r.setAttribute("data-index",`${n}`),r.setAttribute("data-parity",n%2===0?"even":"odd"),r.setAttribute("id",this.view.getElementID(n));const o=this.setAccessibilityAttributes(r,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(r);c.renderElement(l,e.startIndex,d,e.height);const h=Ee(()=>{o.dispose(),c.disposeElement(l,e.startIndex,d,e.height),c.disposeTemplate(d),r.remove()});return{element:r,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 r=this.accessibilityProvider.getAriaLabel(t),o=r&&typeof r!="string"?r:rd(r),a=ci(l=>{const d=l.readObservable(o);d?e.setAttribute("aria-label",d):e.removeAttribute("aria-label")});typeof r=="string"||r&&e.setAttribute("aria-label",r.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 wkt 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(!A3(t)&&!L5(t)){this.focusedLast()&&this.view.domFocus();return}if(!g_(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const o=this.state.stickyNodes.findIndex(a=>a.node.element===e.element?.element);if(o===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(o);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,r=this.elements[this.focusedIndex];this._onContextMenu.fire({element:n,anchor:r,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;!A3(t)&&!L5(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=Qa(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,r=this.view.getElementTop(e),o=n?n.position+n.height+i.height:i.height;this.view.scrollTop=r-o}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 bP(s){let e=B1.Unknown;return kq(s.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=B1.Twistie:kq(s.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=B1.Element:kq(s.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=B1.Filter),{browserEvent:s.browserEvent,element:s.element?s.element.element:null,target:e}}function ykt(s){const e=A3(s.browserEvent.target);return{element:s.element?s.element.element:null,browserEvent:s.browserEvent,anchor:s.anchor,isStickyScroll:e}}function tQ(s,e){e(s),s.children.forEach(t=>tQ(t,e))}class Xhe{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&&ns(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=>tQ(d,l)),this.set([...c.values()]);return}const i=new Set,n=c=>i.add(this.identityProvider.getId(c.element).toString());t.forEach(c=>tQ(c,n));const r=new Map,o=c=>r.set(this.identityProvider.getId(c.element).toString(),c);e.forEach(c=>tQ(c,o));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=r.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 Ckt extends tJe{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(XYe(e.browserEvent.target)||aA(e.browserEvent.target)||pV(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,r=L5(e.browserEvent.target);let o=!1;if(r?o=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,r)this.handleStickyScrollMouseEvent(e,t);else{if(o&&!n&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!r||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}}r||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(_xt(e.browserEvent.target)||vxt(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),r=this.list.getElementTop(n),o=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=r-o,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(!A3(t)&&!L5(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!A3(t)&&!L5(t)){super.onContextMenu(e);return}}}class Skt extends Za{constructor(e,t,i,n,r,o,a,c){super(e,t,i,n,c),this.focusTrait=r,this.selectionTrait=o,this.anchorTrait=a}createMouseController(e){return new Ckt(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const n=[],r=[];let o;i.forEach((a,c)=>{this.focusTrait.has(a)&&n.push(e+c),this.selectionTrait.has(a)&&r.push(e+c),this.anchorTrait.has(a)&&(o=e+c)}),n.length>0&&super.setFocus(Ya([...super.getFocus(),...n])),r.length>0&&super.setSelection(Ya([...super.getSelection(),...r])),typeof o=="number"&&super.setAnchor(o)}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 uW;(function(s){s[s.Tree=0]="Tree",s[s.StickyScroll=1]="StickyScroll"})(uW||(uW={}));class EJe{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,bP)}get onMouseDblClick(){return M.filter(M.map(this.view.onMouseDblClick,bP),e=>e.target!==B1.Filter)}get onMouseOver(){return M.map(this.view.onMouseOver,bP)}get onMouseOut(){return M.map(this.view.onMouseOut,bP)}get onContextMenu(){return M.any(M.filter(M.map(this.view.onContextMenu,ykt),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??M.None)}get onTap(){return M.map(this.view.onTap,bP)}get onPointer(){return M.map(this.view.onPointer,bP)}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??ip.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){return this.findController?.matchType??Sb.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,r={}){this._user=e,this._options=r,this.eventBufferer=new Q7,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 SRe(i);const o=new vfe,a=new vfe,c=this.disposables.add(new lkt(a.event)),l=new q7;this.renderers=n.map(p=>new Q_e(p,()=>this.model,o.event,c,l,r));for(const p of this.renderers)this.disposables.add(p);let d;r.keyboardNavigationLabelProvider&&(d=new dkt(this,r.keyboardNavigationLabelProvider,r.filter),r={...r,filter:d},this.disposables.add(d)),this.focus=new Xhe(()=>this.view.getFocusedElements()[0],r.identityProvider),this.selection=new Xhe(()=>this.view.getSelectedElements()[0],r.identityProvider),this.anchor=new Xhe(()=>this.view.getAnchorElement(),r.identityProvider),this.view=new Skt(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...ckt(()=>this.model,r),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,r),o.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 Ph(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,r.keyboardSupport!==!1){const p=M.chain(this.view.onKeyDown,m=>m.filter(v=>!aA(v.target)).map(v=>new xn(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((r.findWidgetEnabled??!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider){const p=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new pkt(this,this.model,this.view,d,r.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;r.enableStickyScroll&&(this.stickyScrollController=new xWe(this,this.model,this.view,this.renderers,this.treeDelegate,r),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=fl(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===hW.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===hW.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new xWe(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 dv(this.getHTMLElement())}layout(e,t){this.view.layout(e,t),dc(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 r=My(e.listFocusAndSelectionOutline,My(e.listSelectionOutline,e.listFocusOutline??""));r&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; 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 um(this.anchor.get(),void 0)}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(r=>this.model.getNode(r));this.selection.set(i,t);const n=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(r=>this.model.getNode(r));this.focus.set(i,t);const n=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=g_(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=g_(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=g_(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=g_(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=g_(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=g_(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()?uW.StickyScroll:uW.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 td(this._user,"Can't get tree view state without an identity provider");const t=o=>e.getId(o).toString(),i=N5.empty(this.scrollTop);for(const o of this.getFocus())i.focus.add(t(o));for(const o of this.getSelection())i.selection.add(t(o));const n=this.model.getNode(),r=[n];for(;r.length>0;){const o=r.shift();o!==n&&o.collapsible&&(i.expanded[t(o.element)]=o.collapsed?0:1),r.push(...o.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 o=this.model.getParentNodeLocation(n);if(!o)return;const a=this.model.getListIndex(o);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[o]=this.view.getFocus(),a=o+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),r=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,r)}navigate(e){return new Akt(this.view,this.model,e)}dispose(){wt(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose()}}class Akt{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 ARe{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 skt(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,r){return i.sorter.compare(n.element,r.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=ui.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=ui.empty(),i){const n=new Set,r=new Set,o=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();r.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();r.has(d)||this.nodesByIdentity.delete(d)}i.onDidDeleteNode?.(l)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:o,onDidDeleteNode:a})}preserveCollapseState(e=ui.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),ui.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const o=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(o)}if(!i){let o;return typeof t.collapsed>"u"?o=void 0:t.collapsed===Of.Collapsed||t.collapsed===Of.PreserveOrCollapsed?o=!0:t.collapsed===Of.Expanded||t.collapsed===Of.PreserveOrExpanded?o=!1:o=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:o}}const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let r;return typeof t.collapsed>"u"||t.collapsed===Of.PreserveOrCollapsed||t.collapsed===Of.PreserveOrExpanded?r=i.collapsed:t.collapsed===Of.Collapsed?r=!0:t.collapsed===Of.Expanded?r=!1:r=!!t.collapsed,{...t,collapsible:n,collapsed:r,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))),ui.map(n,r=>({element:r.element,collapsible:r.collapsible,collapsed:r.collapsed,children:this.resortChildren(r,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 td(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new td(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new td(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 td(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function iQ(s){const e=[s.element],t=s.incompressible||!1;return{element:{elements:e,incompressible:t},children:ui.map(ui.from(s.children),iQ),collapsible:s.collapsible,collapsed:s.collapsed}}function nQ(s){const e=[s.element],t=s.incompressible||!1;let i,n;for(;[n,i]=ui.consume(ui.from(s.children),2),!(n.length!==1||n[0].incompressible);)s=n[0],e.push(s.element);return{element:{elements:e,incompressible:t},children:ui.map(ui.concat(n,i),nQ),collapsible:s.collapsible,collapsed:s.collapsed}}function j_e(s,e=0){let t;return ej_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 DWe(s){return j_e(s,0)}function xJe(s,e,t){return s.element===e?{...s,children:t}:{...s,children:ui.map(ui.from(s.children),i=>xJe(i,e,t))}}const Ekt=s=>({getId(e){return e.elements.map(t=>s.getId(t).toString()).join("\0")}});class xkt{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 ARe(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=ui.empty(),i){const n=i.diffIdentityProvider&&Ekt(i.diffIdentityProvider);if(e===null){const p=ui.map(t,this.enabled?nQ:iQ);this._setChildren(null,p,{diffIdentityProvider:n,diffDepth:1/0});return}const r=this.nodes.get(e);if(!r)throw new td(this.user,"Unknown compressed tree node");const o=this.model.getNode(r),a=this.model.getParentNodeLocation(r),c=this.model.getNode(a),l=DWe(o),d=xJe(l,e,t),h=(this.enabled?nQ:iQ)(d),u=i.diffIdentityProvider?(p,m)=>i.diffIdentityProvider.getId(p)===i.diffIdentityProvider.getId(m):void 0;if(ns(h.element.elements,o.element.elements,u)){this._setChildren(r,h.children||ui.empty(),{diffIdentityProvider:n,diffDepth:1});return}const f=c.children.map(p=>p===o?h:p);this._setChildren(c.element,f,{diffIdentityProvider:n,diffDepth:o.depth-c.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,n=ui.map(i,DWe),r=ui.map(n,e?nQ:iQ);this._setChildren(null,r,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,r=a=>{for(const c of a.element.elements)n.add(c),this.nodes.set(c,a.element)},o=a=>{for(const c of a.element.elements)n.has(c)||this.nodes.delete(c)};this.model.setChildren(e,t,{...i,onDidCreateNode:r,onDidDeleteNode:o})}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 td(this.user,`Tree element not found: ${e}`);return t}}const Dkt=s=>s[s.length-1];class ERe{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new ERe(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 kkt(s,e){return{splice(t,i,n){e.splice(t,i,n.map(r=>s.map(r)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function Ikt(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 Tkt{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||Dkt;const n=r=>this.elementMapper(r.elements);this.nodeMapper=new yRe(r=>new ERe(n,r)),this.model=new xkt(e,kkt(this.nodeMapper,t),Ikt(n,i))}setChildren(e,t=ui.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 xRe extends EJe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,r={}){super(e,t,i,n,r),this.user=e}setChildren(e,t=ui.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 ARe(e,t,i)}}class Y_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 r=this.stickyScrollDelegate.getCompressedNode(e);r||(r=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),r.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=r,this.renderer.renderCompressedElements(r,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}}Y_e.__decorator=D([ei],Y_e.prototype,"compressedTreeNodeProvider",null);class Lkt{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 Lkt(()=>this.model),c=n.map(l=>new Y_e(o,a,l));super(e,t,i,c,{...Rkt(o,r),stickyScrollDelegate:a})}setChildren(e,t=ui.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new Tkt(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 Zhe(s){return{...s,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function J_e(s,e){return e.parent?e.parent===s?!0:J_e(s,e.parent):!1}function Mkt(s,e){return s===e||J_e(s,e)||J_e(e,s)}class DRe{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new DRe(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 Nkt{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(...He.asClassNameArray(ve.treeItemLoading)),!0):(t.classList.remove(...He.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 kWe(s){return{browserEvent:s.browserEvent,elements:s.elements.map(e=>e.element)}}function _K(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,target:s.target}}function Pkt(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,anchor:s.anchor,isStickyScroll:s.isStickyScroll}}class Fkt extends k6{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 eue(s){return s instanceof k6?new Fkt(s):s}class Okt{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?.(eue(e),t)}onDragOver(e,t,i,n,r,o=!0){return this.dnd.onDragOver(eue(e),t&&t.element,i,n,r)}drop(e,t,i,n,r){this.dnd.drop(eue(e),t&&t.element,i,n,r)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.dnd.dispose()}}function kJe(s){return s&&{...s,collapseByDefault:!0,identityProvider:s.identityProvider&&{getId(e){return s.identityProvider.getId(e.element)}},dnd:s.dnd&&new Okt(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 X_e(s,e){e(s),s.children.forEach(t=>X_e(t,e))}class IJe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return M.map(this.tree.onDidChangeFocus,kWe)}get onDidChangeSelection(){return M.map(this.tree.onDidChangeSelection,kWe)}get onKeyDown(){return this.tree.onKeyDown}get onMouseClick(){return M.map(this.tree.onMouseClick,_K)}get onMouseDblClick(){return M.map(this.tree.onMouseDblClick,_K)}get onContextMenu(){return M.map(this.tree.onContextMenu,Pkt)}get onTap(){return M.map(this.tree.onTap,_K)}get onPointer(){return M.map(this.tree.onPointer,_K)}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,r,o={}){this.user=e,this.dataSource=r,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new I,this._onDidChangeNodeSlowState=new I,this.nodeMapper=new yRe(a=>new DRe(a)),this.disposables=new Z,this.identityProvider=o.identityProvider,this.autoExpandSingleChildren=typeof o.autoExpandSingleChildren>"u"?!1:o.autoExpandSingleChildren,this.sorter=o.sorter,this.getDefaultCollapseState=a=>o.collapseByDefault?o.collapseByDefault(a)?Of.PreserveOrCollapsed:Of.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,n,o),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=Zhe({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,r){const o=new SRe(i),a=n.map(l=>new Nkt(l,this.nodeMapper,this._onDidChangeNodeSlowState.event)),c=kJe(r)||{};return new xRe(e,t,o,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,r){if(typeof this.root.element>"u")throw new td(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event));const o=this.getDataNode(e);if(await this.refreshAndRenderNode(o,t,n,r),i)try{this.tree.rerender(o)}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 td(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 ui.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 td(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((r,o)=>{!n&&Mkt(o,e)&&(n=r.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(r=>n=r),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const r=await this.doRefreshNode(e,t,i);e.stale=!1,await er.settled(r.map(o=>this.doRefreshSubTree(o,t,i)))}finally{n()}}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let n;if(!e.hasChildren)n=Promise.resolve(ui.empty());else{const r=this.doGetChildren(e);if(GFe(r))n=Promise.resolve(r);else{const o=Ao(800);o.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),n=r.finally(()=>o.cancel())}}try{const r=await n;return this.setChildren(e,r,t,i)}catch(r){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Oo(r))return[];throw r}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 GFe(i)?this.processChildren(i):(t=Mo(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,n){const r=[...t];if(e.children.length===0&&r.length===0)return[];const o=new Map,a=new Map;for(const d of e.children)o.set(d.element,d),this.identityProvider&&a.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});const c=[],l=r.map(d=>{const h=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const m=Zhe({element:d,parent:e,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return h&&m.defaultCollapseState===Of.PreserveOrExpanded&&c.push(m),m}const u=this.identityProvider.getId(d).toString(),f=a.get(u);if(f){const m=f.node;return o.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=>X_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=Zhe({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===Of.PreserveOrExpanded)&&c.push(p),p});for(const d of o.values())X_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(o=>this.asTreeElement(o,t)),r=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(o){return i.diffIdentityProvider.getId(o.element)}}};this.tree.setChildren(e===this.root?null:e,n,r),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?ui.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 td(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=[],r=this.tree.getNode(),o=[r];for(;o.length>0;){const a=o.pop();a!==r&&a.collapsible&&!a.collapsed&&n.push(e(a.element.element)),o.push(...a.children)}return{focus:t,selection:i,expanded:n,scrollTop:this.scrollTop}}dispose(){this.disposables.dispose(),this.tree.dispose()}}class kRe{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 kRe(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 Bkt{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(...He.asClassNameArray(ve.treeItemLoading)),!0):(t.classList.remove(...He.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=wt(this.disposables)}}function Wkt(s){const e=s&&kJe(s);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return s.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}}}}class Hkt extends IJe{constructor(e,t,i,n,r,o,a={}){super(e,t,i,r,o,a),this.compressionDelegate=n,this.compressibleNodeMapper=new yRe(c=>new kRe(c)),this.filter=a.filter}createTree(e,t,i,n,r){const o=new SRe(i),a=n.map(l=>new Bkt(l,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),c=Wkt(r)||{};return new DJe(e,t,o,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 td(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=[],r=this.tree.getCompressedTreeNode(),o=[r];for(;o.length>0;){const a=o.pop();if(a!==r&&a.collapsible&&!a.collapsed)for(const c of a.element.elements)n.push(e(c.element));o.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(),r=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},o=r(this.tree.getSelection()),a=r(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=Ukt(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 Ukt(s){return typeof s=="boolean"?s?Qs.Visible:Qs.Hidden:CRe(s)?L3(s.visibility):L3(s)}class Vkt extends EJe{constructor(e,t,i,n,r,o={}){super(e,t,i,n,o),this.user=e,this.dataSource=r,this.nodesByIdentity=new Map,this.identityProvider=o.identityProvider}getInput(){return this.input}setInput(e,t){if(t&&!this.identityProvider)throw new td(this.user,"Can't restore tree view state without an identity provider");if(this.input=e,!e){this.nodesByIdentity.clear(),this.model.setChildren(null,ui.empty());return}if(!t){this._refresh(e);return}const i=[],n=[],r=a=>{const c=this.identityProvider.getId(a).toString();return!t.expanded[c]},o=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,r,o),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 td(this.user,"Tree input not set");let t;this.identityProvider&&(t=i=>{const n=this.identityProvider.getId(i).toString(),r=this.nodesByIdentity.get(n);if(r)return r.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 r=new Set,o=i;i=a=>{const c=this.identityProvider.getId(a.element).toString();r.add(c),this.nodesByIdentity.set(c,a),o?.(a)},n=a=>{const c=this.identityProvider.getId(a.element).toString();r.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:ui.map(i,r=>{const{elements:o,size:a}=this.iterate(r,t),c=this.dataSource.hasChildren?this.dataSource.hasChildren(r):void 0,l=a===0?void 0:t&&t(r);return{element:r,children:o,collapsible:c,collapsed:l}}),size:i.length}}createModel(e,t,i){return new ARe(e,t,i)}}const zkt=new Q("isMac",jt,g(4967,"Whether the operating system is macOS")),$kt=new Q("isLinux",mo,g(4968,"Whether the operating system is Linux")),P6=new Q("isWindows",jn,g(4969,"Whether the operating system is Windows")),IRe=new Q("isWeb",Hn,g(4970,"Whether the platform is a web browser")),Gkt=new Q("isMacNative",jt&&!Hn,g(4971,"Whether the operating system is macOS on a non-browser platform")),Kkt=new Q("isIOS",gm,g(4972,"Whether the operating system is iOS")),qkt=new Q("isMobile",ZGe,g(4973,"Whether the platform is a mobile web browser")),IWe=new Q("isDevelopment",!1,!0),Qkt=new Q("productQualityType","",g(4974,"Quality type of VS Code")),Uae="inputFocus",TRe=new Q(Uae,!1,g(4975,"Whether keyboard focus is inside an input box")),ug=ae("listService");class jkt{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 iJe(fl(),"").style(zN)),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),dv(e.getHTMLElement())&&this.setLastFocusedList(e),Yo(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 R3=new Q("listScrollAtBoundary","none"),Ykt=he.or(R3.isEqualTo("top"),R3.isEqualTo("both")),Jkt=he.or(R3.isEqualTo("bottom"),R3.isEqualTo("both")),TJe=new Q("listFocus",!0),LJe=new Q("treestickyScrollFocused",!1),Vae=new Q("listSupportsMultiselect",!0),zae=he.and(TJe,he.not(Uae),LJe.negate()),LRe=new Q("listHasSelectionOrFocus",!1),RRe=new Q("listDoubleSelection",!1),MRe=new Q("listMultiSelection",!1),$ae=new Q("listSelectionNavigation",!1),Xkt=new Q("listSupportsFind",!0),NRe=new Q("treeElementCanCollapse",!1),Zkt=new Q("treeElementHasParent",!1),PRe=new Q("treeElementCanExpand",!1),eIt=new Q("treeElementHasChild",!1),tIt=new Q("treeFindOpen",!1),RJe="listTypeNavigationMode",MJe="listAutomaticKeyboardNavigation";function Gae(s,e){const t=s.createScoped(e.getHTMLElement());return TJe.bindTo(t),t}function Kae(s,e){const t=R3.bindTo(s),i=()=>{const n=e.scrollTop===0,r=e.scrollHeight-e.renderHeight-e.scrollTop<1;n&&r?t.set("both"):n?t.set("top"):r?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const KN="workbench.list.multiSelectModifier",sQ="workbench.list.openMode",am="workbench.list.horizontalScrolling",FRe="workbench.list.defaultFindMode",ORe="workbench.list.typeNavigationMode",bJ="workbench.list.keyboardNavigation",Fb="workbench.list.scrollByPage",BRe="workbench.list.defaultFindMatchType",M3="workbench.tree.indent",wJ="workbench.tree.renderIndentGuides",Ob="workbench.list.smoothScrolling",iC="workbench.list.mouseWheelScrollSensitivity",nC="workbench.list.fastScrollSensitivity",yJ="workbench.tree.expandMode",CJ="workbench.tree.enableStickyScroll",SJ="workbench.tree.stickyScrollMaxItemCount";function sC(s){return s.getValue(KN)==="alt"}class iIt extends V{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=sC(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(KN)&&(this.useAltAsMultipleSelectionModifier=sC(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:ZYe(e)}isSelectionRangeChangeEvent(e){return eJe(e)}}function qae(s,e){const t=s.get(Te),i=s.get(Vt),n=new Z;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(o){return i.mightProducePrintableCharacter(o)}},smoothScrolling:!!t.getValue(Ob),mouseWheelScrollSensitivity:t.getValue(iC),fastScrollSensitivity:t.getValue(nC),multipleSelectionController:e.multipleSelectionController??n.add(new iIt(t)),keyboardNavigationEventFilter:rIt(i),scrollByPage:!!t.getValue(Fb)},n]}let Z_e=class extends Za{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,r,o,a,c,l){const d=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(am),[h,u]=l.invokeFunction(qae,r);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=Gae(o,this),this.disposables.add(Kae(this.contextKeyService,this)),this.listSupportsMultiSelect=Vae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),$ae.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=LRe.bindTo(this.contextKeyService),this.listDoubleSelection=RRe.bindTo(this.contextKeyService),this.listMultiSelection=MRe.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=sC(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.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(KN)&&(this._useAltAsMultipleSelectionModifier=sC(c));let m={};if(p.affectsConfiguration(am)&&this.horizontalScrolling===void 0){const v=!!c.getValue(am);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(Fb)){const v=!!c.getValue(Fb);m={...m,scrollByPage:v}}if(p.affectsConfiguration(Ob)){const v=!!c.getValue(Ob);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(iC)){const v=c.getValue(iC);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(nC)){const v=c.getValue(nC);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new NJe(this,{configurationService:c,...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?$N(e):zN)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}};Z_e=D([_(5,Le),_(6,ug),_(7,Te),_(8,we)],Z_e);let TWe=class extends $Dt{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,r,o,a,c,l){const d=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(am),[h,u]=l.invokeFunction(qae,r);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new Z,this.disposables.add(u),this.contextKeyService=Gae(o,this),this.disposables.add(Kae(this.contextKeyService,this.widget)),this.horizontalScrolling=r.horizontalScrolling,this.listSupportsMultiSelect=Vae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),$ae.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this._useAltAsMultipleSelectionModifier=sC(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(KN)&&(this._useAltAsMultipleSelectionModifier=sC(c));let m={};if(p.affectsConfiguration(am)&&this.horizontalScrolling===void 0){const v=!!c.getValue(am);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(Fb)){const v=!!c.getValue(Fb);m={...m,scrollByPage:v}}if(p.affectsConfiguration(Ob)){const v=!!c.getValue(Ob);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(iC)){const v=c.getValue(iC);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(nC)){const v=c.getValue(nC);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new NJe(this,{configurationService:c,...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?$N(e):zN)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};TWe=D([_(5,Le),_(6,ug),_(7,Te),_(8,we)],TWe);let LWe=class extends q_e{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,r,o,a,c,l,d){const h=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(am),[u,f]=d.invokeFunction(qae,o);super(e,t,i,n,r,{keyboardSupport:!1,...u,horizontalScrolling:h}),this.disposables.add(f),this.contextKeyService=Gae(a,this),this.disposables.add(Kae(this.contextKeyService,this)),this.listSupportsMultiSelect=Vae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),$ae.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=LRe.bindTo(this.contextKeyService),this.listDoubleSelection=RRe.bindTo(this.contextKeyService),this.listMultiSelection=MRe.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=sC(l),this.disposables.add(this.contextKeyService),this.disposables.add(c.register(this)),this.updateStyles(o.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(KN)&&(this._useAltAsMultipleSelectionModifier=sC(l));let v={};if(m.affectsConfiguration(am)&&this.horizontalScrolling===void 0){const b=!!l.getValue(am);v={...v,horizontalScrolling:b}}if(m.affectsConfiguration(Fb)){const b=!!l.getValue(Fb);v={...v,scrollByPage:b}}if(m.affectsConfiguration(Ob)){const b=!!l.getValue(Ob);v={...v,smoothScrolling:b}}if(m.affectsConfiguration(iC)){const b=l.getValue(iC);v={...v,mouseWheelScrollSensitivity:b}}if(m.affectsConfiguration(nC)){const b=l.getValue(nC);v={...v,fastScrollSensitivity:b}}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new nIt(this,{configurationService:l,...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?$N(e):zN)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};LWe=D([_(6,Le),_(7,ug),_(8,Te),_(9,we)],LWe);class WRe 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=>g_(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(sQ)!=="doubleClick",this._register(t?.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(sQ)&&(this.openOnSingleClick=t?.configurationService.getValue(sQ)!=="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,r=!0,o=n,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,o,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 r=!1,o=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,o,a,t)}_open(e,t,i,n,r){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:r})}}class NJe extends WRe{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class nIt extends WRe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class sIt extends WRe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function rIt(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===of.MoreChordsNeeded?(e=!0,!1):(e=!1,i.kind===of.NoMatchingKb)}}let N3=class extends xRe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,r,o,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=o.invokeFunction(F6,r);super(e,t,i,n,d),this.disposables.add(u),this.internals=new MM(this,r,h,r.overrideStyles,a,c,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};N3=D([_(5,we),_(6,Le),_(7,ug),_(8,Te)],N3);let RWe=class extends DJe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,r,o,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=o.invokeFunction(F6,r);super(e,t,i,n,d),this.disposables.add(u),this.internals=new MM(this,r,h,r.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)}};RWe=D([_(5,we),_(6,Le),_(7,ug),_(8,Te)],RWe);let MWe=class extends Vkt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,r,o,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(F6,o);super(e,t,i,n,r,h),this.disposables.add(f),this.internals=new MM(this,o,u,o.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)}};MWe=D([_(6,we),_(7,Le),_(8,ug),_(9,Te)],MWe);let eve=class extends IJe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,r,o,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(F6,o);super(e,t,i,n,r,h),this.disposables.add(f),this.internals=new MM(this,o,u,o.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)}};eve=D([_(6,we),_(7,Le),_(8,ug),_(9,Te)],eve);let AJ=class extends Hkt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,r,o,a,c,l,d,h){const{options:u,getTypeNavigationMode:f,disposable:p}=c.invokeFunction(F6,a);super(e,t,i,n,r,o,u),this.disposables.add(p),this.internals=new MM(this,a,f,a.overrideStyles,l,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};AJ=D([_(7,we),_(8,Le),_(9,ug),_(10,Te)],AJ);function PJe(s){const e=s.getValue(FRe);if(e==="highlight")return ip.Highlight;if(e==="filter")return ip.Filter;const t=s.getValue(bJ);if(t==="simple"||t==="highlight")return ip.Highlight;if(t==="filter")return ip.Filter}function FJe(s){const e=s.getValue(BRe);if(e==="fuzzy")return Sb.Fuzzy;if(e==="contiguous")return Sb.Contiguous}function F6(s,e){const t=s.get(Te),i=s.get(bf),n=s.get(Le),r=s.get(we),o=()=>{const u=n.getContextKeyValue(RJe);if(u==="automatic")return jw.Automatic;if(u==="trigger"||n.getContextKeyValue(MJe)===!1)return jw.Trigger;const p=t.getValue(ORe);if(p==="automatic")return jw.Automatic;if(p==="trigger")return jw.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(am),[c,l]=r.invokeFunction(qae,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(wJ);return{getTypeNavigationMode:o,disposable:l,options:{keyboardSupport:!1,...c,indent:typeof t.getValue(M3)=="number"?t.getValue(M3):void 0,renderIndentGuides:h,smoothScrolling:!!t.getValue(Ob),defaultFindMode:PJe(t),defaultFindMatchType:FJe(t),horizontalScrolling:a,scrollByPage:!!t.getValue(Fb),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(yJ)==="doubleClick",contextViewProvider:i,findWidgetStyles:jxt,enableStickyScroll:!!t.getValue(CJ),stickyScrollMaxItemCount:Number(t.getValue(SJ))}}}let MM=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,r,o,a){this.tree=e,this.disposables=[],this.contextKeyService=Gae(r,e),this.disposables.push(Kae(this.contextKeyService,e)),this.listSupportsMultiSelect=Vae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),$ae.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=Xkt.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=LRe.bindTo(this.contextKeyService),this.hasDoubleSelection=RRe.bindTo(this.contextKeyService),this.hasMultiSelection=MRe.bindTo(this.contextKeyService),this.treeElementCanCollapse=NRe.bindTo(this.contextKeyService),this.treeElementHasParent=Zkt.bindTo(this.contextKeyService),this.treeElementCanExpand=PRe.bindTo(this.contextKeyService),this.treeElementHasChild=eIt.bindTo(this.contextKeyService),this.treeFindOpen=tIt.bindTo(this.contextKeyService),this.treeStickyScrollFocused=LJe.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=sC(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(RJe),d.add(MJe),this.disposables.push(this.contextKeyService,o.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(KN)&&(this._useAltAsMultipleSelectionModifier=sC(a)),h.affectsConfiguration(M3)){const f=a.getValue(M3);u={...u,indent:f}}if(h.affectsConfiguration(wJ)&&t.renderIndentGuides===void 0){const f=a.getValue(wJ);u={...u,renderIndentGuides:f}}if(h.affectsConfiguration(Ob)){const f=!!a.getValue(Ob);u={...u,smoothScrolling:f}}if(h.affectsConfiguration(FRe)||h.affectsConfiguration(bJ)){const f=PJe(a);u={...u,defaultFindMode:f}}if(h.affectsConfiguration(ORe)||h.affectsConfiguration(bJ)){const f=i();u={...u,typeNavigationMode:f}}if(h.affectsConfiguration(BRe)){const f=FJe(a);u={...u,defaultFindMatchType:f}}if(h.affectsConfiguration(am)&&t.horizontalScrolling===void 0){const f=!!a.getValue(am);u={...u,horizontalScrolling:f}}if(h.affectsConfiguration(Fb)){const f=!!a.getValue(Fb);u={...u,scrollByPage:f}}if(h.affectsConfiguration(yJ)&&t.expandOnlyOnTwistieClick===void 0&&(u={...u,expandOnlyOnTwistieClick:a.getValue(yJ)==="doubleClick"}),h.affectsConfiguration(CJ)){const f=a.getValue(CJ);u={...u,enableStickyScroll:f}}if(h.affectsConfiguration(SJ)){const f=Math.max(1,a.getValue(SJ));u={...u,stickyScrollMaxItemCount:f}}if(h.affectsConfiguration(iC)){const f=a.getValue(iC);u={...u,mouseWheelScrollSensitivity:f}}if(h.affectsConfiguration(nC)){const f=a.getValue(nC);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 sIt(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?$N(e):zN)}dispose(){this.disposables=wt(this.disposables)}};MM=D([_(4,Le),_(5,ug),_(6,Te)],MM);const oIt=je.as(Pn.Configuration);oIt.registerConfiguration({id:"workbench",order:7,title:g(1295,"Workbench"),type:"object",properties:{[KN]:{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.")},[sQ]:{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.")},[am]:{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.")},[Fb]:{type:"boolean",default:!1,description:g(1301,"Controls whether clicks in the scrollbar scroll page by page.")},[M3]:{type:"number",default:8,minimum:4,maximum:40,description:g(1302,"Controls tree indentation in pixels.")},[wJ]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:g(1303,"Controls whether the tree should render indent guides.")},[Ob]:{type:"boolean",default:!1,description:g(1304,"Controls whether lists and trees have smooth scrolling.")},[iC]:{type:"number",default:1,markdownDescription:g(1305,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[nC]:{type:"number",default:5,markdownDescription:g(1306,"Scrolling speed multiplier when pressing `Alt`.")},[FRe]:{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.")},[bJ]:{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.")},[BRe]:{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.")},[yJ]:{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.")},[CJ]:{type:"boolean",default:!0,description:g(1319,"Controls whether sticky scrolling is enabled in trees.")},[SJ]:{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#`")},[ORe]:{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 aIt=".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}";gt(aIt,{});class uD 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=oe(e,fe("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=uD.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Js(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=r===`\r `?-1:0,o+=i;for(const a of t)a.end<=o||(a.start>=o&&(a.start+=n),a.end>=o&&(a.end+=n));return i+=n,"⏎"})}}class E4{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 P3 extends V{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new E4(oe(e,fe(".monaco-icon-label")))),this.labelContainer=oe(this.domNode.element,fe(".monaco-icon-label-container")),this.nameContainer=oe(this.labelContainer,fe("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new dIt(this.nameContainer,!!t.supportIcons)):this.nameNode=new cIt(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??Fo("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],r=["monaco-icon-label-container"];let o="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&r.push("disabled"),i.title&&(typeof i.title=="string"?o+=i.title:o+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let c;!a||!Jo(a)?(c=fe(".monaco-icon-label-iconpath"),this.domNode.element.prepend(c)):c=a,c.style.backgroundImage=ig(i?.iconPath)}else a&&a.remove();if(this.domNode.className=n.join(" "),this.domNode.element.setAttribute("aria-label",o),this.labelContainer.className=r.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 uD?(c.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(c.element,i?.descriptionTitle)):(c.textContent=t&&i?.labelEscapeNewLines?uD.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(r,o){Rt(o)?r.title=Tae(o):o?.markdownNotSupportedFallback?r.title=o.markdownNotSupportedFallback:r.removeAttribute("title")})(e,t);else{const n=xm().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 E4(mqe(this.nameContainer,fe("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new E4(oe(e.element,fe("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new E4(oe(this.labelContainer,fe("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new uD(oe(e.element,fe("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new E4(oe(e.element,fe("span.label-description"))))}return this.descriptionNode}}class cIt{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Js(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=oe(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 r={start:i,end:i+n.length},o=t.map(a=>Pd.intersect(r,a)).filter(a=>!Pd.isEmpty(a)).map(({start:a,end:c})=>({start:a-i,end:c-i}));return i=r.end+e.length,o})}class dIt 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&&Js(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 uD(oe(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=lIt(e,i,t?.matches);for(let r=0;r{const s=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:s,collatorIsNumeric:s.resolvedOptions().numeric}}),UU=new Ca(()=>({collator:new Intl.Collator(void 0,{numeric:!0})})),HRe=new Ca(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function BJe(s,e,t=!1){const i=s||"",n=e||"",r=NWe.value.collator.compare(i,n);return NWe.value.collatorIsNumeric&&r===0&&i!==n?in.length)return 1}return 0}class SIt extends OU{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 BU(()=>{},()=>`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:(r,o)=>{},handlePossibleChange:r=>{}},this),this._updateCounter>1)for(const r of this.observers)r.handlePossibleChange(this)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function DJ(s,e){return s.lazy?new SIt(new Xd(s.owner,s.debugName,void 0),e,s.equalsFn??wp):new mRe(new Xd(s.owner,s.debugName,void 0),e,s.equalsFn??wp)}var tve;const yv=fe;class UJe{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new Ca(()=>{const n=i.label??"",r=pF(n).text.trim(),o=i.ariaLabel||[n,this.saneDescription,this.saneDetail].map(a=>lYe(a)).filter(a=>!!a).join(", ");return{saneLabel:n,saneSortLabel:r,saneAriaLabel:o}}),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 bl extends UJe{constructor(e,t,i,n,r,o){super(e,t,r),this.fireButtonTriggered=i,this._onChecked=n,this.item=r,this._separator=o,this._checked=!1,this.onChecked=t?M.map(M.filter(this._onChecked.event,a=>a.element===this),a=>a.checked):M.None,this._saneDetail=r.detail,this._labelHighlights=r.highlights?.label,this._descriptionHighlights=r.highlights?.description,this._detailHighlights=r.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 Rw;(function(s){s[s.NONE=0]="NONE",s[s.MOUSE_HOVER=1]="MOUSE_HOVER",s[s.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(Rw||(Rw={}));class u0 extends UJe{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=Rw.NONE}}class AIt{getHeight(e){return e instanceof u0?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof bl?kJ.ID:IJ.ID}}class EIt{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 bl)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class VJe{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new Z,t.toDisposeTemplate=new Z,t.entry=oe(e,yv(".quick-input-list-entry"));const i=oe(t.entry,yv("label.quick-input-list-label"));t.toDisposeTemplate.add(Rr(i,ke.CLICK,l=>{t.checkbox.offsetParent||l.preventDefault()})),t.checkbox=oe(i,yv("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";const n=oe(i,yv(".quick-input-list-rows")),r=oe(n,yv(".quick-input-list-row")),o=oe(n,yv(".quick-input-list-row"));t.label=new P3(r,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=nae(t.label.element,yv(".quick-input-list-icon"));const a=oe(r,yv(".quick-input-list-entry-keybinding"));t.keybinding=new Zk(a,pr),t.toDisposeTemplate.add(t.keybinding);const c=oe(o,yv(".quick-input-list-label-meta"));return t.detail=new P3(c,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=oe(t.entry,yv(".quick-input-list-separator")),t.actionBar=new gd(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 vL;let kJ=(vL=class extends VJe{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return tve.ID}renderTemplate(e){const t=super.renderTemplate(e);return t.toDisposeTemplate.add(Rr(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 r=n.item;i.checkbox.checked=n.checked,i.toDisposeElement.add(n.onChecked(u=>i.checkbox.checked=u)),i.checkbox.disabled=n.checkboxDisabled;const{labelHighlights:o,descriptionHighlights:a,detailHighlights:c}=n;if(r.iconPath){const u=_ae(this.themeService.getColorTheme().type)?r.iconPath.dark:r.iconPath.light??r.iconPath.dark,f=N.revive(u);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=ig(f)}else i.icon.style.backgroundImage="",i.icon.className=r.iconClass?`quick-input-list-icon ${r.iconClass}`:"";let l;!n.saneTooltip&&n.saneDescription&&(l={markdown:{value:n.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDescription});const d={matches:o||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};if(d.extraClasses=r.iconClasses,d.italic=r.italic,d.strikethrough=r.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(n.saneLabel,n.saneDescription,d),i.keybinding.set(r.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=r.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>M5(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)}},tve=vL,vL.ID="quickpickitem",vL);kJ=tve=D([_(1,mn)],kJ);const Nse=class Nse extends VJe{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return Nse.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 r=n.separator,{labelHighlights:o,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:o||[],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=r.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>M5(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)}};Nse.ID="quickpickseparator";let IJ=Nse,NM=class extends V{constructor(e,t,i,n,r,o){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=o,this._onKeyDown=new I,this.onKeyDown=this._onKeyDown.event,this._onLeave=new I,this.onLeave=this._onLeave.event,this._visibleCountObservable=Yt("VisibleCount",0),this.onChangedVisibleCount=M.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=Yt("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=M.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=Yt("CheckedCount",0),this.onChangedCheckedCount=M.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=DJ({equalsFn:ns},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 Q7,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=oe(this.parent,yv(".quick-input-list")),this._separatorRenderer=new IJ(t),this._itemRenderer=r.createInstance(kJ,t),this._tree=this._register(r.createInstance(N3,"QuickInput",this._container,new AIt,[this._itemRenderer,this._separatorRenderer],{accessibilityProvider:new EIt,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:hW.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 bl).map(t=>t.item),this._store)}get onDidChangeSelection(){return M.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof bl).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 xn(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 c6(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(EOe(t.browserEvent.target)){e.cancel();return}if(!(!EOe(t.browserEvent.relatedTarget)&&yc(t.browserEvent.relatedTarget,t.element?.element)))try{await e.trigger(async()=>{t.element instanceof bl&&this.showHover(t.element)})}catch(i){if(!Oo(i))throw i}})),this._register(this._tree.onMouseOut(t=>{yc(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&Rw.ACTIVE_ITEM)!==n&&(n?i.focusInsideSeparator|=Rw.ACTIVE_ITEM:i.focusInsideSeparator&=~Rw.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&Rw.MOUSE_HOVER)||(i.focusInsideSeparator|=Rw.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&Rw.MOUSE_HOVER)&&(i.focusInsideSeparator&=~Rw.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof bl);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof u0&&(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,r)=>{let o;if(n.type==="separator"){if(!n.buttons)return i;t=new u0(r,a=>this._onSeparatorButtonTriggered.fire(a),n),o=t}else{const a=r>0?e[r-1]:void 0;let c;a&&a.type==="separator"&&!a.buttons&&(t=void 0,c=a);const l=new bl(r,this._hasCheckboxes,d=>this._onButtonTriggered.fire(d),this._elementChecked,n,c);if(this._itemElements.push(l),t)return t.children.push(l),i;o=l}return i.push(o),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 r=i.nextSibling;i.remove(),n.insertBefore(i,r)}},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===wr.Second&&this._itemElements.length<2&&(e=wr.First),e){case wr.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,t=>t.element instanceof bl);break;case wr.Second:{this._tree.scrollTop=0;let t=!1;this._tree.focusFirst(void 0,i=>i.element instanceof bl?t?!0:(t=!t,!1):!1);break}case wr.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,t=>t.element instanceof bl);break;case wr.Next:{const t=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,n=>n.element instanceof bl?(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 wr.Previous:{const t=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,n=>{if(!(n.element instanceof bl))return!1;const r=this._tree.getParentElement(n.element);return r===null||r.children[0]!==n.element?this._tree.reveal(n.element):this._tree.reveal(r),!0});const i=this._tree.getFocus();t.length&&t[0]===i[0]&&t[0]===this._itemElements[0]&&this._onLeave.fire();break}case wr.NextPage:this._tree.focusNextPage(void 0,t=>t.element instanceof bl?(this._tree.reveal(t.element),!0):!1);break;case wr.PreviousPage:this._tree.focusPreviousPage(void 0,t=>{if(!(t.element instanceof bl))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 wr.NextSeparator:{let t=!1;const i=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,r=>{if(t)return!0;if(r.element instanceof u0)t=!0,this._separatorRenderer.isSeparatorVisible(r.element)?this._tree.reveal(r.element.children[0]):this._tree.reveal(r.element,0);else if(r.element instanceof bl){if(r.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(r.element)?this._tree.reveal(r.element):this._tree.reveal(r.element,0),!0;if(r.element===this._elementTree[0])return this._tree.reveal(r.element,0),!0}return!1});const n=this._tree.getFocus()[0];i===n&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,r=>r.element instanceof bl));break}case wr.PreviousSeparator:{let t,i=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,n=>{if(n.element instanceof u0)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 bl&&!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(o=>{o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=!1;const a=o.index&&this._inputElements[o.index-1];o.item&&(o.separator=a&&a.type==="separator"&&!a.buttons?a:void 0)});else{let o;this._elementTree.forEach(a=>{let c;this.matchOnLabelMode==="fuzzy"?c=this.matchOnLabel?Kq(e,pF(a.saneLabel))??void 0:void 0:c=this.matchOnLabel?xIt(t,pF(a.saneLabel))??void 0:void 0;const l=this.matchOnDescription?Kq(e,pF(a.saneDescription||""))??void 0:void 0,d=this.matchOnDetail?Kq(e,pF(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];o=h&&h.type==="separator"?h:o,o&&!a.hidden&&(a.separator=o,o=void 0)}})}const i=this._elementTree.filter(o=>!o.hidden);if(this.sortByLabel&&e){const o=e.toLowerCase();i.sort((a,c)=>DIt(a,c,o))}let n;const r=i.reduce((o,a,c)=>(a instanceof bl?n?n.children.push(a):o.push(a):a instanceof u0&&(a.children=[],n=a,o.push(a)),o),new Array);return this._setElementsToTree(r),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const e=this._tree.getFocus().filter(i=>i instanceof bl),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 bl))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 bl&&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 u0?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:vr.RIGHT}},!1))}};NM.__decorator=D([ei],NM.prototype,"onDidChangeFocus",null);NM.__decorator=D([ei],NM.prototype,"onDidChangeSelection",null);NM=D([_(4,we),_(5,_o)],NM);function xIt(s,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return PWe(s,t);const n=SU(t," "),r=t.length-n.length,o=PWe(s,n);if(o)for(const a of o){const c=i[a.start+r]+r;a.start+=c,a.end+=c}return o}function PWe(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t!==-1?[{start:t,end:t+s.length}]:null}function DIt(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:oQ(s.saneSortLabel,e.saneSortLabel,t)}const zJe={weight:Ae.WorkbenchContrib,when:he.and(he.equals(_Je,cW.QuickPick),pDt),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 Bg(s,e={}){Sr.registerCommandAndKeybindingRule({...zJe,...s,secondary:kIt(s.primary,s.secondary??[],e)})}const TJ=jt?U.WinCtrl:U.CtrlCmd;function kIt(s,e,t={}){return t.withAltMod&&e.push(U.Alt+s),t.withCtrlMod&&(e.push(TJ+s),t.withAltMod&&e.push(U.Alt+TJ+s)),t.withCmdMod&&jt&&(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 Bf(s,e){return t=>{const i=t.get(Tn).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(s)}}Bg({id:"quickInput.pageNext",primary:S.PageDown,handler:Bf(wr.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Bg({id:"quickInput.pagePrevious",primary:S.PageUp,handler:Bf(wr.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Bg({id:"quickInput.first",primary:TJ+S.Home,handler:Bf(wr.First)},{withAltMod:!0,withCmdMod:!0});Bg({id:"quickInput.last",primary:TJ+S.End,handler:Bf(wr.Last)},{withAltMod:!0,withCmdMod:!0});Bg({id:"quickInput.next",primary:S.DownArrow,handler:Bf(wr.Next)},{withCtrlMod:!0});Bg({id:"quickInput.previous",primary:S.UpArrow,handler:Bf(wr.Previous)},{withCtrlMod:!0});const FWe=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."),OWe=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.");jt?(Bg({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:U.CtrlCmd+S.DownArrow,handler:Bf(wr.NextSeparator,wr.Next),metadata:{description:FWe}}),Bg({id:"quickInput.nextSeparator",primary:U.CtrlCmd+U.Alt+S.DownArrow,secondary:[U.CtrlCmd+U.WinCtrl+S.DownArrow],handler:Bf(wr.NextSeparator)},{withCtrlMod:!0}),Bg({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:U.CtrlCmd+S.UpArrow,handler:Bf(wr.PreviousSeparator,wr.Previous),metadata:{description:OWe}}),Bg({id:"quickInput.previousSeparator",primary:U.CtrlCmd+U.Alt+S.UpArrow,secondary:[U.CtrlCmd+U.WinCtrl+S.UpArrow],handler:Bf(wr.PreviousSeparator)},{withCtrlMod:!0})):(Bg({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:U.Alt+S.DownArrow,handler:Bf(wr.NextSeparator,wr.Next),metadata:{description:FWe}}),Bg({id:"quickInput.nextSeparator",primary:U.CtrlCmd+U.Alt+S.DownArrow,handler:Bf(wr.NextSeparator)}),Bg({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:U.Alt+S.UpArrow,handler:Bf(wr.PreviousSeparator,wr.Previous),metadata:{description:OWe}}),Bg({id:"quickInput.previousSeparator",primary:U.CtrlCmd+U.Alt+S.UpArrow,handler:Bf(wr.PreviousSeparator)}));Bg({id:"quickInput.acceptInBackground",when:he.and(zJe.when,he.or(TRe.negate(),vDt)),primary:S.RightArrow,weight:Ae.WorkbenchContrib+50,handler:s=>{s.get(Tn).currentQuickInput?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});var ive;const bg=fe;var bL;let nve=(bL=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=fDt.bindTo(this.contextKeyService),this.quickInputTypeContext=mDt.bindTo(this.contextKeyService),this.endOfQuickInputBoxContext=_Dt.bindTo(this.contextKeyService),this.backButton=pJ,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(M.runAndSubscribe(sm,({window:r,disposables:o})=>this.registerKeyModsListeners(r,o),{window:ri,disposables:this._store})),this._register(Rht(r=>{this.ui&<(this.ui.container)===r&&(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&<(this._container)!==lt(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=oe(this._container,bg(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=fl(t),n=oe(t,bg(".quick-input-titlebar")),r=this._register(new gd(n,{hoverDelegate:this.options.hoverDelegate}));r.domNode.classList.add("quick-input-left-action-bar");const o=oe(n,bg(".quick-input-title")),a=this._register(new gd(n,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const c=oe(t,bg(".quick-input-header")),l=oe(c,bg("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",g(5279,"Toggle all checkboxes")),this._register(Rr(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=oe(c,bg(".quick-input-description")),h=oe(c,bg(".quick-input-and-message")),u=oe(h,bg(".quick-input-filter")),f=this._register(new HDt(u,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const p=oe(u,bg(".quick-input-visible-count"));p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true");const m=new K_e(p,{countFormat:g(5280,"{0} Results")},this.styles.countBadge),v=oe(u,bg(".quick-input-count"));v.setAttribute("aria-live","polite");const b=new K_e(v,{countFormat:g(5281,"{0} Selected")},this.styles.countBadge),w=this._register(new gd(c,{hoverDelegate:this.options.hoverDelegate}));w.domNode.classList.add("quick-input-inline-action-bar");const y=oe(c,bg(".quick-input-action")),C=this._register(new Zd(y,this.styles.button));C.label=g(5282,"OK"),this._register(C.onDidClick(ne=>{this.onDidAcceptEmitter.fire()}));const A=oe(c,bg(".quick-input-action")),L=this._register(new Zd(A,{...this.styles.button,supportIcons:!0}));L.label=g(5283,"Custom"),this._register(L.onDidClick(ne=>{this.onDidCustomEmitter.fire()}));const k=oe(h,bg(`#${this.idPrefix}message.quick-input-message`)),P=this._register(new mJ(t,this.styles.progressBar));P.getContainer().classList.add("quick-input-progress");const R=oe(t,bg(".quick-input-html-widget"));R.tabIndex=-1;const z=oe(t,bg(".quick-input-description")),G=this.idPrefix+"list",Y=this._register(this.instantiationService.createInstance(NM,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 vF&&this.controller.canSelectMany&&Y.clearFocus())},0)}));const j=Ec(t);return this._register(j),this._register(ue(t,ke.FOCUS,ne=>{const ge=this.getUI();if(yc(ne.relatedTarget,ge.inputContainer)){const De=ge.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==De&&this.endOfQuickInputBoxContext.set(De)}yc(ne.relatedTarget,ge.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=Jo(ne.relatedTarget)?ne.relatedTarget:void 0)},!0)),this._register(j.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(aW.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(Rr(t,ke.KEY_DOWN,ne=>{if(!yc(ne.target,R))switch(ne.keyCode){case S.Enter:tn.stop(ne,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case S.Escape:tn.stop(ne,!0),this.hide(aW.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(yc(ne.target,this.getUI().widget))break;ge.push(".quick-input-html-widget")}const De=t.querySelectorAll(ge.join(", "));ne.shiftKey&&ne.target===De[0]?(tn.stop(ne,!0),Y.clearFocus()):!ne.shiftKey&&yc(ne.target,De[De.length-1])&&(tn.stop(ne,!0),De[0].focus())}break;case S.Space:ne.ctrlKey&&(tn.stop(ne,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:r,titleBar:n,title:o,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,oe(this._container,this.ui.container))}pick(e,t={},i=Ue.None){return new Promise((n,r)=>{let o=d=>{o=n,t.onKeyMods?.(a.keyMods),n(d)};if(i.isCancellationRequested){o(void 0);return}const a=this.createQuickPick();let c;const l=[a,a.onDidAccept(()=>{if(a.canSelectMany)o(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(o(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&&(o(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(()=>{wt(l),o(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=>{r(d),a.hide()})})}setValidationOnInput(e,t){t&&Rt(t)?(e.severity=Ze.Error,e.validationMessage=t):t&&!Rt(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=Ze.Ignore,e.validationMessage=void 0)}input(e={},t=Ue.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}const n=this.createInputBox(),r=e.validateInput||(()=>Promise.resolve(void 0)),o=M.debounce(n.onDidChangeValue,(d,h)=>h,100);let a=e.value||"",c=Promise.resolve(r(a));const l=[n,o(d=>{d!==a&&(c=Promise.resolve(r(d)),a=d),c.then(h=>{d===a&&this.setValidationOnInput(n,h)})}),n.onDidAccept(()=>{const d=n.value;d!==a&&(c=Promise.resolve(r(d)),a=d),c.then(h=>{!h||!Rt(h)&&h.severity!==Ze.Error?(i(d),n.hide()):d===a&&this.setValidationOnInput(n,h)})}),t.onCancellationRequested(()=>{n.hide()}),n.onDidHide(()=>{wt(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 vF(e)}createInputBox(){const e=this.getUI(!0);return new bDt(e)}createQuickWidget(){const e=this.getUI(!0);return new wDt(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="",ca(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Ze.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),ca(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();pJ.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&&!FTe(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!n){let r=this.previousFocusElement;for(;r&&!r.offsetParent;)r=r.parentElement??void 0;r?.offsetParent?(r.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 vF&&this.controller.canSelectMany&&this.getUI().list.toggleCheckbox()}navigate(e,t){this.isVisible()&&this.getUI().list.displayed&&(this.getUI().list.focus(e?wr.Next:wr.Previous),t&&this.controller instanceof vF&&(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,ive.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:r}=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=r?`0 0 8px 2px ${r}`:"",this.ui.list.style(this.styles.list);const o=[];this.styles.pickerGroup.pickerGroupBorder&&o.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.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)&&(o.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&o.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&o.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&o.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&o.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&o.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),o.push("}"));const a=o.join(` -`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}},ive=bL,bL.MAX_WIDTH=600,bL);nve=ive=D([_(1,_u),_(2,we),_(3,Le)],nve);let LJ=class extends CLe{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(z_e))),this._quickAccess}constructor(e,t,i,n,r){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=r,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:r=>this.setContextKey(r),linkOpenerDelegate:r=>{this.instantiationService.invokeFunction(o=>{o.get(Ar).open(r,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(G_e))},n=this._register(this.instantiationService.createInstance(nve,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(r=>{lt(e.activeContainer)===lt(n.container)&&n.layout(r,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=Ue.None){return this.controller.pick(e,t,i)}input(e={},t=Ue.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:$e(SBe),quickInputForeground:$e(Jmt),quickInputTitleBackground:$e(Xmt),widgetBorder:$e(q2),widgetShadow:$e(kI)},inputBox:LM,toggle:dJ,countBadge:lJe,button:M6,progressBar:cJe,keybindingLabel:I_e,list:$N({listBackground:SBe,listFocusBackground:t3,listFocusForeground:e3,listInactiveFocusForeground:e3,listInactiveSelectionIconForeground:lLe,listInactiveFocusBackground:t3,listFocusOutline:Xs,listInactiveFocusOutline:Xs}),pickerGroup:{pickerGroupBorder:$e(Zmt),pickerGroupForeground:$e(RQe)}}}};LJ=D([_(0,we),_(1,Le),_(2,mn),_(3,_u),_(4,Te)],LJ);let sve=class extends LJ{constructor(e,t,i,n,r,o){super(t,i,n,new Qme(e.getContainerDomNode(),r),o),this.host=void 0;const a=O3.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)}};sve=D([_(1,we),_(2,Le),_(3,mn),_(4,qt),_(5,Te)],sve);let F3=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(sve,e);this.mapEditorToService.set(e,t),fm(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=Ue.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()}};F3=D([_(0,we),_(1,qt)],F3);const Pse=class Pse{static get(e){return e.getContribution(Pse.ID)}constructor(e){this.editor=e,this.widget=new rve(this.editor)}dispose(){this.widget.dispose()}};Pse.ID="editor.controller.quickInput";let O3=Pse;const Fse=class Fse{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Fse.ID}getDomNode(){return this.domNode}getPosition(){return{preference:Vg.TOP_CENTER}}dispose(){this.codeEditor.removeOverlayWidget(this)}};Fse.ID="editor.contrib.quickInputWidget";let rve=Fse;on(O3.ID,O3,ai.Lazy);class IIt{constructor(e,t,i,n,r){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=r}}function TIt(s){if(!s||!Array.isArray(s))return[];const e=[];let t=0;for(let i=0,n=s.length;i{const u=FIt(d.token,h.token);return u!==0?u:d.index-h.index});let t=Vr.None,i="000000",n="ffffff";for(;s.length>=1&&s[0].token==="";){const d=s.shift();d.fontStyle!==Vr.NotSet&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(n=d.background)}const r=new MIt;for(const d of e)r.getId(d);const o=r.getId(i),a=r.getId(n),c=new URe(t,o,a),l=new VRe(c);for(let d=0,h=s.length;d"u"){const n=this._match(t),r=PIt(t);i=(n.metadata|r<>>0,this._cache.set(t,i)}return(i|e<>>0}}const NIt=/\b(comment|string|regex|regexp)\b/;function PIt(s){const e=s.match(NIt);if(!e)return no.Other;switch(e[1]){case"comment":return no.Comment;case"string":return no.String;case"regex":return no.RegEx;case"regexp":return no.RegEx}throw new Error("Unexpected match for standard token type!")}function FIt(s,e){return se?1:0}class URe{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 URe(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==Vr.NotSet&&(this._fontStyle=e),t!==Rl.None&&(this._foreground=t),i!==Rl.None&&(this._background=i),this.metadata=(this._fontStyle<>>0}}class OIt{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 VRe{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 OIt(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 r=this._children.get(i);return typeof r<"u"?r.match(n):this._mainRule}insert(e,t,i,n){if(e===""){this._mainRule.acceptOverwrite(t,i,n);return}const r=e.indexOf(".");let o,a;r===-1?(o=e,a=""):(o=e.substring(0,r),a=e.substring(r+1));let c=this._children.get(o);typeof c>"u"&&(c=new VRe(this._mainRule.clone()),this._children.set(o,c)),c.insert(a,t,i,n)}}function BIt(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=r=>Rt(r)?r:void 0;if(i&&Array.isArray(i.src)&&i.src.every(r=>Rt(r.format)&&Rt(r.location)))return{weight:n(i.weight),style:n(i.style),src:i.src.map(r=>({format:r.format,location:N.parse(r.location)}))}}s.fromJSONObject=t})(BWe||(BWe={}));class zIt{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:`^${He.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const r=this.iconsById[e];if(r){if(i&&!r.description){r.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 r}const o={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=o;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=(r,o)=>r.id.localeCompare(o.id),t=r=>{for(;He.isThemeIcon(r.defaults);)r=this.iconsById[r.defaults.id];return`codicon codicon-${r?r.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map(r=>this.iconsById[r]);for(const r of n.filter(o=>!!o.description).sort(e))i.push(`||${r.id}|${He.isThemeIcon(r.defaults)?r.defaults.id:r.id}|${r.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const r of n.filter(o=>!He.isThemeIcon(o.defaults)).sort(e))i.push(`||${r.id}|`);return i.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}},ive=bL,bL.MAX_WIDTH=600,bL);nve=ive=D([_(1,_u),_(2,we),_(3,Le)],nve);let LJ=class extends CLe{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(z_e))),this._quickAccess}constructor(e,t,i,n,r){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=r,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:r=>this.setContextKey(r),linkOpenerDelegate:r=>{this.instantiationService.invokeFunction(o=>{o.get(Ar).open(r,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(G_e))},n=this._register(this.instantiationService.createInstance(nve,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(r=>{lt(e.activeContainer)===lt(n.container)&&n.layout(r,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=Ue.None){return this.controller.pick(e,t,i)}input(e={},t=Ue.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:$e(SBe),quickInputForeground:$e(Jmt),quickInputTitleBackground:$e(Xmt),widgetBorder:$e(q2),widgetShadow:$e(kI)},inputBox:LM,toggle:dJ,countBadge:lJe,button:M6,progressBar:cJe,keybindingLabel:I_e,list:$N({listBackground:SBe,listFocusBackground:t3,listFocusForeground:e3,listInactiveFocusForeground:e3,listInactiveSelectionIconForeground:lLe,listInactiveFocusBackground:t3,listFocusOutline:Xs,listInactiveFocusOutline:Xs}),pickerGroup:{pickerGroupBorder:$e(Zmt),pickerGroupForeground:$e(RQe)}}}};LJ=D([_(0,we),_(1,Le),_(2,mn),_(3,_u),_(4,Te)],LJ);let sve=class extends LJ{constructor(e,t,i,n,r,o){super(t,i,n,new Qme(e.getContainerDomNode(),r),o),this.host=void 0;const a=O3.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)}};sve=D([_(1,we),_(2,Le),_(3,mn),_(4,qt),_(5,Te)],sve);let F3=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(sve,e);this.mapEditorToService.set(e,t),fm(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=Ue.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()}};F3=D([_(0,we),_(1,qt)],F3);const Pse=class Pse{static get(e){return e.getContribution(Pse.ID)}constructor(e){this.editor=e,this.widget=new rve(this.editor)}dispose(){this.widget.dispose()}};Pse.ID="editor.controller.quickInput";let O3=Pse;const Fse=class Fse{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Fse.ID}getDomNode(){return this.domNode}getPosition(){return{preference:Vg.TOP_CENTER}}dispose(){this.codeEditor.removeOverlayWidget(this)}};Fse.ID="editor.contrib.quickInputWidget";let rve=Fse;on(O3.ID,O3,ai.Lazy);class IIt{constructor(e,t,i,n,r){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=r}}function TIt(s){if(!s||!Array.isArray(s))return[];const e=[];let t=0;for(let i=0,n=s.length;i{const u=FIt(d.token,h.token);return u!==0?u:d.index-h.index});let t=Vr.None,i="000000",n="ffffff";for(;s.length>=1&&s[0].token==="";){const d=s.shift();d.fontStyle!==Vr.NotSet&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(n=d.background)}const r=new MIt;for(const d of e)r.getId(d);const o=r.getId(i),a=r.getId(n),c=new URe(t,o,a),l=new VRe(c);for(let d=0,h=s.length;d"u"){const n=this._match(t),r=PIt(t);i=(n.metadata|r<>>0,this._cache.set(t,i)}return(i|e<>>0}}const NIt=/\b(comment|string|regex|regexp)\b/;function PIt(s){const e=s.match(NIt);if(!e)return no.Other;switch(e[1]){case"comment":return no.Comment;case"string":return no.String;case"regex":return no.RegEx;case"regexp":return no.RegEx}throw new Error("Unexpected match for standard token type!")}function FIt(s,e){return se?1:0}class URe{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 URe(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==Vr.NotSet&&(this._fontStyle=e),t!==Ml.None&&(this._foreground=t),i!==Ml.None&&(this._background=i),this.metadata=(this._fontStyle<>>0}}class OIt{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 VRe{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 OIt(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 r=this._children.get(i);return typeof r<"u"?r.match(n):this._mainRule}insert(e,t,i,n){if(e===""){this._mainRule.acceptOverwrite(t,i,n);return}const r=e.indexOf(".");let o,a;r===-1?(o=e,a=""):(o=e.substring(0,r),a=e.substring(r+1));let c=this._children.get(o);typeof c>"u"&&(c=new VRe(this._mainRule.clone()),this._children.set(o,c)),c.insert(a,t,i,n)}}function BIt(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=r=>Rt(r)?r:void 0;if(i&&Array.isArray(i.src)&&i.src.every(r=>Rt(r.format)&&Rt(r.location)))return{weight:n(i.weight),style:n(i.style),src:i.src.map(r=>({format:r.format,location:N.parse(r.location)}))}}s.fromJSONObject=t})(BWe||(BWe={}));class zIt{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:`^${He.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const r=this.iconsById[e];if(r){if(i&&!r.description){r.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 r}const o={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=o;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=(r,o)=>r.id.localeCompare(o.id),t=r=>{for(;He.isThemeIcon(r.defaults);)r=this.iconsById[r.defaults.id];return`codicon codicon-${r?r.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map(r=>this.iconsById[r]);for(const r of n.filter(o=>!!o.description).sort(e))i.push(`||${r.id}|${He.isThemeIcon(r.defaults)?r.defaults.id:r.id}|${r.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const r of n.filter(o=>!He.isThemeIcon(o.defaults)).sort(e))i.push(`||${r.id}|`);return i.join(` `)}}const VU=new zIt;je.add(GJe.IconContribution,VU);function oi(s,e,t,i){return VU.registerIcon(s,e,t,i)}function zRe(){return VU}function $It(){const s=FKe();for(const e in s){const t="\\"+s[e].toString(16);VU.registerIcon(e,{fontCharacter:t})}}$It();const KJe="vscode://schemas/icons",qJe=je.as(tE.JSONContribution);qJe.registerSchema(KJe,VU.getIconSchema());const WWe=new ln(()=>qJe.notifySchemaChanged(KJe),200);VU.onDidChange(()=>{WWe.isScheduled()||WWe.schedule()});const QJe=oi("widget-close",ve.close,g(4499,"Icon for the close action in widgets.")),GIt=oi("goto-previous-location",ve.arrowUp,g(4500,"Icon for goto previous editor location.")),KIt=oi("goto-next-location",ve.arrowDown,g(4501,"Icon for goto next editor location."));He.modify(ve.sync,"spin");He.modify(ve.loading,"spin");function qIt(s){const e=new Z,t=e.add(new I),i=zRe();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 jJe,r={},o=[],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?(r[d.id]=d.definition,a.push(`${h}: ${Iq(d.id)};`,`${u}: '${l.fontCharacter}';`),o.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; font-family: ${Iq(d.id)}; }`)):(a.push(`${u}: '${l.fontCharacter}'; ${h}: 'codicon';`),o.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; }`))}for(const c in r){const l=r[c],d=l.weight?`font-weight: ${l.weight};`:"",h=l.style?`font-style: ${l.style};`:"",u=l.src.map(f=>`${ig(f.location)} format('${f.format}')`).join(", ");o.push(`@font-face { src: ${u}; font-family: ${Iq(c)};${d}${h} font-display: block; }`)}return o.push(`:root { ${a.join(" ")} }`),o.join(` `)}}}class jJe{getIcon(e){const t=zRe();let i=e.defaults;for(;He.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const ox="vs",P5="vs-dark",XO="hc-black",ZO="hc-light",YJe=je.as(tLe.ColorContribution),QIt=je.as(GQe.ThemingContribution);class JJe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(aQ(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=ove(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=YJe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case ox:return ef.LIGHT;case XO:return ef.HIGH_CONTRAST_DARK;case ZO:return ef.HIGH_CONTRAST_LIGHT;default:return ef.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const r=ove(this.themeData.base);e=r.rules,r.encodedTokensColors&&(t=r.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const r={token:""};i&&(r.foreground=i),n&&(r.background=n),e.push(r)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=$Je.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const r=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=jv.getForeground(r),a=jv.getFontStyle(r);return{foreground:o,italic:!!(a&Vr.Italic),bold:!!(a&Vr.Bold),underline:!!(a&Vr.Underline),strikethrough:!!(a&Vr.Strikethrough)}}get tokenColorMap(){return[]}}function aQ(s){return s===ox||s===P5||s===XO||s===ZO}function ove(s){switch(s){case ox:return WIt;case P5:return HIt;case XO:return UIt;case ZO:return VIt}}function bK(s){const e=ove(s);return new JJe(s,e)}class jIt 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 jJe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(ox,bK(ox)),this._knownThemes.set(P5,bK(P5)),this._knownThemes.set(XO,bK(XO)),this._knownThemes.set(ZO,bK(ZO));const e=this._register(qIt(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} ${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(ox),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Jj(ri,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return F8(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=fl(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),V.None}_registerShadowDomContainer(e){const t=fl(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(ox),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=ri.matchMedia("(forced-colors: active)").matches;if(e!==Fy(this._theme.type)){let t;_ae(this._theme.type)?t=e?XO:P5:t=e?ZO:ox,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:o=>{t[o]||(e.push(o),t[o]=!0)}};QIt.getThemingParticipants().forEach(o=>o(this._theme,i,this._environment));const n=[];for(const o of YJe.getColors()){const a=this._theme.getColor(o.id,!0);a&&n.push(`${cae(o.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(` @@ -669,10 +669,10 @@ ${e.toString()}`}}class B3{constructor(e=new Vc,t=!1,i,n=r0t){this._services=e,t `+t),ri.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:Ze.Info,message:e,detail:t})}async warn(e,t){await this.prompt({type:Ze.Warning,message:e,detail:t})}async error(e,t){await this.prompt({type:Ze.Error,message:e,detail:t})}input(){return Promise.resolve({confirmed:!1})}about(){return Promise.resolve(void 0)}}const Yz=class Yz{constructor(){this.onDidAddNotification=M.None,this.onDidRemoveNotification=M.None,this.onDidChangeFilter=M.None}info(e){return this.notify({severity:Ze.Info,message:e})}warn(e){return this.notify({severity:Ze.Warning,message:e})}error(e){return this.notify({severity:Ze.Error,message:e})}notify(e){switch(e.severity){case Ze.Error:console.error(e.message);break;case Ze.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Yz.NO_OP}prompt(e,t,i,n){return Yz.NO_OP}status(e,t){return V.None}setFilter(e){}getFilter(e){return qme.OFF}getFilters(){return[]}removeFilter(e){}};Yz.NO_OP=new wCt;let bve=Yz,wve=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=vt.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)}}};wve=D([_(0,we)],wve);let tI=class extends RYe{constructor(e,t,i,n,r,o){super(e,t,i,n,r),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 xn(m);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),p.add(ue(f,ke.KEY_UP,m=>{const v=new xn(m);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new f0t(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(o.onCodeEditorAdd(l)),this._register(o.onCodeEditorRemove(d)),o.listCodeEditors().forEach(l);const h=f=>{a(f.getContainerDomNode())},u=f=>{c(f.getContainerDomNode())};this._register(o.onDiffEditorAdd(h)),this._register(o.onDiffEditorRemove(u)),o.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return Yo(vt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:Dpe(i.keybinding,pr),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 ri.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const r of e){const o=r.when||void 0,a=r.keybinding;if(!a)i[n++]=new Mx(void 0,r.command,r.commandArgs,o,t,null,!1);else{const c=this.resolveKeybinding(a);for(const l of c)i[n++]=new Mx(l,r.command,r.commandArgs,o,t,null,!1)}}return i}resolveKeybinding(e){return nW.resolveKeybinding(e,pr)}resolveKeyboardEvent(e){const t=new Lh(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new nW([t],pr)}resolveUserBinding(e){return[]}_dumpDebugInfo(){return""}_dumpDebugInfoJSON(){return""}registerSchemaContribution(e){}enableKeybindingHoldMode(e){}};tI=D([_(0,Le),_(1,bi),_(2,Ji),_(3,wi),_(4,Ke),_(5,qt)],tI);class f0t 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 MJ=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new I,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new eXe(e);this._configuration=new w3(t.reload(),cs.createEmptyModel(e),cs.createEmptyModel(e),cs.createEmptyModel(e),cs.createEmptyModel(e),cs.createEmptyModel(e),new gi,cs.createEmptyModel(e),new gi,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[r,o]=n;this.getValue(r)!==o&&(this._configuration.updateValue(r,o),i.push(r))}if(i.length>0){const n=new cRe({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);n.source=At.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:[]}}};MJ=D([_(0,Ke)],MJ);let yve=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:(r,o)=>n.affectsConfiguration(o)})})}getValue(e,t,i){const n=re.isIPosition(t)?t:null,r=n?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,o=e?this.getLanguage(e,n):void 0;return typeof r>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:o}):this.configurationService.getValue(r,{resource:e,overrideIdentifier:o})}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)}};yve=D([_(0,Te),_(1,fi),_(2,Di)],yve);let Cve=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:mo||jt?` `:`\r -`}};Cve=D([_(0,Te)],Cve);class p0t{constructor(){this.telemetryLevel=jg.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 nO=class nO{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:nO.SCHEME,authority:"model",path:"/"});this.workspace={id:WYe,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===nO.SCHEME?this.workspace.folders[0]:null}isInsideWorkspace(e){return e&&e.scheme===nO.SCHEME}isCurrentWorkspace(e){return!0}};nO.SCHEME="inmemory";let Sve=nO;function NJ(s,e,t){if(!e||!(s instanceof MJ))return;const i=[];Object.keys(e).forEach(n=>{cEt(n)&&i.push([`editor.${n}`,e[n]]),t&&lEt(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&s.updateValues(i)}let Ave=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}setPreviewHandler(){return V.None}async apply(e,t){const i=Array.isArray(e)?e:Mae.convert(e),n=new Map;for(const a of i){if(!(a instanceof rA))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(es.replaceMove(F.lift(a.textEdit.range),a.textEdit.text))}let r=0,o=0;for(const[a,c]of n)a.pushStackElement(),a.pushEditOperations([],c,()=>[]),a.pushStackElement(),o+=1,r+=c.length;return{ariaSummary:qp(v_e.bulkEditServiceSummary,r,o),isApplied:r>0}}};Ave=D([_(0,fi)],Ave);class m0t{constructor(){this.onDidChangeFormatters=M.None}getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return vi(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 Eve=class extends sEt{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)}};Eve=D([_(0,_u),_(1,qt)],Eve);class _0t{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 v0t extends aJ{constructor(){super()}}class b0t extends tXe{constructor(){super(new zCt)}}let xve=class extends P_e{constructor(e,t,i,n,r,o){super(e,t,i,n,r,o),this.configure({blockMouse:!1})}};xve=D([_(0,Ji),_(1,wi),_(2,bf),_(3,Vt),_(4,Ba),_(5,Le)],xve);class w0t{async playSignal(e,t){}async playSignals(e){}getEnabledState(e,t,i){return cKe.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(Ke,b0t,Qt.Eager);ce(Te,MJ,Qt.Eager);ce(xc,yve,Qt.Eager);ce(jTe,Cve,Qt.Eager);ce(Ci,Sve,Qt.Eager);ce(Os,m0t,Qt.Eager);ce(Ji,p0t,Qt.Eager);ce(ir,g0t,Qt.Eager);ce(ec,u0t,Qt.Eager);ce(wi,bve,Qt.Eager);ce(Dm,OE,Qt.Eager);ce(Di,v0t,Qt.Eager);ce(hv,jIt,Qt.Eager);ce(fi,V_e,Qt.Eager);ce(eLe,U_e,Qt.Eager);ce(Le,pve,Qt.Eager);ce(hg,h0t,Qt.Eager);ce(nE,vve,Qt.Eager);ce(Gi,Kxt,Qt.Eager);ce(Pl,Jpe,Qt.Eager);ce(UN,Ave,Qt.Eager);ce(mC,_0t,Qt.Eager);ce(pn,_ve,Qt.Eager);ce(_o,ave,Qt.Eager);ce(ug,jkt,Qt.Eager);ce(bi,wve,Qt.Eager);ce(Vt,tI,Qt.Eager);ce(Tn,F3,Qt.Eager);ce(bf,Eve,Qt.Eager);ce(Ar,H_e,Qt.Eager);ce(gg,uve,Qt.Eager);ce(lo,xve,Qt.Eager);ce(Ba,cve,Qt.Eager);ce(uv,w0t,Qt.Eager);var kt;(function(s){const e=new Vc;for(const[c,l]of zpe())e.set(c,l);const t=new B3(e,!0);e.set(we,t);function i(c){n||o({});const l=e.get(c);if(!l)throw new Error("Missing service "+c);return l instanceof yi?t.invokeFunction(d=>d.get(c)):l}s.get=i;let n=!1;const r=new I;function o(c){if(n)return t;n=!0;for(const[l,d]of zpe())e.get(l)||e.set(l,d);for(const l in c)if(c.hasOwnProperty(l)){const d=ae(l);e.get(d)instanceof yi&&e.set(d,c[l])}return r.fire(),t}s.initialize=o;function a(c){if(n)return c();const l=new Z,d=l.add(r.event(()=>{d.dispose(),l.add(c())}));return l}s.withServices=a})(kt||(kt={}));var y0t=".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}}";gt(y0t,{});class ym{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new ym(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 r=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-r}return new ym(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,r){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=r}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,_t.Immediate)}}class ax{static capture(e){if(e.hasPendingScrollAnimation())return new ax(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 ax(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,_t.Immediate)}}}function C0t(s,e,t,i){if(s.length===0)return e;if(e.length===0)return s;const n=[];let r=0,o=0;for(;rd?(n.push(c),o++):(n.push(i(a,c)),r++,o++)}for(;r`Apply decorations from ${e.debugName}`},n=>{const r=e.read(n);i.set(r)})),t.add({dispose:()=>{i.clear()}}),t}function bF(s,e){return s.appendChild(e),Ee(()=>{e.remove()})}function S0t(s,e){return s.prepend(e),Ee(()=>{e.remove()})}class iXe 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 fQe(e,t)),this._width=Yt(this,this.elementSizeObserver.getWidth()),this._height=Yt(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>is(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 GWe(s,e,t){let i=e.get(),n=i,r=i;const o=Yt("animatedValue",i);let a=-1;const c=300;let l;t.add(WU({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=r,i=e.read(h),a=Date.now()-(u.animate?0:c),d()}));function d(){const h=Date.now()-a;r=Math.floor(A0t(h,n,i-n,c)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}const Wse=class Wse{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${Wse._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};Wse._counter=0;let Dve=Wse;function NA(s,e){return ci(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,r=>"-"+r.toLowerCase()),s.style[i]=n})}function FJ(s,e,t,i){const n=new Z,r=[];return n.add(du((o,a)=>{const c=e.read(o),l=new Map,d=new Map;t&&t(!0),s.changeViewZones(h=>{for(const u of r)h.removeZone(u),i?.delete(u);r.length=0;for(const u of c){const f=h.addZone(u);u.setZoneId&&u.setZoneId(f),r.push(f),i?.add(f),l.set(u,f)}}),t&&t(!1),a.add(WU({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(o=>{for(const a of r)o.removeZone(a)}),i?.clear(),t&&t(!1)}}),n}class E0t extends li{dispose(){super.dispose(!0)}}function KWe(s,e){const t=Tk(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 re(n,s.column))}if(!t.innerChanges)return F.fromPositions(new re(t.modified.startLineNumber,1));const i=Tk(t.innerChanges,n=>n.originalRange.getStartPosition().isBeforeOrEqual(s));if(!i){const n=s.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return F.fromPositions(new re(n,s.column))}if(i.originalRange.containsPosition(s))return i.modifiedRange;{const n=x0t(i.originalRange.getEndPosition(),s);return F.fromPositions(n.addToPosition(i.modifiedRange.getEndPosition()))}}function x0t(s,e){return s.lineNumber===e.lineNumber?new ng(0,e.column-s.column):new ng(e.lineNumber-s.lineNumber,e.column-1)}function D0t(s,e){let t;return s.filter(i=>{const n=e(i,t);return t=i,n})}class fW{static create(e,t=void 0){return new tue(e,e,t)}static createWithDisposable(e,t,i=void 0){const n=new Z;return n.add(t),n.add(e),new tue(e,n,i)}static createOfNonDisposable(e,t,i=void 0){return new tue(e,t,i)}}class tue extends fW{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 k0t(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 k0t extends fW{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 QRe(s,e,t){return hxt({debugName:()=>`Configuration Key "${s}"`},i=>t.onDidChangeConfiguration(n=>{n.affectsConfiguration(s)&&i(n)}),()=>t.getValue(s)??e)}function Rv(s,e,t){const i=s.bindTo(e);return T6({debugName:()=>`Set Context Key "${s.key}"`},n=>{i.set(t(n))})}let qWe=class extends V{constructor(e,t,i){super(),this.configurationService=e,this.accessibilityService=t,this.telemetryService=i,this.sounds=new Map,this.screenReaderAttached=qn(this,this.accessibilityService.onDidChangeScreenReaderOptimized,()=>this.accessibilityService.isScreenReaderOptimized()),this.sentTelemetry=new Set,this.playingSounds=new Set,this._signalConfigValue=new Wj(n=>QRe(n.settingsKey,{sound:"off",announcement:"off"},this.configurationService)),this._signalEnabledState=new Wj({getCacheKey:YEt},n=>et(r=>{const o=this._signalConfigValue.get(n.signal).read(r);return!!((n.modality==="sound"||n.modality===void 0)&&QWe(o.sound,()=>this.screenReaderAttached.read(r),n.userGesture)||(n.modality==="announcement"||n.modality===void 0)&&QWe(o.announcement,()=>this.screenReaderAttached.read(r),n.userGesture))}).recomputeInitiallyAndOnChange(this._store))}getEnabledState(e,t,i){return new _Re(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 r of e)this.sendSignalTelemetry("signal"in r?r.signal:r,"source"in r?r.source:void 0);const t=e.map(r=>"signal"in r?r.signal:r),i=t.filter(r=>this.isAnnouncementEnabled(r)).map(r=>r.announcementMessage);i.length&&this.accessibilityService.status(i.join(", "));const n=new Set(t.filter(r=>this.isSoundEnabled(r)).map(r=>r.sound.getSound()));await Promise.all(Array.from(n).map(r=>this.playSound(r,!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=sf.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 r=await I0t(i,this.getVolumeInPercent()/100);this.sounds.set(i,r)}}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===ll.errorAtPosition.name&&i==="positional"?n=this.configurationService.getValue("accessibility.signalOptions.experimental.delays.errorAtPosition"):e.name===ll.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}};qWe=D([_(0,Te),_(1,_o),_(2,Ji)],qWe);function QWe(s,e,t){return s==="on"||s==="always"||s==="auto"&&e()||s==="userGesture"&&t}function I0t(s,e){return new Promise((t,i)=>{const n=new Audio(s);n.volume=e,n.addEventListener("ended",()=>{t(n)}),n.addEventListener("error",r=>{i(r.error)}),n.play().catch(r=>{i(r)})})}const Wn=class Wn{static register(e){return new Wn(e.fileName)}constructor(e){this.fileName=e}};Wn.error=Wn.register({fileName:"error.mp3"}),Wn.warning=Wn.register({fileName:"warning.mp3"}),Wn.success=Wn.register({fileName:"success.mp3"}),Wn.foldedArea=Wn.register({fileName:"foldedAreas.mp3"}),Wn.break=Wn.register({fileName:"break.mp3"}),Wn.quickFixes=Wn.register({fileName:"quickFixes.mp3"}),Wn.taskCompleted=Wn.register({fileName:"taskCompleted.mp3"}),Wn.taskFailed=Wn.register({fileName:"taskFailed.mp3"}),Wn.terminalBell=Wn.register({fileName:"terminalBell.mp3"}),Wn.diffLineInserted=Wn.register({fileName:"diffLineInserted.mp3"}),Wn.diffLineDeleted=Wn.register({fileName:"diffLineDeleted.mp3"}),Wn.diffLineModified=Wn.register({fileName:"diffLineModified.mp3"}),Wn.chatRequestSent=Wn.register({fileName:"chatRequestSent.mp3"}),Wn.chatResponseReceived1=Wn.register({fileName:"chatResponseReceived1.mp3"}),Wn.chatResponseReceived2=Wn.register({fileName:"chatResponseReceived2.mp3"}),Wn.chatResponseReceived3=Wn.register({fileName:"chatResponseReceived3.mp3"}),Wn.chatResponseReceived4=Wn.register({fileName:"chatResponseReceived4.mp3"}),Wn.clear=Wn.register({fileName:"clear.mp3"}),Wn.save=Wn.register({fileName:"save.mp3"}),Wn.format=Wn.register({fileName:"format.mp3"}),Wn.voiceRecordingStarted=Wn.register({fileName:"voiceRecordingStarted.mp3"}),Wn.voiceRecordingStopped=Wn.register({fileName:"voiceRecordingStopped.mp3"}),Wn.progress=Wn.register({fileName:"progress.mp3"});let go=Wn;class T0t{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 qi=class qi{constructor(e,t,i,n,r,o){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=r,this.announcementMessage=o}static register(e){const t=new T0t("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new qi(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return qi._signals.add(i),i}static get allAccessibilitySignals(){return[...this._signals]}};qi._signals=new Set,qi.errorAtPosition=qi.register({name:g(2242,"Error at Position"),sound:go.error,announcementMessage:g(2243,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),qi.warningAtPosition=qi.register({name:g(2244,"Warning at Position"),sound:go.warning,announcementMessage:g(2245,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),qi.errorOnLine=qi.register({name:g(2246,"Error on Line"),sound:go.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:g(2247,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),qi.warningOnLine=qi.register({name:g(2248,"Warning on Line"),sound:go.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:g(2249,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),qi.foldedArea=qi.register({name:g(2250,"Folded Area on Line"),sound:go.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:g(2251,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),qi.break=qi.register({name:g(2252,"Breakpoint on Line"),sound:go.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:g(2253,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),qi.inlineSuggestion=qi.register({name:g(2254,"Inline Suggestion on Line"),sound:go.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),qi.terminalQuickFix=qi.register({name:g(2255,"Terminal Quick Fix"),sound:go.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:g(2256,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),qi.onDebugBreak=qi.register({name:g(2257,"Debugger Stopped on Breakpoint"),sound:go.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:g(2258,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),qi.noInlayHints=qi.register({name:g(2259,"No Inlay Hints on Line"),sound:go.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:g(2260,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),qi.taskCompleted=qi.register({name:g(2261,"Task Completed"),sound:go.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:g(2262,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),qi.taskFailed=qi.register({name:g(2263,"Task Failed"),sound:go.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:g(2264,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),qi.terminalCommandFailed=qi.register({name:g(2265,"Terminal Command Failed"),sound:go.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:g(2266,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),qi.terminalCommandSucceeded=qi.register({name:g(2267,"Terminal Command Succeeded"),sound:go.success,announcementMessage:g(2268,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),qi.terminalBell=qi.register({name:g(2269,"Terminal Bell"),sound:go.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:g(2270,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),qi.notebookCellCompleted=qi.register({name:g(2271,"Notebook Cell Completed"),sound:go.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:g(2272,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),qi.notebookCellFailed=qi.register({name:g(2273,"Notebook Cell Failed"),sound:go.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:g(2274,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),qi.diffLineInserted=qi.register({name:g(2275,"Diff Line Inserted"),sound:go.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),qi.diffLineDeleted=qi.register({name:g(2276,"Diff Line Deleted"),sound:go.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),qi.diffLineModified=qi.register({name:g(2277,"Diff Line Modified"),sound:go.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),qi.chatRequestSent=qi.register({name:g(2278,"Chat Request Sent"),sound:go.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:g(2279,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),qi.chatResponseReceived=qi.register({name:g(2280,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[go.chatResponseReceived1,go.chatResponseReceived2,go.chatResponseReceived3,go.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),qi.progress=qi.register({name:g(2281,"Progress"),sound:go.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:g(2282,"Progress"),settingsKey:"accessibility.signals.progress"}),qi.clear=qi.register({name:g(2283,"Clear"),sound:go.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:g(2284,"Clear"),settingsKey:"accessibility.signals.clear"}),qi.save=qi.register({name:g(2285,"Save"),sound:go.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:g(2286,"Save"),settingsKey:"accessibility.signals.save"}),qi.format=qi.register({name:g(2287,"Format"),sound:go.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:g(2288,"Format"),settingsKey:"accessibility.signals.format"}),qi.voiceRecordingStarted=qi.register({name:g(2289,"Voice Recording Started"),sound:go.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),qi.voiceRecordingStopped=qi.register({name:g(2290,"Voice Recording Stopped"),sound:go.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});let ll=qi;var L0t=".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}";gt(L0t,{});const R0t=oi("diff-review-insert",ve.add,g(5250,"Icon for 'Insert' in accessible diff viewer.")),M0t=oi("diff-review-remove",ve.remove,g(5251,"Icon for 'Remove' in accessible diff viewer.")),N0t=oi("diff-review-close",ve.close,g(5252,"Icon for 'Close' in accessible diff viewer."));var CB;let Px=(CB=class extends V{constructor(e,t,i,n,r,o,a,c,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=r,this._height=o,this._diffs=a,this._models=c,this._instantiationService=l,this._state=TI(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(kve,this._diffs,this._models,this._setVisible,this._canClose)),p=h.add(this._instantiationService.createInstance(Ive,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:p}}).recomputeInitiallyAndOnChange(this._store)}next(){is(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){is(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){is(e=>{this._setVisible(!1,e)})}},CB._ttPolicy=ZA("diffReview",{createHTML:e=>e}),CB);Px=D([_(8,we)],Px);let kve=class extends V{constructor(e,t,i,n,r){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=r,this._groups=Yt(this,[]),this._currentGroupIdx=Yt(this,0),this._currentElementIdx=Yt(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((o,a)=>this._groups.read(a)[o]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((o,a)=>this.currentGroup.read(a)?.lines[o]),this._register(ci(o=>{const a=this._diffs.read(o);if(!a){this._groups.set([],void 0);return}const c=P0t(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());is(l=>{const d=this._models.getModifiedPosition();if(d){const h=c.findIndex(u=>d?.lineNumber{const a=this.currentElement.read(o);a?.type===Gh.Deleted?this._accessibilitySignalService.playSignal(ll.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===Gh.Added&&this._accessibilitySignalService.playSignal(ll.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(ci(o=>{const a=this.currentElement.read(o);if(a&&a.type!==Gh.Header){const c=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(F.fromPositions(new re(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||IM(t,n=>{this._currentGroupIdx.set(_i.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||is(i=>{this._currentElementIdx.set(_i.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&&is(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===Gh.Deleted?this._models.originalReveal(F.fromPositions(new re(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==Gh.Header?F.fromPositions(new re(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};kve=D([_(4,uv)],kve);const x4=3;function P0t(s,e,t){const i=[];for(const n of cTe(s,(r,o)=>o.modified.startLineNumber-r.modified.endLineNumberExclusive<2*x4)){const r=[];r.push(new O0t);const o=new mi(Math.max(1,n[0].original.startLineNumber-x4),Math.min(n[n.length-1].original.endLineNumberExclusive+x4,e+1)),a=new mi(Math.max(1,n[0].modified.startLineNumber-x4),Math.min(n[n.length-1].modified.endLineNumberExclusive+x4,t+1));HGe(n,(d,h)=>{const u=new mi(d?d.original.endLineNumberExclusive:o.startLineNumber,h?h.original.startLineNumber:o.endLineNumberExclusive),f=new mi(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(p=>{r.push(new H0t(p,f.startLineNumber+(p-u.startLineNumber)))}),h&&(h.original.forEach(p=>{r.push(new B0t(h,p))}),h.modified.forEach(p=>{r.push(new W0t(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 F0t(new N_(c,l),r))}return i}var Gh;(function(s){s[s.Header=0]="Header",s[s.Unchanged=1]="Unchanged",s[s.Deleted=2]="Deleted",s[s.Added=3]="Added"})(Gh||(Gh={}));class F0t{constructor(e,t){this.range=e,this.lines=t}}class O0t{constructor(){this.type=Gh.Header}}class B0t{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=Gh.Deleted,this.modifiedLineNumber=void 0}}class W0t{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=Gh.Added,this.originalLineNumber=void 0}}class H0t{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=Gh.Unchanged}}let Ive=class extends V{constructor(e,t,i,n,r,o){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._models=r,this._languageService=o,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 gd(a)),this._register(ci(c=>{this._actionBar.clear(),this._model.canClose.read(c)&&this._actionBar.push(new an("diffreview.close",g(5253,"Close"),"close-diff-review "+He.asClassName(N0t),!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 MU(this._content,{})),ca(this.domNode,this._scrollbar.getDomNode(),a),this._register(ci(c=>{this._height.read(c),this._width.read(c),this._scrollbar.scanDomNode()})),this._register(Ee(()=>{ca(this.domNode)})),this._register(NA(this.domNode,{width:this._width,height:this._height})),this._register(NA(this._content,{width:this._width,height:this._height})),this._register(du((c,l)=>{this._model.currentGroup.read(c),this._render(l)})),this._register(Rr(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.")),kl(n,i.get(x.fontInfo)),ca(this._content,n);const r=this._models.getOriginalModel(),o=this._models.getModifiedModel();if(!r||!o)return;const a=r.getOptions(),c=o.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===Gh.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,r,a,i,o,c);n.appendChild(u);const f=et(p=>this._model.currentElement.read(p)===h);e.add(ci(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,r,o,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 Gh.Added:p="diff-review-row line-insert",m=" char-insert",b=R0t;break;case Gh.Deleted:p="diff-review-row line-delete",m=" char-delete",b=M0t;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=He.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);Px._ttPolicy&&(R=Px._ttPolicy.createHTML(R)),y.insertAdjacentHTML("beforeend",R),k=c.getLineContent(e.modifiedLineNumber)}else{let R=this._getLineHtml(r,n,o.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Px._ttPolicy&&(R=Px._ttPolicy.createHTML(R)),y.insertAdjacentHTML("beforeend",R),k=r.getLineContent(e.originalLineNumber)}k.length===0&&(k=g(5259,"blank"));let P="";switch(e.type){case Gh.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 Gh.Added:P=g(5262,"+ {0} modified line {1}",k,e.modifiedLineNumber);break;case Gh.Deleted:P=g(5263,"- {0} original line {1}",k,e.originalLineNumber);break}return w.setAttribute("aria-label",P),w}_getLineHtml(e,t,i,n,r){const o=e.getLineContent(n),a=t.get(x.fontInfo),c=pd.createEmpty(o,r),l=_p.isBasicASCII(o,e.mightContainNonBasicASCII()),d=_p.containsRTL(o,l,e.mightContainRTL());return aae(new DI(a.isMonospace&&!t.get(x.disableMonospaceOptimizations),a.canUseHalfwidthRightwardsArrow,o,!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)!==Ok.OFF,null)).html}};Ive=D([_(5,Di)],Ive);class U0t{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 V0t=oi("diff-insert",ve.add,g(4991,"Line decoration for inserts in the diff editor.")),nXe=oi("diff-remove",ve.remove,g(4992,"Line decoration for removals in the diff editor.")),OJ=Kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+He.asClassName(V0t),marginClassName:"gutter-insert"}),W3=Kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+He.asClassName(nXe),marginClassName:"gutter-delete"}),jWe=Kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),YWe=Kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),BJ=Kt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),jRe=Kt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),YRe=Kt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),pW=Kt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),JRe=Kt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),XRe=Kt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class z0t{get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=Yt(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}}class O6{static fromFn(e){return new O6(e())}constructor(e){this._value=Yt(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(is(i=>{this._value.set(new JWe(t,void 0),i)}),t),t=>{throw is(i=>{this._value.set(new JWe(void 0,t),i)}),t})}}class JWe{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}class $0t{constructor(e){this._computePromise=e,this._lazyValue=new z0t(()=>new O6(this._computePromise())),this.cachedPromiseResult=et(this,t=>this._lazyValue.cachedValue.read(t)?.promiseResult.read(t))}getPromise(){return this._lazyValue.getValue().promise}}function B5(s,e,t,i){return e||(e=n=>n!=null),new Promise((n,r)=>{let o=!0,a=!1;const c=s.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),l=ci(d=>{const{isFinished:h,error:u,state:f}=c.read(d);(h||u)&&(o?a=!0:l.dispose(),u?r(u===!0?f:u):n(f))});if(i){const d=i.onCancellationRequested(()=>{l.dispose(),d.dispose(),r(new Na)});if(i.isCancellationRequested){l.dispose(),d.dispose(),r(new Na);return}}o=!1,a&&l.dispose()})}var g0;const B6=ae("diffProviderFactoryService");let Tve=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(Lve,e)}};Tve=D([_(0,we)],Tve);ce(B6,Tve,Qt.Delayed);var CL;let Lve=(CL=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 Y_(new mi(1,2),new mi(1,t.getLineCount()+1),[new Qp(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const r=JSON.stringify([e.uri.toString(),t.uri.toString()]),o=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=g0.diffCache.get(r);if(a&&a.context===o)return a.result;const c=Ys.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 g0.diffCache.size>10&&g0.diffCache.delete(g0.diffCache.keys().next().value),g0.diffCache.set(r,{result:l,context:o}),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()}},g0=CL,CL.diffCache=new Map,CL);Lve=g0=D([_(1,Pl),_(2,Ji)],Lve);function Qae(){return N2&&!!N2.VSCODE_DEV}function sXe(s){if(Qae()){const e=G0t();return e.add(s),{dispose(){e.delete(s)}}}else return{dispose(){}}}function G0t(){wK||(wK=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 wK){const r=n(t);r&&i.push(r)}if(i.length>0)return n=>{let r=!1;for(const o of i)o(n)&&(r=!0);return r}}),wK}let wK;Qae()&&sXe(({oldExports:s,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{for(const n in i){const r=i[n];if(console.log(`[hot-reload] Patching prototype methods of '${n}'`,{exportedItem:r}),typeof r=="function"&&r.prototype){const o=s[n];if(o){for(const a of Object.getOwnPropertyNames(r.prototype)){const c=Object.getOwnPropertyDescriptor(r.prototype,a),l=Object.getOwnPropertyDescriptor(o.prototype,a);c?.value?.toString()!==l?.value?.toString()&&console.log(`[hot-reload] Patching prototype method '${n}.${a}'`),Object.defineProperty(o.prototype,a,c)}i[n]=o}}}return!0}});function Wg(s,e){return K0t([s],e),s}function K0t(s,e){Qae()&&sd("reload",i=>sXe(({oldExports:n})=>{if([...Object.values(n)].some(r=>s.includes(r)))return r=>(i(void 0),!0)})).read(e)}let WJ=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=Yt(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Yt(this,void 0),this.diff=this._diff,this._unchangedRegions=Yt(this,void 0),this.unchangedRegions=et(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(is(c=>{for(const l of this._unchangedRegions.get()?.regions||[])l.collapseAll(c)}),[])),this.movedTextToCompare=Yt(this,void 0),this._activeMovedText=Yt(this,void 0),this._hoveredMovedText=Yt(this,void 0),this.activeMovedText=et(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new li,this._diffProvider=et(this,a=>{const c=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),l=sd("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:l}}),this._register(Ee(()=>this._cancellationTokenSource.cancel()));const n=_C("contentChangedSignal"),r=this._register(new ln(()=>n.trigger(void 0),200));this._register(ci(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?mi.fromRangeInclusive(p):void 0),d=c.modifiedDecorationIds.map(p=>e.modified.getDecorationRange(p)).map(p=>p?mi.fromRangeInclusive(p):void 0),h=c.regions.map((p,m)=>!l[m]||!d[m]?void 0:new Fx(l[m].startLineNumber,d[m].startLineNumber,l[m].length,p.visibleLineCountTop.read(a),p.visibleLineCountBottom.read(a))).filter(Oc),u=[];let f=!1;for(const p of cTe(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 Fx(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"}})));is(v=>{this._unchangedRegions.set({regions:u,originalDecorationIds:p,modifiedDecorationIds:m},v)})}}));const o=(a,c,l)=>{const d=Fx.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?mi.fromRangeInclusive(C):void 0),b=u.modifiedDecorationIds.map(C=>e.modified.getDecorationRange(C)).map(C=>C?mi.fromRangeInclusive(C):void 0);let y=D0t(u.regions.map((C,A)=>{if(!v[A]||!b[A])return;const L=v[A].length;return new Fx(v[A].startLineNumber,b[A].startLineNumber,L,Math.min(C.visibleLineCountTop.get(),L),Math.min(C.visibleLineCountBottom.get(),L-C.visibleLineCountTop.get()))}).filter(Oc),(C,A)=>!A||C.modifiedLineNumber>=A.modifiedLineNumber+A.lineCount&&C.originalLineNumber>=A.originalLineNumber+A.lineCount).map(C=>new N_(C.getHiddenOriginalRange(l),C.getHiddenModifiedRange(l)));y=N_.clip(y,mi.ofLength(1,e.original.getLineCount()),mi.ofLength(1,e.modified.getLineCount())),h=N_.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()&&LS.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(e.original.onDidChangeContent(a=>{this._diff.get()&&LS.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(du(async(a,c)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),r.cancel(),n.read(a);const l=this._diffProvider.read(a);l.onChangeSignal.read(a),Wg(oQe,a),Wg(Ype,a),this._isDiffUpToDate.set(!1,void 0);let d=[];c.add(e.original.onDidChangeContent(f=>{const p=LS.fromModelContentChanges(f.changes);d=LY(d,p)}));let h=[];c.add(e.modified.onDidChangeContent(f=>{const p=LS.fromModelContentChanges(f.changes);h=LY(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=q0t(u,e.original,e.modified),u=u,u=u,is(f=>{o(u,f),this._lastDiff=u;const p=ZRe.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 r of n)if(r.getHiddenModifiedRange(void 0).contains(e)){r.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 r of n)if(r.getHiddenOriginalRange(void 0).contains(e)){r.showOriginalLine(e,t,i);return}}async waitForDiff(){await B5(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=>mi.deserialize(n.range)),i=this._unchangedRegions.get();!i||!t||is(n=>{for(const r of i.regions)for(const o of t)if(r.modifiedUnchangedRange.intersect(o)){r.setHiddenModifiedRange(o,n);break}})}};WJ=D([_(2,B6)],WJ);function q0t(s,e,t){return{changes:s.changes.map(i=>new Y_(i.original,i.modified,i.innerChanges?i.innerChanges.map(n=>Q0t(n,e,t)):void 0)),moves:s.moves,identical:s.identical,quitEarly:s.quitEarly}}function Q0t(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 rXe(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 rXe{constructor(e){this.lineRangeMapping=e}}class Fx{static fromDiffs(e,t,i,n,r){const o=Y_.inverse(e,t,i),a=[];for(const c of o){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>=r+n?(u&&!f&&(h-=r),f&&!u&&(l+=r,d+=r,h-=r),a.push(new Fx(l,d,h,0,0))):h>=r*2+n&&(l+=r,d+=r,h-=r*2,a.push(new Fx(l,d,h,0,0)))}return a}get originalUnchangedRange(){return mi.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return mi.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,r){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Yt(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Yt(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=et(this,c=>this.visibleLineCountTop.read(c)+this.visibleLineCountBottom.read(c)===this.lineCount&&!this.isDragged.read(c)),this.isDragged=Yt(this,void 0);const o=Math.max(Math.min(n,this.lineCount),0),a=Math.max(Math.min(r,this.lineCount-n),0);kOe(n===o),kOe(r===a),this._visibleLineCountTop.set(o,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],n=new Xp(e.map(c=>c.modified)).subtractFrom(this.modifiedUnchangedRange);let r=this.originalLineNumber,o=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)-o,u=new Fx(r,o,h,0,0);u.setHiddenModifiedRange(l,t),i.push(u),r=u.originalUnchangedRange.endLineNumberExclusive,o=u.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return mi.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return mi.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()),r=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===m_.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 an("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 an("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()===Eh.LF?` +`}};Cve=D([_(0,Te)],Cve);class p0t{constructor(){this.telemetryLevel=jg.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 nO=class nO{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:nO.SCHEME,authority:"model",path:"/"});this.workspace={id:WYe,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===nO.SCHEME?this.workspace.folders[0]:null}isInsideWorkspace(e){return e&&e.scheme===nO.SCHEME}isCurrentWorkspace(e){return!0}};nO.SCHEME="inmemory";let Sve=nO;function NJ(s,e,t){if(!e||!(s instanceof MJ))return;const i=[];Object.keys(e).forEach(n=>{cEt(n)&&i.push([`editor.${n}`,e[n]]),t&&lEt(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&s.updateValues(i)}let Ave=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}setPreviewHandler(){return V.None}async apply(e,t){const i=Array.isArray(e)?e:Mae.convert(e),n=new Map;for(const a of i){if(!(a instanceof rA))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(es.replaceMove(F.lift(a.textEdit.range),a.textEdit.text))}let r=0,o=0;for(const[a,c]of n)a.pushStackElement(),a.pushEditOperations([],c,()=>[]),a.pushStackElement(),o+=1,r+=c.length;return{ariaSummary:qp(v_e.bulkEditServiceSummary,r,o),isApplied:r>0}}};Ave=D([_(0,fi)],Ave);class m0t{constructor(){this.onDidChangeFormatters=M.None}getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return vi(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 Eve=class extends sEt{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)}};Eve=D([_(0,_u),_(1,qt)],Eve);class _0t{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 v0t extends aJ{constructor(){super()}}class b0t extends tXe{constructor(){super(new zCt)}}let xve=class extends P_e{constructor(e,t,i,n,r,o){super(e,t,i,n,r,o),this.configure({blockMouse:!1})}};xve=D([_(0,Ji),_(1,wi),_(2,bf),_(3,Vt),_(4,Wa),_(5,Le)],xve);class w0t{async playSignal(e,t){}async playSignals(e){}getEnabledState(e,t,i){return cKe.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(Ke,b0t,Qt.Eager);ce(Te,MJ,Qt.Eager);ce(xc,yve,Qt.Eager);ce(jTe,Cve,Qt.Eager);ce(Ci,Sve,Qt.Eager);ce(Os,m0t,Qt.Eager);ce(Ji,p0t,Qt.Eager);ce(ir,g0t,Qt.Eager);ce(ec,u0t,Qt.Eager);ce(wi,bve,Qt.Eager);ce(Dm,OE,Qt.Eager);ce(Di,v0t,Qt.Eager);ce(hv,jIt,Qt.Eager);ce(fi,V_e,Qt.Eager);ce(eLe,U_e,Qt.Eager);ce(Le,pve,Qt.Eager);ce(hg,h0t,Qt.Eager);ce(nE,vve,Qt.Eager);ce(Gi,Kxt,Qt.Eager);ce(Fl,Jpe,Qt.Eager);ce(UN,Ave,Qt.Eager);ce(mC,_0t,Qt.Eager);ce(pn,_ve,Qt.Eager);ce(_o,ave,Qt.Eager);ce(ug,jkt,Qt.Eager);ce(bi,wve,Qt.Eager);ce(Vt,tI,Qt.Eager);ce(Tn,F3,Qt.Eager);ce(bf,Eve,Qt.Eager);ce(Ar,H_e,Qt.Eager);ce(gg,uve,Qt.Eager);ce(lo,xve,Qt.Eager);ce(Wa,cve,Qt.Eager);ce(uv,w0t,Qt.Eager);var kt;(function(s){const e=new Vc;for(const[c,l]of zpe())e.set(c,l);const t=new B3(e,!0);e.set(we,t);function i(c){n||o({});const l=e.get(c);if(!l)throw new Error("Missing service "+c);return l instanceof yi?t.invokeFunction(d=>d.get(c)):l}s.get=i;let n=!1;const r=new I;function o(c){if(n)return t;n=!0;for(const[l,d]of zpe())e.get(l)||e.set(l,d);for(const l in c)if(c.hasOwnProperty(l)){const d=ae(l);e.get(d)instanceof yi&&e.set(d,c[l])}return r.fire(),t}s.initialize=o;function a(c){if(n)return c();const l=new Z,d=l.add(r.event(()=>{d.dispose(),l.add(c())}));return l}s.withServices=a})(kt||(kt={}));var y0t=".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}}";gt(y0t,{});class ym{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new ym(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 r=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-r}return new ym(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,r){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=r}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,_t.Immediate)}}class ax{static capture(e){if(e.hasPendingScrollAnimation())return new ax(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 ax(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,_t.Immediate)}}}function C0t(s,e,t,i){if(s.length===0)return e;if(e.length===0)return s;const n=[];let r=0,o=0;for(;rd?(n.push(c),o++):(n.push(i(a,c)),r++,o++)}for(;r`Apply decorations from ${e.debugName}`},n=>{const r=e.read(n);i.set(r)})),t.add({dispose:()=>{i.clear()}}),t}function bF(s,e){return s.appendChild(e),Ee(()=>{e.remove()})}function S0t(s,e){return s.prepend(e),Ee(()=>{e.remove()})}class iXe 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 fQe(e,t)),this._width=Yt(this,this.elementSizeObserver.getWidth()),this._height=Yt(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>is(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 GWe(s,e,t){let i=e.get(),n=i,r=i;const o=Yt("animatedValue",i);let a=-1;const c=300;let l;t.add(WU({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=r,i=e.read(h),a=Date.now()-(u.animate?0:c),d()}));function d(){const h=Date.now()-a;r=Math.floor(A0t(h,n,i-n,c)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}const Wse=class Wse{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${Wse._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};Wse._counter=0;let Dve=Wse;function NA(s,e){return ci(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,r=>"-"+r.toLowerCase()),s.style[i]=n})}function FJ(s,e,t,i){const n=new Z,r=[];return n.add(du((o,a)=>{const c=e.read(o),l=new Map,d=new Map;t&&t(!0),s.changeViewZones(h=>{for(const u of r)h.removeZone(u),i?.delete(u);r.length=0;for(const u of c){const f=h.addZone(u);u.setZoneId&&u.setZoneId(f),r.push(f),i?.add(f),l.set(u,f)}}),t&&t(!1),a.add(WU({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(o=>{for(const a of r)o.removeZone(a)}),i?.clear(),t&&t(!1)}}),n}class E0t extends li{dispose(){super.dispose(!0)}}function KWe(s,e){const t=Tk(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 re(n,s.column))}if(!t.innerChanges)return F.fromPositions(new re(t.modified.startLineNumber,1));const i=Tk(t.innerChanges,n=>n.originalRange.getStartPosition().isBeforeOrEqual(s));if(!i){const n=s.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return F.fromPositions(new re(n,s.column))}if(i.originalRange.containsPosition(s))return i.modifiedRange;{const n=x0t(i.originalRange.getEndPosition(),s);return F.fromPositions(n.addToPosition(i.modifiedRange.getEndPosition()))}}function x0t(s,e){return s.lineNumber===e.lineNumber?new ng(0,e.column-s.column):new ng(e.lineNumber-s.lineNumber,e.column-1)}function D0t(s,e){let t;return s.filter(i=>{const n=e(i,t);return t=i,n})}class fW{static create(e,t=void 0){return new tue(e,e,t)}static createWithDisposable(e,t,i=void 0){const n=new Z;return n.add(t),n.add(e),new tue(e,n,i)}static createOfNonDisposable(e,t,i=void 0){return new tue(e,t,i)}}class tue extends fW{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 k0t(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 k0t extends fW{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 QRe(s,e,t){return hxt({debugName:()=>`Configuration Key "${s}"`},i=>t.onDidChangeConfiguration(n=>{n.affectsConfiguration(s)&&i(n)}),()=>t.getValue(s)??e)}function Rv(s,e,t){const i=s.bindTo(e);return T6({debugName:()=>`Set Context Key "${s.key}"`},n=>{i.set(t(n))})}let qWe=class extends V{constructor(e,t,i){super(),this.configurationService=e,this.accessibilityService=t,this.telemetryService=i,this.sounds=new Map,this.screenReaderAttached=qn(this,this.accessibilityService.onDidChangeScreenReaderOptimized,()=>this.accessibilityService.isScreenReaderOptimized()),this.sentTelemetry=new Set,this.playingSounds=new Set,this._signalConfigValue=new Wj(n=>QRe(n.settingsKey,{sound:"off",announcement:"off"},this.configurationService)),this._signalEnabledState=new Wj({getCacheKey:YEt},n=>et(r=>{const o=this._signalConfigValue.get(n.signal).read(r);return!!((n.modality==="sound"||n.modality===void 0)&&QWe(o.sound,()=>this.screenReaderAttached.read(r),n.userGesture)||(n.modality==="announcement"||n.modality===void 0)&&QWe(o.announcement,()=>this.screenReaderAttached.read(r),n.userGesture))}).recomputeInitiallyAndOnChange(this._store))}getEnabledState(e,t,i){return new _Re(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 r of e)this.sendSignalTelemetry("signal"in r?r.signal:r,"source"in r?r.source:void 0);const t=e.map(r=>"signal"in r?r.signal:r),i=t.filter(r=>this.isAnnouncementEnabled(r)).map(r=>r.announcementMessage);i.length&&this.accessibilityService.status(i.join(", "));const n=new Set(t.filter(r=>this.isSoundEnabled(r)).map(r=>r.sound.getSound()));await Promise.all(Array.from(n).map(r=>this.playSound(r,!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=sf.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 r=await I0t(i,this.getVolumeInPercent()/100);this.sounds.set(i,r)}}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===ll.errorAtPosition.name&&i==="positional"?n=this.configurationService.getValue("accessibility.signalOptions.experimental.delays.errorAtPosition"):e.name===ll.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}};qWe=D([_(0,Te),_(1,_o),_(2,Ji)],qWe);function QWe(s,e,t){return s==="on"||s==="always"||s==="auto"&&e()||s==="userGesture"&&t}function I0t(s,e){return new Promise((t,i)=>{const n=new Audio(s);n.volume=e,n.addEventListener("ended",()=>{t(n)}),n.addEventListener("error",r=>{i(r.error)}),n.play().catch(r=>{i(r)})})}const Wn=class Wn{static register(e){return new Wn(e.fileName)}constructor(e){this.fileName=e}};Wn.error=Wn.register({fileName:"error.mp3"}),Wn.warning=Wn.register({fileName:"warning.mp3"}),Wn.success=Wn.register({fileName:"success.mp3"}),Wn.foldedArea=Wn.register({fileName:"foldedAreas.mp3"}),Wn.break=Wn.register({fileName:"break.mp3"}),Wn.quickFixes=Wn.register({fileName:"quickFixes.mp3"}),Wn.taskCompleted=Wn.register({fileName:"taskCompleted.mp3"}),Wn.taskFailed=Wn.register({fileName:"taskFailed.mp3"}),Wn.terminalBell=Wn.register({fileName:"terminalBell.mp3"}),Wn.diffLineInserted=Wn.register({fileName:"diffLineInserted.mp3"}),Wn.diffLineDeleted=Wn.register({fileName:"diffLineDeleted.mp3"}),Wn.diffLineModified=Wn.register({fileName:"diffLineModified.mp3"}),Wn.chatRequestSent=Wn.register({fileName:"chatRequestSent.mp3"}),Wn.chatResponseReceived1=Wn.register({fileName:"chatResponseReceived1.mp3"}),Wn.chatResponseReceived2=Wn.register({fileName:"chatResponseReceived2.mp3"}),Wn.chatResponseReceived3=Wn.register({fileName:"chatResponseReceived3.mp3"}),Wn.chatResponseReceived4=Wn.register({fileName:"chatResponseReceived4.mp3"}),Wn.clear=Wn.register({fileName:"clear.mp3"}),Wn.save=Wn.register({fileName:"save.mp3"}),Wn.format=Wn.register({fileName:"format.mp3"}),Wn.voiceRecordingStarted=Wn.register({fileName:"voiceRecordingStarted.mp3"}),Wn.voiceRecordingStopped=Wn.register({fileName:"voiceRecordingStopped.mp3"}),Wn.progress=Wn.register({fileName:"progress.mp3"});let go=Wn;class T0t{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 qi=class qi{constructor(e,t,i,n,r,o){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=r,this.announcementMessage=o}static register(e){const t=new T0t("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new qi(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return qi._signals.add(i),i}static get allAccessibilitySignals(){return[...this._signals]}};qi._signals=new Set,qi.errorAtPosition=qi.register({name:g(2242,"Error at Position"),sound:go.error,announcementMessage:g(2243,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),qi.warningAtPosition=qi.register({name:g(2244,"Warning at Position"),sound:go.warning,announcementMessage:g(2245,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),qi.errorOnLine=qi.register({name:g(2246,"Error on Line"),sound:go.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:g(2247,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),qi.warningOnLine=qi.register({name:g(2248,"Warning on Line"),sound:go.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:g(2249,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),qi.foldedArea=qi.register({name:g(2250,"Folded Area on Line"),sound:go.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:g(2251,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),qi.break=qi.register({name:g(2252,"Breakpoint on Line"),sound:go.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:g(2253,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),qi.inlineSuggestion=qi.register({name:g(2254,"Inline Suggestion on Line"),sound:go.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),qi.terminalQuickFix=qi.register({name:g(2255,"Terminal Quick Fix"),sound:go.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:g(2256,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),qi.onDebugBreak=qi.register({name:g(2257,"Debugger Stopped on Breakpoint"),sound:go.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:g(2258,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),qi.noInlayHints=qi.register({name:g(2259,"No Inlay Hints on Line"),sound:go.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:g(2260,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),qi.taskCompleted=qi.register({name:g(2261,"Task Completed"),sound:go.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:g(2262,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),qi.taskFailed=qi.register({name:g(2263,"Task Failed"),sound:go.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:g(2264,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),qi.terminalCommandFailed=qi.register({name:g(2265,"Terminal Command Failed"),sound:go.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:g(2266,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),qi.terminalCommandSucceeded=qi.register({name:g(2267,"Terminal Command Succeeded"),sound:go.success,announcementMessage:g(2268,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),qi.terminalBell=qi.register({name:g(2269,"Terminal Bell"),sound:go.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:g(2270,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),qi.notebookCellCompleted=qi.register({name:g(2271,"Notebook Cell Completed"),sound:go.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:g(2272,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),qi.notebookCellFailed=qi.register({name:g(2273,"Notebook Cell Failed"),sound:go.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:g(2274,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),qi.diffLineInserted=qi.register({name:g(2275,"Diff Line Inserted"),sound:go.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),qi.diffLineDeleted=qi.register({name:g(2276,"Diff Line Deleted"),sound:go.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),qi.diffLineModified=qi.register({name:g(2277,"Diff Line Modified"),sound:go.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),qi.chatRequestSent=qi.register({name:g(2278,"Chat Request Sent"),sound:go.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:g(2279,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),qi.chatResponseReceived=qi.register({name:g(2280,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[go.chatResponseReceived1,go.chatResponseReceived2,go.chatResponseReceived3,go.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),qi.progress=qi.register({name:g(2281,"Progress"),sound:go.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:g(2282,"Progress"),settingsKey:"accessibility.signals.progress"}),qi.clear=qi.register({name:g(2283,"Clear"),sound:go.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:g(2284,"Clear"),settingsKey:"accessibility.signals.clear"}),qi.save=qi.register({name:g(2285,"Save"),sound:go.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:g(2286,"Save"),settingsKey:"accessibility.signals.save"}),qi.format=qi.register({name:g(2287,"Format"),sound:go.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:g(2288,"Format"),settingsKey:"accessibility.signals.format"}),qi.voiceRecordingStarted=qi.register({name:g(2289,"Voice Recording Started"),sound:go.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),qi.voiceRecordingStopped=qi.register({name:g(2290,"Voice Recording Stopped"),sound:go.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});let ll=qi;var L0t=".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}";gt(L0t,{});const R0t=oi("diff-review-insert",ve.add,g(5250,"Icon for 'Insert' in accessible diff viewer.")),M0t=oi("diff-review-remove",ve.remove,g(5251,"Icon for 'Remove' in accessible diff viewer.")),N0t=oi("diff-review-close",ve.close,g(5252,"Icon for 'Close' in accessible diff viewer."));var CB;let Px=(CB=class extends V{constructor(e,t,i,n,r,o,a,c,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=r,this._height=o,this._diffs=a,this._models=c,this._instantiationService=l,this._state=TI(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(kve,this._diffs,this._models,this._setVisible,this._canClose)),p=h.add(this._instantiationService.createInstance(Ive,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:p}}).recomputeInitiallyAndOnChange(this._store)}next(){is(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){is(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){is(e=>{this._setVisible(!1,e)})}},CB._ttPolicy=ZA("diffReview",{createHTML:e=>e}),CB);Px=D([_(8,we)],Px);let kve=class extends V{constructor(e,t,i,n,r){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=r,this._groups=Yt(this,[]),this._currentGroupIdx=Yt(this,0),this._currentElementIdx=Yt(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((o,a)=>this._groups.read(a)[o]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((o,a)=>this.currentGroup.read(a)?.lines[o]),this._register(ci(o=>{const a=this._diffs.read(o);if(!a){this._groups.set([],void 0);return}const c=P0t(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());is(l=>{const d=this._models.getModifiedPosition();if(d){const h=c.findIndex(u=>d?.lineNumber{const a=this.currentElement.read(o);a?.type===Gh.Deleted?this._accessibilitySignalService.playSignal(ll.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===Gh.Added&&this._accessibilitySignalService.playSignal(ll.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(ci(o=>{const a=this.currentElement.read(o);if(a&&a.type!==Gh.Header){const c=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(F.fromPositions(new re(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||IM(t,n=>{this._currentGroupIdx.set(_i.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||is(i=>{this._currentElementIdx.set(_i.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&&is(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===Gh.Deleted?this._models.originalReveal(F.fromPositions(new re(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==Gh.Header?F.fromPositions(new re(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};kve=D([_(4,uv)],kve);const x4=3;function P0t(s,e,t){const i=[];for(const n of cTe(s,(r,o)=>o.modified.startLineNumber-r.modified.endLineNumberExclusive<2*x4)){const r=[];r.push(new O0t);const o=new mi(Math.max(1,n[0].original.startLineNumber-x4),Math.min(n[n.length-1].original.endLineNumberExclusive+x4,e+1)),a=new mi(Math.max(1,n[0].modified.startLineNumber-x4),Math.min(n[n.length-1].modified.endLineNumberExclusive+x4,t+1));HGe(n,(d,h)=>{const u=new mi(d?d.original.endLineNumberExclusive:o.startLineNumber,h?h.original.startLineNumber:o.endLineNumberExclusive),f=new mi(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(p=>{r.push(new H0t(p,f.startLineNumber+(p-u.startLineNumber)))}),h&&(h.original.forEach(p=>{r.push(new B0t(h,p))}),h.modified.forEach(p=>{r.push(new W0t(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 F0t(new N_(c,l),r))}return i}var Gh;(function(s){s[s.Header=0]="Header",s[s.Unchanged=1]="Unchanged",s[s.Deleted=2]="Deleted",s[s.Added=3]="Added"})(Gh||(Gh={}));class F0t{constructor(e,t){this.range=e,this.lines=t}}class O0t{constructor(){this.type=Gh.Header}}class B0t{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=Gh.Deleted,this.modifiedLineNumber=void 0}}class W0t{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=Gh.Added,this.originalLineNumber=void 0}}class H0t{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=Gh.Unchanged}}let Ive=class extends V{constructor(e,t,i,n,r,o){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._models=r,this._languageService=o,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 gd(a)),this._register(ci(c=>{this._actionBar.clear(),this._model.canClose.read(c)&&this._actionBar.push(new an("diffreview.close",g(5253,"Close"),"close-diff-review "+He.asClassName(N0t),!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 MU(this._content,{})),ca(this.domNode,this._scrollbar.getDomNode(),a),this._register(ci(c=>{this._height.read(c),this._width.read(c),this._scrollbar.scanDomNode()})),this._register(Ee(()=>{ca(this.domNode)})),this._register(NA(this.domNode,{width:this._width,height:this._height})),this._register(NA(this._content,{width:this._width,height:this._height})),this._register(du((c,l)=>{this._model.currentGroup.read(c),this._render(l)})),this._register(Rr(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.")),Il(n,i.get(x.fontInfo)),ca(this._content,n);const r=this._models.getOriginalModel(),o=this._models.getModifiedModel();if(!r||!o)return;const a=r.getOptions(),c=o.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===Gh.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,r,a,i,o,c);n.appendChild(u);const f=et(p=>this._model.currentElement.read(p)===h);e.add(ci(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,r,o,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 Gh.Added:p="diff-review-row line-insert",m=" char-insert",b=R0t;break;case Gh.Deleted:p="diff-review-row line-delete",m=" char-delete",b=M0t;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=He.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);Px._ttPolicy&&(R=Px._ttPolicy.createHTML(R)),y.insertAdjacentHTML("beforeend",R),k=c.getLineContent(e.modifiedLineNumber)}else{let R=this._getLineHtml(r,n,o.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Px._ttPolicy&&(R=Px._ttPolicy.createHTML(R)),y.insertAdjacentHTML("beforeend",R),k=r.getLineContent(e.originalLineNumber)}k.length===0&&(k=g(5259,"blank"));let P="";switch(e.type){case Gh.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 Gh.Added:P=g(5262,"+ {0} modified line {1}",k,e.modifiedLineNumber);break;case Gh.Deleted:P=g(5263,"- {0} original line {1}",k,e.originalLineNumber);break}return w.setAttribute("aria-label",P),w}_getLineHtml(e,t,i,n,r){const o=e.getLineContent(n),a=t.get(x.fontInfo),c=pd.createEmpty(o,r),l=_p.isBasicASCII(o,e.mightContainNonBasicASCII()),d=_p.containsRTL(o,l,e.mightContainRTL());return aae(new DI(a.isMonospace&&!t.get(x.disableMonospaceOptimizations),a.canUseHalfwidthRightwardsArrow,o,!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)!==Ok.OFF,null)).html}};Ive=D([_(5,Di)],Ive);class U0t{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 V0t=oi("diff-insert",ve.add,g(4991,"Line decoration for inserts in the diff editor.")),nXe=oi("diff-remove",ve.remove,g(4992,"Line decoration for removals in the diff editor.")),OJ=Kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+He.asClassName(V0t),marginClassName:"gutter-insert"}),W3=Kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+He.asClassName(nXe),marginClassName:"gutter-delete"}),jWe=Kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),YWe=Kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),BJ=Kt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),jRe=Kt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),YRe=Kt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),pW=Kt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),JRe=Kt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),XRe=Kt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class z0t{get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=Yt(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}}class O6{static fromFn(e){return new O6(e())}constructor(e){this._value=Yt(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(is(i=>{this._value.set(new JWe(t,void 0),i)}),t),t=>{throw is(i=>{this._value.set(new JWe(void 0,t),i)}),t})}}class JWe{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}class $0t{constructor(e){this._computePromise=e,this._lazyValue=new z0t(()=>new O6(this._computePromise())),this.cachedPromiseResult=et(this,t=>this._lazyValue.cachedValue.read(t)?.promiseResult.read(t))}getPromise(){return this._lazyValue.getValue().promise}}function B5(s,e,t,i){return e||(e=n=>n!=null),new Promise((n,r)=>{let o=!0,a=!1;const c=s.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),l=ci(d=>{const{isFinished:h,error:u,state:f}=c.read(d);(h||u)&&(o?a=!0:l.dispose(),u?r(u===!0?f:u):n(f))});if(i){const d=i.onCancellationRequested(()=>{l.dispose(),d.dispose(),r(new Pa)});if(i.isCancellationRequested){l.dispose(),d.dispose(),r(new Pa);return}}o=!1,a&&l.dispose()})}var g0;const B6=ae("diffProviderFactoryService");let Tve=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(Lve,e)}};Tve=D([_(0,we)],Tve);ce(B6,Tve,Qt.Delayed);var CL;let Lve=(CL=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 Y_(new mi(1,2),new mi(1,t.getLineCount()+1),[new Qp(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const r=JSON.stringify([e.uri.toString(),t.uri.toString()]),o=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=g0.diffCache.get(r);if(a&&a.context===o)return a.result;const c=Ys.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 g0.diffCache.size>10&&g0.diffCache.delete(g0.diffCache.keys().next().value),g0.diffCache.set(r,{result:l,context:o}),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()}},g0=CL,CL.diffCache=new Map,CL);Lve=g0=D([_(1,Fl),_(2,Ji)],Lve);function Qae(){return N2&&!!N2.VSCODE_DEV}function sXe(s){if(Qae()){const e=G0t();return e.add(s),{dispose(){e.delete(s)}}}else return{dispose(){}}}function G0t(){wK||(wK=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 wK){const r=n(t);r&&i.push(r)}if(i.length>0)return n=>{let r=!1;for(const o of i)o(n)&&(r=!0);return r}}),wK}let wK;Qae()&&sXe(({oldExports:s,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{for(const n in i){const r=i[n];if(console.log(`[hot-reload] Patching prototype methods of '${n}'`,{exportedItem:r}),typeof r=="function"&&r.prototype){const o=s[n];if(o){for(const a of Object.getOwnPropertyNames(r.prototype)){const c=Object.getOwnPropertyDescriptor(r.prototype,a),l=Object.getOwnPropertyDescriptor(o.prototype,a);c?.value?.toString()!==l?.value?.toString()&&console.log(`[hot-reload] Patching prototype method '${n}.${a}'`),Object.defineProperty(o.prototype,a,c)}i[n]=o}}}return!0}});function Wg(s,e){return K0t([s],e),s}function K0t(s,e){Qae()&&sd("reload",i=>sXe(({oldExports:n})=>{if([...Object.values(n)].some(r=>s.includes(r)))return r=>(i(void 0),!0)})).read(e)}let WJ=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=Yt(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Yt(this,void 0),this.diff=this._diff,this._unchangedRegions=Yt(this,void 0),this.unchangedRegions=et(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(is(c=>{for(const l of this._unchangedRegions.get()?.regions||[])l.collapseAll(c)}),[])),this.movedTextToCompare=Yt(this,void 0),this._activeMovedText=Yt(this,void 0),this._hoveredMovedText=Yt(this,void 0),this.activeMovedText=et(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new li,this._diffProvider=et(this,a=>{const c=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),l=sd("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:l}}),this._register(Ee(()=>this._cancellationTokenSource.cancel()));const n=_C("contentChangedSignal"),r=this._register(new ln(()=>n.trigger(void 0),200));this._register(ci(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?mi.fromRangeInclusive(p):void 0),d=c.modifiedDecorationIds.map(p=>e.modified.getDecorationRange(p)).map(p=>p?mi.fromRangeInclusive(p):void 0),h=c.regions.map((p,m)=>!l[m]||!d[m]?void 0:new Fx(l[m].startLineNumber,d[m].startLineNumber,l[m].length,p.visibleLineCountTop.read(a),p.visibleLineCountBottom.read(a))).filter(Oc),u=[];let f=!1;for(const p of cTe(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 Fx(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"}})));is(v=>{this._unchangedRegions.set({regions:u,originalDecorationIds:p,modifiedDecorationIds:m},v)})}}));const o=(a,c,l)=>{const d=Fx.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?mi.fromRangeInclusive(C):void 0),b=u.modifiedDecorationIds.map(C=>e.modified.getDecorationRange(C)).map(C=>C?mi.fromRangeInclusive(C):void 0);let y=D0t(u.regions.map((C,A)=>{if(!v[A]||!b[A])return;const L=v[A].length;return new Fx(v[A].startLineNumber,b[A].startLineNumber,L,Math.min(C.visibleLineCountTop.get(),L),Math.min(C.visibleLineCountBottom.get(),L-C.visibleLineCountTop.get()))}).filter(Oc),(C,A)=>!A||C.modifiedLineNumber>=A.modifiedLineNumber+A.lineCount&&C.originalLineNumber>=A.originalLineNumber+A.lineCount).map(C=>new N_(C.getHiddenOriginalRange(l),C.getHiddenModifiedRange(l)));y=N_.clip(y,mi.ofLength(1,e.original.getLineCount()),mi.ofLength(1,e.modified.getLineCount())),h=N_.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()&&LS.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(e.original.onDidChangeContent(a=>{this._diff.get()&&LS.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(du(async(a,c)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),r.cancel(),n.read(a);const l=this._diffProvider.read(a);l.onChangeSignal.read(a),Wg(oQe,a),Wg(Ype,a),this._isDiffUpToDate.set(!1,void 0);let d=[];c.add(e.original.onDidChangeContent(f=>{const p=LS.fromModelContentChanges(f.changes);d=LY(d,p)}));let h=[];c.add(e.modified.onDidChangeContent(f=>{const p=LS.fromModelContentChanges(f.changes);h=LY(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=q0t(u,e.original,e.modified),u=u,u=u,is(f=>{o(u,f),this._lastDiff=u;const p=ZRe.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 r of n)if(r.getHiddenModifiedRange(void 0).contains(e)){r.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 r of n)if(r.getHiddenOriginalRange(void 0).contains(e)){r.showOriginalLine(e,t,i);return}}async waitForDiff(){await B5(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=>mi.deserialize(n.range)),i=this._unchangedRegions.get();!i||!t||is(n=>{for(const r of i.regions)for(const o of t)if(r.modifiedUnchangedRange.intersect(o)){r.setHiddenModifiedRange(o,n);break}})}};WJ=D([_(2,B6)],WJ);function q0t(s,e,t){return{changes:s.changes.map(i=>new Y_(i.original,i.modified,i.innerChanges?i.innerChanges.map(n=>Q0t(n,e,t)):void 0)),moves:s.moves,identical:s.identical,quitEarly:s.quitEarly}}function Q0t(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 rXe(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 rXe{constructor(e){this.lineRangeMapping=e}}class Fx{static fromDiffs(e,t,i,n,r){const o=Y_.inverse(e,t,i),a=[];for(const c of o){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>=r+n?(u&&!f&&(h-=r),f&&!u&&(l+=r,d+=r,h-=r),a.push(new Fx(l,d,h,0,0))):h>=r*2+n&&(l+=r,d+=r,h-=r*2,a.push(new Fx(l,d,h,0,0)))}return a}get originalUnchangedRange(){return mi.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return mi.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,r){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Yt(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Yt(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=et(this,c=>this.visibleLineCountTop.read(c)+this.visibleLineCountBottom.read(c)===this.lineCount&&!this.isDragged.read(c)),this.isDragged=Yt(this,void 0);const o=Math.max(Math.min(n,this.lineCount),0),a=Math.max(Math.min(r,this.lineCount-n),0);kOe(n===o),kOe(r===a),this._visibleLineCountTop.set(o,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],n=new Xp(e.map(c=>c.modified)).subtractFrom(this.modifiedUnchangedRange);let r=this.originalLineNumber,o=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)-o,u=new Fx(r,o,h,0,0);u.setHiddenModifiedRange(l,t),i.push(u),r=u.originalUnchangedRange.endLineNumberExclusive,o=u.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return mi.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return mi.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()),r=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===m_.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 an("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 an("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()===Eh.LF?` `:`\r -`),await this._clipboardService.writeText(y)})),i.getOption(x.readOnly)||v.push(new an("diff.inline.revertChange",g(9962,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Rr(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:m,height:v}=So(this._diffActions),b=Math.floor(d/3);p.preventDefault(),f(p.posx,m+v+b)})),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:n}=So(e),r=t-n,o=Math.floor(r/i),a=o*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let c=0;for(let l=0;ls});function oXe(s,e,t,i){kl(i,e.fontInfo);const n=t.length>0,r=new kU(1e4);let o=0,a=0;const c=[];for(let u=0;u');const c=e.getLineContent(),l=_p.isBasicASCII(c,n),d=_p.containsRTL(c,l,r),h=p6(new DI(o.fontInfo.isMonospace&&!o.disableMonospaceOptimizations,o.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,l,d,0,e,t,o.tabSize,0,o.fontInfo.spaceWidth,o.fontInfo.middotWidth,o.fontInfo.wsmiddotWidth,o.stopRenderingLineAfter,o.renderWhitespace,o.renderControlCharacters,o.fontLigatures!==Ok.OFF,null),a);return a.appendString(""),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}let Rve=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=r,this._canIgnoreViewZoneUpdateEvent=o,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=c,this._clipboardService=l,this._contextMenuService=d,this._originalTopPadding=Yt(this,0),this._originalScrollOffset=Yt(this,0),this._originalScrollOffsetAnimated=GWe(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Yt(this,0),this._modifiedScrollOffset=Yt(this,0),this._modifiedScrollOffsetAnimated=GWe(this._targetWindow,this._modifiedScrollOffset,this._store);const h=Yt("invalidateAlignmentsState",0),u=this._register(new ln(()=>{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?qn(this,y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===lD.Completed):void 0).map((y,C)=>y?.read(C)),p=et(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 eHe(this._editors.original,this._editors.modified,A.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),m=et(y=>{const C=this._diffModel.read(y)?.movedTextToCompare.read(y);if(!C)return null;h.read(y);const A=C.changes.map(L=>new rXe(L));return eHe(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=TI(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 dt of A)if(dt.diff)for(let Dt=dt.originalRange.startLineNumber;DtNe.getLineCount())return{orig:L,mod:k};G?.addRequest(Ne.getLineContent(Dt),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,Be=this._editors.original.getModel()?.mightContainRTL()??!1,Ct=jae.fromEditor(this._editors.modified);for(const Ne of A)if(Ne.diff&&!z&&(!this._options.useTrueInlineDiffRendering.read(y)||!eMe(Ne.diff))){if(!Ne.originalRange.isEmpty){f.read(y);const Dt=document.createElement("div");Dt.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Xi=this._editors.original.getModel();if(Ne.originalRange.endLineNumberExclusive-1>Xi.getLineCount())return{orig:L,mod:k};const Ti=new aXe(Ne.originalRange.mapToLineArray(hs=>Xi.tokenization.getLineTokens(hs)),Ne.originalRange.mapToLineArray(hs=>Y[j++]),De,Be),ss=[];for(const hs of Ne.diff.innerChanges||[])ss.push(new WO(hs.originalRange.delta(-(Ne.diff.original.startLineNumber-1)),pW.className,Xa.Regular));const $s=oXe(Ti,Ct,ss,Dt),Fn=document.createElement("div");if(Fn.className="inline-deleted-margin-view-zone",kl(Fn,Ct.fontInfo),this._options.renderIndicators.read(y))for(let hs=0;hs<$s.heightInLines;hs++){const Zr=document.createElement("div");Zr.className=`delete-sign ${He.asClassName(nXe)}`,Zr.setAttribute("style",`position:absolute;top:${hs*ne}px;width:${Ct.lineDecorationsWidth}px;height:${ne}px;right:0;`),Fn.appendChild(Zr)}let Zo;b.add(new j0t(()=>Qn(Zo),Fn,this._editors.modified,Ne.diff,this._diffEditorWidget,$s.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let hs=0;hs<$s.viewLineCounts.length;hs++){const Zr=$s.viewLineCounts[hs];Zr>1&&L.push({afterLineNumber:Ne.originalRange.startLineNumber+hs,domNode:v(),heightInPx:(Zr-1)*ne,showInHiddenAreas:!0,suppressMouseDown:!0})}k.push({afterLineNumber:Ne.modifiedRange.startLineNumber-1,domNode:Dt,heightInPx:$s.heightInLines*ne,minWidthInPx:$s.minWidthInPx,marginDomNode:Fn,setZoneId(hs){Zo=hs},showInHiddenAreas:!0,suppressMouseDown:!0})}const dt=document.createElement("div");dt.className="gutter-delete",L.push({afterLineNumber:Ne.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Ne.modifiedHeightInPx,marginDomNode:dt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const dt=Ne.modifiedHeightInPx-Ne.originalHeightInPx;if(dt>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:dt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Dt=function(){const Ti=document.createElement("div");return Ti.className="arrow-revert-change "+He.asClassName(ve.arrowRight),C.add(ue(Ti,"mousedown",ss=>ss.stopPropagation())),C.add(ue(Ti,"click",ss=>{ss.stopPropagation(),r.revert(Ne.diff)})),fe("div",{},Ti)};if(ge?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Ne.modifiedRange.endLineNumberExclusive-1))continue;let Xi;Ne.diff&&Ne.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(y)&&(Xi=Dt()),k.push({afterLineNumber:Ne.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-dt,marginDomNode:Xi,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 dt=Ne.modifiedHeightInPx-Ne.originalHeightInPx;dt>0?L.push({afterLineNumber:Ne.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:dt,showInHiddenAreas:!0,suppressMouseDown:!0}):k.push({afterLineNumber:Ne.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-dt,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=qn(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=qn(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(ci(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,_t.Immediate)})),this._register(ci(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,_t.Immediate)})),this._register(ci(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)}))}};Rve=D([_(8,gg),_(9,lo)],Rve);function eHe(s,e,t,i,n,r){const o=new Gy(tHe(s,i)),a=new Gy(tHe(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=o.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}):(o.dequeue(),a.dequeue()),d.push({originalRange:mi.ofLength(v.lineNumber,1),modifiedRange:mi.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(r)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:o*(l-1)})}for(const c of s.getWhitespaces()){if(e.has(c.id))continue;const l=c.afterLineNumber===0?0:r.convertViewPositionToModelPosition(new re(c.afterLineNumber,1)).lineNumber;t.push({lineNumber:l,heightInPx:c.height})}return C0t(t,i,c=>c.lineNumber,(c,l)=>({lineNumber:c.lineNumber,heightInPx:c.heightInPx+l.heightInPx}))}function eMe(s){return s.innerChanges?s.innerChanges.every(e=>iHe(e.modifiedRange)&&iHe(e.originalRange)):!1}function iHe(s){return s.startLineNumber===s.endLineNumber}const Jz=class Jz extends V{constructor(e,t,i,n,r){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=r,this._originalScrollTop=qn(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=qn(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=sd("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Yt(this,0),this._modifiedViewZonesChangedSignal=sd("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=sd("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=TI(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(Be,Ct){const Ne=Ct.getTopForLineNumber(Be.startLineNumber,!0),dt=Ct.getTopForLineNumber(Be.endLineNumberExclusive,!0);return(Ne+dt)/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 _i(ge,De),from:j,to:ne,fromWithoutScroll:R,toWithoutScroll:G,move:k}});v.sort($Ge(Sc(k=>k.fromWithoutScroll>k.toWithoutScroll,Nat),Sc(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,ru)));const b=tMe.compute(v.map(k=>k.range)),w=10,y=p.verticalScrollbarWidth,C=(b.getTrackCount()-1)*10+w*2,A=y+C+(m.contentLeft-Jz.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"),Be=document.createElementNS("http://www.w3.org/2000/svg","path");Be.setAttribute("d",`M 0 ${k.from} L ${R} ${k.from} L ${R} ${k.to} L ${Y-G} ${k.to}`),Be.setAttribute("fill","none"),De.appendChild(Be);const Ct=document.createElementNS("http://www.w3.org/2000/svg","polygon");Ct.classList.add("arrow"),h.add(ci(Ne=>{Be.classList.toggle("currentMove",k.move===u.activeMovedText.read(Ne)),Ct.classList.toggle("currentMove",k.move===u.activeMovedText.read(Ne))})),Ct.setAttribute("points",`${Y-G},${k.to-z/2} ${Y},${k.to} ${Y-G},${k.to+z/2}`),De.appendChild(Ct),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(ci(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-Jz.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(VN(this._state));const o=et(d=>{const u=this._diffModel.read(d)?.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new wF(rd(f.lineRangeMapping.original.startLineNumber-1),18),modified:new wF(rd(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(FJ(this._editors.original,o.map(d=>d.map(h=>h.original)))),this._register(FJ(this._editors.modified,o.map(d=>d.map(h=>h.modified)))),this._register(du((d,h)=>{const u=o.read(d);for(const f of u)h.add(new nHe(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new nHe(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=sd("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),c=sd("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let l="modified";this._register(WU({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)}))}};Jz.movedCodeBlockPadding=4;let tB=Jz;class tMe{static compute(e){const t=[],i=[];for(const n of e){let r=t.findIndex(o=>!o.intersectsStrict(n));r===-1&&(t.length>=6?r=Dat(t,Sc(a=>a.intersectWithRangeLength(n),ru)):(r=t.length,t.push(new qTe))),t[r].addRange(n),i.push(r)}return new tMe(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class nHe extends qRe{constructor(e,t,i,n,r){const o=Wt("div.diff-hidden-lines-widget");super(e,t,o.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=r,this._nodes=Wt("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Wt("div.text-content@textContent"),Wt("div.action-bar@actionBar")]),o.root.appendChild(this._nodes.root);const a=qn(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(NA(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 gd(this._nodes.actionBar,{highlightToggledItems:!0})),d=new an("",c,"",!1);l.push(d,{icon:!1,label:!0});const h=new an("","Compare",He.asClassName(ve.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(ci(u=>{const f=this._diffModel.movedTextToCompare.read(u)===i;h.checked=f})),l.push(h,{icon:!1,label:!0})}}class Y0t extends V{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=et(this,r=>{const o=this._diffModel.read(r),a=o?.diff.read(r);if(!a)return null;const c=this._diffModel.read(r).movedTextToCompare.read(r),l=this._options.renderIndicators.read(r),d=this._options.showEmptyDecorations.read(r),h=[],u=[];if(!c)for(const p of a.mappings)if(p.lineRangeMapping.original.isEmpty||h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:l?W3:YWe}),p.lineRangeMapping.modified.isEmpty||u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:l?OJ:jWe}),p.lineRangeMapping.modified.isEmpty||p.lineRangeMapping.original.isEmpty)p.lineRangeMapping.original.isEmpty||h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:JRe}),p.lineRangeMapping.modified.isEmpty||u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:jRe});else{const m=this._options.useTrueInlineDiffRendering.read(r)&&eMe(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?XRe:pW}),p.lineRangeMapping.modified.contains(v.modifiedRange.startLineNumber)&&u.push({range:v.modifiedRange,options:v.modifiedRange.isEmpty()&&d&&!m?YRe:BJ}),m){const b=o.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?W3:YWe});const v=p.modified.toInclusiveRange();v&&u.push({range:v,options:l?OJ:jWe});for(const b of p.innerChanges||[])h.push({range:b.originalRange,options:pW}),u.push({range:b.modifiedRange,options:BJ})}const f=this._diffModel.read(r).activeMovedText.read(r);for(const p of a.movedTexts)h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(p===f?" currentMove":""),blockPadding:[tB.movedCodeBlockPadding,0,tB.movedCodeBlockPadding,tB.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(PJ(this._editors.original,this._decorations.map(r=>r?.originalDecorations||[]))),this._register(PJ(this._editors.modified,this._decorations.map(r=>r?.modifiedDecorations||[])))}}class J0t{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=I6(this,i=>{const n=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(n,i)},(i,n)=>{const r=this.dimensions.width.get();this._sashRatio.set(i/r,n)}),this._sashRatio=Yt(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),r=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,o=100;return i<=o*2?n:ri-o?i-o:r}}class cXe extends V{constructor(e,t,i,n,r,o){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=r,this._resetSash=o,this._sash=this._register(new Wd(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:pi.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(ci(a=>{const c=this._boundarySashes.read(a);c&&(this._sash.orthogonalEndSash=c.bottom)})),this._register(ci(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 X0t extends V{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=qn(this,this._editor.onDidScrollChange,o=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(o=>o===0),this.modelAttached=qn(this,this._editor.onDidChangeModel,o=>this._editor.hasModel()),this.editorOnDidChangeViewZones=sd("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=sd("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=_C("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(Wt("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),r=new ResizeObserver(()=>{is(o=>{this.domNodeSizeChanged.trigger(o)})});r.observe(this._domNode),this._register(Ee(()=>r.disconnect())),this._register(ci(o=>{n.className=this.isScrollTopZero.read(o)?"":"scroll-decoration"})),this._register(ci(o=>this.render(o)))}dispose(){super.dispose(),ca(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()),r=_i.ofStartAndLength(0,this._domNode.clientHeight);if(!r.isEmpty)for(const o of i){const a=new mi(o.startLineNumber,o.endLineNumber+1),c=this.itemProvider.getIntersectingGutterItems(a,e);is(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=Yt("item",d),b=this.itemProvider.createView(v,m);h=new Z0t(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(_i.ofStartAndLength(u,p),r)}})}for(const o of n){const a=this.views.get(o);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(o)}}}class Z0t{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class lXe extends q_{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class Mve extends tQe{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 ng(e-1,t)}}var e1t=".monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}";gt(e1t,{});class dXe extends V{constructor(e,t,i={orientation:W_.HORIZONTAL}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new yTe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Z),i.hoverDelegate=i.hoverDelegate??this._register(Yk()),this.options=i,this.toggleMenuAction=this._register(new H3(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new gd(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(n,r)=>{if(n.id===H3.ID)return this.toggleMenuActionViewItem=new cA(n,n.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:He.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 o=i.actionViewItemProvider(n,r);if(o)return o}if(n instanceof Hk){const o=new cA(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 o.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(o),this.disposables.add(this._onDidChangeDropdownVisibility.add(o.onDidChangeVisibility)),o}}}))}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 Hse=class Hse extends an{constructor(e,t){t=t||g(10094,"More Actions..."),super(Hse.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}};Hse.ID="toolbar.toggle.more";let H3=Hse;var hA;(function(s){s[s.NoHide=-1]="NoHide",s[s.Ignore=0]="Ignore",s[s.RenderInSecondaryGroup=1]="RenderInSecondaryGroup"})(hA||(hA={}));let mW=class extends dXe{constructor(e,t,i,n,r,o,a,c){super(e,r,{getKeyBinding:d=>o.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=r,this._keybindingService=o,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(),r=t.slice(),o=[];let a=0;const c=[];let l=!1;if(this._options?.hiddenItemStrategy!==hA.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))}}vM(n),vM(c),super.setActions(n,Eo.join(c,r)),(o.length>0||n.length>0)&&this._sessionDisposables.add(ue(this.getElement(),"contextmenu",d=>{const h=new Dh(lt(this.getElement()),d),u=this.getItemAction(h.target);if(!u)return;h.preventDefault(),h.stopPropagation();const f=[];if(u instanceof Ac&&u.menuKeybinding)f.push(u.menuKeybinding);else if(!(u instanceof Ny||u instanceof H3)){const m=!!this._keybindingService.lookupKeybinding(u.id);f.push(XJe(this._commandService,this._keybindingService,u.id,void 0,m))}if(o.length>0){let m=!1;if(a===1&&this._options?.hiddenItemStrategy===hA.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})}))}};mW=D([_(2,Ba),_(3,Le),_(4,lo),_(5,Vt),_(6,bi),_(7,Ji)],mW);let Cm=class extends mW{constructor(e,t,i,n,r,o,a,c,l){super(e,{resetMenu:t,...i},n,r,o,a,c,l),this._onDidChangeMenuItems=this._store.add(new I),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(n.createMenu(t,r,{emitEventsForSubmenuChanges:!0})),h=()=>{const u=[],f=[];vC(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 Pi("This toolbar is populated from a menu.")}};Cm=D([_(3,Ba),_(4,Le),_(5,lo),_(6,Vt),_(7,bi),_(8,Ji)],Cm);const iue=[],yK=35;let Nve=class extends V{constructor(e,t,i,n,r,o,a,c,l){super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=r,this._boundarySashes=o,this._instantiationService=a,this._contextKeyService=c,this._menuService=l,this._menu=this._register(this._menuService.createMenu(_e.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=qn(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=et(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=et(this,d=>this._hasActions.read(d)?yK:0),this.elements=Wt("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:yK+"px"}},[]),this._currentDiff=et(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=et(this,d=>{const u=this._diffModel.read(d)?.diff.read(d);if(!u)return iue;const f=this._editors.modifiedSelections.read(d);if(f.every(b=>b.isEmpty()))return iue;const p=new Xp(f.map(b=>mi.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)?iue:v}),this._register(S0t(e,this.elements.root)),this._register(ue(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(NA(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),vh(this,d=>this._showSash.read(d)?new cXe(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,I6(this,u=>this._sashLayout.sashLeft.read(u)-yK,(u,f)=>this._sashLayout.sashLeft.set(u+yK,f)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new X0t(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=Y_.fromRangeMappings(p.flatMap(b=>b.rangeMappings));return[new sHe(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 sHe(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 Mve(this._editors.modifiedModel.get()),n=new Mve(this._editors.original.getModel());return new G2(t.map(a=>a.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};Nve=D([_(6,we),_(7,Le),_(8,Ba)],Nve);class sHe{constructor(e,t,i,n,r,o){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=r,this.modifiedUri=o}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=Wt("div.gutterItem",{style:{height:"20px",width:"34px"}},[Wt("div.background@background",{},[]),Wt("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,o=>o.showAlways),this._menuId=this._item.map(this,o=>o.menuId),this._isSmall=Yt(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const r=this._register(n.createInstance(RM,"element",!0,{position:{hoverPosition:vr.RIGHT}}));this._register(bF(t,this._elements.root)),this._register(ci(o=>{const a=this._showAlways.read(o);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(du((o,a)=>{this._elements.buttons.replaceChildren();const c=a.add(n.createInstance(Cm,this._elements.buttons,this._menuId.read(o),{orientation:W_.VERTICAL,hoverDelegate:r,toolbarOptions:{primaryGroup:l=>l.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(o)?1:3},hiddenItemStrategy:hA.Ignore,actionRunner:new lXe(()=>{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,r=i;let o=e.start+n;const a=_i.tryCreate(r,t.endExclusive-r-i),c=_i.tryCreate(e.start+r,e.endExclusive-i-r);c&&a&&c.start{const n=YE._map.get(e);n&&(YE._map.delete(e),n.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new BU(()=>{}))}_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=Yt(this,this.editor.getModel()),this.model=this._model,this.isReadonly=qn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.readOnly)),this._versionId=DJ({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=DJ({owner:this,equalsFn:jq(sW(ht.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=Zh({owner:this,equalsFn:jq(sW(re.equals))},t=>this.selections.read(t)?.map(i=>i.getStartPosition())??null),this.isFocused=qn(this,t=>{const i=this.editor.onDidFocusEditorWidget(t),n=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.hasWidgetFocus()),this.value=I6(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=et(this,t=>(this.versionId.read(t),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=Zh({owner:this,equalsFn:jq(ht.selectionsEqual)},t=>this.selections.read(t)?.[0]??null),this.cursorPosition=Zh({owner:this,equalsFn:re.equals},t=>this.selections.read(t)?.[0]?.getPosition()??null),this.onDidType=_C(this),this.scrollTop=qn(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=qn(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=qn(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(t=>t.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(t=>t.decorationsLeft),this.contentWidth=qn(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 qn(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(T6({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const r=e.read(n);i.set(r)})),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=ci(r=>{e.position.read(r),e.minContentWidthInPx.read(r),this.editor.layoutOverlayWidget(i)});return Ee(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}};YE._map=new Map;let Fve=YE;function Ove(s,e){return lxt({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 t1t(s,e){const t=new Z,i=Ove(s,(n,r)=>{t.clear(),e(n,r,t)});return{dispose(){i.dispose(),t.dispose()}}}var cQ,SL;let HJ=(SL=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=vh(this,c=>{const l=this._editors.modifiedModel.read(c),d=cQ._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===Bi.ContentFlush)return;const l=this._diffModel.get();is(d=>{for(const h of this._editors.original.getSelections()||[])l?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,m_.FromCloserSide,d),l?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,m_.FromCloserSide,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===Bi.ContentFlush)return;const l=this._diffModel.get();is(d=>{for(const h of this._editors.modified.getSelections()||[])l?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,m_.FromCloserSide,d),l?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,m_.FromCloserSide,d)})}));const r=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=TI(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=r.read(c);for(let v=0;vb.getHiddenOriginalRange(C).startLineNumber-1),y=new wF(w,12);h.push(y),l.add(new rHe(this._editors.original,y,b,!f))}{const w=et(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),y=new wF(w,12);u.push(y),l.add(new rHe(this._editors.modified,y,b))}}else{{const w=et(this,C=>b.getHiddenOriginalRange(C).startLineNumber-1),y=new wF(w,24);h.push(y),l.add(new oHe(this._editors.original,y,b,b.originalUnchangedRange,!f,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,m_.FromBottom,void 0),this._options))}{const w=et(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),y=new wF(w,24);u.push(y),l.add(new oHe(this._editors.modified,y,b,b.modifiedUnchangedRange,!1,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,m_.FromBottom,void 0),this._options))}}}return{origViewZones:h,modViewZones:u}});const o={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Nt(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(g(5244,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+He.asClassName(ve.fold),zIndex:10001};this._register(PJ(this._editors.original,et(this,c=>{const l=r.read(c),d=l.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:o}));for(const h of l)h.shouldHideControls(c)&&d.push({range:F.fromPositions(new re(h.originalLineNumber,1)),options:a});return d}))),this._register(PJ(this._editors.modified,et(this,c=>{const l=r.read(c),d=l.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:o}));for(const h of l)h.shouldHideControls(c)&&d.push({range:mi.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(ci(c=>{const l=r.read(c);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(l.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(Oc)),this._editors.modified.setHiddenAreas(l.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(Oc))}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()}}))}},cQ=SL,SL._breadcrumbsSourceFactory=Yt(cQ,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),SL);HJ=cQ=D([_(3,we)],HJ);class rHe extends qRe{constructor(e,t,i,n=!1){const r=Wt("div.diff-hidden-lines-widget");super(e,t,r.root),this._unchangedRegion=i,this._hide=n,this._nodes=Wt("div.diff-hidden-lines-compact",[Wt("div.line-left",[]),Wt("div.text@text",[]),Wt("div.line-right",[])]),r.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(ci(o=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(o).length,c=g(5245,"{0} hidden lines",a);this._nodes.text.innerText=c}}))}}class oHe extends qRe{constructor(e,t,i,n,r,o,a,c){const l=Wt("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=r,this._modifiedOutlineSource=o,this._revealModifiedHiddenLine=a,this._options=c,this._nodes=Wt("div.diff-hidden-lines",[Wt("div.top@top",{title:g(5246,"Click or drag to show more above")}),Wt("div.center@content",{style:{display:"flex"}},[Wt("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)}},...Ib("$(unfold)"))]),Wt("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Wt("div.bottom@bottom",{title:g(5248,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root),this._hide?ca(this._nodes.first):this._register(NA(this._nodes.first,{width:eu(this._editor).layoutInfoContentLeft})),this._register(ci(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=lt(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=lt(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(ci(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)}}}}ca(this._nodes.others,...u)}))}}var Cv,VS;let _W=(VS=class extends V{constructor(e,t,i,n,r,o,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=r,this._modifiedEditorLayoutInfo=o,this._themeService=a,this.width=Cv.ENTIRE_DIFF_OVERVIEW_WIDTH;const c=qn(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),l=et(u=>{const f=c.read(u),p=f.getColor(Upt)||(f.getColor(wy)||nme).transparent(2),m=f.getColor(Vpt)||(f.getColor(cF)||sme).transparent(2);return{insertColor:p,removeColor:m}}),d=ds(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=Wt("div.diffOverview",{style:{position:"absolute",top:"0px",width:Cv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(bF(h,d.domNode)),this._register(Rr(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(bF(this._rootElement,h)),this._register(du((u,f)=>{const p=this._diffModel.read(u),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(f.add(m),f.add(bF(h,m.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(f.add(v),f.add(bF(h,v.getDomNode()))),!m||!v)return;const b=sd("viewZoneChanged",this._editors.original.onDidChangeViewZones),w=sd("viewZoneChanged",this._editors.modified.onDidChangeViewZones),y=sd("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),C=sd("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(ci(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 re(ge.startLineNumber,1)),Be=ne.coordinatesConverter.convertModelPositionToViewPosition(new re(ge.endLineNumberExclusive,1)),Ct=Be.lineNumber-De.lineNumber;return new gje(De.lineNumber,Be.lineNumber,Ct,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(ci(A=>{const L=this._rootHeight.read(A),k=this._rootWidth.read(A),P=this._modifiedEditorLayoutInfo.read(A);if(P){const R=Cv.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Cv.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:L,right:R+Cv.ONE_OVERVIEW_WIDTH,width:Cv.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:L,right:0,width:Cv.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 X2(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-Cv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(Cv.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},Cv=VS,VS.ONE_OVERVIEW_WIDTH=15,VS.ENTIRE_DIFF_OVERVIEW_WIDTH=VS.ONE_OVERVIEW_WIDTH*2,VS);_W=Cv=D([_(6,mn)],_W);const nue=[];class i1t extends V{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=et(this,r=>{const a=this._diffModel.read(r)?.diff.read(r);if(!a)return nue;const c=this._editors.modifiedSelections.read(r);if(c.every(u=>u.isEmpty()))return nue;const l=new Xp(c.map(u=>mi.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)?nue:h}),this._register(du((r,o)=>{if(!this._options.shouldRenderOldRevertArrows.read(r))return;const a=this._diffModel.read(r),c=a?.diff.read(r);if(!a||!c||a.movedTextToCompare.read(r))return;const l=[],d=this._selectedDiffs.read(r),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(r),f=o.add(new UJ(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=o.add(new UJ(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(f),l.push(f)}o.add(Ee(()=>{for(const u of l)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}const Use=class Use 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${Use.counter++}`,this._domNode=Wt("div.revertButton",{title:this._revertSelection?g(5268,"Revert Selected Changes"):g(5269,"Revert Change")},[eC(ve.arrowRight)]).root,this._register(ue(this._domNode,ke.MOUSE_DOWN,r=>{r.button!==2&&(r.stopPropagation(),r.preventDefault())})),this._register(ue(this._domNode,ke.MOUSE_UP,r=>{r.stopPropagation(),r.preventDefault()})),this._register(ue(this._domNode,ke.CLICK,r=>{this._diffs instanceof N_?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),r.stopPropagation(),r.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:j_.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};Use.counter=0;let UJ=Use,Bve=class extends V{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,r,o,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=r,this._instantiationService=o,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=qn(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=qn(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=eu(this.modified),this.originalObs=eu(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=qn(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=Zh({owner:this,equalsFn:re.equals},c=>this.modifiedSelections.read(c)[0]?.getPosition()??new re(1,1)),this.originalCursor=qn(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new re(1,1)),this.isOriginalFocused=eu(this.original).isFocused,this.isModifiedFocused=eu(this.modified).isFocused,this.isFocused=et(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(WU({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 r=this._createInnerEditor(e,t,i,n);return this._register(r.onDidContentSizeChange(o=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+_W.ENTIRE_DIFF_OVERVIEW_WIDTH,c=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:c,contentWidth:a,contentHeightChanged:o.contentHeightChanged,contentWidthChanged:o.contentWidthChanged})})),r}_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=Ch.revealHorizontalRightPadding.defaultValue+_W.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,""):""}};Bve=D([_(5,we),_(6,Vt)],Bve);const Vse=class Vse extends V{constructor(){super(...arguments),this._id=++Vse.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=_t.Smooth){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=_t.Smooth){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=_t.Smooth){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=_t.Smooth){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=_t.Smooth){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=_t.Smooth){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=_t.Smooth){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=_t.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=_t.Smooth){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=_t.Smooth){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=_t.Smooth){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=_t.Smooth){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=_t.Smooth,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=_t.Smooth){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=_t.Smooth){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=_t.Smooth){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=_t.Smooth){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=_t.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)}};Vse.idCounter=0;let Wve=Vse,VJ=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Yt(this,0),this._screenReaderMode=qn(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=et(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=et(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=et(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=et(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=et(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=et(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=et(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=et(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=et(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=et(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=et(this,n=>this._options.read(n).maxComputationTime),this.showMoves=et(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=et(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=et(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=et(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=et(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=et(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=et(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=et(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=et(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.compactMode=et(this,n=>this._options.read(n).compactMode),this.trueInlineDiffRenderingEnabled=et(this,n=>this._options.read(n).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=et(this,n=>!this.renderSideBySide.read(n)&&this.trueInlineDiffRenderingEnabled.read(n)),this.hideUnchangedRegions=et(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=et(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=et(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=et(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount),this._model=Yt(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,n=>fxt(this,r=>{const o=n?.diff.read(r);return o?n1t(o,this.trueInlineDiffRenderingEnabled.read(r)):void 0})).flatten().map(this,n=>!!n),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...aHe(e,Wl)};this._options=Yt(this,i)}updateOptions(e){const t=aHe(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)}};VJ=D([_(1,_o)],VJ);function n1t(s,e){return s.mappings.every(t=>s1t(t.lineRangeMapping)||r1t(t.lineRangeMapping)||e&&eMe(t.lineRangeMapping))}function s1t(s){return s.original.length===0}function r1t(s){return s.modified.length===0}function aHe(s,e){return{enableSplitViewResizing:xt(s.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:rlt(s.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:xt(s.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:xt(s.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:r0(s.maxComputationTime,e.maxComputationTime,0,Vn.MAX_SAFE_SMALL_INTEGER),maxFileSize:r0(s.maxFileSize,e.maxFileSize,0,Vn.MAX_SAFE_SMALL_INTEGER),ignoreTrimWhitespace:xt(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:xt(s.renderIndicators,e.renderIndicators),originalEditable:xt(s.originalEditable,e.originalEditable),diffCodeLens:xt(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:xt(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:qo(s.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:qo(s.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:xt(s.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:xt(s.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:xt(s.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:xt(s.experimental?.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:xt(s.hideUnchangedRegions?.enabled??s.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:r0(s.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,Vn.MAX_SAFE_SMALL_INTEGER),minimumLineCount:r0(s.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,Vn.MAX_SAFE_SMALL_INTEGER),revealLineCount:r0(s.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,Vn.MAX_SAFE_SMALL_INTEGER)},isInEmbeddedEditor:xt(s.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:xt(s.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:r0(s.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,Vn.MAX_SAFE_SMALL_INTEGER),useInlineViewWhenSpaceIsLimited:xt(s.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:xt(s.renderGutterMenu,e.renderGutterMenu),compactMode:xt(s.compactMode,e.compactMode)}}var SB;let yp=(SB=class extends Wve{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}get collapseUnchangedRegions(){return this._options.hideUnchangedRegions.get()}constructor(e,t,i,n,r,o,a,c){super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=r,this._accessibilitySignalService=a,this._editorProgressService=c,this.elements=Wt("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Wt("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Wt("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Wt("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(C3(this,void 0)),this._diffModel=et(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 Vc([Le,this._contextKeyService]))),this._boundarySashes=Yt(this,void 0),this._accessibleDiffViewerShouldBeVisible=Yt(this,!1),this._accessibleDiffViewerVisible=et(this,C=>this._options.onlyShowAccessibleDiffViewer.read(C)?!0:this._accessibleDiffViewerShouldBeVisible.read(C)),this._movedBlocksLinesPart=Yt(this,void 0),this._layoutInfo=et(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 Be=k.sashLeft.read(C),Ct=this._movedBlocksLinesPart.read(C)?.width.read(C)??0;G=0,Y=Be-R-Ct,ge=Be-R,j=Be,ne=A-j-z}else{ge=0;const Be=this._options.inlineViewHideOriginalLineNumbers.read(C);G=R,Be?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),o.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 iXe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(VJ,t),this._register(ci(C=>{this._options.setWidth(this._rootSizeObserver.width.read(C))})),this._contextKeyService.createKey(J.isEmbeddedDiffEditor.key,!1),this._register(Rv(J.isEmbeddedDiffEditor,this._contextKeyService,C=>this._options.isInEmbeddedEditor.read(C))),this._register(Rv(J.comparingMovedCode,this._contextKeyService,C=>!!this._diffModel.read(C)?.movedTextToCompare.read(C))),this._register(Rv(J.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,C=>this._options.couldShowInlineViewBecauseOfSize.read(C))),this._register(Rv(J.diffEditorInlineMode,this._contextKeyService,C=>!this._options.renderSideBySide.read(C))),this._register(Rv(J.hasChanges,this._contextKeyService,C=>(this._diffModel.read(C)?.diff.read(C)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(Bve,this.elements.original,this.elements.modified,this._options,i,(C,A,L,k)=>this._createInnerEditor(C,A,L,k))),this._register(Rv(J.diffEditorOriginalWritable,this._contextKeyService,C=>this._options.originalEditable.read(C))),this._register(Rv(J.diffEditorModifiedWritable,this._contextKeyService,C=>!this._options.readOnly.read(C))),this._register(Rv(J.diffEditorOriginalUri,this._contextKeyService,C=>this._diffModel.read(C)?.model.original.uri.toString()??"")),this._register(Rv(J.diffEditorModifiedUri,this._contextKeyService,C=>this._diffModel.read(C)?.model.modified.uri.toString()??"")),this._overviewRulerPart=vh(this,C=>this._options.renderOverviewRuler.read(C)?this._instantiationService.createInstance(Wg(_W,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 J0t(this._options,l),this._sash=vh(this,C=>{const A=this._options.renderSideBySide.read(C);return this.elements.root.classList.toggle("side-by-side",A),A?new cXe(this.elements.root,l,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=vh(this,C=>this._instantiationService.createInstance(Wg(HJ,C),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);vh(this,C=>this._instantiationService.createInstance(Wg(Y0t,C),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let f=!1;const p=vh(this,C=>this._instantiationService.createInstance(Wg(Rve,C),lt(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.get().isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),m=et(this,C=>{const A=p.read(C).viewZones.read(C).orig,L=d.read(C).viewZones.read(C).origViewZones;return A.concat(L)}),v=et(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(FJ(this._editors.original,m,C=>{f=C},h));let b;this._register(FJ(this._editors.modified,v,C=>{f=C,f?b=ym.capture(this._editors.modified):(b?.restore(this._editors.modified),b=void 0)},u)),this._accessibleDiffViewer=vh(this,C=>this._instantiationService.createInstance(Wg(Px,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 U0t(this._editors))).recomputeInitiallyAndOnChange(this._store);const w=this._accessibleDiffViewerVisible.map(C=>C?"hidden":"visible");this._register(NA(this.elements.modified,{visibility:w})),this._register(NA(this.elements.original,{visibility:w})),this._createDiffEditorContributions(),o.addDiffEditor(this),this._gutter=vh(this,C=>this._options.shouldRenderGutterMenu.read(C)?this._instantiationService.createInstance(Wg(Nve,C),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(VN(this._layoutInfo)),vh(this,C=>new(Wg(tB,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(du((C,A)=>{if(y.read(C)===!0){const L=this._editorProgressService.show(!0,1e3);A.add(Ee(()=>L.done()))}})),this._register(du((C,A)=>{A.add(new(Wg(i1t,C))(this._editors,this._diffModel,this._options,this))})),this._register(du((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=>{bt(new Pi("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(ci(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(Kk,t,i,n)}_createDiffEditorContributions(){const e=dp.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 TU.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(WJ,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?fW.create(e).createNewRef(this):fW.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&&IM(t,n=>{const r=e?.object;qn.batchEventsGlobally(n,()=>{this._editors.original.setModel(r?r.model.original:null),this._editors.modified.setModel(r?r.model.modified:null)});const o=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),n),setTimeout(()=>{o?.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?o1t(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 re(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(r=>r.lineRangeMapping.modified.startLineNumber>i)??t[0]:n=Tk(t,r=>r.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 r=t.getSelection();if(r){const o=this._diffModel.get()?.diff.get()?.mappings.map(a=>e?a.lineRangeMapping.flip():a.lineRangeMapping);if(o){const a=KWe(r.getStartPosition(),o),c=KWe(r.getEndPosition(),o);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&&is(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&is(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===Bi.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(ll.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(ll.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(ll.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}},SB.ENTIRE_DIFF_OVERVIEW_WIDTH=_W.ENTIRE_DIFF_OVERVIEW_WIDTH,SB);yp=D([_(3,Le),_(4,we),_(5,qt),_(6,uv),_(7,nE)],yp);function o1t(s){return s.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,r,o,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?(r=t.modified.startLineNumber-1,o=0,a=void 0):(r=t.modified.startLineNumber,o=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:r,modifiedEndLineNumber:o,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 a1t=0,cHe=!1;function c1t(s){if(!s){if(cHe)return;cHe=!0}cpt(s||ri.document.body)}let iI=class extends Kk{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){const p={...t};p.ariaLabel=p.ariaLabel||oJ.editorViewAccessibleLabel,p.ariaLabel=p.ariaLabel+";"+oJ.accessibilityHelpMessage,super(e,p,{isStandaloneEditor:!0},i,n,r,o,l,d,h,u,f),c instanceof tI?this._standaloneKeybindingService=c:this._standaloneKeybindingService=null,c1t(p.ariaContainerElement),UYe((m,v)=>i.createInstance(RM,m,v,{})),sJe(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_"+ ++a1t,r=he.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,r),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)),r=e.keybindings,o=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(vt.registerCommand(h,l)),a){const f={command:{id:h,title:i},when:n,group:a,order:c};d.add(Yn.appendMenuItem(_e.EditorContext,f))}if(Array.isArray(r))for(const f of r)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,l,o));const u=new pje(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 UY)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};iI=D([_(2,we),_(3,qt),_(4,bi),_(5,Le),_(6,tc),_(7,Vt),_(8,mn),_(9,wi),_(10,_o),_(11,zs),_(12,nt)],iI);let PM=class extends iI{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v){const b={...t};NJ(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,r,o,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||Sa;C=hXe(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){NJ(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)}};PM=D([_(2,we),_(3,qt),_(4,bi),_(5,Le),_(6,tc),_(7,Vt),_(8,hv),_(9,wi),_(10,Te),_(11,_o),_(12,fi),_(13,Di),_(14,zs),_(15,nt)],PM);let zJ=class extends yp{constructor(e,t,i,n,r,o,a,c,l,d,h,u){const f={...t};NJ(c,f,!0);const p=o.registerEditorContainer(e);typeof f.theme=="string"&&o.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&o.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{isStandaloneEditor:!0},n,i,r,u,d),this._configurationService=c,this._standaloneThemeService=o,this._register(p)}dispose(){super.dispose()}updateOptions(e){NJ(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(iI,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)}};zJ=D([_(2,we),_(3,Le),_(4,qt),_(5,hv),_(6,wi),_(7,Te),_(8,lo),_(9,nE),_(10,gg),_(11,uv)],zJ);function hXe(s,e,t,i,n){if(t=t||"",!i){const r=t.indexOf(` -`);let o=t;return r!==-1&&(o=t.substring(0,r)),lHe(s,t,e.createByFilepathOrFirstLine(n||null,o),n)}return lHe(s,t,e.createById(i),n)}function lHe(s,e,t,i){return s.createModel(e,t,i)}var l1t=".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}}}";gt(l1t,{});class d1t{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let $J=class extends V{constructor(e,t,i,n){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=Yt(this,void 0),this._collapsed=et(this,o=>this._viewModel.read(o)?.collapsed.read(o)),this._editorContentHeight=Yt(this,500),this.contentHeight=et(this,o=>(this._collapsed.read(o)?0:this._editorContentHeight.read(o))+this._outerEditorHeight),this._modifiedContentWidth=Yt(this,0),this._modifiedWidth=Yt(this,0),this._originalContentWidth=Yt(this,0),this._originalWidth=Yt(this,0),this.maxScroll=et(this,o=>{const a=this._modifiedContentWidth.read(o)-this._modifiedWidth.read(o),c=this._originalContentWidth.read(o)-this._originalWidth.read(o);return a>c?{maxScroll:a,width:this._modifiedWidth.read(o)}:{maxScroll:c,width:this._originalWidth.read(o)}}),this._elements=Wt("div.multiDiffEntry",[Wt("div.header@header",[Wt("div.header-content",[Wt("div.collapse-button@collapseButton"),Wt("div.file-path",[Wt("div.title.modified.show-file-icons@primaryPath",[]),Wt("div.status.deleted@status",["R"]),Wt("div.title.original.show-file-icons@secondaryPath",[])]),Wt("div.actions@actions")])]),Wt("div.editorParent",[Wt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(yp,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=eu(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=eu(this.editor.getOriginalEditor()).isFocused,this.isFocused=et(this,o=>this.isModifedFocused.read(o)||this.isOriginalFocused.read(o)),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 r=new Zd(this._elements.collapseButton,{});this._register(ci(o=>{r.element.className="",r.icon=this._collapsed.read(o)?ve.chevronRight:ve.chevronDown})),this._register(r.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(ci(o=>{this._elements.editor.style.display=this._collapsed.read(o)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(o=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(o=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(o=>{fV(a=>{this._editorContentHeight.set(o.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(o=>{if(this._isSettingScrollTop||!o.scrollTopChanged||!this._data)return;const a=o.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(ci(o=>{const a=this._viewModel.read(o)?.isActive.read(o);this._elements.root.classList.toggle("active",a)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(Cm,this._elements.actions,_e.MultiDiffEditorFileToolbar,{actionRunner:this._register(new lXe(()=>this._viewModel.get()?.modifiedUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:o=>o.startsWith("navigation")},actionViewItemProvider:(o,a)=>GN(n,o,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){fV(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;fV(n=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let r=!1,o=!1,a=!1,c="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(c="R",r=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(c="A",a=!0):(c="D",o=!0),this._elements.status.classList.toggle("renamed",r),this._elements.status.classList.toggle("deleted",o),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=c,this._resourceLabel2?.setUri(r?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 r=e.length-this._headerHeight,o=Math.max(0,Math.min(n.start-e.start,r));this._elements.header.style.transform=`translateY(${o}px)`,fV(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",o>0||i>0),this._elements.header.classList.toggle("collapsed",o===r)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};$J=D([_(3,we)],$J);class h1t{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 Hve=class extends V{constructor(e,t,i,n,r,o){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=r,this._parentInstantiationService=o,this._scrollableElements=Wt("div.scrollContent",[Wt("div@content",{style:{overflow:"hidden"}}),Wt("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new DN({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>Ml(lt(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new y6(this._scrollableElements.root,{vertical:Cr.Auto,horizontal:Cr.Auto,useShadows:!1},this._scrollable)),this._elements=Wt("div.monaco-component.multiDiffEditor",{},[Wt("div",{},[this._scrollableElement.getDomNode()]),Wt("div.placeholder@placeholder",{},[Wt("div",[g(9360,"No Changed Files")])])]),this._sizeObserver=this._register(new iXe(this._element,void 0)),this._objectPool=this._register(new h1t(c=>{const l=this._instantiationService.createInstance($J,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return l.setData(c),l})),this.scrollTop=qn(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=qn(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=TI(this,(c,l)=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:p=>{throw new Pi}};const h=d.items.read(c),u=new Map;return{items:h.map(p=>{const m=l.add(new g1t(p,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),v=this._lastDocStates?.[m.getKey()];return v&&is(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=et(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 Vc([Le,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(J.inMultiDiffEditor.key,!0),this._register(du((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(ci(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(ci(c=>{const l=this._dimension.read(c);this._sizeObserver.observe(l)})),this._register(ci(c=>{const l=this._viewItems.read(c);this._elements.placeholder.classList.toggle("visible",l.length===0)})),this._scrollableElements.content.style.position="relative",this._register(ci(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=aTe(f,Sc(m=>m.maxScroll.read(c).maxScroll,ru));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(ci(c=>{fV(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 Pi("Resource not found in diff editor");const r=i[n];this._viewModel.get().activeDiffItem.setCache(r.viewModel,void 0);let o=0;for(let l=0;l[e.getKey(),e.getViewState()]))}}setViewState(e){this.setScrollState(e.scrollState),this._lastDocStates=e.docStates,is(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,r=0;const o=this._sizeObserver.height.read(e),a=_i.ofStartAndLength(t,o),c=this._sizeObserver.width.read(e);for(const l of this._viewItems.read(e)){const d=l.contentHeight.read(e),h=Math.min(d,o),u=_i.ofStartAndLength(n,h),f=_i.ofStartAndLength(r,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=_i.ofStartAndLength(t+i,o);l.render(u,p,c,m)}n+=h+this._spaceBetweenPx,r+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};Hve=D([_(4,Le),_(5,we)],Hve);function u1t(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 g1t extends V{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(C3(this,void 0)),this.contentHeight=et(this,r=>this._templateRef.read(r)?.object.contentHeight?.read(r)??this.viewModel.lastTemplateData.read(r).contentHeight),this.maxScroll=et(this,r=>this._templateRef.read(r)?.object.maxScroll.read(r)??{maxScroll:0,scrollWidth:0}),this.template=et(this,r=>this._templateRef.read(r)?.object),this._isHidden=Yt(this,!1),this._isFocused=et(this,r=>this.template.read(r)?.isFocused.read(r)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(ci(r=>{const o=this._scrollLeft.read(r);this._templateRef.read(r)?.object.setScrollLeft(o)})),this._register(ci(r=>{const o=this._templateRef.read(r);!o||!this._isHidden.read(r)||o.object.isFocused.read(r)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}getViewState(){return is(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(ht.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const r=this._templateRef.get();r&&n&&r.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&&is(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 r=this._templateRef.get();if(!r){r=this._objectPool.getUnusedObj(new d1t(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(r,void 0);const o=this.viewModel.lastTemplateData.get().selections;o&&r.object.editor.setSelections(o)}r.object.render(e,i,t,n)}}class uXe extends V{async waitForDiffs(){for(const e of this.items.get())await e.diffEditorViewModel.waitForDiff()}collapseAll(){is(e=>{for(const t of this.items.get())t.collapsed.set(!0,e)})}expandAll(){is(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=JYe(this.model,this.model.documents),this.items=lJ(this,this._documents,(i,n)=>n.add(this._instantiationService.createInstance(Uve,i,this))).recomputeInitiallyAndOnChange(this._store),this.focusedDiffItem=et(this,i=>this.items.read(i).find(n=>n.isFocused.read(i))),this.activeDiffItem=gxt(this,(i,n)=>this.focusedDiffItem.read(i)??n)}}let Uve=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=Yt(this,!1),this.lastTemplateData=Yt(this,{contentHeight:500,selections:void 0}),this.isActive=et(this,d=>this._editorViewModel.activeDiffItem.read(d)===this),this._isFocusedSource=Yt(this,rd(!1)),this.isFocused=et(this,d=>this._isFocusedSource.read(d).read(d)),this.isAlive=Yt(this,!0),this._register(Ee(()=>{this.isAlive.set(!1,void 0)})),this.documentDiffItemRef=this._register(e.createNewRef(this));function r(d){return{...d,hideUnchangedRegions:{enabled:!0}}}const o=this._instantiationService.createInstance(VJ,r(this.documentDiffItem.options||{}));this.documentDiffItem.onOptionsDidChange&&this._register(this.documentDiffItem.onOptionsDidChange(()=>{o.updateOptions(r(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(fW.createWithDisposable(this._instantiationService.createInstance(WJ,{original:c,modified:l},o),a,this))}getKey(){return JSON.stringify([this.originalUri?.toString(),this.modifiedUri?.toString()])}};Uve=D([_(2,we),_(3,fi)],Uve);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 Vve=class extends V{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Yt(this,void 0),this._viewModel=Yt(this,void 0),this._widgetImpl=TI(this,(n,r)=>(Wg($J,n),r.add(this._instantiationService.createInstance(Wg(Hve,n),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._activeControl=et(this,n=>this._widgetImpl.read(n).activeControl.read(n)),this.onDidChangeActiveControl=M.fromObservableLight(this._activeControl),this._register(VN(this._widgetImpl))}reveal(e,t){this._widgetImpl.get().reveal(e,t)}createViewModel(e){return new uXe(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)}};Vve=D([_(2,we)],Vve);const iMe=ae("IEditorCancelService"),gXe=new Q("cancellableOperation",!1,g(9366,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ce(iMe,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const r=gXe.bindTo(n.get(Le)),o=new ul;return{key:r,tokens:o}}),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 f1t extends li{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(iMe).add(e,this))}dispose(){this._unregister(),super.dispose()}}Qe(new class extends uc{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:Ae.EditorContrib,primary:S.Escape},precondition:gXe})}runEditorCommand(s,e){s.get(iMe).cancel(e)}});var jr;(function(s){s[s.Value=1]="Value",s[s.Selection=2]="Selection",s[s.Position=4]="Position",s[s.Scroll=8]="Scroll"})(jr||(jr={}));let Yae=class zve{constructor(e,t){if(this.flags=t,this.flags&jr.Value){const i=e.getModel();this.modelVersionId=i?qp("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&jr.Position?this.position=e.getPosition():this.position=null,this.flags&jr.Selection?this.selection=e.getSelection():this.selection=null,this.flags&jr.Scroll?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof zve))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 zve(e,this.flags))}};class nI extends f1t{constructor(e,t,i,n){super(e,n),this._listener=new Z,t&jr.Position&&this._listener.add(e.onDidChangeCursorPosition(r=>{(!i||!F.containsPosition(i,r.position))&&this.cancel()})),t&jr.Selection&&this._listener.add(e.onDidChangeCursorSelection(r=>{(!i||!F.containsRange(i,r.selection))&&this.cancel()})),t&jr.Scroll&&this._listener.add(e.onDidScrollChange(r=>this.cancel())),t&jr.Value&&(this._listener.add(e.onDidChangeModel(r=>this.cancel())),this._listener.add(e.onDidChangeModelContent(r=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class nMe extends li{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class vW{static _handleEolEdits(e,t){let i;const n=[];for(const r of t)typeof r.eol=="number"&&(i=r.eol),r.range&&typeof r.text=="string"&&n.push(r);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=ym.capture(e),r=vW._handleEolEdits(e,t);r.length===1&&vW._isFullModelReplaceEdit(e,r[0])?e.executeEdits("formatEditsCommand",r.map(o=>es.replace(F.lift(o.range),o.text))):e.executeEdits("formatEditsCommand",r.map(o=>es.replaceMove(F.lift(o.range),o.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}function fXe(s){return s.scheme===pe.vscodeRemote?s.authority:void 0}function W6(s){if(!s)return;const e=s.indexOf("+");return e<0?s:s.substr(0,e)}const p1t="extensions.user.cache",m1t="extensions.builtin.cache",pXe="undefined_publisher",_1t=["ui","workspace","web"];function CK(s){if(typeof s=="object"&&s!==null&&s.supported!==!0)return s.description}const mXe=["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 wo;(function(s){s[s.System=0]="System",s[s.User=1]="User"})(wo||(wo={}));var xs;(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"})(xs||(xs={}));class An{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 ga(i,n)}return e._lower===t._lower}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class D_{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(An.toKey(e))}delete(e){return this._set.delete(An.toKey(e))}has(e){return this._set.has(An.toKey(e))}}class ba{constructor(){this._map=new Map}clear(){this._map.clear()}delete(e){this._map.delete(An.toKey(e))}get(e){return this._map.get(An.toKey(e))}has(e){return this._map.has(An.toKey(e))}set(e,t){this._map.set(An.toKey(e),t)}values(){return this._map.values()}forEach(e){this._map.forEach(e)}[Symbol.iterator](){return this._map[Symbol.iterator]()}}function v1t(s){return sMe(s)}function sMe(s){return s.contributes&&s.contributes.localizations?s.contributes.localizations.length>0:!1}function b1t(s,e){if(e){const t=`onResolveRemoteAuthority:${W6(e)}`;return!!s.activationEvents?.includes(t)}return!1}function w1t(s){return s.map(e=>{const[t,i]=e.split("@");return{proposalName:t,version:i?parseInt(i):void 0}})}function y1t(s){return s.map(e=>e.split("@")[0])}function Jae(s,e,t){const i=[],n=new D_,r=s.ordered(t);for(const a of r)i.push(a),a.extensionId&&n.add(a.extensionId);const o=e.ordered(t);for(const a of o){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 bW;(function(s){s[s.File=1]="File",s[s.Selection=2]="Selection"})(bW||(bW={}));var cm;(function(s){s[s.Explicit=1]="Explicit",s[s.Silent=2]="Silent"})(cm||(cm={}));const Xz=class Xz{static setFormatterSelector(e){return{dispose:Xz._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const r=ui.first(Xz._selectors);if(r)return await r(e,t,i,n)}};Xz._selectors=new ul;let wW=Xz;async function Xae(s,e,t,i,n,r,o){const a=s.get(we),{documentRangeFormattingEditProvider:c}=s.get(nt),l=jo(e)?e.getModel():e,d=c.ordered(l),h=await wW.select(d,l,i,bW.Selection);h&&(n.report(h),await a.invokeFunction(_Xe,h,e,t,r,o))}async function _Xe(s,e,t,i,n,r){const o=s.get(Pl),a=s.get(Ke),c=s.get(uv);let l,d;jo(t)?(l=t.getModel(),d=new nI(t,jr.Value|jr.Position,void 0,n)):(l=t,d=new nMe(t,n));const h=[];let u=0;for(const b of z_(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 ht(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn)];return null})}return c.playSignal(ll.format,{userGesture:r}),!0}async function $ve(s,e,t,i,n,r){const o=s.get(we),a=s.get(nt),c=jo(e)?e.getModel():e,l=Jae(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,c),d=await wW.select(l,c,t,bW.File);d&&(i.report(d),await o.invokeFunction(vXe,d,e,t,n,r))}async function vXe(s,e,t,i,n,r){const o=s.get(Pl),a=s.get(uv);let c,l;jo(t)?(c=t.getModel(),l=new nI(t,jr.Value|jr.Position,void 0,n)):(c=t,l=new nMe(t,n));let d;try{const h=await e.provideDocumentFormattingEdits(c,c.getFormattingOptions(),l.token);if(d=await o.computeMoreMinimalEdits(c.uri,h),l.token.isCancellationRequested)return!0}finally{l.dispose()}if(!d||d.length===0)return!1;if(jo(t))vW.execute(t,d,i!==cm.Silent),i!==cm.Silent&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),_t.Immediate);else{const[{range:h}]=d,u=new ht(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 ht(p.startLineNumber,p.startColumn,p.endLineNumber,p.endColumn)];return null})}return a.playSignal(ll.format,{userGesture:r}),!0}async function C1t(s,e,t,i,n,r){const o=e.documentRangeFormattingEditProvider.ordered(t);for(const a of o){const c=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,r)).catch(Nr);if(tr(c))return await s.computeMoreMinimalEdits(t.uri,c)}}async function S1t(s,e,t,i,n){const r=Jae(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const o of r){const a=await Promise.resolve(o.provideDocumentFormattingEdits(t,i,n)).catch(Nr);if(tr(a))return await s.computeMoreMinimalEdits(t.uri,a)}}function bXe(s,e,t,i,n,r,o){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,r,o)).catch(Nr).then(c=>s.computeMoreMinimalEdits(t.uri,c))}vt.registerCommand("_executeFormatRangeProvider",async function(s,...e){const[t,i,n]=e;Lt(N.isUri(t)),Lt(F.isIRange(i));const r=s.get(pn),o=s.get(Pl),a=s.get(nt),c=await r.createModelReference(t);try{return C1t(o,a,c.object.textEditorModel,F.lift(i),n,Ue.None)}finally{c.dispose()}});vt.registerCommand("_executeFormatDocumentProvider",async function(s,...e){const[t,i]=e;Lt(N.isUri(t));const n=s.get(pn),r=s.get(Pl),o=s.get(nt),a=await n.createModelReference(t);try{return S1t(r,o,a.object.textEditorModel,i,Ue.None)}finally{a.dispose()}});vt.registerCommand("_executeFormatOnTypeProvider",async function(s,...e){const[t,i,n,r]=e;Lt(N.isUri(t)),Lt(re.isIPosition(i)),Lt(typeof n=="string");const o=s.get(pn),a=s.get(Pl),c=s.get(nt),l=await o.createModelReference(t);try{return bXe(a,c,l.object.textEditorModel,re.lift(i),n,r,Ue.None)}finally{l.dispose()}});var Sl;(function(s){s[s.provider=0]="provider",s[s.userDefined=1]="userDefined",s[s.recovered=2]="recovered"})(Sl||(Sl={}));const A1t={[Sl.provider]:" ",[Sl.userDefined]:"u",[Sl.recovered]:"r"},dHe=65535,Gv=16777215,hHe=4278190080;class sue{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<dHe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new sue(e.length),this._userDefinedStates=new sue(e.length),this._recoveredStates=new sue(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,n)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=i&&this.getEndLineNumber(r)>=n};for(let i=0,n=this._startIndexes.length;iGv||o>Gv)throw new Error("startLineNumber or endLineNumber must not exceed "+Gv);for(;e.length>0&&!t(r,o);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=r+((a&255)<<24),this._endIndexes[i]=o+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Gv}getEndLineNumber(e){return this._endIndexes[e]&Gv}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)?Sl.userDefined:this.isRecovered(e)?Sl.recovered:Sl.provider}setSource(e,t){t===Sl.userDefined?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===Sl.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]&hHe)>>>16);return t===dHe?-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===Sl.userDefined?m=d:(m=l,m.isCollapsed=d.isCollapsed&&l.endLineNumber===d.endLineNumber,m.source=Sl.provider),l=r(++a)):(m=d,d.isCollapsed&&d.source===Sl.provider&&(m.source=Sl.recovered)),d=o(++c);else{let v=c,b=d;for(;;){if(!b||b.startLineNumber>l.endLineNumber){m=l;break}if(b.source===Sl.userDefined&&b.endLineNumber>l.endLineNumber)break;b=o(++v)}l=r(++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 E1t{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,r=-1,o=-1;const a=c=>{for(;no&&(o=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),r=Math.max(r,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 r of e)if(!(r.startLineNumber>n.endLineNumber||n.startLineNumber>r.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,r)=>{for(const o of e)if(n=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const a=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.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 r of e){if(r.startLineNumber>=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const o=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);(!r.checksum||o===r.checksum)&&t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:void 0,isCollapsed:r.isCollapsed??!0,source:r.source??Sl.provider})}const n=qf.sanitizeAndMerge(this._regions,t,i);this.updatePost(qf.fromFoldRanges(n))}_getLinesChecksum(e,t){return Hc(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),r=1;for(;n>=0;){const o=this._regions.toRegion(n);(!t||t(o,r))&&i.push(o),r++,n=o.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,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const o=[];for(let a=n,c=this._regions.length;a0&&!l.containedBy(o[o.length-1]);)o.pop();o.push(l),t(l,o.length)&&i.push(l)}else break}}else for(let o=n,a=this._regions.length;o1){const a=s.getRegionsInside(r,(c,l)=>c.isCollapsed!==o&&l0)for(const r of i){const o=s.getRegionAtLine(r);if(o&&(o.isCollapsed!==e&&n.push(o),t>1)){const a=s.getRegionsInside(o,(c,l)=>c.isCollapsed!==e&&lo.isCollapsed!==e&&aa.isCollapsed!==e&&c<=t);n.push(...o)}s.toggleCollapseState(n)}function D1t(s,e,t){const i=[];for(const n of t){const r=s.getAllRegionsAtLine(n,o=>o.isCollapsed!==e);r.length>0&&i.push(r[0])}s.toggleCollapseState(i)}function k1t(s,e,t,i){const n=(o,a)=>a===e&&o.isCollapsed!==t&&!i.some(c=>o.containsLine(c)),r=s.getRegionsInside(null,n);s.toggleCollapseState(r)}function yXe(s,e,t){const i=[];for(const o of t){const a=s.getAllRegionsAtLine(o,void 0);a.length>0&&i.push(a[0])}const n=o=>i.every(a=>!a.containedBy(o)&&!o.containedBy(a))&&o.isCollapsed!==e,r=s.getRegionsInside(null,n);s.toggleCollapseState(r)}function oMe(s,e,t){const i=s.textModel,n=s.regions,r=[];for(let o=n.length-1;o>=0;o--)if(t!==n.isCollapsed(o)){const a=n.getStartLineNumber(o);e.test(i.getLineContent(a))&&r.push(n.toRegion(o))}s.toggleCollapseState(r)}function aMe(s,e,t){const i=s.regions,n=[];for(let r=i.length-1;r>=0;r--)t!==i.isCollapsed(r)&&e===i.getType(r)&&n.push(i.toRegion(r));s.toggleCollapseState(n)}function I1t(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 T1t(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 L1t(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||kb(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,r=Number.MAX_VALUE,o=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return uHe(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const r=o=>((!n||!N1t(o,n))&&(n=uHe(this._hiddenRanges,o)),n?n.startLineNumber-1:null);for(let o=0,a=e.length;o0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function N1t(s,e){return s>=e.startLineNumber&&s<=e.endLineNumber}function uHe(s,e){const t=D2(s,i=>e=0&&s[t].endLineNumber>=e?s[t]:null}const P1t=5e3,F1t="indent";class cMe{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=F1t}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(W1t(this.editorModel,i,n,this.foldingRangesLimit))}}let O1t=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Gv||t>Gv)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 r=this._length-1,o=0;r>=0;r--,o++)i[o]=this._startIndexes[r],n[o]=this._endIndexes[r];return new qf(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 r=e.getOptions().tabSize,o=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=Aae(h,r);(u{}};function W1t(s,e,t,i=B1t){const n=s.getOptions().tabSize,r=new O1t(i);let o;t&&(o=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=Aae(d,n);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=l);continue}let f;if(o&&(f=d.match(o)))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],r.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&&r.insertFirst(l,p,h)}u.indent===h?u.endAbove=l:a.push({indent:h,endAbove:l,line:l})}return r.toIndentRanges(s)}const H1t=W("editor.foldBackground",{light:rt(kS,.3),dark:rt(kS,.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",mY,g(1687,"Color of the folding control in the editor gutter."));const GJ=oi("folding-expanded",ve.chevronDown,g(1688,"Icon for expanded ranges in the editor glyph margin.")),KJ=oi("folding-collapsed",ve.chevronRight,g(1689,"Icon for collapsed ranges in the editor glyph margin.")),gHe=oi("folding-manual-collapsed",KJ,g(1690,"Icon for manually collapsed ranges in the editor glyph margin.")),fHe=oi("folding-manual-expanded",GJ,g(1691,"Icon for manually expanded ranges in the editor glyph margin.")),rue={color:$r(H1t),position:Rh.Inline},wP=g(1692,"Click to expand the range."),SK=g(1693,"Click to collapse the range."),Ga=class Ga{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ga.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ga.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ga.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ga.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ga.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ga.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ga.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ga.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ga.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ga.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ga.MANUALLY_EXPANDED_VISUAL_DECORATION:Ga.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};Ga.COLLAPSED_VISUAL_DECORATION=Kt.register({description:"folding-collapsed-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:wP,firstLineDecorationClassName:He.asClassName(KJ)}),Ga.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Kt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:rue,isWholeLine:!0,linesDecorationsTooltip:wP,firstLineDecorationClassName:He.asClassName(KJ)}),Ga.MANUALLY_COLLAPSED_VISUAL_DECORATION=Kt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:wP,firstLineDecorationClassName:He.asClassName(gHe)}),Ga.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Kt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:rue,isWholeLine:!0,linesDecorationsTooltip:wP,firstLineDecorationClassName:He.asClassName(gHe)}),Ga.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:wP}),Ga.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:rue,isWholeLine:!0,linesDecorationsTooltip:wP}),Ga.EXPANDED_VISUAL_DECORATION=Kt.register({description:"folding-expanded-visual-decoration",stickiness:si.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+He.asClassName(GJ),linesDecorationsTooltip:SK}),Ga.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Kt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:si.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:He.asClassName(GJ),linesDecorationsTooltip:SK}),Ga.MANUALLY_EXPANDED_VISUAL_DECORATION=Kt.register({description:"folding-manually-expanded-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+He.asClassName(fHe),linesDecorationsTooltip:SK}),Ga.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Kt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:He.asClassName(fHe),linesDecorationsTooltip:SK}),Ga.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0}),Ga.HIDDEN_RANGE_DECORATION=Kt.register({description:"folding-hidden-range-decoration",stickiness:si.NeverGrowsWhenTypingAtEdges});let Gve=Ga;const U1t={},V1t="syntax";class lMe{constructor(e,t,i,n,r){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=r,this.id=V1t,this.disposables=new Z,r&&this.disposables.add(r);for(const o of t)typeof o.onDidChange=="function"&&this.disposables.add(o.onDidChange(i))}compute(e){return z1t(this.providers,this.editorModel,e).then(t=>t?G1t(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function z1t(s,e,t){let i=null;const n=s.map((r,o)=>Promise.resolve(r.provideFoldingRanges(e,U1t,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:o,kind:l.kind})}},Nr));return Promise.all(n).then(r=>i)}class $1t{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>Gv||t>Gv)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=n,this._types[r]=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),r=new Uint32Array(e),o=[];for(let a=0,c=0;a{let c=o.start-a.start;return c===0&&(c=o.rank-a.rank),c}),i=new $1t(e);let n;const r=[];for(const o of t)if(!n)n=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else if(o.start>n.start)if(o.end<=n.end)r.push(n),n=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else{if(o.start>n.end){do n=r.pop();while(n&&o.start>n.end);n&&r.push(n),n=o}i.add(o.start,o.end,o.kind&&o.kind.value,r.length)}return i.toIndentRanges()}var f0;const vd=new Q("foldingEnabled",!1);var AL;let PA=(AL=class extends V{static get(e){return e.getContribution(f0.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return f0._foldingRangeSelector?.(i,t)??i}static setFoldingRangeProviderSelector(e){return f0._foldingRangeSelector=e,{dispose:()=>{f0._foldingRangeSelector=void 0}}}constructor(e,t,i,n,r,o){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=o,this.localToDispose=this._register(new Z),this.editor=e,this._foldingLimitReporter=new CXe(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=r.for(o.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 Gve(e),this.foldingDecorationProvider.showFoldingControls=a.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=a.get(x.foldingHighlight),this.foldingEnabled=vd.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 x1t(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new M1t(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Ph(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new ln(()=>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 cMe(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=f0.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new lMe(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 Ys,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Mo(r=>i.compute(r));return n.then(r=>{if(r&&n===this.foldingRegionPromise){let o;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=r.setCollapsedAllOfType(u_.Imports.value,!0);d&&(o=ym.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),c=a?a.map(d=>d.startLineNumber):[];e.update(r,c),o?.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 n=[];for(const r of i){const o=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(o)&&n.push(...t.getAllRegionsAtLine(o,a=>a.isCollapsed&&o>a.startLineNumber))}n.length&&(t.toggleCollapseState(n),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 n=e.target.detail,r=e.target.element.offsetLeft;if(n.offsetX-r<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 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,r=e.target.range;if(!r||r.startLineNumber!==i)return;if(n){if(e.target.type!==Mt.GUTTER_LINE_DECORATIONS)return}else{const a=this.editor.getModel();if(!a||r.startColumn!==a.getLineMaxColumn(i))return}const o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){const a=o.isCollapsed;if(n||a){const c=e.event.altKey;let l=[];if(c){const d=u=>!u.containedBy(o)&&!o.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(o))h.isCollapsed===a&&l.push(h);(a||!d||l.length===0)&&l.push(o)}t.toggleCollapseState(l),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,_t.Smooth)}},f0=AL,AL.ID="editor.contrib.folding",AL);PA=f0=D([_(1,Le),_(2,zs),_(3,wi),_(4,xp),_(5,nt)],PA);class CXe{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 th extends it{runEditorCommand(e,t,i){const n=e.get(zs),r=PA.get(t);if(!r)return;const o=r.getFoldingModel();if(o)return this.reportTelemetry(e,t),o.then(a=>{if(a){this.invoke(r,a,t,i,n);const c=t.getSelection();c&&r.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 SXe(s){if(!Ja(s)){if(!In(s))return!1;const e=s;if(!Ja(e.levels)&&!dc(e.levels)||!Ja(e.direction)&&!Rt(e.direction)||!Ja(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(dc)))return!1}return!0}class K1t extends th{constructor(){super({id:"editor.unfold",label:g(453,"Unfold"),alias:"Unfold",precondition:vd,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: +`),await this._clipboardService.writeText(y)})),i.getOption(x.readOnly)||v.push(new an("diff.inline.revertChange",g(9962,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Rr(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:m,height:v}=So(this._diffActions),b=Math.floor(d/3);p.preventDefault(),f(p.posx,m+v+b)})),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:n}=So(e),r=t-n,o=Math.floor(r/i),a=o*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let c=0;for(let l=0;ls});function oXe(s,e,t,i){Il(i,e.fontInfo);const n=t.length>0,r=new kU(1e4);let o=0,a=0;const c=[];for(let u=0;u');const c=e.getLineContent(),l=_p.isBasicASCII(c,n),d=_p.containsRTL(c,l,r),h=p6(new DI(o.fontInfo.isMonospace&&!o.disableMonospaceOptimizations,o.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,l,d,0,e,t,o.tabSize,0,o.fontInfo.spaceWidth,o.fontInfo.middotWidth,o.fontInfo.wsmiddotWidth,o.stopRenderingLineAfter,o.renderWhitespace,o.renderControlCharacters,o.fontLigatures!==Ok.OFF,null),a);return a.appendString(""),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}let Rve=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=r,this._canIgnoreViewZoneUpdateEvent=o,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=c,this._clipboardService=l,this._contextMenuService=d,this._originalTopPadding=Yt(this,0),this._originalScrollOffset=Yt(this,0),this._originalScrollOffsetAnimated=GWe(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Yt(this,0),this._modifiedScrollOffset=Yt(this,0),this._modifiedScrollOffsetAnimated=GWe(this._targetWindow,this._modifiedScrollOffset,this._store);const h=Yt("invalidateAlignmentsState",0),u=this._register(new ln(()=>{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?qn(this,y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===lD.Completed):void 0).map((y,C)=>y?.read(C)),p=et(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 eHe(this._editors.original,this._editors.modified,A.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),m=et(y=>{const C=this._diffModel.read(y)?.movedTextToCompare.read(y);if(!C)return null;h.read(y);const A=C.changes.map(L=>new rXe(L));return eHe(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=TI(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 dt of A)if(dt.diff)for(let Dt=dt.originalRange.startLineNumber;DtNe.getLineCount())return{orig:L,mod:k};G?.addRequest(Ne.getLineContent(Dt),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,Be=this._editors.original.getModel()?.mightContainRTL()??!1,Ct=jae.fromEditor(this._editors.modified);for(const Ne of A)if(Ne.diff&&!z&&(!this._options.useTrueInlineDiffRendering.read(y)||!eMe(Ne.diff))){if(!Ne.originalRange.isEmpty){f.read(y);const Dt=document.createElement("div");Dt.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Xi=this._editors.original.getModel();if(Ne.originalRange.endLineNumberExclusive-1>Xi.getLineCount())return{orig:L,mod:k};const Ti=new aXe(Ne.originalRange.mapToLineArray(hs=>Xi.tokenization.getLineTokens(hs)),Ne.originalRange.mapToLineArray(hs=>Y[j++]),De,Be),ss=[];for(const hs of Ne.diff.innerChanges||[])ss.push(new WO(hs.originalRange.delta(-(Ne.diff.original.startLineNumber-1)),pW.className,Xa.Regular));const $s=oXe(Ti,Ct,ss,Dt),Fn=document.createElement("div");if(Fn.className="inline-deleted-margin-view-zone",Il(Fn,Ct.fontInfo),this._options.renderIndicators.read(y))for(let hs=0;hs<$s.heightInLines;hs++){const Zr=document.createElement("div");Zr.className=`delete-sign ${He.asClassName(nXe)}`,Zr.setAttribute("style",`position:absolute;top:${hs*ne}px;width:${Ct.lineDecorationsWidth}px;height:${ne}px;right:0;`),Fn.appendChild(Zr)}let Zo;b.add(new j0t(()=>Qn(Zo),Fn,this._editors.modified,Ne.diff,this._diffEditorWidget,$s.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let hs=0;hs<$s.viewLineCounts.length;hs++){const Zr=$s.viewLineCounts[hs];Zr>1&&L.push({afterLineNumber:Ne.originalRange.startLineNumber+hs,domNode:v(),heightInPx:(Zr-1)*ne,showInHiddenAreas:!0,suppressMouseDown:!0})}k.push({afterLineNumber:Ne.modifiedRange.startLineNumber-1,domNode:Dt,heightInPx:$s.heightInLines*ne,minWidthInPx:$s.minWidthInPx,marginDomNode:Fn,setZoneId(hs){Zo=hs},showInHiddenAreas:!0,suppressMouseDown:!0})}const dt=document.createElement("div");dt.className="gutter-delete",L.push({afterLineNumber:Ne.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Ne.modifiedHeightInPx,marginDomNode:dt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const dt=Ne.modifiedHeightInPx-Ne.originalHeightInPx;if(dt>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:dt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Dt=function(){const Ti=document.createElement("div");return Ti.className="arrow-revert-change "+He.asClassName(ve.arrowRight),C.add(ue(Ti,"mousedown",ss=>ss.stopPropagation())),C.add(ue(Ti,"click",ss=>{ss.stopPropagation(),r.revert(Ne.diff)})),fe("div",{},Ti)};if(ge?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Ne.modifiedRange.endLineNumberExclusive-1))continue;let Xi;Ne.diff&&Ne.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(y)&&(Xi=Dt()),k.push({afterLineNumber:Ne.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-dt,marginDomNode:Xi,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 dt=Ne.modifiedHeightInPx-Ne.originalHeightInPx;dt>0?L.push({afterLineNumber:Ne.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:dt,showInHiddenAreas:!0,suppressMouseDown:!0}):k.push({afterLineNumber:Ne.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-dt,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=qn(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=qn(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(ci(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,_t.Immediate)})),this._register(ci(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,_t.Immediate)})),this._register(ci(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)}))}};Rve=D([_(8,gg),_(9,lo)],Rve);function eHe(s,e,t,i,n,r){const o=new Gy(tHe(s,i)),a=new Gy(tHe(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=o.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}):(o.dequeue(),a.dequeue()),d.push({originalRange:mi.ofLength(v.lineNumber,1),modifiedRange:mi.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(r)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:o*(l-1)})}for(const c of s.getWhitespaces()){if(e.has(c.id))continue;const l=c.afterLineNumber===0?0:r.convertViewPositionToModelPosition(new re(c.afterLineNumber,1)).lineNumber;t.push({lineNumber:l,heightInPx:c.height})}return C0t(t,i,c=>c.lineNumber,(c,l)=>({lineNumber:c.lineNumber,heightInPx:c.heightInPx+l.heightInPx}))}function eMe(s){return s.innerChanges?s.innerChanges.every(e=>iHe(e.modifiedRange)&&iHe(e.originalRange)):!1}function iHe(s){return s.startLineNumber===s.endLineNumber}const Jz=class Jz extends V{constructor(e,t,i,n,r){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=r,this._originalScrollTop=qn(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=qn(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=sd("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Yt(this,0),this._modifiedViewZonesChangedSignal=sd("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=sd("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=TI(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(Be,Ct){const Ne=Ct.getTopForLineNumber(Be.startLineNumber,!0),dt=Ct.getTopForLineNumber(Be.endLineNumberExclusive,!0);return(Ne+dt)/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 _i(ge,De),from:j,to:ne,fromWithoutScroll:R,toWithoutScroll:G,move:k}});v.sort($Ge(Sc(k=>k.fromWithoutScroll>k.toWithoutScroll,Nat),Sc(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,ru)));const b=tMe.compute(v.map(k=>k.range)),w=10,y=p.verticalScrollbarWidth,C=(b.getTrackCount()-1)*10+w*2,A=y+C+(m.contentLeft-Jz.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"),Be=document.createElementNS("http://www.w3.org/2000/svg","path");Be.setAttribute("d",`M 0 ${k.from} L ${R} ${k.from} L ${R} ${k.to} L ${Y-G} ${k.to}`),Be.setAttribute("fill","none"),De.appendChild(Be);const Ct=document.createElementNS("http://www.w3.org/2000/svg","polygon");Ct.classList.add("arrow"),h.add(ci(Ne=>{Be.classList.toggle("currentMove",k.move===u.activeMovedText.read(Ne)),Ct.classList.toggle("currentMove",k.move===u.activeMovedText.read(Ne))})),Ct.setAttribute("points",`${Y-G},${k.to-z/2} ${Y},${k.to} ${Y-G},${k.to+z/2}`),De.appendChild(Ct),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(ci(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-Jz.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(VN(this._state));const o=et(d=>{const u=this._diffModel.read(d)?.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new wF(rd(f.lineRangeMapping.original.startLineNumber-1),18),modified:new wF(rd(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(FJ(this._editors.original,o.map(d=>d.map(h=>h.original)))),this._register(FJ(this._editors.modified,o.map(d=>d.map(h=>h.modified)))),this._register(du((d,h)=>{const u=o.read(d);for(const f of u)h.add(new nHe(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new nHe(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=sd("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),c=sd("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let l="modified";this._register(WU({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)}))}};Jz.movedCodeBlockPadding=4;let tB=Jz;class tMe{static compute(e){const t=[],i=[];for(const n of e){let r=t.findIndex(o=>!o.intersectsStrict(n));r===-1&&(t.length>=6?r=Dat(t,Sc(a=>a.intersectWithRangeLength(n),ru)):(r=t.length,t.push(new qTe))),t[r].addRange(n),i.push(r)}return new tMe(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class nHe extends qRe{constructor(e,t,i,n,r){const o=Wt("div.diff-hidden-lines-widget");super(e,t,o.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=r,this._nodes=Wt("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Wt("div.text-content@textContent"),Wt("div.action-bar@actionBar")]),o.root.appendChild(this._nodes.root);const a=qn(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(NA(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 gd(this._nodes.actionBar,{highlightToggledItems:!0})),d=new an("",c,"",!1);l.push(d,{icon:!1,label:!0});const h=new an("","Compare",He.asClassName(ve.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(ci(u=>{const f=this._diffModel.movedTextToCompare.read(u)===i;h.checked=f})),l.push(h,{icon:!1,label:!0})}}class Y0t extends V{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=et(this,r=>{const o=this._diffModel.read(r),a=o?.diff.read(r);if(!a)return null;const c=this._diffModel.read(r).movedTextToCompare.read(r),l=this._options.renderIndicators.read(r),d=this._options.showEmptyDecorations.read(r),h=[],u=[];if(!c)for(const p of a.mappings)if(p.lineRangeMapping.original.isEmpty||h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:l?W3:YWe}),p.lineRangeMapping.modified.isEmpty||u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:l?OJ:jWe}),p.lineRangeMapping.modified.isEmpty||p.lineRangeMapping.original.isEmpty)p.lineRangeMapping.original.isEmpty||h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:JRe}),p.lineRangeMapping.modified.isEmpty||u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:jRe});else{const m=this._options.useTrueInlineDiffRendering.read(r)&&eMe(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?XRe:pW}),p.lineRangeMapping.modified.contains(v.modifiedRange.startLineNumber)&&u.push({range:v.modifiedRange,options:v.modifiedRange.isEmpty()&&d&&!m?YRe:BJ}),m){const b=o.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?W3:YWe});const v=p.modified.toInclusiveRange();v&&u.push({range:v,options:l?OJ:jWe});for(const b of p.innerChanges||[])h.push({range:b.originalRange,options:pW}),u.push({range:b.modifiedRange,options:BJ})}const f=this._diffModel.read(r).activeMovedText.read(r);for(const p of a.movedTexts)h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(p===f?" currentMove":""),blockPadding:[tB.movedCodeBlockPadding,0,tB.movedCodeBlockPadding,tB.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(PJ(this._editors.original,this._decorations.map(r=>r?.originalDecorations||[]))),this._register(PJ(this._editors.modified,this._decorations.map(r=>r?.modifiedDecorations||[])))}}class J0t{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=I6(this,i=>{const n=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(n,i)},(i,n)=>{const r=this.dimensions.width.get();this._sashRatio.set(i/r,n)}),this._sashRatio=Yt(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),r=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,o=100;return i<=o*2?n:ri-o?i-o:r}}class cXe extends V{constructor(e,t,i,n,r,o){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=r,this._resetSash=o,this._sash=this._register(new Wd(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:pi.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(ci(a=>{const c=this._boundarySashes.read(a);c&&(this._sash.orthogonalEndSash=c.bottom)})),this._register(ci(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 X0t extends V{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=qn(this,this._editor.onDidScrollChange,o=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(o=>o===0),this.modelAttached=qn(this,this._editor.onDidChangeModel,o=>this._editor.hasModel()),this.editorOnDidChangeViewZones=sd("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=sd("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=_C("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(Wt("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),r=new ResizeObserver(()=>{is(o=>{this.domNodeSizeChanged.trigger(o)})});r.observe(this._domNode),this._register(Ee(()=>r.disconnect())),this._register(ci(o=>{n.className=this.isScrollTopZero.read(o)?"":"scroll-decoration"})),this._register(ci(o=>this.render(o)))}dispose(){super.dispose(),ca(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()),r=_i.ofStartAndLength(0,this._domNode.clientHeight);if(!r.isEmpty)for(const o of i){const a=new mi(o.startLineNumber,o.endLineNumber+1),c=this.itemProvider.getIntersectingGutterItems(a,e);is(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=Yt("item",d),b=this.itemProvider.createView(v,m);h=new Z0t(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(_i.ofStartAndLength(u,p),r)}})}for(const o of n){const a=this.views.get(o);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(o)}}}class Z0t{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class lXe extends q_{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class Mve extends tQe{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 ng(e-1,t)}}var e1t=".monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}";gt(e1t,{});class dXe extends V{constructor(e,t,i={orientation:W_.HORIZONTAL}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new yTe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Z),i.hoverDelegate=i.hoverDelegate??this._register(Yk()),this.options=i,this.toggleMenuAction=this._register(new H3(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new gd(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(n,r)=>{if(n.id===H3.ID)return this.toggleMenuActionViewItem=new cA(n,n.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:He.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 o=i.actionViewItemProvider(n,r);if(o)return o}if(n instanceof Hk){const o=new cA(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 o.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(o),this.disposables.add(this._onDidChangeDropdownVisibility.add(o.onDidChangeVisibility)),o}}}))}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 Hse=class Hse extends an{constructor(e,t){t=t||g(10094,"More Actions..."),super(Hse.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}};Hse.ID="toolbar.toggle.more";let H3=Hse;var hA;(function(s){s[s.NoHide=-1]="NoHide",s[s.Ignore=0]="Ignore",s[s.RenderInSecondaryGroup=1]="RenderInSecondaryGroup"})(hA||(hA={}));let mW=class extends dXe{constructor(e,t,i,n,r,o,a,c){super(e,r,{getKeyBinding:d=>o.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=r,this._keybindingService=o,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(),r=t.slice(),o=[];let a=0;const c=[];let l=!1;if(this._options?.hiddenItemStrategy!==hA.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))}}vM(n),vM(c),super.setActions(n,Eo.join(c,r)),(o.length>0||n.length>0)&&this._sessionDisposables.add(ue(this.getElement(),"contextmenu",d=>{const h=new Dh(lt(this.getElement()),d),u=this.getItemAction(h.target);if(!u)return;h.preventDefault(),h.stopPropagation();const f=[];if(u instanceof Ac&&u.menuKeybinding)f.push(u.menuKeybinding);else if(!(u instanceof Ny||u instanceof H3)){const m=!!this._keybindingService.lookupKeybinding(u.id);f.push(XJe(this._commandService,this._keybindingService,u.id,void 0,m))}if(o.length>0){let m=!1;if(a===1&&this._options?.hiddenItemStrategy===hA.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})}))}};mW=D([_(2,Wa),_(3,Le),_(4,lo),_(5,Vt),_(6,bi),_(7,Ji)],mW);let Cm=class extends mW{constructor(e,t,i,n,r,o,a,c,l){super(e,{resetMenu:t,...i},n,r,o,a,c,l),this._onDidChangeMenuItems=this._store.add(new I),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(n.createMenu(t,r,{emitEventsForSubmenuChanges:!0})),h=()=>{const u=[],f=[];vC(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 Pi("This toolbar is populated from a menu.")}};Cm=D([_(3,Wa),_(4,Le),_(5,lo),_(6,Vt),_(7,bi),_(8,Ji)],Cm);const iue=[],yK=35;let Nve=class extends V{constructor(e,t,i,n,r,o,a,c,l){super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=r,this._boundarySashes=o,this._instantiationService=a,this._contextKeyService=c,this._menuService=l,this._menu=this._register(this._menuService.createMenu(_e.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=qn(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=et(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=et(this,d=>this._hasActions.read(d)?yK:0),this.elements=Wt("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:yK+"px"}},[]),this._currentDiff=et(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=et(this,d=>{const u=this._diffModel.read(d)?.diff.read(d);if(!u)return iue;const f=this._editors.modifiedSelections.read(d);if(f.every(b=>b.isEmpty()))return iue;const p=new Xp(f.map(b=>mi.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)?iue:v}),this._register(S0t(e,this.elements.root)),this._register(ue(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(NA(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),vh(this,d=>this._showSash.read(d)?new cXe(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,I6(this,u=>this._sashLayout.sashLeft.read(u)-yK,(u,f)=>this._sashLayout.sashLeft.set(u+yK,f)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new X0t(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=Y_.fromRangeMappings(p.flatMap(b=>b.rangeMappings));return[new sHe(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 sHe(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 Mve(this._editors.modifiedModel.get()),n=new Mve(this._editors.original.getModel());return new G2(t.map(a=>a.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};Nve=D([_(6,we),_(7,Le),_(8,Wa)],Nve);class sHe{constructor(e,t,i,n,r,o){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=r,this.modifiedUri=o}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=Wt("div.gutterItem",{style:{height:"20px",width:"34px"}},[Wt("div.background@background",{},[]),Wt("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,o=>o.showAlways),this._menuId=this._item.map(this,o=>o.menuId),this._isSmall=Yt(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const r=this._register(n.createInstance(RM,"element",!0,{position:{hoverPosition:vr.RIGHT}}));this._register(bF(t,this._elements.root)),this._register(ci(o=>{const a=this._showAlways.read(o);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(du((o,a)=>{this._elements.buttons.replaceChildren();const c=a.add(n.createInstance(Cm,this._elements.buttons,this._menuId.read(o),{orientation:W_.VERTICAL,hoverDelegate:r,toolbarOptions:{primaryGroup:l=>l.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(o)?1:3},hiddenItemStrategy:hA.Ignore,actionRunner:new lXe(()=>{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,r=i;let o=e.start+n;const a=_i.tryCreate(r,t.endExclusive-r-i),c=_i.tryCreate(e.start+r,e.endExclusive-i-r);c&&a&&c.start{const n=YE._map.get(e);n&&(YE._map.delete(e),n.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new BU(()=>{}))}_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=Yt(this,this.editor.getModel()),this.model=this._model,this.isReadonly=qn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.readOnly)),this._versionId=DJ({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=DJ({owner:this,equalsFn:jq(sW(ht.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=Zh({owner:this,equalsFn:jq(sW(re.equals))},t=>this.selections.read(t)?.map(i=>i.getStartPosition())??null),this.isFocused=qn(this,t=>{const i=this.editor.onDidFocusEditorWidget(t),n=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.hasWidgetFocus()),this.value=I6(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=et(this,t=>(this.versionId.read(t),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=Zh({owner:this,equalsFn:jq(ht.selectionsEqual)},t=>this.selections.read(t)?.[0]??null),this.cursorPosition=Zh({owner:this,equalsFn:re.equals},t=>this.selections.read(t)?.[0]?.getPosition()??null),this.onDidType=_C(this),this.scrollTop=qn(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=qn(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=qn(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(t=>t.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(t=>t.decorationsLeft),this.contentWidth=qn(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 qn(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(T6({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const r=e.read(n);i.set(r)})),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=ci(r=>{e.position.read(r),e.minContentWidthInPx.read(r),this.editor.layoutOverlayWidget(i)});return Ee(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}};YE._map=new Map;let Fve=YE;function Ove(s,e){return lxt({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 t1t(s,e){const t=new Z,i=Ove(s,(n,r)=>{t.clear(),e(n,r,t)});return{dispose(){i.dispose(),t.dispose()}}}var cQ,SL;let HJ=(SL=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=vh(this,c=>{const l=this._editors.modifiedModel.read(c),d=cQ._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===Bi.ContentFlush)return;const l=this._diffModel.get();is(d=>{for(const h of this._editors.original.getSelections()||[])l?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,m_.FromCloserSide,d),l?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,m_.FromCloserSide,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===Bi.ContentFlush)return;const l=this._diffModel.get();is(d=>{for(const h of this._editors.modified.getSelections()||[])l?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,m_.FromCloserSide,d),l?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,m_.FromCloserSide,d)})}));const r=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=TI(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=r.read(c);for(let v=0;vb.getHiddenOriginalRange(C).startLineNumber-1),y=new wF(w,12);h.push(y),l.add(new rHe(this._editors.original,y,b,!f))}{const w=et(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),y=new wF(w,12);u.push(y),l.add(new rHe(this._editors.modified,y,b))}}else{{const w=et(this,C=>b.getHiddenOriginalRange(C).startLineNumber-1),y=new wF(w,24);h.push(y),l.add(new oHe(this._editors.original,y,b,b.originalUnchangedRange,!f,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,m_.FromBottom,void 0),this._options))}{const w=et(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),y=new wF(w,24);u.push(y),l.add(new oHe(this._editors.modified,y,b,b.modifiedUnchangedRange,!1,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,m_.FromBottom,void 0),this._options))}}}return{origViewZones:h,modViewZones:u}});const o={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Nt(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(g(5244,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+He.asClassName(ve.fold),zIndex:10001};this._register(PJ(this._editors.original,et(this,c=>{const l=r.read(c),d=l.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:o}));for(const h of l)h.shouldHideControls(c)&&d.push({range:F.fromPositions(new re(h.originalLineNumber,1)),options:a});return d}))),this._register(PJ(this._editors.modified,et(this,c=>{const l=r.read(c),d=l.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:o}));for(const h of l)h.shouldHideControls(c)&&d.push({range:mi.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(ci(c=>{const l=r.read(c);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(l.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(Oc)),this._editors.modified.setHiddenAreas(l.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(Oc))}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()}}))}},cQ=SL,SL._breadcrumbsSourceFactory=Yt(cQ,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),SL);HJ=cQ=D([_(3,we)],HJ);class rHe extends qRe{constructor(e,t,i,n=!1){const r=Wt("div.diff-hidden-lines-widget");super(e,t,r.root),this._unchangedRegion=i,this._hide=n,this._nodes=Wt("div.diff-hidden-lines-compact",[Wt("div.line-left",[]),Wt("div.text@text",[]),Wt("div.line-right",[])]),r.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(ci(o=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(o).length,c=g(5245,"{0} hidden lines",a);this._nodes.text.innerText=c}}))}}class oHe extends qRe{constructor(e,t,i,n,r,o,a,c){const l=Wt("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=r,this._modifiedOutlineSource=o,this._revealModifiedHiddenLine=a,this._options=c,this._nodes=Wt("div.diff-hidden-lines",[Wt("div.top@top",{title:g(5246,"Click or drag to show more above")}),Wt("div.center@content",{style:{display:"flex"}},[Wt("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)}},...Ib("$(unfold)"))]),Wt("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Wt("div.bottom@bottom",{title:g(5248,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root),this._hide?ca(this._nodes.first):this._register(NA(this._nodes.first,{width:eu(this._editor).layoutInfoContentLeft})),this._register(ci(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=lt(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=lt(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(ci(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)}}}}ca(this._nodes.others,...u)}))}}var Cv,VS;let _W=(VS=class extends V{constructor(e,t,i,n,r,o,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=r,this._modifiedEditorLayoutInfo=o,this._themeService=a,this.width=Cv.ENTIRE_DIFF_OVERVIEW_WIDTH;const c=qn(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),l=et(u=>{const f=c.read(u),p=f.getColor(Upt)||(f.getColor(wy)||nme).transparent(2),m=f.getColor(Vpt)||(f.getColor(cF)||sme).transparent(2);return{insertColor:p,removeColor:m}}),d=ds(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=Wt("div.diffOverview",{style:{position:"absolute",top:"0px",width:Cv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(bF(h,d.domNode)),this._register(Rr(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(bF(this._rootElement,h)),this._register(du((u,f)=>{const p=this._diffModel.read(u),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(f.add(m),f.add(bF(h,m.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(f.add(v),f.add(bF(h,v.getDomNode()))),!m||!v)return;const b=sd("viewZoneChanged",this._editors.original.onDidChangeViewZones),w=sd("viewZoneChanged",this._editors.modified.onDidChangeViewZones),y=sd("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),C=sd("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(ci(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 re(ge.startLineNumber,1)),Be=ne.coordinatesConverter.convertModelPositionToViewPosition(new re(ge.endLineNumberExclusive,1)),Ct=Be.lineNumber-De.lineNumber;return new gje(De.lineNumber,Be.lineNumber,Ct,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(ci(A=>{const L=this._rootHeight.read(A),k=this._rootWidth.read(A),P=this._modifiedEditorLayoutInfo.read(A);if(P){const R=Cv.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Cv.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:L,right:R+Cv.ONE_OVERVIEW_WIDTH,width:Cv.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:L,right:0,width:Cv.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 X2(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-Cv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(Cv.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},Cv=VS,VS.ONE_OVERVIEW_WIDTH=15,VS.ENTIRE_DIFF_OVERVIEW_WIDTH=VS.ONE_OVERVIEW_WIDTH*2,VS);_W=Cv=D([_(6,mn)],_W);const nue=[];class i1t extends V{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=et(this,r=>{const a=this._diffModel.read(r)?.diff.read(r);if(!a)return nue;const c=this._editors.modifiedSelections.read(r);if(c.every(u=>u.isEmpty()))return nue;const l=new Xp(c.map(u=>mi.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)?nue:h}),this._register(du((r,o)=>{if(!this._options.shouldRenderOldRevertArrows.read(r))return;const a=this._diffModel.read(r),c=a?.diff.read(r);if(!a||!c||a.movedTextToCompare.read(r))return;const l=[],d=this._selectedDiffs.read(r),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(r),f=o.add(new UJ(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=o.add(new UJ(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(f),l.push(f)}o.add(Ee(()=>{for(const u of l)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}const Use=class Use 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${Use.counter++}`,this._domNode=Wt("div.revertButton",{title:this._revertSelection?g(5268,"Revert Selected Changes"):g(5269,"Revert Change")},[eC(ve.arrowRight)]).root,this._register(ue(this._domNode,ke.MOUSE_DOWN,r=>{r.button!==2&&(r.stopPropagation(),r.preventDefault())})),this._register(ue(this._domNode,ke.MOUSE_UP,r=>{r.stopPropagation(),r.preventDefault()})),this._register(ue(this._domNode,ke.CLICK,r=>{this._diffs instanceof N_?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),r.stopPropagation(),r.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:j_.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};Use.counter=0;let UJ=Use,Bve=class extends V{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,r,o,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=r,this._instantiationService=o,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=qn(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=qn(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=eu(this.modified),this.originalObs=eu(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=qn(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=Zh({owner:this,equalsFn:re.equals},c=>this.modifiedSelections.read(c)[0]?.getPosition()??new re(1,1)),this.originalCursor=qn(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new re(1,1)),this.isOriginalFocused=eu(this.original).isFocused,this.isModifiedFocused=eu(this.modified).isFocused,this.isFocused=et(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(WU({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 r=this._createInnerEditor(e,t,i,n);return this._register(r.onDidContentSizeChange(o=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+_W.ENTIRE_DIFF_OVERVIEW_WIDTH,c=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:c,contentWidth:a,contentHeightChanged:o.contentHeightChanged,contentWidthChanged:o.contentWidthChanged})})),r}_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=Ch.revealHorizontalRightPadding.defaultValue+_W.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,""):""}};Bve=D([_(5,we),_(6,Vt)],Bve);const Vse=class Vse extends V{constructor(){super(...arguments),this._id=++Vse.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=_t.Smooth){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=_t.Smooth){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=_t.Smooth){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=_t.Smooth){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=_t.Smooth){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=_t.Smooth){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=_t.Smooth){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=_t.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=_t.Smooth){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=_t.Smooth){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=_t.Smooth){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=_t.Smooth){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=_t.Smooth,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=_t.Smooth){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=_t.Smooth){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=_t.Smooth){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=_t.Smooth){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=_t.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)}};Vse.idCounter=0;let Wve=Vse,VJ=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Yt(this,0),this._screenReaderMode=qn(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=et(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=et(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=et(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=et(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=et(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=et(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=et(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=et(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=et(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=et(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=et(this,n=>this._options.read(n).maxComputationTime),this.showMoves=et(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=et(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=et(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=et(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=et(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=et(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=et(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=et(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=et(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.compactMode=et(this,n=>this._options.read(n).compactMode),this.trueInlineDiffRenderingEnabled=et(this,n=>this._options.read(n).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=et(this,n=>!this.renderSideBySide.read(n)&&this.trueInlineDiffRenderingEnabled.read(n)),this.hideUnchangedRegions=et(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=et(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=et(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=et(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount),this._model=Yt(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,n=>fxt(this,r=>{const o=n?.diff.read(r);return o?n1t(o,this.trueInlineDiffRenderingEnabled.read(r)):void 0})).flatten().map(this,n=>!!n),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...aHe(e,Hl)};this._options=Yt(this,i)}updateOptions(e){const t=aHe(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)}};VJ=D([_(1,_o)],VJ);function n1t(s,e){return s.mappings.every(t=>s1t(t.lineRangeMapping)||r1t(t.lineRangeMapping)||e&&eMe(t.lineRangeMapping))}function s1t(s){return s.original.length===0}function r1t(s){return s.modified.length===0}function aHe(s,e){return{enableSplitViewResizing:xt(s.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:rlt(s.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:xt(s.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:xt(s.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:r0(s.maxComputationTime,e.maxComputationTime,0,Vn.MAX_SAFE_SMALL_INTEGER),maxFileSize:r0(s.maxFileSize,e.maxFileSize,0,Vn.MAX_SAFE_SMALL_INTEGER),ignoreTrimWhitespace:xt(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:xt(s.renderIndicators,e.renderIndicators),originalEditable:xt(s.originalEditable,e.originalEditable),diffCodeLens:xt(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:xt(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:qo(s.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:qo(s.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:xt(s.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:xt(s.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:xt(s.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:xt(s.experimental?.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:xt(s.hideUnchangedRegions?.enabled??s.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:r0(s.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,Vn.MAX_SAFE_SMALL_INTEGER),minimumLineCount:r0(s.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,Vn.MAX_SAFE_SMALL_INTEGER),revealLineCount:r0(s.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,Vn.MAX_SAFE_SMALL_INTEGER)},isInEmbeddedEditor:xt(s.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:xt(s.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:r0(s.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,Vn.MAX_SAFE_SMALL_INTEGER),useInlineViewWhenSpaceIsLimited:xt(s.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:xt(s.renderGutterMenu,e.renderGutterMenu),compactMode:xt(s.compactMode,e.compactMode)}}var SB;let yp=(SB=class extends Wve{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}get collapseUnchangedRegions(){return this._options.hideUnchangedRegions.get()}constructor(e,t,i,n,r,o,a,c){super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=r,this._accessibilitySignalService=a,this._editorProgressService=c,this.elements=Wt("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Wt("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Wt("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Wt("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(C3(this,void 0)),this._diffModel=et(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 Vc([Le,this._contextKeyService]))),this._boundarySashes=Yt(this,void 0),this._accessibleDiffViewerShouldBeVisible=Yt(this,!1),this._accessibleDiffViewerVisible=et(this,C=>this._options.onlyShowAccessibleDiffViewer.read(C)?!0:this._accessibleDiffViewerShouldBeVisible.read(C)),this._movedBlocksLinesPart=Yt(this,void 0),this._layoutInfo=et(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 Be=k.sashLeft.read(C),Ct=this._movedBlocksLinesPart.read(C)?.width.read(C)??0;G=0,Y=Be-R-Ct,ge=Be-R,j=Be,ne=A-j-z}else{ge=0;const Be=this._options.inlineViewHideOriginalLineNumbers.read(C);G=R,Be?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),o.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 iXe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(VJ,t),this._register(ci(C=>{this._options.setWidth(this._rootSizeObserver.width.read(C))})),this._contextKeyService.createKey(J.isEmbeddedDiffEditor.key,!1),this._register(Rv(J.isEmbeddedDiffEditor,this._contextKeyService,C=>this._options.isInEmbeddedEditor.read(C))),this._register(Rv(J.comparingMovedCode,this._contextKeyService,C=>!!this._diffModel.read(C)?.movedTextToCompare.read(C))),this._register(Rv(J.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,C=>this._options.couldShowInlineViewBecauseOfSize.read(C))),this._register(Rv(J.diffEditorInlineMode,this._contextKeyService,C=>!this._options.renderSideBySide.read(C))),this._register(Rv(J.hasChanges,this._contextKeyService,C=>(this._diffModel.read(C)?.diff.read(C)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(Bve,this.elements.original,this.elements.modified,this._options,i,(C,A,L,k)=>this._createInnerEditor(C,A,L,k))),this._register(Rv(J.diffEditorOriginalWritable,this._contextKeyService,C=>this._options.originalEditable.read(C))),this._register(Rv(J.diffEditorModifiedWritable,this._contextKeyService,C=>!this._options.readOnly.read(C))),this._register(Rv(J.diffEditorOriginalUri,this._contextKeyService,C=>this._diffModel.read(C)?.model.original.uri.toString()??"")),this._register(Rv(J.diffEditorModifiedUri,this._contextKeyService,C=>this._diffModel.read(C)?.model.modified.uri.toString()??"")),this._overviewRulerPart=vh(this,C=>this._options.renderOverviewRuler.read(C)?this._instantiationService.createInstance(Wg(_W,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 J0t(this._options,l),this._sash=vh(this,C=>{const A=this._options.renderSideBySide.read(C);return this.elements.root.classList.toggle("side-by-side",A),A?new cXe(this.elements.root,l,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=vh(this,C=>this._instantiationService.createInstance(Wg(HJ,C),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);vh(this,C=>this._instantiationService.createInstance(Wg(Y0t,C),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let f=!1;const p=vh(this,C=>this._instantiationService.createInstance(Wg(Rve,C),lt(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.get().isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),m=et(this,C=>{const A=p.read(C).viewZones.read(C).orig,L=d.read(C).viewZones.read(C).origViewZones;return A.concat(L)}),v=et(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(FJ(this._editors.original,m,C=>{f=C},h));let b;this._register(FJ(this._editors.modified,v,C=>{f=C,f?b=ym.capture(this._editors.modified):(b?.restore(this._editors.modified),b=void 0)},u)),this._accessibleDiffViewer=vh(this,C=>this._instantiationService.createInstance(Wg(Px,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 U0t(this._editors))).recomputeInitiallyAndOnChange(this._store);const w=this._accessibleDiffViewerVisible.map(C=>C?"hidden":"visible");this._register(NA(this.elements.modified,{visibility:w})),this._register(NA(this.elements.original,{visibility:w})),this._createDiffEditorContributions(),o.addDiffEditor(this),this._gutter=vh(this,C=>this._options.shouldRenderGutterMenu.read(C)?this._instantiationService.createInstance(Wg(Nve,C),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(VN(this._layoutInfo)),vh(this,C=>new(Wg(tB,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(du((C,A)=>{if(y.read(C)===!0){const L=this._editorProgressService.show(!0,1e3);A.add(Ee(()=>L.done()))}})),this._register(du((C,A)=>{A.add(new(Wg(i1t,C))(this._editors,this._diffModel,this._options,this))})),this._register(du((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=>{bt(new Pi("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(ci(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(Kk,t,i,n)}_createDiffEditorContributions(){const e=dp.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 TU.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(WJ,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?fW.create(e).createNewRef(this):fW.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&&IM(t,n=>{const r=e?.object;qn.batchEventsGlobally(n,()=>{this._editors.original.setModel(r?r.model.original:null),this._editors.modified.setModel(r?r.model.modified:null)});const o=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),n),setTimeout(()=>{o?.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?o1t(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 re(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(r=>r.lineRangeMapping.modified.startLineNumber>i)??t[0]:n=Tk(t,r=>r.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 r=t.getSelection();if(r){const o=this._diffModel.get()?.diff.get()?.mappings.map(a=>e?a.lineRangeMapping.flip():a.lineRangeMapping);if(o){const a=KWe(r.getStartPosition(),o),c=KWe(r.getEndPosition(),o);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&&is(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&is(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===Bi.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(ll.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(ll.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(ll.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}},SB.ENTIRE_DIFF_OVERVIEW_WIDTH=_W.ENTIRE_DIFF_OVERVIEW_WIDTH,SB);yp=D([_(3,Le),_(4,we),_(5,qt),_(6,uv),_(7,nE)],yp);function o1t(s){return s.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,r,o,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?(r=t.modified.startLineNumber-1,o=0,a=void 0):(r=t.modified.startLineNumber,o=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:r,modifiedEndLineNumber:o,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 a1t=0,cHe=!1;function c1t(s){if(!s){if(cHe)return;cHe=!0}cpt(s||ri.document.body)}let iI=class extends Kk{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){const p={...t};p.ariaLabel=p.ariaLabel||oJ.editorViewAccessibleLabel,p.ariaLabel=p.ariaLabel+";"+oJ.accessibilityHelpMessage,super(e,p,{isStandaloneEditor:!0},i,n,r,o,l,d,h,u,f),c instanceof tI?this._standaloneKeybindingService=c:this._standaloneKeybindingService=null,c1t(p.ariaContainerElement),UYe((m,v)=>i.createInstance(RM,m,v,{})),sJe(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_"+ ++a1t,r=he.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,r),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)),r=e.keybindings,o=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(vt.registerCommand(h,l)),a){const f={command:{id:h,title:i},when:n,group:a,order:c};d.add(Yn.appendMenuItem(_e.EditorContext,f))}if(Array.isArray(r))for(const f of r)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,l,o));const u=new pje(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 UY)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};iI=D([_(2,we),_(3,qt),_(4,bi),_(5,Le),_(6,tc),_(7,Vt),_(8,mn),_(9,wi),_(10,_o),_(11,zs),_(12,nt)],iI);let PM=class extends iI{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v){const b={...t};NJ(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,r,o,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||Sa;C=hXe(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){NJ(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)}};PM=D([_(2,we),_(3,qt),_(4,bi),_(5,Le),_(6,tc),_(7,Vt),_(8,hv),_(9,wi),_(10,Te),_(11,_o),_(12,fi),_(13,Di),_(14,zs),_(15,nt)],PM);let zJ=class extends yp{constructor(e,t,i,n,r,o,a,c,l,d,h,u){const f={...t};NJ(c,f,!0);const p=o.registerEditorContainer(e);typeof f.theme=="string"&&o.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&o.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{isStandaloneEditor:!0},n,i,r,u,d),this._configurationService=c,this._standaloneThemeService=o,this._register(p)}dispose(){super.dispose()}updateOptions(e){NJ(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(iI,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)}};zJ=D([_(2,we),_(3,Le),_(4,qt),_(5,hv),_(6,wi),_(7,Te),_(8,lo),_(9,nE),_(10,gg),_(11,uv)],zJ);function hXe(s,e,t,i,n){if(t=t||"",!i){const r=t.indexOf(` +`);let o=t;return r!==-1&&(o=t.substring(0,r)),lHe(s,t,e.createByFilepathOrFirstLine(n||null,o),n)}return lHe(s,t,e.createById(i),n)}function lHe(s,e,t,i){return s.createModel(e,t,i)}var l1t=".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}}}";gt(l1t,{});class d1t{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let $J=class extends V{constructor(e,t,i,n){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=Yt(this,void 0),this._collapsed=et(this,o=>this._viewModel.read(o)?.collapsed.read(o)),this._editorContentHeight=Yt(this,500),this.contentHeight=et(this,o=>(this._collapsed.read(o)?0:this._editorContentHeight.read(o))+this._outerEditorHeight),this._modifiedContentWidth=Yt(this,0),this._modifiedWidth=Yt(this,0),this._originalContentWidth=Yt(this,0),this._originalWidth=Yt(this,0),this.maxScroll=et(this,o=>{const a=this._modifiedContentWidth.read(o)-this._modifiedWidth.read(o),c=this._originalContentWidth.read(o)-this._originalWidth.read(o);return a>c?{maxScroll:a,width:this._modifiedWidth.read(o)}:{maxScroll:c,width:this._originalWidth.read(o)}}),this._elements=Wt("div.multiDiffEntry",[Wt("div.header@header",[Wt("div.header-content",[Wt("div.collapse-button@collapseButton"),Wt("div.file-path",[Wt("div.title.modified.show-file-icons@primaryPath",[]),Wt("div.status.deleted@status",["R"]),Wt("div.title.original.show-file-icons@secondaryPath",[])]),Wt("div.actions@actions")])]),Wt("div.editorParent",[Wt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(yp,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=eu(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=eu(this.editor.getOriginalEditor()).isFocused,this.isFocused=et(this,o=>this.isModifedFocused.read(o)||this.isOriginalFocused.read(o)),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 r=new Zd(this._elements.collapseButton,{});this._register(ci(o=>{r.element.className="",r.icon=this._collapsed.read(o)?ve.chevronRight:ve.chevronDown})),this._register(r.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(ci(o=>{this._elements.editor.style.display=this._collapsed.read(o)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(o=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(o=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(o=>{fV(a=>{this._editorContentHeight.set(o.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(o=>{if(this._isSettingScrollTop||!o.scrollTopChanged||!this._data)return;const a=o.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(ci(o=>{const a=this._viewModel.read(o)?.isActive.read(o);this._elements.root.classList.toggle("active",a)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(Cm,this._elements.actions,_e.MultiDiffEditorFileToolbar,{actionRunner:this._register(new lXe(()=>this._viewModel.get()?.modifiedUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:o=>o.startsWith("navigation")},actionViewItemProvider:(o,a)=>GN(n,o,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){fV(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;fV(n=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let r=!1,o=!1,a=!1,c="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(c="R",r=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(c="A",a=!0):(c="D",o=!0),this._elements.status.classList.toggle("renamed",r),this._elements.status.classList.toggle("deleted",o),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=c,this._resourceLabel2?.setUri(r?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 r=e.length-this._headerHeight,o=Math.max(0,Math.min(n.start-e.start,r));this._elements.header.style.transform=`translateY(${o}px)`,fV(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",o>0||i>0),this._elements.header.classList.toggle("collapsed",o===r)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};$J=D([_(3,we)],$J);class h1t{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 Hve=class extends V{constructor(e,t,i,n,r,o){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=r,this._parentInstantiationService=o,this._scrollableElements=Wt("div.scrollContent",[Wt("div@content",{style:{overflow:"hidden"}}),Wt("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new DN({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>Nl(lt(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new y6(this._scrollableElements.root,{vertical:Cr.Auto,horizontal:Cr.Auto,useShadows:!1},this._scrollable)),this._elements=Wt("div.monaco-component.multiDiffEditor",{},[Wt("div",{},[this._scrollableElement.getDomNode()]),Wt("div.placeholder@placeholder",{},[Wt("div",[g(9360,"No Changed Files")])])]),this._sizeObserver=this._register(new iXe(this._element,void 0)),this._objectPool=this._register(new h1t(c=>{const l=this._instantiationService.createInstance($J,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return l.setData(c),l})),this.scrollTop=qn(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=qn(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=TI(this,(c,l)=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:p=>{throw new Pi}};const h=d.items.read(c),u=new Map;return{items:h.map(p=>{const m=l.add(new g1t(p,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),v=this._lastDocStates?.[m.getKey()];return v&&is(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=et(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 Vc([Le,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(J.inMultiDiffEditor.key,!0),this._register(du((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(ci(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(ci(c=>{const l=this._dimension.read(c);this._sizeObserver.observe(l)})),this._register(ci(c=>{const l=this._viewItems.read(c);this._elements.placeholder.classList.toggle("visible",l.length===0)})),this._scrollableElements.content.style.position="relative",this._register(ci(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=aTe(f,Sc(m=>m.maxScroll.read(c).maxScroll,ru));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(ci(c=>{fV(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 Pi("Resource not found in diff editor");const r=i[n];this._viewModel.get().activeDiffItem.setCache(r.viewModel,void 0);let o=0;for(let l=0;l[e.getKey(),e.getViewState()]))}}setViewState(e){this.setScrollState(e.scrollState),this._lastDocStates=e.docStates,is(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,r=0;const o=this._sizeObserver.height.read(e),a=_i.ofStartAndLength(t,o),c=this._sizeObserver.width.read(e);for(const l of this._viewItems.read(e)){const d=l.contentHeight.read(e),h=Math.min(d,o),u=_i.ofStartAndLength(n,h),f=_i.ofStartAndLength(r,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=_i.ofStartAndLength(t+i,o);l.render(u,p,c,m)}n+=h+this._spaceBetweenPx,r+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};Hve=D([_(4,Le),_(5,we)],Hve);function u1t(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 g1t extends V{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(C3(this,void 0)),this.contentHeight=et(this,r=>this._templateRef.read(r)?.object.contentHeight?.read(r)??this.viewModel.lastTemplateData.read(r).contentHeight),this.maxScroll=et(this,r=>this._templateRef.read(r)?.object.maxScroll.read(r)??{maxScroll:0,scrollWidth:0}),this.template=et(this,r=>this._templateRef.read(r)?.object),this._isHidden=Yt(this,!1),this._isFocused=et(this,r=>this.template.read(r)?.isFocused.read(r)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(ci(r=>{const o=this._scrollLeft.read(r);this._templateRef.read(r)?.object.setScrollLeft(o)})),this._register(ci(r=>{const o=this._templateRef.read(r);!o||!this._isHidden.read(r)||o.object.isFocused.read(r)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}getViewState(){return is(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(ht.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const r=this._templateRef.get();r&&n&&r.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&&is(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 r=this._templateRef.get();if(!r){r=this._objectPool.getUnusedObj(new d1t(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(r,void 0);const o=this.viewModel.lastTemplateData.get().selections;o&&r.object.editor.setSelections(o)}r.object.render(e,i,t,n)}}class uXe extends V{async waitForDiffs(){for(const e of this.items.get())await e.diffEditorViewModel.waitForDiff()}collapseAll(){is(e=>{for(const t of this.items.get())t.collapsed.set(!0,e)})}expandAll(){is(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=JYe(this.model,this.model.documents),this.items=lJ(this,this._documents,(i,n)=>n.add(this._instantiationService.createInstance(Uve,i,this))).recomputeInitiallyAndOnChange(this._store),this.focusedDiffItem=et(this,i=>this.items.read(i).find(n=>n.isFocused.read(i))),this.activeDiffItem=gxt(this,(i,n)=>this.focusedDiffItem.read(i)??n)}}let Uve=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=Yt(this,!1),this.lastTemplateData=Yt(this,{contentHeight:500,selections:void 0}),this.isActive=et(this,d=>this._editorViewModel.activeDiffItem.read(d)===this),this._isFocusedSource=Yt(this,rd(!1)),this.isFocused=et(this,d=>this._isFocusedSource.read(d).read(d)),this.isAlive=Yt(this,!0),this._register(Ee(()=>{this.isAlive.set(!1,void 0)})),this.documentDiffItemRef=this._register(e.createNewRef(this));function r(d){return{...d,hideUnchangedRegions:{enabled:!0}}}const o=this._instantiationService.createInstance(VJ,r(this.documentDiffItem.options||{}));this.documentDiffItem.onOptionsDidChange&&this._register(this.documentDiffItem.onOptionsDidChange(()=>{o.updateOptions(r(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(fW.createWithDisposable(this._instantiationService.createInstance(WJ,{original:c,modified:l},o),a,this))}getKey(){return JSON.stringify([this.originalUri?.toString(),this.modifiedUri?.toString()])}};Uve=D([_(2,we),_(3,fi)],Uve);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 Vve=class extends V{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Yt(this,void 0),this._viewModel=Yt(this,void 0),this._widgetImpl=TI(this,(n,r)=>(Wg($J,n),r.add(this._instantiationService.createInstance(Wg(Hve,n),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._activeControl=et(this,n=>this._widgetImpl.read(n).activeControl.read(n)),this.onDidChangeActiveControl=M.fromObservableLight(this._activeControl),this._register(VN(this._widgetImpl))}reveal(e,t){this._widgetImpl.get().reveal(e,t)}createViewModel(e){return new uXe(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)}};Vve=D([_(2,we)],Vve);const iMe=ae("IEditorCancelService"),gXe=new Q("cancellableOperation",!1,g(9366,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ce(iMe,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const r=gXe.bindTo(n.get(Le)),o=new ul;return{key:r,tokens:o}}),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 f1t extends li{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(iMe).add(e,this))}dispose(){this._unregister(),super.dispose()}}Qe(new class extends uc{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:Ae.EditorContrib,primary:S.Escape},precondition:gXe})}runEditorCommand(s,e){s.get(iMe).cancel(e)}});var jr;(function(s){s[s.Value=1]="Value",s[s.Selection=2]="Selection",s[s.Position=4]="Position",s[s.Scroll=8]="Scroll"})(jr||(jr={}));let Yae=class zve{constructor(e,t){if(this.flags=t,this.flags&jr.Value){const i=e.getModel();this.modelVersionId=i?qp("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&jr.Position?this.position=e.getPosition():this.position=null,this.flags&jr.Selection?this.selection=e.getSelection():this.selection=null,this.flags&jr.Scroll?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof zve))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 zve(e,this.flags))}};class nI extends f1t{constructor(e,t,i,n){super(e,n),this._listener=new Z,t&jr.Position&&this._listener.add(e.onDidChangeCursorPosition(r=>{(!i||!F.containsPosition(i,r.position))&&this.cancel()})),t&jr.Selection&&this._listener.add(e.onDidChangeCursorSelection(r=>{(!i||!F.containsRange(i,r.selection))&&this.cancel()})),t&jr.Scroll&&this._listener.add(e.onDidScrollChange(r=>this.cancel())),t&jr.Value&&(this._listener.add(e.onDidChangeModel(r=>this.cancel())),this._listener.add(e.onDidChangeModelContent(r=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class nMe extends li{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class vW{static _handleEolEdits(e,t){let i;const n=[];for(const r of t)typeof r.eol=="number"&&(i=r.eol),r.range&&typeof r.text=="string"&&n.push(r);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=ym.capture(e),r=vW._handleEolEdits(e,t);r.length===1&&vW._isFullModelReplaceEdit(e,r[0])?e.executeEdits("formatEditsCommand",r.map(o=>es.replace(F.lift(o.range),o.text))):e.executeEdits("formatEditsCommand",r.map(o=>es.replaceMove(F.lift(o.range),o.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}function fXe(s){return s.scheme===pe.vscodeRemote?s.authority:void 0}function W6(s){if(!s)return;const e=s.indexOf("+");return e<0?s:s.substr(0,e)}const p1t="extensions.user.cache",m1t="extensions.builtin.cache",pXe="undefined_publisher",_1t=["ui","workspace","web"];function CK(s){if(typeof s=="object"&&s!==null&&s.supported!==!0)return s.description}const mXe=["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 wo;(function(s){s[s.System=0]="System",s[s.User=1]="User"})(wo||(wo={}));var xs;(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"})(xs||(xs={}));class An{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 ga(i,n)}return e._lower===t._lower}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class D_{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(An.toKey(e))}delete(e){return this._set.delete(An.toKey(e))}has(e){return this._set.has(An.toKey(e))}}class ba{constructor(){this._map=new Map}clear(){this._map.clear()}delete(e){this._map.delete(An.toKey(e))}get(e){return this._map.get(An.toKey(e))}has(e){return this._map.has(An.toKey(e))}set(e,t){this._map.set(An.toKey(e),t)}values(){return this._map.values()}forEach(e){this._map.forEach(e)}[Symbol.iterator](){return this._map[Symbol.iterator]()}}function v1t(s){return sMe(s)}function sMe(s){return s.contributes&&s.contributes.localizations?s.contributes.localizations.length>0:!1}function b1t(s,e){if(e){const t=`onResolveRemoteAuthority:${W6(e)}`;return!!s.activationEvents?.includes(t)}return!1}function w1t(s){return s.map(e=>{const[t,i]=e.split("@");return{proposalName:t,version:i?parseInt(i):void 0}})}function y1t(s){return s.map(e=>e.split("@")[0])}function Jae(s,e,t){const i=[],n=new D_,r=s.ordered(t);for(const a of r)i.push(a),a.extensionId&&n.add(a.extensionId);const o=e.ordered(t);for(const a of o){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 bW;(function(s){s[s.File=1]="File",s[s.Selection=2]="Selection"})(bW||(bW={}));var cm;(function(s){s[s.Explicit=1]="Explicit",s[s.Silent=2]="Silent"})(cm||(cm={}));const Xz=class Xz{static setFormatterSelector(e){return{dispose:Xz._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const r=ui.first(Xz._selectors);if(r)return await r(e,t,i,n)}};Xz._selectors=new ul;let wW=Xz;async function Xae(s,e,t,i,n,r,o){const a=s.get(we),{documentRangeFormattingEditProvider:c}=s.get(nt),l=jo(e)?e.getModel():e,d=c.ordered(l),h=await wW.select(d,l,i,bW.Selection);h&&(n.report(h),await a.invokeFunction(_Xe,h,e,t,r,o))}async function _Xe(s,e,t,i,n,r){const o=s.get(Fl),a=s.get(Ke),c=s.get(uv);let l,d;jo(t)?(l=t.getModel(),d=new nI(t,jr.Value|jr.Position,void 0,n)):(l=t,d=new nMe(t,n));const h=[];let u=0;for(const b of z_(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 ht(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn)];return null})}return c.playSignal(ll.format,{userGesture:r}),!0}async function $ve(s,e,t,i,n,r){const o=s.get(we),a=s.get(nt),c=jo(e)?e.getModel():e,l=Jae(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,c),d=await wW.select(l,c,t,bW.File);d&&(i.report(d),await o.invokeFunction(vXe,d,e,t,n,r))}async function vXe(s,e,t,i,n,r){const o=s.get(Fl),a=s.get(uv);let c,l;jo(t)?(c=t.getModel(),l=new nI(t,jr.Value|jr.Position,void 0,n)):(c=t,l=new nMe(t,n));let d;try{const h=await e.provideDocumentFormattingEdits(c,c.getFormattingOptions(),l.token);if(d=await o.computeMoreMinimalEdits(c.uri,h),l.token.isCancellationRequested)return!0}finally{l.dispose()}if(!d||d.length===0)return!1;if(jo(t))vW.execute(t,d,i!==cm.Silent),i!==cm.Silent&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),_t.Immediate);else{const[{range:h}]=d,u=new ht(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 ht(p.startLineNumber,p.startColumn,p.endLineNumber,p.endColumn)];return null})}return a.playSignal(ll.format,{userGesture:r}),!0}async function C1t(s,e,t,i,n,r){const o=e.documentRangeFormattingEditProvider.ordered(t);for(const a of o){const c=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,r)).catch(Nr);if(tr(c))return await s.computeMoreMinimalEdits(t.uri,c)}}async function S1t(s,e,t,i,n){const r=Jae(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const o of r){const a=await Promise.resolve(o.provideDocumentFormattingEdits(t,i,n)).catch(Nr);if(tr(a))return await s.computeMoreMinimalEdits(t.uri,a)}}function bXe(s,e,t,i,n,r,o){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,r,o)).catch(Nr).then(c=>s.computeMoreMinimalEdits(t.uri,c))}vt.registerCommand("_executeFormatRangeProvider",async function(s,...e){const[t,i,n]=e;Lt(N.isUri(t)),Lt(F.isIRange(i));const r=s.get(pn),o=s.get(Fl),a=s.get(nt),c=await r.createModelReference(t);try{return C1t(o,a,c.object.textEditorModel,F.lift(i),n,Ue.None)}finally{c.dispose()}});vt.registerCommand("_executeFormatDocumentProvider",async function(s,...e){const[t,i]=e;Lt(N.isUri(t));const n=s.get(pn),r=s.get(Fl),o=s.get(nt),a=await n.createModelReference(t);try{return S1t(r,o,a.object.textEditorModel,i,Ue.None)}finally{a.dispose()}});vt.registerCommand("_executeFormatOnTypeProvider",async function(s,...e){const[t,i,n,r]=e;Lt(N.isUri(t)),Lt(re.isIPosition(i)),Lt(typeof n=="string");const o=s.get(pn),a=s.get(Fl),c=s.get(nt),l=await o.createModelReference(t);try{return bXe(a,c,l.object.textEditorModel,re.lift(i),n,r,Ue.None)}finally{l.dispose()}});var Al;(function(s){s[s.provider=0]="provider",s[s.userDefined=1]="userDefined",s[s.recovered=2]="recovered"})(Al||(Al={}));const A1t={[Al.provider]:" ",[Al.userDefined]:"u",[Al.recovered]:"r"},dHe=65535,Gv=16777215,hHe=4278190080;class sue{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<dHe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new sue(e.length),this._userDefinedStates=new sue(e.length),this._recoveredStates=new sue(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,n)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=i&&this.getEndLineNumber(r)>=n};for(let i=0,n=this._startIndexes.length;iGv||o>Gv)throw new Error("startLineNumber or endLineNumber must not exceed "+Gv);for(;e.length>0&&!t(r,o);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=r+((a&255)<<24),this._endIndexes[i]=o+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Gv}getEndLineNumber(e){return this._endIndexes[e]&Gv}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)?Al.userDefined:this.isRecovered(e)?Al.recovered:Al.provider}setSource(e,t){t===Al.userDefined?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===Al.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]&hHe)>>>16);return t===dHe?-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===Al.userDefined?m=d:(m=l,m.isCollapsed=d.isCollapsed&&l.endLineNumber===d.endLineNumber,m.source=Al.provider),l=r(++a)):(m=d,d.isCollapsed&&d.source===Al.provider&&(m.source=Al.recovered)),d=o(++c);else{let v=c,b=d;for(;;){if(!b||b.startLineNumber>l.endLineNumber){m=l;break}if(b.source===Al.userDefined&&b.endLineNumber>l.endLineNumber)break;b=o(++v)}l=r(++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 E1t{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,r=-1,o=-1;const a=c=>{for(;no&&(o=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),r=Math.max(r,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 r of e)if(!(r.startLineNumber>n.endLineNumber||n.startLineNumber>r.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,r)=>{for(const o of e)if(n=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const a=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.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 r of e){if(r.startLineNumber>=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const o=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);(!r.checksum||o===r.checksum)&&t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:void 0,isCollapsed:r.isCollapsed??!0,source:r.source??Al.provider})}const n=qf.sanitizeAndMerge(this._regions,t,i);this.updatePost(qf.fromFoldRanges(n))}_getLinesChecksum(e,t){return Hc(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),r=1;for(;n>=0;){const o=this._regions.toRegion(n);(!t||t(o,r))&&i.push(o),r++,n=o.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,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const o=[];for(let a=n,c=this._regions.length;a0&&!l.containedBy(o[o.length-1]);)o.pop();o.push(l),t(l,o.length)&&i.push(l)}else break}}else for(let o=n,a=this._regions.length;o1){const a=s.getRegionsInside(r,(c,l)=>c.isCollapsed!==o&&l0)for(const r of i){const o=s.getRegionAtLine(r);if(o&&(o.isCollapsed!==e&&n.push(o),t>1)){const a=s.getRegionsInside(o,(c,l)=>c.isCollapsed!==e&&lo.isCollapsed!==e&&aa.isCollapsed!==e&&c<=t);n.push(...o)}s.toggleCollapseState(n)}function D1t(s,e,t){const i=[];for(const n of t){const r=s.getAllRegionsAtLine(n,o=>o.isCollapsed!==e);r.length>0&&i.push(r[0])}s.toggleCollapseState(i)}function k1t(s,e,t,i){const n=(o,a)=>a===e&&o.isCollapsed!==t&&!i.some(c=>o.containsLine(c)),r=s.getRegionsInside(null,n);s.toggleCollapseState(r)}function yXe(s,e,t){const i=[];for(const o of t){const a=s.getAllRegionsAtLine(o,void 0);a.length>0&&i.push(a[0])}const n=o=>i.every(a=>!a.containedBy(o)&&!o.containedBy(a))&&o.isCollapsed!==e,r=s.getRegionsInside(null,n);s.toggleCollapseState(r)}function oMe(s,e,t){const i=s.textModel,n=s.regions,r=[];for(let o=n.length-1;o>=0;o--)if(t!==n.isCollapsed(o)){const a=n.getStartLineNumber(o);e.test(i.getLineContent(a))&&r.push(n.toRegion(o))}s.toggleCollapseState(r)}function aMe(s,e,t){const i=s.regions,n=[];for(let r=i.length-1;r>=0;r--)t!==i.isCollapsed(r)&&e===i.getType(r)&&n.push(i.toRegion(r));s.toggleCollapseState(n)}function I1t(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 T1t(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 L1t(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||kb(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,r=Number.MAX_VALUE,o=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return uHe(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const r=o=>((!n||!N1t(o,n))&&(n=uHe(this._hiddenRanges,o)),n?n.startLineNumber-1:null);for(let o=0,a=e.length;o0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function N1t(s,e){return s>=e.startLineNumber&&s<=e.endLineNumber}function uHe(s,e){const t=D2(s,i=>e=0&&s[t].endLineNumber>=e?s[t]:null}const P1t=5e3,F1t="indent";class cMe{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=F1t}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(W1t(this.editorModel,i,n,this.foldingRangesLimit))}}let O1t=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Gv||t>Gv)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 r=this._length-1,o=0;r>=0;r--,o++)i[o]=this._startIndexes[r],n[o]=this._endIndexes[r];return new qf(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 r=e.getOptions().tabSize,o=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=Aae(h,r);(u{}};function W1t(s,e,t,i=B1t){const n=s.getOptions().tabSize,r=new O1t(i);let o;t&&(o=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=Aae(d,n);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=l);continue}let f;if(o&&(f=d.match(o)))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],r.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&&r.insertFirst(l,p,h)}u.indent===h?u.endAbove=l:a.push({indent:h,endAbove:l,line:l})}return r.toIndentRanges(s)}const H1t=W("editor.foldBackground",{light:rt(kS,.3),dark:rt(kS,.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",mY,g(1687,"Color of the folding control in the editor gutter."));const GJ=oi("folding-expanded",ve.chevronDown,g(1688,"Icon for expanded ranges in the editor glyph margin.")),KJ=oi("folding-collapsed",ve.chevronRight,g(1689,"Icon for collapsed ranges in the editor glyph margin.")),gHe=oi("folding-manual-collapsed",KJ,g(1690,"Icon for manually collapsed ranges in the editor glyph margin.")),fHe=oi("folding-manual-expanded",GJ,g(1691,"Icon for manually expanded ranges in the editor glyph margin.")),rue={color:$r(H1t),position:Rh.Inline},wP=g(1692,"Click to expand the range."),SK=g(1693,"Click to collapse the range."),Ka=class Ka{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ka.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ka.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ka.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ka.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ka.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ka.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ka.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ka.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ka.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ka.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ka.MANUALLY_EXPANDED_VISUAL_DECORATION:Ka.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};Ka.COLLAPSED_VISUAL_DECORATION=Kt.register({description:"folding-collapsed-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:wP,firstLineDecorationClassName:He.asClassName(KJ)}),Ka.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Kt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:rue,isWholeLine:!0,linesDecorationsTooltip:wP,firstLineDecorationClassName:He.asClassName(KJ)}),Ka.MANUALLY_COLLAPSED_VISUAL_DECORATION=Kt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:wP,firstLineDecorationClassName:He.asClassName(gHe)}),Ka.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Kt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:rue,isWholeLine:!0,linesDecorationsTooltip:wP,firstLineDecorationClassName:He.asClassName(gHe)}),Ka.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:wP}),Ka.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:rue,isWholeLine:!0,linesDecorationsTooltip:wP}),Ka.EXPANDED_VISUAL_DECORATION=Kt.register({description:"folding-expanded-visual-decoration",stickiness:si.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+He.asClassName(GJ),linesDecorationsTooltip:SK}),Ka.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Kt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:si.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:He.asClassName(GJ),linesDecorationsTooltip:SK}),Ka.MANUALLY_EXPANDED_VISUAL_DECORATION=Kt.register({description:"folding-manually-expanded-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+He.asClassName(fHe),linesDecorationsTooltip:SK}),Ka.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Kt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:He.asClassName(fHe),linesDecorationsTooltip:SK}),Ka.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Kt.register({description:"folding-no-controls-range-decoration",stickiness:si.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0}),Ka.HIDDEN_RANGE_DECORATION=Kt.register({description:"folding-hidden-range-decoration",stickiness:si.NeverGrowsWhenTypingAtEdges});let Gve=Ka;const U1t={},V1t="syntax";class lMe{constructor(e,t,i,n,r){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=r,this.id=V1t,this.disposables=new Z,r&&this.disposables.add(r);for(const o of t)typeof o.onDidChange=="function"&&this.disposables.add(o.onDidChange(i))}compute(e){return z1t(this.providers,this.editorModel,e).then(t=>t?G1t(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function z1t(s,e,t){let i=null;const n=s.map((r,o)=>Promise.resolve(r.provideFoldingRanges(e,U1t,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:o,kind:l.kind})}},Nr));return Promise.all(n).then(r=>i)}class $1t{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>Gv||t>Gv)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=n,this._types[r]=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),r=new Uint32Array(e),o=[];for(let a=0,c=0;a{let c=o.start-a.start;return c===0&&(c=o.rank-a.rank),c}),i=new $1t(e);let n;const r=[];for(const o of t)if(!n)n=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else if(o.start>n.start)if(o.end<=n.end)r.push(n),n=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else{if(o.start>n.end){do n=r.pop();while(n&&o.start>n.end);n&&r.push(n),n=o}i.add(o.start,o.end,o.kind&&o.kind.value,r.length)}return i.toIndentRanges()}var f0;const vd=new Q("foldingEnabled",!1);var AL;let PA=(AL=class extends V{static get(e){return e.getContribution(f0.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return f0._foldingRangeSelector?.(i,t)??i}static setFoldingRangeProviderSelector(e){return f0._foldingRangeSelector=e,{dispose:()=>{f0._foldingRangeSelector=void 0}}}constructor(e,t,i,n,r,o){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=o,this.localToDispose=this._register(new Z),this.editor=e,this._foldingLimitReporter=new CXe(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=r.for(o.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 Gve(e),this.foldingDecorationProvider.showFoldingControls=a.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=a.get(x.foldingHighlight),this.foldingEnabled=vd.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 x1t(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new M1t(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Ph(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new ln(()=>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 cMe(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=f0.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new lMe(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 Ys,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Mo(r=>i.compute(r));return n.then(r=>{if(r&&n===this.foldingRegionPromise){let o;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=r.setCollapsedAllOfType(u_.Imports.value,!0);d&&(o=ym.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),c=a?a.map(d=>d.startLineNumber):[];e.update(r,c),o?.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 n=[];for(const r of i){const o=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(o)&&n.push(...t.getAllRegionsAtLine(o,a=>a.isCollapsed&&o>a.startLineNumber))}n.length&&(t.toggleCollapseState(n),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 n=e.target.detail,r=e.target.element.offsetLeft;if(n.offsetX-r<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 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,r=e.target.range;if(!r||r.startLineNumber!==i)return;if(n){if(e.target.type!==Mt.GUTTER_LINE_DECORATIONS)return}else{const a=this.editor.getModel();if(!a||r.startColumn!==a.getLineMaxColumn(i))return}const o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){const a=o.isCollapsed;if(n||a){const c=e.event.altKey;let l=[];if(c){const d=u=>!u.containedBy(o)&&!o.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(o))h.isCollapsed===a&&l.push(h);(a||!d||l.length===0)&&l.push(o)}t.toggleCollapseState(l),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,_t.Smooth)}},f0=AL,AL.ID="editor.contrib.folding",AL);PA=f0=D([_(1,Le),_(2,zs),_(3,wi),_(4,xp),_(5,nt)],PA);class CXe{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 th extends it{runEditorCommand(e,t,i){const n=e.get(zs),r=PA.get(t);if(!r)return;const o=r.getFoldingModel();if(o)return this.reportTelemetry(e,t),o.then(a=>{if(a){this.invoke(r,a,t,i,n);const c=t.getSelection();c&&r.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 SXe(s){if(!Ja(s)){if(!In(s))return!1;const e=s;if(!Ja(e.levels)&&!dc(e.levels)||!Ja(e.direction)&&!Rt(e.direction)||!Ja(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(dc)))return!1}return!0}class K1t extends th{constructor(){super({id:"editor.unfold",label:g(453,"Unfold"),alias:"Unfold",precondition:vd,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. @@ -681,43 +681,43 @@ ${e.toString()}`}}class B3{constructor(e=new Vc,t=!1,i,n=r0t){this._services=e,t * '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:SXe,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 r=this.getLineNumbers(n,i),o=n&&n.levels,a=n&&n.direction;typeof o!="number"&&typeof a!="string"?D1t(t,!0,r):a==="up"?wXe(t,!0,o||1,r):zU(t,!0,o||1,r)}}class j1t extends th{constructor(){super({id:"editor.toggleFold",label:g(456,"Toggle Fold"),alias:"Toggle Fold",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyL),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);rMe(t,1,n)}}class Y1t extends th{constructor(){super({id:"editor.foldRecursively",label:g(457,"Fold Recursively"),alias:"Fold Recursively",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.BracketLeft),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);zU(t,!0,Number.MAX_VALUE,n)}}class J1t extends th{constructor(){super({id:"editor.toggleFoldRecursively",label:g(458,"Toggle Fold Recursively"),alias:"Toggle Fold Recursively",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|U.Shift|S.KeyL),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);rMe(t,Number.MAX_VALUE,n)}}class X1t extends th{constructor(){super({id:"editor.foldAllBlockComments",label:g(459,"Fold All Block Comments"),alias:"Fold All Block Comments",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Slash),weight:Ae.EditorContrib}})}invoke(e,t,i,n,r){if(t.regions.hasTypes())aMe(t,u_.Comment.value,!0);else{const o=i.getModel();if(!o)return;const a=r.getLanguageConfiguration(o.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const c=new RegExp("^\\s*"+Nh(a.blockCommentStartToken));oMe(t,c,!0)}}}}class Z1t extends th{constructor(){super({id:"editor.foldAllMarkerRegions",label:g(460,"Fold All Regions"),alias:"Fold All Regions",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit8),weight:Ae.EditorContrib}})}invoke(e,t,i,n,r){if(t.regions.hasTypes())aMe(t,u_.Region.value,!0);else{const o=i.getModel();if(!o)return;const a=r.getLanguageConfiguration(o.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const c=new RegExp(a.markers.start);oMe(t,c,!0)}}}}class eTt extends th{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:g(461,"Unfold All Regions"),alias:"Unfold All Regions",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit9),weight:Ae.EditorContrib}})}invoke(e,t,i,n,r){if(t.regions.hasTypes())aMe(t,u_.Region.value,!1);else{const o=i.getModel();if(!o)return;const a=r.getLanguageConfiguration(o.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const c=new RegExp(a.markers.start);oMe(t,c,!1)}}}}class tTt extends th{constructor(){super({id:"editor.foldAllExcept",label:g(462,"Fold All Except Selected"),alias:"Fold All Except Selected",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Minus),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);yXe(t,!0,n)}}class iTt extends th{constructor(){super({id:"editor.unfoldAllExcept",label:g(463,"Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Equal),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);yXe(t,!1,n)}}class nTt extends th{constructor(){super({id:"editor.foldAll",label:g(464,"Fold All"),alias:"Fold All",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit0),weight:Ae.EditorContrib}})}invoke(e,t,i){zU(t,!0)}}class sTt extends th{constructor(){super({id:"editor.unfoldAll",label:g(465,"Unfold All"),alias:"Unfold All",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyJ),weight:Ae.EditorContrib}})}invoke(e,t,i){zU(t,!1)}}const sO=class sO extends th{getFoldingLevel(){return parseInt(this.id.substr(sO.ID_PREFIX.length))}invoke(e,t,i){k1t(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}};sO.ID_PREFIX="editor.foldLevel",sO.ID=e=>sO.ID_PREFIX+e;let qJ=sO;class rTt extends th{constructor(){super({id:"editor.gotoParentFold",label:g(466,"Go to Parent Fold"),alias:"Go to Parent Fold",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const r=I1t(n[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class oTt extends th{constructor(){super({id:"editor.gotoPreviousFold",label:g(467,"Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const r=T1t(n[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class aTt extends th{constructor(){super({id:"editor.gotoNextFold",label:g(468,"Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const r=L1t(n[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class cTt extends th{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:g(469,"Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Comma),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=[],r=i.getSelections();if(r){for(const o of r){let a=o.endLineNumber;o.endColumn===1&&--a,a>o.startLineNumber&&(n.push({startLineNumber:o.startLineNumber,endLineNumber:a,type:void 0,isCollapsed:!0,source:Sl.userDefined}),i.setSelection({startLineNumber:o.startLineNumber,startColumn:1,endLineNumber:o.startLineNumber,endColumn:1}))}if(n.length>0){n.sort((a,c)=>a.startLineNumber-c.startLineNumber);const o=qf.sanitizeAndMerge(t.regions,n,i.getModel()?.getLineCount());t.updatePost(qf.fromFoldRanges(o))}}}}class lTt extends th{constructor(){super({id:"editor.removeManualFoldingRanges",label:g(470,"Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Period),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=i.getSelections();if(n){const r=[];for(const o of n){const{startLineNumber:a,endLineNumber:c}=o;r.push(c>=a?{startLineNumber:a,endLineNumber:c}:{endLineNumber:c,startLineNumber:a})}t.removeManualRanges(r),e.triggerFoldingModelChanged()}}}on(PA.ID,PA,ai.Eager);Re(K1t);Re(q1t);Re(Q1t);Re(Y1t);Re(J1t);Re(nTt);Re(sTt);Re(X1t);Re(Z1t);Re(eTt);Re(tTt);Re(iTt);Re(j1t);Re(rTt);Re(oTt);Re(aTt);Re(cTt);Re(lTt);for(let s=1;s<=7;s++)Lut(new qJ({id:qJ.ID(s),label:g(471,"Fold Level {0}",s),alias:`Fold Level ${s}`,precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit0+s),weight:Ae.EditorContrib}}));vt.registerCommand("_executeFoldingRangeProvider",async function(s,...e){const[t]=e;if(!(t instanceof N))throw Fi();const i=s.get(nt),n=s.get(fi).getModel(t);if(!n)throw Fi();const r=s.get(Te);if(!r.getValue("editor.folding",{resource:t}))return[];const o=s.get(zs),a=r.getValue("editor.foldingStrategy",{resource:t}),c={get limit(){return r.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,p)=>{}},l=new cMe(n,o,c);let d=l;if(a!=="indentation"){const f=PA.getFoldingRangeProviders(i,n);f.length&&(d=new lMe(n,f,()=>{},c,l))}const h=await d.compute(Ue.None),u=[];try{if(h)for(let f=0;f{const r={...t,limits:{size:Number.MAX_VALUE}};s.openEditor(e,r)}}),al({id:"workbench.action.configureEditorLargeFileConfirmation",label:g(452,"Configure Limit"),run:()=>n.openUserSettings({query:"workbench.editorLargeFileConfirmation"})})],{forceMessage:!0,forceSeverity:Ze.Warning})}function H5(s){return ya(s?.editor)}function oue(s){const e=s;return H5(s)&&e?.group!==void 0}function Kve(s){const e=s;return typeof e?.groupId=="number"&&ya(e.editor)}function mHe(s){return typeof s?.groupId=="number"}var uA;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.REPLACE=1]="REPLACE",s[s.MOVE=2]="MOVE",s[s.UNPIN=3]="UNPIN"})(uA||(uA={}));var Dr;(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"})(Dr||(Dr={}));var Us;(function(s){s[s.PRIMARY=1]="PRIMARY",s[s.SECONDARY=2]="SECONDARY",s[s.BOTH=3]="BOTH",s[s.ANY=4]="ANY"})(Us||(Us={}));class _Tt{getOriginalUri(e,t){if(!e)return;if(Ab(e))return Pa.getOriginalUri(e.result,t);if(t?.supportSideBySide){const{primary:n,secondary:r}=this.getSideEditors(e);if(n&&r){if(t?.supportSideBySide===Us.BOTH)return{primary:this.getOriginalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getOriginalUri(r,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Us.ANY)return this.getOriginalUri(n,{filterByScheme:t.filterByScheme})??this.getOriginalUri(r,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Us.PRIMARY?n:r}}if(k_(e)||W5(e)||RS(e)||Ab(e))return;const i=fTt(e)?e.preferredResource:e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}getSideEditors(e){return pTt(e)||RS(e)?{primary:e.primary,secondary:e.secondary}:xXe(e)||k_(e)?{primary:e.modified,secondary:e.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(e,t){if(!e)return;if(Ab(e))return Pa.getCanonicalUri(e.result,t);if(t?.supportSideBySide){const{primary:n,secondary:r}=this.getSideEditors(e);if(n&&r){if(t?.supportSideBySide===Us.BOTH)return{primary:this.getCanonicalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getCanonicalUri(r,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Us.ANY)return this.getCanonicalUri(n,{filterByScheme:t.filterByScheme})??this.getCanonicalUri(r,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Us.PRIMARY?n:r}}if(k_(e)||W5(e)||RS(e)||Ab(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 _He;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.KEYBOARD=1]="KEYBOARD",s[s.MOUSE=2]="MOUSE"})(_He||(_He={}));const Pa=new _Tt;var vHe;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT"})(vHe||(vHe={}));class vTt{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)}}je.add(rC.EditorFactory,new vTt);async function aue(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 o=i.exists,a=i.type;if(typeof o!="boolean"||typeof a!="number")try{a=(await e.stat(n)).isDirectory?rn.Directory:rn.Unknown,o=!0}catch(l){t.error(l),o=!1}if(!o&&i.openOnlyIfExists){t.info("Cannot resolve the path because it does not exist",i);return}if(a===rn.Directory){t.info("Cannot resolve the path because it is a directory",i);return}const c={...i.options,pinned:!0};return o?{resource:n,options:c}:{resource:n,options:c,forceUntitled:!0}}))}var tu;(function(s){s[s.MOST_RECENTLY_ACTIVE=0]="MOST_RECENTLY_ACTIVE",s[s.SEQUENTIAL=1]="SEQUENTIAL"})(tu||(tu={}));function dMe(s){const e=s;if(!e)return!1;const t=e;if(t.modified)return dMe(t.modified);const i=e;return!!(i.contributionsState&&i.viewState&&Array.isArray(i.cursorState))}function DXe(s,e,t){const i=VCt(s,e);return i.forceMessage=t?.forceMessage,i.forceSeverity=t?.forceSeverity,i.allowDialog=t?.allowDialog,i}var Sv;const bTt=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)")}),wTt=new Q("workspaceFolderCount",0,g(481,"The number of root folders in the workspace")),yTt=new Q("openFolderWorkspaceSupport",!0,!0),CTt=new Q("enterMultiRootWorkspaceSupport",!0,!0),kXe=new Q("emptyWorkspaceSupport",!0,!0),STt=new Q("dirtyWorkingCopies",!1,g(482,"Whether there are any working copies with unsaved changes")),ATt=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")),ETt=new Q("virtualWorkspace","",g(484,"The scheme of the current workspace is from a virtual file system or an empty string.")),IXe=new Q("temporaryWorkspace",!1,g(485,"The scheme of the current workspace is from a temporary file system.")),xTt=new Q("isFullscreen",!1,g(486,"Whether the main window is in fullscreen mode")),DTt=new Q("isAuxiliaryWindowFocusedContext",!1,g(487,"Whether an auxiliary window is focused")),kTt=new Q("hasWebFileSystemAccess",!1,!0),ITt=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 TTt=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 TXe=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 Zae=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 LTt=new Q("activeEditorGroupEmpty",!1,g(504,"Whether the active editor group is empty")),RTt=new Q("activeEditorGroupIndex",0,g(505,"The index of the active editor group")),MTt=new Q("activeEditorGroupLast",!1,g(506,"Whether the active editor group is the last group")),NTt=new Q("activeEditorGroupLocked",!1,g(507,"Whether the active editor group is locked")),PTt=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 FTt=new Q("editorIsOpen",!1,g(515,"Whether an editor is open")),OTt=new Q("inZenMode",!1,g(516,"Whether Zen mode is enabled")),BTt=new Q("isCenteredLayout",!1,g(517,"Whether centered layout is enabled for the main editor")),WTt=new Q("splitEditorsVertically",!1,g(518,"Whether editors split vertically")),HTt=new Q("mainEditorAreaVisible",!0,g(519,"Whether the editor area in the main window is visible")),UTt=new Q("editorTabsVisible",!0,g(520,"Whether editor tabs are visible")),VTt=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 zTt=new Q("titleBarStyle",mo?"native":"custom",g(525,"Style of the window title bar")),$Tt=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 GTt=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 KTt=new Q("panelPosition","bottom",g(536,"The position of the panel, always 'bottom'")),qTt=new Q("panelAlignment","center",g(537,"The alignment of the panel, either 'center', 'left', 'right' or 'justify'")),QTt=new Q("panelVisible",!1,g(538,"Whether the panel is visible")),jTt=new Q("panelMaximized",!1,g(539,"Whether the panel is maximized")),$U=new Q("focusedView","",g(540,"The identifier of the view that has keyboard focus"));var Og;let U3=(Og=class{constructor(e,t,i,n){this._contextKeyService=e,this._fileService=t,this._languageService=i,this._modelService=n,this._disposables=new Z,this._schemeKey=Sv.Scheme.bindTo(this._contextKeyService),this._filenameKey=Sv.Filename.bindTo(this._contextKeyService),this._dirnameKey=Sv.Dirname.bindTo(this._contextKeyService),this._pathKey=Sv.Path.bindTo(this._contextKeyService),this._langIdKey=Sv.LangId.bindTo(this._contextKeyService),this._resourceKey=Sv.Resource.bindTo(this._contextKeyService),this._extensionKey=Sv.Extension.bindTo(this._contextKeyService),this._hasResource=Sv.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=Sv.IsFileSystemResource.bindTo(this._contextKeyService),this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(()=>{const r=this.get();this._isFileSystemResource.set(!!(r&&t.hasProvider(r)))})),this._disposables.add(n.onModelAdded(r=>{Yi(r.uri,this.get())&&this._setLangId()})),this._disposables.add(n.onModelLanguageChanged(r=>{Yi(r.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,!Yi(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?vi(e):null),this._dirnameKey.set(e?this.uriToPath(Ro(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?xU(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}},Sv=Og,Og.Scheme=new Q("resourceScheme",void 0,{type:"string",description:g(541,"The scheme of the resource")}),Og.Filename=new Q("resourceFilename",void 0,{type:"string",description:g(542,"The file name of the resource")}),Og.Dirname=new Q("resourceDirname",void 0,{type:"string",description:g(543,"The folder name the resource is contained in")}),Og.Path=new Q("resourcePath",void 0,{type:"string",description:g(544,"The full path of the resource")}),Og.LangId=new Q("resourceLangId",void 0,{type:"string",description:g(545,"The language identifier of the resource")}),Og.Resource=new Q("resource",void 0,{type:"URI",description:g(546,"The full value of the resource including scheme and path")}),Og.Extension=new Q("resourceExtname",void 0,{type:"string",description:g(547,"The extension name of the resource")}),Og.HasResource=new Q("resourceSet",void 0,{type:"boolean",description:g(548,"Whether a resource is present or not")}),Og.IsFileSystemResource=new Q("isFileSystemResource",void 0,{type:"boolean",description:g(549,"Whether the resource is backed by a file system provider")}),Og);U3=Sv=D([_(0,Le),_(1,Xt),_(2,Di),_(3,fi)],U3);function YTt(s,e){return s.invokeFunction(t=>C_.getServiceDependencies(e).sort((i,n)=>i.index-n.index).map(i=>t.get(i.id)))}function hMe(s){const e=s;return class extends e{constructor(...t){super(...t.slice(1),...YTt(t[0],s))}}}class uMe{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 bHe{constructor(e){this.identifier=e}}const ece=ae("treeViewsDndService");ce(ece,uMe,Qt.Delayed);const LXe=ae("extensionHostDebugService"),JTt="diagnosticsService";class XTt{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 ZTt=ae(JTt),gMe=ae("downloadService"),eLt=ae("encryptionService"),LI=ae("extensionGalleryService"),H6=ae("extensionManagementService"),RXe=ae("IGlobalExtensionEnablementService"),tLt=ae("IExtensionTipsService"),V3=ae("IExtensionStorageService"),tce=ae("IExtensionsProfileScannerService"),iLt=ae("IExtensionsScannerService"),nLt=ae("IExtensionRecommendationNotificationService"),ice=ae("extensionResourceLoaderService"),sLt=ae("IBuiltinExtensionsScannerService"),nce=ae("keyboardLayoutService"),MXe=ae("languagePackService");class NXe{constructor(){this.onDidChange=M.None}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}const xo=ae("productService"),bC=ae("remoteAuthorityResolverService"),sce=ae("IRemoteExtensionsScannerService"),fMe=ae("remoteSocketFactoryService"),U6=ae("requestService"),PXe=ae("secretStorageService"),rLt="signService",FXe=ae(rLt);let rce=class{constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};class oLt{async publicLog(e,t,i){}async publicLogError(e,t,i){}}const aLt="extensionTelemetryLog";function lQ(s,e){return!e.isBuilt&&!e.disableTelemetry?!0:!(e.disableTelemetry||!s.enableTelemetry)}function pMe(s,e){return e.extensionTestsLocationURI?!0:!(e.isBuilt||e.disableTelemetry||s.enableTelemetry&&s.aiConfig?.ariaKey)}function cLt(s){const e=s.getValue(NYe),t=s.getValue(AEt);if(s.getValue(PYe)===!1||t===!1)return jg.NONE;switch(e??e1.ON){case e1.ON:return jg.USAGE;case e1.ERROR:return jg.ERROR;case e1.CRASH:return jg.CRASH;case e1.OFF:return jg.NONE}}const lLt=new Set(["ssh-remote","dev-container","attached-container","wsl","tunnel","codespaces","amlext"]);function dLt(s){if(!s)return"none";const e=W6(s);return lLt.has(e)?e:"other"}function hLt(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)[\\\/]/,r=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let o=0;for(t="";;){const a=r.exec(s);if(!a)break;const c=i.some(([l,d])=>a.index",o=r.lastIndex)}return o`;return s}function wHe(s,e){return T2(s,t=>{if(t instanceof rce||Object.hasOwnProperty.call(t,"isTrustedTelemetryValue"))return t.value;if(typeof t=="string"){let i=t.replaceAll("%20"," ");i=hLt(i,e);for(const n of e)i=i.replace(n,"");return i=uLt(i),i}})}var yHe;(function(s){s.AutomationProfile="terminal.integrated.automationProfile.",s.DefaultProfile="terminal.integrated.defaultProfile.",s.Profiles="terminal.integrated.profiles."})(yHe||(yHe={}));var zw;(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"})(zw||(zw={}));var CHe;(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"})(CHe||(CHe={}));var SHe;(function(s){s.CommandPrompt="cmd",s.PowerShell="pwsh",s.Wsl="wsl",s.GitBash="gitbash",s.Python="python"})(SHe||(SHe={}));var AHe;(function(s){s[s.Api=0]="Api",s[s.Process=1]="Process",s[s.Sequence=2]="Sequence",s[s.Config=3]="Config"})(AHe||(AHe={}));var Hg;(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"})(Hg||(Hg={}));var yW;(function(s){s[s.Panel=1]="Panel",s[s.Editor=2]="Editor"})(yW||(yW={}));var EHe;(function(s){s.TerminalView="view",s.Editor="editor"})(EHe||(EHe={}));var xHe;(function(s){s[s.HighWatermarkChars=1e5]="HighWatermarkChars",s[s.LowWatermarkChars=5e3]="LowWatermarkChars",s[s.CharCountAckSize=5e3]="CharCountAckSize"})(xHe||(xHe={}));var DHe;(function(s){s[s.Off=0]="Off",s[s.FinalTerm=1]="FinalTerm",s[s.VSCode=2]="VSCode"})(DHe||(DHe={}));var NT;(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"})(NT||(NT={}));const gLt={Backend:"workbench.contributions.terminal.processBackend"};function qve(s){return s?.toLowerCase()??""}class fLt{constructor(e){this.remoteAuthority=e}affects(e){return qve(e)===this.remoteAuthority}}class pLt{constructor(){this._backends=new Map,this._onDidChangeBackends=new I,this.onDidChangeBackends=this._onDidChangeBackends.event}get backends(){return this._backends}registerTerminalBackend(e){const t=qve(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 fLt(t))}getTerminalBackend(e){return this._backends.get(qve(e))}}je.add(gLt.Backend,new pLt);const mLt=ae("terminalLogService"),oce=ae("tunnelService");var Mv;(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"})(Mv||(Mv={}));var kHe;(function(s){s[s.Setup=0]="Setup",s[s.Archive=1]="Archive",s[s.Snap=2]="Snap"})(kHe||(kHe={}));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 _Lt={Uninitialized:{type:Mv.Uninitialized},Disabled:s=>({type:Mv.Disabled,reason:s}),Idle:(s,e)=>({type:Mv.Idle,updateType:s,error:e}),CheckingForUpdates:s=>({type:Mv.CheckingForUpdates,explicit:s}),AvailableForDownload:s=>({type:Mv.AvailableForDownload,update:s}),Downloading:{type:Mv.Downloading},Downloaded:s=>({type:Mv.Downloaded,update:s}),Updating:s=>({type:Mv.Updating,update:s}),Ready:s=>({type:Mv.Ready,update:s})},OXe=ae("updateService");var THe;let cue=class{constructor(e,t,i){this.level=e,this.key=t,this.value=i,this.forward=[]}};const D4=void 0;class n1{constructor(e,t=2**16){this.comparator=e,this[THe]="SkipList",this._level=0,this._size=0,this._maxLevel=Math.max(1,Math.log2(t)|0),this._header=new cue(this._maxLevel,D4,D4)}get size(){return this._size}clear(){this._header=new cue(this._maxLevel,D4,D4),this._size=0}has(e){return!!n1._search(this,e,this.comparator)}get(e){return n1._search(this,e,this.comparator)?.value}set(e,t){return n1._insert(this,e,t,this.comparator)&&(this._size+=1),this}delete(e){const t=n1._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]}[(THe=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 r=e._level-1;r>=0;r--)for(;n.forward[r]&&i(n.forward[r].key,t)<0;)n=n.forward[r];if(n=n.forward[0],n&&i(n.key,t)===0)return n}static _insert(e,t,i,n){const r=[];let o=e._header;for(let a=e._level-1;a>=0;a--){for(;o.forward[a]&&n(o.forward[a].key,t)<0;)o=o.forward[a];r[a]=o}if(o=o.forward[0],o&&n(o.key,t)===0)return o.value=i,!1;{const a=n1._randomLevel(e);if(a>e._level){for(let c=e._level;c=0;o--){for(;r.forward[o]&&i(r.forward[o].key,t)<0;)r=r.forward[o];n[o]=r}if(r=r.forward[0],!r||i(r.key,t)!==0)return!1;for(let o=0;o0&&e._header.forward[e._level-1]===D4;)e._level-=1;return!0}}const Zz=class Zz{constructor(e){this.uri=e,this.time=Zz._clock++}touch(){return this.time=Zz._clock++,this}};Zz._clock=0;let jJ=Zz,Qve=class{constructor(e){this._fileService=e,this._dispooables=new Z,this._limit=2**16;const t=new Map,i=n=>{let r=t.get(n.scheme);return r===void 0&&(r=e.hasProvider(n)&&!this._fileService.hasCapability(n,zn.PathCaseSensitive),t.set(n.scheme,r)),r};this._dispooables.add(M.any(e.onDidChangeFileSystemProviderRegistrations,e.onDidChangeFileSystemProviderCapabilities)(n=>{t.delete(n.scheme)})),this.extUri=new RN(i),this._canonicalUris=new n1((n,r)=>this.extUri.compare(n,r,!0),this._limit)}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(e){this._fileService.hasProvider(e)&&(e=QKe(e));const t=this._canonicalUris.get(e);return t?t.touch().uri.with({fragment:e.fragment}):(this._canonicalUris.set(e,new jJ(e)),this._checkTrim(),e)}_checkTrim(){if(this._canonicalUris.sizei[1].timen[1].time?-1:0);jJ._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,r,o,a,c,l,d,h,u){let f,p;if(u)f=u.label,p=u.role;else if(f=lYe(r),o){const y=typeof o=="string"?o:o.value;f+=`, ${y}`}let m;switch(l?.id){case FHe:case ULt:m=l.id===FHe?"error":"warning",c=void 0,l=void 0}const v={name:n,text:r,tooltip:o,command:a,color:c,backgroundColor:l,ariaLabel:f,role:p,kind:m};typeof h>"u"&&(h=0);let b=d?G3.LEFT:G3.RIGHT;const w=this._entries.get(e);if(w&&(b=w.alignment,h=w.priority),w)return w.accessor.update(v),w.entry=v,K3.DidUpdate;{let y;typeof i=="string"?y={primary:h,secondary:Hc(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}]}),K3.DidDefine}}unsetEntry(e){this._entries.get(e)?.disposable.dispose(),this._entries.delete(e)}getEntries(){return this._entries.entries()}};Jve=D([_(0,yMe)],Jve);ce(CMe,Jve,Qt.Delayed);const YLt=ae("IEditorBreadcrumbsService"),Bx=new wn(220,70),JJ=new wn(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),cce={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}},Im=ae("viewDescriptorService"),Tm=ae("accessibleViewService"),qN=ae("chatWidgetService"),JLt=ae("quickChatService"),jXe=ae("chatAccessibilityService"),XLt=ae("chatCodeBlockContextProviderService"),wf=ae("chatAgentService"),lce=ae("chatAgentNameService"),Lm=ae("IChatService"),SMe=ae("chatSlashCommandService"),z6=ae("IChatVariablesService"),YXe=ae("IChatWidgetHistoryService"),JXe=ae("ILanguageModelsService"),rE=ae("commentService"),AMe=ae("customEditorService"),EMe=ae("debugService"),XXe=ae("debugVisualizerService"),ZLt=ae("IEditSessionsStorageService"),eRt=ae("IEditSessionsLogService"),Xr=ae("extensionsWorkbenchService"),ZXe=ae("externalUriOpenerService"),yf=ae("explorerService"),eZe=ae("IInlineChatSavingService "),xMe=ae("IInlineChatSessionService"),DMe=ae("IInteractiveDocumentService"),tZe=ae("IInteractiveHistoryService"),tRt=ae("IDefaultLogLevelsService"),iZe=ae("multiDiffSourceResolverService"),$6=ae("INotebookEditorWidgetService"),nZe=ae("notebookCellStatusBarService"),dce=ae("INotebookModelResolverService"),iRt=ae("INotebookExecutionService"),sZe=ae("INotebookExecutionStateService"),rZe=ae("INotebookKernelService"),nRt=ae("INotebookKernelHistoryService"),sRt=ae("notebookKeymapService"),rRt=ae("INotebookLoggingService"),oZe=ae("INotebookRendererMessagingService"),oE=ae("notebookService"),oRt="notebookEditorWorkerService",aRt=ae(oRt),cRt=ae("outputChannelModelService"),lRt=ae("preferencesSearchService"),G6=ae("quickDiff"),kMe=ae("scm"),aZe=ae("scmView"),dRt=ae("replaceService"),hRt=ae("searchViewModelWorkbenchService"),uRt=ae("notebookSearchService"),gRt=ae("searchHistoryService"),cZe=ae("shareService"),hce=ae("snippetService"),uce=ae("speechService");class fRt{getTags(){return Promise.resolve({})}async getTelemetryWorkspaceId(e,t){}getHashedRemotesFromUri(e,t){return Promise.resolve([])}}const pRt=ae("workspaceTagsService"),lZe=ae("taskService"),GU=ae("terminalService"),mRt=ae("terminalConfigurationService"),dZe=ae("terminalEditorService"),IMe=ae("terminalGroupService"),hZe=ae("terminalInstanceService"),uZe=ae("environmentVariableService"),gZe=ae("terminalProfileResolverService"),fZe=ae("terminalProfileService"),_Rt=ae("terminalContributionsService"),pZe=ae("terminalLinkProviderService"),mZe=ae("terminalQuickFixService"),vRt=ae("testCoverageService"),bRt=ae("testingFilterState"),_Ze=ae("testProfileService"),vZe=ae("testResultService"),wRt=ae("ITestResultStorage"),bZe=ae("testService"),yRt=ae("testingContinuousRunService"),CRt=ae("testingDecorationService"),SRt=ae("testingPeekOpener"),ARt="timeline",wZe=ae(ARt),gce=ae("webviewService"),K6=ae("webviewEditorService"),yZe=ae("webviewViewService"),ERt=ae("walkthroughsService"),xRt=ae("activityService"),CZe=ae("IAiEmbeddingVectorService"),TMe=ae("IAiRelatedInformationService"),SZe=ae("WorkbenchAssignmentService"),fce=ae("IAuthenticationAccessService"),AZe=ae("IAuthenticationUsageService"),LMe=ae("IAuthenticationService"),EZe=ae("IAuthenticationExtensionsService"),xZe=ae("auxiliaryWindowService"),DRt=ae("bannerService"),MI=ae("jsonEditingService"),RMe=ae("configurationResolverService"),aE=ae("IFileDecorationsService"),cE=ae("ICustomEditorLabelService"),Pr=ae("editorGroupsService"),DZe=ae("editorPaneService"),KU=ae("editorResolverService"),ti=ae("editorService"),qU=ae("IExtensionBisectService"),kZe=ae("IExtensionFeaturesManagementService"),kRt=H6,gv=ae("extensionManagementServerService"),q6=kRt,Fl=ae("extensionEnablementService"),MMe=ae("IWebExtensionsScannerService"),IZe=ae("extensionRecommendationsService"),pce=ae("IExtensionIgnoredRecommendationsService"),IRt=ae("IWorkspaceExtensionsConfigService"),TZe=ae("extensionUrlHandler"),Rm=ae("extensionManifestPropertiesService"),ps=ae("extensionService"),Q6=ae("elevatedFileService"),bd=ae("filesConfigurationService"),TRt=ae("historyService"),Dc=ae("hostService"),LRt=ae("ITroubleshootIssueService"),RRt=ae("issueFormService"),MRt=ae("workbenchIssueService");class Xve{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 Lh(t,e.shiftKey,i,e.metaKey,e.keyCode);return this.resolveKeybinding(new PO([n]))[0]}resolveKeybinding(e){return nW.resolveKeybinding(e,this._OS)}}const NRt=ae("keybindingEditingService"),j6=ae("ILanguageDetectionService"),mce=ae("ILanguageStatusService"),rg=ae("lifecycleService");var Zve;(function(s){s[s.Default=1]="Default",s[s.Last=2]="Last"})(Zve||(Zve={}));var pD;(function(s){s[s.CLOSE=1]="CLOSE",s[s.QUIT=2]="QUIT",s[s.RELOAD=3]="RELOAD",s[s.LOAD=4]="LOAD"})(pD||(pD={}));var U5;(function(s){s[s.NewWindow=1]="NewWindow",s[s.ReloadedWindow=3]="ReloadedWindow",s[s.ReopenedWindow=4]="ReopenedWindow"})(U5||(U5={}));var Ms;(function(s){s[s.Starting=1]="Starting",s[s.Ready=2]="Ready",s[s.Restored=3]="Restored",s[s.Eventually=4]="Eventually"})(Ms||(Ms={}));function PRt(s){switch(s){case Ms.Starting:return"Starting";case Ms.Ready:return"Ready";case Ms.Restored:return"Restored";case Ms.Eventually:return"Eventually"}}var vV,EL;let ebe=(EL=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=Ms.Starting,this.phaseWhen=new Map,this._startupKind=this.resolveStartupKind(),this._register(this.storageService.onWillSaveState(i=>{i.reason===Ay.SHUTDOWN&&this.storageService.store(vV.LAST_SHUTDOWN_REASON_KEY,this.shutdownReason,Ie.WORKSPACE,cn.MACHINE)}))}resolveStartupKind(){const e=this.doResolveStartupKind()??U5.NewWindow;return this.logService.trace(`[lifecycle] starting up (startup kind: ${e})`),e}doResolveStartupKind(){const e=this.storageService.getNumber(vV.LAST_SHUTDOWN_REASON_KEY,Ie.WORKSPACE);this.storageService.remove(vV.LAST_SHUTDOWN_REASON_KEY,Ie.WORKSPACE);let t;switch(e){case pD.RELOAD:t=U5.ReloadedWindow;break;case pD.LOAD:t=U5.ReopenedWindow;break}return t}set phase(e){if(e0&&(t[An.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=[],r=[],o=[],a=[],c=KHe(this._allExtensions),l=KHe(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){r.push(m);continue}if(!d(v,m)){n.push(v.identifier),c.delete(v.identifier);continue}}const h=new D_(this._myExtensions),u=new D_(i);for(const m of this._myExtensions)u.has(m)||o.push(m);for(const m of i)h.has(m)||a.push(m);const f=nB.createActivationEventsMap(r),p={versionId:e,toRemove:n,toAdd:r,addActivationEvents:f,myToRemove:o,myToAdd:a};return this.delta(p),p}delta(e){if(this._versionId>=e.versionId)return null;const{toRemove:t,toAdd:i,myToRemove:n,myToAdd:r}=e,o=new D_(t),a=new D_(n);for(let c=0;csO.ID_PREFIX+e;let qJ=sO;class rTt extends th{constructor(){super({id:"editor.gotoParentFold",label:g(466,"Go to Parent Fold"),alias:"Go to Parent Fold",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const r=I1t(n[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class oTt extends th{constructor(){super({id:"editor.gotoPreviousFold",label:g(467,"Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const r=T1t(n[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class aTt extends th{constructor(){super({id:"editor.gotoNextFold",label:g(468,"Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const r=L1t(n[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class cTt extends th{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:g(469,"Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Comma),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=[],r=i.getSelections();if(r){for(const o of r){let a=o.endLineNumber;o.endColumn===1&&--a,a>o.startLineNumber&&(n.push({startLineNumber:o.startLineNumber,endLineNumber:a,type:void 0,isCollapsed:!0,source:Al.userDefined}),i.setSelection({startLineNumber:o.startLineNumber,startColumn:1,endLineNumber:o.startLineNumber,endColumn:1}))}if(n.length>0){n.sort((a,c)=>a.startLineNumber-c.startLineNumber);const o=qf.sanitizeAndMerge(t.regions,n,i.getModel()?.getLineCount());t.updatePost(qf.fromFoldRanges(o))}}}}class lTt extends th{constructor(){super({id:"editor.removeManualFoldingRanges",label:g(470,"Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Period),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=i.getSelections();if(n){const r=[];for(const o of n){const{startLineNumber:a,endLineNumber:c}=o;r.push(c>=a?{startLineNumber:a,endLineNumber:c}:{endLineNumber:c,startLineNumber:a})}t.removeManualRanges(r),e.triggerFoldingModelChanged()}}}on(PA.ID,PA,ai.Eager);Re(K1t);Re(q1t);Re(Q1t);Re(Y1t);Re(J1t);Re(nTt);Re(sTt);Re(X1t);Re(Z1t);Re(eTt);Re(tTt);Re(iTt);Re(j1t);Re(rTt);Re(oTt);Re(aTt);Re(cTt);Re(lTt);for(let s=1;s<=7;s++)Lut(new qJ({id:qJ.ID(s),label:g(471,"Fold Level {0}",s),alias:`Fold Level ${s}`,precondition:vd,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit0+s),weight:Ae.EditorContrib}}));vt.registerCommand("_executeFoldingRangeProvider",async function(s,...e){const[t]=e;if(!(t instanceof N))throw Fi();const i=s.get(nt),n=s.get(fi).getModel(t);if(!n)throw Fi();const r=s.get(Te);if(!r.getValue("editor.folding",{resource:t}))return[];const o=s.get(zs),a=r.getValue("editor.foldingStrategy",{resource:t}),c={get limit(){return r.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,p)=>{}},l=new cMe(n,o,c);let d=l;if(a!=="indentation"){const f=PA.getFoldingRangeProviders(i,n);f.length&&(d=new lMe(n,f,()=>{},c,l))}const h=await d.compute(Ue.None),u=[];try{if(h)for(let f=0;f{const r={...t,limits:{size:Number.MAX_VALUE}};s.openEditor(e,r)}}),al({id:"workbench.action.configureEditorLargeFileConfirmation",label:g(452,"Configure Limit"),run:()=>n.openUserSettings({query:"workbench.editorLargeFileConfirmation"})})],{forceMessage:!0,forceSeverity:Ze.Warning})}function H5(s){return ya(s?.editor)}function oue(s){const e=s;return H5(s)&&e?.group!==void 0}function Kve(s){const e=s;return typeof e?.groupId=="number"&&ya(e.editor)}function mHe(s){return typeof s?.groupId=="number"}var uA;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.REPLACE=1]="REPLACE",s[s.MOVE=2]="MOVE",s[s.UNPIN=3]="UNPIN"})(uA||(uA={}));var Dr;(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"})(Dr||(Dr={}));var Us;(function(s){s[s.PRIMARY=1]="PRIMARY",s[s.SECONDARY=2]="SECONDARY",s[s.BOTH=3]="BOTH",s[s.ANY=4]="ANY"})(Us||(Us={}));class _Tt{getOriginalUri(e,t){if(!e)return;if(Ab(e))return Fa.getOriginalUri(e.result,t);if(t?.supportSideBySide){const{primary:n,secondary:r}=this.getSideEditors(e);if(n&&r){if(t?.supportSideBySide===Us.BOTH)return{primary:this.getOriginalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getOriginalUri(r,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Us.ANY)return this.getOriginalUri(n,{filterByScheme:t.filterByScheme})??this.getOriginalUri(r,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Us.PRIMARY?n:r}}if(k_(e)||W5(e)||RS(e)||Ab(e))return;const i=fTt(e)?e.preferredResource:e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}getSideEditors(e){return pTt(e)||RS(e)?{primary:e.primary,secondary:e.secondary}:xXe(e)||k_(e)?{primary:e.modified,secondary:e.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(e,t){if(!e)return;if(Ab(e))return Fa.getCanonicalUri(e.result,t);if(t?.supportSideBySide){const{primary:n,secondary:r}=this.getSideEditors(e);if(n&&r){if(t?.supportSideBySide===Us.BOTH)return{primary:this.getCanonicalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getCanonicalUri(r,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Us.ANY)return this.getCanonicalUri(n,{filterByScheme:t.filterByScheme})??this.getCanonicalUri(r,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Us.PRIMARY?n:r}}if(k_(e)||W5(e)||RS(e)||Ab(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 _He;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.KEYBOARD=1]="KEYBOARD",s[s.MOUSE=2]="MOUSE"})(_He||(_He={}));const Fa=new _Tt;var vHe;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT"})(vHe||(vHe={}));class vTt{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)}}je.add(rC.EditorFactory,new vTt);async function aue(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 o=i.exists,a=i.type;if(typeof o!="boolean"||typeof a!="number")try{a=(await e.stat(n)).isDirectory?rn.Directory:rn.Unknown,o=!0}catch(l){t.error(l),o=!1}if(!o&&i.openOnlyIfExists){t.info("Cannot resolve the path because it does not exist",i);return}if(a===rn.Directory){t.info("Cannot resolve the path because it is a directory",i);return}const c={...i.options,pinned:!0};return o?{resource:n,options:c}:{resource:n,options:c,forceUntitled:!0}}))}var tu;(function(s){s[s.MOST_RECENTLY_ACTIVE=0]="MOST_RECENTLY_ACTIVE",s[s.SEQUENTIAL=1]="SEQUENTIAL"})(tu||(tu={}));function dMe(s){const e=s;if(!e)return!1;const t=e;if(t.modified)return dMe(t.modified);const i=e;return!!(i.contributionsState&&i.viewState&&Array.isArray(i.cursorState))}function DXe(s,e,t){const i=VCt(s,e);return i.forceMessage=t?.forceMessage,i.forceSeverity=t?.forceSeverity,i.allowDialog=t?.allowDialog,i}var Sv;const bTt=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)")}),wTt=new Q("workspaceFolderCount",0,g(481,"The number of root folders in the workspace")),yTt=new Q("openFolderWorkspaceSupport",!0,!0),CTt=new Q("enterMultiRootWorkspaceSupport",!0,!0),kXe=new Q("emptyWorkspaceSupport",!0,!0),STt=new Q("dirtyWorkingCopies",!1,g(482,"Whether there are any working copies with unsaved changes")),ATt=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")),ETt=new Q("virtualWorkspace","",g(484,"The scheme of the current workspace is from a virtual file system or an empty string.")),IXe=new Q("temporaryWorkspace",!1,g(485,"The scheme of the current workspace is from a temporary file system.")),xTt=new Q("isFullscreen",!1,g(486,"Whether the main window is in fullscreen mode")),DTt=new Q("isAuxiliaryWindowFocusedContext",!1,g(487,"Whether an auxiliary window is focused")),kTt=new Q("hasWebFileSystemAccess",!1,!0),ITt=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 TTt=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 TXe=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 Zae=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 LTt=new Q("activeEditorGroupEmpty",!1,g(504,"Whether the active editor group is empty")),RTt=new Q("activeEditorGroupIndex",0,g(505,"The index of the active editor group")),MTt=new Q("activeEditorGroupLast",!1,g(506,"Whether the active editor group is the last group")),NTt=new Q("activeEditorGroupLocked",!1,g(507,"Whether the active editor group is locked")),PTt=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 FTt=new Q("editorIsOpen",!1,g(515,"Whether an editor is open")),OTt=new Q("inZenMode",!1,g(516,"Whether Zen mode is enabled")),BTt=new Q("isCenteredLayout",!1,g(517,"Whether centered layout is enabled for the main editor")),WTt=new Q("splitEditorsVertically",!1,g(518,"Whether editors split vertically")),HTt=new Q("mainEditorAreaVisible",!0,g(519,"Whether the editor area in the main window is visible")),UTt=new Q("editorTabsVisible",!0,g(520,"Whether editor tabs are visible")),VTt=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 zTt=new Q("titleBarStyle",mo?"native":"custom",g(525,"Style of the window title bar")),$Tt=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 GTt=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 KTt=new Q("panelPosition","bottom",g(536,"The position of the panel, always 'bottom'")),qTt=new Q("panelAlignment","center",g(537,"The alignment of the panel, either 'center', 'left', 'right' or 'justify'")),QTt=new Q("panelVisible",!1,g(538,"Whether the panel is visible")),jTt=new Q("panelMaximized",!1,g(539,"Whether the panel is maximized")),$U=new Q("focusedView","",g(540,"The identifier of the view that has keyboard focus"));var Og;let U3=(Og=class{constructor(e,t,i,n){this._contextKeyService=e,this._fileService=t,this._languageService=i,this._modelService=n,this._disposables=new Z,this._schemeKey=Sv.Scheme.bindTo(this._contextKeyService),this._filenameKey=Sv.Filename.bindTo(this._contextKeyService),this._dirnameKey=Sv.Dirname.bindTo(this._contextKeyService),this._pathKey=Sv.Path.bindTo(this._contextKeyService),this._langIdKey=Sv.LangId.bindTo(this._contextKeyService),this._resourceKey=Sv.Resource.bindTo(this._contextKeyService),this._extensionKey=Sv.Extension.bindTo(this._contextKeyService),this._hasResource=Sv.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=Sv.IsFileSystemResource.bindTo(this._contextKeyService),this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(()=>{const r=this.get();this._isFileSystemResource.set(!!(r&&t.hasProvider(r)))})),this._disposables.add(n.onModelAdded(r=>{Yi(r.uri,this.get())&&this._setLangId()})),this._disposables.add(n.onModelLanguageChanged(r=>{Yi(r.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,!Yi(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?vi(e):null),this._dirnameKey.set(e?this.uriToPath(Ro(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?xU(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}},Sv=Og,Og.Scheme=new Q("resourceScheme",void 0,{type:"string",description:g(541,"The scheme of the resource")}),Og.Filename=new Q("resourceFilename",void 0,{type:"string",description:g(542,"The file name of the resource")}),Og.Dirname=new Q("resourceDirname",void 0,{type:"string",description:g(543,"The folder name the resource is contained in")}),Og.Path=new Q("resourcePath",void 0,{type:"string",description:g(544,"The full path of the resource")}),Og.LangId=new Q("resourceLangId",void 0,{type:"string",description:g(545,"The language identifier of the resource")}),Og.Resource=new Q("resource",void 0,{type:"URI",description:g(546,"The full value of the resource including scheme and path")}),Og.Extension=new Q("resourceExtname",void 0,{type:"string",description:g(547,"The extension name of the resource")}),Og.HasResource=new Q("resourceSet",void 0,{type:"boolean",description:g(548,"Whether a resource is present or not")}),Og.IsFileSystemResource=new Q("isFileSystemResource",void 0,{type:"boolean",description:g(549,"Whether the resource is backed by a file system provider")}),Og);U3=Sv=D([_(0,Le),_(1,Xt),_(2,Di),_(3,fi)],U3);function YTt(s,e){return s.invokeFunction(t=>C_.getServiceDependencies(e).sort((i,n)=>i.index-n.index).map(i=>t.get(i.id)))}function hMe(s){const e=s;return class extends e{constructor(...t){super(...t.slice(1),...YTt(t[0],s))}}}class uMe{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 bHe{constructor(e){this.identifier=e}}const ece=ae("treeViewsDndService");ce(ece,uMe,Qt.Delayed);const LXe=ae("extensionHostDebugService"),JTt="diagnosticsService";class XTt{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 ZTt=ae(JTt),gMe=ae("downloadService"),eLt=ae("encryptionService"),LI=ae("extensionGalleryService"),H6=ae("extensionManagementService"),RXe=ae("IGlobalExtensionEnablementService"),tLt=ae("IExtensionTipsService"),V3=ae("IExtensionStorageService"),tce=ae("IExtensionsProfileScannerService"),iLt=ae("IExtensionsScannerService"),nLt=ae("IExtensionRecommendationNotificationService"),ice=ae("extensionResourceLoaderService"),sLt=ae("IBuiltinExtensionsScannerService"),nce=ae("keyboardLayoutService"),MXe=ae("languagePackService");class NXe{constructor(){this.onDidChange=M.None}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}const xo=ae("productService"),bC=ae("remoteAuthorityResolverService"),sce=ae("IRemoteExtensionsScannerService"),fMe=ae("remoteSocketFactoryService"),U6=ae("requestService"),PXe=ae("secretStorageService"),rLt="signService",FXe=ae(rLt);let rce=class{constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};class oLt{async publicLog(e,t,i){}async publicLogError(e,t,i){}}const aLt="extensionTelemetryLog";function lQ(s,e){return!e.isBuilt&&!e.disableTelemetry?!0:!(e.disableTelemetry||!s.enableTelemetry)}function pMe(s,e){return e.extensionTestsLocationURI?!0:!(e.isBuilt||e.disableTelemetry||s.enableTelemetry&&s.aiConfig?.ariaKey)}function cLt(s){const e=s.getValue(NYe),t=s.getValue(AEt);if(s.getValue(PYe)===!1||t===!1)return jg.NONE;switch(e??e1.ON){case e1.ON:return jg.USAGE;case e1.ERROR:return jg.ERROR;case e1.CRASH:return jg.CRASH;case e1.OFF:return jg.NONE}}const lLt=new Set(["ssh-remote","dev-container","attached-container","wsl","tunnel","codespaces","amlext"]);function dLt(s){if(!s)return"none";const e=W6(s);return lLt.has(e)?e:"other"}function hLt(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)[\\\/]/,r=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let o=0;for(t="";;){const a=r.exec(s);if(!a)break;const c=i.some(([l,d])=>a.index",o=r.lastIndex)}return o`;return s}function wHe(s,e){return T2(s,t=>{if(t instanceof rce||Object.hasOwnProperty.call(t,"isTrustedTelemetryValue"))return t.value;if(typeof t=="string"){let i=t.replaceAll("%20"," ");i=hLt(i,e);for(const n of e)i=i.replace(n,"");return i=uLt(i),i}})}var yHe;(function(s){s.AutomationProfile="terminal.integrated.automationProfile.",s.DefaultProfile="terminal.integrated.defaultProfile.",s.Profiles="terminal.integrated.profiles."})(yHe||(yHe={}));var zw;(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"})(zw||(zw={}));var CHe;(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"})(CHe||(CHe={}));var SHe;(function(s){s.CommandPrompt="cmd",s.PowerShell="pwsh",s.Wsl="wsl",s.GitBash="gitbash",s.Python="python"})(SHe||(SHe={}));var AHe;(function(s){s[s.Api=0]="Api",s[s.Process=1]="Process",s[s.Sequence=2]="Sequence",s[s.Config=3]="Config"})(AHe||(AHe={}));var Hg;(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"})(Hg||(Hg={}));var yW;(function(s){s[s.Panel=1]="Panel",s[s.Editor=2]="Editor"})(yW||(yW={}));var EHe;(function(s){s.TerminalView="view",s.Editor="editor"})(EHe||(EHe={}));var xHe;(function(s){s[s.HighWatermarkChars=1e5]="HighWatermarkChars",s[s.LowWatermarkChars=5e3]="LowWatermarkChars",s[s.CharCountAckSize=5e3]="CharCountAckSize"})(xHe||(xHe={}));var DHe;(function(s){s[s.Off=0]="Off",s[s.FinalTerm=1]="FinalTerm",s[s.VSCode=2]="VSCode"})(DHe||(DHe={}));var NT;(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"})(NT||(NT={}));const gLt={Backend:"workbench.contributions.terminal.processBackend"};function qve(s){return s?.toLowerCase()??""}class fLt{constructor(e){this.remoteAuthority=e}affects(e){return qve(e)===this.remoteAuthority}}class pLt{constructor(){this._backends=new Map,this._onDidChangeBackends=new I,this.onDidChangeBackends=this._onDidChangeBackends.event}get backends(){return this._backends}registerTerminalBackend(e){const t=qve(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 fLt(t))}getTerminalBackend(e){return this._backends.get(qve(e))}}je.add(gLt.Backend,new pLt);const mLt=ae("terminalLogService"),oce=ae("tunnelService");var Mv;(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"})(Mv||(Mv={}));var kHe;(function(s){s[s.Setup=0]="Setup",s[s.Archive=1]="Archive",s[s.Snap=2]="Snap"})(kHe||(kHe={}));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 _Lt={Uninitialized:{type:Mv.Uninitialized},Disabled:s=>({type:Mv.Disabled,reason:s}),Idle:(s,e)=>({type:Mv.Idle,updateType:s,error:e}),CheckingForUpdates:s=>({type:Mv.CheckingForUpdates,explicit:s}),AvailableForDownload:s=>({type:Mv.AvailableForDownload,update:s}),Downloading:{type:Mv.Downloading},Downloaded:s=>({type:Mv.Downloaded,update:s}),Updating:s=>({type:Mv.Updating,update:s}),Ready:s=>({type:Mv.Ready,update:s})},OXe=ae("updateService");var THe;let cue=class{constructor(e,t,i){this.level=e,this.key=t,this.value=i,this.forward=[]}};const D4=void 0;class n1{constructor(e,t=2**16){this.comparator=e,this[THe]="SkipList",this._level=0,this._size=0,this._maxLevel=Math.max(1,Math.log2(t)|0),this._header=new cue(this._maxLevel,D4,D4)}get size(){return this._size}clear(){this._header=new cue(this._maxLevel,D4,D4),this._size=0}has(e){return!!n1._search(this,e,this.comparator)}get(e){return n1._search(this,e,this.comparator)?.value}set(e,t){return n1._insert(this,e,t,this.comparator)&&(this._size+=1),this}delete(e){const t=n1._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]}[(THe=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 r=e._level-1;r>=0;r--)for(;n.forward[r]&&i(n.forward[r].key,t)<0;)n=n.forward[r];if(n=n.forward[0],n&&i(n.key,t)===0)return n}static _insert(e,t,i,n){const r=[];let o=e._header;for(let a=e._level-1;a>=0;a--){for(;o.forward[a]&&n(o.forward[a].key,t)<0;)o=o.forward[a];r[a]=o}if(o=o.forward[0],o&&n(o.key,t)===0)return o.value=i,!1;{const a=n1._randomLevel(e);if(a>e._level){for(let c=e._level;c=0;o--){for(;r.forward[o]&&i(r.forward[o].key,t)<0;)r=r.forward[o];n[o]=r}if(r=r.forward[0],!r||i(r.key,t)!==0)return!1;for(let o=0;o0&&e._header.forward[e._level-1]===D4;)e._level-=1;return!0}}const Zz=class Zz{constructor(e){this.uri=e,this.time=Zz._clock++}touch(){return this.time=Zz._clock++,this}};Zz._clock=0;let jJ=Zz,Qve=class{constructor(e){this._fileService=e,this._dispooables=new Z,this._limit=2**16;const t=new Map,i=n=>{let r=t.get(n.scheme);return r===void 0&&(r=e.hasProvider(n)&&!this._fileService.hasCapability(n,zn.PathCaseSensitive),t.set(n.scheme,r)),r};this._dispooables.add(M.any(e.onDidChangeFileSystemProviderRegistrations,e.onDidChangeFileSystemProviderCapabilities)(n=>{t.delete(n.scheme)})),this.extUri=new RN(i),this._canonicalUris=new n1((n,r)=>this.extUri.compare(n,r,!0),this._limit)}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(e){this._fileService.hasProvider(e)&&(e=QKe(e));const t=this._canonicalUris.get(e);return t?t.touch().uri.with({fragment:e.fragment}):(this._canonicalUris.set(e,new jJ(e)),this._checkTrim(),e)}_checkTrim(){if(this._canonicalUris.sizei[1].timen[1].time?-1:0);jJ._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,r,o,a,c,l,d,h,u){let f,p;if(u)f=u.label,p=u.role;else if(f=lYe(r),o){const y=typeof o=="string"?o:o.value;f+=`, ${y}`}let m;switch(l?.id){case FHe:case ULt:m=l.id===FHe?"error":"warning",c=void 0,l=void 0}const v={name:n,text:r,tooltip:o,command:a,color:c,backgroundColor:l,ariaLabel:f,role:p,kind:m};typeof h>"u"&&(h=0);let b=d?G3.LEFT:G3.RIGHT;const w=this._entries.get(e);if(w&&(b=w.alignment,h=w.priority),w)return w.accessor.update(v),w.entry=v,K3.DidUpdate;{let y;typeof i=="string"?y={primary:h,secondary:Hc(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}]}),K3.DidDefine}}unsetEntry(e){this._entries.get(e)?.disposable.dispose(),this._entries.delete(e)}getEntries(){return this._entries.entries()}};Jve=D([_(0,yMe)],Jve);ce(CMe,Jve,Qt.Delayed);const YLt=ae("IEditorBreadcrumbsService"),Bx=new wn(220,70),JJ=new wn(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),cce={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}},Im=ae("viewDescriptorService"),Tm=ae("accessibleViewService"),qN=ae("chatWidgetService"),JLt=ae("quickChatService"),jXe=ae("chatAccessibilityService"),XLt=ae("chatCodeBlockContextProviderService"),wf=ae("chatAgentService"),lce=ae("chatAgentNameService"),Lm=ae("IChatService"),SMe=ae("chatSlashCommandService"),z6=ae("IChatVariablesService"),YXe=ae("IChatWidgetHistoryService"),JXe=ae("ILanguageModelsService"),rE=ae("commentService"),AMe=ae("customEditorService"),EMe=ae("debugService"),XXe=ae("debugVisualizerService"),ZLt=ae("IEditSessionsStorageService"),eRt=ae("IEditSessionsLogService"),Xr=ae("extensionsWorkbenchService"),ZXe=ae("externalUriOpenerService"),yf=ae("explorerService"),eZe=ae("IInlineChatSavingService "),xMe=ae("IInlineChatSessionService"),DMe=ae("IInteractiveDocumentService"),tZe=ae("IInteractiveHistoryService"),tRt=ae("IDefaultLogLevelsService"),iZe=ae("multiDiffSourceResolverService"),$6=ae("INotebookEditorWidgetService"),nZe=ae("notebookCellStatusBarService"),dce=ae("INotebookModelResolverService"),iRt=ae("INotebookExecutionService"),sZe=ae("INotebookExecutionStateService"),rZe=ae("INotebookKernelService"),nRt=ae("INotebookKernelHistoryService"),sRt=ae("notebookKeymapService"),rRt=ae("INotebookLoggingService"),oZe=ae("INotebookRendererMessagingService"),oE=ae("notebookService"),oRt="notebookEditorWorkerService",aRt=ae(oRt),cRt=ae("outputChannelModelService"),lRt=ae("preferencesSearchService"),G6=ae("quickDiff"),kMe=ae("scm"),aZe=ae("scmView"),dRt=ae("replaceService"),hRt=ae("searchViewModelWorkbenchService"),uRt=ae("notebookSearchService"),gRt=ae("searchHistoryService"),cZe=ae("shareService"),hce=ae("snippetService"),uce=ae("speechService");class fRt{getTags(){return Promise.resolve({})}async getTelemetryWorkspaceId(e,t){}getHashedRemotesFromUri(e,t){return Promise.resolve([])}}const pRt=ae("workspaceTagsService"),lZe=ae("taskService"),GU=ae("terminalService"),mRt=ae("terminalConfigurationService"),dZe=ae("terminalEditorService"),IMe=ae("terminalGroupService"),hZe=ae("terminalInstanceService"),uZe=ae("environmentVariableService"),gZe=ae("terminalProfileResolverService"),fZe=ae("terminalProfileService"),_Rt=ae("terminalContributionsService"),pZe=ae("terminalLinkProviderService"),mZe=ae("terminalQuickFixService"),vRt=ae("testCoverageService"),bRt=ae("testingFilterState"),_Ze=ae("testProfileService"),vZe=ae("testResultService"),wRt=ae("ITestResultStorage"),bZe=ae("testService"),yRt=ae("testingContinuousRunService"),CRt=ae("testingDecorationService"),SRt=ae("testingPeekOpener"),ARt="timeline",wZe=ae(ARt),gce=ae("webviewService"),K6=ae("webviewEditorService"),yZe=ae("webviewViewService"),ERt=ae("walkthroughsService"),xRt=ae("activityService"),CZe=ae("IAiEmbeddingVectorService"),TMe=ae("IAiRelatedInformationService"),SZe=ae("WorkbenchAssignmentService"),fce=ae("IAuthenticationAccessService"),AZe=ae("IAuthenticationUsageService"),LMe=ae("IAuthenticationService"),EZe=ae("IAuthenticationExtensionsService"),xZe=ae("auxiliaryWindowService"),DRt=ae("bannerService"),MI=ae("jsonEditingService"),RMe=ae("configurationResolverService"),aE=ae("IFileDecorationsService"),cE=ae("ICustomEditorLabelService"),Pr=ae("editorGroupsService"),DZe=ae("editorPaneService"),KU=ae("editorResolverService"),ti=ae("editorService"),qU=ae("IExtensionBisectService"),kZe=ae("IExtensionFeaturesManagementService"),kRt=H6,gv=ae("extensionManagementServerService"),q6=kRt,Ol=ae("extensionEnablementService"),MMe=ae("IWebExtensionsScannerService"),IZe=ae("extensionRecommendationsService"),pce=ae("IExtensionIgnoredRecommendationsService"),IRt=ae("IWorkspaceExtensionsConfigService"),TZe=ae("extensionUrlHandler"),Rm=ae("extensionManifestPropertiesService"),ps=ae("extensionService"),Q6=ae("elevatedFileService"),bd=ae("filesConfigurationService"),TRt=ae("historyService"),Dc=ae("hostService"),LRt=ae("ITroubleshootIssueService"),RRt=ae("issueFormService"),MRt=ae("workbenchIssueService");class Xve{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 Lh(t,e.shiftKey,i,e.metaKey,e.keyCode);return this.resolveKeybinding(new PO([n]))[0]}resolveKeybinding(e){return nW.resolveKeybinding(e,this._OS)}}const NRt=ae("keybindingEditingService"),j6=ae("ILanguageDetectionService"),mce=ae("ILanguageStatusService"),rg=ae("lifecycleService");var Zve;(function(s){s[s.Default=1]="Default",s[s.Last=2]="Last"})(Zve||(Zve={}));var pD;(function(s){s[s.CLOSE=1]="CLOSE",s[s.QUIT=2]="QUIT",s[s.RELOAD=3]="RELOAD",s[s.LOAD=4]="LOAD"})(pD||(pD={}));var U5;(function(s){s[s.NewWindow=1]="NewWindow",s[s.ReloadedWindow=3]="ReloadedWindow",s[s.ReopenedWindow=4]="ReopenedWindow"})(U5||(U5={}));var Ms;(function(s){s[s.Starting=1]="Starting",s[s.Ready=2]="Ready",s[s.Restored=3]="Restored",s[s.Eventually=4]="Eventually"})(Ms||(Ms={}));function PRt(s){switch(s){case Ms.Starting:return"Starting";case Ms.Ready:return"Ready";case Ms.Restored:return"Restored";case Ms.Eventually:return"Eventually"}}var vV,EL;let ebe=(EL=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=Ms.Starting,this.phaseWhen=new Map,this._startupKind=this.resolveStartupKind(),this._register(this.storageService.onWillSaveState(i=>{i.reason===Ay.SHUTDOWN&&this.storageService.store(vV.LAST_SHUTDOWN_REASON_KEY,this.shutdownReason,Ie.WORKSPACE,cn.MACHINE)}))}resolveStartupKind(){const e=this.doResolveStartupKind()??U5.NewWindow;return this.logService.trace(`[lifecycle] starting up (startup kind: ${e})`),e}doResolveStartupKind(){const e=this.storageService.getNumber(vV.LAST_SHUTDOWN_REASON_KEY,Ie.WORKSPACE);this.storageService.remove(vV.LAST_SHUTDOWN_REASON_KEY,Ie.WORKSPACE);let t;switch(e){case pD.RELOAD:t=U5.ReloadedWindow;break;case pD.LOAD:t=U5.ReopenedWindow;break}return t}set phase(e){if(e0&&(t[An.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=[],r=[],o=[],a=[],c=KHe(this._allExtensions),l=KHe(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){r.push(m);continue}if(!d(v,m)){n.push(v.identifier),c.delete(v.identifier);continue}}const h=new D_(this._myExtensions),u=new D_(i);for(const m of this._myExtensions)u.has(m)||o.push(m);for(const m of i)h.has(m)||a.push(m);const f=nB.createActivationEventsMap(r),p={versionId:e,toRemove:n,toAdd:r,addActivationEvents:f,myToRemove:o,myToAdd:a};return this.delta(p),p}delta(e){if(this._versionId>=e.versionId)return null;const{toRemove:t,toAdd:i,myToRemove:n,myToAdd:r}=e,o=new D_(t),a=new D_(n);for(let c=0;csetTimeout(e,s))}function hMt(s,e,t){let i=Promise.resolve(),n=null;return async r=>{n==null?(n=r,i=i.then(async()=>dMt(t)).then(async()=>{const o=n;n=null,await s(o)})):n=e(n,r),await i}}const uMt={};let gMt;function fMt(s){return uMt[s]}function pMt(){return gMt}var EK;ce(pf,class extends Wje{constructor(){super(Kn.Info,N.file("logs.log"))}doCreateLogger(){return new Hje}},0);ce(ti,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 kt.get(qt).getFocusedCodeEditor()??void 0}createScoped(){return this}},0);ce(Mm,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(Is,Qve,1);ce(Fr,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(Xt,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 mMt=class{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=E,this.isTransient=()=>!1,this.windowId=ri.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 kt.get(Le)}focus(){}};const ZJ=new mMt;let _Mt=class{constructor(){this.windowId=ri.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=ZJ,this.groups=[ZJ],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=cce,this.onDidChangeEditorPartOptions=M.None,this.createEditorDropTarget=E}get contentDimension(){return E()}get sideGroup(){return E()}},vMt=class{constructor(){this.registerContextKeyProvider=E,this.saveWorkingSet=E,this.getWorkingSets=E,this.applyWorkingSet=E,this.deleteWorkingSet=E,this.onDidCreateAuxiliaryEditorPart=M.None,this.mainPart=new _Mt,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=cce,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=ZJ,this.groups=[ZJ],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(Pr,vMt,0);ce(DRt,class{focus(){}focusNextAction(){}focusPreviousAction(){}hide(){}show(){}},0);ce(WRt,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(qb,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(Cf,class{constructor(){this.defaultUriScheme="file",this.fileURI=E,this.userHome=E,this.hasValidBasename=E,this.resolvedUserHome=void 0}get path(){return E()}},1);ce(xo,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(tLt,class{constructor(){this._serviceBrand=void 0,this.getConfigBasedTips=async()=>[],this.getImportantExecutableBasedTips=async()=>[],this.getOtherExecutableBasedTips=async()=>[]}},0);ce(mce,class{constructor(){this.onDidChange=M.None,this.addStatus=E,this.getLanguageStatus=E}},1);ce(Dc,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(rg,class extends ebe{constructor(){super(...arguments),this.shutdown=E}},0);ce(j6,class{isEnabledForLanguage(){return!1}async detectLanguage(){}},0);ce(ps,oMt,0);ce(nce,class{constructor(){this.onDidChangeKeyboardLayout=M.None,this.getRawKeyboardMapping=()=>null,this.getCurrentKeyboardLayout=()=>null,this.getAllKeyboardLayouts=()=>[],this.getKeyboardMapper=()=>new Xve(!1,pr),this.validateCurrentKeyboardMapping=()=>{}}},1);ce(yce,class{async requiresInitialization(){return!1}async whenInitializationFinished(){}async initializeRequiredResources(){}async initializeInstalledExtensions(){}async initializeOtherResources(){}},0);ce(NZe,class{constructor(){this.dark=!1,this.highContrast=!1,this.onDidChangeColorScheme=M.None}},0);let tbe=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}};tbe=D([_(0,pg)],tbe);ce(Y6,tbe,0);ce(BRt,class{constructor(){this.onDidEncounterLanguage=M.None,this.createGrammar=E,this.startDebugMode=E,this.createTokenizer=E}},0);let ibe=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()}};ibe=D([_(0,pg)],ibe);ce(km,ibe,0);ce(cMt,class{constructor(){this.onDidChange=M.None,this.readStorageData=E,this.updateStorageData=E,this.withProfileScopedStorageService=E}},0);let nbe=class extends GRt{constructor(e){super({...mV("__default__profile__","Default",e.userRoamingDataHome,Ft(e.cacheHome,"CachedProfilesData")),isDefault:!0})}};nbe=D([_(0,ec)],nbe);ce(pg,nbe,0);ce(KRe,NXe,0);ce(hce,class{constructor(){this.getSnippetFiles=E,this.isEnabled=E,this.updateEnablement=E,this.updateUsageTimestamp=E,this.getSnippets=async()=>[],this.getSnippetsSync=E}},0);const bMt={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 wMt{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 yMt{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(EMe,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 yMt,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=()=>bMt,this.getViewModel=()=>new wMt,this.runTo=E}get state(){return E()}},0);ce(U6,class{constructor(){this.lookupAuthorization=E,this.lookupKerberosAuthorization=E,this.request=E,this.resolveProxy=E,this.loadCertificates=E}},0);ce(Bae,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(xRt,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(LXe,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(Nm,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(Im,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(TRt,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(lZe,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(RMe,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(fg,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(Tut,oLt,0);let sbe=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(){}};sbe=D([_(0,fi)],sbe);ce(bce,sbe,0);ce(_Me,class{constructor(){this.registerEditSessionIdentityProvider=()=>V.None,this.getEditSessionIdentifier=async()=>{},this.provideEditSessionIdentityMatch=async()=>{},this.addEditSessionIdentityCreateParticipant=()=>V.None,this.onWillCreateEditSessionIdentity=async()=>{}}},0);ce(oC,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(PZe,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(Xr,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(gv,class{constructor(){this._serviceBrand=void 0,this.localExtensionManagementServer=null,this.remoteExtensionManagementServer=null,this.webExtensionManagementServer=null,this.getExtensionManagementServer=E,this.getExtensionInstallLocation=E}},0);ce(IZe,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(ALt,class{constructor(){this.onError=M.None,this.turnOn=E,this.turnOff=E,this.triggerSync=E}},0);ce(vLt,class{constructor(){this.getIgnoredExtensions=()=>[],this.hasToNeverSyncExtension=()=>!1,this.hasToAlwaysSyncExtension=()=>!1,this.updateIgnoredExtensions=E,this.updateSynchronizedExtensions=E}},0);ce(nLt,class{constructor(){this.ignoredRecommendations=[],this.hasToIgnoreRecommendationNotifications=()=>!1,this.promptImportantExtensionsInstallNotification=E,this.promptWorkspaceRecommendations=E}},0);ce(MMe,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(iLt,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(tce,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(pce,class{constructor(){this.onDidChangeIgnoredRecommendations=M.None,this.ignoredRecommendations=[],this.onDidChangeGlobalIgnoredRecommendation=M.None,this.globalIgnoredRecommendations=[],this.toggleGlobalIgnoredRecommendation=E}},0);ce(IRt,class{constructor(){this.onDidChangeExtensionsConfigs=M.None,this.getExtensionsConfigs=E,this.getRecommendations=E,this.getUnwantedRecommendations=E,this.toggleRecommendation=E,this.toggleUnwantedRecommendation=E}},0);ce(Fl,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(oce,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(bd,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(J6,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(X6,class{async hasBackups(){return!1}hasBackupSync(){return!1}async getBackups(){return[]}async resolve(){}async backup(){}async discardBackup(){}async discardBackups(){}},0);ce(Pm,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(aE,class{constructor(){this.onDidChangeDecorations=M.None,this.registerDecorationsProvider=E,this.getDecoration=()=>{}}},0);ce(Q6,class{constructor(){this.isSupported=()=>!1,this.writeFileElevated=E}},0);ce(dg,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(MI,class{constructor(){this.write=E}},1);ce(RI,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(wce,class{constructor(){this.createTextEditor=E,this.resolveTextEditor=E}},0);ce(KU,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(_ce,class{constructor(){this.onActiveOutputChannel=M.None}getChannel(){}getChannelDescriptor(){}getChannelDescriptors(){return[]}getActiveChannel(){}async showChannel(){}},1);ce(cRt,class{constructor(){this.createOutputChannelModel=E}},1);ce(ice,class{constructor(){this.readExtensionResource=E,this.supportsExtensionGalleryResources=!1,this.isExtensionGalleryResource=()=>!1,this.getExtensionGalleryResourceURL=E}},0);ce(sLt,class{scanBuiltinExtensions(){return Promise.resolve([])}},0);ce(yf,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(V3,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(RXe,class{constructor(){this.onDidChangeEnablement=M.None}getDisabledExtensions(){return[]}enableExtension(){return Promise.resolve(!0)}disableExtension(){return Promise.resolve(!0)}},1);ce(MXe,class{async getAvailableLanguages(){return[]}async getInstalledLanguages(){return[]}async getBuiltInExtensionTranslationsUri(e,t){const i=fMt(t)?.[e];return i!=null?N.parse(i):void 0}},1);ce(ece,class{constructor(){this.removeDragOperationTransfer=E,this.addDragOperationTransfer=E}},1);ce(YLt,class{constructor(){this.register=E,this.getWidget=()=>{}}},0);ce(MZe,class{constructor(){this.onDidChange=M.None,this.canCreateOutline=()=>!1,this.createOutline=async()=>{},this.registerOutlineCreator=E}},0);ce(OXe,class{constructor(){this.onStateChange=M.None,this.state=_Lt.Uninitialized,this.checkForUpdates=E,this.downloadUpdate=E,this.applyUpdate=E,this.quitAndInstall=E,this.isLatestVersion=async()=>!0,this._applySpecificUpdate=E}},0);ce(yMe,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(LI,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(GU,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=yW.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 vct(this.instances,this.onDidCreateInstance,this.onDidDisposeInstance,e)}get configHelper(){return E()}},1);ce(mRt,class{constructor(){this.onConfigChanged=M.None,this.setPanelContainer=E,this.configFontIsMonospace=E,this.getFont=E}get config(){return E()}},1);ce(dZe,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(hZe,class{constructor(){this.getRegisteredBackends=()=>[].values(),this.onDidCreateInstance=M.None,this.convertProfileToShellLaunchConfig=E,this.createInstance=E,this.getBackend=E,this.didRegisterBackend=E}},1);ce(fZe,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(mLt,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(pZe,class{constructor(){this.linkProviders=new Set([]),this.onDidAddLinkProvider=M.None,this.onDidRemoveLinkProvider=M.None,this.registerLinkProvider=E}},1);ce(_Rt,class{constructor(){this.terminalProfiles=[]}},1);ce(gZe,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(uZe,class{constructor(){this.collections=new Map,this.onDidChangeCollections=M.None,this.set=E,this.delete=E}get mergedCollection(){return E()}},1);ce(mZe,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(KRt,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(BXe,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(NRt,class{constructor(){this.addKeybinding=E,this.editKeybinding=E,this.removeKeybinding=E,this.resetKeybinding=E}},1);ce(lRt,class{constructor(){this.getLocalSearchProvider=E,this.getRemoteSearchProvider=E}},1);ce(oE,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(dRt,class{constructor(){this.replace=E,this.openReplacePreview=E,this.updateReplacePreview=E}},1);ce(gRt,class{constructor(){this.onDidClearHistory=M.None,this.clearHistory=E,this.load=E,this.save=E}},1);ce($6,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(hRt,class{get searchModel(){return E()}},1);ce(dce,class{constructor(){this.onDidSaveNotebook=M.None,this.onDidChangeDirty=M.None,this.onWillFailWithConflict=M.None,this.isDirty=E,this.resolve=E}},1);ce(OZe,class{constructor(){this.onDidRegisterHandler=M.None,this.registerHandler=()=>V.None,this.findEditor=()=>{}}},1);ce(NMe,class{constructor(){this.isActive=!1,this.onDidChangeIsActive=M.None,this.markActive=E}},1);ce(mMe,class{constructor(){this.registerCanonicalUriProvider=E}},1);ce(CMe,class{constructor(){this.onDidChange=M.None}setOrUpdateEntry(){return 1}unsetEntry(){}getEntries(){return[]}},1);ce(SZe,class{constructor(){this.getCurrentExperiments=async()=>[],this.getTreatment=async()=>{}}},1);ce(Lm,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(WZe,class{constructor(){this.update=E}},1);ce(JLt,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(wf,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(lce,class{getAgentNameRestriction(){return!0}},1);ce(ORt,class{constructor(){this.onDidCreateTerminal=M.None,this.createTerminal=E}},1);ce(AMe,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(gce,class{constructor(){this.webviews=[],this.onDidChangeActiveWebview=M.None,this.createWebviewElement=E,this.createWebviewOverlay=E}},1);ce(yZe,class{constructor(){this.onNewResolverRegistered=M.None,this.register=E,this.resolve=E}},1);ce(LZe,class{constructor(){this.setLocale=E}clearLocalePreference(){return Promise.resolve()}},1);ce(K6,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(bC,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(ZXe,class{constructor(){this.registerExternalOpenerProvider=()=>V.None,this.getOpener=async()=>{}}},1);ce(Tm,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(aMt,class{constructor(){this.hasShownAccessibleView=()=>!1}},1);ce(q6,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(Rm,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(Oae,class{isWorkspaceTrustEnabled(){return!1}},1);ce(sce,class{whenExtensionsReady(){throw new Error("Method not implemented.")}async scanExtensions(){return[]}async scanSingleExtension(){return null}},1);ce(ace,class{constructor(){this.create=E,this.open=async()=>!1,this.registerHandler=E}},1);ce(fMe,class{constructor(){this.register=E,this.connect=E}},1);ce(G6,class{constructor(){this.onDidChangeQuickDiffProviders=M.None,this.addQuickDiffProvider=E,this.getQuickDiffs=E}},1);ce(kMe,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(gMe,class{constructor(){this.download=E}},1);ce(TZe,class{constructor(){this.registerExtensionHandler=E,this.unregisterExtensionHandler=E}},1);ce(rE,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(nZe,class{constructor(){this.onDidChangeProviders=M.None,this.onDidChangeItems=M.None,this.registerCellStatusBarItemProvider=E,this.getStatusBarItemsForCell=E}},1);ce(rZe,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(oZe,class{constructor(){this.onShouldPostMessage=M.None,this.prepare=E,this.getScoped=E,this.receiveMessage=E}},1);ce(tZe,class{constructor(){this.addToHistory=E,this.getPreviousValue=E,this.getNextValue=E,this.replaceLast=E,this.clearHistory=E,this.has=E}},1);ce(DMe,class{constructor(){this.onWillAddInteractiveDocument=M.None,this.onWillRemoveInteractiveDocument=M.None,this.willCreateInteractiveDocument=E,this.willRemoveInteractiveDocument=E}},1);ce(FRt,class{async getExtensionIdProvidingCurrentLocale(){return pMt()}},0);ce(HRt,class{constructor(){this.getRemoteProfiles=async()=>[],this.getRemoteProfile=E}},0);ce(qU,class{constructor(){this.isDisabledByBisect=()=>!1,this.isActive=!1,this.disabledCount=0,this.start=E,this.next=E,this.reset=E}},0);ce(DLt,class{constructor(){this.onTokenFailed=M.None,this.account=void 0,this.onDidChangeAccount=M.None}updateAccount(){return Promise.resolve()}},0);ce(qN,class{constructor(){this.getWidgetBySessionId=()=>{},this.lastFocusedWidget=void 0,this.revealViewForProvider=E,this.getWidgetByInputUri=E}},1);ce(vce,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(LMe,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(fce,class{constructor(){this.onDidChangeExtensionSessionAccess=M.None,this.isAccessAllowed=()=>!1,this.readAllowedExtensions=()=>[],this.updateAllowedExtensions=E,this.removeAllowedExtensions=E}},1);ce(EZe,class{constructor(){this.updateSessionPreference=E,this.getSessionPreference=()=>{},this.removeSessionPreference=E,this.selectSession=E,this.requestSessionAccess=E,this.requestNewSession=E}},1);ce(AZe,class{constructor(){this.readAccountUsages=E,this.removeAccountUsage=E,this.addAccountUsage=E}},1);ce(wZe,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(bZe,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(PXe,class{constructor(){this.onDidChangeSecret=M.None,this.type="in-memory",this.get=async()=>{},this.set=E,this.delete=E}},1);ce(cZe,class{constructor(){this.registerShareProvider=E,this.getShareActions=()=>[],this.provideShare=async()=>{}}},1);ce(FZe,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(MRt,class{constructor(){this.registerIssueDataProvider=E,this.openReporter=E,this.openProcessExplorer=E,this.registerIssueUriRequestHandler=E}},1);ce(aZe,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(sZe,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(_Ze,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(eLt,class{constructor(){this.setUsePlainTextEncryption=E,this.getKeyStorageProvider=E,this.encrypt=E,this.decrypt=E,this.isEncryptionAvailable=E}},1);ce(vZe,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(wRt,class{constructor(){this.read=E,this.persist=E}},1);ce(CRt,class{constructor(){this.onDidChange=M.None,this.invalidateResultMessage=E,this.syncDecorations=E,this.getDecoratedTestPosition=E}},1);ce(yce,class{constructor(){this.requiresInitialization=async()=>!1,this.whenInitializationFinished=async()=>{},this.initializeRequiredResources=async()=>{},this.initializeInstalledExtensions=async()=>{},this.initializeOtherResources=async()=>{}}},1);ce(ZTt,XTt,1);ce(uRt,class{notebookSearch(){return{openFilesToScan:new Mk,completeData:Promise.resolve({results:[],messages:[]}),allScannedFiles:Promise.resolve(new Mk)}}},1);ce(JXe,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(SMe,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(z6,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(TMe,class{constructor(){this.isEnabled=()=>!1,this.getRelatedInformation=E,this.registerAiRelatedInformationProvider=E}},1);ce(CZe,class{constructor(){this.isEnabled=()=>!1,this.getEmbeddingVector=E,this.registerAiEmbeddingVectorProvider=E}},1);ce(FXe,(EK=class{async createNewMessage(e){return{id:String(EK._nextId++),data:e}}async validate(){return!0}async sign(e){return e}},EK._nextId=1,EK),1);ce(yRt,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(bRt,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(SRt,class{constructor(){this.tryPeekFirstError=E,this.peekUri=E,this.openCurrentInEditor=E,this.open=E,this.closeAllPeeks=E}get historyVisible(){return E()}},1);ce(xZe,class{constructor(){this.getWindow=()=>{},this.onDidOpenAuxiliaryWindow=M.None,this.hasWindow=()=>!1,this.open=E}},1);ce(uce,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(vRt,class{constructor(){this.openCoverage=E,this.closeCoverage=E}get showInline(){return E()}get filterToTest(){return E()}get selected(){return E()}},1);ce(jXe,class{constructor(){this.acceptRequest=E,this.acceptResponse=E}},1);ce(YXe,class{constructor(){this.onDidClearHistory=M.None,this.clearHistory=E,this.getHistory=()=>[],this.saveHistory=E}},1);ce(XLt,class{constructor(){this.providers=[],this.registerProvider=()=>V.None}},1);ce(xMe,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(aRt,class{constructor(){this.canComputeDiff=()=>!1,this.computeDiff=E,this.canPromptRecommendation=async()=>!1}},1);ce(nRt,class{constructor(){this.getKernels=E,this.addMostRecentKernel=E}},1);ce(iRt,class{constructor(){this.executeNotebookCells=E,this.cancelNotebookCells=E,this.cancelNotebookCellHandles=E,this.registerExecutionParticipant=E}},1);ce(sRt,class{},1);ce(rRt,class{constructor(){this.info=E,this.debug=E}},1);ce(ERt,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(bLt,class{constructor(){this.onDidChangeUserDataSyncStore=M.None,this.userDataSyncStore=void 0,this.switch=E,this.getPreviousUserDataSyncStore=E}},1);ce(wLt,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(xLt,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(CLt,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(kLt,class{constructor(){this.onDidChange=M.None,this.getMachines=E,this.addCurrentMachine=E,this.removeCurrentMachine=E,this.renameMachine=E,this.setEnablements=E}},1);ce(SLt,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(yLt,class{constructor(){this.writeResource=E,this.getAllResourceRefs=E,this.resolveResourceContent=E}},1);ce(ELt,class{constructor(){this.resolveDefaultCoreIgnoredSettings=async()=>[],this.resolveUserBindings=E,this.resolveFormattingOptions=E,this.resolveDefaultIgnoredSettings=E}},1);ce(URt,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(qRt,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(eZe,class{constructor(){this.markChanged=E}},1);ce(RZe,class{constructor(){this.getNotebook=()=>{},this.addNotebookDocument=E,this.removeNotebookDocument=E}},1);ce(XXe,class{constructor(){this.registerTree=E,this.getVisualizedNodeFor=E,this.getVisualizedChildren=E,this.editTreeItem=E,this.getApplicableFor=E,this.register=E}},1);ce(eRt,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(ZLt,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(iZe,class{constructor(){this.registerResolver=()=>V.None,this.resolve=async()=>{}}},1);ce(pRt,fRt,1);ce(kZe,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(DZe,class{constructor(){this.onWillInstantiateEditorPane=M.None,this.didInstantiateEditorPane=()=>!1}},1);ce(QRt,class{constructor(){this.matches=E,this.getWorkspaceStateFolders=E}},1);ce(tRt,class{constructor(){this.onDidChangeDefaultLogLevels=M.None,this.getDefaultLogLevel=async()=>Kn.Off,this.getDefaultLogLevels=E,this.setDefaultLogLevel=E,this.migrateLogLevels=E}},1);ce(cE,class{constructor(){this.onDidChange=M.None,this.getName=()=>{}}},1);ce(LRt,class{constructor(){this.isActive=()=>!1,this.start=E,this.resume=E,this.stop=E}},1);ce(lMt,class{async isPure(){return{isPure:!1,proof:[]}}},1);ce(Sce,class{isValid(){return!1}},1);ce(HZe,class{constructor(){this.onDidChangeTools=M.None,this.registerToolData=E,this.registerToolImplementation=E,this.getTools=()=>[],this.invokeTool=E}},1);ce(RRt,class{constructor(){this.openReporter=E,this.reloadWithExtensionsDisabled=E,this.showConfirmCloseDialog=E,this.showClipboardDialog=E,this.sendReporterMenu=E,this.closeReporter=E}},1);const CMt="vscode://schemas/vscode-product",SMt={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"}},BM=Object.freeze(SMt),PMe=je.as(tE.JSONContribution);class AMt{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(Ze.Error,e)}warn(e){this._msg(Ze.Warning,e)}info(e){this._msg(Ze.Info,e)}}class z5{static _toSet(e){const t=new D_;for(let i=0,n=e.length;i!i.has(a.description.identifier)),o=e.filter(a=>!n.has(a.description.identifier));return new z5(r,o)}constructor(e,t){this.added=e,this.removed=t}}class EMt{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=z5.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 xMt={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.")]},UZe="vscode://schemas/vscode-extensions",rbe={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:mXe},{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(BM).map(s=>s),markdownEnumDescriptions:Object.values(BM).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:q3}},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:q3}},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:xMt,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 DMt{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw new Error("Duplicate extension point: "+e.extensionPoint);const t=new EMt(e.extensionPoint,e.defaultExtensionKind);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&nB.register(e.extensionPoint,e.activationEventsGenerator),rbe.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,PMe.registerSchema(UZe,rbe),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}}const VZe={ExtensionsRegistry:"ExtensionsRegistry"};je.add(VZe.ExtensionsRegistry,new DMt);const ih=je.as(VZe.ExtensionsRegistry);PMe.registerSchema(UZe,rbe);PMe.registerSchema(CMt,{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(BM),markdownEnumDescriptions:Object.values(BM).map(s=>s.proposal)}}]}}}});var ev;(function(s){s.ExtensionFeaturesRegistry="workbench.registry.extensionFeatures"})(ev||(ev={}));class kMt{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())}}je.add(ev.ExtensionFeaturesRegistry,new kMt);var hf;(function(s){s.Workbench="workbench.contributions.kind"})(hf||(hf={}));var Cc;(function(s){s[s.BlockStartup=1]="BlockStartup",s[s.BlockRestore=2]="BlockRestore",s[s.AfterRestored=3]="AfterRestored",s[s.Eventually=4]="Eventually"})(Cc||(Cc={}));function qHe(s){const e=s;return!!e&&typeof e.editorTypeId=="string"}function IMt(s){switch(s){case Ms.Restored:return Cc.AfterRestored;case Ms.Eventually:return Cc.Eventually}}function QHe(s){switch(s){case Cc.BlockStartup:return Ms.Starting;case Cc.BlockRestore:return Ms.Ready;case Cc.AfterRestored:return Ms.Restored;case Cc.Eventually:return Ms.Eventually}}const JE=class JE 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 hc,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"&&qHe(i)&&this.editorPaneService.didInstantiateEditorPane(i.editorTypeId))?this.safeCreateContribution(this.instantiationService,this.logService,this.environmentService,n,typeof i=="number"?QHe(i):this.lifecycleService.phase):(typeof i=="number"&&Pj(this.contributionsByPhase,QHe(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),qHe(i)&&Pj(this.contributionsByEditor,i.editorTypeId,[]).push(n)))}registerWorkbenchContribution(e,t){this.registerWorkbenchContribution2(void 0,e,IMt(t))}getWorkbenchContribution(e){if(this.instancesById.has(e))return this.instancesById.get(e);const t=this.instantiationService,i=this.lifecycleService,n=this.logService,r=this.environmentService;if(!t||!i||!n||!r)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): cannot be called before registry started`);const o=this.contributionsById.get(e);if(!o)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): contribution with that identifier is unknown.`);i.phase{this.instanceDisposables.clear()}));for(const a of[Ms.Starting,Ms.Ready,Ms.Restored,Ms.Eventually])this.instantiateByPhase(t,i,n,r,a);for(const a of this.contributionsByEditor.keys())o.didInstantiateEditorPane(a)&&this.onEditor(a,t,i,n,r);this._register(o.onWillInstantiateEditorPane(a=>this.onEditor(a.typeId,t,i,n,r)))}onEditor(e,t,i,n,r){const o=this.contributionsByEditor.get(e);if(o){this.contributionsByEditor.delete(e);for(const a of o)this.safeCreateContribution(t,n,r,a,i.phase)}}instantiateByPhase(e,t,i,n,r){t.phase>=r?this.doInstantiateByPhase(e,i,n,r):t.when(r).then(()=>this.doInstantiateByPhase(e,i,n,r))}async doInstantiateByPhase(e,t,i,n){const r=this.contributionsByPhase.get(n);if(r)switch(this.contributionsByPhase.delete(n),n){case Ms.Starting:case Ms.Ready:{ls(`code/willCreateWorkbenchContributions/${n}`);for(const o of r)this.safeCreateContribution(e,t,i,o,n);ls(`code/didCreateWorkbenchContributions/${n}`);break}case Ms.Restored:case Ms.Eventually:{n===Ms.Eventually&&await this.pendingRestoredContributions.p,this.doInstantiateWhenIdle(r,e,t,i,n);break}}}doInstantiateWhenIdle(e,t,i,n,r){ls(`code/willCreateWorkbenchContributions/${r}`);let o=0;const a=r===Ms.Eventually?3e3:500,c=l=>{for(;o(r{for(const t of e){const i=t.value,n=t.collector,r=t.description.extensionLocation;if(!i||!Array.isArray(i)){n.error(g(674,"'configuration.jsonValidation' must be a array"));return}i.forEach(o=>{if(!Rt(o.fileMatch)&&!(Array.isArray(o.fileMatch)&&o.fileMatch.every(Rt))){n.error(g(675,"'configuration.jsonValidation.fileMatch' must be defined as a string or an array of strings."));return}const a=o.url;if(!Rt(a)){n.error(g(676,"'configuration.jsonValidation.url' must be a URL or relative path"));return}if(a.startsWith("./"))try{const c=Ft(r,a);Jy(c,r)||n.warn(g(677,"Expected `contributes.{0}.url` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",jHe.name,c.toString(),r.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 LMt 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(r=>[new Nt().appendMarkdown(`\`${Array.isArray(r.fileMatch)?r.fileMatch.join(", "):r.fileMatch}\``),r.url]);return{data:{headers:i,rows:n},dispose:()=>{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"jsonValidation",label:g(682,"JSON Validation"),access:{canToggle:!1},renderer:new yi(LMt)});var AB;let eX=(AB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(TMt)}},AB.ID="workbench.contrib.jsonValidationExtensionPoint",AB);eX=D([_(0,we)],eX);Ju(eX.ID,eX,Cc.BlockStartup);const obe=je.as(tLe.ColorContribution),xK=obe.getColorReferenceSchema(),zZe="^\\w+[.\\w+]*$",RMt=ih.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:zZe,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:[xK,{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:[xK,{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:[xK,{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:[xK,{type:"string",format:"color-hex"}]}},required:["light","dark"]}}}}});class MMt{constructor(){RMt.setHandler((e,t)=>{for(const i of t.added){const n=i.value,r=i.collector;if(!n||!Array.isArray(n)){r.error(g(691,"'configuration.colors' must be a array"));return}const o=(a,c)=>a.length>0?a[0]==="#"?me.Format.CSS.parseHex(a):a:(r.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){r.error(g(693,"'configuration.colors.id' must be defined and can not be empty"));return}if(!a.id.match(zZe)){r.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){r.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"){r.error(g(696,"'configuration.colors.defaults' must be defined and must contain 'light' and 'dark'"));return}if(c.highContrast&&typeof c.highContrast!="string"){r.error(g(697,"If defined, 'configuration.colors.defaults.highContrast' must be a string."));return}if(c.highContrastLight&&typeof c.highContrastLight!="string"){r.error(g(698,"If defined, 'configuration.colors.defaults.highContrastLight' must be a string."));return}obe.registerColor(a.id,{light:o(c.light,"configuration.colors.defaults.light"),dark:o(c.dark,"configuration.colors.defaults.dark"),hcDark:o(c.highContrast??c.dark,"configuration.colors.defaults.highContrast"),hcLight:o(c.highContrastLight??c.light,"configuration.colors.defaults.highContrastLight")},a.description)}}for(const i of t.removed){const n=i.value;for(const r of n)obe.deregisterColor(r.id)}})}}class NMt 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=o=>o[0]==="#"?me.fromHex(o):void 0,r=t.sort((o,a)=>o.id.localeCompare(a.id)).map(o=>[new Nt().appendMarkdown(`\`${o.id}\``),o.description,n(o.defaults.dark)??new Nt().appendMarkdown(`\`${o.defaults.dark}\``),n(o.defaults.light)??new Nt().appendMarkdown(`\`${o.defaults.light}\``),n(o.defaults.highContrast)??new Nt().appendMarkdown(`\`${o.defaults.highContrast}\``)]);return{data:{headers:i,rows:r},dispose:()=>{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"colors",label:g(704,"Colors"),access:{canToggle:!1},renderer:new yi(NMt)});var EB;let tX=(EB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(MMt)}},EB.ID="workbench.contrib.colorExtensionPoint",EB);tX=D([_(0,we)],tX);Ju(tX.ID,tX,Cc.BlockStartup);const bV=je.as(GJe.IconContribution),PMt=bV.getIconReferenceSchema(),$Ze=`^${He.iconNameSegment}(-${He.iconNameSegment})+$`,FMt=ih.registerExtensionPoint({extensionPoint:"icons",jsonSchema:{description:g(705,"Contributes extension defined themable icons"),type:"object",propertyNames:{pattern:$Ze,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:[PMt,{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 OMt{constructor(){FMt.setHandler((e,t)=>{for(const i of t.added){const n=i.value,r=i.collector;if(!n||typeof n!="object"){r.error(g(712,"'configuration.icons' must be an object with the icon names as properties."));return}for(const o in n){if(!o.match($Ze)){r.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[o];if(typeof a.description!="string"||a.description.length===0){r.error(g(714,"'configuration.icons.description' must be defined and can not be empty"));return}const c=a.default;if(typeof c=="string")bV.registerIcon(o,{id:c},a.description);else if(typeof c=="object"&&typeof c.fontPath=="string"&&typeof c.fontCharacter=="string"){const l=jy(c.fontPath).substring(1),d=BMt[l];if(!d){r.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=Ft(h,c.fontPath);if(!Jy(u,h)){r.warn(g(716,"Expected `contributes.icons.default.fontPath` ({0}) to be included inside extension's folder ({0}).",u.path,h.path));return}const f=WMt(i.description,c.fontPath),p=bV.registerIconFont(f,{src:[{location:u,format:d}]});bV.registerIcon(o,{fontCharacter:c.fontCharacter,font:{id:f,definition:p}},a.description)}else r.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 r in n)bV.deregisterIcon(r)}})}}const BMt={ttf:"truetype",woff:"woff",woff2:"woff2"};function WMt(s,e){return zi.join(s.identifier.value,e)}var xB;let iX=(xB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(OMt)}},xB.ID="workbench.contrib.iconExtensionPoint",xB);iX=D([_(0,we)],iX);Ju(iX.ID,iX,Cc.BlockStartup);const la=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 HMt extends di{constructor(){super({id:"menu.resetHiddenStates",title:Pe(4502,"Reset All Menus"),category:la.View,f1:!0})}run(e){e.get(Ba).resetHiddenStates(),e.get(Ke).info("did RESET all menu hidden states")}}Et(HMt);var UMt='.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}';gt(UMt,{});let uf=class extends Kk{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,r,o,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){mp(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};uf=D([_(4,we),_(5,qt),_(6,bi),_(7,Le),_(8,mn),_(9,wi),_(10,_o),_(11,zs),_(12,nt)],uf);var VMt=".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}";gt(VMt,{});const YHe=new me(new hn(0,122,204)),zMt={showArrow:!0,showFrame:!0,className:"",frameColor:YHe,arrowColor:YHe,keepEditorSelection:!1},$Mt="vs.editor.contrib.zoneWidget";class GMt{constructor(e,t,i,n,r,o,a,c){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=c,this._onDomNodeTop=r,this._onComputedHeight=o}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class KMt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const zse=class zse{constructor(e){this._editor=e,this._ruleName=zse._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),xS(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(){xS(this._ruleName),$f(`.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:si.NeverGrowsWhenTypingAtEdges}}])}hide(){this._decorations.clear()}};zse._IdGenerator=new PU(".arrow-decoration-");let abe=zse;class FMe{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=Ds(t),mp(this.options,zMt,!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 abe(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(Wc())}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:Kt.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: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(),n=this.editor.getLayoutInfo(),r=this._getWidth(n);this.domNode.style.width=`${r}px`,this.domNode.style.left=this._getLeft(n)+"px";const o=document.createElement("div");o.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 GMt(o,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 KMt($Mt+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,r),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,_t.Smooth):this.editor.revealRange(e,_t.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 Wd(this.domNode,this,{orientation:pi.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),r=e.heightInLines+n;r>5&&r<35&&this._relayout(r)}}))}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 GZe=ae("IPeekViewService");ce(GZe,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 og;(function(s){s.inPeekEditor=new Q("inReferenceSearchEditor",!0,g(5106,"Whether the current code editor is embedded inside peek")),s.notInPeekEditor=s.inPeekEditor.toNegated()})(og||(og={}));var DB;let nX=(DB=class{constructor(e,t){e instanceof uf&&og.inPeekEditor.bindTo(t)}dispose(){}},DB.ID="editor.contrib.referenceController",DB);nX=D([_(1,Le)],nX);on(nX.ID,nX,ai.Eager);function KZe(s){const e=s.get(qt).getFocusedCodeEditor();return e instanceof uf?e.getParentEditor():e}const qMt={headerBackgroundColor:me.white,primaryHeadingColor:me.fromHex("#333333"),secondaryHeadingColor:me.fromHex("#6c6c6cb3")};let Q3=class extends FMe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,mp(this.options,qMt,!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"),Rr(this._titleElement,"click",r=>this._onTitleClick(r))),oe(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=fe("span.filename"),this._secondaryHeading=fe("span.dirname"),this._metaHeading=fe("span.meta"),oe(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=fe(".peekview-actions");oe(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new gd(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new an("peekview.close",g(5107,"Close"),He.asClassName(ve.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:GN.bind(void 0,this.instantiationService),orientation:W_.HORIZONTAL}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Ns(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Xh(this._metaHeading)):Gd(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`)}};Q3=D([_(2,we)],Q3);const Ace=W("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},g(5108,"Background color of the peek view title area.")),OMe=W("peekViewTitleLabel.foreground",{dark:me.white,light:me.black,hcDark:me.white,hcLight:Nl},g(5109,"Color of the peek view title.")),BMe=W("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},g(5110,"Color of the peek view title info.")),WMe=W("peekView.border",{dark:bm,light:bm,hcDark:yt,hcLight:yt},g(5111,"Color of the peek view borders and arrow.")),QMt=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:Nl},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:Nl},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:Nl},g(5116,"Foreground color of the selected entry in the peek view result list."));const qZe=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",qZe,g(5118,"Background color of the gutter in the peek view editor."));W("peekViewEditorStickyScroll.background",qZe,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:Xs,hcLight:Xs},g(5122,"Match highlight border in the peek view editor."));class sI{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=c_e.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,vi(this.uri),this.range.startLineNumber,this.range.startColumn):g(5094,"in {0} on line {1} at column {2}",vi(this.uri),this.range.startLineNumber,this.range.startColumn)}}class jMt{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:r,endLineNumber:o,endColumn:a}=e,c=i.getWordUntilPosition({lineNumber:n,column:r-t}),l=new F(n,c.startColumn,n,r),d=new F(o,a,o,Vn.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 j3{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new gi}dispose(){wt(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}",vi(this.uri),this.uri.fsPath):g(5097,"{0} symbols in {1}, full path {2}",e,vi(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 jMt(i))}catch(i){bt(i)}return this}}class cf{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(cf._compareReferences);let n;for(const r of e)if((!n||!Dn.isEqual(n.uri,r.uri,!0))&&(n=new j3(this,r.uri),this.groups.push(n)),n.children.length===0||cf._compareReferences(r,n.children[n.children.length-1])!==0){const o=new sI(i===r,n,r,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(o),n.children.push(o)}}dispose(){wt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new cf(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 r=i.children.length,o=i.parent.groups.length;return o===1||t&&n+10?(t?n=(n+1)%r:n=(n+r-1)%r,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%o,i.parent.groups[n].children[0]):(n=(n+o-1)%o,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,r)=>({idx:r,prefixLen:Qy(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,r)=>n.prefixLen>r.prefixLen?-1:n.prefixLenr.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 Dn.compare(e.uri,t.uri)||F.compareRangesUsingStarts(e.range,t.range)}}var YMt=".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}";gt(YMt,{});var cbe;let lbe=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof cf||e instanceof j3}getChildren(e){if(e instanceof cf)return e.groups;if(e instanceof j3)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};lbe=D([_(0,pn)],lbe);class JMt{getHeight(){return 23}getTemplateId(e){return e instanceof j3?sX.id:rX.id}}let dbe=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof sI){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return vi(e.uri)}mightProducePrintableCharacter(e){return this._keybindingService.mightProducePrintableCharacter(e)}};dbe=D([_(0,Vt)],dbe);class XMt{getId(e){return e instanceof sI?e.id:e.uri}}let hbe=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 P3(i,{supportHighlights:!0})),this.badge=new K_e(oe(i,fe(".count")),{},lJe),e.appendChild(i)}set(e,t){const i=Ro(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))}};hbe=D([_(1,Os)],hbe);var xL;let sX=(xL=class{constructor(e){this._instantiationService=e,this.templateId=cbe.id}renderTemplate(e){return this._instantiationService.createInstance(hbe,e)}renderElement(e,t,i){i.set(e.element,NU(e.filterData))}disposeTemplate(e){e.dispose()}},cbe=xL,xL.id="FileReferencesRenderer",xL);sX=cbe=D([_(0,we)],sX);class ZMt extends V{constructor(e){super(),this.label=this._register(new uD(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(!i||!i.value)this.label.set(`${vi(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:n,highlight:r}=i;t&&!O_.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(n,NU(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(n,[r]))}}}const $se=class $se{constructor(){this.templateId=$se.id}renderTemplate(e){return new ZMt(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};$se.id="OneReferenceRenderer";let rX=$se;class eNt{getWidgetAriaLabel(){return g(11228,"References")}getAriaLabel(e){return e.ariaMessage}}const Gse=class Gse{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,r=e.children.length;n{const r=n.deltaDecorations([],t);for(let o=0;o{r.equals(S.Escape)&&(this._keybindingService.dispatchEvent(r,r.target),r.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(iNt,"ReferencesWidget",this._treeContainer,new JMt,[this._instantiationService.createInstance(sX),this._instantiationService.createInstance(rX)],this._instantiationService.createInstance(lbe),i),this._splitView.addView({onDidChange:M.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:r=>{this._preview.layout({height:this._dim.height,width:r})}},Xk.Distribute),this._splitView.addView({onDidChange:M.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:r=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${r}px`,this._tree.layout(this._dim.height,r)}},Xk.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(r,o)=>{r instanceof sI&&(o==="show"&&this._revealReference(r,!1),this._onDidSelectReference.fire({element:r,kind:o,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(r=>{r.sideBySide?n(r.element,"side"):r.editorOptions.pinned?n(r.element,"goto"):n(r.element,"show")})),Gd(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new wn(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"),Xh(this._messageContainer),Promise.resolve(void 0)):(Gd(this._messageContainer),this._decorationsManager=new ube(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"),Xh(this._treeContainer),Xh(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 sI)return e;if(e instanceof j3&&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(TA(e.uri),this._uriLabel.getUriLabel(Ro(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}wt(this._previewModelReference);const r=n.object;if(r){const o=this._preview.getModel()===r.textEditorModel?_t.Smooth:_t.Immediate,a=F.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(r.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,o)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};gbe=D([_(3,mn),_(4,pn),_(5,we),_(6,GZe),_(7,Os),_(8,iE),_(9,Vt),_(10,Di),_(11,zs)],gbe);var hQ;const QN=new Q("referenceSearchVisible",!1,g(4503,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var DL;let HM=(DL=class{static get(e){return e.getContribution(hQ.ID)}constructor(e,t,i,n,r,o,a,c){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=r,this._instantiationService=o,this._storageService=a,this._configurationService=c,this._disposables=new Z,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=QN.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 r="peekViewLayout",o=tNt.fromJSON(this._storageService.get(r,Ie.PROFILE,"{}"));this._widget=this._instantiationService.createInstance(gbe,this._editor,this._defaultTreeKeyboardSupport,o),this._widget.setTitle(g(4504,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(r,JSON.stringify(this._widget.layoutData),Ie.PROFILE,cn.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 re(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),r=this._editor.hasTextFocus(),o=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),r?this._editor.focus():this._widget&&o&&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:Lb.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 r=hQ.get(n),o=this._model.clone();this.closeWidget(),n.focus(),r?.toggleWidget(i,Mo(a=>Promise.resolve(o)),this._peekMode??!1)}},n=>{this._ignoreModelChangeEvent=!1,bt(n)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:r}=e;this._editorService.openCodeEditor({resource:n,options:{selection:r,selectionSource:Lb.JUMP,pinned:i}},this._editor,t)}},hQ=DL,DL.ID="editor.contrib.referencesController",DL);HM=hQ=D([_(2,Le),_(3,qt),_(4,wi),_(5,we),_(6,Gi),_(7,Te)],HM);function jN(s,e){const t=KZe(s);if(!t)return;const i=HM.get(t);i&&e(i)}Sr.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:Ae.EditorContrib,primary:oo(U.CtrlCmd|S.KeyK,S.F2),when:he.or(QN,og.inPeekEditor),handler(s){jN(s,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Sr.registerCommandAndKeybindingRule({id:"goToNextReference",weight:Ae.EditorContrib-10,primary:S.F4,secondary:[S.F12],when:he.or(QN,og.inPeekEditor),handler(s){jN(s,e=>{e.goToNextOrPreviousReference(!0)})}});Sr.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:Ae.EditorContrib-10,primary:U.Shift|S.F4,secondary:[U.Shift|S.F12],when:he.or(QN,og.inPeekEditor),handler(s){jN(s,e=>{e.goToNextOrPreviousReference(!1)})}});vt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");vt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");vt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");vt.registerCommand("closeReferenceSearch",s=>jN(s,e=>e.closeWidget()));Sr.registerKeybindingRule({id:"closeReferenceSearch",weight:Ae.EditorContrib-101,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(og.inPeekEditor,he.not("config.editor.stablePeek"))});Sr.registerKeybindingRule({id:"closeReferenceSearch",weight:Ae.WorkbenchContrib+50,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(QN,he.not("config.editor.stablePeek"),he.or(J.editorTextFocus,TRe.negate()))});Sr.registerCommandAndKeybindingRule({id:"revealReference",weight:Ae.WorkbenchContrib,primary:S.Enter,mac:{primary:S.Enter,secondary:[U.CtrlCmd|S.DownArrow]},when:he.and(QN,zae,NRe.negate(),PRe.negate()),handler(s){const t=s.get(ug).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof sI&&jN(s,i=>i.revealReference(t[0]))}});Sr.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Enter,mac:{primary:U.WinCtrl|S.Enter},when:he.and(QN,zae,NRe.negate(),PRe.negate()),handler(s){const t=s.get(ug).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof sI&&jN(s,i=>i.openReference(t[0],!0,!0))}});vt.registerCommand("openReference",s=>{const t=s.get(ug).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof sI&&jN(s,i=>i.openReference(t[0],!1,!0))});let fbe=class extends HM{constructor(e,t,i,n,r,o,a){super(!1,e,t,i,n,r,o,a)}};fbe=D([_(1,Le),_(2,qt),_(3,wi),_(4,we),_(5,Gi),_(6,Te)],fbe);on(HM.ID,fbe,ai.Lazy);const TFe=class TFe 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)}))}};TFe.ID="editor.contrib.menuPreventer";let BA=TFe;on(BA.ID,BA,ai.BeforeFirstInteraction);let Y3=class extends yp{constructor(e,t,i,n,r,o,a,c,l){super(e,n.getRawOptions(),i,r,o,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){mp(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Y3=D([_(4,Le),_(5,we),_(6,qt),_(7,uv),_(8,nE)],Y3);const Z6=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 QZe extends _d{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(){Ns(this._domNode),this._domNode.style.backgroundColor=ime(yy,$e(Uc)),this._domNode.style.color=ime(EM,$e(Nl)),this._domNode.style.border=`1px solid ${$e(yt)}`,oe(this._domNode,fe("")).textContent=this.label,this.onclick(this._domNode,()=>this._onClick.fire())}}let oX=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(vC(this.menu,{renderShortTitle:!0,shouldForwardArgs:!0},i),i.length===0)return;const[n]=i,r=this.createWidget(n,e);e.add(r),e.add(r.onClick(()=>n.run(this.getActionArg()))),r.render()};this._register(this.menu.onDidChange(t)),t()}getActionArg(){}isVisible(){return!0}};oX=D([_(1,Ba),_(2,Le)],oX);let JHe=class extends oX{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(QZe,e.label),n=i.getDomNode();return this.options.container.appendChild(n),t.add(Ee(()=>n.remove())),i}getActionArg(){return this.options.getActionArg()}};JHe=D([_(1,we),_(2,Ba),_(3,Le)],JHe);var uQ,VD;let XHe=(VD=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),jo(t)?this.doHighlightRange(t,e):K2(t)&&jo(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&&Yi(t,e.resource)&&jo(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===Bi.NotSet||t.reason===Bi.Explicit||t.reason===Bi.Undo||t.reason===Bi.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?uQ._WHOLE_LINE_RANGE_HIGHLIGHT:uQ._RANGE_HIGHLIGHT}dispose(){super.dispose(),this.editor?.getModel()&&(this.removeHighlightRange(),this.editor=null)}},uQ=VD,VD._WHOLE_LINE_RANGE_HIGHLIGHT=Kt.register({description:"codeeditor-range-highlight-whole",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight",isWholeLine:!0}),VD._RANGE_HIGHLIGHT=Kt.register({description:"codeeditor-range-highlight",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight"}),VD);XHe=uQ=D([_(0,ti)],XHe);let aX=class extends QZe{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:Vg.BOTTOM_RIGHT_CORNER}}render(){super.render(),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}};aX=D([_(3,Vt)],aX);var kB;let ZHe=(kB=class extends oX{constructor(e,t,i,n){super(_e.EditorContent,i,n),this.editor=e,this.instantiationService=t,this.render()}createWidget(e){return this.instantiationService.createInstance(aX,this.editor,e.label,e.id)}isVisible(){return!(this.editor instanceof uf)&&this.editor?.hasModel()&&!this.editor.getOption(x.inDiffEditor)}getActionArg(){return this.editor.getModel()?.uri}},kB.ID="editor.contrib.floatingClickMenu",kB);ZHe=D([_(1,we),_(2,Ba),_(3,Le)],ZHe);Object.freeze({id:"application",order:100,title:g(4506,"Application"),type:"object"});const eG=Object.freeze({id:"workbench",order:7,title:g(4507,"Workbench"),type:"object"}),nNt=Object.freeze({id:"security",scope:ct.APPLICATION,title:g(4508,"Security"),type:"object",order:7}),sNt=Object.freeze({id:"problems",title:g(4509,"Problems"),type:"object",order:101}),jZe=Object.freeze({id:"window",order:8,title:g(4510,"Window"),type:"object"}),Fm={ConfigurationMigration:"base.contributions.configuration.migration"};class rNt{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new I,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}}const gQ=new rNt;je.add(Fm.ConfigurationMigration,gQ);var IB;let cX=(IB=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,gQ.migrations)})),this.migrateConfigurations(gQ.migrations),this._register(gQ.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",At.USER],["userLocal",At.USER_LOCAL],["userRemote",At.USER_REMOTE],["workspace",At.WORKSPACE],["workspaceFolder",At.WORKSPACE_FOLDER]]:[["user",At.USER],["userLocal",At.USER_LOCAL],["userRemote",At.USER_REMOTE],["workspace",At.WORKSPACE]];for(const[r,o]of n){const a=i[r];if(!a)continue;const c=[];if(a.value!==void 0){const l=await this.runMigration(e,r,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,r,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},o)))}}async runMigration(e,t,i,n,r){const o=c=>{const d=this.configurationService.inspect(c,{resource:n})[t];if(d)return r?d.overrides?.find(({identifiers:h})=>Js(h,r))?.value:d.value},a=await e.migrateFn(i,o);return Array.isArray(a)?a:[[e.key,a]]}},IB.ID="workbench.contrib.configurationMigration",IB);cX=D([_(0,Te),_(1,Ci)],cX);var TB;let lX=(TB=class extends V{constructor(e){super(),this.remoteAgentService=e,this._ready=new hc,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!jn&&(await this.remoteAgentService.getEnvironment())?.os!==ks.Windows)return;je.as(Pn.Configuration).registerConfiguration({...nNt,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:ct.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:ct.MACHINE}}})}},TB.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration",TB);lX=D([_(0,fg)],lX);const k4="window.newWindowProfile";var LB;let dX=(LB=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!==At.DEFAULT&&i.affectsConfiguration(k4)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){const e=je.as(Pn.Configuration),t={...jZe,properties:{[k4]:{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:ct.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){const e=this.configurationService.getValue(k4);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){const e=this.configurationService.getValue(k4);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(k4,t?.name)}},LB.ID="workbench.contrib.dynamicWindowConfiguration",LB);dX=D([_(0,km),_(1,Te)],dX);class oNt extends di{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 YZe extends di{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 JZe extends di{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 tG=Pe(4979,"Diff Editor");class aNt extends mf{constructor(){super({id:"diffEditor.switchSide",title:Pe(4980,"Switch Side"),icon:ve.arrowSwap,precondition:he.has("isInDiffEditor"),f1:!0,category:tG})}runEditorCommand(e,t,i){const n=QU(e);if(n instanceof yp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class cNt extends mf{constructor(){super({id:"diffEditor.exitCompareMove",title:Pe(4981,"Exit Compare Move"),icon:ve.close,precondition:J.comparingMovedCode,f1:!1,category:tG,keybinding:{weight:1e4,primary:S.Escape}})}runEditorCommand(e,t,...i){const n=QU(e);n instanceof yp&&n.exitCompareMove()}}class lNt extends mf{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Pe(4982,"Collapse All Unchanged Regions"),icon:ve.fold,precondition:he.has("isInDiffEditor"),f1:!0,category:tG})}runEditorCommand(e,t,...i){const n=QU(e);n instanceof yp&&n.collapseAllUnchangedRegions()}}class dNt extends mf{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Pe(4983,"Show All Unchanged Regions"),icon:ve.unfold,precondition:he.has("isInDiffEditor"),f1:!0,category:tG})}runEditorCommand(e,t,...i){const n=QU(e);n instanceof yp&&n.showAllUnchangedRegions()}}class pbe extends di{constructor(){super({id:"diffEditor.revert",title:Pe(4984,"Revert"),f1:!1,category:tG})}run(e,t){const i=hNt(e,t.originalUri,t.modifiedUri);i instanceof yp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const XZe=Pe(4985,"Accessible Diff Viewer"),Kse=class Kse extends di{constructor(){super({id:Kse.id,title:Pe(4986,"Go to Next Difference"),category:XZe,precondition:he.has("isInDiffEditor"),keybinding:{primary:S.F7,weight:Ae.EditorContrib},f1:!0})}run(e){QU(e)?.accessibleDiffViewerNext()}};Kse.id="editor.action.accessibleDiffViewer.next";let SW=Kse;const qse=class qse extends di{constructor(){super({id:qse.id,title:Pe(4987,"Go to Previous Difference"),category:XZe,precondition:he.has("isInDiffEditor"),keybinding:{primary:U.Shift|S.F7,weight:Ae.EditorContrib},f1:!0})}run(e){QU(e)?.accessibleDiffViewerPrev()}};qse.id="editor.action.accessibleDiffViewer.prev";let J3=qse;function hNt(s,e,t){return s.get(qt).listDiffEditors().find(r=>{const o=r.getModifiedEditor(),a=r.getOriginalEditor();return o&&o.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function QU(s){const t=s.get(qt).listDiffEditors(),i=Wc();if(i)for(const n of t){const r=n.getContainerDomNode();if(uNt(r,i))return n}return null}function uNt(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}var Wb;(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"})(Wb||(Wb={}));var Sm;(function(s){s.Help="help",s.View="view"})(Sm||(Sm={}));var eUe;(function(s){s.Previous="previous",s.Next="next"})(eUe||(eUe={}));class ZZe extends V{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(),this.id=e,this.options=t,this.provideContent=i,this.onClose=n,this.verbositySettingKey=r,this.onOpen=o,this.actions=a,this.provideNextContent=c,this.providePreviousContent=l,this.onDidChangeContent=d,this.onKeyDown=h,this.getSymbols=u,this.onDidRequestClearLastProvider=f}}const gNt=new Q("hasSpeechProvider",!1,{type:"boolean",description:g(6234,"A speech provider is registered to the speech service.")}),fNt=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 yF;(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"})(yF||(yF={}));var mbe;(function(s){s[s.Started=1]="Started",s[s.Stopped=2]="Stopped",s[s.Error=3]="Error"})(mbe||(mbe={}));var tUe;(function(s){s[s.Recognized=1]="Recognized",s[s.Stopped=2]="Stopped",s[s.Canceled=3]="Canceled"})(tUe||(tUe={}));var sB;(function(s){s.SpeechTimeout="accessibility.voice.speechTimeout",s.AutoSynthesize="accessibility.voice.autoSynthesize",s.SpeechLanguage="accessibility.voice.speechLanguage"})(sB||(sB={}));sB.SpeechLanguage;const pNt={"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)")}},WA=new Q("accessibilityHelpIsShown",!1,!0),Cp=new Q("accessibleViewIsShown",!1,!0),hX=new Q("accessibleViewSupportsNavigation",!1,!0),iUe=new Q("accessibleViewVerbosityEnabled",!1,!0),nUe=new Q("accessibleViewGoToSymbolSupported",!1,!0);new Q("accessibleViewOnLastLine",!1,!0);const uX=new Q("accessibleViewCurrentProviderId",void 0,void 0);new Q("accessibleViewInCodeBlock",void 0,void 0);const gX=new Q("accessibleViewContainsCodeBlocks",void 0,void 0),sUe=new Q("accessibleViewHasUnassignedKeybindings",void 0,void 0),rUe=new Q("accessibleViewHasAssignedKeybindings",void 0,void 0);var _be;(function(s){s.DimUnfocusedEnabled="accessibility.dimUnfocused.enabled",s.DimUnfocusedOpacity="accessibility.dimUnfocused.opacity",s.HideAccessibleView="accessibility.hideAccessibleView",s.AccessibleViewCloseOnKeyPress="accessibility.accessibleView.closeOnKeyPress"})(_be||(_be={}));var oUe;(function(s){s[s.Default=.75]="Default",s[s.Minimum=.2]="Minimum",s[s.Maximum=1]="Maximum"})(oUe||(oUe={}));var bo;(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"})(bo||(bo={}));const Af={type:"boolean",default:!0,tags:["accessibility"]},eet=Object.freeze({id:"accessibility",title:g(4679,"Accessibility"),type:"object"}),Va={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"]},yd={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto",announcement:"auto"}},Cd={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"]},qI={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto"}};({...eet,scope:ct.RESOURCE,properties:(bo.Terminal+"",{description:g(4685,"Provide information about how to access the terminal accessibility help menu when the terminal is focused."),...Af},bo.DiffEditor+"",{description:g(4686,"Provide information about how to navigate changes in the diff editor when it is focused."),...Af},bo.Chat+"",{description:g(4687,"Provide information about how to access the chat help menu when the chat input is focused."),...Af},bo.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."),...Af},bo.InlineCompletions+"",{description:g(4689,"Provide information about how to access the inline completions hover and Accessible View."),...Af},bo.KeybindingsEditor+"",{description:g(4690,"Provide information about how to change a keybinding in the keybindings editor when a row is focused."),...Af},bo.Notebook+"",{description:g(4691,"Provide information about how to focus the cell container or inner editor when a notebook cell is focused."),...Af},bo.Hover+"",{description:g(4692,"Provide information about how to open the hover in an Accessible View."),...Af},bo.Notification+"",{description:g(4693,"Provide information about how to open the notification in an Accessible View."),...Af},bo.EmptyEditorHint+"",{description:g(4694,"Provide information about relevant actions in an empty text editor."),...Af},bo.ReplInputHint+"",{description:g(4695,"Provide information about relevant actions For the Repl input."),...Af},bo.Comments+"",{description:g(4696,"Provide information about actions that can be taken in the comment widget or in a file which contains comments."),...Af},bo.DiffEditorActive+"",{description:g(4697,"Indicate when a diff editor becomes the active editor."),...Af},bo.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."),...Af},_be.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."),{...yd,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."),...Va},{description:g(4710,"Announces when the active line has a breakpoint."),...Cd})},{...qI,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."),...Va}},{...yd,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."),...Va},{description:g(4715,"Announces when the active line has an error."),...Cd})},{...yd,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."),...Va},{description:g(4718,"Announces when the active line has a folded area that can be unfolded."),...Cd})},{...yd,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."),...Va},{description:g(4721,"Announces when the active line has a warning."),...Cd})},{...yd,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."),...Va},{description:g(4724,"Announces when the active line has a warning."),...Cd})},{...yd,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."),...Va},{description:g(4727,"Announces when the active line has a warning."),...Cd})},{...yd,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."),...Va},{description:g(4730,"Announces when the debugger stopped on a breakpoint."),...Cd})},{...yd,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."),...Va},{description:g(4733,"Announces when trying to read a line with inlay hints that has no inlay hints."),...Cd})},{...yd,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."),...Va},{description:g(4736,"Announces when a task is completed."),...Cd})},{...yd,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)."),...Va},{description:g(4739,"Announces when a task fails (non-zero exit code)."),...Cd})},{...yd,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."),...Va},{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."),...Cd})},{...yd,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."),...Va},{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."),...Cd})},{...yd,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."),...Va},{description:g(4748,"Announces when terminal Quick Fixes are available."),...Cd})},{...yd,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."),...Va},{description:g(4751,"Announces when the terminal bell is ringing."),...Cd})},{...qI,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."),...Va}},{...qI,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."),...Va}},{...qI,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."),...Va}},{...yd,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."),...Va},{description:g(4760,"Announces when a notebook cell execution is successfully completed."),...Cd})},{...yd,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."),...Va},{description:g(4763,"Announces when a notebook cell execution fails."),...Cd})},{...yd,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."),...Va},{description:g(4766,"Announces when a chat request is made."),...Cd})},{...yd,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."),...Va},{description:g(4769,"Alerts on loop while progress is occurring."),...Cd})},{...qI,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."),...Va}},{...qI,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."),...Va}},{...qI,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."),...Va}},{...yd,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."),...Va},{description:g(4778,"Announces when a feature is cleared."),...Cd})},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 mNt=1200;var RB;let aUe=(RB=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,r)=>e[n].name.localeCompare(e[r].name));je.as(Pn.Configuration).registerConfiguration({...eet,properties:{[sB.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:mNt,minimum:0,tags:["accessibility"]},[sB.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)},[sB.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)")},...pNt}}},RB.ID="workbench.contrib.dynamicSpeechAccessibilityConfiguration",RB);aUe=D([_(0,uce),_(1,xo)],aUe);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.volume",migrateFn:(s,e)=>[["accessibility.signalOptions.volume",{value:s}],["audioCues.volume",{value:void 0}]]}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.debouncePositionChanges",migrateFn:s=>[["accessibility.signalOptions.debouncePositionChanges",{value:s}],["audioCues.debouncePositionChanges",{value:void 0}]]}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signalOptions",migrateFn:(s,e)=>{const t=lue(e,"general"),i=lue(e,"errorAtPosition"),n=lue(e,"warningAtPosition"),r=_Nt(e),o=vNt(e);return[["accessibility.signalOptions.volume",{value:r}],["accessibility.signalOptions.debouncePositionChanges",{value:o}],["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}]]}}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.sounds.volume",migrateFn:s=>[["accessibility.signalOptions.volume",{value:s}],["accessibility.signals.sounds.volume",{value:void 0}]]}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.debouncePositionChanges",migrateFn:s=>[["accessibility.signalOptions.debouncePositionChanges",{value:s}],["accessibility.signals.debouncePositionChanges",{value:void 0}]]}]);function lue(s,e){return s(`accessibility.signalOptions.experimental.delays.${e}`)||s("accessibility.signalOptions")?.["experimental.delays"]?.[`${e}`]||s("accessibility.signalOptions")?.delays?.[`${e}`]}function _Nt(s){return s("accessibility.signalOptions.volume")||s("accessibility.signalOptions")?.volume||s("accessibility.signals.sounds.volume")||s("audioCues.volume")}function vNt(s){return s("accessibility.signalOptions.debouncePositionChanges")||s("accessibility.signalOptions")?.debouncePositionChanges||s("accessibility.signals.debouncePositionChanges")||s("audioCues.debouncePositionChanges")}je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.chatResponsePending",migrateFn:(s,e)=>[["accessibility.signals.progress",{value:s}],["accessibility.signals.chatResponsePending",{value:void 0}]]}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations(ll.allAccessibilitySignals.map(s=>s.legacySoundSettingsKey?{key:s.legacySoundSettingsKey,migrateFn:(e,t)=>{const i=[],n=s.legacyAnnouncementSettingsKey;let r;return n&&(r=t(n)??void 0,r!==void 0&&typeof r!="string"&&(r=r?"auto":"off")),i.push([`${s.legacySoundSettingsKey}`,{value:void 0}]),i.push([`${s.settingsKey}`,{value:r!==void 0?{announcement:r,sound:e}:{sound:e}}]),i}}:void 0).filter(Oc));je.as(Fm.ConfigurationMigration).registerConfigurationMigrations(ll.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 eh;(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"})(eh||(eh={}));function bNt(s){const e=new Z,t=e.add(gqe());return e.add(ci(i=>{t.setStyle(s.read(i))})),e}const tet="editor.action.inlineSuggest.commit",iet="editor.action.inlineSuggest.showPrevious",net="editor.action.inlineSuggest.showNext";var wNt=".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}";gt(wNt,{});class X3{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 G2([...this.parts.map(i=>new lu(F.fromPositions(new re(this.lineNumber,i.column)),t?`[${i.lines.join(` + The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ${s.identifier.value}`)}class sMt{constructor(e,t,i,n){this.codeLoadingTime=e,this.activateCallTime=t,this.activateResolvedTime=i,this.activationReason=n}}class rMt{constructor(e,t){this.description=e,this.value=t}}var Bb;(function(s){s[s.Normal=0]="Normal",s[s.Immediate=1]="Immediate"})(Bb||(Bb={}));function Cce(s){return{type:s.isBuiltin?wo.System:wo.User,isBuiltin:s.isBuiltin||s.isUserBuiltin,identifier:{id:Mw(s.publisher,s.name),uuid:s.uuid},manifest:s,location:s.extensionLocation,targetPlatform:s.targetPlatform,validations:[],isValid:!0}}function mD(s,e){const t=OM(s.manifest.publisher,s.manifest.name);return{id:t,identifier:new An(t),isBuiltin:s.type===wo.System,isUserBuiltin:s.type===wo.User&&s.isBuiltin,isUnderDevelopment:!!e,extensionLocation:s.location,uuid:s.identifier.uuid,targetPlatform:s.targetPlatform,publisherDisplayName:s.publisherDisplayName,...s.manifest}}class oMt{constructor(){this.onDidRegisterExtensions=M.None,this.onDidChangeExtensionsStatus=M.None,this.onDidChangeExtensions=M.None,this.onWillActivateByEvent=M.None,this.onDidChangeResponsiveChange=M.None,this.onWillStop=M.None,this.extensions=[]}activateByEvent(e){return Promise.resolve(void 0)}activateById(e,t){return Promise.resolve(void 0)}activationEventIsDone(e){return!1}whenInstalledExtensionsRegistered(){return Promise.resolve(!0)}getExtension(){return Promise.resolve(void 0)}readExtensionPointContributions(e){return Promise.resolve(Object.create(null))}getExtensionsStatus(){return Object.create(null)}getInspectPorts(e,t){return Promise.resolve([])}stopExtensionHosts(){}async startExtensionHosts(){}async setRemoteEnvironment(e){}canAddExtension(){return!1}canRemoveExtension(){return!1}}const WZe=ae("ILanguageModelStatsService"),aMt=ae("accessibleViewInformationService"),cMt=ae("IUserDataProfileStorageService"),lMt=ae("integrityService"),Sce=ae("ITrustedDomainService"),HZe=ae("ILanguageModelToolsService");function E(){throw new Error("unsupported")}async function dMt(s){await new Promise(e=>setTimeout(e,s))}function hMt(s,e,t){let i=Promise.resolve(),n=null;return async r=>{n==null?(n=r,i=i.then(async()=>dMt(t)).then(async()=>{const o=n;n=null,await s(o)})):n=e(n,r),await i}}const uMt={};let gMt;function fMt(s){return uMt[s]}function pMt(){return gMt}var EK;ce(pf,class extends Wje{constructor(){super(Kn.Info,N.file("logs.log"))}doCreateLogger(){return new Hje}},0);ce(ti,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 kt.get(qt).getFocusedCodeEditor()??void 0}createScoped(){return this}},0);ce(Mm,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(Is,Qve,1);ce(Fr,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(Xt,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 mMt=class{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=E,this.isTransient=()=>!1,this.windowId=ri.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 kt.get(Le)}focus(){}};const ZJ=new mMt;let _Mt=class{constructor(){this.windowId=ri.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=ZJ,this.groups=[ZJ],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=cce,this.onDidChangeEditorPartOptions=M.None,this.createEditorDropTarget=E}get contentDimension(){return E()}get sideGroup(){return E()}},vMt=class{constructor(){this.registerContextKeyProvider=E,this.saveWorkingSet=E,this.getWorkingSets=E,this.applyWorkingSet=E,this.deleteWorkingSet=E,this.onDidCreateAuxiliaryEditorPart=M.None,this.mainPart=new _Mt,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=cce,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=ZJ,this.groups=[ZJ],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(Pr,vMt,0);ce(DRt,class{focus(){}focusNextAction(){}focusPreviousAction(){}hide(){}show(){}},0);ce(WRt,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(qb,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(Cf,class{constructor(){this.defaultUriScheme="file",this.fileURI=E,this.userHome=E,this.hasValidBasename=E,this.resolvedUserHome=void 0}get path(){return E()}},1);ce(xo,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(tLt,class{constructor(){this._serviceBrand=void 0,this.getConfigBasedTips=async()=>[],this.getImportantExecutableBasedTips=async()=>[],this.getOtherExecutableBasedTips=async()=>[]}},0);ce(mce,class{constructor(){this.onDidChange=M.None,this.addStatus=E,this.getLanguageStatus=E}},1);ce(Dc,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(rg,class extends ebe{constructor(){super(...arguments),this.shutdown=E}},0);ce(j6,class{isEnabledForLanguage(){return!1}async detectLanguage(){}},0);ce(ps,oMt,0);ce(nce,class{constructor(){this.onDidChangeKeyboardLayout=M.None,this.getRawKeyboardMapping=()=>null,this.getCurrentKeyboardLayout=()=>null,this.getAllKeyboardLayouts=()=>[],this.getKeyboardMapper=()=>new Xve(!1,pr),this.validateCurrentKeyboardMapping=()=>{}}},1);ce(yce,class{async requiresInitialization(){return!1}async whenInitializationFinished(){}async initializeRequiredResources(){}async initializeInstalledExtensions(){}async initializeOtherResources(){}},0);ce(NZe,class{constructor(){this.dark=!1,this.highContrast=!1,this.onDidChangeColorScheme=M.None}},0);let tbe=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}};tbe=D([_(0,pg)],tbe);ce(Y6,tbe,0);ce(BRt,class{constructor(){this.onDidEncounterLanguage=M.None,this.createGrammar=E,this.startDebugMode=E,this.createTokenizer=E}},0);let ibe=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()}};ibe=D([_(0,pg)],ibe);ce(km,ibe,0);ce(cMt,class{constructor(){this.onDidChange=M.None,this.readStorageData=E,this.updateStorageData=E,this.withProfileScopedStorageService=E}},0);let nbe=class extends GRt{constructor(e){super({...mV("__default__profile__","Default",e.userRoamingDataHome,Ft(e.cacheHome,"CachedProfilesData")),isDefault:!0})}};nbe=D([_(0,ec)],nbe);ce(pg,nbe,0);ce(KRe,NXe,0);ce(hce,class{constructor(){this.getSnippetFiles=E,this.isEnabled=E,this.updateEnablement=E,this.updateUsageTimestamp=E,this.getSnippets=async()=>[],this.getSnippetsSync=E}},0);const bMt={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 wMt{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 yMt{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(EMe,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 yMt,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=()=>bMt,this.getViewModel=()=>new wMt,this.runTo=E}get state(){return E()}},0);ce(U6,class{constructor(){this.lookupAuthorization=E,this.lookupKerberosAuthorization=E,this.request=E,this.resolveProxy=E,this.loadCertificates=E}},0);ce(Bae,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(xRt,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(LXe,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(Nm,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(Im,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(TRt,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(lZe,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(RMe,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(fg,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(Tut,oLt,0);let sbe=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(){}};sbe=D([_(0,fi)],sbe);ce(bce,sbe,0);ce(_Me,class{constructor(){this.registerEditSessionIdentityProvider=()=>V.None,this.getEditSessionIdentifier=async()=>{},this.provideEditSessionIdentityMatch=async()=>{},this.addEditSessionIdentityCreateParticipant=()=>V.None,this.onWillCreateEditSessionIdentity=async()=>{}}},0);ce(oC,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(PZe,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(Xr,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(gv,class{constructor(){this._serviceBrand=void 0,this.localExtensionManagementServer=null,this.remoteExtensionManagementServer=null,this.webExtensionManagementServer=null,this.getExtensionManagementServer=E,this.getExtensionInstallLocation=E}},0);ce(IZe,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(ALt,class{constructor(){this.onError=M.None,this.turnOn=E,this.turnOff=E,this.triggerSync=E}},0);ce(vLt,class{constructor(){this.getIgnoredExtensions=()=>[],this.hasToNeverSyncExtension=()=>!1,this.hasToAlwaysSyncExtension=()=>!1,this.updateIgnoredExtensions=E,this.updateSynchronizedExtensions=E}},0);ce(nLt,class{constructor(){this.ignoredRecommendations=[],this.hasToIgnoreRecommendationNotifications=()=>!1,this.promptImportantExtensionsInstallNotification=E,this.promptWorkspaceRecommendations=E}},0);ce(MMe,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(iLt,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(tce,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(pce,class{constructor(){this.onDidChangeIgnoredRecommendations=M.None,this.ignoredRecommendations=[],this.onDidChangeGlobalIgnoredRecommendation=M.None,this.globalIgnoredRecommendations=[],this.toggleGlobalIgnoredRecommendation=E}},0);ce(IRt,class{constructor(){this.onDidChangeExtensionsConfigs=M.None,this.getExtensionsConfigs=E,this.getRecommendations=E,this.getUnwantedRecommendations=E,this.toggleRecommendation=E,this.toggleUnwantedRecommendation=E}},0);ce(Ol,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(oce,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(bd,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(J6,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(X6,class{async hasBackups(){return!1}hasBackupSync(){return!1}async getBackups(){return[]}async resolve(){}async backup(){}async discardBackup(){}async discardBackups(){}},0);ce(Pm,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(aE,class{constructor(){this.onDidChangeDecorations=M.None,this.registerDecorationsProvider=E,this.getDecoration=()=>{}}},0);ce(Q6,class{constructor(){this.isSupported=()=>!1,this.writeFileElevated=E}},0);ce(dg,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(MI,class{constructor(){this.write=E}},1);ce(RI,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(wce,class{constructor(){this.createTextEditor=E,this.resolveTextEditor=E}},0);ce(KU,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(_ce,class{constructor(){this.onActiveOutputChannel=M.None}getChannel(){}getChannelDescriptor(){}getChannelDescriptors(){return[]}getActiveChannel(){}async showChannel(){}},1);ce(cRt,class{constructor(){this.createOutputChannelModel=E}},1);ce(ice,class{constructor(){this.readExtensionResource=E,this.supportsExtensionGalleryResources=!1,this.isExtensionGalleryResource=()=>!1,this.getExtensionGalleryResourceURL=E}},0);ce(sLt,class{scanBuiltinExtensions(){return Promise.resolve([])}},0);ce(yf,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(V3,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(RXe,class{constructor(){this.onDidChangeEnablement=M.None}getDisabledExtensions(){return[]}enableExtension(){return Promise.resolve(!0)}disableExtension(){return Promise.resolve(!0)}},1);ce(MXe,class{async getAvailableLanguages(){return[]}async getInstalledLanguages(){return[]}async getBuiltInExtensionTranslationsUri(e,t){const i=fMt(t)?.[e];return i!=null?N.parse(i):void 0}},1);ce(ece,class{constructor(){this.removeDragOperationTransfer=E,this.addDragOperationTransfer=E}},1);ce(YLt,class{constructor(){this.register=E,this.getWidget=()=>{}}},0);ce(MZe,class{constructor(){this.onDidChange=M.None,this.canCreateOutline=()=>!1,this.createOutline=async()=>{},this.registerOutlineCreator=E}},0);ce(OXe,class{constructor(){this.onStateChange=M.None,this.state=_Lt.Uninitialized,this.checkForUpdates=E,this.downloadUpdate=E,this.applyUpdate=E,this.quitAndInstall=E,this.isLatestVersion=async()=>!0,this._applySpecificUpdate=E}},0);ce(yMe,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(LI,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(GU,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=yW.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 vct(this.instances,this.onDidCreateInstance,this.onDidDisposeInstance,e)}get configHelper(){return E()}},1);ce(mRt,class{constructor(){this.onConfigChanged=M.None,this.setPanelContainer=E,this.configFontIsMonospace=E,this.getFont=E}get config(){return E()}},1);ce(dZe,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(hZe,class{constructor(){this.getRegisteredBackends=()=>[].values(),this.onDidCreateInstance=M.None,this.convertProfileToShellLaunchConfig=E,this.createInstance=E,this.getBackend=E,this.didRegisterBackend=E}},1);ce(fZe,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(mLt,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(pZe,class{constructor(){this.linkProviders=new Set([]),this.onDidAddLinkProvider=M.None,this.onDidRemoveLinkProvider=M.None,this.registerLinkProvider=E}},1);ce(_Rt,class{constructor(){this.terminalProfiles=[]}},1);ce(gZe,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(uZe,class{constructor(){this.collections=new Map,this.onDidChangeCollections=M.None,this.set=E,this.delete=E}get mergedCollection(){return E()}},1);ce(mZe,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(KRt,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(BXe,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(NRt,class{constructor(){this.addKeybinding=E,this.editKeybinding=E,this.removeKeybinding=E,this.resetKeybinding=E}},1);ce(lRt,class{constructor(){this.getLocalSearchProvider=E,this.getRemoteSearchProvider=E}},1);ce(oE,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(dRt,class{constructor(){this.replace=E,this.openReplacePreview=E,this.updateReplacePreview=E}},1);ce(gRt,class{constructor(){this.onDidClearHistory=M.None,this.clearHistory=E,this.load=E,this.save=E}},1);ce($6,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(hRt,class{get searchModel(){return E()}},1);ce(dce,class{constructor(){this.onDidSaveNotebook=M.None,this.onDidChangeDirty=M.None,this.onWillFailWithConflict=M.None,this.isDirty=E,this.resolve=E}},1);ce(OZe,class{constructor(){this.onDidRegisterHandler=M.None,this.registerHandler=()=>V.None,this.findEditor=()=>{}}},1);ce(NMe,class{constructor(){this.isActive=!1,this.onDidChangeIsActive=M.None,this.markActive=E}},1);ce(mMe,class{constructor(){this.registerCanonicalUriProvider=E}},1);ce(CMe,class{constructor(){this.onDidChange=M.None}setOrUpdateEntry(){return 1}unsetEntry(){}getEntries(){return[]}},1);ce(SZe,class{constructor(){this.getCurrentExperiments=async()=>[],this.getTreatment=async()=>{}}},1);ce(Lm,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(WZe,class{constructor(){this.update=E}},1);ce(JLt,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(wf,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(lce,class{getAgentNameRestriction(){return!0}},1);ce(ORt,class{constructor(){this.onDidCreateTerminal=M.None,this.createTerminal=E}},1);ce(AMe,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(gce,class{constructor(){this.webviews=[],this.onDidChangeActiveWebview=M.None,this.createWebviewElement=E,this.createWebviewOverlay=E}},1);ce(yZe,class{constructor(){this.onNewResolverRegistered=M.None,this.register=E,this.resolve=E}},1);ce(LZe,class{constructor(){this.setLocale=E}clearLocalePreference(){return Promise.resolve()}},1);ce(K6,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(bC,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(ZXe,class{constructor(){this.registerExternalOpenerProvider=()=>V.None,this.getOpener=async()=>{}}},1);ce(Tm,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(aMt,class{constructor(){this.hasShownAccessibleView=()=>!1}},1);ce(q6,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(Rm,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(Oae,class{isWorkspaceTrustEnabled(){return!1}},1);ce(sce,class{whenExtensionsReady(){throw new Error("Method not implemented.")}async scanExtensions(){return[]}async scanSingleExtension(){return null}},1);ce(ace,class{constructor(){this.create=E,this.open=async()=>!1,this.registerHandler=E}},1);ce(fMe,class{constructor(){this.register=E,this.connect=E}},1);ce(G6,class{constructor(){this.onDidChangeQuickDiffProviders=M.None,this.addQuickDiffProvider=E,this.getQuickDiffs=E}},1);ce(kMe,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(gMe,class{constructor(){this.download=E}},1);ce(TZe,class{constructor(){this.registerExtensionHandler=E,this.unregisterExtensionHandler=E}},1);ce(rE,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(nZe,class{constructor(){this.onDidChangeProviders=M.None,this.onDidChangeItems=M.None,this.registerCellStatusBarItemProvider=E,this.getStatusBarItemsForCell=E}},1);ce(rZe,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(oZe,class{constructor(){this.onShouldPostMessage=M.None,this.prepare=E,this.getScoped=E,this.receiveMessage=E}},1);ce(tZe,class{constructor(){this.addToHistory=E,this.getPreviousValue=E,this.getNextValue=E,this.replaceLast=E,this.clearHistory=E,this.has=E}},1);ce(DMe,class{constructor(){this.onWillAddInteractiveDocument=M.None,this.onWillRemoveInteractiveDocument=M.None,this.willCreateInteractiveDocument=E,this.willRemoveInteractiveDocument=E}},1);ce(FRt,class{async getExtensionIdProvidingCurrentLocale(){return pMt()}},0);ce(HRt,class{constructor(){this.getRemoteProfiles=async()=>[],this.getRemoteProfile=E}},0);ce(qU,class{constructor(){this.isDisabledByBisect=()=>!1,this.isActive=!1,this.disabledCount=0,this.start=E,this.next=E,this.reset=E}},0);ce(DLt,class{constructor(){this.onTokenFailed=M.None,this.account=void 0,this.onDidChangeAccount=M.None}updateAccount(){return Promise.resolve()}},0);ce(qN,class{constructor(){this.getWidgetBySessionId=()=>{},this.lastFocusedWidget=void 0,this.revealViewForProvider=E,this.getWidgetByInputUri=E}},1);ce(vce,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(LMe,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(fce,class{constructor(){this.onDidChangeExtensionSessionAccess=M.None,this.isAccessAllowed=()=>!1,this.readAllowedExtensions=()=>[],this.updateAllowedExtensions=E,this.removeAllowedExtensions=E}},1);ce(EZe,class{constructor(){this.updateSessionPreference=E,this.getSessionPreference=()=>{},this.removeSessionPreference=E,this.selectSession=E,this.requestSessionAccess=E,this.requestNewSession=E}},1);ce(AZe,class{constructor(){this.readAccountUsages=E,this.removeAccountUsage=E,this.addAccountUsage=E}},1);ce(wZe,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(bZe,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(PXe,class{constructor(){this.onDidChangeSecret=M.None,this.type="in-memory",this.get=async()=>{},this.set=E,this.delete=E}},1);ce(cZe,class{constructor(){this.registerShareProvider=E,this.getShareActions=()=>[],this.provideShare=async()=>{}}},1);ce(FZe,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(MRt,class{constructor(){this.registerIssueDataProvider=E,this.openReporter=E,this.openProcessExplorer=E,this.registerIssueUriRequestHandler=E}},1);ce(aZe,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(sZe,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(_Ze,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(eLt,class{constructor(){this.setUsePlainTextEncryption=E,this.getKeyStorageProvider=E,this.encrypt=E,this.decrypt=E,this.isEncryptionAvailable=E}},1);ce(vZe,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(wRt,class{constructor(){this.read=E,this.persist=E}},1);ce(CRt,class{constructor(){this.onDidChange=M.None,this.invalidateResultMessage=E,this.syncDecorations=E,this.getDecoratedTestPosition=E}},1);ce(yce,class{constructor(){this.requiresInitialization=async()=>!1,this.whenInitializationFinished=async()=>{},this.initializeRequiredResources=async()=>{},this.initializeInstalledExtensions=async()=>{},this.initializeOtherResources=async()=>{}}},1);ce(ZTt,XTt,1);ce(uRt,class{notebookSearch(){return{openFilesToScan:new Mk,completeData:Promise.resolve({results:[],messages:[]}),allScannedFiles:Promise.resolve(new Mk)}}},1);ce(JXe,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(SMe,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(z6,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(TMe,class{constructor(){this.isEnabled=()=>!1,this.getRelatedInformation=E,this.registerAiRelatedInformationProvider=E}},1);ce(CZe,class{constructor(){this.isEnabled=()=>!1,this.getEmbeddingVector=E,this.registerAiEmbeddingVectorProvider=E}},1);ce(FXe,(EK=class{async createNewMessage(e){return{id:String(EK._nextId++),data:e}}async validate(){return!0}async sign(e){return e}},EK._nextId=1,EK),1);ce(yRt,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(bRt,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(SRt,class{constructor(){this.tryPeekFirstError=E,this.peekUri=E,this.openCurrentInEditor=E,this.open=E,this.closeAllPeeks=E}get historyVisible(){return E()}},1);ce(xZe,class{constructor(){this.getWindow=()=>{},this.onDidOpenAuxiliaryWindow=M.None,this.hasWindow=()=>!1,this.open=E}},1);ce(uce,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(vRt,class{constructor(){this.openCoverage=E,this.closeCoverage=E}get showInline(){return E()}get filterToTest(){return E()}get selected(){return E()}},1);ce(jXe,class{constructor(){this.acceptRequest=E,this.acceptResponse=E}},1);ce(YXe,class{constructor(){this.onDidClearHistory=M.None,this.clearHistory=E,this.getHistory=()=>[],this.saveHistory=E}},1);ce(XLt,class{constructor(){this.providers=[],this.registerProvider=()=>V.None}},1);ce(xMe,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(aRt,class{constructor(){this.canComputeDiff=()=>!1,this.computeDiff=E,this.canPromptRecommendation=async()=>!1}},1);ce(nRt,class{constructor(){this.getKernels=E,this.addMostRecentKernel=E}},1);ce(iRt,class{constructor(){this.executeNotebookCells=E,this.cancelNotebookCells=E,this.cancelNotebookCellHandles=E,this.registerExecutionParticipant=E}},1);ce(sRt,class{},1);ce(rRt,class{constructor(){this.info=E,this.debug=E}},1);ce(ERt,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(bLt,class{constructor(){this.onDidChangeUserDataSyncStore=M.None,this.userDataSyncStore=void 0,this.switch=E,this.getPreviousUserDataSyncStore=E}},1);ce(wLt,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(xLt,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(CLt,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(kLt,class{constructor(){this.onDidChange=M.None,this.getMachines=E,this.addCurrentMachine=E,this.removeCurrentMachine=E,this.renameMachine=E,this.setEnablements=E}},1);ce(SLt,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(yLt,class{constructor(){this.writeResource=E,this.getAllResourceRefs=E,this.resolveResourceContent=E}},1);ce(ELt,class{constructor(){this.resolveDefaultCoreIgnoredSettings=async()=>[],this.resolveUserBindings=E,this.resolveFormattingOptions=E,this.resolveDefaultIgnoredSettings=E}},1);ce(URt,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(qRt,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(eZe,class{constructor(){this.markChanged=E}},1);ce(RZe,class{constructor(){this.getNotebook=()=>{},this.addNotebookDocument=E,this.removeNotebookDocument=E}},1);ce(XXe,class{constructor(){this.registerTree=E,this.getVisualizedNodeFor=E,this.getVisualizedChildren=E,this.editTreeItem=E,this.getApplicableFor=E,this.register=E}},1);ce(eRt,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(ZLt,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(iZe,class{constructor(){this.registerResolver=()=>V.None,this.resolve=async()=>{}}},1);ce(pRt,fRt,1);ce(kZe,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(DZe,class{constructor(){this.onWillInstantiateEditorPane=M.None,this.didInstantiateEditorPane=()=>!1}},1);ce(QRt,class{constructor(){this.matches=E,this.getWorkspaceStateFolders=E}},1);ce(tRt,class{constructor(){this.onDidChangeDefaultLogLevels=M.None,this.getDefaultLogLevel=async()=>Kn.Off,this.getDefaultLogLevels=E,this.setDefaultLogLevel=E,this.migrateLogLevels=E}},1);ce(cE,class{constructor(){this.onDidChange=M.None,this.getName=()=>{}}},1);ce(LRt,class{constructor(){this.isActive=()=>!1,this.start=E,this.resume=E,this.stop=E}},1);ce(lMt,class{async isPure(){return{isPure:!1,proof:[]}}},1);ce(Sce,class{isValid(){return!1}},1);ce(HZe,class{constructor(){this.onDidChangeTools=M.None,this.registerToolData=E,this.registerToolImplementation=E,this.getTools=()=>[],this.invokeTool=E}},1);ce(RRt,class{constructor(){this.openReporter=E,this.reloadWithExtensionsDisabled=E,this.showConfirmCloseDialog=E,this.showClipboardDialog=E,this.sendReporterMenu=E,this.closeReporter=E}},1);const CMt="vscode://schemas/vscode-product",SMt={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"}},BM=Object.freeze(SMt),PMe=je.as(tE.JSONContribution);class AMt{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(Ze.Error,e)}warn(e){this._msg(Ze.Warning,e)}info(e){this._msg(Ze.Info,e)}}class z5{static _toSet(e){const t=new D_;for(let i=0,n=e.length;i!i.has(a.description.identifier)),o=e.filter(a=>!n.has(a.description.identifier));return new z5(r,o)}constructor(e,t){this.added=e,this.removed=t}}class EMt{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=z5.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 xMt={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.")]},UZe="vscode://schemas/vscode-extensions",rbe={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:mXe},{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(BM).map(s=>s),markdownEnumDescriptions:Object.values(BM).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:q3}},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:q3}},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:xMt,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 DMt{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw new Error("Duplicate extension point: "+e.extensionPoint);const t=new EMt(e.extensionPoint,e.defaultExtensionKind);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&nB.register(e.extensionPoint,e.activationEventsGenerator),rbe.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,PMe.registerSchema(UZe,rbe),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}}const VZe={ExtensionsRegistry:"ExtensionsRegistry"};je.add(VZe.ExtensionsRegistry,new DMt);const ih=je.as(VZe.ExtensionsRegistry);PMe.registerSchema(UZe,rbe);PMe.registerSchema(CMt,{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(BM),markdownEnumDescriptions:Object.values(BM).map(s=>s.proposal)}}]}}}});var ev;(function(s){s.ExtensionFeaturesRegistry="workbench.registry.extensionFeatures"})(ev||(ev={}));class kMt{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())}}je.add(ev.ExtensionFeaturesRegistry,new kMt);var hf;(function(s){s.Workbench="workbench.contributions.kind"})(hf||(hf={}));var Cc;(function(s){s[s.BlockStartup=1]="BlockStartup",s[s.BlockRestore=2]="BlockRestore",s[s.AfterRestored=3]="AfterRestored",s[s.Eventually=4]="Eventually"})(Cc||(Cc={}));function qHe(s){const e=s;return!!e&&typeof e.editorTypeId=="string"}function IMt(s){switch(s){case Ms.Restored:return Cc.AfterRestored;case Ms.Eventually:return Cc.Eventually}}function QHe(s){switch(s){case Cc.BlockStartup:return Ms.Starting;case Cc.BlockRestore:return Ms.Ready;case Cc.AfterRestored:return Ms.Restored;case Cc.Eventually:return Ms.Eventually}}const JE=class JE 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 hc,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"&&qHe(i)&&this.editorPaneService.didInstantiateEditorPane(i.editorTypeId))?this.safeCreateContribution(this.instantiationService,this.logService,this.environmentService,n,typeof i=="number"?QHe(i):this.lifecycleService.phase):(typeof i=="number"&&Pj(this.contributionsByPhase,QHe(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),qHe(i)&&Pj(this.contributionsByEditor,i.editorTypeId,[]).push(n)))}registerWorkbenchContribution(e,t){this.registerWorkbenchContribution2(void 0,e,IMt(t))}getWorkbenchContribution(e){if(this.instancesById.has(e))return this.instancesById.get(e);const t=this.instantiationService,i=this.lifecycleService,n=this.logService,r=this.environmentService;if(!t||!i||!n||!r)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): cannot be called before registry started`);const o=this.contributionsById.get(e);if(!o)throw new Error(`IWorkbenchContributionsRegistry#getContribution('${e}'): contribution with that identifier is unknown.`);i.phase{this.instanceDisposables.clear()}));for(const a of[Ms.Starting,Ms.Ready,Ms.Restored,Ms.Eventually])this.instantiateByPhase(t,i,n,r,a);for(const a of this.contributionsByEditor.keys())o.didInstantiateEditorPane(a)&&this.onEditor(a,t,i,n,r);this._register(o.onWillInstantiateEditorPane(a=>this.onEditor(a.typeId,t,i,n,r)))}onEditor(e,t,i,n,r){const o=this.contributionsByEditor.get(e);if(o){this.contributionsByEditor.delete(e);for(const a of o)this.safeCreateContribution(t,n,r,a,i.phase)}}instantiateByPhase(e,t,i,n,r){t.phase>=r?this.doInstantiateByPhase(e,i,n,r):t.when(r).then(()=>this.doInstantiateByPhase(e,i,n,r))}async doInstantiateByPhase(e,t,i,n){const r=this.contributionsByPhase.get(n);if(r)switch(this.contributionsByPhase.delete(n),n){case Ms.Starting:case Ms.Ready:{ls(`code/willCreateWorkbenchContributions/${n}`);for(const o of r)this.safeCreateContribution(e,t,i,o,n);ls(`code/didCreateWorkbenchContributions/${n}`);break}case Ms.Restored:case Ms.Eventually:{n===Ms.Eventually&&await this.pendingRestoredContributions.p,this.doInstantiateWhenIdle(r,e,t,i,n);break}}}doInstantiateWhenIdle(e,t,i,n,r){ls(`code/willCreateWorkbenchContributions/${r}`);let o=0;const a=r===Ms.Eventually?3e3:500,c=l=>{for(;o(r{for(const t of e){const i=t.value,n=t.collector,r=t.description.extensionLocation;if(!i||!Array.isArray(i)){n.error(g(674,"'configuration.jsonValidation' must be a array"));return}i.forEach(o=>{if(!Rt(o.fileMatch)&&!(Array.isArray(o.fileMatch)&&o.fileMatch.every(Rt))){n.error(g(675,"'configuration.jsonValidation.fileMatch' must be defined as a string or an array of strings."));return}const a=o.url;if(!Rt(a)){n.error(g(676,"'configuration.jsonValidation.url' must be a URL or relative path"));return}if(a.startsWith("./"))try{const c=Ft(r,a);Jy(c,r)||n.warn(g(677,"Expected `contributes.{0}.url` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",jHe.name,c.toString(),r.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 LMt 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(r=>[new Nt().appendMarkdown(`\`${Array.isArray(r.fileMatch)?r.fileMatch.join(", "):r.fileMatch}\``),r.url]);return{data:{headers:i,rows:n},dispose:()=>{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"jsonValidation",label:g(682,"JSON Validation"),access:{canToggle:!1},renderer:new yi(LMt)});var AB;let eX=(AB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(TMt)}},AB.ID="workbench.contrib.jsonValidationExtensionPoint",AB);eX=D([_(0,we)],eX);Ju(eX.ID,eX,Cc.BlockStartup);const obe=je.as(tLe.ColorContribution),xK=obe.getColorReferenceSchema(),zZe="^\\w+[.\\w+]*$",RMt=ih.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:zZe,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:[xK,{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:[xK,{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:[xK,{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:[xK,{type:"string",format:"color-hex"}]}},required:["light","dark"]}}}}});class MMt{constructor(){RMt.setHandler((e,t)=>{for(const i of t.added){const n=i.value,r=i.collector;if(!n||!Array.isArray(n)){r.error(g(691,"'configuration.colors' must be a array"));return}const o=(a,c)=>a.length>0?a[0]==="#"?me.Format.CSS.parseHex(a):a:(r.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){r.error(g(693,"'configuration.colors.id' must be defined and can not be empty"));return}if(!a.id.match(zZe)){r.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){r.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"){r.error(g(696,"'configuration.colors.defaults' must be defined and must contain 'light' and 'dark'"));return}if(c.highContrast&&typeof c.highContrast!="string"){r.error(g(697,"If defined, 'configuration.colors.defaults.highContrast' must be a string."));return}if(c.highContrastLight&&typeof c.highContrastLight!="string"){r.error(g(698,"If defined, 'configuration.colors.defaults.highContrastLight' must be a string."));return}obe.registerColor(a.id,{light:o(c.light,"configuration.colors.defaults.light"),dark:o(c.dark,"configuration.colors.defaults.dark"),hcDark:o(c.highContrast??c.dark,"configuration.colors.defaults.highContrast"),hcLight:o(c.highContrastLight??c.light,"configuration.colors.defaults.highContrastLight")},a.description)}}for(const i of t.removed){const n=i.value;for(const r of n)obe.deregisterColor(r.id)}})}}class NMt 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=o=>o[0]==="#"?me.fromHex(o):void 0,r=t.sort((o,a)=>o.id.localeCompare(a.id)).map(o=>[new Nt().appendMarkdown(`\`${o.id}\``),o.description,n(o.defaults.dark)??new Nt().appendMarkdown(`\`${o.defaults.dark}\``),n(o.defaults.light)??new Nt().appendMarkdown(`\`${o.defaults.light}\``),n(o.defaults.highContrast)??new Nt().appendMarkdown(`\`${o.defaults.highContrast}\``)]);return{data:{headers:i,rows:r},dispose:()=>{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"colors",label:g(704,"Colors"),access:{canToggle:!1},renderer:new yi(NMt)});var EB;let tX=(EB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(MMt)}},EB.ID="workbench.contrib.colorExtensionPoint",EB);tX=D([_(0,we)],tX);Ju(tX.ID,tX,Cc.BlockStartup);const bV=je.as(GJe.IconContribution),PMt=bV.getIconReferenceSchema(),$Ze=`^${He.iconNameSegment}(-${He.iconNameSegment})+$`,FMt=ih.registerExtensionPoint({extensionPoint:"icons",jsonSchema:{description:g(705,"Contributes extension defined themable icons"),type:"object",propertyNames:{pattern:$Ze,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:[PMt,{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 OMt{constructor(){FMt.setHandler((e,t)=>{for(const i of t.added){const n=i.value,r=i.collector;if(!n||typeof n!="object"){r.error(g(712,"'configuration.icons' must be an object with the icon names as properties."));return}for(const o in n){if(!o.match($Ze)){r.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[o];if(typeof a.description!="string"||a.description.length===0){r.error(g(714,"'configuration.icons.description' must be defined and can not be empty"));return}const c=a.default;if(typeof c=="string")bV.registerIcon(o,{id:c},a.description);else if(typeof c=="object"&&typeof c.fontPath=="string"&&typeof c.fontCharacter=="string"){const l=jy(c.fontPath).substring(1),d=BMt[l];if(!d){r.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=Ft(h,c.fontPath);if(!Jy(u,h)){r.warn(g(716,"Expected `contributes.icons.default.fontPath` ({0}) to be included inside extension's folder ({0}).",u.path,h.path));return}const f=WMt(i.description,c.fontPath),p=bV.registerIconFont(f,{src:[{location:u,format:d}]});bV.registerIcon(o,{fontCharacter:c.fontCharacter,font:{id:f,definition:p}},a.description)}else r.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 r in n)bV.deregisterIcon(r)}})}}const BMt={ttf:"truetype",woff:"woff",woff2:"woff2"};function WMt(s,e){return zi.join(s.identifier.value,e)}var xB;let iX=(xB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(OMt)}},xB.ID="workbench.contrib.iconExtensionPoint",xB);iX=D([_(0,we)],iX);Ju(iX.ID,iX,Cc.BlockStartup);const la=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 HMt extends di{constructor(){super({id:"menu.resetHiddenStates",title:Pe(4502,"Reset All Menus"),category:la.View,f1:!0})}run(e){e.get(Wa).resetHiddenStates(),e.get(Ke).info("did RESET all menu hidden states")}}Et(HMt);var UMt='.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}';gt(UMt,{});let uf=class extends Kk{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,r,o,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){mp(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};uf=D([_(4,we),_(5,qt),_(6,bi),_(7,Le),_(8,mn),_(9,wi),_(10,_o),_(11,zs),_(12,nt)],uf);var VMt=".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}";gt(VMt,{});const YHe=new me(new hn(0,122,204)),zMt={showArrow:!0,showFrame:!0,className:"",frameColor:YHe,arrowColor:YHe,keepEditorSelection:!1},$Mt="vs.editor.contrib.zoneWidget";class GMt{constructor(e,t,i,n,r,o,a,c){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=c,this._onDomNodeTop=r,this._onComputedHeight=o}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class KMt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const zse=class zse{constructor(e){this._editor=e,this._ruleName=zse._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),xS(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(){xS(this._ruleName),$f(`.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:si.NeverGrowsWhenTypingAtEdges}}])}hide(){this._decorations.clear()}};zse._IdGenerator=new PU(".arrow-decoration-");let abe=zse;class FMe{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=Ds(t),mp(this.options,zMt,!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 abe(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(Wc())}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:Kt.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: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(),n=this.editor.getLayoutInfo(),r=this._getWidth(n);this.domNode.style.width=`${r}px`,this.domNode.style.left=this._getLeft(n)+"px";const o=document.createElement("div");o.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 GMt(o,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 KMt($Mt+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,r),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,_t.Smooth):this.editor.revealRange(e,_t.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 Wd(this.domNode,this,{orientation:pi.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),r=e.heightInLines+n;r>5&&r<35&&this._relayout(r)}}))}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 GZe=ae("IPeekViewService");ce(GZe,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 og;(function(s){s.inPeekEditor=new Q("inReferenceSearchEditor",!0,g(5106,"Whether the current code editor is embedded inside peek")),s.notInPeekEditor=s.inPeekEditor.toNegated()})(og||(og={}));var DB;let nX=(DB=class{constructor(e,t){e instanceof uf&&og.inPeekEditor.bindTo(t)}dispose(){}},DB.ID="editor.contrib.referenceController",DB);nX=D([_(1,Le)],nX);on(nX.ID,nX,ai.Eager);function KZe(s){const e=s.get(qt).getFocusedCodeEditor();return e instanceof uf?e.getParentEditor():e}const qMt={headerBackgroundColor:me.white,primaryHeadingColor:me.fromHex("#333333"),secondaryHeadingColor:me.fromHex("#6c6c6cb3")};let Q3=class extends FMe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,mp(this.options,qMt,!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"),Rr(this._titleElement,"click",r=>this._onTitleClick(r))),oe(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=fe("span.filename"),this._secondaryHeading=fe("span.dirname"),this._metaHeading=fe("span.meta"),oe(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=fe(".peekview-actions");oe(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new gd(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new an("peekview.close",g(5107,"Close"),He.asClassName(ve.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:GN.bind(void 0,this.instantiationService),orientation:W_.HORIZONTAL}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Ns(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Xh(this._metaHeading)):Gd(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`)}};Q3=D([_(2,we)],Q3);const Ace=W("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},g(5108,"Background color of the peek view title area.")),OMe=W("peekViewTitleLabel.foreground",{dark:me.white,light:me.black,hcDark:me.white,hcLight:Pl},g(5109,"Color of the peek view title.")),BMe=W("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},g(5110,"Color of the peek view title info.")),WMe=W("peekView.border",{dark:bm,light:bm,hcDark:yt,hcLight:yt},g(5111,"Color of the peek view borders and arrow.")),QMt=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:Pl},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:Pl},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:Pl},g(5116,"Foreground color of the selected entry in the peek view result list."));const qZe=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",qZe,g(5118,"Background color of the gutter in the peek view editor."));W("peekViewEditorStickyScroll.background",qZe,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:Xs,hcLight:Xs},g(5122,"Match highlight border in the peek view editor."));class sI{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=c_e.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,vi(this.uri),this.range.startLineNumber,this.range.startColumn):g(5094,"in {0} on line {1} at column {2}",vi(this.uri),this.range.startLineNumber,this.range.startColumn)}}class jMt{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:r,endLineNumber:o,endColumn:a}=e,c=i.getWordUntilPosition({lineNumber:n,column:r-t}),l=new F(n,c.startColumn,n,r),d=new F(o,a,o,Vn.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 j3{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new gi}dispose(){wt(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}",vi(this.uri),this.uri.fsPath):g(5097,"{0} symbols in {1}, full path {2}",e,vi(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 jMt(i))}catch(i){bt(i)}return this}}class cf{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(cf._compareReferences);let n;for(const r of e)if((!n||!Dn.isEqual(n.uri,r.uri,!0))&&(n=new j3(this,r.uri),this.groups.push(n)),n.children.length===0||cf._compareReferences(r,n.children[n.children.length-1])!==0){const o=new sI(i===r,n,r,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(o),n.children.push(o)}}dispose(){wt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new cf(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 r=i.children.length,o=i.parent.groups.length;return o===1||t&&n+10?(t?n=(n+1)%r:n=(n+r-1)%r,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%o,i.parent.groups[n].children[0]):(n=(n+o-1)%o,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,r)=>({idx:r,prefixLen:Qy(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,r)=>n.prefixLen>r.prefixLen?-1:n.prefixLenr.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 Dn.compare(e.uri,t.uri)||F.compareRangesUsingStarts(e.range,t.range)}}var YMt=".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}";gt(YMt,{});var cbe;let lbe=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof cf||e instanceof j3}getChildren(e){if(e instanceof cf)return e.groups;if(e instanceof j3)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};lbe=D([_(0,pn)],lbe);class JMt{getHeight(){return 23}getTemplateId(e){return e instanceof j3?sX.id:rX.id}}let dbe=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof sI){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return vi(e.uri)}mightProducePrintableCharacter(e){return this._keybindingService.mightProducePrintableCharacter(e)}};dbe=D([_(0,Vt)],dbe);class XMt{getId(e){return e instanceof sI?e.id:e.uri}}let hbe=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 P3(i,{supportHighlights:!0})),this.badge=new K_e(oe(i,fe(".count")),{},lJe),e.appendChild(i)}set(e,t){const i=Ro(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))}};hbe=D([_(1,Os)],hbe);var xL;let sX=(xL=class{constructor(e){this._instantiationService=e,this.templateId=cbe.id}renderTemplate(e){return this._instantiationService.createInstance(hbe,e)}renderElement(e,t,i){i.set(e.element,NU(e.filterData))}disposeTemplate(e){e.dispose()}},cbe=xL,xL.id="FileReferencesRenderer",xL);sX=cbe=D([_(0,we)],sX);class ZMt extends V{constructor(e){super(),this.label=this._register(new uD(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(!i||!i.value)this.label.set(`${vi(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:n,highlight:r}=i;t&&!O_.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(n,NU(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(n,[r]))}}}const $se=class $se{constructor(){this.templateId=$se.id}renderTemplate(e){return new ZMt(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};$se.id="OneReferenceRenderer";let rX=$se;class eNt{getWidgetAriaLabel(){return g(11228,"References")}getAriaLabel(e){return e.ariaMessage}}const Gse=class Gse{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,r=e.children.length;n{const r=n.deltaDecorations([],t);for(let o=0;o{r.equals(S.Escape)&&(this._keybindingService.dispatchEvent(r,r.target),r.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(iNt,"ReferencesWidget",this._treeContainer,new JMt,[this._instantiationService.createInstance(sX),this._instantiationService.createInstance(rX)],this._instantiationService.createInstance(lbe),i),this._splitView.addView({onDidChange:M.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:r=>{this._preview.layout({height:this._dim.height,width:r})}},Xk.Distribute),this._splitView.addView({onDidChange:M.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:r=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${r}px`,this._tree.layout(this._dim.height,r)}},Xk.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(r,o)=>{r instanceof sI&&(o==="show"&&this._revealReference(r,!1),this._onDidSelectReference.fire({element:r,kind:o,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(r=>{r.sideBySide?n(r.element,"side"):r.editorOptions.pinned?n(r.element,"goto"):n(r.element,"show")})),Gd(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new wn(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"),Xh(this._messageContainer),Promise.resolve(void 0)):(Gd(this._messageContainer),this._decorationsManager=new ube(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"),Xh(this._treeContainer),Xh(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 sI)return e;if(e instanceof j3&&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(TA(e.uri),this._uriLabel.getUriLabel(Ro(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}wt(this._previewModelReference);const r=n.object;if(r){const o=this._preview.getModel()===r.textEditorModel?_t.Smooth:_t.Immediate,a=F.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(r.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,o)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};gbe=D([_(3,mn),_(4,pn),_(5,we),_(6,GZe),_(7,Os),_(8,iE),_(9,Vt),_(10,Di),_(11,zs)],gbe);var hQ;const QN=new Q("referenceSearchVisible",!1,g(4503,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var DL;let HM=(DL=class{static get(e){return e.getContribution(hQ.ID)}constructor(e,t,i,n,r,o,a,c){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=r,this._instantiationService=o,this._storageService=a,this._configurationService=c,this._disposables=new Z,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=QN.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 r="peekViewLayout",o=tNt.fromJSON(this._storageService.get(r,Ie.PROFILE,"{}"));this._widget=this._instantiationService.createInstance(gbe,this._editor,this._defaultTreeKeyboardSupport,o),this._widget.setTitle(g(4504,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(r,JSON.stringify(this._widget.layoutData),Ie.PROFILE,cn.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 re(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),r=this._editor.hasTextFocus(),o=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),r?this._editor.focus():this._widget&&o&&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:Lb.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 r=hQ.get(n),o=this._model.clone();this.closeWidget(),n.focus(),r?.toggleWidget(i,Mo(a=>Promise.resolve(o)),this._peekMode??!1)}},n=>{this._ignoreModelChangeEvent=!1,bt(n)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:r}=e;this._editorService.openCodeEditor({resource:n,options:{selection:r,selectionSource:Lb.JUMP,pinned:i}},this._editor,t)}},hQ=DL,DL.ID="editor.contrib.referencesController",DL);HM=hQ=D([_(2,Le),_(3,qt),_(4,wi),_(5,we),_(6,Gi),_(7,Te)],HM);function jN(s,e){const t=KZe(s);if(!t)return;const i=HM.get(t);i&&e(i)}Sr.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:Ae.EditorContrib,primary:oo(U.CtrlCmd|S.KeyK,S.F2),when:he.or(QN,og.inPeekEditor),handler(s){jN(s,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Sr.registerCommandAndKeybindingRule({id:"goToNextReference",weight:Ae.EditorContrib-10,primary:S.F4,secondary:[S.F12],when:he.or(QN,og.inPeekEditor),handler(s){jN(s,e=>{e.goToNextOrPreviousReference(!0)})}});Sr.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:Ae.EditorContrib-10,primary:U.Shift|S.F4,secondary:[U.Shift|S.F12],when:he.or(QN,og.inPeekEditor),handler(s){jN(s,e=>{e.goToNextOrPreviousReference(!1)})}});vt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");vt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");vt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");vt.registerCommand("closeReferenceSearch",s=>jN(s,e=>e.closeWidget()));Sr.registerKeybindingRule({id:"closeReferenceSearch",weight:Ae.EditorContrib-101,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(og.inPeekEditor,he.not("config.editor.stablePeek"))});Sr.registerKeybindingRule({id:"closeReferenceSearch",weight:Ae.WorkbenchContrib+50,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(QN,he.not("config.editor.stablePeek"),he.or(J.editorTextFocus,TRe.negate()))});Sr.registerCommandAndKeybindingRule({id:"revealReference",weight:Ae.WorkbenchContrib,primary:S.Enter,mac:{primary:S.Enter,secondary:[U.CtrlCmd|S.DownArrow]},when:he.and(QN,zae,NRe.negate(),PRe.negate()),handler(s){const t=s.get(ug).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof sI&&jN(s,i=>i.revealReference(t[0]))}});Sr.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Enter,mac:{primary:U.WinCtrl|S.Enter},when:he.and(QN,zae,NRe.negate(),PRe.negate()),handler(s){const t=s.get(ug).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof sI&&jN(s,i=>i.openReference(t[0],!0,!0))}});vt.registerCommand("openReference",s=>{const t=s.get(ug).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof sI&&jN(s,i=>i.openReference(t[0],!1,!0))});let fbe=class extends HM{constructor(e,t,i,n,r,o,a){super(!1,e,t,i,n,r,o,a)}};fbe=D([_(1,Le),_(2,qt),_(3,wi),_(4,we),_(5,Gi),_(6,Te)],fbe);on(HM.ID,fbe,ai.Lazy);const TFe=class TFe 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)}))}};TFe.ID="editor.contrib.menuPreventer";let BA=TFe;on(BA.ID,BA,ai.BeforeFirstInteraction);let Y3=class extends yp{constructor(e,t,i,n,r,o,a,c,l){super(e,n.getRawOptions(),i,r,o,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){mp(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Y3=D([_(4,Le),_(5,we),_(6,qt),_(7,uv),_(8,nE)],Y3);const Z6=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 QZe extends _d{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(){Ns(this._domNode),this._domNode.style.backgroundColor=ime(yy,$e(Uc)),this._domNode.style.color=ime(EM,$e(Pl)),this._domNode.style.border=`1px solid ${$e(yt)}`,oe(this._domNode,fe("")).textContent=this.label,this.onclick(this._domNode,()=>this._onClick.fire())}}let oX=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(vC(this.menu,{renderShortTitle:!0,shouldForwardArgs:!0},i),i.length===0)return;const[n]=i,r=this.createWidget(n,e);e.add(r),e.add(r.onClick(()=>n.run(this.getActionArg()))),r.render()};this._register(this.menu.onDidChange(t)),t()}getActionArg(){}isVisible(){return!0}};oX=D([_(1,Wa),_(2,Le)],oX);let JHe=class extends oX{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(QZe,e.label),n=i.getDomNode();return this.options.container.appendChild(n),t.add(Ee(()=>n.remove())),i}getActionArg(){return this.options.getActionArg()}};JHe=D([_(1,we),_(2,Wa),_(3,Le)],JHe);var uQ,VD;let XHe=(VD=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),jo(t)?this.doHighlightRange(t,e):K2(t)&&jo(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&&Yi(t,e.resource)&&jo(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===Bi.NotSet||t.reason===Bi.Explicit||t.reason===Bi.Undo||t.reason===Bi.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?uQ._WHOLE_LINE_RANGE_HIGHLIGHT:uQ._RANGE_HIGHLIGHT}dispose(){super.dispose(),this.editor?.getModel()&&(this.removeHighlightRange(),this.editor=null)}},uQ=VD,VD._WHOLE_LINE_RANGE_HIGHLIGHT=Kt.register({description:"codeeditor-range-highlight-whole",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight",isWholeLine:!0}),VD._RANGE_HIGHLIGHT=Kt.register({description:"codeeditor-range-highlight",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight"}),VD);XHe=uQ=D([_(0,ti)],XHe);let aX=class extends QZe{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:Vg.BOTTOM_RIGHT_CORNER}}render(){super.render(),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}};aX=D([_(3,Vt)],aX);var kB;let ZHe=(kB=class extends oX{constructor(e,t,i,n){super(_e.EditorContent,i,n),this.editor=e,this.instantiationService=t,this.render()}createWidget(e){return this.instantiationService.createInstance(aX,this.editor,e.label,e.id)}isVisible(){return!(this.editor instanceof uf)&&this.editor?.hasModel()&&!this.editor.getOption(x.inDiffEditor)}getActionArg(){return this.editor.getModel()?.uri}},kB.ID="editor.contrib.floatingClickMenu",kB);ZHe=D([_(1,we),_(2,Wa),_(3,Le)],ZHe);Object.freeze({id:"application",order:100,title:g(4506,"Application"),type:"object"});const eG=Object.freeze({id:"workbench",order:7,title:g(4507,"Workbench"),type:"object"}),nNt=Object.freeze({id:"security",scope:ct.APPLICATION,title:g(4508,"Security"),type:"object",order:7}),sNt=Object.freeze({id:"problems",title:g(4509,"Problems"),type:"object",order:101}),jZe=Object.freeze({id:"window",order:8,title:g(4510,"Window"),type:"object"}),Fm={ConfigurationMigration:"base.contributions.configuration.migration"};class rNt{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new I,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}}const gQ=new rNt;je.add(Fm.ConfigurationMigration,gQ);var IB;let cX=(IB=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,gQ.migrations)})),this.migrateConfigurations(gQ.migrations),this._register(gQ.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",At.USER],["userLocal",At.USER_LOCAL],["userRemote",At.USER_REMOTE],["workspace",At.WORKSPACE],["workspaceFolder",At.WORKSPACE_FOLDER]]:[["user",At.USER],["userLocal",At.USER_LOCAL],["userRemote",At.USER_REMOTE],["workspace",At.WORKSPACE]];for(const[r,o]of n){const a=i[r];if(!a)continue;const c=[];if(a.value!==void 0){const l=await this.runMigration(e,r,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,r,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},o)))}}async runMigration(e,t,i,n,r){const o=c=>{const d=this.configurationService.inspect(c,{resource:n})[t];if(d)return r?d.overrides?.find(({identifiers:h})=>Js(h,r))?.value:d.value},a=await e.migrateFn(i,o);return Array.isArray(a)?a:[[e.key,a]]}},IB.ID="workbench.contrib.configurationMigration",IB);cX=D([_(0,Te),_(1,Ci)],cX);var TB;let lX=(TB=class extends V{constructor(e){super(),this.remoteAgentService=e,this._ready=new hc,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!jn&&(await this.remoteAgentService.getEnvironment())?.os!==ks.Windows)return;je.as(Pn.Configuration).registerConfiguration({...nNt,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:ct.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:ct.MACHINE}}})}},TB.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration",TB);lX=D([_(0,fg)],lX);const k4="window.newWindowProfile";var LB;let dX=(LB=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!==At.DEFAULT&&i.affectsConfiguration(k4)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){const e=je.as(Pn.Configuration),t={...jZe,properties:{[k4]:{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:ct.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){const e=this.configurationService.getValue(k4);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){const e=this.configurationService.getValue(k4);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(k4,t?.name)}},LB.ID="workbench.contrib.dynamicWindowConfiguration",LB);dX=D([_(0,km),_(1,Te)],dX);class oNt extends di{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 YZe extends di{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 JZe extends di{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 tG=Pe(4979,"Diff Editor");class aNt extends mf{constructor(){super({id:"diffEditor.switchSide",title:Pe(4980,"Switch Side"),icon:ve.arrowSwap,precondition:he.has("isInDiffEditor"),f1:!0,category:tG})}runEditorCommand(e,t,i){const n=QU(e);if(n instanceof yp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class cNt extends mf{constructor(){super({id:"diffEditor.exitCompareMove",title:Pe(4981,"Exit Compare Move"),icon:ve.close,precondition:J.comparingMovedCode,f1:!1,category:tG,keybinding:{weight:1e4,primary:S.Escape}})}runEditorCommand(e,t,...i){const n=QU(e);n instanceof yp&&n.exitCompareMove()}}class lNt extends mf{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Pe(4982,"Collapse All Unchanged Regions"),icon:ve.fold,precondition:he.has("isInDiffEditor"),f1:!0,category:tG})}runEditorCommand(e,t,...i){const n=QU(e);n instanceof yp&&n.collapseAllUnchangedRegions()}}class dNt extends mf{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Pe(4983,"Show All Unchanged Regions"),icon:ve.unfold,precondition:he.has("isInDiffEditor"),f1:!0,category:tG})}runEditorCommand(e,t,...i){const n=QU(e);n instanceof yp&&n.showAllUnchangedRegions()}}class pbe extends di{constructor(){super({id:"diffEditor.revert",title:Pe(4984,"Revert"),f1:!1,category:tG})}run(e,t){const i=hNt(e,t.originalUri,t.modifiedUri);i instanceof yp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const XZe=Pe(4985,"Accessible Diff Viewer"),Kse=class Kse extends di{constructor(){super({id:Kse.id,title:Pe(4986,"Go to Next Difference"),category:XZe,precondition:he.has("isInDiffEditor"),keybinding:{primary:S.F7,weight:Ae.EditorContrib},f1:!0})}run(e){QU(e)?.accessibleDiffViewerNext()}};Kse.id="editor.action.accessibleDiffViewer.next";let SW=Kse;const qse=class qse extends di{constructor(){super({id:qse.id,title:Pe(4987,"Go to Previous Difference"),category:XZe,precondition:he.has("isInDiffEditor"),keybinding:{primary:U.Shift|S.F7,weight:Ae.EditorContrib},f1:!0})}run(e){QU(e)?.accessibleDiffViewerPrev()}};qse.id="editor.action.accessibleDiffViewer.prev";let J3=qse;function hNt(s,e,t){return s.get(qt).listDiffEditors().find(r=>{const o=r.getModifiedEditor(),a=r.getOriginalEditor();return o&&o.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function QU(s){const t=s.get(qt).listDiffEditors(),i=Wc();if(i)for(const n of t){const r=n.getContainerDomNode();if(uNt(r,i))return n}return null}function uNt(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}var Wb;(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"})(Wb||(Wb={}));var Sm;(function(s){s.Help="help",s.View="view"})(Sm||(Sm={}));var eUe;(function(s){s.Previous="previous",s.Next="next"})(eUe||(eUe={}));class ZZe extends V{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(),this.id=e,this.options=t,this.provideContent=i,this.onClose=n,this.verbositySettingKey=r,this.onOpen=o,this.actions=a,this.provideNextContent=c,this.providePreviousContent=l,this.onDidChangeContent=d,this.onKeyDown=h,this.getSymbols=u,this.onDidRequestClearLastProvider=f}}const gNt=new Q("hasSpeechProvider",!1,{type:"boolean",description:g(6234,"A speech provider is registered to the speech service.")}),fNt=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 yF;(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"})(yF||(yF={}));var mbe;(function(s){s[s.Started=1]="Started",s[s.Stopped=2]="Stopped",s[s.Error=3]="Error"})(mbe||(mbe={}));var tUe;(function(s){s[s.Recognized=1]="Recognized",s[s.Stopped=2]="Stopped",s[s.Canceled=3]="Canceled"})(tUe||(tUe={}));var sB;(function(s){s.SpeechTimeout="accessibility.voice.speechTimeout",s.AutoSynthesize="accessibility.voice.autoSynthesize",s.SpeechLanguage="accessibility.voice.speechLanguage"})(sB||(sB={}));sB.SpeechLanguage;const pNt={"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)")}},WA=new Q("accessibilityHelpIsShown",!1,!0),Cp=new Q("accessibleViewIsShown",!1,!0),hX=new Q("accessibleViewSupportsNavigation",!1,!0),iUe=new Q("accessibleViewVerbosityEnabled",!1,!0),nUe=new Q("accessibleViewGoToSymbolSupported",!1,!0);new Q("accessibleViewOnLastLine",!1,!0);const uX=new Q("accessibleViewCurrentProviderId",void 0,void 0);new Q("accessibleViewInCodeBlock",void 0,void 0);const gX=new Q("accessibleViewContainsCodeBlocks",void 0,void 0),sUe=new Q("accessibleViewHasUnassignedKeybindings",void 0,void 0),rUe=new Q("accessibleViewHasAssignedKeybindings",void 0,void 0);var _be;(function(s){s.DimUnfocusedEnabled="accessibility.dimUnfocused.enabled",s.DimUnfocusedOpacity="accessibility.dimUnfocused.opacity",s.HideAccessibleView="accessibility.hideAccessibleView",s.AccessibleViewCloseOnKeyPress="accessibility.accessibleView.closeOnKeyPress"})(_be||(_be={}));var oUe;(function(s){s[s.Default=.75]="Default",s[s.Minimum=.2]="Minimum",s[s.Maximum=1]="Maximum"})(oUe||(oUe={}));var bo;(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"})(bo||(bo={}));const Af={type:"boolean",default:!0,tags:["accessibility"]},eet=Object.freeze({id:"accessibility",title:g(4679,"Accessibility"),type:"object"}),za={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"]},yd={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto",announcement:"auto"}},Cd={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"]},qI={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto"}};({...eet,scope:ct.RESOURCE,properties:(bo.Terminal+"",{description:g(4685,"Provide information about how to access the terminal accessibility help menu when the terminal is focused."),...Af},bo.DiffEditor+"",{description:g(4686,"Provide information about how to navigate changes in the diff editor when it is focused."),...Af},bo.Chat+"",{description:g(4687,"Provide information about how to access the chat help menu when the chat input is focused."),...Af},bo.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."),...Af},bo.InlineCompletions+"",{description:g(4689,"Provide information about how to access the inline completions hover and Accessible View."),...Af},bo.KeybindingsEditor+"",{description:g(4690,"Provide information about how to change a keybinding in the keybindings editor when a row is focused."),...Af},bo.Notebook+"",{description:g(4691,"Provide information about how to focus the cell container or inner editor when a notebook cell is focused."),...Af},bo.Hover+"",{description:g(4692,"Provide information about how to open the hover in an Accessible View."),...Af},bo.Notification+"",{description:g(4693,"Provide information about how to open the notification in an Accessible View."),...Af},bo.EmptyEditorHint+"",{description:g(4694,"Provide information about relevant actions in an empty text editor."),...Af},bo.ReplInputHint+"",{description:g(4695,"Provide information about relevant actions For the Repl input."),...Af},bo.Comments+"",{description:g(4696,"Provide information about actions that can be taken in the comment widget or in a file which contains comments."),...Af},bo.DiffEditorActive+"",{description:g(4697,"Indicate when a diff editor becomes the active editor."),...Af},bo.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."),...Af},_be.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."),{...yd,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."),...za},{description:g(4710,"Announces when the active line has a breakpoint."),...Cd})},{...qI,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."),...za}},{...yd,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."),...za},{description:g(4715,"Announces when the active line has an error."),...Cd})},{...yd,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."),...za},{description:g(4718,"Announces when the active line has a folded area that can be unfolded."),...Cd})},{...yd,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."),...za},{description:g(4721,"Announces when the active line has a warning."),...Cd})},{...yd,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."),...za},{description:g(4724,"Announces when the active line has a warning."),...Cd})},{...yd,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."),...za},{description:g(4727,"Announces when the active line has a warning."),...Cd})},{...yd,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."),...za},{description:g(4730,"Announces when the debugger stopped on a breakpoint."),...Cd})},{...yd,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."),...za},{description:g(4733,"Announces when trying to read a line with inlay hints that has no inlay hints."),...Cd})},{...yd,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."),...za},{description:g(4736,"Announces when a task is completed."),...Cd})},{...yd,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)."),...za},{description:g(4739,"Announces when a task fails (non-zero exit code)."),...Cd})},{...yd,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."),...za},{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."),...Cd})},{...yd,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."),...za},{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."),...Cd})},{...yd,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."),...za},{description:g(4748,"Announces when terminal Quick Fixes are available."),...Cd})},{...yd,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."),...za},{description:g(4751,"Announces when the terminal bell is ringing."),...Cd})},{...qI,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."),...za}},{...qI,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."),...za}},{...qI,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."),...za}},{...yd,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."),...za},{description:g(4760,"Announces when a notebook cell execution is successfully completed."),...Cd})},{...yd,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."),...za},{description:g(4763,"Announces when a notebook cell execution fails."),...Cd})},{...yd,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."),...za},{description:g(4766,"Announces when a chat request is made."),...Cd})},{...yd,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."),...za},{description:g(4769,"Alerts on loop while progress is occurring."),...Cd})},{...qI,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."),...za}},{...qI,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."),...za}},{...qI,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."),...za}},{...yd,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."),...za},{description:g(4778,"Announces when a feature is cleared."),...Cd})},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 mNt=1200;var RB;let aUe=(RB=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,r)=>e[n].name.localeCompare(e[r].name));je.as(Pn.Configuration).registerConfiguration({...eet,properties:{[sB.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:mNt,minimum:0,tags:["accessibility"]},[sB.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)},[sB.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)")},...pNt}}},RB.ID="workbench.contrib.dynamicSpeechAccessibilityConfiguration",RB);aUe=D([_(0,uce),_(1,xo)],aUe);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.volume",migrateFn:(s,e)=>[["accessibility.signalOptions.volume",{value:s}],["audioCues.volume",{value:void 0}]]}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.debouncePositionChanges",migrateFn:s=>[["accessibility.signalOptions.debouncePositionChanges",{value:s}],["audioCues.debouncePositionChanges",{value:void 0}]]}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signalOptions",migrateFn:(s,e)=>{const t=lue(e,"general"),i=lue(e,"errorAtPosition"),n=lue(e,"warningAtPosition"),r=_Nt(e),o=vNt(e);return[["accessibility.signalOptions.volume",{value:r}],["accessibility.signalOptions.debouncePositionChanges",{value:o}],["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}]]}}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.sounds.volume",migrateFn:s=>[["accessibility.signalOptions.volume",{value:s}],["accessibility.signals.sounds.volume",{value:void 0}]]}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.debouncePositionChanges",migrateFn:s=>[["accessibility.signalOptions.debouncePositionChanges",{value:s}],["accessibility.signals.debouncePositionChanges",{value:void 0}]]}]);function lue(s,e){return s(`accessibility.signalOptions.experimental.delays.${e}`)||s("accessibility.signalOptions")?.["experimental.delays"]?.[`${e}`]||s("accessibility.signalOptions")?.delays?.[`${e}`]}function _Nt(s){return s("accessibility.signalOptions.volume")||s("accessibility.signalOptions")?.volume||s("accessibility.signals.sounds.volume")||s("audioCues.volume")}function vNt(s){return s("accessibility.signalOptions.debouncePositionChanges")||s("accessibility.signalOptions")?.debouncePositionChanges||s("accessibility.signals.debouncePositionChanges")||s("audioCues.debouncePositionChanges")}je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.chatResponsePending",migrateFn:(s,e)=>[["accessibility.signals.progress",{value:s}],["accessibility.signals.chatResponsePending",{value:void 0}]]}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations(ll.allAccessibilitySignals.map(s=>s.legacySoundSettingsKey?{key:s.legacySoundSettingsKey,migrateFn:(e,t)=>{const i=[],n=s.legacyAnnouncementSettingsKey;let r;return n&&(r=t(n)??void 0,r!==void 0&&typeof r!="string"&&(r=r?"auto":"off")),i.push([`${s.legacySoundSettingsKey}`,{value:void 0}]),i.push([`${s.settingsKey}`,{value:r!==void 0?{announcement:r,sound:e}:{sound:e}}]),i}}:void 0).filter(Oc));je.as(Fm.ConfigurationMigration).registerConfigurationMigrations(ll.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 eh;(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"})(eh||(eh={}));function bNt(s){const e=new Z,t=e.add(gqe());return e.add(ci(i=>{t.setStyle(s.read(i))})),e}const tet="editor.action.inlineSuggest.commit",iet="editor.action.inlineSuggest.showPrevious",net="editor.action.inlineSuggest.showNext";var wNt=".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}";gt(wNt,{});class X3{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 G2([...this.parts.map(i=>new lu(F.fromPositions(new re(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 G2([...this.parts.map(r=>new lu(F.fromPositions(new re(1,r.column)),r.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 fX{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=cv(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 vbe{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new fX(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=cv(this.text)}renderForScreenReader(e){return this.newLines.join(` `)}render(e,t=!1){const i=this.columnRange.toRange(this.lineNumber);return t?new G2([new lu(F.fromPositions(i.getStartPosition()),"("),new lu(F.fromPositions(i.getEndPosition()),`)[${this.newLines.join(` `)}]`)]).applyToString(e):new G2([new lu(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 cUe(s,e){return ns(s,e,set)}function set(s,e){return s===e?!0:!s||!e?!1:s instanceof X3&&e instanceof X3||s instanceof vbe&&e instanceof vbe?s.equals(e):!1}const yNt=[];function CNt(){return yNt}class ret{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Pi(`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 oet(s,e){const t=new Z,i=s.createDecorationsCollection();return t.add(T6({debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const r=e.read(n);i.set(r)})),t.add({dispose:()=>{i.clear()}}),t}function SNt(s,e){return new re(s.lineNumber+e.lineNumber-1,e.lineNumber===1?s.column+e.column-1:e.column)}function lUe(s,e){return new re(s.lineNumber-e.lineNumber+1,s.lineNumber-e.lineNumber===0?s.column-e.column+1:s.column)}const dUe="ghost-text";let bbe=class extends V{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=Yt(this,!1),this.currentTextModel=qn(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=et(this,n=>{if(this.isDisposed.read(n))return;const r=this.currentTextModel.read(n);if(r!==this.model.targetTextModel.read(n))return;const o=this.model.ghostText.read(n);if(!o)return;const a=o instanceof vbe?o.columnRange:void 0,c=[],l=[];function d(m,v){if(l.length>0){const b=l[l.length-1];v&&b.decorations.push(new iu(b.content.length+1,b.content.length+1+m[0].length,v,Xa.Regular)),b.content+=m[0],m=m.slice(1)}for(const b of m)l.push({content:b,decorations:v?[new iu(1,b.length+1,v,Xa.Regular)]:[]})}const h=r.getLineContent(o.lineNumber);let u,f=0;for(const m of o.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,dUe),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 ret(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:c,additionalLines:l,hiddenRange:p,lineNumber:o.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:r}}),this.decorations=et(this,n=>{const r=this.uiState.read(n);if(!r)return[];const o=[];r.replacedRange&&o.push({range:r.replacedRange.toRange(r.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),r.hiddenRange&&o.push({range:r.hiddenRange.toRange(r.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of r.inlineTexts)o.push({range:F.fromPositions(new re(r.lineNumber,a.column)),options:{description:dUe,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:S_.Left},showIfCollapsed:!0}});return o}),this.additionalLinesWidget=this._register(new aet(this.editor,this.languageService.languageIdCodec,et(n=>{const r=this.uiState.read(n);return r?{lineNumber:r.lineNumber,additionalLines:r.additionalLines,minReservedLineCount:r.additionalReservedLineCount,targetTextModel:r.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(oet(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};bbe=D([_(2,Di)],bbe);class aet 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=sd("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(ci(n=>{const r=this.lines.read(n);this.editorOptionsChanged.read(n),r?this.updateLines(r.lineNumber,r.additionalLines,r.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:r}=n.getOptions();this.editor.changeViewZones(o=>{this._viewZoneId&&(o.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const c=document.createElement("div");ANt(c,r,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=o.addZone({afterLineNumber:e,heightInLines:a,domNode:c,afterColumnAffinity:Ir.Right})}})}}function ANt(s,e,t,i,n){const r=i.get(x.disableMonospaceOptimizations),o=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 kU(1e4);u.appendString('

');for(let m=0,v=t.length;m');const y=X7(w),C=R2(w),A=pd.createEmpty(w,n);p6(new DI(d.isMonospace&&!r,d.canUseHalfwidthRightwardsArrow,w,!1,y,C,0,A,b.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,o,a,c,l!==Ok.OFF,null),u),u.appendString("
")}u.appendString(""),kl(s,d);const f=u.build(),p=hUe?hUe.createHTML(f):f;s.innerHTML=p}const hUe=ZA("editorGhostText",{createHTML:s=>s}),xw=class xw extends V{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=xw.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=xw.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=xw.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=xw.suppressSuggestions.bindTo(this.contextKeyService),this._register(ci(i=>{const r=this.model.read(i)?.state.read(i),o=!!r?.inlineCompletion&&r?.primaryGhostText!==void 0&&!r?.primaryGhostText.isEmpty();this.inlineCompletionVisible.set(o),r?.primaryGhostText&&r?.inlineCompletion&&this.suppressSuggestions.set(r.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(ci(i=>{const n=this.model.read(i);let r=!1,o=!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=Th(d);f===-1&&(f=d.length-1),r=f>0;const p=n.textModel.getOptions().tabSize;o=Qa.visibleColumnFromColumn(d,f+1,p)this.editor.getOption(x.inlineSuggest).showToolbar==="always"),this.sessionPosition=void 0,this.position=et(this,n=>{const r=this.model.read(n)?.primaryGhostText.read(n);if(!this.alwaysShowToolbar.read(n)||!r||r.parts.length===0)return this.sessionPosition=void 0,null;const o=r.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==r.lineNumber&&(this.sessionPosition=void 0);const a=new re(r.lineNumber,Math.min(o,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(du((n,r)=>{const o=this.model.read(n);if(!o||!this.alwaysShowToolbar.read(n))return;const a=TI((l,d)=>{const h=d.add(this.instantiationService.createInstance(AW,this.editor,!0,this.position,o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands));return e.addContentWidget(h),d.add(Ee(()=>e.removeContentWidget(h))),d.add(ci(u=>{this.position.read(u)&&o.lastTriggerKind.read(u)!==nm.Explicit&&o.triggerExplicitly()})),h}),c=L6(this,(l,d)=>!!this.position.read(l)||!!d);r.add(ci(l=>{c.read(l)&&a.read(l)}))}))}};wbe=D([_(2,we)],wbe);const xNt=oi("inline-suggestion-hints-next",ve.chevronRight,g(9866,"Icon for show next parameter hint.")),DNt=oi("inline-suggestion-hints-previous",ve.chevronLeft,g(9867,"Icon for show previous parameter hint."));var zD;let AW=(zD=class extends V{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new an(e,t,i,!0,()=>this._commandService.executeCommand(e)),r=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let o=t;return r&&(o=g(9868,"{0} ({1})",t,r.getLabel())),n.tooltip=o,n}constructor(e,t,i,n,r,o,a,c,l,d,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=r,this._extraCommands=o,this._commandService=a,this.keybindingService=l,this._contextKeyService=d,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${fQ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Wt("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Wt("div@toolBar")]),this.previousAction=this.createCommandAction(iet,g(9869,"Previous"),He.asClassName(DNt)),this.availableSuggestionCountAction=new an("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(net,g(9870,"Next"),He.asClassName(xNt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(_e.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new ln(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new ln(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.toolBar=this._register(c.createInstance(ybe,this.nodes.toolBar,_e.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,f)=>{if(u instanceof Ac)return c.createInstance(INt,u,void 0);if(u===this.availableSuggestionCountAction){const p=new kNt(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=>{fQ._dropDownVisible=u})),this._register(ci(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(ci(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(ci(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 Ac&&p.push(b);p.length>0&&p.unshift(new Eo),this.toolBar.setAdditionalSecondaryActions(p)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[ts.ABOVE,ts.BELOW],positionAffinity:Ir.LeftOfInjectedText}}},fQ=zD,zD._dropDownVisible=!1,zD.id=0,zD);AW=fQ=D([_(6,bi),_(7,we),_(8,Vt),_(9,Le),_(10,Ba)],AW);class kNt extends tC{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 INt=class extends Pb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Wt("div.keybinding").root;this._register(new Zk(t,pr,{disableTitle:!0,...OJe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},ybe=class extends mW{constructor(e,t,i,n,r,o,a,c,l){super(e,{resetMenu:t,...i},n,r,o,a,c,l),this.menuId=t,this.options2=i,this.menuService=n,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.updateToolbar()}updateToolbar(){const e=[],t=[];vC(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){ns(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){ns(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};ybe=D([_(3,Ba),_(4,Le),_(5,lo),_(6,Vt),_(7,bi),_(8,Ji)],ybe);function TNt(s,e){const t=new yje,i=new Sje(t,l=>e.getLanguageConfiguration(l)),n=new Cje(new LNt([s]),i),r=Mme(n,[],void 0,!0);let o="";const a=s.getLineContent();function c(l,d){if(l.kind===Gr.Pair)if(c(l.openingBracket,d),d=Lo(d,l.openingBracket.length),l.child&&(c(l.child,d),d=Lo(d,l.child.length)),l.closingBracket)c(l.closingBracket,d),d=Lo(d,l.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(l.openingBracket.languageId).findClosingTokenText(l.openingBracket.bracketIds);o+=u}else if(l.kind!==Gr.UnexpectedClosingBracket){if(l.kind===Gr.Text||l.kind===Gr.Bracket)o+=a.substring(d,Lo(d,l.length));else if(l.kind===Gr.List)for(const h of l.children)c(h,d),d=Lo(d,h.length)}}return c(r,nu),o}class LNt{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getValue(){return this.lines.map(e=>e.getLineContent()).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 cUe(s,e){return ns(s,e,set)}function set(s,e){return s===e?!0:!s||!e?!1:s instanceof X3&&e instanceof X3||s instanceof vbe&&e instanceof vbe?s.equals(e):!1}const yNt=[];function CNt(){return yNt}class ret{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Pi(`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 oet(s,e){const t=new Z,i=s.createDecorationsCollection();return t.add(T6({debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const r=e.read(n);i.set(r)})),t.add({dispose:()=>{i.clear()}}),t}function SNt(s,e){return new re(s.lineNumber+e.lineNumber-1,e.lineNumber===1?s.column+e.column-1:e.column)}function lUe(s,e){return new re(s.lineNumber-e.lineNumber+1,s.lineNumber-e.lineNumber===0?s.column-e.column+1:s.column)}const dUe="ghost-text";let bbe=class extends V{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=Yt(this,!1),this.currentTextModel=qn(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=et(this,n=>{if(this.isDisposed.read(n))return;const r=this.currentTextModel.read(n);if(r!==this.model.targetTextModel.read(n))return;const o=this.model.ghostText.read(n);if(!o)return;const a=o instanceof vbe?o.columnRange:void 0,c=[],l=[];function d(m,v){if(l.length>0){const b=l[l.length-1];v&&b.decorations.push(new iu(b.content.length+1,b.content.length+1+m[0].length,v,Xa.Regular)),b.content+=m[0],m=m.slice(1)}for(const b of m)l.push({content:b,decorations:v?[new iu(1,b.length+1,v,Xa.Regular)]:[]})}const h=r.getLineContent(o.lineNumber);let u,f=0;for(const m of o.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,dUe),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 ret(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:c,additionalLines:l,hiddenRange:p,lineNumber:o.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:r}}),this.decorations=et(this,n=>{const r=this.uiState.read(n);if(!r)return[];const o=[];r.replacedRange&&o.push({range:r.replacedRange.toRange(r.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),r.hiddenRange&&o.push({range:r.hiddenRange.toRange(r.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of r.inlineTexts)o.push({range:F.fromPositions(new re(r.lineNumber,a.column)),options:{description:dUe,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:S_.Left},showIfCollapsed:!0}});return o}),this.additionalLinesWidget=this._register(new aet(this.editor,this.languageService.languageIdCodec,et(n=>{const r=this.uiState.read(n);return r?{lineNumber:r.lineNumber,additionalLines:r.additionalLines,minReservedLineCount:r.additionalReservedLineCount,targetTextModel:r.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(oet(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};bbe=D([_(2,Di)],bbe);class aet 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=sd("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(ci(n=>{const r=this.lines.read(n);this.editorOptionsChanged.read(n),r?this.updateLines(r.lineNumber,r.additionalLines,r.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:r}=n.getOptions();this.editor.changeViewZones(o=>{this._viewZoneId&&(o.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const c=document.createElement("div");ANt(c,r,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=o.addZone({afterLineNumber:e,heightInLines:a,domNode:c,afterColumnAffinity:Ir.Right})}})}}function ANt(s,e,t,i,n){const r=i.get(x.disableMonospaceOptimizations),o=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 kU(1e4);u.appendString('
');for(let m=0,v=t.length;m');const y=X7(w),C=R2(w),A=pd.createEmpty(w,n);p6(new DI(d.isMonospace&&!r,d.canUseHalfwidthRightwardsArrow,w,!1,y,C,0,A,b.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,o,a,c,l!==Ok.OFF,null),u),u.appendString("
")}u.appendString(""),Il(s,d);const f=u.build(),p=hUe?hUe.createHTML(f):f;s.innerHTML=p}const hUe=ZA("editorGhostText",{createHTML:s=>s}),xw=class xw extends V{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=xw.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=xw.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=xw.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=xw.suppressSuggestions.bindTo(this.contextKeyService),this._register(ci(i=>{const r=this.model.read(i)?.state.read(i),o=!!r?.inlineCompletion&&r?.primaryGhostText!==void 0&&!r?.primaryGhostText.isEmpty();this.inlineCompletionVisible.set(o),r?.primaryGhostText&&r?.inlineCompletion&&this.suppressSuggestions.set(r.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(ci(i=>{const n=this.model.read(i);let r=!1,o=!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=Th(d);f===-1&&(f=d.length-1),r=f>0;const p=n.textModel.getOptions().tabSize;o=ja.visibleColumnFromColumn(d,f+1,p)this.editor.getOption(x.inlineSuggest).showToolbar==="always"),this.sessionPosition=void 0,this.position=et(this,n=>{const r=this.model.read(n)?.primaryGhostText.read(n);if(!this.alwaysShowToolbar.read(n)||!r||r.parts.length===0)return this.sessionPosition=void 0,null;const o=r.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==r.lineNumber&&(this.sessionPosition=void 0);const a=new re(r.lineNumber,Math.min(o,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(du((n,r)=>{const o=this.model.read(n);if(!o||!this.alwaysShowToolbar.read(n))return;const a=TI((l,d)=>{const h=d.add(this.instantiationService.createInstance(AW,this.editor,!0,this.position,o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands));return e.addContentWidget(h),d.add(Ee(()=>e.removeContentWidget(h))),d.add(ci(u=>{this.position.read(u)&&o.lastTriggerKind.read(u)!==nm.Explicit&&o.triggerExplicitly()})),h}),c=L6(this,(l,d)=>!!this.position.read(l)||!!d);r.add(ci(l=>{c.read(l)&&a.read(l)}))}))}};wbe=D([_(2,we)],wbe);const xNt=oi("inline-suggestion-hints-next",ve.chevronRight,g(9866,"Icon for show next parameter hint.")),DNt=oi("inline-suggestion-hints-previous",ve.chevronLeft,g(9867,"Icon for show previous parameter hint."));var zD;let AW=(zD=class extends V{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new an(e,t,i,!0,()=>this._commandService.executeCommand(e)),r=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let o=t;return r&&(o=g(9868,"{0} ({1})",t,r.getLabel())),n.tooltip=o,n}constructor(e,t,i,n,r,o,a,c,l,d,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=r,this._extraCommands=o,this._commandService=a,this.keybindingService=l,this._contextKeyService=d,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${fQ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Wt("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Wt("div@toolBar")]),this.previousAction=this.createCommandAction(iet,g(9869,"Previous"),He.asClassName(DNt)),this.availableSuggestionCountAction=new an("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(net,g(9870,"Next"),He.asClassName(xNt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(_e.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new ln(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new ln(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.toolBar=this._register(c.createInstance(ybe,this.nodes.toolBar,_e.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,f)=>{if(u instanceof Ac)return c.createInstance(INt,u,void 0);if(u===this.availableSuggestionCountAction){const p=new kNt(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=>{fQ._dropDownVisible=u})),this._register(ci(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(ci(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(ci(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 Ac&&p.push(b);p.length>0&&p.unshift(new Eo),this.toolBar.setAdditionalSecondaryActions(p)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[ts.ABOVE,ts.BELOW],positionAffinity:Ir.LeftOfInjectedText}}},fQ=zD,zD._dropDownVisible=!1,zD.id=0,zD);AW=fQ=D([_(6,bi),_(7,we),_(8,Vt),_(9,Le),_(10,Wa)],AW);class kNt extends tC{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 INt=class extends Pb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Wt("div.keybinding").root;this._register(new Zk(t,pr,{disableTitle:!0,...OJe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},ybe=class extends mW{constructor(e,t,i,n,r,o,a,c,l){super(e,{resetMenu:t,...i},n,r,o,a,c,l),this.menuId=t,this.options2=i,this.menuService=n,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.updateToolbar()}updateToolbar(){const e=[],t=[];vC(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){ns(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){ns(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};ybe=D([_(3,Wa),_(4,Le),_(5,lo),_(6,Vt),_(7,bi),_(8,Ji)],ybe);function TNt(s,e){const t=new yje,i=new Sje(t,l=>e.getLanguageConfiguration(l)),n=new Cje(new LNt([s]),i),r=Mme(n,[],void 0,!0);let o="";const a=s.getLineContent();function c(l,d){if(l.kind===Gr.Pair)if(c(l.openingBracket,d),d=Lo(d,l.openingBracket.length),l.child&&(c(l.child,d),d=Lo(d,l.child.length)),l.closingBracket)c(l.closingBracket,d),d=Lo(d,l.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(l.openingBracket.languageId).findClosingTokenText(l.openingBracket.bracketIds);o+=u}else if(l.kind!==Gr.UnexpectedClosingBracket){if(l.kind===Gr.Text||l.kind===Gr.Bracket)o+=a.substring(d,Lo(d,l.length));else if(l.kind===Gr.List)for(const h of l.children)c(h,d),d=Lo(d,h.length)}}return c(r,nu),o}class LNt{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(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"})(Zt||(Zt={}));const Zm=class Zm{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:Zt.EOF,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=Zm._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(Zm.isDigitCharacter(i)){n=Zt.Int;do t+=1,i=this.value.charCodeAt(e+t);while(Zm.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(Zm.isVariableCharacter(i)){n=Zt.VariableName;do i=this.value.charCodeAt(e+ ++t);while(Zm.isVariableCharacter(i)||Zm.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=Zt.Format;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Zm._table[i]>"u"&&!Zm.isDigitCharacter(i)&&!Zm.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};Zm._table={[B.DollarSign]:Zt.Dollar,[B.Colon]:Zt.Colon,[B.Comma]:Zt.Comma,[B.OpenCurlyBrace]:Zt.CurlyOpen,[B.CloseCurlyBrace]:Zt.CurlyClose,[B.Backslash]:Zt.Backslash,[B.Slash]:Zt.Forwardslash,[B.Pipe]:Zt.Pipe,[B.Plus]:Zt.Plus,[B.Dash]:Zt.Dash,[B.QuestionMark]:Zt.QuestionMark};let Cbe=Zm;class jU{constructor(){this._children=[]}appendChild(e){return e instanceof Kd&&this._children[this._children.length-1]instanceof Kd?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),r=i.children.slice(0);r.splice(n,1,...t),i._children=r}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 iG)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Kd extends jU{static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){super(),this.value=e}toString(){return this.value}toTextmateString(){return Kd.escape(this.value)}len(){return this.value.length}clone(){return new Kd(this.value)}}class cet extends jU{}class Kg extends cet{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 YU?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 Kg(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class YU extends jU{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Kd&&(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 YU;return this.options.forEach(e.appendChild,e),e}}class HMe extends jU{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(r=>r instanceof Kv&&!!r.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Kv){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 HMe;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 Kv extends jU{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 Kv(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class EW extends cet{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 Kd(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 EW(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function uUe(s,e){const t=[...s];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class iG extends jU{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Kg&&(e.push(i),t=!t||t.indexn===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return uUe([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Kg&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof EW&&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 iG;return this._children=this.children.map(t=>t.clone()),e}walk(e){uUe(this.children,e)}}class tv{constructor(){this._scanner=new Cbe,this._token={type:Zt.EOF,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static asInsertText(e){return new tv().parse(e).toString()}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new iG;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,r=[];t.walk(c=>(c instanceof Kg&&(c.isFinalTabstop?n.set(0,void 0):!n.has(c.index)&&c.children.length>0?n.set(c.index,c.children):r.push(c)),!0));const o=(c,l)=>{const d=n.get(c.index);if(!d)return;const h=new Kg(c.index);h.transform=c.transform;for(const u of d){const f=u.clone();h.appendChild(f),f instanceof Kg&&n.has(f.index)&&!l.has(f.index)&&(l.add(f.index),o(f,l),l.delete(f.index))}t.replace(c,[h])},a=new Set;for(const c of r)o(c,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(r=>r.index===0)||e.appendChild(new Kg(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 n=this._scanner.next();if(n.type!==Zt.Dollar&&n.type!==Zt.CurlyClose&&n.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 Kd(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 Kg(Number(t)):new EW(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 r=new Kg(Number(t));if(this._accept(Zt.Colon))for(;;){if(this._accept(Zt.CurlyClose))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new Kd("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(Zt.Pipe)){const o=new YU;for(;;){if(this._parseChoiceElement(o)){if(this._accept(Zt.Comma))continue;if(this._accept(Zt.Pipe)&&(r.appendChild(o),this._accept(Zt.CurlyClose)))return e.appendChild(r),!0}return this._backTo(i),!1}}else return this._accept(Zt.Forwardslash)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(i),!1):this._accept(Zt.CurlyClose)?(e.appendChild(r),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===Zt.Comma||this._token.type===Zt.Pipe);){let n;if((n=this._accept(Zt.Backslash,!0))?n=this._accept(Zt.Comma,!0)||this._accept(Zt.Pipe,!0)||this._accept(Zt.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 Kd(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 r=new EW(t);if(this._accept(Zt.Colon))for(;;){if(this._accept(Zt.CurlyClose))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new Kd("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else return this._accept(Zt.Forwardslash)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(i),!1):this._accept(Zt.CurlyClose)?(e.appendChild(r),!0):this._backTo(i)}_parseTransform(e){const t=new HMe;let i="",n="";for(;!this._accept(Zt.Forwardslash);){let r;if(r=this._accept(Zt.Backslash,!0)){r=this._accept(Zt.Forwardslash,!0)||r,i+=r;continue}if(this._token.type!==Zt.EOF){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(Zt.Forwardslash);){let r;if(r=this._accept(Zt.Backslash,!0)){r=this._accept(Zt.Backslash,!0)||this._accept(Zt.Forwardslash,!0)||r,t.appendChild(new Kd(r));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(Zt.CurlyClose);){if(this._token.type!==Zt.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(Zt.Dollar))return!1;let i=!1;this._accept(Zt.CurlyOpen)&&(i=!0);const n=this._accept(Zt.Int,!0);if(n)if(i){if(this._accept(Zt.CurlyClose))return e.appendChild(new Kv(Number(n))),!0;if(!this._accept(Zt.Colon))return this._backTo(t),!1}else return e.appendChild(new Kv(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(Zt.Forwardslash)){const r=this._accept(Zt.VariableName,!0);return!r||!this._accept(Zt.CurlyClose)?(this._backTo(t),!1):(e.appendChild(new Kv(Number(n),r)),!0)}else if(this._accept(Zt.Plus)){const r=this._until(Zt.CurlyClose);if(r)return e.appendChild(new Kv(Number(n),void 0,r,void 0)),!0}else if(this._accept(Zt.Dash)){const r=this._until(Zt.CurlyClose);if(r)return e.appendChild(new Kv(Number(n),void 0,void 0,r)),!0}else if(this._accept(Zt.QuestionMark)){const r=this._until(Zt.Colon);if(r){const o=this._until(Zt.CurlyClose);if(o)return e.appendChild(new Kv(Number(n),void 0,r,o)),!0}}else{const r=this._until(Zt.CurlyClose);if(r)return e.appendChild(new Kv(Number(n),void 0,void 0,r)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==Zt.EOF?(e.appendChild(new Kd(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}async function det(s,e,t,i,n=Ue.None,r){const o=e instanceof re?PNt(e,t):e,a=s.all(t),c=new q7;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&&Nr(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(A=>A.toString?A.toString():""+A).join(" -> ")}`));const C=new hc;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 re?await b.provideInlineCompletions(t,e,i,n):await b.provideInlineEdits?.(t,e,i,n)}catch(A){Nr(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 MNt(w,b.provider);v.push(y);for(const C of w.items){const A=NNt.from(C,y,o,t,r);m.set(A.hash(),A)}}return new RNt(Array.from(m.values()),new Set(m.keys()),v)}class RNt{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 MNt=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)}},NNt=class Sbe{static from(e,t,i,n,r){let o,a,c=e.range?F.lift(e.range):i;if(typeof e.insertText=="string"){if(o=e.insertText,r&&e.completeBracketPairs){o=gUe(o,c.getStartPosition(),n,r);const l=o.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(r&&e.completeBracketPairs){e.insertText.snippet=gUe(e.insertText.snippet,c.getStartPosition(),n,r);const h=e.insertText.snippet.length-l;h!==0&&(c=new F(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+h))}const d=new tv().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof Kd?(o=d.children[0].value,a=void 0):(o=d.toString(),a={snippet:e.insertText.snippet,range:c})}else h6();return new Sbe(o,e.command,c,o,a,e.additionalTextEdits||CNt(),e,t)}constructor(e,t,i,n,r,o,a,c){this.filterText=e,this.command=t,this.range=i,this.insertText=n,this.snippetInfo=r,this.additionalTextEdits=o,this.sourceInlineCompletion=a,this.source=c,e=e.replace(/\r\n|\r/g,` `),n=e.replace(/\r\n|\r/g,` -`)}withRange(e){return new Sbe(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 lu(this.range,this.insertText)}};function PNt(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 gUe(s,e,t,i){const r=t.getLineContent(e.lineNumber).substring(0,e.column-1)+s,a=t.tokenization.tokenizeLineWithEdit(e,r.length-(e.column-1),s)?.sliceAndInflate(e.column-1,r.length,0);return a?TNt(a,i):s}function PT(s,e,t){const i=t?s.range.intersectRanges(t):s.range;if(!i)return s;const n=e.getValueInRange(i,gr.LF),r=Qy(n,s.text),o=ng.ofText(n.substring(0,r)).addToPosition(s.range.getStartPosition()),a=s.text.substring(r),c=F.fromPositions(o,s.range.getEndPosition());return new lu(c,a)}function het(s,e){return s.text.startsWith(e.text)&&FNt(s.range,e.range)}function fUe(s,e,t,i,n=0){let r=PT(s,e);if(r.range.endLineNumber!==r.range.startLineNumber)return;const o=e.getLineContent(r.range.startLineNumber),a=hr(o).length;if(r.range.startColumn-1<=a){const p=hr(r.text).length,m=o.substring(r.range.startColumn-1,a),[v,b]=[r.range.getStartPosition(),r.range.getEndPosition()],w=v.column+m.length<=b.column?v.delta(0,m.length):b,y=F.fromPositions(w,b),C=r.text.startsWith(m)?r.text.substring(m.length):r.text.substring(p);r=new lu(y,C)}const l=e.getValueInRange(r.range),d=ONt(l,r.text);if(!d)return;const h=r.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=r.text.length-n;for(const p of d){const m=r.range.startColumn+p.originalStart+p.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===r.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=r.text.substring(p.modifiedStart,b),y=r.text.substring(b,Math.max(p.modifiedStart,v));w.length>0&&u.push(new fX(m,w,!1)),y.length>0&&u.push(new fX(m,y,!0))}return new X3(h,u)}function FNt(s,e){return e.getStartPosition().equals(s.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(s.getEndPosition())}let DK;function ONt(s,e){if(DK?.originalValue===s&&DK?.newValue===e)return DK?.changes;{let t=mUe(s,e,!0);if(t){const i=pUe(t);if(i>0){const n=mUe(s,e,!1);n&&pUe(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 r(l){if(l<0)throw new Error("unexpected");return n+l+1}function o(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 Abe=class extends V{constructor(e,t,i,n,r){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=r,this._updateOperation=this._register(new yn),this.inlineCompletions=C3("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=C3("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){const n=new WNt(e,t,this.textModel.getVersionId()),r=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(this._updateOperation.value?.request.satisfies(n))return this._updateOperation.value.promise;if(r.get()?.request.satisfies(n))return Promise.resolve(!0);const o=!!this._updateOperation.value;this._updateOperation.clear();const a=new li,c=(async()=>{if((o||t.triggerKind===nm.Automatic)&&await BNt(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 det(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 UNt(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(),is(m=>{r.set(p,m)}),!0})(),l=new HNt(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()}};Abe=D([_(3,nt),_(4,zs)],Abe);function BNt(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 WNt{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&jq(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,jEt())&&(e.context.triggerKind===nm.Automatic||this.context.triggerKind===nm.Explicit)&&this.versionId===e.versionId}}class HNt{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class UNt{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 r=i.deltaDecorations([],e.completions.map(o=>({range:o.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((o,a)=>new _Ue(o,r[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 _Ue(e,n,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class _Ue{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=Zh({owner:this,equalsFn:F.equalsRange},r=>(this._modelVersion.read(r),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??due)}toSingleTextEdit(e){return new lu(this._updatedRange.read(e)??due,this.inlineCompletion.insertText)}isVisible(e,t,i){const n=PT(this._toFilterTextReplacement(i),e),r=this._updatedRange.read(i);if(!r||!this.inlineCompletion.range.getStartPosition().equals(r.getStartPosition())||t.lineNumber!==n.range.startLineNumber)return!1;const o=e.getValueInRange(n.range,gr.LF),a=n.text,c=Math.max(0,t.column-n.range.startColumn);let l=a.substring(0,c),d=a.substring(c),h=o.substring(0,c),u=o.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)&&!!Zje(u,d)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&ng.ofRange(i).isGreaterThanOrEqualTo(ng.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new lu(this._updatedRange.read(e)??due,this.inlineCompletion.filterText)}}const due=new F(1,1,1,1),VNt=g(11236,"input"),zNt=g(11237,"Preserve Case");class $Nt extends sE{constructor(e){super({icon:ve.preserveCase,title:zNt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const LFe=class LFe extends _d{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||VNt;const r=n.appendPreserveCaseLabel||"",o=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 wRe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:o,showHistoryHint:n.showHistoryHint,flexibleHeight:a,flexibleWidth:c,flexibleMaxHeight:l,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new $Nt({appendTitle:r,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(),tn.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()}};LFe.OPTION_CHANGE="optionChange";let Ebe=LFe;const UMe=new Q("suggestWidgetVisible",!1,g(9874,"Whether suggestion are visible")),VMe="historyNavigationWidgetFocus",uet="historyNavigationForwardsEnabled",get="historyNavigationBackwardsEnabled";let $5;const kK=[];function Ece(s,e){if(kK.includes(e))throw new Error("Cannot register the same widget multiple times");kK.push(e);const t=new Z,i=new Q(VMe,!1).bindTo(s),n=new Q(uet,!0).bindTo(s),r=new Q(get,!0).bindTo(s),o=()=>{i.set(!0),$5=e},a=()=>{i.set(!1),$5===e&&($5=void 0)};return dv(e.element)&&o(),t.add(e.onDidFocus(()=>o())),t.add(e.onDidBlur(()=>a())),t.add(Ee(()=>{kK.splice(kK.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:n,historyNavigationBackwardsEnablement:r,dispose(){t.dispose()}}}let pX=class extends wRe{constructor(e,t,i,n){super(e,t,i);const r=this._register(n.createScoped(this.element));this._register(Ece(r,this))}};pX=D([_(3,Le)],pX);let xbe=class extends D3{constructor(e,t,i,n){super(e,t,i);const r=this._register(n.createScoped(this.inputBox.element));this._register(Ece(r,this.inputBox))}};xbe=D([_(3,Le)],xbe);let Dbe=class extends Ebe{constructor(e,t,i,n,r=!1){super(e,t,r,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(Ece(o,this.inputBox))}};Dbe=D([_(3,Le)],Dbe);Sr.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:Ae.WorkbenchContrib,when:he.and(he.has(VMe),he.equals(get,!0),he.not("isComposing"),UMe.isEqualTo(!1)),primary:S.UpArrow,secondary:[U.Alt|S.UpArrow],handler:s=>{$5?.showPreviousValue()}});Sr.registerCommandAndKeybindingRule({id:"history.showNext",weight:Ae.WorkbenchContrib,when:he.and(he.has(VMe),he.equals(uet,!0),he.not("isComposing"),UMe.isEqualTo(!1)),primary:S.DownArrow,secondary:[U.Alt|S.DownArrow],handler:s=>{$5?.showNextValue()}});const Vi={Visible:UMe,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"))},_D=new _e("suggestWidgetStatusBar");let GNt=class{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=O_.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 re(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new re(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new re(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||F.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new re(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new re(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new re(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 Ys(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(n=>{Object.assign(this.completion,n),this._resolveDuration=i.elapsed()},n=>{Oo(n)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}};var gA;(function(s){s[s.Top=0]="Top",s[s.Inline=1]="Inline",s[s.Bottom=2]="Bottom"})(gA||(gA={}));const Qse=class Qse{constructor(e=gA.Bottom,t=new Set,i=new Set,n=new Map,r=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=r}};Qse.default=new Qse;let Z3=Qse,cx;function KNt(){return cx}function qNt(s){const e=cx;return cx=s,e}class QNt{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function zMe(s,e,t,i=Z3.default,n={triggerKind:ju.Invoke},r=Ue.None){const o=new Ys;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(F2.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&Zg.InsertAsSnippet&&(f=tv.guessNeedsClipboard(C.insertText)),d.push(new GNt(t,C,b,v)),y=!0}return xN(b)&&h.add(b),u.push({providerName:v._debugDisplayName??"unknown_provider",elapsedProvider:b.duration??-1,elapsedOverall:w.elapsed()}),y},m=(async()=>{if(!cx||i.kindFilter.has(Me.Snippet))return;const v=i.providerItemsToReuse.get(cx);if(v){v.forEach(y=>d.push(y));return}if(i.providerFilter.size>0&&!i.providerFilter.has(cx))return;const b=new Ys,w=await cx.provideCompletionItems(e,t,n,r);p(cx,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 Ys,C=await w.provideCompletionItems(e,t,n,r);b=p(w,C,y)||b}catch(y){Nr(y)}})),b||r.isCancellationRequested)break}return await m,r.isCancellationRequested?(h.dispose(),Promise.reject(new Na)):new QNt(d.sort(JNt(i.snippetSortOrder)),f,{entries:u,elapsed:o.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 jNt(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 YNt(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 xce=new Map;xce.set(gA.Top,jNt);xce.set(gA.Bottom,YNt);xce.set(gA.Inline,$Me);function JNt(s){return xce.get(s)}vt.registerCommand("_executeCompletionItemProvider",async(s,...e)=>{const[t,i,n,r]=e;Lt(N.isUri(t)),Lt(re.isIPosition(i)),Lt(typeof n=="string"||!n),Lt(typeof r=="number"||!r);const{completionProvider:o}=s.get(nt),a=await s.get(pn).createModelReference(t);try{const c={incomplete:!1,suggestions:[]},l=[],d=a.object.textEditorModel.validatePosition(i),h=await zMe(o,a.object.textEditorModel,d,void 0,{triggerCharacter:n??void 0,triggerKind:n?ju.TriggerCharacter:ju.Invoke});for(const u of h.items)l.length<(r??0)&&l.push(u.resolve(Ue.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 fet(s,e){s.getContribution("editor.contrib.suggestController")?.triggerSuggest(new Set().add(e),void 0,!0)}class CF{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 no.Comment:return e.comments;case no.String:return e.strings;default:return e.other}}}var XNt=".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}";gt(XNt,{});function ZNt(s,e){const{os:t,tildify:i,relative:n}=e;if(n){const a=ePt(s,n,t);if(typeof a=="string")return a}let r=s.fsPath;if(t===ks.Windows&&!jn?r=r.replace(/\//g,"\\"):t!==ks.Windows&&jn&&(r=r.replace(/\\/g,"/")),t!==ks.Windows&&i?.userHome){const a=i.userHome.fsPath;let c;s.scheme!==i.userHome.scheme&&s.path[0]===zi.sep&&s.path[1]!==zi.sep?c=i.userHome.with({path:s.path}).fsPath:c=r,r=pet(c,a,t)}return(t===ks.Windows?lc:zi).normalize(Yw(r,t===ks.Windows))}function ePt(s,e,t){const i=t===ks.Windows?lc:zi,n=t===ks.Linux?Dn:Xoe,r=e.getWorkspace(),o=um(r.folders);if(!o)return;s.scheme!==o.uri.scheme&&s.path[0]===zi.sep&&s.path[1]!==zi.sep&&(s=o.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)),r.folders.length>1&&!e.noPrefix){const l=a.name?a.name:n.basenameOrAuthority(a.uri);c=c?`${l} • ${c}`:l}return c}function Yw(s,e=jn){return $Ke(s,e)?s.charAt(0).toUpperCase()+s.slice(1):s}let hue=Object.create(null);function pet(s,e,t=pr){if(t===ks.Windows||!s||!e)return s;let i=hue.original===e?hue.normalized:void 0;i||(i=e,jn&&(i=L8(i)),i=`${qy(i,zi.sep)}${zi.sep}`,hue={original:e,normalized:i});let n=s;return jn&&(n=L8(n)),(t===ks.Linux?n.startsWith(i):J7(n,i))?`~/${n.substr(i.length)}`:s}function tPt(s,e){return s.replace(/^~($|\/|\\)/,`${e}$1`)}const vUe="…",I4="\\\\",T4="~";function iPt(s,e=au){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(":")||o!=="")&&(d===1&&(d=0,l++,h=c[0]+e+h),d>0&&(u=c[0]+e),u=o+u),d>0&&(u=u+vUe+e),u=u+h,d+l{if(r.type===_w.SEPARATOR){const a=t[o-1],c=t[o+1];return[a,c].every(l=>l&&(l.type===_w.VARIABLE||l.type===_w.TEXT)&&l.value.length>0)}return!0}).map(r=>r.value).join("")}function GMe(s,e){return jt||e?s.replace(/\(&&\w\)|&&/g,""):jn?s.replace(/&&|&/g,t=>t==="&"?"&&":"&"):s.replace(/&&/g,"_")}const sPt=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 bUe{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 wUe{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 r=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);r&&(i=r.value,n=r.multiline)}if(i&&n&&e.snippet){const r=this._model.getLineContent(this._selection.startLineNumber),o=hr(r,0,this._selection.startColumn-1);let a=o;e.snippet.walk(l=>l===e?!1:(l instanceof Kd&&(a=hr(cv(l.value).pop())),!0));const c=Qy(a,o);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 yUe{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Kr(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=Kr(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return xb(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(Ro(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 CUe{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=>!Qu(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let mX=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}}};mX=D([_(2,zs)],mX);const Dw=class Dw{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 Dw.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Dw.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Dw.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Dw.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?"-":"+",r=Math.trunc(Math.abs(i/60)),o=r<10?"0"+r:r,a=Math.abs(i)-r*60,c=a<10?"0"+a:a;return n+o+":"+c}}};Dw.dayNames=[g(9881,"Sunday"),g(9882,"Monday"),g(9883,"Tuesday"),g(9884,"Wednesday"),g(9885,"Thursday"),g(9886,"Friday"),g(9887,"Saturday")],Dw.dayNamesShort=[g(9888,"Sun"),g(9889,"Mon"),g(9890,"Tue"),g(9891,"Wed"),g(9892,"Thu"),g(9893,"Fri"),g(9894,"Sat")],Dw.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")],Dw.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 _X=Dw;class SUe{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=JO(this._workspaceService.getWorkspace());if(!EEt(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(B_(e))return Kr(e.uri.path);let t=Kr(e.configPath.path);return t.endsWith(Tb)&&(t=t.substr(0,t.length-Tb.length-1)),t}_resoveWorkspacePath(e){if(B_(e))return Yw(e.uri.fsPath);const t=Kr(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?Yw(i):"/"}}class AUe{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 ao()}}var Av;const e_=class e_{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=d8(t.placeholders,Kg.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),r=this._snippet.fullLen(i),o=F.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+r)),a=i.isFinalTabstop?e_._decor.inactiveFinal:e_._decor.inactive,c=t.addDecoration(o,a);this._placeholderDecorations.set(i,c)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const n=[];for(const r of this._placeholderGroups[this._placeholderGroupsIdx])if(r.transform){const o=this._placeholderDecorations.get(r),a=this._editor.getModel().getDecorationRange(o),c=this._editor.getModel().getValueInRange(a),l=r.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 r=new Set,o=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const c=this._placeholderDecorations.get(a),l=this._editor.getModel().getDecorationRange(c);o.push(new ht(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(c,a.isFinalTabstop?e_._decor.activeFinal:e_._decor.active),r.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);n.changeDecorationOptions(h,d.isFinalTabstop?e_._decor.activeFinal:e_._decor.active),r.add(d)}}for(const[a,c]of this._placeholderDecorations)r.has(a)||n.changeDecorationOptions(c,a.isFinalTabstop?e_._decor.inactiveFinal:e_._decor.inactive);return o});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Kg){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 r=this._placeholderDecorations.get(n),o=this._editor.getModel().getDecorationRange(r);if(!o){e.delete(n.index);break}i.push(o)}}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 YU,!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 r=e.shift();console.assert(r._offset!==-1),console.assert(!r._placeholderDecorations);const o=r._snippet.placeholderInfo.last.index;for(const c of r._snippet.placeholderInfo.all)c.isFinalTabstop?c.index=n.index+(o+1)/this._nestingLevel:c.index=n.index+c.index/this._nestingLevel;this._snippet.replace(n,r._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const c of r._snippet.placeholders){const l=r._snippet.offset(c),d=r._snippet.fullLen(c),h=F.fromPositions(t.getPositionAt(r._offset+l),t.getPositionAt(r._offset+l+d)),u=i.addDecoration(h,e_._decor.inactive);this._placeholderDecorations.set(c,u)}}this._placeholderGroups=d8(this._snippet.placeholders,Kg.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}};e_._decor={active:Kt.register({description:"snippet-placeholder-1",stickiness:si.AlwaysGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),inactive:Kt.register({description:"snippet-placeholder-2",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),activeFinal:Kt.register({description:"snippet-placeholder-3",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"}),inactiveFinal:Kt.register({description:"snippet-placeholder-4",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"})};let vX=e_;const EUe={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let bX=Av=class{static adjustWhitespace(e,t,i,n,r){const o=e.getLineContent(t.lineNumber),a=hr(o,0,t.column-1);let c;return n.walk(l=>{if(!(l instanceof Kd)||l.parent instanceof YU||r&&!r.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(Ci)),p=e.invokeWithinContext(C=>new yUe(C.get(Os),u)),m=()=>a,v=u.getValueInRange(Av.adjustSelection(u,e.getSelection(),i,0)),b=u.getValueInRange(Av.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=Av.adjustSelection(u,C,i,0),k=Av.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 tv().parse(t,!0,r),z=P.getStartPosition(),G=Av.adjustWhitespace(u,z,o||A>0&&w!==u.getLineFirstNonWhitespaceColumn(C.positionLineNumber),R);R.resolveVariables(new bUe([p,new CUe(m,A,y.length,e.getOption(x.multiCursorPaste)==="spread"),new wUe(u,C,A,c),new mX(u,C,l),new _X,new SUe(f),new AUe])),d[A]=es.replace(P,R.toString()),d[A].identifier={major:A,minor:0},d[A]._isTracked=!0,h[A]=new vX(e,R,G)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,n,r,o,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const c=[],l=e.getModel(),d=new tv,h=new iG,u=new bUe([e.invokeWithinContext(p=>new yUe(p.get(Os),l)),new CUe(()=>r,0,e.getSelections().length,e.getOption(x.multiCursorPaste)==="spread"),new wUe(l,e.getSelection(),0,o),new mX(l,e.getSelection(),a),new _X,new SUe(e.invokeWithinContext(p=>p.get(Ci))),new AUe]);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 Kd(l.getValueInRange(L));h.appendChild(k),f+=k.value.length}const b=d.parseFragment(v,h);Av.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=es.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 vX(e,h,"")]}}constructor(e,t,i=EUe,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){wt(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"?Av.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):Av.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(r=>!!r.identifier);for(let r=0;rht.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=EUe){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=Av.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,r=>{const o=r.filter(c=>!!c.identifier);for(let c=0;cht.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{r.push(...n.get(o))})}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 r=0;r0}getEnclosingRange(){let e;for(const t of this._snippets){const i=t.getEnclosingRange();e?e=e.plusRange(i):e=i}return e}};bX=Av=D([_(3,zs)],bX);var BP;const IK={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var sy;let pc=(sy=class{static get(e){return e.getContribution(BP.ID)}constructor(e,t,i,n,r){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=r,this._snippetListener=new Z,this._modelVersionId=-1,this._inSnippet=BP.InSnippetMode.bindTo(n),this._hasNextTabstop=BP.HasNextTabstop.bindTo(n),this._hasPrevTabstop=BP.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"?IK:{...IK,...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"?IK:{...IK,...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?(Lt(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new bX(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()||!re.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{r?.dispose(),o=!1},c=()=>{o||(r=this._languageFeaturesService.completionProvider.register({language:n.getLanguageId(),pattern:n.uri.fsPath,scheme:n.uri.scheme,exclusive:!0},i),this._snippetListener.add(r),o=!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(()=>{fet(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()}},BP=sy,sy.ID="snippetController2",sy.InSnippetMode=new Q("inSnippetMode",!1,g(1558,"Whether the editor in current in snippet mode")),sy.HasNextTabstop=new Q("hasNextTabstop",!1,g(1559,"Whether there is a next tab stop when in snippet mode")),sy.HasPrevTabstop=new Q("hasPrevTabstop",!1,g(1560,"Whether there is a previous tab stop when in snippet mode")),sy);pc=BP=D([_(1,Ke),_(2,nt),_(3,Le),_(4,zs)],pc);on(pc.ID,pc,ai.Lazy);const Dce=uc.bindToContribution(pc.get);Qe(new Dce({id:"jumpToNextSnippetPlaceholder",precondition:he.and(pc.InSnippetMode,pc.HasNextTabstop),handler:s=>s.next(),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:S.Tab}}));Qe(new Dce({id:"jumpToPrevSnippetPlaceholder",precondition:he.and(pc.InSnippetMode,pc.HasPrevTabstop),handler:s=>s.prev(),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:U.Shift|S.Tab}}));Qe(new Dce({id:"leaveSnippet",precondition:pc.InSnippetMode,handler:s=>s.cancel(!0),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));Qe(new Dce({id:"acceptSnippet",precondition:pc.InSnippetMode,handler:s=>s.finish()}));let kbe=class extends V{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,r,o,a,c,l,d,h,u){super(),this.textModel=e,this.selectedSuggestItem=t,this._textModelVersionId=i,this._positions=n,this._debounceValue=r,this._suggestPreviewEnabled=o,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(Abe,this.textModel,this._textModelVersionId,this._debounceValue)),this._isActive=Yt(this,!1),this._forceUpdateExplicitlySignal=_C(this),this._selectedInlineCompletionId=Yt(this,void 0),this._primaryPosition=et(this,p=>this._positions.read(p)[0]??new re(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([NC.Redo,NC.Undo,NC.AcceptWord]),this._fetchInlineCompletionsPromise=jYe({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:nm.Automatic}),handleChange:(p,m)=>(p.didChange(this._textModelVersionId)&&this._preserveCurrentCompletionReasons.has(this._getReason(p.change))?m.preserveCurrentCompletion=!0:p.didChange(this._forceUpdateExplicitlySignal)&&(m.inlineCompletionTriggerKind=nm.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();is(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=Zh({owner:this,equalsFn:sW()},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=et(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=et(this,p=>{const m=this._filteredInlineCompletionItems.read(p),v=this.selectedInlineCompletionIndex.read(p);return m[v]}),this.activeCommands=Zh({owner:this,equalsFn:sW()},p=>this.selectedInlineCompletion.read(p)?.inlineCompletion.source.inlineCompletions.commands??[]),this.lastTriggerKind=this._source.inlineCompletions.map(this,p=>p?.request.context.triggerKind),this.inlineCompletionsCount=et(this,p=>{if(this.lastTriggerKind.read(p)===nm.Explicit)return this._filteredInlineCompletionItems.read(p).length}),this.state=Zh({owner:this,equalsFn:(p,m)=>!p||!m?p===m:cUe(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=PT(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,...uue(this.textModel,k,C)],R=P.map((G,Y)=>fUe(G,m,L,k[Y],A)).filter(Oc),z=R[0]??new X3(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,...uue(this.textModel,C,w)],L=A.map((k,P)=>fUe(k,m,y,C[P],0)).filter(Oc);return L[0]?{edits:A,primaryGhostText:L[0],ghostTexts:L,inlineCompletion:b,suggestItem:void 0}:void 0}}),this.ghostTexts=Zh({owner:this,equalsFn:cUe},p=>{const m=this.state.read(p);if(m)return m.ghostTexts}),this.primaryGhostText=Zh({owner:this,equalsFn:set},p=>{const m=this.state.read(p);if(m)return m?.primaryGhostText}),this._register(VN(this._fetchInlineCompletionsPromise));let f;this._register(ci(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?NC.Undo:e?.isRedoing?NC.Redo:this.isAcceptingPartially?NC.AcceptWord:NC.Other}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){IM(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){IM(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t),r=n?n.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(Oc);return kat(r,a=>{let c=a.toSingleTextEdit(t);return c=PT(c,i,F.fromPositions(c.range.getStartPosition(),e.range.getEndPosition())),het(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 Pi;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",[es.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),pc.get(e)?.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const n=t.edits,r=xUe(n).map(o=>ht.fromPositions(o));e.executeEdits("inlineSuggestion.accept",[...n.map(o=>es.replace(o.range,o.text)),...i.additionalTextEdits]),e.setSelections(r,"inlineCompletionAccept")}this.stop(),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,Nr),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const n=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),r=this._languageConfigurationService.getLanguageConfiguration(n),o=new RegExp(r.wordDefinition.source,r.wordDefinition.flags.replace("g","")),a=i.match(o);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},nD.Line)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new Pi;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const r=n.primaryGhostText,o=n.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){await this.accept(e);return}const a=r.parts[0],c=new re(r.lineNumber,a.column),l=a.text,d=t(c,l);if(d===l.length&&r.parts.length===1){this.accept(e);return}const h=l.substring(0,d),u=this._positions.get(),f=u[0];o.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const p=F.fromPositions(f,c),m=e.getModel().getValueInRange(p)+h,v=new lu(p,m),b=[v,...uue(this.textModel,u,v)],w=xUe(b).map(y=>ht.fromPositions(y));e.executeEdits("inlineSuggestion.accept",b.map(y=>es.replace(y.range,y.text))),e.setSelections(w,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),_t.Immediate)}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const p=F.fromPositions(o.range.getStartPosition(),ng.ofText(h).addToPosition(c)),m=e.getModel().getValueInRange(p,gr.LF);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,m.length,{kind:i})}}finally{o.source.removeRef()}}handleSuggestAccepted(e){const t=PT(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:nD.Suggest})}};kbe=D([_(9,we),_(10,bi),_(11,zs)],kbe);var NC;(function(s){s[s.Undo=0]="Undo",s[s.Redo=1]="Redo",s[s.AcceptWord=2]="AcceptWord",s[s.Other=3]="Other"})(NC||(NC={}));function uue(s,e,t){if(e.length===1)return[];const i=e[0],n=e.slice(1),r=t.range.getStartPosition(),o=t.range.getEndPosition(),a=s.getValueInRange(F.fromPositions(i,o)),c=lUe(i,r);if(c.lineNumber<1)return bt(new Pi(`positionWithinTextEdit line number should be bigger than 0. - Invalid subtraction between ${i.toString()} and ${r.toString()}`)),[];const l=rPt(t.text,c);return n.map(d=>{const h=SNt(lUe(d,r),o),u=s.getValueInRange(F.fromPositions(d,h)),f=Qy(a,u),p=F.fromPositions(d,d.delta(0,f));return new lu(p,l)})}function rPt(s,e){let t="";const i=Mct(s);for(let n=e.lineNumber-1;nr.range,F.compareRangesUsingStarts)),i=new G2(e.apply(s)).getNewRanges();return e.inverse().apply(i).map(r=>r.getEndPosition())}var wV;class KMe{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let r=0;rc&&h.type===i[l].completion.kind&&h.insertText===i[l].completion.insertText&&(c=h.touch,a=l),i[l].completion.preselect&&o===-1)return o=l}return a!==-1?a:o!==-1?o: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:x8.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class aPt extends KMe{constructor(){super("recentlyUsedByPrefix"),this._trie=Ih.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),r=`${e.getLanguageId()}/${n}`;this._trie.set(r,{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 r=`${e.getLanguageId()}/${n}`;let o=this._trie.get(r);if(o||(o=this._trie.findSubstr(r)),o)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:x8.fromString(i.type),this._trie.set(t,i)}}}var $D;let Ibe=($D=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Z,this._persistSoon=new ln(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===Ay.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=wV._strategyCtors.get(i)||DUe;this._strategy=new n;try{const o=this._configService.getValue("editor.suggest.shareSuggestSelections")?Ie.PROFILE:Ie.WORKSPACE,a=this._storageService.get(`${wV._storagePrefix}/${i}`,o);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(`${wV._storagePrefix}/${this._strategy.name}`,i,t,cn.MACHINE)}}},wV=$D,$D._strategyCtors=new Map([["recentlyUsedByPrefix",aPt],["recentlyUsed",oPt],["first",DUe]]),$D._storagePrefix="suggest/memories",$D);Ibe=wV=D([_(0,Gi),_(1,Te)],Ibe);const kce=ae("ISuggestMemories");ce(kce,Ibe,Qt.Delayed);var Tbe,kL;let wX=(kL=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=Tbe.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(),r=i.getWordAtPosition(n.getStartPosition());if(!r){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(r.endColumn===n.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},Tbe=kL,kL.AtEnd=new Q("atEndOfWord",!1),kL);wX=Tbe=D([_(1,Le)],wX);var yV,IL;let xW=(IL=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=yV.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(yV._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 r=t.items.length;r>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,!(n===i||!t.items[n].completion.additionalTextEdits));r--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=yV._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},yV=IL,IL.OtherSuggestions=new Q("hasOtherSuggestions",!1),IL);xW=yV=D([_(1,Le)],xW);const Mp=class Mp{async provideSelectionRanges(e,t){const i=[];for(const n of t){const r=[];i.push(r);const o=new Map;await new Promise(a=>Mp._bracketsRightYield(a,0,e,n,o)),await new Promise(a=>Mp._bracketsLeftYield(a,0,e,n,o,r))}return i}static _bracketsRightYield(e,t,i,n,r){const o=new Map,a=Date.now();for(;;){if(t>=Mp._maxRounds){e();break}if(!n){e();break}const c=i.bracketPairs.findNextBracket(n);if(!c){e();break}if(Date.now()-a>Mp._maxDuration){setTimeout(()=>Mp._bracketsRightYield(e,t+1,i,n,r));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText,h=o.has(d)?o.get(d):0;o.set(d,h+1)}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText;let h=o.has(d)?o.get(d):0;if(h-=1,o.set(d,Math.max(0,h)),h<0){let u=r.get(d);u||(u=new ul,r.set(d,u)),u.push(c.range)}}n=c.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,r,o){const a=new Map,c=Date.now();for(;;){if(t>=Mp._maxRounds&&r.size===0){e();break}if(!n){e();break}const l=i.bracketPairs.findPrevBracket(n);if(!l){e();break}if(Date.now()-c>Mp._maxDuration){setTimeout(()=>Mp._bracketsLeftYield(e,t+1,i,n,r,o));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=r.get(h);if(f){const p=f.shift();f.size===0&&r.delete(h);const m=F.fromPositions(l.range.getEndPosition(),p.getStartPosition()),v=F.fromPositions(l.range.getStartPosition(),p.getEndPosition());o.push({range:m}),o.push({range:v}),Mp._addBracketLeading(i,v,o)}}}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,r=e.getLineFirstNonWhitespaceColumn(n);r!==0&&r!==t.startColumn&&(i.push({range:F.fromPositions(new re(n,r),t.getEndPosition())}),i.push({range:F.fromPositions(new re(n,1),t.getEndPosition())}));const o=n-1;if(o>0){const a=e.getLineFirstNonWhitespaceColumn(o);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(o)&&(i.push({range:F.fromPositions(new re(o,a),t.getEndPosition())}),i.push({range:F.fromPositions(new re(o,1),t.getEndPosition())}))}}};Mp._maxDuration=30,Mp._maxRounds=2;let yX=Mp;const kw=class kw{static async create(e,t){if(!t.getOption(x.suggest).localityBonus||!t.hasModel())return kw.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return kw.None;const[r]=await new yX().provideSelectionRanges(i,[n]);if(r.length===0)return kw.None;const o=await e.computeWordRanges(i.uri,r[0].range);if(!o)return kw.None;const a=i.getWordUntilPosition(n);return delete o[a.word],new class extends kw{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=o[d];if(wU(h))return 2<<20;const u=k2(h,F.fromPositions(c),F.compareRangesUsingStarts),f=u>=0?h[u]:h[Math.max(0,~u-1)];let p=r.length;for(const m of r){if(!F.containsRange(m.range,f))break;p-=1}return p}}}};kw.None=new class extends kw{distance(){return 0}};let CX=kw,kUe=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};var BE;(function(s){s[s.Nothing=0]="Nothing",s[s.All=1]="All",s[s.Incr=2]="Incr"})(BE||(BE={}));class lx{constructor(e,t,i,n,r,o,a=p3.default,c=void 0){this.clipboardText=c,this._snippetCompareFn=lx._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=r,this._refilterKind=BE.All,this._lineContext=i,this._fuzzyScoreOptions=a,o==="top"?this._snippetCompareFn=lx._compareCompletionItemsSnippetsUp:o==="bottom"&&(this._snippetCompareFn=lx._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!==BE.Nothing&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",r="";const o=this._refilterKind===BE.All?this._items:this._filteredItems,a=[],c=!this._options.filterGraceful||o.length>2e3?qk:TSt;for(let l=0;l=f)d.score=O_.Default;else if(typeof d.completion.filterText=="string"){const m=c(n,r,p,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;AS(d.completion.filterText,d.textLabel)===0?d.score=m:(d.score=DSt(n,r,p,d.textLabel,d.labelLow,0),d.score[0]=m[0])}else{const m=c(n,r,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=BE.Nothing,this._stats={pLabelLen:e.length?lfe(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 lx._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 lx._compareCompletionItems(e,t)}}var Lbe;class QI{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 vD;(function(s){s[s.Idle=0]="Idle",s[s.Manual=1]="Manual",s[s.Auto=2]="Auto"})(vD||(vD={}));function cPt(s,e,t){if(!e.getContextKeyValue(Xu.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(Xu.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(x.inlineSuggest).suppressSuggestions}function lPt(s,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(Xu.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(x.inlineSuggest).suppressSuggestions}let SX=Lbe=class{constructor(e,t,i,n,r,o,a,c,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=r,this._contextKeyService=o,this._configurationService=a,this._languageFeaturesService=c,this._envService=l,this._toDispose=new Z,this._triggerCharacterListener=new Z,this._triggerQuickSuggest=new Em,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 ht(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(){wt(this._triggerCharacterListener),wt([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 r=e.get(n);r||(r=new Set,r.add(KNt()),e.set(n,r)),r.add(i)}const t=i=>{if(!lPt(this._editor,this._contextKeyService)||QI.shouldAutoTrigger(this._editor))return;if(!i){const o=this._editor.getPosition();i=this._editor.getModel().getLineContent(o.lineNumber).substr(0,o.column-1)}let n="";wM(i.charCodeAt(i.length-1))?Fc(i.charCodeAt(i.length-2))&&(n=i.substr(i.length-2)):n=i.charAt(i.length-1);const r=e.get(n);if(r){const o=new Map;if(this._completionModel)for(const[a,c]of this._completionModel.getItemsByProvider())r.has(a)||o.set(a,c);this.trigger({auto:!0,triggerKind:ju.TriggerCharacter,triggerCharacter:n,retrigger:!!this._completionModel,clipboardText:this._completionModel?.clipboardText,completionOptions:{providerFilter:r,providerItemsToReuse:o}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?vD.Auto:vD.Manual:vD.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!==Bi.NotSet&&e.reason!==Bi.Explicit||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===Bi.NotSet?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===Bi.Explicit&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){CF.isAllOff(this._editor.getOption(x.quickSuggestions))||this._editor.getOption(x.suggest).snippetsPreventQuickSuggestions&&pc.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!QI.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(!CF.isAllOff(i)){if(!CF.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),r=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(CF.valueFor(i,r)!=="on")return}cPt(this._editor,this._contextKeyService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}},this._editor.getOption(x.quickSuggestionsDelay)))}_refilterCompletionItems(){Lt(this._editor.hasModel()),Lt(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new QI(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new QI(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??ju.Invoke};e.triggerCharacter&&(n={triggerKind:ju.TriggerCharacter,triggerCharacter:e.triggerCharacter}),this._requestToken=new li;const r=this._editor.getOption(x.snippetSuggestions);let o=gA.Inline;switch(r){case"top":o=gA.Top;break;case"bottom":o=gA.Bottom;break}const{itemKind:a,showDeprecated:c}=Lbe.createSuggestFilter(this._editor),l=new Z3(o,e.completionOptions?.kindFilter??a,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,c),d=CX.create(this._editorWorkerService,this._editor),h=zMe(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 QI(m,this._editor.getPosition(),e),b={...p3.default,firstMatchCanBeWeak:!this._editor.getOption(x.suggest).matchOnWordStartOnly};if(this._completionModel=new lx(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(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(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(hr(e.leadingLineContent)!==hr(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(QI.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,r]of this._completionModel.getItemsByProvider())r.length>0&&r[0].container.incomplete?i.add(n):t.set(n,r);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:ju.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=QI.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})}}}}};SX=Lbe=D([_(1,Pl),_(2,gg),_(3,Ji),_(4,Ke),_(5,Le),_(6,Te),_(7,nt),_(8,ec)],SX);class dPt{constructor(e,t,i,n){this._disposables=new Z,this._disposables.add(i.onDidSuggest(r=>{r.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(r=>{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(r=>{if(this._active&&!t.isFrozen()&&i.state!==vD.Idle){const o=r.charCodeAt(r.length-1);this._active.acceptCharacters.has(o)&&e.getOption(x.acceptSuggestionOnCommitCharacter)&&n(this._active.item)}}))}_onItem(e){if(!e||!tr(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new cY;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 jse=class jse{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 r=!1;for(let a=0;ajse._maxSelectionLength)return;this._lastOvertyped[a]={value:o.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 Ac?i.createInstance(N6,a,{useComma:!0}):void 0;this._leftActions=new gd(this.element,{actionViewItemProvider:o}),this._rightActions=new gd(this.element,{actionViewItemProvider:o}),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[r,o]of e.getActions())r==="left"?i.push(...o):n.push(...o);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()}};Mbe=D([_(2,we),_(3,Ba),_(4,Le)],Mbe);var fPt=".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)}";gt(fPt,{});W("symbolIcon.arrayForeground",$i,g(9919,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.booleanForeground",$i,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",$i,g(9922,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.constantForeground",$i,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",$i,g(9929,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.folderForeground",$i,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",$i,g(9933,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.keywordForeground",$i,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",$i,g(9936,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.namespaceForeground",$i,g(9937,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.nullForeground",$i,g(9938,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.numberForeground",$i,g(9939,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.objectForeground",$i,g(9940,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.operatorForeground",$i,g(9941,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.packageForeground",$i,g(9942,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.propertyForeground",$i,g(9943,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.referenceForeground",$i,g(9944,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.snippetForeground",$i,g(9945,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.stringForeground",$i,g(9946,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.structForeground",$i,g(9947,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.textForeground",$i,g(9948,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.typeParameterForeground",$i,g(9949,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.unitForeground",$i,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 qMe{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 wn(0,0),this._minSize=new wn(0,0),this._maxSize=new wn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Wd(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:pi.VERTICAL}),this._westSash=new Wd(this.domNode,{getVerticalSashLeft:()=>0},{orientation:pi.VERTICAL}),this._northSash=new Wd(this.domNode,{getHorizontalSashTop:()=>0},{orientation:pi.HORIZONTAL,orthogonalEdge:_J.North}),this._southSash=new Wd(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:pi.HORIZONTAL,orthogonalEdge:_J.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:r,width:o}=this._maxSize;e=Math.max(i,Math.min(r,e)),t=Math.max(n,Math.min(o,t));const a=new wn(t,e);wn.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 QMe(s){return!!s&&!!(s.completion.documentation||s.completion.detail&&s.completion.detail!==s.completion.label)}let Nbe=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 wn(330,0),this.domNode=fe(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Z_,{editor:e}),this._body=fe(".body"),this._scrollbar=new MU(this._body,{alwaysConsumeMouseWheel:!0}),oe(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=oe(this._body,fe(".header")),this._close=oe(this._header,fe("span"+He.asCSSSelector(ve.close))),this._close.title=g(9952,"Close"),this._type=oe(this._header,fe("p.type")),this._docs=oe(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,r=e.get(x.suggestLineHeight)||t.lineHeight,o=t.fontWeight,a=`${n}px`,c=`${r}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${r/n}`,this.domNode.style.fontWeight=o,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 r="";r+=`score: ${e.score[0]} +`)}withRange(e){return new Sbe(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 lu(this.range,this.insertText)}};function PNt(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 gUe(s,e,t,i){const r=t.getLineContent(e.lineNumber).substring(0,e.column-1)+s,a=t.tokenization.tokenizeLineWithEdit(e,r.length-(e.column-1),s)?.sliceAndInflate(e.column-1,r.length,0);return a?TNt(a,i):s}function PT(s,e,t){const i=t?s.range.intersectRanges(t):s.range;if(!i)return s;const n=e.getValueInRange(i,gr.LF),r=Qy(n,s.text),o=ng.ofText(n.substring(0,r)).addToPosition(s.range.getStartPosition()),a=s.text.substring(r),c=F.fromPositions(o,s.range.getEndPosition());return new lu(c,a)}function het(s,e){return s.text.startsWith(e.text)&&FNt(s.range,e.range)}function fUe(s,e,t,i,n=0){let r=PT(s,e);if(r.range.endLineNumber!==r.range.startLineNumber)return;const o=e.getLineContent(r.range.startLineNumber),a=hr(o).length;if(r.range.startColumn-1<=a){const p=hr(r.text).length,m=o.substring(r.range.startColumn-1,a),[v,b]=[r.range.getStartPosition(),r.range.getEndPosition()],w=v.column+m.length<=b.column?v.delta(0,m.length):b,y=F.fromPositions(w,b),C=r.text.startsWith(m)?r.text.substring(m.length):r.text.substring(p);r=new lu(y,C)}const l=e.getValueInRange(r.range),d=ONt(l,r.text);if(!d)return;const h=r.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=r.text.length-n;for(const p of d){const m=r.range.startColumn+p.originalStart+p.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===r.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=r.text.substring(p.modifiedStart,b),y=r.text.substring(b,Math.max(p.modifiedStart,v));w.length>0&&u.push(new fX(m,w,!1)),y.length>0&&u.push(new fX(m,y,!0))}return new X3(h,u)}function FNt(s,e){return e.getStartPosition().equals(s.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(s.getEndPosition())}let DK;function ONt(s,e){if(DK?.originalValue===s&&DK?.newValue===e)return DK?.changes;{let t=mUe(s,e,!0);if(t){const i=pUe(t);if(i>0){const n=mUe(s,e,!1);n&&pUe(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 r(l){if(l<0)throw new Error("unexpected");return n+l+1}function o(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 Abe=class extends V{constructor(e,t,i,n,r){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=r,this._updateOperation=this._register(new yn),this.inlineCompletions=C3("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=C3("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){const n=new WNt(e,t,this.textModel.getVersionId()),r=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(this._updateOperation.value?.request.satisfies(n))return this._updateOperation.value.promise;if(r.get()?.request.satisfies(n))return Promise.resolve(!0);const o=!!this._updateOperation.value;this._updateOperation.clear();const a=new li,c=(async()=>{if((o||t.triggerKind===nm.Automatic)&&await BNt(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 det(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 UNt(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(),is(m=>{r.set(p,m)}),!0})(),l=new HNt(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()}};Abe=D([_(3,nt),_(4,zs)],Abe);function BNt(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 WNt{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&jq(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,jEt())&&(e.context.triggerKind===nm.Automatic||this.context.triggerKind===nm.Explicit)&&this.versionId===e.versionId}}class HNt{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class UNt{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 r=i.deltaDecorations([],e.completions.map(o=>({range:o.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((o,a)=>new _Ue(o,r[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 _Ue(e,n,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class _Ue{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=Zh({owner:this,equalsFn:F.equalsRange},r=>(this._modelVersion.read(r),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??due)}toSingleTextEdit(e){return new lu(this._updatedRange.read(e)??due,this.inlineCompletion.insertText)}isVisible(e,t,i){const n=PT(this._toFilterTextReplacement(i),e),r=this._updatedRange.read(i);if(!r||!this.inlineCompletion.range.getStartPosition().equals(r.getStartPosition())||t.lineNumber!==n.range.startLineNumber)return!1;const o=e.getValueInRange(n.range,gr.LF),a=n.text,c=Math.max(0,t.column-n.range.startColumn);let l=a.substring(0,c),d=a.substring(c),h=o.substring(0,c),u=o.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)&&!!Zje(u,d)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&ng.ofRange(i).isGreaterThanOrEqualTo(ng.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new lu(this._updatedRange.read(e)??due,this.inlineCompletion.filterText)}}const due=new F(1,1,1,1),VNt=g(11236,"input"),zNt=g(11237,"Preserve Case");class $Nt extends sE{constructor(e){super({icon:ve.preserveCase,title:zNt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Fo("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const LFe=class LFe extends _d{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||VNt;const r=n.appendPreserveCaseLabel||"",o=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 wRe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:o,showHistoryHint:n.showHistoryHint,flexibleHeight:a,flexibleWidth:c,flexibleMaxHeight:l,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new $Nt({appendTitle:r,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(),tn.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()}};LFe.OPTION_CHANGE="optionChange";let Ebe=LFe;const UMe=new Q("suggestWidgetVisible",!1,g(9874,"Whether suggestion are visible")),VMe="historyNavigationWidgetFocus",uet="historyNavigationForwardsEnabled",get="historyNavigationBackwardsEnabled";let $5;const kK=[];function Ece(s,e){if(kK.includes(e))throw new Error("Cannot register the same widget multiple times");kK.push(e);const t=new Z,i=new Q(VMe,!1).bindTo(s),n=new Q(uet,!0).bindTo(s),r=new Q(get,!0).bindTo(s),o=()=>{i.set(!0),$5=e},a=()=>{i.set(!1),$5===e&&($5=void 0)};return dv(e.element)&&o(),t.add(e.onDidFocus(()=>o())),t.add(e.onDidBlur(()=>a())),t.add(Ee(()=>{kK.splice(kK.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:n,historyNavigationBackwardsEnablement:r,dispose(){t.dispose()}}}let pX=class extends wRe{constructor(e,t,i,n){super(e,t,i);const r=this._register(n.createScoped(this.element));this._register(Ece(r,this))}};pX=D([_(3,Le)],pX);let xbe=class extends D3{constructor(e,t,i,n){super(e,t,i);const r=this._register(n.createScoped(this.inputBox.element));this._register(Ece(r,this.inputBox))}};xbe=D([_(3,Le)],xbe);let Dbe=class extends Ebe{constructor(e,t,i,n,r=!1){super(e,t,r,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(Ece(o,this.inputBox))}};Dbe=D([_(3,Le)],Dbe);Sr.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:Ae.WorkbenchContrib,when:he.and(he.has(VMe),he.equals(get,!0),he.not("isComposing"),UMe.isEqualTo(!1)),primary:S.UpArrow,secondary:[U.Alt|S.UpArrow],handler:s=>{$5?.showPreviousValue()}});Sr.registerCommandAndKeybindingRule({id:"history.showNext",weight:Ae.WorkbenchContrib,when:he.and(he.has(VMe),he.equals(uet,!0),he.not("isComposing"),UMe.isEqualTo(!1)),primary:S.DownArrow,secondary:[U.Alt|S.DownArrow],handler:s=>{$5?.showNextValue()}});const Vi={Visible:UMe,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"))},_D=new _e("suggestWidgetStatusBar");let GNt=class{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=O_.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 re(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new re(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new re(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||F.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new re(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new re(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new re(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 Ys(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(n=>{Object.assign(this.completion,n),this._resolveDuration=i.elapsed()},n=>{Oo(n)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}};var gA;(function(s){s[s.Top=0]="Top",s[s.Inline=1]="Inline",s[s.Bottom=2]="Bottom"})(gA||(gA={}));const Qse=class Qse{constructor(e=gA.Bottom,t=new Set,i=new Set,n=new Map,r=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=r}};Qse.default=new Qse;let Z3=Qse,cx;function KNt(){return cx}function qNt(s){const e=cx;return cx=s,e}class QNt{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function zMe(s,e,t,i=Z3.default,n={triggerKind:ju.Invoke},r=Ue.None){const o=new Ys;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(F2.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&Zg.InsertAsSnippet&&(f=tv.guessNeedsClipboard(C.insertText)),d.push(new GNt(t,C,b,v)),y=!0}return xN(b)&&h.add(b),u.push({providerName:v._debugDisplayName??"unknown_provider",elapsedProvider:b.duration??-1,elapsedOverall:w.elapsed()}),y},m=(async()=>{if(!cx||i.kindFilter.has(Me.Snippet))return;const v=i.providerItemsToReuse.get(cx);if(v){v.forEach(y=>d.push(y));return}if(i.providerFilter.size>0&&!i.providerFilter.has(cx))return;const b=new Ys,w=await cx.provideCompletionItems(e,t,n,r);p(cx,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 Ys,C=await w.provideCompletionItems(e,t,n,r);b=p(w,C,y)||b}catch(y){Nr(y)}})),b||r.isCancellationRequested)break}return await m,r.isCancellationRequested?(h.dispose(),Promise.reject(new Pa)):new QNt(d.sort(JNt(i.snippetSortOrder)),f,{entries:u,elapsed:o.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 jNt(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 YNt(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 xce=new Map;xce.set(gA.Top,jNt);xce.set(gA.Bottom,YNt);xce.set(gA.Inline,$Me);function JNt(s){return xce.get(s)}vt.registerCommand("_executeCompletionItemProvider",async(s,...e)=>{const[t,i,n,r]=e;Lt(N.isUri(t)),Lt(re.isIPosition(i)),Lt(typeof n=="string"||!n),Lt(typeof r=="number"||!r);const{completionProvider:o}=s.get(nt),a=await s.get(pn).createModelReference(t);try{const c={incomplete:!1,suggestions:[]},l=[],d=a.object.textEditorModel.validatePosition(i),h=await zMe(o,a.object.textEditorModel,d,void 0,{triggerCharacter:n??void 0,triggerKind:n?ju.TriggerCharacter:ju.Invoke});for(const u of h.items)l.length<(r??0)&&l.push(u.resolve(Ue.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 fet(s,e){s.getContribution("editor.contrib.suggestController")?.triggerSuggest(new Set().add(e),void 0,!0)}class CF{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 no.Comment:return e.comments;case no.String:return e.strings;default:return e.other}}}var XNt=".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}";gt(XNt,{});function ZNt(s,e){const{os:t,tildify:i,relative:n}=e;if(n){const a=ePt(s,n,t);if(typeof a=="string")return a}let r=s.fsPath;if(t===ks.Windows&&!jn?r=r.replace(/\//g,"\\"):t!==ks.Windows&&jn&&(r=r.replace(/\\/g,"/")),t!==ks.Windows&&i?.userHome){const a=i.userHome.fsPath;let c;s.scheme!==i.userHome.scheme&&s.path[0]===zi.sep&&s.path[1]!==zi.sep?c=i.userHome.with({path:s.path}).fsPath:c=r,r=pet(c,a,t)}return(t===ks.Windows?lc:zi).normalize(Yw(r,t===ks.Windows))}function ePt(s,e,t){const i=t===ks.Windows?lc:zi,n=t===ks.Linux?Dn:Xoe,r=e.getWorkspace(),o=um(r.folders);if(!o)return;s.scheme!==o.uri.scheme&&s.path[0]===zi.sep&&s.path[1]!==zi.sep&&(s=o.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)),r.folders.length>1&&!e.noPrefix){const l=a.name?a.name:n.basenameOrAuthority(a.uri);c=c?`${l} • ${c}`:l}return c}function Yw(s,e=jn){return $Ke(s,e)?s.charAt(0).toUpperCase()+s.slice(1):s}let hue=Object.create(null);function pet(s,e,t=pr){if(t===ks.Windows||!s||!e)return s;let i=hue.original===e?hue.normalized:void 0;i||(i=e,jn&&(i=L8(i)),i=`${qy(i,zi.sep)}${zi.sep}`,hue={original:e,normalized:i});let n=s;return jn&&(n=L8(n)),(t===ks.Linux?n.startsWith(i):J7(n,i))?`~/${n.substr(i.length)}`:s}function tPt(s,e){return s.replace(/^~($|\/|\\)/,`${e}$1`)}const vUe="…",I4="\\\\",T4="~";function iPt(s,e=au){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(":")||o!=="")&&(d===1&&(d=0,l++,h=c[0]+e+h),d>0&&(u=c[0]+e),u=o+u),d>0&&(u=u+vUe+e),u=u+h,d+l{if(r.type===_w.SEPARATOR){const a=t[o-1],c=t[o+1];return[a,c].every(l=>l&&(l.type===_w.VARIABLE||l.type===_w.TEXT)&&l.value.length>0)}return!0}).map(r=>r.value).join("")}function GMe(s,e){return jt||e?s.replace(/\(&&\w\)|&&/g,""):jn?s.replace(/&&|&/g,t=>t==="&"?"&&":"&"):s.replace(/&&/g,"_")}const sPt=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 bUe{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 wUe{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 r=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);r&&(i=r.value,n=r.multiline)}if(i&&n&&e.snippet){const r=this._model.getLineContent(this._selection.startLineNumber),o=hr(r,0,this._selection.startColumn-1);let a=o;e.snippet.walk(l=>l===e?!1:(l instanceof Kd&&(a=hr(cv(l.value).pop())),!0));const c=Qy(a,o);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 yUe{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Kr(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=Kr(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return xb(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(Ro(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 CUe{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=>!Qu(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let mX=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}}};mX=D([_(2,zs)],mX);const Dw=class Dw{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 Dw.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Dw.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Dw.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Dw.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?"-":"+",r=Math.trunc(Math.abs(i/60)),o=r<10?"0"+r:r,a=Math.abs(i)-r*60,c=a<10?"0"+a:a;return n+o+":"+c}}};Dw.dayNames=[g(9881,"Sunday"),g(9882,"Monday"),g(9883,"Tuesday"),g(9884,"Wednesday"),g(9885,"Thursday"),g(9886,"Friday"),g(9887,"Saturday")],Dw.dayNamesShort=[g(9888,"Sun"),g(9889,"Mon"),g(9890,"Tue"),g(9891,"Wed"),g(9892,"Thu"),g(9893,"Fri"),g(9894,"Sat")],Dw.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")],Dw.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 _X=Dw;class SUe{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=JO(this._workspaceService.getWorkspace());if(!EEt(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(B_(e))return Kr(e.uri.path);let t=Kr(e.configPath.path);return t.endsWith(Tb)&&(t=t.substr(0,t.length-Tb.length-1)),t}_resoveWorkspacePath(e){if(B_(e))return Yw(e.uri.fsPath);const t=Kr(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?Yw(i):"/"}}class AUe{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 ao()}}var Av;const e_=class e_{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=d8(t.placeholders,Kg.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),r=this._snippet.fullLen(i),o=F.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+r)),a=i.isFinalTabstop?e_._decor.inactiveFinal:e_._decor.inactive,c=t.addDecoration(o,a);this._placeholderDecorations.set(i,c)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const n=[];for(const r of this._placeholderGroups[this._placeholderGroupsIdx])if(r.transform){const o=this._placeholderDecorations.get(r),a=this._editor.getModel().getDecorationRange(o),c=this._editor.getModel().getValueInRange(a),l=r.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 r=new Set,o=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const c=this._placeholderDecorations.get(a),l=this._editor.getModel().getDecorationRange(c);o.push(new ht(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(c,a.isFinalTabstop?e_._decor.activeFinal:e_._decor.active),r.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);n.changeDecorationOptions(h,d.isFinalTabstop?e_._decor.activeFinal:e_._decor.active),r.add(d)}}for(const[a,c]of this._placeholderDecorations)r.has(a)||n.changeDecorationOptions(c,a.isFinalTabstop?e_._decor.inactiveFinal:e_._decor.inactive);return o});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Kg){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 r=this._placeholderDecorations.get(n),o=this._editor.getModel().getDecorationRange(r);if(!o){e.delete(n.index);break}i.push(o)}}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 YU,!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 r=e.shift();console.assert(r._offset!==-1),console.assert(!r._placeholderDecorations);const o=r._snippet.placeholderInfo.last.index;for(const c of r._snippet.placeholderInfo.all)c.isFinalTabstop?c.index=n.index+(o+1)/this._nestingLevel:c.index=n.index+c.index/this._nestingLevel;this._snippet.replace(n,r._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const c of r._snippet.placeholders){const l=r._snippet.offset(c),d=r._snippet.fullLen(c),h=F.fromPositions(t.getPositionAt(r._offset+l),t.getPositionAt(r._offset+l+d)),u=i.addDecoration(h,e_._decor.inactive);this._placeholderDecorations.set(c,u)}}this._placeholderGroups=d8(this._snippet.placeholders,Kg.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}};e_._decor={active:Kt.register({description:"snippet-placeholder-1",stickiness:si.AlwaysGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),inactive:Kt.register({description:"snippet-placeholder-2",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),activeFinal:Kt.register({description:"snippet-placeholder-3",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"}),inactiveFinal:Kt.register({description:"snippet-placeholder-4",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"})};let vX=e_;const EUe={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let bX=Av=class{static adjustWhitespace(e,t,i,n,r){const o=e.getLineContent(t.lineNumber),a=hr(o,0,t.column-1);let c;return n.walk(l=>{if(!(l instanceof Kd)||l.parent instanceof YU||r&&!r.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(Ci)),p=e.invokeWithinContext(C=>new yUe(C.get(Os),u)),m=()=>a,v=u.getValueInRange(Av.adjustSelection(u,e.getSelection(),i,0)),b=u.getValueInRange(Av.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=Av.adjustSelection(u,C,i,0),k=Av.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 tv().parse(t,!0,r),z=P.getStartPosition(),G=Av.adjustWhitespace(u,z,o||A>0&&w!==u.getLineFirstNonWhitespaceColumn(C.positionLineNumber),R);R.resolveVariables(new bUe([p,new CUe(m,A,y.length,e.getOption(x.multiCursorPaste)==="spread"),new wUe(u,C,A,c),new mX(u,C,l),new _X,new SUe(f),new AUe])),d[A]=es.replace(P,R.toString()),d[A].identifier={major:A,minor:0},d[A]._isTracked=!0,h[A]=new vX(e,R,G)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,n,r,o,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const c=[],l=e.getModel(),d=new tv,h=new iG,u=new bUe([e.invokeWithinContext(p=>new yUe(p.get(Os),l)),new CUe(()=>r,0,e.getSelections().length,e.getOption(x.multiCursorPaste)==="spread"),new wUe(l,e.getSelection(),0,o),new mX(l,e.getSelection(),a),new _X,new SUe(e.invokeWithinContext(p=>p.get(Ci))),new AUe]);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 Kd(l.getValueInRange(L));h.appendChild(k),f+=k.value.length}const b=d.parseFragment(v,h);Av.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=es.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 vX(e,h,"")]}}constructor(e,t,i=EUe,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){wt(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"?Av.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):Av.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(r=>!!r.identifier);for(let r=0;rht.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=EUe){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=Av.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,r=>{const o=r.filter(c=>!!c.identifier);for(let c=0;cht.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{r.push(...n.get(o))})}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 r=0;r0}getEnclosingRange(){let e;for(const t of this._snippets){const i=t.getEnclosingRange();e?e=e.plusRange(i):e=i}return e}};bX=Av=D([_(3,zs)],bX);var BP;const IK={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var sy;let pc=(sy=class{static get(e){return e.getContribution(BP.ID)}constructor(e,t,i,n,r){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=r,this._snippetListener=new Z,this._modelVersionId=-1,this._inSnippet=BP.InSnippetMode.bindTo(n),this._hasNextTabstop=BP.HasNextTabstop.bindTo(n),this._hasPrevTabstop=BP.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"?IK:{...IK,...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"?IK:{...IK,...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?(Lt(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new bX(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()||!re.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{r?.dispose(),o=!1},c=()=>{o||(r=this._languageFeaturesService.completionProvider.register({language:n.getLanguageId(),pattern:n.uri.fsPath,scheme:n.uri.scheme,exclusive:!0},i),this._snippetListener.add(r),o=!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(()=>{fet(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()}},BP=sy,sy.ID="snippetController2",sy.InSnippetMode=new Q("inSnippetMode",!1,g(1558,"Whether the editor in current in snippet mode")),sy.HasNextTabstop=new Q("hasNextTabstop",!1,g(1559,"Whether there is a next tab stop when in snippet mode")),sy.HasPrevTabstop=new Q("hasPrevTabstop",!1,g(1560,"Whether there is a previous tab stop when in snippet mode")),sy);pc=BP=D([_(1,Ke),_(2,nt),_(3,Le),_(4,zs)],pc);on(pc.ID,pc,ai.Lazy);const Dce=uc.bindToContribution(pc.get);Qe(new Dce({id:"jumpToNextSnippetPlaceholder",precondition:he.and(pc.InSnippetMode,pc.HasNextTabstop),handler:s=>s.next(),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:S.Tab}}));Qe(new Dce({id:"jumpToPrevSnippetPlaceholder",precondition:he.and(pc.InSnippetMode,pc.HasPrevTabstop),handler:s=>s.prev(),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:U.Shift|S.Tab}}));Qe(new Dce({id:"leaveSnippet",precondition:pc.InSnippetMode,handler:s=>s.cancel(!0),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));Qe(new Dce({id:"acceptSnippet",precondition:pc.InSnippetMode,handler:s=>s.finish()}));let kbe=class extends V{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,r,o,a,c,l,d,h,u){super(),this.textModel=e,this.selectedSuggestItem=t,this._textModelVersionId=i,this._positions=n,this._debounceValue=r,this._suggestPreviewEnabled=o,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(Abe,this.textModel,this._textModelVersionId,this._debounceValue)),this._isActive=Yt(this,!1),this._forceUpdateExplicitlySignal=_C(this),this._selectedInlineCompletionId=Yt(this,void 0),this._primaryPosition=et(this,p=>this._positions.read(p)[0]??new re(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([NC.Redo,NC.Undo,NC.AcceptWord]),this._fetchInlineCompletionsPromise=jYe({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:nm.Automatic}),handleChange:(p,m)=>(p.didChange(this._textModelVersionId)&&this._preserveCurrentCompletionReasons.has(this._getReason(p.change))?m.preserveCurrentCompletion=!0:p.didChange(this._forceUpdateExplicitlySignal)&&(m.inlineCompletionTriggerKind=nm.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();is(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=Zh({owner:this,equalsFn:sW()},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=et(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=et(this,p=>{const m=this._filteredInlineCompletionItems.read(p),v=this.selectedInlineCompletionIndex.read(p);return m[v]}),this.activeCommands=Zh({owner:this,equalsFn:sW()},p=>this.selectedInlineCompletion.read(p)?.inlineCompletion.source.inlineCompletions.commands??[]),this.lastTriggerKind=this._source.inlineCompletions.map(this,p=>p?.request.context.triggerKind),this.inlineCompletionsCount=et(this,p=>{if(this.lastTriggerKind.read(p)===nm.Explicit)return this._filteredInlineCompletionItems.read(p).length}),this.state=Zh({owner:this,equalsFn:(p,m)=>!p||!m?p===m:cUe(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=PT(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,...uue(this.textModel,k,C)],R=P.map((G,Y)=>fUe(G,m,L,k[Y],A)).filter(Oc),z=R[0]??new X3(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,...uue(this.textModel,C,w)],L=A.map((k,P)=>fUe(k,m,y,C[P],0)).filter(Oc);return L[0]?{edits:A,primaryGhostText:L[0],ghostTexts:L,inlineCompletion:b,suggestItem:void 0}:void 0}}),this.ghostTexts=Zh({owner:this,equalsFn:cUe},p=>{const m=this.state.read(p);if(m)return m.ghostTexts}),this.primaryGhostText=Zh({owner:this,equalsFn:set},p=>{const m=this.state.read(p);if(m)return m?.primaryGhostText}),this._register(VN(this._fetchInlineCompletionsPromise));let f;this._register(ci(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?NC.Undo:e?.isRedoing?NC.Redo:this.isAcceptingPartially?NC.AcceptWord:NC.Other}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){IM(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){IM(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t),r=n?n.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(Oc);return kat(r,a=>{let c=a.toSingleTextEdit(t);return c=PT(c,i,F.fromPositions(c.range.getStartPosition(),e.range.getEndPosition())),het(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 Pi;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",[es.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),pc.get(e)?.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const n=t.edits,r=xUe(n).map(o=>ht.fromPositions(o));e.executeEdits("inlineSuggestion.accept",[...n.map(o=>es.replace(o.range,o.text)),...i.additionalTextEdits]),e.setSelections(r,"inlineCompletionAccept")}this.stop(),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,Nr),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const n=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),r=this._languageConfigurationService.getLanguageConfiguration(n),o=new RegExp(r.wordDefinition.source,r.wordDefinition.flags.replace("g","")),a=i.match(o);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},nD.Line)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new Pi;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const r=n.primaryGhostText,o=n.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){await this.accept(e);return}const a=r.parts[0],c=new re(r.lineNumber,a.column),l=a.text,d=t(c,l);if(d===l.length&&r.parts.length===1){this.accept(e);return}const h=l.substring(0,d),u=this._positions.get(),f=u[0];o.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const p=F.fromPositions(f,c),m=e.getModel().getValueInRange(p)+h,v=new lu(p,m),b=[v,...uue(this.textModel,u,v)],w=xUe(b).map(y=>ht.fromPositions(y));e.executeEdits("inlineSuggestion.accept",b.map(y=>es.replace(y.range,y.text))),e.setSelections(w,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),_t.Immediate)}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const p=F.fromPositions(o.range.getStartPosition(),ng.ofText(h).addToPosition(c)),m=e.getModel().getValueInRange(p,gr.LF);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,m.length,{kind:i})}}finally{o.source.removeRef()}}handleSuggestAccepted(e){const t=PT(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:nD.Suggest})}};kbe=D([_(9,we),_(10,bi),_(11,zs)],kbe);var NC;(function(s){s[s.Undo=0]="Undo",s[s.Redo=1]="Redo",s[s.AcceptWord=2]="AcceptWord",s[s.Other=3]="Other"})(NC||(NC={}));function uue(s,e,t){if(e.length===1)return[];const i=e[0],n=e.slice(1),r=t.range.getStartPosition(),o=t.range.getEndPosition(),a=s.getValueInRange(F.fromPositions(i,o)),c=lUe(i,r);if(c.lineNumber<1)return bt(new Pi(`positionWithinTextEdit line number should be bigger than 0. + Invalid subtraction between ${i.toString()} and ${r.toString()}`)),[];const l=rPt(t.text,c);return n.map(d=>{const h=SNt(lUe(d,r),o),u=s.getValueInRange(F.fromPositions(d,h)),f=Qy(a,u),p=F.fromPositions(d,d.delta(0,f));return new lu(p,l)})}function rPt(s,e){let t="";const i=Mct(s);for(let n=e.lineNumber-1;nr.range,F.compareRangesUsingStarts)),i=new G2(e.apply(s)).getNewRanges();return e.inverse().apply(i).map(r=>r.getEndPosition())}var wV;class KMe{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let r=0;rc&&h.type===i[l].completion.kind&&h.insertText===i[l].completion.insertText&&(c=h.touch,a=l),i[l].completion.preselect&&o===-1)return o=l}return a!==-1?a:o!==-1?o: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:x8.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class aPt extends KMe{constructor(){super("recentlyUsedByPrefix"),this._trie=Ih.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),r=`${e.getLanguageId()}/${n}`;this._trie.set(r,{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 r=`${e.getLanguageId()}/${n}`;let o=this._trie.get(r);if(o||(o=this._trie.findSubstr(r)),o)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:x8.fromString(i.type),this._trie.set(t,i)}}}var $D;let Ibe=($D=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Z,this._persistSoon=new ln(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===Ay.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=wV._strategyCtors.get(i)||DUe;this._strategy=new n;try{const o=this._configService.getValue("editor.suggest.shareSuggestSelections")?Ie.PROFILE:Ie.WORKSPACE,a=this._storageService.get(`${wV._storagePrefix}/${i}`,o);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(`${wV._storagePrefix}/${this._strategy.name}`,i,t,cn.MACHINE)}}},wV=$D,$D._strategyCtors=new Map([["recentlyUsedByPrefix",aPt],["recentlyUsed",oPt],["first",DUe]]),$D._storagePrefix="suggest/memories",$D);Ibe=wV=D([_(0,Gi),_(1,Te)],Ibe);const kce=ae("ISuggestMemories");ce(kce,Ibe,Qt.Delayed);var Tbe,kL;let wX=(kL=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=Tbe.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(),r=i.getWordAtPosition(n.getStartPosition());if(!r){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(r.endColumn===n.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},Tbe=kL,kL.AtEnd=new Q("atEndOfWord",!1),kL);wX=Tbe=D([_(1,Le)],wX);var yV,IL;let xW=(IL=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=yV.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(yV._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 r=t.items.length;r>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,!(n===i||!t.items[n].completion.additionalTextEdits));r--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=yV._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},yV=IL,IL.OtherSuggestions=new Q("hasOtherSuggestions",!1),IL);xW=yV=D([_(1,Le)],xW);const Mp=class Mp{async provideSelectionRanges(e,t){const i=[];for(const n of t){const r=[];i.push(r);const o=new Map;await new Promise(a=>Mp._bracketsRightYield(a,0,e,n,o)),await new Promise(a=>Mp._bracketsLeftYield(a,0,e,n,o,r))}return i}static _bracketsRightYield(e,t,i,n,r){const o=new Map,a=Date.now();for(;;){if(t>=Mp._maxRounds){e();break}if(!n){e();break}const c=i.bracketPairs.findNextBracket(n);if(!c){e();break}if(Date.now()-a>Mp._maxDuration){setTimeout(()=>Mp._bracketsRightYield(e,t+1,i,n,r));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText,h=o.has(d)?o.get(d):0;o.set(d,h+1)}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText;let h=o.has(d)?o.get(d):0;if(h-=1,o.set(d,Math.max(0,h)),h<0){let u=r.get(d);u||(u=new ul,r.set(d,u)),u.push(c.range)}}n=c.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,r,o){const a=new Map,c=Date.now();for(;;){if(t>=Mp._maxRounds&&r.size===0){e();break}if(!n){e();break}const l=i.bracketPairs.findPrevBracket(n);if(!l){e();break}if(Date.now()-c>Mp._maxDuration){setTimeout(()=>Mp._bracketsLeftYield(e,t+1,i,n,r,o));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=r.get(h);if(f){const p=f.shift();f.size===0&&r.delete(h);const m=F.fromPositions(l.range.getEndPosition(),p.getStartPosition()),v=F.fromPositions(l.range.getStartPosition(),p.getEndPosition());o.push({range:m}),o.push({range:v}),Mp._addBracketLeading(i,v,o)}}}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,r=e.getLineFirstNonWhitespaceColumn(n);r!==0&&r!==t.startColumn&&(i.push({range:F.fromPositions(new re(n,r),t.getEndPosition())}),i.push({range:F.fromPositions(new re(n,1),t.getEndPosition())}));const o=n-1;if(o>0){const a=e.getLineFirstNonWhitespaceColumn(o);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(o)&&(i.push({range:F.fromPositions(new re(o,a),t.getEndPosition())}),i.push({range:F.fromPositions(new re(o,1),t.getEndPosition())}))}}};Mp._maxDuration=30,Mp._maxRounds=2;let yX=Mp;const kw=class kw{static async create(e,t){if(!t.getOption(x.suggest).localityBonus||!t.hasModel())return kw.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return kw.None;const[r]=await new yX().provideSelectionRanges(i,[n]);if(r.length===0)return kw.None;const o=await e.computeWordRanges(i.uri,r[0].range);if(!o)return kw.None;const a=i.getWordUntilPosition(n);return delete o[a.word],new class extends kw{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=o[d];if(wU(h))return 2<<20;const u=k2(h,F.fromPositions(c),F.compareRangesUsingStarts),f=u>=0?h[u]:h[Math.max(0,~u-1)];let p=r.length;for(const m of r){if(!F.containsRange(m.range,f))break;p-=1}return p}}}};kw.None=new class extends kw{distance(){return 0}};let CX=kw,kUe=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};var BE;(function(s){s[s.Nothing=0]="Nothing",s[s.All=1]="All",s[s.Incr=2]="Incr"})(BE||(BE={}));class lx{constructor(e,t,i,n,r,o,a=p3.default,c=void 0){this.clipboardText=c,this._snippetCompareFn=lx._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=r,this._refilterKind=BE.All,this._lineContext=i,this._fuzzyScoreOptions=a,o==="top"?this._snippetCompareFn=lx._compareCompletionItemsSnippetsUp:o==="bottom"&&(this._snippetCompareFn=lx._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!==BE.Nothing&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",r="";const o=this._refilterKind===BE.All?this._items:this._filteredItems,a=[],c=!this._options.filterGraceful||o.length>2e3?qk:TSt;for(let l=0;l=f)d.score=O_.Default;else if(typeof d.completion.filterText=="string"){const m=c(n,r,p,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;AS(d.completion.filterText,d.textLabel)===0?d.score=m:(d.score=DSt(n,r,p,d.textLabel,d.labelLow,0),d.score[0]=m[0])}else{const m=c(n,r,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=BE.Nothing,this._stats={pLabelLen:e.length?lfe(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 lx._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 lx._compareCompletionItems(e,t)}}var Lbe;class QI{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 vD;(function(s){s[s.Idle=0]="Idle",s[s.Manual=1]="Manual",s[s.Auto=2]="Auto"})(vD||(vD={}));function cPt(s,e,t){if(!e.getContextKeyValue(Xu.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(Xu.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(x.inlineSuggest).suppressSuggestions}function lPt(s,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(Xu.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(x.inlineSuggest).suppressSuggestions}let SX=Lbe=class{constructor(e,t,i,n,r,o,a,c,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=r,this._contextKeyService=o,this._configurationService=a,this._languageFeaturesService=c,this._envService=l,this._toDispose=new Z,this._triggerCharacterListener=new Z,this._triggerQuickSuggest=new Em,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 ht(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(){wt(this._triggerCharacterListener),wt([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 r=e.get(n);r||(r=new Set,r.add(KNt()),e.set(n,r)),r.add(i)}const t=i=>{if(!lPt(this._editor,this._contextKeyService)||QI.shouldAutoTrigger(this._editor))return;if(!i){const o=this._editor.getPosition();i=this._editor.getModel().getLineContent(o.lineNumber).substr(0,o.column-1)}let n="";wM(i.charCodeAt(i.length-1))?Fc(i.charCodeAt(i.length-2))&&(n=i.substr(i.length-2)):n=i.charAt(i.length-1);const r=e.get(n);if(r){const o=new Map;if(this._completionModel)for(const[a,c]of this._completionModel.getItemsByProvider())r.has(a)||o.set(a,c);this.trigger({auto:!0,triggerKind:ju.TriggerCharacter,triggerCharacter:n,retrigger:!!this._completionModel,clipboardText:this._completionModel?.clipboardText,completionOptions:{providerFilter:r,providerItemsToReuse:o}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?vD.Auto:vD.Manual:vD.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!==Bi.NotSet&&e.reason!==Bi.Explicit||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===Bi.NotSet?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===Bi.Explicit&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){CF.isAllOff(this._editor.getOption(x.quickSuggestions))||this._editor.getOption(x.suggest).snippetsPreventQuickSuggestions&&pc.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!QI.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(!CF.isAllOff(i)){if(!CF.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),r=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(CF.valueFor(i,r)!=="on")return}cPt(this._editor,this._contextKeyService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}},this._editor.getOption(x.quickSuggestionsDelay)))}_refilterCompletionItems(){Lt(this._editor.hasModel()),Lt(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new QI(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new QI(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??ju.Invoke};e.triggerCharacter&&(n={triggerKind:ju.TriggerCharacter,triggerCharacter:e.triggerCharacter}),this._requestToken=new li;const r=this._editor.getOption(x.snippetSuggestions);let o=gA.Inline;switch(r){case"top":o=gA.Top;break;case"bottom":o=gA.Bottom;break}const{itemKind:a,showDeprecated:c}=Lbe.createSuggestFilter(this._editor),l=new Z3(o,e.completionOptions?.kindFilter??a,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,c),d=CX.create(this._editorWorkerService,this._editor),h=zMe(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 QI(m,this._editor.getPosition(),e),b={...p3.default,firstMatchCanBeWeak:!this._editor.getOption(x.suggest).matchOnWordStartOnly};if(this._completionModel=new lx(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(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(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(hr(e.leadingLineContent)!==hr(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(QI.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,r]of this._completionModel.getItemsByProvider())r.length>0&&r[0].container.incomplete?i.add(n):t.set(n,r);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:ju.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=QI.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})}}}}};SX=Lbe=D([_(1,Fl),_(2,gg),_(3,Ji),_(4,Ke),_(5,Le),_(6,Te),_(7,nt),_(8,ec)],SX);class dPt{constructor(e,t,i,n){this._disposables=new Z,this._disposables.add(i.onDidSuggest(r=>{r.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(r=>{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(r=>{if(this._active&&!t.isFrozen()&&i.state!==vD.Idle){const o=r.charCodeAt(r.length-1);this._active.acceptCharacters.has(o)&&e.getOption(x.acceptSuggestionOnCommitCharacter)&&n(this._active.item)}}))}_onItem(e){if(!e||!tr(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new cY;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 jse=class jse{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 r=!1;for(let a=0;ajse._maxSelectionLength)return;this._lastOvertyped[a]={value:o.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 Ac?i.createInstance(N6,a,{useComma:!0}):void 0;this._leftActions=new gd(this.element,{actionViewItemProvider:o}),this._rightActions=new gd(this.element,{actionViewItemProvider:o}),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[r,o]of e.getActions())r==="left"?i.push(...o):n.push(...o);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()}};Mbe=D([_(2,we),_(3,Wa),_(4,Le)],Mbe);var fPt=".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)}";gt(fPt,{});W("symbolIcon.arrayForeground",$i,g(9919,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.booleanForeground",$i,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",$i,g(9922,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.constantForeground",$i,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",$i,g(9929,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.folderForeground",$i,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",$i,g(9933,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.keywordForeground",$i,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",$i,g(9936,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.namespaceForeground",$i,g(9937,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.nullForeground",$i,g(9938,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.numberForeground",$i,g(9939,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.objectForeground",$i,g(9940,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.operatorForeground",$i,g(9941,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.packageForeground",$i,g(9942,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.propertyForeground",$i,g(9943,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.referenceForeground",$i,g(9944,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.snippetForeground",$i,g(9945,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.stringForeground",$i,g(9946,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.structForeground",$i,g(9947,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.textForeground",$i,g(9948,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.typeParameterForeground",$i,g(9949,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.unitForeground",$i,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 qMe{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 wn(0,0),this._minSize=new wn(0,0),this._maxSize=new wn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Wd(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:pi.VERTICAL}),this._westSash=new Wd(this.domNode,{getVerticalSashLeft:()=>0},{orientation:pi.VERTICAL}),this._northSash=new Wd(this.domNode,{getHorizontalSashTop:()=>0},{orientation:pi.HORIZONTAL,orthogonalEdge:_J.North}),this._southSash=new Wd(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:pi.HORIZONTAL,orthogonalEdge:_J.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:r,width:o}=this._maxSize;e=Math.max(i,Math.min(r,e)),t=Math.max(n,Math.min(o,t));const a=new wn(t,e);wn.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 QMe(s){return!!s&&!!(s.completion.documentation||s.completion.detail&&s.completion.detail!==s.completion.label)}let Nbe=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 wn(330,0),this.domNode=fe(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Z_,{editor:e}),this._body=fe(".body"),this._scrollbar=new MU(this._body,{alwaysConsumeMouseWheel:!0}),oe(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=oe(this._body,fe(".header")),this._close=oe(this._header,fe("span"+He.asCSSSelector(ve.close))),this._close.title=g(9952,"Close"),this._type=oe(this._header,fe("p.type")),this._docs=oe(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,r=e.get(x.suggestLineHeight)||t.lineHeight,o=t.fontWeight,a=`${n}px`,c=`${r}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${r/n}`,this.domNode.style.fontWeight=o,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 r="";r+=`score: ${e.score[0]} `,r+=`prefix: ${e.word??"(no prefix)"} `,r+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,r+=`distance: ${e.distance} (localityBonus-setting) `,r+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,r+=`commit_chars: ${e.completion.commitCharacters?.join("")} -`,n=new Nt().appendCodeblock("empty",r),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!QMe(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const r=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=r,this._type.title=r,Xh(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(r))}else Ns(this._type),this._type.title="",Gd(this._type),this.domNode.classList.add("no-type");if(Ns(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),Ns(this._docs);const r=this._markdownRenderer.render(n);this._docs.appendChild(r.element),this._renderDisposeable.add(r),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=r=>{r.preventDefault(),r.stopPropagation()},this._close.onclick=r=>{r.preventDefault(),r.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 wn(e,t);wn.equals(i,this._size)||(this._size=i,lqe(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}};Nbe=D([_(1,we)],Nbe);class pPt{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 qMe,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,r=0,o=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&&(o=n.width-a.dimension.width,c=!0),a.north&&(r=n.height-a.dimension.height,c=!0),c&&this._applyTopLeft({top:i.top+r,left:i.left+o})}a.done&&(i=void 0,n=void 0,r=0,o=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=K_(this.getDomNode().ownerDocument.body),r=this.widget.getLayoutInfo(),o=new wn(220,2*r.lineHeight),a=e.top,c=function(){const A=n.width-(e.left+e.width+r.borderWidth+r.horizontalPadding),L=-r.borderWidth+e.left+e.width,k=new wn(A,n.height-e.top-r.borderHeight-r.verticalPadding),P=k.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:L,fit:A-t.width,maxSizeTop:k,maxSizeBottom:P,minSize:o.with(Math.min(A,o.width))}}(),l=function(){const A=e.left-r.borderWidth-r.horizontalPadding,L=Math.max(r.horizontalPadding,e.left-t.width-r.borderWidth),k=new wn(A,n.height-e.top-r.borderHeight-r.verticalPadding),P=k.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:L,fit:A-t.width,maxSizeTop:k,maxSizeBottom:P,minSize:o.with(Math.min(A,o.width))}}(),d=function(){const A=e.left,L=-r.borderWidth+e.top+e.height,k=new wn(e.width-r.borderHeight,n.height-e.top-e.height-r.verticalPadding);return{top:L,left:A,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:o.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-r.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 mPt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function Wx(s,e,t,i,n){if(He.isThemeIcon(n))return[`codicon-${n.id}`,"predefined-file-icon"];if(N.isUri(n))return[];const r=i===wa.ROOT_FOLDER?["rootfolder-icon"]:i===wa.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===pe.data)o=Wk.parseMetaData(t).get(Wk.META_DATA_LABEL);else{const a=t.path.match(mPt);a?(o=TK(a[2].toLowerCase()),a[1]&&r.push(`${TK(a[1].toLowerCase())}-name-dir-icon`)):o=TK(t.authority.toLowerCase())}if(i===wa.ROOT_FOLDER)r.push(`${o}-root-name-folder-icon`);else if(i===wa.FOLDER)r.push(`${o}-name-folder-icon`);else{if(o){if(r.push(`${o}-name-file-icon`),r.push("name-file-icon"),o.length<=255){const c=o.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=met(t),i.colorspan.style.backgroundColor="";const r={labelEscapeNewLines:!0,matches:NU(e.score)},o=[];if(n.kind===Me.Color&&bPt.extract(e,o))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=o[0];else if(n.kind===Me.File&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=Wx(this._modelService,this._languageService,N.from({scheme:"fake",path:e.textLabel}),wa.FILE),c=Wx(this._modelService,this._languageService,N.from({scheme:"fake",path:n.detail}),wa.FILE);r.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",r.extraClasses=[Wx(this._modelService,this._languageService,N.from({scheme:"fake",path:e.textLabel}),wa.FOLDER),Wx(this._modelService,this._languageService,N.from({scheme:"fake",path:n.detail}),wa.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...He.asClassNameArray(x8.toIcon(n.kind))));n.tags&&n.tags.indexOf(F2.Deprecated)>=0&&(r.extraClasses=(r.extraClasses||[]).concat(["deprecated"]),r.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,r),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=gue(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=gue(n.label.detail||""),i.detailsLabel.textContent=gue(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(x.suggest).showInlineDetails?Xh(i.detailsLabel):Gd(i.detailsLabel),QMe(e)?(i.right.classList.add("can-expand-details"),Xh(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"),Gd(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};Pbe=D([_(1,fi),_(2,Di),_(3,mn)],Pbe);function gue(s){return s.replace(/\r\n|\r|\n/g,"")}var WP;W("editorSuggestWidget.background",kh,g(5228,"Background color of the suggest widget."));W("editorSuggestWidget.border",v6,g(5229,"Border color of the suggest widget."));const wPt=W("editorSuggestWidget.foreground",Nl,g(5230,"Foreground color of the suggest widget."));W("editorSuggestWidget.selectedForeground",e3,g(5231,"Foreground color of the selected entry in the suggest widget."));W("editorSuggestWidget.selectedIconForeground",lLe,g(5232,"Icon foreground color of the selected entry in the suggest widget."));const yPt=W("editorSuggestWidget.selectedBackground",t3,g(5233,"Background color of the selected entry in the suggest widget."));W("editorSuggestWidget.highlightForeground",lF,g(5234,"Color of the match highlights in the suggest widget."));W("editorSuggestWidget.focusHighlightForeground",Nmt,g(5235,"Color of the match highlights in the suggest widget when an item is focused."));W("editorSuggestWidgetStatus.foreground",rt(wPt,.5),g(5236,"Foreground color of the suggest widget status."));var vn;(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"})(vn||(vn={}));class CPt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof uf}`}restore(){const e=this._service.get(this._key,Ie.PROFILE)??"";try{const t=JSON.parse(e);if(wn.is(t))return wn.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),Ie.PROFILE,cn.MACHINE)}reset(){this._service.remove(this._key,Ie.PROFILE)}}var GD;let Fbe=(GD=class{constructor(e,t,i,n,r){this.editor=e,this._storageService=t,this._state=vn.Hidden,this._isAuto=!1,this._pendingLayout=new yn,this._pendingShowDetails=new yn,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new Em,this._disposables=new Z,this._onDidSelect=new Nk,this._onDidFocus=new Nk,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 qMe,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new SPt(this,e),this._persistedSize=new CPt(t,e);class o{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 o(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 wn(v,b))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=oe(this.element.domNode,fe(".message")),this._listElement=oe(this.element.domNode,fe(".tree"));const c=this._disposables.add(r.createInstance(Nbe,this.editor));c.onDidClose(this.toggleDetails,this,this._disposables),this._details=new pPt(c,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(x.suggest).showIcons);l();const d=r.createInstance(Pbe,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Za("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=qp("{0}{1}",m||"",p?typeof p=="string"?p:p.value:"");return g(5243,"{0}, docs: {1}",f,v)}}}),this._list.style($N({listInactiveFocusBackground:yPt,listInactiveFocusOutline:Xs})),this._status=r.createInstance(Mbe,this.element.domNode,_D);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=Vi.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Vi.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Vi.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Vi.HasFocusedSuggestion.bindTo(i),this._disposables.add(Rr(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!==vn.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=Fy(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=Mo(async n=>{const r=Zy(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),o=n.onCancellationRequested(()=>r.dispose());try{return await t.resolve(n)}finally{r.dispose(),o.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:met(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===vn.Frozen),this.element.domNode.classList.remove("message"),e){case vn.Hidden:Gd(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 vn.Loading:this.element.domNode.classList.add("message"),this._messageElement.textContent=WP.LOADING_MESSAGE,Gd(this._listElement,this._status.element),Xh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,xh(WP.LOADING_MESSAGE);break;case vn.Empty:this.element.domNode.classList.add("message"),this._messageElement.textContent=WP.NO_SUGGESTIONS_MESSAGE,Gd(this._listElement,this._status.element),Xh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,xh(WP.NO_SUGGESTIONS_MESSAGE);break;case vn.Open:Gd(this._messageElement),Xh(this._listElement,this._status.element),this._show();break;case vn.Frozen:Gd(this._messageElement),Xh(this._listElement,this._status.element),this._show();break;case vn.Details:Gd(this._messageElement),Xh(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===vn.Hidden&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Zy(()=>this._setState(vn.Loading),t)))}showSuggestions(e,t,i,n,r){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!==vn.Empty&&this._state!==vn.Hidden){this._setState(vn.Frozen);return}const o=this._completionModel.items.length,a=o===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(o>1),a){this._setState(n?vn.Hidden:vn.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?vn.Frozen:vn.Open),this._list.reveal(t,0),this._list.setFocus(r?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=eY(lt(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 vn.Hidden:return!1;case vn.Details:return this._details.widget.pageDown(),!0;case vn.Loading:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case vn.Hidden:return!1;case vn.Loading:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case vn.Hidden:return!1;case vn.Details:return this._details.widget.scrollBottom(),!0;case vn.Loading:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case vn.Hidden:return!1;case vn.Details:return this._details.widget.pageUp(),!0;case vn.Loading:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case vn.Hidden:return!1;case vn.Loading:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case vn.Hidden:return!1;case vn.Details:return this._details.widget.scrollTop(),!0;case vn.Loading:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==vn.Hidden&&this._state!==vn.Empty&&this._state!==vn.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===vn.Details?(this._setState(vn.Open),this._details.widget.domNode.classList.remove("focused")):this._state===vn.Open&&this._isDetailsVisible()&&(this._setState(vn.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")):(QMe(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===vn.Open||this._state===vn.Details||this._state===vn.Frozen)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=eY(lt(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(vn.Hidden),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.heighto&&(r=o);const a=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:r,c=i.statusBarHeight+this._list.contentHeight+i.borderHeight,l=i.itemHeight+i.statusBarHeight,d=So(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(ts.ABOVE),this.element.enableSashes(!0,!0,!1,!1),v=m):(this._contentWidget.setPreference(ts.BELOW),this.element.enableSashes(!1,!0,!0,!1),v=f),this.element.preferredSize=new wn(a,i.defaultSize.height),this.element.maxSize=new wn(o,v),this.element.minSize=new wn(220,l),this._cappedHeight=n===c?{wanted:this._cappedHeight?.wanted??e.height,capped:n}:void 0}this._resize(r,n)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:r}=this.getLayoutInfo();this._list.layout(t-r,e),this._listElement.style.height=`${t-r}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]===ts.BELOW)}getLayoutInfo(){const e=this.editor.getOption(x.fontInfo),t=qa(this.editor.getOption(x.suggestLineHeight)||e.lineHeight,8,1e3),i=!this.editor.getOption(x.suggest).showStatusBar||this._state===vn.Empty||this._state===vn.Loading?0:t,n=this._details.widget.borderWidth,r=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:r,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new wn(430,i+12*t+r)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",Ie.PROFILE,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,Ie.PROFILE,cn.USER)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},WP=GD,GD.LOADING_MESSAGE=g(5237,"Loading..."),GD.NO_SUGGESTIONS_MESSAGE=g(5238,"No suggestions."),GD);Fbe=WP=D([_(1,Gi),_(2,Le),_(3,mn),_(4,we)],Fbe);class SPt{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 wn(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 Obe;class APt{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Kt.register({description:"suggest-line-suffix",stickiness:si.NeverGrowsWhenTypingAtEdges}),e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),r=e.getPositionAt(n+1);e.changeDecorations(o=>{this._marker&&o.removeDecoration(this._marker),this._marker=o.addDecoration(F.fromPositions(t,r),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 Ul;(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"})(Ul||(Ul={}));var TL;let tf=(TL=class{static get(e){return e.getContribution(Obe.ID)}constructor(e,t,i,n,r,o,a){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=r,this._logService=o,this._telemetryService=a,this._lineSuffix=new yn,this._toDispose=new Z,this._selectors=new EPt(h=>h.priority),this._onWillInsertSuggestItem=new I,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=r.createInstance(SX,this.editor),this._selectors.register({priority:0,select:(h,u,f)=>this._memoryService.select(h,u,f)});const c=Vi.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 o5(lt(e.getDomNode()),()=>{const h=this._instantiationService.createInstance(Fbe,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(v=>this._insertSuggestion(v,Ul.None),this));const u=new dPt(this.editor,h,this.model,v=>this._insertSuggestion(v,Ul.NoAfterUndoStop));this._toDispose.add(u);const f=Vi.MakesTextEdit.bindTo(this._contextKeyService),p=Vi.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=Vi.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===vD.Auto&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&Zg.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(!re.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 Lh(!0,!1,!1,!1,S.KeyC))||jt&&v.toKeyCodeChord().equals(new Lh(!1,!1,!1,!0,S.KeyC))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),h})),this._overtypingCapturer=this._toDispose.add(new o5(lt(e.getDomNode()),()=>this._toDispose.add(new Rbe(this.editor,this.model)))),this._alternatives=this._toDispose.add(new o5(lt(e.getDomNode()),()=>this._toDispose.add(new xW(this.editor,this._contextKeyService)))),this._toDispose.add(r.createInstance(wX,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new APt(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===vD.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!==ju.TriggerCharacter:p.selectionMode==="whenQuickSuggestion"&&(f=h.triggerOptions.triggerKind===ju.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=Vi.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=pc.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),r=n.getAlternativeVersionId(),{item:o}=e,a=[],c=new li;t&Ul.NoBeforeUndoStop||this.editor.pushUndoStop();const l=this.getOverwriteInfo(o,!!(t&Ul.AlternativeOverwriteConfig));this._memoryService.memorize(n,this.editor.getPosition(),o);const d=o.isResolved;let h=-1,u=-1;if(Array.isArray(o.completion.additionalTextEdits)){this.model.cancel();const p=ym.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map(m=>{let v=F.lift(m.range);if(v.startLineNumber===o.position.lineNumber&&v.startColumn>o.position.column){const b=this.editor.getPosition().column-o.position.column,w=b,y=F.spansMultipleLines(v)?0:b;v=new F(v.startLineNumber,v.startColumn+w,v.endLineNumber,v.endColumn+y)}return es.replaceMove(v,m.text)})),p.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const p=new Ys;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||re.isBefore(L,m))&&(m=L)}}),b=t;t|=Ul.NoAfterUndoStop;let w=!1;const y=this.editor.onWillType(()=>{y.dispose(),w=!0,b&Ul.NoAfterUndoStop||this.editor.pushUndoStop()});a.push(o.resolve(c.token).then(()=>{if(!o.completion.additionalTextEdits||c.token.isCancellationRequested)return;if(m&&o.completion.additionalTextEdits.some(A=>re.isBefore(m,F.getStartPosition(A.range))))return!1;w&&this.editor.pushUndoStop();const C=ym.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map(A=>es.replaceMove(F.lift(A.range),A.text))),C.restoreRelativeVerticalPositionOfCursor(this.editor),(w||!(b&Ul.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}=o.completion;if(o.completion.insertTextRules&Zg.InsertAsSnippet||(f=tv.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(o.completion.insertTextRules&Zg.KeepWhitespace),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&Ul.NoAfterUndoStop||this.editor.pushUndoStop(),o.completion.command)if(o.completion.command.id===AX.id)this.model.trigger({auto:!0,retrigger:!0});else{const p=new Ys;a.push(this._commandService.executeCommand(o.completion.command.id,...o.completion.command.arguments?[...o.completion.command.arguments]:[]).catch(m=>{o.completion.extensionId?Nr(m):bt(m)}).finally(()=>{h=p.elapsed()}))}t&Ul.KeepAlternativeSuggestions&&this._alternatives.value.set(e,p=>{for(c.cancel();n.canUndo();){r!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(p,Ul.NoBeforeUndoStop|Ul.NoAfterUndoStop|(t&Ul.AlternativeOverwriteConfig?Ul.AlternativeOverwriteConfig:0));break}}),this._alertCompletionItem(o),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(o,n,d,h,u),this.model.clear(),c.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,n,r){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:Hc(vi(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:xU(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:r})}getOverwriteInfo(e,t){Lt(this.editor.hasModel());let i=this.editor.getOption(x.suggest).insertMode==="replace";t&&(i=!i);const n=e.position.column-e.editStart.column,r=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,o=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:n+o,overwriteAfter:r+a}}_alertCompletionItem(e){if(tr(e.completion.additionalTextEdits)){const t=g(1562,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);No(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(),_t.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=r=>{if(r.completion.insertTextRules&Zg.InsertAsSnippet||r.completion.additionalTextEdits)return!0;const o=this.editor.getPosition(),a=r.editStart.column,c=o.column;return c-a!==r.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:o.lineNumber,startColumn:a,endLineNumber:o.lineNumber,endColumn:c})!==r.completion.insertText};M.once(this.model.onDidTrigger)(r=>{const o=[];M.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{wt(o),i()},void 0,o),this.model.onDidSuggest(({completionModel:a})=>{if(wt(o),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},Ul.KeepAlternativeSuggestions|Ul.NoBeforeUndoStop|Ul.NoAfterUndoStop)},void 0,o)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,_t.Smooth),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=Ul.KeepAlternativeSuggestions),t&&(n|=Ul.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)}},Obe=TL,TL.ID="editor.contrib.suggestController",TL);tf=Obe=D([_(1,kce),_(2,bi),_(3,Le),_(4,we),_(5,Ke),_(6,Ji)],tf);class EPt{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 Yse=class Yse extends it{constructor(){super({id:Yse.id,label:g(1563,"Trigger Suggest"),alias:"Trigger Suggest",precondition:he.and(J.writable,J.hasCompletionItemProvider,Vi.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=tf.get(t);if(!n)return;let r;i&&typeof i=="object"&&i.auto===!0&&(r=!0),n.triggerSuggest(void 0,r,void 0)}};Yse.id="editor.action.triggerSuggest";let AX=Yse;on(tf.ID,tf,ai.BeforeFirstInteraction);Re(AX);const Sp=Ae.EditorContrib+90,vu=uc.bindToContribution(tf.get);Qe(new vu({id:"acceptSelectedSuggestion",precondition:he.and(Vi.Visible,Vi.HasFocusedSuggestion),handler(s){s.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:S.Tab,kbExpr:he.and(Vi.Visible,J.textInputFocus),weight:Sp},{primary:S.Enter,kbExpr:he.and(Vi.Visible,J.textInputFocus,Vi.AcceptSuggestionsOnEnter,Vi.MakesTextEdit),weight:Sp}],menuOpts:[{menuId:_D,title:g(1564,"Insert"),group:"left",order:1,when:Vi.HasInsertAndReplaceRange.toNegated()},{menuId:_D,title:g(1564,"Insert"),group:"left",order:1,when:he.and(Vi.HasInsertAndReplaceRange,Vi.InsertMode.isEqualTo("insert"))},{menuId:_D,title:g(1565,"Replace"),group:"left",order:1,when:he.and(Vi.HasInsertAndReplaceRange,Vi.InsertMode.isEqualTo("replace"))}]}));Qe(new vu({id:"acceptAlternativeSelectedSuggestion",precondition:he.and(Vi.Visible,J.textInputFocus,Vi.HasFocusedSuggestion),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:U.Shift|S.Enter,secondary:[U.Shift|S.Tab]},handler(s){s.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:_D,group:"left",order:2,when:he.and(Vi.HasInsertAndReplaceRange,Vi.InsertMode.isEqualTo("insert")),title:g(1565,"Replace")},{menuId:_D,group:"left",order:2,when:he.and(Vi.HasInsertAndReplaceRange,Vi.InsertMode.isEqualTo("replace")),title:g(1564,"Insert")}]}));vt.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Qe(new vu({id:"hideSuggestWidget",precondition:Vi.Visible,handler:s=>s.cancelSuggestWidget(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));Qe(new vu({id:"selectNextSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectNextSuggestion(),kbOpts:{weight:Sp,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 vu({id:"selectNextPageSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectNextPageSuggestion(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:S.PageDown,secondary:[U.CtrlCmd|S.PageDown]}}));Qe(new vu({id:"selectLastSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectLastSuggestion()}));Qe(new vu({id:"selectPrevSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevSuggestion(),kbOpts:{weight:Sp,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 vu({id:"selectPrevPageSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevPageSuggestion(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:S.PageUp,secondary:[U.CtrlCmd|S.PageUp]}}));Qe(new vu({id:"selectFirstSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectFirstSuggestion()}));Qe(new vu({id:"focusSuggestion",precondition:he.and(Vi.Visible,Vi.HasFocusedSuggestion.negate()),handler:s=>s.focusSuggestion(),kbOpts:{weight:Sp,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 vu({id:"focusAndAcceptSuggestion",precondition:he.and(Vi.Visible,Vi.HasFocusedSuggestion.negate()),handler:s=>{s.focusSuggestion(),s.acceptSelectedSuggestion(!0,!1)}}));Qe(new vu({id:"toggleSuggestionDetails",precondition:he.and(Vi.Visible,Vi.HasFocusedSuggestion),handler:s=>s.toggleSuggestionDetails(),kbOpts:{weight:Sp,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:_D,group:"right",order:1,when:he.and(Vi.DetailsVisible,Vi.CanResolve),title:g(1566,"show less")},{menuId:_D,group:"right",order:1,when:he.and(Vi.DetailsVisible.toNegated(),Vi.CanResolve),title:g(1567,"show more")}]}));Qe(new vu({id:"toggleExplainMode",precondition:Vi.Visible,handler:s=>s.toggleExplainMode(),kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Slash}}));Qe(new vu({id:"toggleSuggestionFocus",precondition:Vi.Visible,handler:s=>s.toggleSuggestionFocus(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Alt|S.Space,mac:{primary:U.WinCtrl|U.Alt|S.Space}}}));Qe(new vu({id:"insertBestCompletion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),wX.AtEnd,Vi.Visible.toNegated(),xW.OtherSuggestions.toNegated(),pc.InSnippetMode.toNegated()),handler:(s,e)=>{s.triggerSuggestAndAcceptBest(In(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:Sp,primary:S.Tab}}));Qe(new vu({id:"insertNextSuggestion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),xW.OtherSuggestions,Vi.Visible.toNegated(),pc.InSnippetMode.toNegated()),handler:s=>s.acceptNextSuggestion(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:S.Tab}}));Qe(new vu({id:"insertPrevSuggestion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),xW.OtherSuggestions,Vi.Visible.toNegated(),pc.InSnippetMode.toNegated()),handler:s=>s.acceptPrevSuggestion(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:U.Shift|S.Tab}}));Re(class extends it{constructor(){super({id:"editor.action.resetSuggestSize",label:g(1568,"Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(s,e){tf.get(e)?.resetWidgetSize()}});class xPt 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(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 n=tf.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?PT(h,d):void 0;if(!u)return-1;const f=re.lift(c),p=l.map((v,b)=>{const w=G5.fromSuggestion(n,d,f,v,this.isShiftKeyPressed),y=PT(w.toSingleTextEdit(),d),C=het(u,y);return{index:b,valid:C,prefixLength:y.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),m=aTe(p,Sc(v=>v.prefixLength,ru));return m?m.index:-1}}));let r=!1;const o=()=>{r||(r=!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=>{o()})),this._register(n.onWillInsertSuggestItem(a=>{const c=this.editor.getPosition(),l=this.editor.getModel();if(!c||!l)return;const d=G5.fromSuggestion(n,l,c,a.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!DPt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=tf.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 G5.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){tf.get(this.editor)?.stopForceRenderingAbove()}forceRenderingAbove(){tf.get(this.editor)?.forceRenderingAbove()}}class G5{static fromSuggestion(e,t,i,n,r){let{insertText:o}=n.completion,a=!1;if(n.completion.insertTextRules&Zg.InsertAsSnippet){const l=new tv().parse(o);l.children.length<100&&bX.adjustWhitespace(t,i,!0,l),o=l.toString(),a=!0}const c=e.getOverwriteInfo(n,r);return new G5(F.fromPositions(i.delta(0,-c.overwriteBefore),i.delta(0,Math.max(c.overwriteAfter,0))),o,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 OKe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new lu(this.range,this.insertText)}}function DPt(s,e){return s===e?!0:!s||!e?!1:s.equals(e)}var Bbe,LL;let mu=(LL=class extends V{static get(e){return e.getContribution(Bbe.ID)}constructor(e,t,i,n,r,o,a,c,l,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=r,this._debounceService=o,this._languageFeaturesService=a,this._accessibilitySignalService=c,this._keybindingService=l,this._accessibilityService=d,this._editorObs=eu(this.editor),this._positions=et(this,u=>this._editorObs.selections.read(u)?.map(f=>f.getEndPosition())??[new re(1,1)]),this._suggestWidgetAdaptor=this._register(new xPt(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=qn(this,u=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(f=>u(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem),this._enabledInConfig=qn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).enabled),this._isScreenReaderEnabled=qn(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=qn(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=et(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=vh(this,u=>{if(this._editorObs.isReadonly.read(u))return;const f=this._editorObs.model.read(u);return f?this._instantiationService.createInstance(kbe,f,this._suggestWidgetSelectedItem,this._editorObs.versionId,this._positions,this._debounceValue,qn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.suggest).preview),qn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.suggest).previewMode),qn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).mode),this._enabled):void 0}).recomputeInitiallyAndOnChange(this._store),this._ghostTexts=et(this,u=>this.model.read(u)?.ghostTexts.read(u)??[]),this._stablizedGhostTexts=kPt(this._ghostTexts,this._store),this._ghostTextWidgets=lJ(this,this._stablizedGhostTexts,(u,f)=>f.add(this._instantiationService.createInstance(bbe,this.editor,{ghostText:u,minReservedLineCount:rd(0),targetTextModel:this.model.map(p=>p?.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=_C(this),this._fontFamily=qn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).fontFamily),this._register(new Xu(this._contextKeyService,this.model)),this._register(Ove(this._editorObs.onDidType,(u,f)=>{this._enabled.get()&&this.model.get()?.trigger()})),this._register(this._commandService.onDidExecuteCommand(u=>{new Set([VO.Tab.id,VO.DeleteLeft.id,VO.DeleteRight.id,tet,"acceptSelectedSuggestion"]).has(u.commandId)&&e.hasTextFocus()&&this._enabled.get()&&this._editorObs.forceUpdate(p=>{this.model.get()?.trigger(p)})})),this._register(Ove(this._editorObs.selections,(u,f)=>{f.some(p=>p.reason===Bi.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||AW.dropDownVisible||is(u=>{this.model.get()?.stop(u)})})),this._register(ci(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=L6(this,(u,f)=>{const m=this.model.read(u)?.state.read(u);return this._suggestWidgetSelectedItem.get()?f:m?.inlineCompletion?.semanticId});this._register(t1t(et(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 Ao(50,bfe(p)),await B5(this._suggestWidgetSelectedItem,Ja,()=>!1,bfe(p)),await this._accessibilitySignalService.playSignal(ll.inlineSuggestion),this.editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&this._provideScreenReaderUpdate(v.primaryGhostText.renderForScreenReader(b))})),this._register(new wbe(this.editor,this.model,this._instantiationService)),this._register(bNt(et(u=>{const f=this._fontFamily.read(u);return f===""||f==="default"?"":` +`,n=new Nt().appendCodeblock("empty",r),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!QMe(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const r=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=r,this._type.title=r,Xh(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(r))}else Ns(this._type),this._type.title="",Gd(this._type),this.domNode.classList.add("no-type");if(Ns(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),Ns(this._docs);const r=this._markdownRenderer.render(n);this._docs.appendChild(r.element),this._renderDisposeable.add(r),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=r=>{r.preventDefault(),r.stopPropagation()},this._close.onclick=r=>{r.preventDefault(),r.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 wn(e,t);wn.equals(i,this._size)||(this._size=i,lqe(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}};Nbe=D([_(1,we)],Nbe);class pPt{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 qMe,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,r=0,o=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&&(o=n.width-a.dimension.width,c=!0),a.north&&(r=n.height-a.dimension.height,c=!0),c&&this._applyTopLeft({top:i.top+r,left:i.left+o})}a.done&&(i=void 0,n=void 0,r=0,o=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=K_(this.getDomNode().ownerDocument.body),r=this.widget.getLayoutInfo(),o=new wn(220,2*r.lineHeight),a=e.top,c=function(){const A=n.width-(e.left+e.width+r.borderWidth+r.horizontalPadding),L=-r.borderWidth+e.left+e.width,k=new wn(A,n.height-e.top-r.borderHeight-r.verticalPadding),P=k.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:L,fit:A-t.width,maxSizeTop:k,maxSizeBottom:P,minSize:o.with(Math.min(A,o.width))}}(),l=function(){const A=e.left-r.borderWidth-r.horizontalPadding,L=Math.max(r.horizontalPadding,e.left-t.width-r.borderWidth),k=new wn(A,n.height-e.top-r.borderHeight-r.verticalPadding),P=k.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:L,fit:A-t.width,maxSizeTop:k,maxSizeBottom:P,minSize:o.with(Math.min(A,o.width))}}(),d=function(){const A=e.left,L=-r.borderWidth+e.top+e.height,k=new wn(e.width-r.borderHeight,n.height-e.top-e.height-r.verticalPadding);return{top:L,left:A,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:o.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-r.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 mPt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function Wx(s,e,t,i,n){if(He.isThemeIcon(n))return[`codicon-${n.id}`,"predefined-file-icon"];if(N.isUri(n))return[];const r=i===wa.ROOT_FOLDER?["rootfolder-icon"]:i===wa.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===pe.data)o=Wk.parseMetaData(t).get(Wk.META_DATA_LABEL);else{const a=t.path.match(mPt);a?(o=TK(a[2].toLowerCase()),a[1]&&r.push(`${TK(a[1].toLowerCase())}-name-dir-icon`)):o=TK(t.authority.toLowerCase())}if(i===wa.ROOT_FOLDER)r.push(`${o}-root-name-folder-icon`);else if(i===wa.FOLDER)r.push(`${o}-name-folder-icon`);else{if(o){if(r.push(`${o}-name-file-icon`),r.push("name-file-icon"),o.length<=255){const c=o.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=met(t),i.colorspan.style.backgroundColor="";const r={labelEscapeNewLines:!0,matches:NU(e.score)},o=[];if(n.kind===Me.Color&&bPt.extract(e,o))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=o[0];else if(n.kind===Me.File&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=Wx(this._modelService,this._languageService,N.from({scheme:"fake",path:e.textLabel}),wa.FILE),c=Wx(this._modelService,this._languageService,N.from({scheme:"fake",path:n.detail}),wa.FILE);r.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",r.extraClasses=[Wx(this._modelService,this._languageService,N.from({scheme:"fake",path:e.textLabel}),wa.FOLDER),Wx(this._modelService,this._languageService,N.from({scheme:"fake",path:n.detail}),wa.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...He.asClassNameArray(x8.toIcon(n.kind))));n.tags&&n.tags.indexOf(F2.Deprecated)>=0&&(r.extraClasses=(r.extraClasses||[]).concat(["deprecated"]),r.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,r),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=gue(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=gue(n.label.detail||""),i.detailsLabel.textContent=gue(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(x.suggest).showInlineDetails?Xh(i.detailsLabel):Gd(i.detailsLabel),QMe(e)?(i.right.classList.add("can-expand-details"),Xh(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"),Gd(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};Pbe=D([_(1,fi),_(2,Di),_(3,mn)],Pbe);function gue(s){return s.replace(/\r\n|\r|\n/g,"")}var WP;W("editorSuggestWidget.background",kh,g(5228,"Background color of the suggest widget."));W("editorSuggestWidget.border",v6,g(5229,"Border color of the suggest widget."));const wPt=W("editorSuggestWidget.foreground",Pl,g(5230,"Foreground color of the suggest widget."));W("editorSuggestWidget.selectedForeground",e3,g(5231,"Foreground color of the selected entry in the suggest widget."));W("editorSuggestWidget.selectedIconForeground",lLe,g(5232,"Icon foreground color of the selected entry in the suggest widget."));const yPt=W("editorSuggestWidget.selectedBackground",t3,g(5233,"Background color of the selected entry in the suggest widget."));W("editorSuggestWidget.highlightForeground",lF,g(5234,"Color of the match highlights in the suggest widget."));W("editorSuggestWidget.focusHighlightForeground",Nmt,g(5235,"Color of the match highlights in the suggest widget when an item is focused."));W("editorSuggestWidgetStatus.foreground",rt(wPt,.5),g(5236,"Foreground color of the suggest widget status."));var vn;(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"})(vn||(vn={}));class CPt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof uf}`}restore(){const e=this._service.get(this._key,Ie.PROFILE)??"";try{const t=JSON.parse(e);if(wn.is(t))return wn.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),Ie.PROFILE,cn.MACHINE)}reset(){this._service.remove(this._key,Ie.PROFILE)}}var GD;let Fbe=(GD=class{constructor(e,t,i,n,r){this.editor=e,this._storageService=t,this._state=vn.Hidden,this._isAuto=!1,this._pendingLayout=new yn,this._pendingShowDetails=new yn,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new Em,this._disposables=new Z,this._onDidSelect=new Nk,this._onDidFocus=new Nk,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 qMe,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new SPt(this,e),this._persistedSize=new CPt(t,e);class o{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 o(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 wn(v,b))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=oe(this.element.domNode,fe(".message")),this._listElement=oe(this.element.domNode,fe(".tree"));const c=this._disposables.add(r.createInstance(Nbe,this.editor));c.onDidClose(this.toggleDetails,this,this._disposables),this._details=new pPt(c,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(x.suggest).showIcons);l();const d=r.createInstance(Pbe,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Za("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=qp("{0}{1}",m||"",p?typeof p=="string"?p:p.value:"");return g(5243,"{0}, docs: {1}",f,v)}}}),this._list.style($N({listInactiveFocusBackground:yPt,listInactiveFocusOutline:Xs})),this._status=r.createInstance(Mbe,this.element.domNode,_D);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=Vi.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Vi.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Vi.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Vi.HasFocusedSuggestion.bindTo(i),this._disposables.add(Rr(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!==vn.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=Fy(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=Mo(async n=>{const r=Zy(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),o=n.onCancellationRequested(()=>r.dispose());try{return await t.resolve(n)}finally{r.dispose(),o.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:met(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===vn.Frozen),this.element.domNode.classList.remove("message"),e){case vn.Hidden:Gd(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 vn.Loading:this.element.domNode.classList.add("message"),this._messageElement.textContent=WP.LOADING_MESSAGE,Gd(this._listElement,this._status.element),Xh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,xh(WP.LOADING_MESSAGE);break;case vn.Empty:this.element.domNode.classList.add("message"),this._messageElement.textContent=WP.NO_SUGGESTIONS_MESSAGE,Gd(this._listElement,this._status.element),Xh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,xh(WP.NO_SUGGESTIONS_MESSAGE);break;case vn.Open:Gd(this._messageElement),Xh(this._listElement,this._status.element),this._show();break;case vn.Frozen:Gd(this._messageElement),Xh(this._listElement,this._status.element),this._show();break;case vn.Details:Gd(this._messageElement),Xh(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===vn.Hidden&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Zy(()=>this._setState(vn.Loading),t)))}showSuggestions(e,t,i,n,r){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!==vn.Empty&&this._state!==vn.Hidden){this._setState(vn.Frozen);return}const o=this._completionModel.items.length,a=o===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(o>1),a){this._setState(n?vn.Hidden:vn.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?vn.Frozen:vn.Open),this._list.reveal(t,0),this._list.setFocus(r?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=eY(lt(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 vn.Hidden:return!1;case vn.Details:return this._details.widget.pageDown(),!0;case vn.Loading:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case vn.Hidden:return!1;case vn.Loading:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case vn.Hidden:return!1;case vn.Details:return this._details.widget.scrollBottom(),!0;case vn.Loading:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case vn.Hidden:return!1;case vn.Details:return this._details.widget.pageUp(),!0;case vn.Loading:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case vn.Hidden:return!1;case vn.Loading:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case vn.Hidden:return!1;case vn.Details:return this._details.widget.scrollTop(),!0;case vn.Loading:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==vn.Hidden&&this._state!==vn.Empty&&this._state!==vn.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===vn.Details?(this._setState(vn.Open),this._details.widget.domNode.classList.remove("focused")):this._state===vn.Open&&this._isDetailsVisible()&&(this._setState(vn.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")):(QMe(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===vn.Open||this._state===vn.Details||this._state===vn.Frozen)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=eY(lt(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(vn.Hidden),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.heighto&&(r=o);const a=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:r,c=i.statusBarHeight+this._list.contentHeight+i.borderHeight,l=i.itemHeight+i.statusBarHeight,d=So(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(ts.ABOVE),this.element.enableSashes(!0,!0,!1,!1),v=m):(this._contentWidget.setPreference(ts.BELOW),this.element.enableSashes(!1,!0,!0,!1),v=f),this.element.preferredSize=new wn(a,i.defaultSize.height),this.element.maxSize=new wn(o,v),this.element.minSize=new wn(220,l),this._cappedHeight=n===c?{wanted:this._cappedHeight?.wanted??e.height,capped:n}:void 0}this._resize(r,n)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:r}=this.getLayoutInfo();this._list.layout(t-r,e),this._listElement.style.height=`${t-r}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]===ts.BELOW)}getLayoutInfo(){const e=this.editor.getOption(x.fontInfo),t=Qa(this.editor.getOption(x.suggestLineHeight)||e.lineHeight,8,1e3),i=!this.editor.getOption(x.suggest).showStatusBar||this._state===vn.Empty||this._state===vn.Loading?0:t,n=this._details.widget.borderWidth,r=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:r,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new wn(430,i+12*t+r)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",Ie.PROFILE,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,Ie.PROFILE,cn.USER)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},WP=GD,GD.LOADING_MESSAGE=g(5237,"Loading..."),GD.NO_SUGGESTIONS_MESSAGE=g(5238,"No suggestions."),GD);Fbe=WP=D([_(1,Gi),_(2,Le),_(3,mn),_(4,we)],Fbe);class SPt{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 wn(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 Obe;class APt{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Kt.register({description:"suggest-line-suffix",stickiness:si.NeverGrowsWhenTypingAtEdges}),e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),r=e.getPositionAt(n+1);e.changeDecorations(o=>{this._marker&&o.removeDecoration(this._marker),this._marker=o.addDecoration(F.fromPositions(t,r),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 Vl;(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"})(Vl||(Vl={}));var TL;let tf=(TL=class{static get(e){return e.getContribution(Obe.ID)}constructor(e,t,i,n,r,o,a){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=r,this._logService=o,this._telemetryService=a,this._lineSuffix=new yn,this._toDispose=new Z,this._selectors=new EPt(h=>h.priority),this._onWillInsertSuggestItem=new I,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=r.createInstance(SX,this.editor),this._selectors.register({priority:0,select:(h,u,f)=>this._memoryService.select(h,u,f)});const c=Vi.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 o5(lt(e.getDomNode()),()=>{const h=this._instantiationService.createInstance(Fbe,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(v=>this._insertSuggestion(v,Vl.None),this));const u=new dPt(this.editor,h,this.model,v=>this._insertSuggestion(v,Vl.NoAfterUndoStop));this._toDispose.add(u);const f=Vi.MakesTextEdit.bindTo(this._contextKeyService),p=Vi.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=Vi.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===vD.Auto&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&Zg.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(!re.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 Lh(!0,!1,!1,!1,S.KeyC))||jt&&v.toKeyCodeChord().equals(new Lh(!1,!1,!1,!0,S.KeyC))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),h})),this._overtypingCapturer=this._toDispose.add(new o5(lt(e.getDomNode()),()=>this._toDispose.add(new Rbe(this.editor,this.model)))),this._alternatives=this._toDispose.add(new o5(lt(e.getDomNode()),()=>this._toDispose.add(new xW(this.editor,this._contextKeyService)))),this._toDispose.add(r.createInstance(wX,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new APt(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===vD.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!==ju.TriggerCharacter:p.selectionMode==="whenQuickSuggestion"&&(f=h.triggerOptions.triggerKind===ju.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=Vi.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=pc.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),r=n.getAlternativeVersionId(),{item:o}=e,a=[],c=new li;t&Vl.NoBeforeUndoStop||this.editor.pushUndoStop();const l=this.getOverwriteInfo(o,!!(t&Vl.AlternativeOverwriteConfig));this._memoryService.memorize(n,this.editor.getPosition(),o);const d=o.isResolved;let h=-1,u=-1;if(Array.isArray(o.completion.additionalTextEdits)){this.model.cancel();const p=ym.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map(m=>{let v=F.lift(m.range);if(v.startLineNumber===o.position.lineNumber&&v.startColumn>o.position.column){const b=this.editor.getPosition().column-o.position.column,w=b,y=F.spansMultipleLines(v)?0:b;v=new F(v.startLineNumber,v.startColumn+w,v.endLineNumber,v.endColumn+y)}return es.replaceMove(v,m.text)})),p.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const p=new Ys;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||re.isBefore(L,m))&&(m=L)}}),b=t;t|=Vl.NoAfterUndoStop;let w=!1;const y=this.editor.onWillType(()=>{y.dispose(),w=!0,b&Vl.NoAfterUndoStop||this.editor.pushUndoStop()});a.push(o.resolve(c.token).then(()=>{if(!o.completion.additionalTextEdits||c.token.isCancellationRequested)return;if(m&&o.completion.additionalTextEdits.some(A=>re.isBefore(m,F.getStartPosition(A.range))))return!1;w&&this.editor.pushUndoStop();const C=ym.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map(A=>es.replaceMove(F.lift(A.range),A.text))),C.restoreRelativeVerticalPositionOfCursor(this.editor),(w||!(b&Vl.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}=o.completion;if(o.completion.insertTextRules&Zg.InsertAsSnippet||(f=tv.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(o.completion.insertTextRules&Zg.KeepWhitespace),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&Vl.NoAfterUndoStop||this.editor.pushUndoStop(),o.completion.command)if(o.completion.command.id===AX.id)this.model.trigger({auto:!0,retrigger:!0});else{const p=new Ys;a.push(this._commandService.executeCommand(o.completion.command.id,...o.completion.command.arguments?[...o.completion.command.arguments]:[]).catch(m=>{o.completion.extensionId?Nr(m):bt(m)}).finally(()=>{h=p.elapsed()}))}t&Vl.KeepAlternativeSuggestions&&this._alternatives.value.set(e,p=>{for(c.cancel();n.canUndo();){r!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(p,Vl.NoBeforeUndoStop|Vl.NoAfterUndoStop|(t&Vl.AlternativeOverwriteConfig?Vl.AlternativeOverwriteConfig:0));break}}),this._alertCompletionItem(o),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(o,n,d,h,u),this.model.clear(),c.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,n,r){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:Hc(vi(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:xU(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:r})}getOverwriteInfo(e,t){Lt(this.editor.hasModel());let i=this.editor.getOption(x.suggest).insertMode==="replace";t&&(i=!i);const n=e.position.column-e.editStart.column,r=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,o=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:n+o,overwriteAfter:r+a}}_alertCompletionItem(e){if(tr(e.completion.additionalTextEdits)){const t=g(1562,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);No(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(),_t.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=r=>{if(r.completion.insertTextRules&Zg.InsertAsSnippet||r.completion.additionalTextEdits)return!0;const o=this.editor.getPosition(),a=r.editStart.column,c=o.column;return c-a!==r.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:o.lineNumber,startColumn:a,endLineNumber:o.lineNumber,endColumn:c})!==r.completion.insertText};M.once(this.model.onDidTrigger)(r=>{const o=[];M.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{wt(o),i()},void 0,o),this.model.onDidSuggest(({completionModel:a})=>{if(wt(o),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},Vl.KeepAlternativeSuggestions|Vl.NoBeforeUndoStop|Vl.NoAfterUndoStop)},void 0,o)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,_t.Smooth),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=Vl.KeepAlternativeSuggestions),t&&(n|=Vl.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)}},Obe=TL,TL.ID="editor.contrib.suggestController",TL);tf=Obe=D([_(1,kce),_(2,bi),_(3,Le),_(4,we),_(5,Ke),_(6,Ji)],tf);class EPt{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 Yse=class Yse extends it{constructor(){super({id:Yse.id,label:g(1563,"Trigger Suggest"),alias:"Trigger Suggest",precondition:he.and(J.writable,J.hasCompletionItemProvider,Vi.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=tf.get(t);if(!n)return;let r;i&&typeof i=="object"&&i.auto===!0&&(r=!0),n.triggerSuggest(void 0,r,void 0)}};Yse.id="editor.action.triggerSuggest";let AX=Yse;on(tf.ID,tf,ai.BeforeFirstInteraction);Re(AX);const Sp=Ae.EditorContrib+90,vu=uc.bindToContribution(tf.get);Qe(new vu({id:"acceptSelectedSuggestion",precondition:he.and(Vi.Visible,Vi.HasFocusedSuggestion),handler(s){s.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:S.Tab,kbExpr:he.and(Vi.Visible,J.textInputFocus),weight:Sp},{primary:S.Enter,kbExpr:he.and(Vi.Visible,J.textInputFocus,Vi.AcceptSuggestionsOnEnter,Vi.MakesTextEdit),weight:Sp}],menuOpts:[{menuId:_D,title:g(1564,"Insert"),group:"left",order:1,when:Vi.HasInsertAndReplaceRange.toNegated()},{menuId:_D,title:g(1564,"Insert"),group:"left",order:1,when:he.and(Vi.HasInsertAndReplaceRange,Vi.InsertMode.isEqualTo("insert"))},{menuId:_D,title:g(1565,"Replace"),group:"left",order:1,when:he.and(Vi.HasInsertAndReplaceRange,Vi.InsertMode.isEqualTo("replace"))}]}));Qe(new vu({id:"acceptAlternativeSelectedSuggestion",precondition:he.and(Vi.Visible,J.textInputFocus,Vi.HasFocusedSuggestion),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:U.Shift|S.Enter,secondary:[U.Shift|S.Tab]},handler(s){s.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:_D,group:"left",order:2,when:he.and(Vi.HasInsertAndReplaceRange,Vi.InsertMode.isEqualTo("insert")),title:g(1565,"Replace")},{menuId:_D,group:"left",order:2,when:he.and(Vi.HasInsertAndReplaceRange,Vi.InsertMode.isEqualTo("replace")),title:g(1564,"Insert")}]}));vt.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Qe(new vu({id:"hideSuggestWidget",precondition:Vi.Visible,handler:s=>s.cancelSuggestWidget(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));Qe(new vu({id:"selectNextSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectNextSuggestion(),kbOpts:{weight:Sp,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 vu({id:"selectNextPageSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectNextPageSuggestion(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:S.PageDown,secondary:[U.CtrlCmd|S.PageDown]}}));Qe(new vu({id:"selectLastSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectLastSuggestion()}));Qe(new vu({id:"selectPrevSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevSuggestion(),kbOpts:{weight:Sp,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 vu({id:"selectPrevPageSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevPageSuggestion(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:S.PageUp,secondary:[U.CtrlCmd|S.PageUp]}}));Qe(new vu({id:"selectFirstSuggestion",precondition:he.and(Vi.Visible,he.or(Vi.MultipleSuggestions,Vi.HasFocusedSuggestion.negate())),handler:s=>s.selectFirstSuggestion()}));Qe(new vu({id:"focusSuggestion",precondition:he.and(Vi.Visible,Vi.HasFocusedSuggestion.negate()),handler:s=>s.focusSuggestion(),kbOpts:{weight:Sp,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 vu({id:"focusAndAcceptSuggestion",precondition:he.and(Vi.Visible,Vi.HasFocusedSuggestion.negate()),handler:s=>{s.focusSuggestion(),s.acceptSelectedSuggestion(!0,!1)}}));Qe(new vu({id:"toggleSuggestionDetails",precondition:he.and(Vi.Visible,Vi.HasFocusedSuggestion),handler:s=>s.toggleSuggestionDetails(),kbOpts:{weight:Sp,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:_D,group:"right",order:1,when:he.and(Vi.DetailsVisible,Vi.CanResolve),title:g(1566,"show less")},{menuId:_D,group:"right",order:1,when:he.and(Vi.DetailsVisible.toNegated(),Vi.CanResolve),title:g(1567,"show more")}]}));Qe(new vu({id:"toggleExplainMode",precondition:Vi.Visible,handler:s=>s.toggleExplainMode(),kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Slash}}));Qe(new vu({id:"toggleSuggestionFocus",precondition:Vi.Visible,handler:s=>s.toggleSuggestionFocus(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Alt|S.Space,mac:{primary:U.WinCtrl|U.Alt|S.Space}}}));Qe(new vu({id:"insertBestCompletion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),wX.AtEnd,Vi.Visible.toNegated(),xW.OtherSuggestions.toNegated(),pc.InSnippetMode.toNegated()),handler:(s,e)=>{s.triggerSuggestAndAcceptBest(In(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:Sp,primary:S.Tab}}));Qe(new vu({id:"insertNextSuggestion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),xW.OtherSuggestions,Vi.Visible.toNegated(),pc.InSnippetMode.toNegated()),handler:s=>s.acceptNextSuggestion(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:S.Tab}}));Qe(new vu({id:"insertPrevSuggestion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),xW.OtherSuggestions,Vi.Visible.toNegated(),pc.InSnippetMode.toNegated()),handler:s=>s.acceptPrevSuggestion(),kbOpts:{weight:Sp,kbExpr:J.textInputFocus,primary:U.Shift|S.Tab}}));Re(class extends it{constructor(){super({id:"editor.action.resetSuggestSize",label:g(1568,"Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(s,e){tf.get(e)?.resetWidgetSize()}});class xPt 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(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 n=tf.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?PT(h,d):void 0;if(!u)return-1;const f=re.lift(c),p=l.map((v,b)=>{const w=G5.fromSuggestion(n,d,f,v,this.isShiftKeyPressed),y=PT(w.toSingleTextEdit(),d),C=het(u,y);return{index:b,valid:C,prefixLength:y.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),m=aTe(p,Sc(v=>v.prefixLength,ru));return m?m.index:-1}}));let r=!1;const o=()=>{r||(r=!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=>{o()})),this._register(n.onWillInsertSuggestItem(a=>{const c=this.editor.getPosition(),l=this.editor.getModel();if(!c||!l)return;const d=G5.fromSuggestion(n,l,c,a.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!DPt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=tf.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 G5.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){tf.get(this.editor)?.stopForceRenderingAbove()}forceRenderingAbove(){tf.get(this.editor)?.forceRenderingAbove()}}class G5{static fromSuggestion(e,t,i,n,r){let{insertText:o}=n.completion,a=!1;if(n.completion.insertTextRules&Zg.InsertAsSnippet){const l=new tv().parse(o);l.children.length<100&&bX.adjustWhitespace(t,i,!0,l),o=l.toString(),a=!0}const c=e.getOverwriteInfo(n,r);return new G5(F.fromPositions(i.delta(0,-c.overwriteBefore),i.delta(0,Math.max(c.overwriteAfter,0))),o,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 OKe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new lu(this.range,this.insertText)}}function DPt(s,e){return s===e?!0:!s||!e?!1:s.equals(e)}var Bbe,LL;let mu=(LL=class extends V{static get(e){return e.getContribution(Bbe.ID)}constructor(e,t,i,n,r,o,a,c,l,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=r,this._debounceService=o,this._languageFeaturesService=a,this._accessibilitySignalService=c,this._keybindingService=l,this._accessibilityService=d,this._editorObs=eu(this.editor),this._positions=et(this,u=>this._editorObs.selections.read(u)?.map(f=>f.getEndPosition())??[new re(1,1)]),this._suggestWidgetAdaptor=this._register(new xPt(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=qn(this,u=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(f=>u(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem),this._enabledInConfig=qn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).enabled),this._isScreenReaderEnabled=qn(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=qn(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=et(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=vh(this,u=>{if(this._editorObs.isReadonly.read(u))return;const f=this._editorObs.model.read(u);return f?this._instantiationService.createInstance(kbe,f,this._suggestWidgetSelectedItem,this._editorObs.versionId,this._positions,this._debounceValue,qn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.suggest).preview),qn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.suggest).previewMode),qn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).mode),this._enabled):void 0}).recomputeInitiallyAndOnChange(this._store),this._ghostTexts=et(this,u=>this.model.read(u)?.ghostTexts.read(u)??[]),this._stablizedGhostTexts=kPt(this._ghostTexts,this._store),this._ghostTextWidgets=lJ(this,this._stablizedGhostTexts,(u,f)=>f.add(this._instantiationService.createInstance(bbe,this.editor,{ghostText:u,minReservedLineCount:rd(0),targetTextModel:this.model.map(p=>p?.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=_C(this),this._fontFamily=qn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).fontFamily),this._register(new Xu(this._contextKeyService,this.model)),this._register(Ove(this._editorObs.onDidType,(u,f)=>{this._enabled.get()&&this.model.get()?.trigger()})),this._register(this._commandService.onDidExecuteCommand(u=>{new Set([VO.Tab.id,VO.DeleteLeft.id,VO.DeleteRight.id,tet,"acceptSelectedSuggestion"]).has(u.commandId)&&e.hasTextFocus()&&this._enabled.get()&&this._editorObs.forceUpdate(p=>{this.model.get()?.trigger(p)})})),this._register(Ove(this._editorObs.selections,(u,f)=>{f.some(p=>p.reason===Bi.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||AW.dropDownVisible||is(u=>{this.model.get()?.stop(u)})})),this._register(ci(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=L6(this,(u,f)=>{const m=this.model.read(u)?.state.read(u);return this._suggestWidgetSelectedItem.get()?f:m?.inlineCompletion?.semanticId});this._register(t1t(et(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 Ao(50,bfe(p)),await B5(this._suggestWidgetSelectedItem,Ja,()=>!1,bfe(p)),await this._accessibilitySignalService.playSignal(ll.inlineSuggestion),this.editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&this._provideScreenReaderUpdate(v.primaryGhostText.renderForScreenReader(b))})),this._register(new wbe(this.editor,this.model,this._instantiationService)),this._register(bNt(et(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: ${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())),No(n?e+", "+n:e)}shouldShowHoverAt(e){const t=this.model.get()?.primaryGhostText.get();return t?t.parts.some(i=>e.containsPosition(new re(t.lineNumber,i.column))):!1}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.ownsViewZone(e)??!1}hide(){is(e=>{this.model.get()?.stop(e)})}},Bbe=LL,LL.ID="editor.contrib.inlineCompletionsController",LL);mu=Bbe=D([_(1,we),_(2,Le),_(3,Te),_(4,bi),_(5,xp),_(6,nt),_(7,uv),_(8,Vt),_(9,_o)],mu);function kPt(s,e){const t=Yt("result",[]),i=[];return e.add(ci(n=>{const r=s.read(n);is(o=>{if(r.length!==i.length){i.length=r.length;for(let a=0;aa.set(r[c],o))})})),t}const nG={id:_e.AccessibleView,group:"navigation",when:Cp},sG={id:_e.CommandPalette,group:"",order:1};class IPt extends di{constructor(){super({id:eh.ShowNext,precondition:he.and(Cp,hX),keybinding:{primary:U.Alt|S.BracketRight,weight:Ae.WorkbenchContrib},menu:[sG,{...nG,when:he.and(Cp,hX)}],icon:ve.arrowDown,title:g(10002,"Show Next in Accessible View")})}run(e){e.get(Tm).next()}}Et(IPt);class TPt extends di{constructor(){super({id:eh.NextCodeBlock,precondition:he.and(gX,he.equals(uX.key,Wb.Chat)),keybinding:{primary:U.CtrlCmd|U.Alt|S.PageDown,mac:{primary:U.CtrlCmd|U.Alt|S.PageDown},weight:Ae.WorkbenchContrib},icon:ve.arrowRight,menu:{...nG,when:he.and(Cp,gX)},title:g(10003,"Accessible View: Next Code Block")})}run(e){e.get(Tm).navigateToCodeBlock("next")}}Et(TPt);class LPt extends di{constructor(){super({id:eh.PreviousCodeBlock,precondition:he.and(gX,he.equals(uX.key,Wb.Chat)),keybinding:{primary:U.CtrlCmd|U.Alt|S.PageUp,mac:{primary:U.CtrlCmd|U.Alt|S.PageUp},weight:Ae.WorkbenchContrib},icon:ve.arrowLeft,menu:{...nG,when:he.and(Cp,gX)},title:g(10004,"Accessible View: Previous Code Block")})}run(e){e.get(Tm).navigateToCodeBlock("previous")}}Et(LPt);class RPt extends di{constructor(){super({id:eh.ShowPrevious,precondition:he.and(Cp,hX),keybinding:{primary:U.Alt|S.BracketLeft,weight:Ae.WorkbenchContrib},icon:ve.arrowUp,menu:[sG,{...nG,when:he.and(Cp,hX)}],title:g(10005,"Show Previous in Accessible View")})}run(e){e.get(Tm).previous()}}Et(RPt);class MPt extends di{constructor(){super({id:eh.GoToSymbol,precondition:he.and(he.or(Cp,WA),nUe),keybinding:{primary:U.CtrlCmd|U.Shift|S.KeyO,secondary:[U.CtrlCmd|U.Shift|S.Period],weight:Ae.WorkbenchContrib+10},icon:ve.symbolField,menu:[sG,{...nG,when:he.and(he.or(Cp,WA),nUe)}],title:g(10006,"Go To Symbol in Accessible View")})}run(e){e.get(Tm).goToSymbol()}}Et(MPt);function _et(s){return s.register(),s}_et(new xI({id:eh.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:WA.toNegated()},menuOpts:[{menuId:_e.CommandPalette,group:"",title:g(10007,"Open Accessibility Help"),order:1}]}));const NPt=_et(new xI({id:eh.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 PPt extends di{constructor(){super({id:eh.DisableVerbosityHint,precondition:he.and(he.or(Cp,WA),iUe),keybinding:{primary:U.Alt|S.F6,weight:Ae.WorkbenchContrib},icon:ve.bellSlash,menu:[sG,{id:_e.AccessibleView,group:"navigation",when:he.and(he.or(Cp,WA),iUe)}],title:g(10009,"Disable Accessible View Hint")})}run(e){e.get(Tm).disableHint()}}Et(PPt);class FPt extends di{constructor(){super({id:eh.AccessibilityHelpConfigureKeybindings,precondition:he.and(WA,sUe),icon:ve.key,keybinding:{primary:U.Alt|S.KeyK,weight:Ae.WorkbenchContrib},menu:[{id:_e.AccessibleView,group:"navigation",order:3,when:sUe}],title:g(10010,"Accessibility Help Configure Unassigned Keybindings")})}async run(e){await e.get(Tm).configureKeybindings(!0)}}Et(FPt);class OPt extends di{constructor(){super({id:eh.AccessibilityHelpConfigureAssignedKeybindings,precondition:he.and(WA,rUe),icon:ve.key,keybinding:{primary:U.Alt|S.KeyA,weight:Ae.WorkbenchContrib},menu:[{id:_e.AccessibleView,group:"navigation",order:4,when:rUe}],title:g(10011,"Accessibility Help Configure Assigned Keybindings")})}async run(e){await e.get(Tm).configureKeybindings(!1)}}Et(OPt);class BPt extends di{constructor(){super({id:eh.AccessibilityHelpOpenHelpLink,precondition:he.and(WA),keybinding:{primary:U.Alt|S.KeyH,weight:Ae.WorkbenchContrib},title:g(10012,"Accessibility Help Open Help Link")})}run(e){e.get(Tm).openHelpLink()}}Et(BPt);class WPt extends di{constructor(){super({id:eh.AccessibleViewAcceptInlineCompletion,precondition:he.and(Cp,he.equals(uX.key,Wb.InlineCompletions)),keybinding:{primary:U.CtrlCmd|S.Slash,mac:{primary:U.WinCtrl|S.Slash},weight:Ae.WorkbenchContrib},icon:ve.check,menu:[sG,{id:_e.AccessibleView,group:"navigation",order:0,when:he.and(Cp,he.equals(uX.key,Wb.InlineCompletions))}],title:g(10013,"Accept Inline Completion")})}async run(e){const t=e.get(qt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const n=mu.get(i)?.model.get(),r=n?.state.get();!n||!r||(await n.accept(i),n.stop(),i.focus())}}Et(WPt);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.")}),HPt=new Q("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:g(7025,"When the agent or command was automatically detected")}),UPt=new Q("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:g(7026,"True when the current chat response supports issue reporting.")}),vet=new Q("chatSessionResponseFiltered",!1,{type:"boolean",description:g(7027,"True when the chat response was filtered out by the server.")}),e9=new Q("chatSessionRequestInProgress",!1,{type:"boolean",description:g(7028,"True when the current request is still in progress.")}),VPt=new Q("chatResponse",!1,{type:"boolean",description:g(7029,"The chat item is a response.")}),zPt=new Q("chatRequest",!1,{type:"boolean",description:g(7030,"The chat item is a request")}),$Pt=new Q("chatEditApplied",!1,{type:"boolean",description:g(7031,"True when the chat text edits have been applied.")}),jMe=new Q("chatInputHasText",!1,{type:"boolean",description:g(7032,"True when the chat input has text.")}),GPt=new Q("chatInputHasFocus",!1,{type:"boolean",description:g(7033,"True when the chat input has focus.")}),YMe=new Q("inChatInput",!1,{type:"boolean",description:g(7034,"True when focus is in the chat input, false otherwise.")}),KPt=new Q("inChat",!1,{type:"boolean",description:g(7035,"True when focus is in the chat widget, false otherwise.")}),bet=new Q("chatIsEnabled",!1,{type:"boolean",description:g(7036,"True when chat is enabled because a default chat participant is registered.")}),qPt=new Q("chatCursorAtTop",!1),wet=new Q("chatInputHasAgent",!1),QPt=new Q("chatLocation",void 0),jPt=new Q("quickChatHasFocus",!1,{type:"boolean",description:g(7037,"True when the quick chat UI has focus, false otherwise.")});var YPt=".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)}}";gt(YPt,{});var pQ;const yet=new Q("editorDictation.inProgress",!1),Cet=Pe(10420,"Voice");class JPt extends mf{constructor(){super({id:"workbench.action.editorDictation.start",title:Pe(10421,"Start Dictation in Editor"),category:Cet,precondition:he.and(gNt,fNt.toNegated(),J.readOnly.toNegated()),f1:!0,keybinding:{primary:U.CtrlCmd|U.Alt|S.KeyV,weight:Ae.WorkbenchContrib,secondary:jn?[U.Alt|S.Backquote]:void 0}})}runEditorCommand(e,t){const n=e.get(Vt).enableKeybindingHoldMode(this.desc.id);if(n){let r=!1;const o=setTimeout(()=>{r=!0},500);n.finally(()=>{clearTimeout(o),r&&aC.get(t)?.stop()})}aC.get(t)?.start()}}const Jse=class Jse extends mf{constructor(){super({id:Jse.ID,title:Pe(10422,"Stop Dictation in Editor"),category:Cet,precondition:yet,f1:!0,keybinding:{primary:S.Escape,weight:Ae.WorkbenchContrib+100}})}runEditorCommand(e,t){aC.get(t)?.stop()}};Jse.ID="workbench.action.editorDictation.stop";let t9=Jse;class XPt 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 gd(this.domNode)),n=t.lookupKeybinding(t9.ID)?.getLabel();i.push(al({id:t9.ID,label:n?g(10423,"Stop Dictation ({0})",n):g(10424,"Stop Dictation"),class:He.asClassName(ve.micFilled),run:()=>aC.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())?ts.ABOVE:ts.BELOW,ts.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 RL;let aC=(RL=class extends V{static get(e){return e.getContribution(pQ.ID)}constructor(e,t,i,n){super(),this.editor=e,this.speechService=t,this.contextKeyService=i,this.keybindingService=n,this.widget=this._register(new XPt(this.editor,this.keybindingService)),this.editorDictationInProgress=yet.bindTo(this.contextKeyService),this.sessionDisposables=this._register(new yn)}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 r=(c,l)=>{i||(i=Qn(this.editor.getPosition()));const d=new re(i.lineNumber,i.column+c.length);this.editor.executeEdits(pQ.ID,[es.replace(F.fromPositions(i,i.with(void 0,i.column+n)),c)],[ht.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)},o=new li;e.add(Ee(()=>o.dispose(!0)));const a=await this.speechService.createSpeechToTextSession(o.token,"editor");e.add(a.onDidChange(c=>{if(!o.token.isCancellationRequested)switch(c.status){case yF.Started:this.widget.active();break;case yF.Stopped:e.dispose();break;case yF.Recognizing:{if(!c.text)return;r(c.text,!0);break}case yF.Recognized:{if(!c.text)return;r(`${c.text} `,!1);break}}}))}stop(){this.sessionDisposables.clear()}},pQ=RL,RL.ID="editorDictation",RL);aC=pQ=D([_(1,uce),_(2,Le),_(3,Vt)],aC);on(aC.ID,aC,ai.Lazy);Et(JPt);Et(t9);var Wbe,ML;let Hb=(ML=class{static get(e){return e.getContribution(Wbe.ID)}constructor(e,t,i,n,r,o,a,c){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=r,this._menuService=o,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&&AM(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===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 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!==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=[],n=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const r of n){const[,o]=r;let a=0;for(const c of o)if(c instanceof Ny){const l=this._getMenuActions(e,c.item.submenu);l.length>0&&(i.push(new Hk(c.id,c.label,l)),a++)}else i.push(c),a++;a&&i.push(new Eo)}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(),_t.Immediate),this._editor.render();const o=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=So(this._editor.getDomNode()),c=a.left+o.left,l=a.top+o.top+o.height;n={x:c,y:l}}const r=this._editor.getOption(x.useShadowDOM)&&!gm;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:o=>{const a=this._keybindingFor(o);if(a)return new tC(o,o,{label:!0,keybinding:a.getLabel(),isMenu:!0});const c=o;return typeof c.getActionViewItem=="function"?c.getActionViewItem():new tC(o,o,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:o=>this._keybindingFor(o),onHide:o=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||DEt(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}),r=(l,d)=>new Hk(`menu-action-${++i}`,l,d,void 0),o=(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 r(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 Eo),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(o(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(o(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)&&!gm;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()}},Wbe=ML,ML.ID="editor.contrib.contextmenu",ML);Hb=Wbe=D([_(1,lo),_(2,bf),_(3,Le),_(4,Vt),_(5,Ba),_(6,Te),_(7,Ci)],Hb);class ZPt extends it{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){Hb.get(t)?.showContextMenu()}}on(Hb.ID,Hb,ai.BeforeFirstInteraction);Re(ZPt);class eFt{constructor(e){this.isBogous=!1,this.isTrivial=!1,this.usesClipboardVariable=!1,this.usesSelectionVariable=!1,this.codeSnippet=e;const t=new tv().parse(e,!1),i=new Map;let n=0;for(const o of t.placeholders)n=Math.max(n,o.index);if(t.placeholders.length===0)this.isTrivial=!0;else if(n===0){const o=Eg(t.children);this.isTrivial=o instanceof Kg&&o.isFinalTabstop}const r=[...t.children];for(;r.length>0;){const o=r.shift();if(o instanceof EW){if(o.children.length===0&&!sPt[o.name]){const a=i.has(o.name)?i.get(o.name):++n;i.set(o.name,a);const c=new Kg(a).appendChild(new Kd(o.name));t.replace(o,[c]),this.isBogous=!0}switch(o.name){case"CLIPBOARD":this.usesClipboardVariable=!0;break;case"SELECTION":case"TM_SELECTED_TEXT":this.usesSelectionVariable=!0;break}}else r.push(...o.children)}this.isBogous&&(this.codeSnippet=t.toTextmateString())}}class Aet{constructor(e,t,i,n,r,o,a,c,l,d){this.isFileTemplate=e,this.scopes=t,this.name=i,this.prefix=n,this.description=r,this.body=o,this.source=a,this.snippetSource=c,this.snippetIdentifier=l,this.extensionId=d,this.prefixLow=n.toLowerCase(),this._bodyInsights=new o5(Ry(),()=>new eFt(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 tFt(s){return In(s)&&!!s.body}var $w;(function(s){s[s.User=1]="User",s[s.Workspace=2]="Workspace",s[s.Extension=3]="Extension"})($w||($w={}));class fue{constructor(e,t,i,n,r,o){this.source=e,this.location=t,this.defaultScopes=i,this._extension=n,this._fileService=r,this._extensionResourceLoaderService=o,this.data=[],this.isGlobalSnippets=jy(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"===Kr(this.location.path)&&t.push(...this.data)}_scopeSelect(e,t){for(const n of this.data){const r=n.scopes.length;if(r===0)t.push(n);else for(let o=0;o=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=af(e);if(dD(t)==="object")for(const[i,n]of Object.entries(t))if(tFt(n))this._parseSnippet(i,n,this.data);else for(const[r,o]of Object.entries(n))this._parseSnippet(r,o,this.data);return this})),this._loadPromise}reset(){this._loadPromise=void 0,this.data.length=0}_parseSnippet(e,t,i){let{isFileTemplate:n,prefix:r,body:o,description:a}=t;if(r||(r=""),Array.isArray(o)&&(o=o.join(` +}`}))),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())),No(n?e+", "+n:e)}shouldShowHoverAt(e){const t=this.model.get()?.primaryGhostText.get();return t?t.parts.some(i=>e.containsPosition(new re(t.lineNumber,i.column))):!1}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.ownsViewZone(e)??!1}hide(){is(e=>{this.model.get()?.stop(e)})}},Bbe=LL,LL.ID="editor.contrib.inlineCompletionsController",LL);mu=Bbe=D([_(1,we),_(2,Le),_(3,Te),_(4,bi),_(5,xp),_(6,nt),_(7,uv),_(8,Vt),_(9,_o)],mu);function kPt(s,e){const t=Yt("result",[]),i=[];return e.add(ci(n=>{const r=s.read(n);is(o=>{if(r.length!==i.length){i.length=r.length;for(let a=0;aa.set(r[c],o))})})),t}const nG={id:_e.AccessibleView,group:"navigation",when:Cp},sG={id:_e.CommandPalette,group:"",order:1};class IPt extends di{constructor(){super({id:eh.ShowNext,precondition:he.and(Cp,hX),keybinding:{primary:U.Alt|S.BracketRight,weight:Ae.WorkbenchContrib},menu:[sG,{...nG,when:he.and(Cp,hX)}],icon:ve.arrowDown,title:g(10002,"Show Next in Accessible View")})}run(e){e.get(Tm).next()}}Et(IPt);class TPt extends di{constructor(){super({id:eh.NextCodeBlock,precondition:he.and(gX,he.equals(uX.key,Wb.Chat)),keybinding:{primary:U.CtrlCmd|U.Alt|S.PageDown,mac:{primary:U.CtrlCmd|U.Alt|S.PageDown},weight:Ae.WorkbenchContrib},icon:ve.arrowRight,menu:{...nG,when:he.and(Cp,gX)},title:g(10003,"Accessible View: Next Code Block")})}run(e){e.get(Tm).navigateToCodeBlock("next")}}Et(TPt);class LPt extends di{constructor(){super({id:eh.PreviousCodeBlock,precondition:he.and(gX,he.equals(uX.key,Wb.Chat)),keybinding:{primary:U.CtrlCmd|U.Alt|S.PageUp,mac:{primary:U.CtrlCmd|U.Alt|S.PageUp},weight:Ae.WorkbenchContrib},icon:ve.arrowLeft,menu:{...nG,when:he.and(Cp,gX)},title:g(10004,"Accessible View: Previous Code Block")})}run(e){e.get(Tm).navigateToCodeBlock("previous")}}Et(LPt);class RPt extends di{constructor(){super({id:eh.ShowPrevious,precondition:he.and(Cp,hX),keybinding:{primary:U.Alt|S.BracketLeft,weight:Ae.WorkbenchContrib},icon:ve.arrowUp,menu:[sG,{...nG,when:he.and(Cp,hX)}],title:g(10005,"Show Previous in Accessible View")})}run(e){e.get(Tm).previous()}}Et(RPt);class MPt extends di{constructor(){super({id:eh.GoToSymbol,precondition:he.and(he.or(Cp,WA),nUe),keybinding:{primary:U.CtrlCmd|U.Shift|S.KeyO,secondary:[U.CtrlCmd|U.Shift|S.Period],weight:Ae.WorkbenchContrib+10},icon:ve.symbolField,menu:[sG,{...nG,when:he.and(he.or(Cp,WA),nUe)}],title:g(10006,"Go To Symbol in Accessible View")})}run(e){e.get(Tm).goToSymbol()}}Et(MPt);function _et(s){return s.register(),s}_et(new xI({id:eh.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:WA.toNegated()},menuOpts:[{menuId:_e.CommandPalette,group:"",title:g(10007,"Open Accessibility Help"),order:1}]}));const NPt=_et(new xI({id:eh.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 PPt extends di{constructor(){super({id:eh.DisableVerbosityHint,precondition:he.and(he.or(Cp,WA),iUe),keybinding:{primary:U.Alt|S.F6,weight:Ae.WorkbenchContrib},icon:ve.bellSlash,menu:[sG,{id:_e.AccessibleView,group:"navigation",when:he.and(he.or(Cp,WA),iUe)}],title:g(10009,"Disable Accessible View Hint")})}run(e){e.get(Tm).disableHint()}}Et(PPt);class FPt extends di{constructor(){super({id:eh.AccessibilityHelpConfigureKeybindings,precondition:he.and(WA,sUe),icon:ve.key,keybinding:{primary:U.Alt|S.KeyK,weight:Ae.WorkbenchContrib},menu:[{id:_e.AccessibleView,group:"navigation",order:3,when:sUe}],title:g(10010,"Accessibility Help Configure Unassigned Keybindings")})}async run(e){await e.get(Tm).configureKeybindings(!0)}}Et(FPt);class OPt extends di{constructor(){super({id:eh.AccessibilityHelpConfigureAssignedKeybindings,precondition:he.and(WA,rUe),icon:ve.key,keybinding:{primary:U.Alt|S.KeyA,weight:Ae.WorkbenchContrib},menu:[{id:_e.AccessibleView,group:"navigation",order:4,when:rUe}],title:g(10011,"Accessibility Help Configure Assigned Keybindings")})}async run(e){await e.get(Tm).configureKeybindings(!1)}}Et(OPt);class BPt extends di{constructor(){super({id:eh.AccessibilityHelpOpenHelpLink,precondition:he.and(WA),keybinding:{primary:U.Alt|S.KeyH,weight:Ae.WorkbenchContrib},title:g(10012,"Accessibility Help Open Help Link")})}run(e){e.get(Tm).openHelpLink()}}Et(BPt);class WPt extends di{constructor(){super({id:eh.AccessibleViewAcceptInlineCompletion,precondition:he.and(Cp,he.equals(uX.key,Wb.InlineCompletions)),keybinding:{primary:U.CtrlCmd|S.Slash,mac:{primary:U.WinCtrl|S.Slash},weight:Ae.WorkbenchContrib},icon:ve.check,menu:[sG,{id:_e.AccessibleView,group:"navigation",order:0,when:he.and(Cp,he.equals(uX.key,Wb.InlineCompletions))}],title:g(10013,"Accept Inline Completion")})}async run(e){const t=e.get(qt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const n=mu.get(i)?.model.get(),r=n?.state.get();!n||!r||(await n.accept(i),n.stop(),i.focus())}}Et(WPt);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.")}),HPt=new Q("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:g(7025,"When the agent or command was automatically detected")}),UPt=new Q("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:g(7026,"True when the current chat response supports issue reporting.")}),vet=new Q("chatSessionResponseFiltered",!1,{type:"boolean",description:g(7027,"True when the chat response was filtered out by the server.")}),e9=new Q("chatSessionRequestInProgress",!1,{type:"boolean",description:g(7028,"True when the current request is still in progress.")}),VPt=new Q("chatResponse",!1,{type:"boolean",description:g(7029,"The chat item is a response.")}),zPt=new Q("chatRequest",!1,{type:"boolean",description:g(7030,"The chat item is a request")}),$Pt=new Q("chatEditApplied",!1,{type:"boolean",description:g(7031,"True when the chat text edits have been applied.")}),jMe=new Q("chatInputHasText",!1,{type:"boolean",description:g(7032,"True when the chat input has text.")}),GPt=new Q("chatInputHasFocus",!1,{type:"boolean",description:g(7033,"True when the chat input has focus.")}),YMe=new Q("inChatInput",!1,{type:"boolean",description:g(7034,"True when focus is in the chat input, false otherwise.")}),KPt=new Q("inChat",!1,{type:"boolean",description:g(7035,"True when focus is in the chat widget, false otherwise.")}),bet=new Q("chatIsEnabled",!1,{type:"boolean",description:g(7036,"True when chat is enabled because a default chat participant is registered.")}),qPt=new Q("chatCursorAtTop",!1),wet=new Q("chatInputHasAgent",!1),QPt=new Q("chatLocation",void 0),jPt=new Q("quickChatHasFocus",!1,{type:"boolean",description:g(7037,"True when the quick chat UI has focus, false otherwise.")});var YPt=".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)}}";gt(YPt,{});var pQ;const yet=new Q("editorDictation.inProgress",!1),Cet=Pe(10420,"Voice");class JPt extends mf{constructor(){super({id:"workbench.action.editorDictation.start",title:Pe(10421,"Start Dictation in Editor"),category:Cet,precondition:he.and(gNt,fNt.toNegated(),J.readOnly.toNegated()),f1:!0,keybinding:{primary:U.CtrlCmd|U.Alt|S.KeyV,weight:Ae.WorkbenchContrib,secondary:jn?[U.Alt|S.Backquote]:void 0}})}runEditorCommand(e,t){const n=e.get(Vt).enableKeybindingHoldMode(this.desc.id);if(n){let r=!1;const o=setTimeout(()=>{r=!0},500);n.finally(()=>{clearTimeout(o),r&&aC.get(t)?.stop()})}aC.get(t)?.start()}}const Jse=class Jse extends mf{constructor(){super({id:Jse.ID,title:Pe(10422,"Stop Dictation in Editor"),category:Cet,precondition:yet,f1:!0,keybinding:{primary:S.Escape,weight:Ae.WorkbenchContrib+100}})}runEditorCommand(e,t){aC.get(t)?.stop()}};Jse.ID="workbench.action.editorDictation.stop";let t9=Jse;class XPt 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 gd(this.domNode)),n=t.lookupKeybinding(t9.ID)?.getLabel();i.push(al({id:t9.ID,label:n?g(10423,"Stop Dictation ({0})",n):g(10424,"Stop Dictation"),class:He.asClassName(ve.micFilled),run:()=>aC.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())?ts.ABOVE:ts.BELOW,ts.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 RL;let aC=(RL=class extends V{static get(e){return e.getContribution(pQ.ID)}constructor(e,t,i,n){super(),this.editor=e,this.speechService=t,this.contextKeyService=i,this.keybindingService=n,this.widget=this._register(new XPt(this.editor,this.keybindingService)),this.editorDictationInProgress=yet.bindTo(this.contextKeyService),this.sessionDisposables=this._register(new yn)}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 r=(c,l)=>{i||(i=Qn(this.editor.getPosition()));const d=new re(i.lineNumber,i.column+c.length);this.editor.executeEdits(pQ.ID,[es.replace(F.fromPositions(i,i.with(void 0,i.column+n)),c)],[ht.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)},o=new li;e.add(Ee(()=>o.dispose(!0)));const a=await this.speechService.createSpeechToTextSession(o.token,"editor");e.add(a.onDidChange(c=>{if(!o.token.isCancellationRequested)switch(c.status){case yF.Started:this.widget.active();break;case yF.Stopped:e.dispose();break;case yF.Recognizing:{if(!c.text)return;r(c.text,!0);break}case yF.Recognized:{if(!c.text)return;r(`${c.text} `,!1);break}}}))}stop(){this.sessionDisposables.clear()}},pQ=RL,RL.ID="editorDictation",RL);aC=pQ=D([_(1,uce),_(2,Le),_(3,Vt)],aC);on(aC.ID,aC,ai.Lazy);Et(JPt);Et(t9);var Wbe,ML;let Hb=(ML=class{static get(e){return e.getContribution(Wbe.ID)}constructor(e,t,i,n,r,o,a,c){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=r,this._menuService=o,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&&AM(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===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 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!==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=[],n=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const r of n){const[,o]=r;let a=0;for(const c of o)if(c instanceof Ny){const l=this._getMenuActions(e,c.item.submenu);l.length>0&&(i.push(new Hk(c.id,c.label,l)),a++)}else i.push(c),a++;a&&i.push(new Eo)}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(),_t.Immediate),this._editor.render();const o=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=So(this._editor.getDomNode()),c=a.left+o.left,l=a.top+o.top+o.height;n={x:c,y:l}}const r=this._editor.getOption(x.useShadowDOM)&&!gm;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:o=>{const a=this._keybindingFor(o);if(a)return new tC(o,o,{label:!0,keybinding:a.getLabel(),isMenu:!0});const c=o;return typeof c.getActionViewItem=="function"?c.getActionViewItem():new tC(o,o,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:o=>this._keybindingFor(o),onHide:o=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||DEt(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}),r=(l,d)=>new Hk(`menu-action-${++i}`,l,d,void 0),o=(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 r(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 Eo),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(o(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(o(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)&&!gm;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()}},Wbe=ML,ML.ID="editor.contrib.contextmenu",ML);Hb=Wbe=D([_(1,lo),_(2,bf),_(3,Le),_(4,Vt),_(5,Wa),_(6,Te),_(7,Ci)],Hb);class ZPt extends it{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){Hb.get(t)?.showContextMenu()}}on(Hb.ID,Hb,ai.BeforeFirstInteraction);Re(ZPt);class eFt{constructor(e){this.isBogous=!1,this.isTrivial=!1,this.usesClipboardVariable=!1,this.usesSelectionVariable=!1,this.codeSnippet=e;const t=new tv().parse(e,!1),i=new Map;let n=0;for(const o of t.placeholders)n=Math.max(n,o.index);if(t.placeholders.length===0)this.isTrivial=!0;else if(n===0){const o=Eg(t.children);this.isTrivial=o instanceof Kg&&o.isFinalTabstop}const r=[...t.children];for(;r.length>0;){const o=r.shift();if(o instanceof EW){if(o.children.length===0&&!sPt[o.name]){const a=i.has(o.name)?i.get(o.name):++n;i.set(o.name,a);const c=new Kg(a).appendChild(new Kd(o.name));t.replace(o,[c]),this.isBogous=!0}switch(o.name){case"CLIPBOARD":this.usesClipboardVariable=!0;break;case"SELECTION":case"TM_SELECTED_TEXT":this.usesSelectionVariable=!0;break}}else r.push(...o.children)}this.isBogous&&(this.codeSnippet=t.toTextmateString())}}class Aet{constructor(e,t,i,n,r,o,a,c,l,d){this.isFileTemplate=e,this.scopes=t,this.name=i,this.prefix=n,this.description=r,this.body=o,this.source=a,this.snippetSource=c,this.snippetIdentifier=l,this.extensionId=d,this.prefixLow=n.toLowerCase(),this._bodyInsights=new o5(Ry(),()=>new eFt(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 tFt(s){return In(s)&&!!s.body}var $w;(function(s){s[s.User=1]="User",s[s.Workspace=2]="Workspace",s[s.Extension=3]="Extension"})($w||($w={}));class fue{constructor(e,t,i,n,r,o){this.source=e,this.location=t,this.defaultScopes=i,this._extension=n,this._fileService=r,this._extensionResourceLoaderService=o,this.data=[],this.isGlobalSnippets=jy(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"===Kr(this.location.path)&&t.push(...this.data)}_scopeSelect(e,t){for(const n of this.data){const r=n.scopes.length;if(r===0)t.push(n);else for(let o=0;o=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=af(e);if(dD(t)==="object")for(const[i,n]of Object.entries(t))if(tFt(n))this._parseSnippet(i,n,this.data);else for(const[r,o]of Object.entries(n))this._parseSnippet(r,o,this.data);return this})),this._loadPromise}reset(){this._loadPromise=void 0,this.data.length=0}_parseSnippet(e,t,i){let{isFileTemplate:n,prefix:r,body:o,description:a}=t;if(r||(r=""),Array.isArray(o)&&(o=o.join(` `)),typeof o!="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===$w.Workspace?l=g(6745,"Workspace Snippet"):this.isGlobalSnippets?l=g(6746,"Global User Snippet"):l=g(6747,"User Snippet");for(const d of ui.wrap(r))i.push(new Aet(!!n,c,e,d,a,o,l,this.source,this._extension?`${MN(this._extension.extensionLocation,this.location)}/${e}`:`${Kr(this.location.path)}/${e}`,this._extension?.identifier))}}const DW=ih.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 iFt 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)Eet(d)&&n.push({id:d.id,name:(d.aliases||[])[0]||d.id,extensions:d.extensions||[],hasGrammar:!1,hasSnippets:!1});const r=dTe(n,d=>d.id);if((t?.grammars||[]).forEach(d=>{if(!Rt(d.language))return;let h=r[d.language];h?h.hasGrammar=!0:(h={id:d.language,name:d.language,extensions:[],hasGrammar:!0,hasSnippets:!1},r[h.id]=h,n.push(h))}),(t?.snippets||[]).forEach(d=>{if(!Rt(d.language))return;let h=r[d.language];h?h.hasSnippets=!0:(h={id:d.language,name:d.language,extensions:[],hasGrammar:!1,hasSnippets:!0},r[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 Nt().appendMarkdown(`${d.extensions.map(h=>`\`${h}\``).join(" ")}`),d.hasGrammar?"✔︎":"—",d.hasSnippets?"✔︎":"—"]);return{data:{headers:c,rows:l},dispose:()=>{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"languages",label:g(2481,"Programming Languages"),access:{canToggle:!1},renderer:new yi(iFt)});let Hbe=class extends aJ{constructor(e,t,i,n){super(i.verbose||i.isExtensionDevelopment||!i.isBuilt),this.logService=n,this._configurationService=t,this._extensionService=e,DW.setHandler(r=>{const o=[];for(let a=0,c=r.length;a{r.affectsConfiguration(aRe)&&this.updateMime()})),this._extensionService.whenInstalledExtensionsRegistered().then(()=>{this.updateMime()}),this._register(this.onDidRequestRichLanguageFeatures(r=>{this._extensionService.activateByEvent(`onLanguage:${r}`),this._extensionService.activateByEvent("onLanguage")}))}updateMime(){const e=this._configurationService.getValue();LEt(),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}`;kEt({id:i,mime:n,filepattern:t})}),this._onDidChange.fire()}};Hbe=D([_(0,ps),_(1,Te),_(2,ec),_(3,Ke)],Hbe);function LK(s){return typeof s>"u"?!0:Array.isArray(s)?s.every(e=>typeof e=="string"):!1}function Eet(s,e){return s?typeof s.id!="string"?(e?.error(g(2484,"property `{0}` is mandatory and must be of type `string`","id")),!1):LK(s.extensions)?LK(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):LK(s.aliases)?LK(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}`",DW.name)),!1)}const xet="_snippet.markAsUsed";vt.registerCommand(xet,(s,...e)=>{const t=s.get(hce),[i]=e;i instanceof Aet&&t.updateUsageTimestamp(i)});class CV{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===$w.Extension?"z":"a"}-${e.prefix}`,this.kind=Me.Snippet,this.insertTextRules=Zg.InsertAsSnippet,this.command={id:xet,title:"",arguments:[e]}}resolve(){return this.documentation=new Nt().appendCodeblock("",tv.asInsertText(this.snippet.codeSnippet)),this}static compareByLabel(e,t){return mm(e.label.label,t.label.label)}}let Ube=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 Ys,r=t.lineNumber,o=e.getWordAtPosition(t)??{startColumn:t.column,endColumn:t.column,word:""},a=e.getLineContent(t.lineNumber).toLowerCase(),c=a.substring(0,o.startColumn+o.word.length-1),l=this._computeSnippetPositions(e,r,o,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===ju.TriggerCharacter&&!v.prefixLow.startsWith(h))continue;let b;for(const R of l)if(!(R.prefixLow.match(/^\s/)&&!v.prefixLow.match(/^\s/))&&cYe(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=Goe(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:r,column:b.startColumn},{lineNumber:r,column:L}),P=k.setEndPosition(r,t.column);m.push(new CV(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 CV(v,{replace:w,insert:b}))}return this._disambiguateSnippets(m),{suggestions:m,duration:n.elapsed()}}_disambiguateSnippets(e){e.sort(CV.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 CV?e.resolve():e}_computeSnippetPositions(e,t,i,n){const r=[];for(let o=1;o0||r.length===0)&&r.push({startColumn:i.startColumn,prefixLow:n.substring(i.startColumn-1),isWord:!0}),r}_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}};Ube=D([_(0,Di),_(1,hce),_(2,zs)],Ube);var mQ,_Q,EX;(function(s){function e(t,i,n){if(Qu(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(Qu(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(!Qu(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 r=t.description.extensionLocation,o=Ft(r,i.path);return Jy(o,r)?{language:i.language,location:o}:(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,o.path,r.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=ih.registerExtensionPoint({extensionPoint:"snippets",deps:[DW],jsonSchema:s.snippetsContribution})})(EX||(EX={}));function nFt(s,e,t){return Yo(s.watch(e),s.onDidFilesChange(i=>{i.affects(e)&&t()}))}var NL;let Vbe=(NL=class{constructor(e){this._storageService=e;const t=e.get(mQ._key,Ie.PROFILE,"");let i;try{i=JSON.parse(t)}catch{}this._ignored=KGe(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(mQ._key,JSON.stringify(Array.from(this._ignored)),Ie.PROFILE,cn.USER)}},mQ=NL,NL._key="snippets.ignoredSnippets",NL);Vbe=mQ=D([_(0,Gi)],Vbe);var PL;let zbe=(PL=class{constructor(e){this._storageService=e;const t=e.get(_Q._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(_Q._key,JSON.stringify(t),Ie.PROFILE,cn.USER)}},_Q=PL,PL._key="snippets.usageTimestamps",PL);zbe=_Q=D([_(0,Gi)],zbe);let TUe=class{constructor(e,t,i,n,r,o,a,c,l,d,h){this._environmentService=e,this._userDataProfileService=t,this._contextService=i,this._languageService=n,this._logService=r,this._fileService=o,this._textfileService=a,this._extensionResourceLoaderService=c,this._disposables=new Z,this._pendingWork=[],this._files=new gi,this._pendingWork.push(Promise.resolve(l.when(Ms.Restored).then(()=>{this._initExtensionSnippets(),this._initUserSnippets(),this._initWorkspaceSnippets()}))),qNt(new Ube(this._languageService,this,h)),this._enablement=d.createInstance(Vbe),this._usageTimestamps=d.createInstance(zbe)}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 r of this._files.values())n.push(r.load().then(o=>o.select(e,i)).catch(o=>this._logService.error(o,r.location.toString())))}else for(const r of this._files.values())n.push(r.load().then(o=>VGe(i,i.length,o.data)).catch(o=>this._logService.error(o,r.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(r=>{}),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,r)=>{let o=0;if(!t?.noRecencySort){const a=this._usageTimestamps.getUsageTimestamp(n.snippetIdentifier)??-1;o=(this._usageTimestamps.getUsageTimestamp(r.snippetIdentifier)??-1)-a}return o===0&&(o=this._compareSnippet(n,r)),o})}_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===$w.Extension&&this._files.delete(t);for(const t of e)for(const i of t.value){const n=EX.toValidSnippet(t,i,this._languageService);if(!n)continue;const r=this._files.get(n.location);if(r)r.defaultScopes?r.defaultScopes.push(n.language):r.defaultScopes=[];else{const o=new fue($w.Extension,n.location,n.language?[n.language]:void 0,t.description,this._fileService,this._extensionResourceLoaderService);this._files.set(o.location,o),this._environmentService.isExtensionDevelopment&&o.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.',o.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 r=n.toResource(".vscode");await this._fileService.exists(r)?this._initFolderSnippets($w.Workspace,r,t):t.add(this._fileService.onDidFilesChange(a=>{a.contains(r,Tr.ADDED)&&this._initFolderSnippets($w.Workspace,r,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($w.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,r=async()=>{if(n.clear(),!!await this._fileService.exists(t))try{const o=await this._fileService.resolve(t);for(const a of o.children||[])n.add(this._addSnippetFile(a.resource,e))}catch(o){this._logService.error(`Failed snippets from folder '${t.toString()}'`,o)}};return i.add(this._textfileService.files.onDidSave(o=>{Jy(o.model.resource,t)&&r()})),i.add(nFt(this._fileService,t,r)),i.add(n),r()}_addSnippetFile(e,t){const i=xU(e);if(t===$w.User&&i===".json"){const n=vi(e).replace(/\.json/,"");this._files.set(e,new fue(t,e,[n],void 0,this._fileService,this._extensionResourceLoaderService))}else i===".code-snippets"&&this._files.set(e,new fue(t,e,void 0,void 0,this._fileService,this._extensionResourceLoaderService));return{dispose:()=>this._files.delete(e)}}};TUe=D([_(0,ec),_(1,pg),_(2,Ci),_(3,Di),_(4,Ke),_(5,Xt),_(6,Fr),_(7,ice),_(8,rg),_(9,we),_(10,zs)],TUe);function sFt(s,e){const i=s.getLineContent(e.lineNumber).substr(0,e.column-1),n=Math.max(0,i.length-100);for(let r=i.length-1;r>=n;r--){const o=i.charAt(r);if(/\s/.test(o))return i.substr(r+1)}return n===0?i:""}var vQ,KD;let HA=(KD=class{static get(e){return e.getContribution(vQ.ID)}constructor(e,t,i,n,r){this._editor=e,this._snippetService=t,this._clipboardService=i,this._languageFeaturesService=n,this._activeSnippets=[],this._hasSnippets=vQ.ContextKey.bindTo(r),this._configListener=this._editor.onDidChangeConfiguration(o=>{o.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 o=sFt(t,e.getPosition());if(o)for(const a of n)o.endsWith(a.prefix)&&this._activeSnippets.push(a)}else if(!F.spansMultipleLines(e)&&t.getValueLengthInRange(e)<=100){const o=t.getValueInRange(e);if(o)for(const a of n)o===a.prefix&&this._activeSnippets.push(a)}const r=this._activeSnippets.length;if(r===0)this._hasSnippets.set(!1);else if(r===1)this._hasSnippets.set(!0);else{this._hasSnippets.set(!0),this._completionProvider={_debugDisplayName:"tabCompletion",dispose:()=>{o.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 CV(d,h)})}};const o=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 Yae(this._editor,jr.Value|jr.Position);if(t=await this._clipboardService.readText(),!i.validate(this._editor))return}pc.get(this._editor)?.insert(e.codeSnippet,{overwriteBefore:e.prefix.length,overwriteAfter:0,clipboardText:t})}else this._activeSnippets.length>1&&this._completionProvider&&fet(this._editor,this._completionProvider)}},vQ=KD,KD.ID="editor.tabCompletionController",KD.ContextKey=new Q("hasSnippetCompletions",void 0),KD);HA=vQ=D([_(1,hce),_(2,gg),_(3,nt),_(4,Le)],HA);on(HA.ID,HA,ai.Eager);const rFt=uc.bindToContribution(HA.get);Qe(new rFt({id:"insertSnippet",precondition:HA.ContextKey,handler:s=>s.performSnippetCompletions(),kbOpts:{weight:Ae.EditorContrib,kbExpr:he.and(J.editorTextFocus,J.tabDoesNotMoveFocus,pc.InSnippetMode.toNegated()),primary:S.Tab}}));var I_;(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")})})(I_||(I_={}));function rG(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function oFt(s,e,t){const i={id:ao(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class Ice{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 ui.some(this,([i,n])=>n.asFile())&&t.push("files"),ket(xX(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 xX(e)}}function xX(s){return s.toLowerCase()}function Det(s,e){return ket(xX(s),e.map(xX))}function ket(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,r]=t;return r==="*"?e.some(o=>o.startsWith(n+"/")):!1}const rI=Object.freeze({create:s=>Ya(s.map(e=>e.toString())).join(`\r `),split:s=>s.split(`\r `),parse:s=>rI.split(s).filter(e=>!e.startsWith("#"))}),Iw=class Iw{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+Iw.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Iw((this.value?[this.value,...e]:e).join(Iw.sep))}};Iw.sep=".",Iw.None=new Iw("@@none@@"),Iw.Empty=new Iw("");let Jn=Iw;var Zp;(function(s){function e(r){return typeof r?.showDirectoryPicker=="function"}s.supported=e;function t(r){const o=r;return o?typeof o.kind=="string"&&typeof o.queryPermission=="function"&&typeof o.requestPermission=="function":!1}s.isFileSystemHandle=t;function i(r){return r.kind==="file"}s.isFileSystemFileHandle=i;function n(r){return r.kind==="directory"}s.isFileSystemDirectoryHandle=n})(Zp||(Zp={}));class aFt{get capabilities(){return this._capabilities||(this._capabilities=zn.FileReadWrite|zn.FileReadStream,mo&&(this._capabilities|=zn.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=mo?Dn:Xoe,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(Zp.isFileSystemFileHandle(t)){const i=await t.getFile();return{type:rn.File,mtime:i.lastModified,ctime:0,size:i.size}}return{type:rn.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,r]of t)i.push([n,Zp.isFileSystemFileHandle(r)?rn.File:rn.Directory]);return i}catch(t){throw this.toFileSystemProviderError(t)}}readFileStream(e,t,i){const n=eE(r=>Ge.concat(r.map(o=>Ge.wrap(o))).buffer,{highWaterMark:10});return(async()=>{try{const r=await this.getFileHandle(e);if(!r)throw this.createFileSystemProviderError(e,"No such file or directory, readFile",ot.FileNotFound);const o=await r.getFile();if(typeof t.length=="number"||typeof t.position=="number"){let a=new Uint8Array(await o.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=o.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(r){n.error(this.toFileSystemProviderError(r)),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 o=await this.getDirectoryHandle(this.extUri.dirname(e));if(!o)throw this.createFileSystemProviderError(e,"No such parent directory, writeFile",ot.FileNotFound);if(n=await o.getFileHandle(this.extUri.basename(e),{create:!0}),!n)throw this.createFileSystemProviderError(e,"Unable to create file , writeFile",ot.Unknown)}const r=await n.createWritable();await r.write(t),await r.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 r=await n.getFile(),o=new Uint8Array(await r.arrayBuffer());await this.writeFile(t,o,{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=jy(e.name),r=Kr(e.name,n);let o=1;do i=`/${r}-${o++}${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=Dn.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(Dn.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(Dn.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",r=>r.get(t));if(Zp.isFileSystemHandle(n)){let r=await n.queryPermission()==="granted";try{r||(r=await n.requestPermission()==="granted")}catch(o){this.logService.error(o)}if(r)return Zp.isFileSystemFileHandle(n)?this._files.set(t,n):Zp.isFileSystemDirectoryHandle(n)&&this._directories.set(t,n),n}throw this.createFileSystemProviderError(e,"No file system handle registered",ot.Unavailable)}toFileSystemProviderError(e){if(e instanceof LA)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),gs(e,t)}createFileSystemProviderError(e,t,i){return gs(new Error(`${t} (${Bk(e.path)})`),i)}}const UM={EDITORS:"CodeEditors",FILES:"CodeFiles"};function cFt(s){const e=[];if(s.dataTransfer&&s.dataTransfer.types.length>0){const n=s.dataTransfer.getData(UM.EDITORS);if(n)try{e.push(...iW(n))}catch{}else try{const a=s.dataTransfer.getData(ap.RESOURCES);e.push(...lFt(a))}catch{}if(s.dataTransfer?.files)for(let a=0;adFt(o,e));for(const o of r)t.push({resource:o.resource,contents:o.contents?.toString(),isExternal:!0,allowWorkspaceOpen:o.isDirectory})}return t}function lFt(s){const e=[];if(s){const t=JSON.parse(s);for(const i of t)if(i.indexOf(":")>0){const{selection:n,uri:r}=bRe(N.parse(i));e.push({resource:r,options:{selection:n}})}}return e}async function dFt(s,e){if(Zp.supported(ri)){const i=e.dataTransfer?.items;if(i)return hFt(s,i)}const t=e.dataTransfer?.files;return t?uFt(s,t):[]}async function hFt(s,e){const t=s.get(Xt).getProvider(pe.file);if(!(t instanceof aFt))return[];const i=[];for(let n=0;n{try{const a=await r.getAsFileSystemHandle();if(!a){o.complete(void 0);return}Zp.isFileSystemFileHandle(a)?o.complete({resource:await t.registerFileHandle(a),isDirectory:!1}):Zp.isFileSystemDirectoryHandle(a)?o.complete({resource:await t.registerDirectoryHandle(a),isDirectory:!0}):o.complete(void 0)}catch{o.complete(void 0)}})()}}return Oi(await Promise.all(i.map(n=>n.p)))}async function uFt(s,e){const t=s.get(ir),i=[];for(let n=0;n100*Pc.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 o=new hc;i.push(o);const a=new FileReader;a.onerror=()=>o.complete(void 0),a.onabort=()=>o.complete(void 0),a.onload=async c=>{const l=r.name,d=c.target?.result??void 0;if(typeof l!="string"||typeof d>"u"){o.complete(void 0);return}o.complete({resource:N.from({scheme:pe.untitled,path:l}),contents:typeof d=="string"?Ge.fromString(d):Ge.wrap(new Uint8Array(d))})},a.readAsArrayBuffer(r)}}return Oi(await Promise.all(i.map(n=>n.p)))}function Tet(s,...e){if(!s.dataTransfer)return!1;const t=s.dataTransfer.types,i=[];for(let n=0;n=0)return!0;return!1}class gFt{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 JMe={DragAndDropContribution:"workbench.contributions.dragAndDrop"};je.add(JMe.DragAndDropContribution,new gFt);const e8=class e8{constructor(){}static getInstance(){return e8.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)}};e8.INSTANCE=new e8;let DX=e8;function Let(s){const e=new Ice;for(const t of s.items){const i=t.type;if(t.kind==="string"){const n=new Promise(r=>t.getAsString(r));e.append(i,rG(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,fFt(n))}}return e}function fFt(s){const e=s.path?N.parse(s.path):void 0;return oFt(s.name,e,async()=>new Uint8Array(await s.arrayBuffer()))}const pFt=Object.freeze([UM.EDITORS,UM.FILES,ap.RESOURCES,ap.INTERNAL_URI_LIST]);function Ret(s,e=!1){const t=Let(s),i=t.get(ap.INTERNAL_URI_LIST);if(i)t.replace(Vs.uriList,i);else if(e||!t.has(Vs.uriList)){const n=[];for(const r of s.items){const o=r.getAsFile();if(o){const a=o.path;try{a?n.push(N.file(a).toString()):n.push(N.parse(o.name,!0).toString())}catch{}}}n.length&&t.replace(Vs.uriList,rG(rI.create(n)))}for(const n of pFt)t.delete(n);return t}class XMe{async provideDocumentPasteEdits(e,t,i,n,r){const o=await this.getEdit(i,r);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const r=await this.getEdit(i,n);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}}const rO=class rO extends XMe{constructor(){super(...arguments),this.id=rO.id,this.kind=rO.kind,this.dropMimeTypes=[Vs.text],this.pasteMimeTypes=[Vs.text]}async getEdit(e,t){const i=e.get(Vs.text);if(!i||e.has(Vs.uriList))return;const n=await i.asString();return{handledMimeType:Vs.text,title:g(5042,"Insert Plain Text"),insertText:n,kind:this.kind}}};rO.id="text",rO.kind=new Jn("text.plain");let VM=rO;class Met extends XMe{constructor(){super(...arguments),this.kind=new Jn("uri.absolute"),this.dropMimeTypes=[Vs.uriList],this.pasteMimeTypes=[Vs.uriList]}async getEdit(e,t){const i=await Net(e);if(!i.length||t.isCancellationRequested)return;let n=0;const r=i.map(({uri:a,originalText:c})=>a.scheme===pe.file?a.fsPath:(n++,c)).join(" ");let o;return n>0?o=i.length>1?g(5043,"Insert Uris"):g(5044,"Insert Uri"):o=i.length>1?g(5045,"Insert Paths"):g(5046,"Insert Path"),{handledMimeType:Vs.uriList,insertText:r,title:o,kind:this.kind}}}let kX=class extends XMe{constructor(e){super(),this._workspaceContextService=e,this.kind=new Jn("uri.relative"),this.dropMimeTypes=[Vs.uriList],this.pasteMimeTypes=[Vs.uriList]}async getEdit(e,t){const i=await Net(e);if(!i.length||t.isCancellationRequested)return;const n=Oi(i.map(({uri:r})=>{const o=this._workspaceContextService.getWorkspaceFolder(r);return o?MN(o.uri,r):void 0}));if(n.length)return{handledMimeType:Vs.uriList,insertText:n.join(" "),title:i.length>1?g(5047,"Insert Relative Paths"):g(5048,"Insert Relative Path"),kind:this.kind}}};kX=D([_(0,Ci)],kX);class mFt{constructor(){this.kind=new Jn("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Vs.text}]}async provideDocumentPasteEdits(e,t,i,n,r){if(n.triggerKind!==D8.PasteAs&&!n.only?.contains(this.kind))return;const a=await i.get("text/html")?.asString();if(!(!a||r.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:g(5049,"Insert HTML"),kind:this.kind}]}}}async function Net(s){const e=s.get(Vs.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of rI.parse(t))try{i.push({uri:N.parse(n),originalText:n})}catch{}return i}let $be=class extends V{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new VM)),this._register(e.documentDropEditProvider.register("*",new Met)),this._register(e.documentDropEditProvider.register("*",new kX(t)))}};$be=D([_(0,nt),_(1,Ci)],$be);let Gbe=class extends V{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new VM)),this._register(e.documentPasteEditProvider.register("*",new Met)),this._register(e.documentPasteEditProvider.register("*",new kX(t))),this._register(e.documentPasteEditProvider.register("*",new mFt))}};Gbe=D([_(0,nt),_(1,Ci)],Gbe);function Pet(s,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new rA(s,{range:i,text:typeof t.insertText=="string"?tv.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function Fet(s){function e(o,a){return"mimeType"in o?o.mimeType===a.handledMimeType:!!a.kind&&o.kind.contains(a.kind)}const t=new Map;for(const o of s)for(const a of o.yieldTo??[])for(const c of s)if(c!==o&&e(a,c)){let l=t.get(o);l||(l=[],t.set(o,l)),l.push(c)}if(!t.size)return Array.from(s);const i=new Set,n=[];function r(o){if(!o.length)return[];const a=o[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),o;if(i.has(a))return r(o.slice(1));let c=[];const l=t.get(a);return l&&(n.push(a),c=r(l),n.pop()),i.add(a),[...c,a,...r(o.slice(1))]}return r(Array.from(s))}var _Ft=".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)}";gt(_Ft,{});const vFt=Kt.register({description:"inline-progress-widget",stickiness:si.NeverGrowsWhenTypingAtEdges,showIfCollapsed:!0,after:{content:wKe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),Xse=class Xse extends V{constructor(e,t,i,n,r){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=r,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(...He.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 Xse.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[ts.EXACT]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};Xse.baseId="editor.widget.inlineProgressWidget";let Kbe=Xse,IX=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 yn),this._currentWidget=this._register(new yn),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,r){const o=this._operationIdPool++;this._currentOperation=o,this.clear(),this._showPromise.value=Zy(()=>{const a=F.fromPositions(e);this._currentDecorations.set([{range:a,options:vFt}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Kbe,this.id,this._editor,a,t,n))},r??this._showDelay);try{return await i}finally{this._currentOperation===o&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};IX=D([_(2,we)],IX);var bFt=".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}";gt(bFt,{});var bQ,qD;let Mh=(qD=class{static get(e){return e.getContribution(bQ.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new yn,this._messageListeners=new Z,this._mouseOverMessage=!1,this._editor=e,this._visible=bQ.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){No(ud(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=ud(e)?x6(e,{actionHandler:{callback:n=>{this.closeMessage(),Rae(this._openerService,n,ud(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new LUe(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(M.debounce(this._editor.onDidBlurEditorText,(n,r)=>r,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&yc(Wc(),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(LUe.fadeOut(this._messageWidget.value))}},bQ=qD,qD.ID="editor.contrib.messageController",qD.MESSAGE_VISIBLE=new Q("messageVisible",!1,g(5105,"Whether the editor is currently showing an inline message")),qD);Mh=bQ=D([_(1,Le),_(2,Ar)],Mh);const wFt=uc.bindToContribution(Mh.get);Qe(new wFt({id:"leaveEditorMessage",precondition:Mh.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:Ae.EditorContrib+30,primary:S.Escape}}));let LUe=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,_t.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 r=document.createElement("div");r.classList.add("anchor","top"),this._domNode.appendChild(r);const o=document.createElement("div");typeof n=="string"?(o.classList.add("message"),o.textContent=n):(n.classList.add("message"),o.appendChild(n)),this._domNode.appendChild(o);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:[ts.ABOVE,ts.BELOW],positionAffinity:Ir.Right}}afterRender(e){this._domNode.classList.toggle("below",e===ts.BELOW)}};on(Mh.ID,Mh,ai.Lazy);var fd;(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"})(fd||(fd={}));const RFe=class RFe{get value(){return this._value}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};RFe.None=Object.freeze({report(){}});let hu=RFe,RUe=class extends V{constructor(e,t){super(),this.deferred=new hc,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}};RUe=D([_(1,hg)],RUe);var yFt=".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}";gt(yFt,{});var qbe,FL;let Qbe=(FL=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=r,this.edits=o,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=>{r.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 Zd(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ue(this.domNode,ke.CLICK,()=>this.showSelector()))}getId(){return qbe.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[ts.BELOW]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=So(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>al({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},qbe=FL,FL.baseId="editor.widget.postEditWidget",FL);Qbe=qbe=D([_(7,lo),_(8,Le),_(9,Vt)],Qbe);let TX=class extends V{constructor(e,t,i,n,r,o,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=r,this._bulkEditService=o,this._notificationService=a,this._currentWidget=this._register(new yn),this._register(M.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,r){const o=this._editor.getModel();if(!o||!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,r))},l=(v,b)=>{Oo(v)||(this._notificationService.error(b),i&&this.show(e[0],t,c))};let d;try{d=await n(a,r)}catch(v){return l(v,g(9845,`Error resolving edit '{0}': {1}`,a.title,Po(v)))}if(r.isCancellationRequested)return;const h=Pet(o.uri,e,d),u=e[0],f=o.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:si.AlwaysGrowsWhenTypingAtEdges}}]);this._editor.focus();let p,m;try{p=await this._bulkEditService.apply(h,{editor:this._editor,token:r}),m=o.getDecorationRange(f[0])}catch(v){return l(v,g(9846,`Error applying edit '{0}': -{1}`,a.title,Po(v)))}finally{o.deltaDecorations(f,[])}r.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(Qbe,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};TX=D([_(4,we),_(5,UN),_(6,wi)],TX);var p0;const Oet="editor.changePasteType",ZMe=new Q("pasteWidgetVisible",!1,g(4993,"Whether the paste widget is showing")),pue="application/vnd.code.copyMetadata";var OL;let cC=(OL=class extends V{static get(e){return e.getContribution(p0.ID)}constructor(e,t,i,n,r,o,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=r,this._quickInputService=o,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 IX("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(TX,"pasteIntoEditor",e,ZMe,{id:Oet,label:g(4994,"Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},Vu().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()||(Hn&&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 r=i;const o=i.length===1&&i[0].isEmpty();if(o){if(!n)return;r=[new F(r[0].startLineNumber,1,r[0].startLineNumber,1+t.getLineLength(r[0].startLineNumber))]}const a=this._editor._getViewModel()?.getPlainTextToCopy(i,n,jn),l={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:o,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(m=>!!m.prepareDocumentPaste);if(!d.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:l});return}const h=Let(e.clipboardData),u=d.flatMap(m=>m.copyMimeTypes??[]),f=ao();this.setCopyMetadata(e.clipboardData,{id:f,providerCopyMimeTypes:u,defaultPastePayload:l});const p=Mo(async m=>{const v=Oi(await Promise.all(d.map(async b=>{try{return await b.prepareDocumentPaste(t,r,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});p0._currentCopyOperation?.dataTransferPromise.cancel(),p0._currentCopyOperation={handle:f,dataTransferPromise:p}}async handlePaste(e){if(!e.clipboardData||!this._editor.hasTextFocus())return;Mh.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),r=Ret(e.clipboardData);r.delete(pue);const o=[...e.clipboardData.types,...n?.providerCopyMimeTypes??[],Vs.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=>Det(d,o))});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,r,n):this.doPasteInline(a,i,r,n,e)}showPasteAsNoEditMessage(e,t){Mh.get(this._editor)?.showMessage(g(4995,"No paste edits for '{0}' found",t instanceof Jn?t.value:t.providerId),e[0].getStartPosition())}doPasteInline(e,t,i,n,r){const o=this._editor;if(!o.hasModel())return;const a=new nI(o,jr.Value|jr.Selection,void 0),c=Mo(async l=>{const d=this._editor;if(!d.hasModel())return;const h=d.getModel(),u=new Z,f=u.add(new li(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 VM)return this.applyDefaultPasteHandler(i,n,p,r);const v={triggerKind:D8.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 VM)return this.applyDefaultPasteHandler(i,n,p,r);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 hc,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 Na))},0);return R&&(y.additionalEdit=R.additionalEdit),A(y)}catch(k){return L(k)}})()}),p)}await this.applyDefaultPasteHandler(i,n,p,r)}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,r)}finally{a.dispose()}}}).then(()=>{a.dispose()}),this._currentPasteOperation=c}showPasteAsPick(e,t,i,n,r){const o=Mo(async a=>{const c=this._editor;if(!c.hasModel())return;const l=c.getModel(),d=new Z,h=d.add(new nI(c,jr.Value|jr.Selection,void 0,a));try{if(await this.mergeInDataFromCopy(n,r,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:D8.PasteAs,only:e&&e instanceof Jn?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 Jn?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=Pet(l.uri,i,m);await this._bulkEditService.apply(v,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:fd.Window,title:g(4999,"Running paste handlers")},()=>o)}setCopyMetadata(e,t){e.setData(pue,JSON.stringify(t))}fetchCopyMetadata(e){if(!e.clipboardData)return;const t=e.clipboardData.getData(pue);if(t)try{return JSON.parse(t)}catch{return}const[i,n]=wme.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&&p0._currentCopyOperation?.handle===t.id){const n=await p0._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[r,o]of n)e.replace(r,o)}if(!e.has(Vs.uriList)){const n=await this._clipboardService.readResources();if(i.isCancellationRequested)return;n.length&&e.append(Vs.uriList,rG(rI.create(n)))}}async getPasteEdits(e,t,i,n,r,o){const a=new Z,c=await $_(Promise.all(e.map(async d=>{try{const h=await d.provideDocumentPasteEdits?.(i,n,t,r,o);return h&&a.add(h),h?.edits?.map(u=>({...u,provider:d}))}catch(h){Oo(h)||console.error(h);return}})),o),l=Oi(c??[]).flat().filter(d=>!r.only||r.only.contains(d.kind));return{edits:Fet(l),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,n){const o=await(e.get(Vs.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;const a={clipboardEvent:n,text:o,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 Jn?e.providedPasteEditKinds?e.providedPasteEditKinds.some(i=>t.contains(i)):!0:e.id===t.providerId}},p0=OL,OL.ID="editor.contrib.copyPasteActionController",OL);cC=p0=D([_(1,we),_(2,UN),_(3,gg),_(4,nt),_(5,Tn),_(6,hg)],cC);const Cs=new class{constructor(){this.QuickFix=new Jn("quickfix"),this.Refactor=new Jn("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 Jn("notebook"),this.Source=new Jn("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var od;(function(s){s.IfSingle="ifSingle",s.First="first",s.Never="never"})(od||(od={}));var ag;(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"})(ag||(ag={}));function CFt(s,e){return!(s.include&&!s.include.intersects(e)||s.excludes&&s.excludes.some(t=>Bet(e,t,s.include))||!s.includeSourceActions&&Cs.Source.contains(e))}function SFt(s,e){const t=e.kind?new Jn(e.kind):void 0;return!(s.include&&(!t||!s.include.contains(t))||s.excludes&&t&&s.excludes.some(i=>Bet(t,i,s.include))||!s.includeSourceActions&&t&&Cs.Source.contains(t)||s.onlyIncludePreferredActions&&!e.isPreferred)}function Bet(s,e,t){return!(!e.contains(s)||t&&e.contains(t))}class Jw{static fromUser(e,t){return!e||typeof e!="object"?new Jw(t.kind,t.apply,!1):new Jw(Jw.getKindFromUser(e,t.kind),Jw.getApplyFromUser(e,t.apply),Jw.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return od.First;case"never":return od.Never;case"ifsingle":return od.IfSingle;default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Jn(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 AFt{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){Nr(i)}t&&(this.action.edit=t.edit)}return this}}const eNe="editor.action.codeAction",tNe="editor.action.quickFix",Wet="editor.action.autoFix",iNe="editor.action.refactor",nNe="editor.action.sourceAction",jbe="editor.action.organizeImports",Ybe="editor.action.fixAll";class K5 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:tr(e.diagnostics)?tr(t.diagnostics)?K5.codeActionsPreferredComparator(e,t):-1:tr(t.diagnostics)?1:K5.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(K5.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Cs.QuickFix.contains(new Jn(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 MUe={actions:[],documentation:void 0};async function rB(s,e,t,i,n,r){const o=i.filter||{},a={...o,excludes:[...o.excludes||[],Cs.Notebook]},c={only:o.include?.value,trigger:i.type},l=new nMe(e,r),d=i.type===Ah.Auto,h=EFt(s,e,d?a:o),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 MUe;const b=(v?.actions||[]).filter(y=>y&&SFt(o,y)),w=DFt(m,b,o.include);return{actions:b.map(y=>new AFt(y,m)),documentation:w}}catch(v){if(Oo(v))throw v;return Nr(v),MUe}}),p=s.onDidChange(()=>{const m=s.all(e);ns(m,h)||l.cancel()});try{const m=await Promise.all(f),v=m.map(w=>w.actions).flat(),b=[...Oi(m.map(w=>w.documentation)),...xFt(s,e,i,v)];return new K5(v,b,u)}finally{p.dispose(),l.dispose()}}function EFt(s,e,t){return s.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>CFt(t,new Jn(n))):!0)}function*xFt(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(r=>r.action)))}function DFt(s,e,t){if(!s.documentation)return;const i=s.documentation.map(n=>({kind:new Jn(n.kind),command:n.command}));if(t){let n;for(const r of i)r.kind.contains(t)&&(n?n.kind.contains(r.kind)&&(n=r):n=r);if(n)return n?.command}for(const n of e)if(n.kind){for(const r of i)if(r.kind.contains(new Jn(n.kind)))return r.command}}var Hx;(function(s){s.OnSave="onSave",s.FromProblemsView="fromProblemsView",s.FromCodeActions="fromCodeActions",s.FromAILightbulb="fromAILightbulb"})(Hx||(Hx={}));async function Het(s,e,t,i,n=Ue.None){const r=s.get(UN),o=s.get(bi),a=s.get(Ji),c=s.get(wi);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 r.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Hx.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await o.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(l){const d=kFt(l);c.error(typeof d=="string"?d:g(4521,"An unknown error occurred while applying the code action"))}}function kFt(s){return typeof s=="string"?s:s instanceof Error&&typeof s.message=="string"?s.message:void 0}vt.registerCommand("_executeCodeActionProvider",async function(s,e,t,i,n){if(!(e instanceof N))throw Fi();const{codeActionProvider:r}=s.get(nt),o=s.get(fi).getModel(e);if(!o)throw Fi();const a=ht.isISelection(t)?ht.liftSelection(t):F.isIRange(t)?o.validateRange(t):void 0;if(!a)throw Fi();const c=typeof i=="string"?new Jn(i):void 0,l=await rB(r,o,a,{type:Ah.Invoke,triggerAction:ag.Default,filter:{includeSourceActions:!0,include:c}},hu.None,Ue.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 Jbe,BL;let Xbe=(BL=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Ca(()=>this.keybindingService.getKeybindings().filter(t=>Jbe.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===jbe?i={kind:Cs.SourceOrganizeImports.value}:t.command===Ybe&&(i={kind:Cs.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Jw.fromUser(i,{kind:Jn.None,apply:od.Never})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Jn(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,r)=>n?n.kind.contains(r.kind)?r:n:r,void 0)}},Jbe=BL,BL.codeActionCommands=[iNe,eNe,nNe,jbe,Ybe],BL);Xbe=Jbe=D([_(0,Vt)],Xbe);var IFt='.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}';gt(IFt,{});const Uet="acceptSelectedCodeAction",Vet="previewSelectedCodeAction";var v_;(function(s){s.Action="action",s.Header="header"})(v_||(v_={}));class TFt{get templateId(){return v_.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 Zbe=class{get templateId(){return v_.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 Zk(e,pr);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=He.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=$e(e.group.icon.color.id))):(i.icon.className=He.asClassName(ve.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=zet(e.label),i.keybinding.set(e.keybinding),WTe(!!e.keybinding,i.keybinding.element);const n=this._keybindingService.lookupKeybinding(Uet)?.getLabel(),r=this._keybindingService.lookupKeybinding(Vet)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:n&&r?this._supportsPreview&&e.canPreview?i.container.title=g(11229,"{0} to Apply, {1} to Preview",n,r):i.container.title=g(11230,"{0} to Apply",n):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};Zbe=D([_(1,Vt)],Zbe);class LFt extends UIEvent{constructor(){super("acceptSelectedAction")}}class NUe extends UIEvent{constructor(){super("previewSelectedAction")}}function RFt(s){if(s.kind==="action")return s.label}let ewe=class extends V{constructor(e,t,i,n,r,o){super(),this._delegate=n,this._contextViewService=r,this._keybindingService=o,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new li),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:c=>c.kind===v_.Header?this._headerLineHeight:this._actionLineHeight,getTemplateId:c=>c.kind};this._list=this._register(new Za(e,this.domNode,a,[new Zbe(t,this._keybindingService),new TFt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:RFt},accessibilityProvider:{getAriaLabel:c=>{if(c.kind===v_.Action){let l=c.label?zet(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===v_.Action?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(zN),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===v_.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 r=e;if(this._allMenuItems.length>=50)r=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});r=Math.max(...c,e)}const a=Math.min(n,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,r),this.domNode.style.height=`${a}px`,this._list.domFocus(),r}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 r=e?new NUe:new LFt;this._list.setSelection([i],r)}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 NUe):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===v_.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([])}};ewe=D([_(4,bf),_(5,Vt)],ewe);function zet(s){return s.replace(/\r\n|\r|\n/g," ")}const $et=Object.freeze({kind:Jn.Empty,title:g(9847,"More Actions...")}),MFt=Object.freeze([{kind:Cs.QuickFix,title:g(9848,"Quick Fix")},{kind:Cs.RefactorExtract,title:g(9849,"Extract"),icon:ve.wrench},{kind:Cs.RefactorInline,title:g(9850,"Inline"),icon:ve.wrench},{kind:Cs.RefactorRewrite,title:g(9851,"Rewrite"),icon:ve.wrench},{kind:Cs.RefactorMove,title:g(9852,"Move"),icon:ve.wrench},{kind:Cs.SurroundWith,title:g(9853,"Surround With"),icon:ve.surroundWith},{kind:Cs.Source,title:g(9854,"Source Action"),icon:ve.symbolFile},$et]);function NFt(s,e,t){if(!e)return s.map(r=>({kind:v_.Action,item:r,group:$et,disabled:!!r.action.disabled,label:r.action.disabled||r.action.title,canPreview:!!r.action.edit?.edits.length}));const i=MFt.map(r=>({group:r,actions:[]}));for(const r of s){const o=r.action.kind?new Jn(r.action.kind):Jn.None;for(const a of i)if(a.group.kind.contains(o)){a.actions.push(r);break}}const n=[];for(const r of i)if(r.actions.length){n.push({kind:v_.Header,group:r.group});for(const o of r.actions){const a=r.group;n.push({kind:v_.Action,item:o,group:o.action.isAI?{title:a.title,kind:a.kind,icon:ve.sparkle}:a,label:o.action.title,disabled:!!o.action.disabled,keybinding:t(o.action)})}}return n}var PFt='.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))}';gt(PFt,{});var HP;const PUe=oi("gutter-lightbulb",ve.lightBulb,g(5031,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),FUe=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.")),OUe=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.")),BUe=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.")),WUe=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 xd;(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,r,o,a){this.actions=n,this.trigger=r,this.editorPosition=o,this.widgetPosition=a,this.type=e.Showing}}s.Showing=t})(xd||(xd={}));var zS;let i9=(zS=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=xd.Hidden,this._gutterState=xd.Hidden,this._iconClasses=[],this.gutterDecoration=HP.GUTTER_DECORATION,this._domNode=fe("div.lightBulbWidget"),this._domNode.role="listbox",this._register(md.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const n=this._editor.getModel();(this.state.type!==xd.Type.Showing||!n||this.state.editorPosition.lineNumber>=n.getLineCount())&&this.hide(),(this.gutterState.type!==xd.Type.Showing||!n||this.gutterState.editorPosition.lineNumber>=n.getLineCount())&&this.gutterHide()})),this._register(Fht(this._domNode,i=>{if(this.state.type!==xd.Type.Showing)return;this._editor.focus(),i.preventDefault();const{top:n,height:r}=So(this._domNode),o=this._editor.getOption(x.lineHeight);let a=Math.floor(o/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(Wet)?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding(tNe)?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async i=>{const n=["codicon-"+PUe.id,"codicon-"+BUe.id,"codicon-"+FUe.id,"codicon-"+OUe.id,"codicon-"+WUe.id];if(!i.target.element||!n.some(l=>i.target.element&&i.target.element.classList.contains(l))||this.gutterState.type!==xd.Type.Showing)return;this._editor.focus();const{top:r,height:o}=So(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=o,m=1;if(!u){const w=y=>{const C=r.getLineContent(y);return/^\s*$|^\s+/.test(C)||C.length<=m};if(o>1&&!f(o-1)){const y=r.getLineCount(),C=o===y,A=o>1&&w(o-1),L=!C&&w(o+1),k=w(o),P=!L&&!A;let R=!1;const z=this._editor.getLineDecorations(o);if(z)for(const G of z)G.options.glyphMarginClassName?.includes(ve.debugBreakpoint.id)&&(R=!0);if(!L&&!A&&!R)return this.gutterState=new xd.Showing(e,t,i,{position:{lineNumber:p,column:m},preference:HP._posPref}),this.renderGutterLightbub(),this.hide();A||C||P&&!k?p-=1:(L||P&&k)&&(p+=1)}else{if(o===1&&(o===r.getLineCount()||!w(o+1)&&!w(o)))return this.gutterState=new xd.Showing(e,t,i,{position:{lineNumber:p,column:m},preference:HP._posPref}),this.renderGutterLightbub(),this.hide();if(o{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===xd.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}},HP=zS,zS.GUTTER_DECORATION=Kt.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:He.asClassName(ve.lightBulb),glyphMargin:{position:j_.Left},stickiness:si.NeverGrowsWhenTypingAtEdges}),zS.ID="editor.contrib.lightbulbWidget",zS._posPref=[ts.EXACT],zS);i9=HP=D([_(1,Vt)],i9);W("actionBar.toggledBackground",b6,g(9855,"Background color for toggled action items in action bar."));const zM={Visible:new Q("codeActionMenuVisible",!1,g(9856,"Whether the action widget list is visible"))},YN=ae("actionWidgetService");let $M=class extends V{get isVisible(){return zM.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new yn)}show(e,t,i,n,r,o,a){const c=zM.Visible.bindTo(this._contextKeyService),l=this._instantiationService.createInstance(ewe,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>r,render:d=>(c.set(!0),this._renderWidget(d,l,a??[])),onHide:d=>{c.reset(),this._onWidgetClosed(d)}},o,!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 r=new Z,o=document.createElement("div"),a=e.appendChild(o);a.classList.add("context-view-block"),r.add(ue(a,ke.MOUSE_DOWN,f=>f.stopPropagation()));const c=document.createElement("div"),l=e.appendChild(c);l.classList.add("context-view-pointerBlock"),r.add(ue(l,ke.POINTER_MOVE,()=>l.remove())),r.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),r.add(f),d=f.getContainer().offsetWidth)}const h=this._list.value?.layout(d);n.style.width=`${h}px`;const u=r.add(Ec(e));return r.add(u.onDidBlur(()=>this.hide(!0))),r}_createActionBar(e,t){if(!t.length)return;const i=fe(e),n=new gd(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){this._list.value?.hide(e)}};$M=D([_(0,bf),_(1,Le),_(2,we)],$M);ce(YN,$M,Qt.Delayed);const oG=Ae.EditorContrib+1e3;Et(class extends di{constructor(){super({id:"hideCodeActionWidget",title:Pe(9857,"Hide action widget"),precondition:zM.Visible,keybinding:{weight:oG,primary:S.Escape,secondary:[U.Shift|S.Escape]}})}run(s){s.get(YN).hide(!0)}});Et(class extends di{constructor(){super({id:"selectPrevCodeAction",title:Pe(9858,"Select previous action"),precondition:zM.Visible,keybinding:{weight:oG,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(YN);e instanceof $M&&e.focusPrevious()}});Et(class extends di{constructor(){super({id:"selectNextCodeAction",title:Pe(9859,"Select next action"),precondition:zM.Visible,keybinding:{weight:oG,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(YN);e instanceof $M&&e.focusNext()}});Et(class extends di{constructor(){super({id:Uet,title:Pe(9860,"Accept selected action"),precondition:zM.Visible,keybinding:{weight:oG,primary:S.Enter,secondary:[U.CtrlCmd|S.Period]}})}run(s){const e=s.get(YN);e instanceof $M&&e.acceptSelected()}});Et(class extends di{constructor(){super({id:Vet,title:Pe(9861,"Preview selected action"),precondition:zM.Visible,keybinding:{weight:oG,primary:U.CtrlCmd|S.Enter}})}run(s){const e=s.get(YN);e instanceof $M&&e.acceptSelected(!0)}});const Get=new Q("supportedCodeAction",""),HUe="_typescript.applyFixAllCodeAction";class FFt 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 Em),this._register(this._markerService.onMarkerChanged(r=>this._onMarkerChanges(r))),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=>Yi(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:Ah.Auto,triggerAction:ag.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===Ah.Invoke)return t;const i=this._editor.getOption(x.lightbulb).enabled;if(i!==d_.Off){{if(i===d_.On)return t;if(i===d_.OnCode){if(!t.isEmpty())return t;const r=this._editor.getModel(),{lineNumber:o,column:a}=t.getPosition(),c=r.getLineContent(o);if(c.length===0)return;if(a===1){if(/\s/.test(c[0]))return}else if(a===r.getLineMaxColumn(o)){if(/\s/.test(c[c.length-1]))return}else if(/\s/.test(c[a-2])&&/\s/.test(c[a-1]))return}}return t}}}var Wv;(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,r,o){this.trigger=n,this.position=r,this._cancellablePromise=o,this.type=e.Triggered,this.actions=o.catch(a=>{if(Oo(a))return Ket;throw a})}cancel(){this._cancellablePromise.cancel()}}s.Triggered=t})(Wv||(Wv={}));const Ket=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class OFt extends V{constructor(e,t,i,n,r,o){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=r,this._configurationService=o,this._codeActionOracle=this._register(new yn),this._state=Wv.Empty,this._onDidChangeState=this._register(new I),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=Get.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(Wv.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(Wv.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 FFt(this._editor,this._markerService,i=>{if(!i){this.setState(Wv.Empty);return}const n=i.selection.getStartPosition(),r=Mo(async c=>{if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===Ah.Invoke&&(i.trigger.triggerAction===ag.QuickFix||i.trigger.filter?.include?.contains(Cs.QuickFix))){const l=await rB(this._registry,e,i.selection,i.trigger,hu.None,c),d=[...l.allActions];if(c.isCancellationRequested)return Ket;const h=l.validActions?.some(f=>f.action.kind?Cs.QuickFix.contains(new Jn(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(HUe))&&(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 re(C,y);const L={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:i.trigger.filter?.include?i.trigger.filter?.include:Cs.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:i.trigger.context?.notAvailableMessage||"",position:p}},k=new ht(p.lineNumber,p.column,p.lineNumber,p.column),P=await rB(this._registry,e,k,L,hu.None,c);if(P.validActions.length!==0){for(const R of P.validActions)R.action.command?.arguments?.some(z=>typeof z=="string"&&z.includes(HUe))&&(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 rB(this._registry,e,i.selection,i.trigger,hu.None,c)});i.trigger.type===Ah.Invoke&&this._progressService?.showWhile(r,250);const o=new Wv.Triggered(i.trigger,n,r);let a=!1;this._state.type===Wv.Type.Triggered&&(a=this._state.trigger.type===Ah.Invoke&&o.type===Wv.Type.Triggered&&o.trigger.type===Ah.Auto&&this._state.position!==o.position),a?setTimeout(()=>{this.setState(o)},500):this.setState(o)},void 0),this._codeActionOracle.value.trigger({type:Ah.Auto,triggerAction:ag.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===Wv.Type.Triggered&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var UP;const BFt="quickfix-edit-highlight";var QD;let GM=(QD=class extends V{static get(e){return e.getContribution(UP.ID)}constructor(e,t,i,n,r,o,a,c,l,d){super(),this._commandService=a,this._configurationService=c,this._actionWidgetService=l,this._instantiationService=d,this._activeCodeActions=this._register(new yn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new OFt(this._editor,r.codeActionProvider,t,i,o,c)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new Ca(()=>{const h=this._editor.getContribution(i9.ID);return h&&this._register(h.onClick(u=>this.showCodeActionsFromLightbulb(u.actions,u))),h}),this._resolver=n.createInstance(Xbe),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,Hx.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;Mh.get(this._editor)?.closeMessage();const r=this._editor.getPosition();this._trigger({type:Ah.Invoke,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i,n){try{await this._instantiationService.invokeFunction(Het,e,n,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:Ah.Auto,triggerAction:ag.QuickFix,filter:{}})}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(e.type!==Wv.Type.Triggered){this.hideLightBulbWidget();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===Ah.Invoke){if(e.trigger.filter?.include){const n=this.tryGetValidActionToApply(e.trigger,t);if(n){try{this.hideLightBulbWidget(),await this._applyCodeAction(n,!1,!1,Hx.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const r=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(r&&r.action.disabled){Mh.get(this._editor)?.showMessage(r.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)){Mh.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===od.First&&t.validActions.length===0||e.autoApply===od.IfSingle&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply===od.First&&t.validActions.length>0||e.autoApply===od.IfSingle&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),r=this._editor.getDomNode();if(!r)return;const o=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!o.length)return;const a=re.isIPosition(t)?this.toCoords(t):t,c={onSelect:async(l,d)=>{this._applyCodeAction(l,!0,!!d,i.fromLightbulb?Hx.FromAILightbulb:Hx.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 Jn(u);h=[Cs.RefactorExtract,Cs.RefactorInline,Cs.RefactorRewrite,Cs.RefactorMove,Cs.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:UP.DECORATION})):d.map(f=>({range:f,options:UP.DECORATION}));n.set(u)}else if(h&&h.length>0){const u=h.map(p=>({range:p,options:UP.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;xh(g(5028,"Context: {0} at line {1} and column {2}.",p,f.startLineNumber,f.startColumn))}}}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,NFt(o,this._shouldShowHeaders(),this._resolver.getResolver()),c,a,r,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,_t.Immediate),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=So(this._editor.getDomNode()),n=i.left+t.left,r=i.top+t.top+t.height;return{x:n,y:r}}_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(r=>({id:r.id,label:r.title,tooltip:r.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(r.id,...r.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}},UP=QD,QD.ID="editor.contrib.codeActionController",QD.DECORATION=Kt.register({description:"quickfix-highlight",className:BFt}),QD);GM=UP=D([_(1,Dm),_(2,Le),_(3,we),_(4,nt),_(5,nE),_(6,bi),_(7,Te),_(8,YN),_(9,we)],GM);Ep((s,e)=>{((n,r)=>{r&&e.addRule(`.monaco-editor ${n} { background-color: ${r}; }`)})(".quickfix-edit-highlight",s.getColor(yb));const i=s.getColor(kx);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Fy(s.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var twe;const qet="editor.experimental.dropIntoEditor.defaultProvider",Qet="editor.changeDropType",sNe=new Q("dropWidgetVisible",!1,g(5050,"Whether the drop widget is showing"));var WL;let KM=(WL=class extends V{static get(e){return e.getContribution(twe.ID)}constructor(e,t,i,n,r){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=r,this.treeItemsTransfer=DX.getInstance(),this._dropProgressManager=this._register(t.createInstance(IX,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(TX,"dropIntoEditor",e,sNe,{id:Qet,label:g(5051,"Show drop options...")})),this._register(e.onDropIntoEditor(o=>this.onDropIntoEditor(e,o.position,o.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=Mo(async r=>{const o=new Z,a=o.add(new nI(e,jr.Value,void 0,r));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=o.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,r)}}finally{o.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,r){const o=new Z,a=await $_(Promise.all(e.map(async l=>{try{const d=await l.provideDocumentDropEdits(t,i,n,r.token);return d&&o.add(d),d?.edits.map(h=>({...h,providerId:l.id}))}catch(d){console.error(d)}})),r.token),c=Oi(a??[]).flat();return{edits:Fet(c),dispose:()=>o.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(qet,{resource:e.uri});for(const[n,r]of Object.entries(i)){const o=new Jn(r),a=t.findIndex(c=>o.value===c.providerId&&c.handledMimeType&&Det(n,[c.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new Ice;const t=Ret(e.dataTransfer);if(this.treeItemsTransfer.hasData(bHe.prototype)){const i=this.treeItemsTransfer.getData(bHe.prototype);if(Array.isArray(i))for(const n of i){const r=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(r)for(const[o,a]of r)t.replace(o,a)}}return t}},twe=WL,WL.ID="editor.contrib.dropIntoEditorController",WL);KM=twe=D([_(1,we),_(2,Te),_(3,nt),_(4,ece)],KM);var WFt=".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}";gt(WFt,{});function iwe(s,e){return!!s[e]}class mue{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=iwe(e.event,t.triggerModifier),this.hasSideBySideModifier=iwe(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class UUe{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=iwe(e,t.triggerModifier)}}class RK{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 VUe(s){return s==="altKey"?jt?new RK(S.Meta,"metaKey",S.Alt,"altKey"):new RK(S.Ctrl,"ctrlKey",S.Alt,"altKey"):jt?new RK(S.Alt,"altKey",S.Meta,"metaKey"):new RK(S.Alt,"altKey",S.Ctrl,"ctrlKey")}class Tce 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=VUe(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=VUe(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 mue(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new mue(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new mue(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new UUe(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new UUe(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 HFt=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 LX{constructor(e){this._disposables=new Z;let t=[];for(const[i,n]of e){const r=i.links.map(o=>new HFt(o,n));t=LX._union(t,r),xN(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,r,o,a;for(n=0,o=0,r=e.length,a=t.length;nPromise.resolve(r.provideLinks(e,t)).then(a=>{a&&(i[o]=[a,r])},Nr));return Promise.all(n).then(()=>{const r=new LX(Oi(i));return t.isCancellationRequested?(r.dispose(),new LX([])):r})}vt.registerCommand("_executeLinkProvider",async(s,...e)=>{let[t,i]=e;Lt(t instanceof N),typeof i!="number"&&(i=0);const{linkProvider:n}=s.get(nt),r=s.get(fi).getModel(t);if(!r)return[];const o=await jet(n,r,Ue.None);if(!o)return[];for(let c=0;cthis.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const o=this._register(new Tce(e));this._register(o.onMouseMoveOrRelevantKeyDown(([a,c])=>{this._onEditorMouseMove(a,c)})),this._register(o.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(o.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=Mo(t=>jet(this.providers,e,t));try{const t=new Ys(!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=[],n=Object.keys(this.currentOccurrences);for(const o of n){const a=this.currentOccurrences[o];i.push(a.decorationId)}const r=[];if(e)for(const o of e)r.push(oB.decoration(o,t));this.editor.changeDecorations(o=>{const a=o.deltaDecorations(i,r);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let c=0,l=a.length;c{n.activate(r,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(Ue.None).then(r=>{if(typeof r=="string"&&this.editor.hasModel()){const o=this.editor.getModel().uri;if(o.scheme===pe.file&&r.startsWith(`${pe.file}:`)){const a=N.parse(r);if(a.scheme===pe.file){const c=i_(a);let l=null;c.startsWith("/./")||c.startsWith("\\.\\")?l=`.${c.substr(1)}`:(c.startsWith("//./")||c.startsWith("\\\\.\\"))&&(l=`.${c.substr(2)}`),l&&(r=Ft(o,l))}}}return this.openerService.open(r,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},r=>{const o=r instanceof Error?r.message:r;o==="invalid"?this.notificationService.warn(g(1508,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):o==="missing"?this.notificationService.warn(g(1509,"Failed to open this link because its target is missing.")):bt(r)})}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===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()}},nwe=HL,HL.ID="editor.linkDetector",HL);kW=nwe=D([_(1,Ar),_(2,wi),_(3,nt),_(4,xp)],kW);const zUe={general:Kt.register({description:"detected-link",stickiness:si.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Kt.register({description:"detected-link-active",stickiness:si.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class oB{static decoration(e,t){return{range:e.range,options:oB._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n={...i?zUe.active:zUe.general};return n.hoverMessage=UFt(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,oB._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,oB._getOptions(this.link,t,!1))}}function UFt(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?jt?g(1512,"cmd + click"):g(1513,"ctrl + click"):jt?g(1514,"option + click"):g(1515,"alt + click");if(s.url){let r="";if(/^command:/i.test(s.url.toString())){const a=s.url.toString().match(/^command:([^?#]+)/);if(a){const c=a[1];r=g(1516,"Execute command {0}",c)}}return new Nt("",!0).appendLink(s.url.toString(!0).replace(/ /g,"%20"),i,r).appendMarkdown(` (${n})`)}else return new Nt().appendText(`${i} (${n})`)}class VFt extends it{constructor(){super({id:"editor.action.openLink",label:g(1517,"Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=kW.get(t);if(!i||!t.hasModel())return;const n=t.getSelections();for(const r of n){const o=i.getLinkOccurrence(r.getEndPosition());o&&i.openLinkOccurrence(o,!1)}}}on(kW.ID,kW,ai.AfterFirstRender);Re(VFt);const Lce="editor.contrib.selectionClipboard",Yet="editor.action.showHover",zFt="editor.action.showDefinitionPreviewHover",$Ft="editor.action.scrollUpHover",GFt="editor.action.scrollDownHover",KFt="editor.action.scrollLeftHover",qFt="editor.action.scrollRightHover",QFt="editor.action.pageUpHover",jFt="editor.action.pageDownHover",YFt="editor.action.goToTopHover",JFt="editor.action.goToBottomHover",JU="editor.action.increaseHoverVerbosityLevel",XFt="editor.action.increaseHoverVerbosityLevelFromAccessibleView",ZFt=g(9864,"Increase Hover Verbosity Level"),XU="editor.action.decreaseHoverVerbosityLevel",eOt="editor.action.decreaseHoverVerbosityLevelFromAccessibleView",tOt=g(9865,"Decrease Hover Verbosity Level");var Vl;(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"})(Vl||(Vl={}));var lC;(function(s){s[s.Delayed=0]="Delayed",s[s.Immediate=1]="Immediate"})(lC||(lC={}));var UA;(function(s){s[s.Mouse=0]="Mouse",s[s.Keyboard=1]="Keyboard"})(UA||(UA={}));let iOt=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class Jet 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 ln(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new ln(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new ln(()=>this._triggerLoadingMessage(),0)),this._state=Vl.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(Vl.SecondWait),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=sht(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===Vl.WaitingForAsync||this._state===Vl.WaitingForAsyncShowingLoading)&&this._setState(Vl.Idle)}catch(e){bt(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?Vl.Idle:Vl.WaitingForAsync)}_triggerLoadingMessage(){this._state===Vl.WaitingForAsync&&this._setState(Vl.WaitingForAsyncShowingLoading)}_fireResult(){if(this._state===Vl.FirstWait||this._state===Vl.SecondWait)return;const e=this._state===Vl.Idle,t=this._state===Vl.WaitingForAsyncShowingLoading;this._onResult.fire(new iOt(this._result.slice(0),e,t))}start(e){if(e===lC.Delayed)this._state===Vl.Idle&&(this._setState(Vl.FirstWait),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case Vl.Idle:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case Vl.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(Vl.Idle,!1)}}const nOt=30,sOt=24;class rOt extends V{constructor(e,t=new wn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new qMe),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=wn.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 wn(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?re.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:So(t).top+i.top-nOt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=So(t),r=K_(t.ownerDocument.body),o=n.top+i.top+i.height;return r.height-o-sOt}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),n=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),r=Math.min(Math.max(n,i),e),o=Math.min(e,r);let a;return this._editor.getOption(x.hover).above?a=o<=n?ts.ABOVE:ts.BELOW:a=o<=i?ts.BELOW:ts.ABOVE,a===ts.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 sw;const $Ue=30,oOt=6;var jD;let RX=(jD=class extends rOt{get isVisibleFromKeyboard(){return this._renderedHover?.source===UA.Keyboard}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,n,r){const o=e.getOption(x.lineHeight)+8,a=150,c=new wn(a,o);super(e,c),this._configurationService=i,this._accessibilityService=n,this._keybindingService=r,this._hover=this._register(new jLe),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),oe(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(Ec(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 sw.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,r=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=r}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return sw._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return sw._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,r=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=r}_setHoverWidgetMaxDimensions(e,t){sw._applyMaxDimensions(this._hover.contentsDomNode,e,t),sw._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 wn(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){sw._lastDimensions=new wn(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===ts.ABOVE?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=oOt;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(r=>this._editor.applyFontInfo(r))}_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,sw._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,sw._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?Ir.LeftOfInjectedText:void 0,preference:[this._positionPreference??ts.ABOVE]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=vb(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??ts.ABOVE,this.onContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const r=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&Qje(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._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new wn(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 wn(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 wn(e,this._minimumSize.height)}onContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=vb(e),i=Od(e);if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=vb(e),i=Od(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._renderedHover?.showAtPosition){const n=vb(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})}},sw=jD,jD.ID="editor.contrib.resizableContentHoverWidget",jD._lastDimensions=new wn(0,0),jD);RX=sw=D([_(1,Le),_(2,Te),_(3,_o),_(4,Vt)],RX);function GUe(s,e,t,i,n,r){const o=t+n/2,a=i+r/2,c=Math.max(Math.abs(s-o)-n/2,0),l=Math.max(Math.abs(e-a)-r/2,0);return Math.sqrt(c*c+l*l)}var uu;(function(s){s[s.Range=1]="Range",s[s.ForeignElement=2]="ForeignElement"})(uu||(uu={}));class _ue{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=uu.Range}equals(e){return e.type===uu.Range&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===uu.Range&&t.lineNumber===this.range.startLineNumber}}class wQ{constructor(e,t,i,n,r,o){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=r,this.supportsMarkerHover=o,this.type=uu.ForeignElement}equals(e){return e.type===uu.ForeignElement&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===uu.ForeignElement&&this.owner===e.owner}}class qM{constructor(e){this.renderedHoverParts=e}dispose(){for(const e of this.renderedHoverParts)e.dispose()}}const JN=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class MX{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=UA.Mouse,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==uu.Range&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const r=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(o=>{if(o.options.isWholeLine)return!0;const a=o.range.startLineNumber===n?o.range.startColumn:1,c=o.range.endLineNumber===n?o.range.endColumn:r;if(o.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 Yd.EMPTY;const i=MX._getLineDecorations(this._editor,t);return Yd.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):Yd.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=MX._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Oi(t)}}class Xet{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 aOt(this,this.anchor,t,this.isComplete)}}class aOt extends Xet{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}const KUe=fe;let NX=class extends V{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this.actions=[],this._hasContent=!1,this.hoverElement=KUe("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=oe(this.hoverElement,KUe("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const n=this._register(YLe.render(this.actionsElement,e,i));return this.actions.push(n),n}append(e){const t=oe(this.actionsElement,e);return this._hasContent=!0,t}};NX=D([_(0,Vt)],NX);class cOt{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function lOt(s,e,t,i,n){const r=await Promise.resolve(s.provideHover(t,i,n)).catch(Nr);if(!(!r||!dOt(r)))return new cOt(s,r,e)}function rNe(s,e,t,i,n=!1){const o=s.ordered(e,n).map((a,c)=>lOt(a,c,e,t,i));return Yd.fromPromises(o).coalesce()}function Zet(s,e,t,i,n=!1){return rNe(s,e,t,i,n).map(r=>r.hover).toPromise()}lg("_executeHoverProvider",(s,e,t)=>{const i=s.get(nt);return Zet(i.hoverProvider,e,t,Ue.None)});lg("_executeHoverProvider_recursive",(s,e,t)=>{const i=s.get(nt);return Zet(i.hoverProvider,e,t,Ue.None,!0)});function dOt(s){const e=typeof s.range<"u",t=typeof s.contents<"u"&&s.contents&&s.contents.length>0;return e&&t}const SF=fe,hOt=oi("hover-increase-verbosity",ve.add,g(5160,"Icon for increaseing hover verbosity.")),uOt=oi("hover-decrease-verbosity",ve.remove,g(5161,"Icon for decreasing hover verbosity."));class b_{constructor(e,t,i,n,r,o=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=r,this.source=o}isValidForHoverAnchor(e){return e.type===uu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class ett{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case Nc.Increase:return this.hover.canIncreaseVerbosity??!1;case Nc.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let n9=class{constructor(e,t,i,n,r,o,a,c){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=r,this._keybindingService=o,this._hoverService=a,this._commandService=c,this.hoverOrdinal=3}createLoadingMessage(e){return new b_(this,e.range,[new Nt().appendText(g(5162,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==uu.Range)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,r=i.getLineMaxColumn(n),o=[];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,o.push(new b_(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&&o.push(new b_(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:r,b=p.options.hoverMessage;if(!b||tW(b))continue;p.options.beforeContentClassName&&(f=!0);const w=new F(e.range.startLineNumber,m,e.range.startLineNumber,v);o.push(new b_(this,w,z_(b),f,a++))}return o}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==uu.Range)return Yd.EMPTY;const n=this._editor.getModel(),r=this._languageFeaturesService.hoverProvider;return r.has(n)?this._getMarkdownHovers(r,n,e,i):Yd.EMPTY}_getMarkdownHovers(e,t,i,n){const r=i.range.getStartPosition();return rNe(e,t,r,n).filter(c=>!tW(c.hover.contents)).map(c=>{const l=c.hover.range?F.lift(c.hover.range):i.range,d=new ett(c.hover,c.provider,r);return new b_(this,l,c.hover.contents,!1,c.ordinal,d)})}renderHoverParts(e,t){return this._renderedHoverParts=new gOt(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))}};n9=D([_(1,Di),_(2,Ar),_(3,Te),_(4,nt),_(5,Vt),_(6,tc),_(7,bi)],n9);class MK{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 gOt{constructor(e,t,i,n,r,o,a,c,l,d,h){this._hoverParticipant=i,this._editor=n,this._languageService=r,this._openerService=o,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(Sc(n=>n.ordinal,ru)),e.map(n=>{const r=this._renderHoverPart(n,i);return t.appendChild(r.hoverElement),r})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),n=i.hoverElement,r=e.source,o=new Z;if(o.add(i),!r)return new MK(e,n,o);const a=r.supportsVerbosityAction(Nc.Increase),c=r.supportsVerbosityAction(Nc.Decrease);if(!a&&!c)return new MK(e,n,o);const l=SF("div.verbosity-actions");return n.prepend(l),o.add(this._renderHoverExpansionAction(l,Nc.Increase,a)),o.add(this._renderHoverExpansionAction(l,Nc.Decrease,c)),new MK(e,n,o)}_renderMarkdownHover(e,t){return ttt(this._editor,e,this._languageService,this._openerService,t)}_renderHoverExpansionAction(e,t,i){const n=new Z,r=t===Nc.Increase,o=oe(e,SF(He.asCSSSelector(r?hOt:uOt)));o.tabIndex=0;const a=new RM("mouse",!1,{target:e,position:{hoverPosition:vr.LEFT}},this._configurationService,this._hoverService);if(n.add(this._hoverService.setupManagedHover(a,o,itt(this._keybindingService,t))),!i)return o.classList.add("disabled"),n;o.classList.add("enabled");const c=()=>this._commandService.executeCommand(t===Nc.Increase?JU:XU);return n.add(new jje(o,c)),n.add(new Yje(o,c,[S.Enter,S.Space])),n}async updateMarkdownHoverPartVerbosityLevel(e,t,i=!0){const n=this._editor.getModel();if(!n)return;const r=this._getRenderedHoverPartAtIndex(t),o=r?.hoverPart.source;if(!r||!o?.supportsVerbosityAction(e))return;const a=await this._fetchHover(o,n,e);if(!a)return;const c=new ett(a,o.hoverProvider,o.hoverPosition),l=r.hoverPart,d=new b_(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(o=>o.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===Nc.Increase?1:-1;const r=e.hoverProvider,o=this._ongoingHoverOperations.get(r);o&&(o.tokenSource.cancel(),n+=o.verbosityDelta);const a=new li;this._ongoingHoverOperations.set(r,{verbosityDelta:n,tokenSource:a});const c={verbosityRequest:{verbosityDelta:n,previousHover:e.hover}};let l;try{l=await Promise.resolve(r.provideHover(t,e.hoverPosition,a.token,c))}catch(d){Nr(d)}return a.dispose(),this._ongoingHoverOperations.delete(r),l}_replaceRenderedHoverPartAtIndex(e,t,i){if(e>=this.renderedHoverParts.length||e<0)return;const n=this.renderedHoverParts[e],r=n.hoverElement,o=t.hoverElement,a=Array.from(o.children);r.replaceChildren(...a);const c=new MK(i,r,t.disposables);r.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 fOt(s,e,t,i,n){e.sort(Sc(o=>o.ordinal,ru));const r=[];for(const o of e)r.push(ttt(t,o,i,n,s.onContentsChanged));return new qM(r)}function ttt(s,e,t,i,n){const r=new Z,o=SF("div.hover-row"),a=SF("div.hover-row-contents");o.appendChild(a);const c=e.contents;for(const d of c){if(tW(d))continue;const h=SF("div.markdown-hover"),u=oe(h,SF("div.hover-contents")),f=r.add(new Z_({editor:s},t,i));r.add(f.onDidRenderAsync(()=>{u.className="hover-contents code-hover-contents",n()}));const p=r.add(f.render(d));u.appendChild(p.element),a.appendChild(h)}return{hoverPart:e,hoverElement:o,dispose(){r.dispose()}}}function itt(s,e){switch(e){case Nc.Increase:{const t=s.lookupKeybinding(JU);return t?g(5165,"Increase Hover Verbosity ({0})",t.getLabel()):g(5166,"Increase Hover Verbosity")}case Nc.Decrease:{const t=s.lookupKeybinding(XU);return t?g(5167,"Decrease Hover Verbosity ({0})",t.getLabel()):g(5168,"Decrease Hover Verbosity")}}}const ntt=[];function aG(s){ntt.push(s)}function pOt(){return ntt.slice(0)}class oNe{constructor(e,t){this._editorWorkerClient=new YTe(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,r=t.color,o=r.alpha,a=new me(new hn(Math.round(255*r.red),Math.round(255*r.green),Math.round(255*r.blue),o)),c=o?me.Format.CSS.formatRGB(a):me.Format.CSS.formatRGBA(a),l=o?me.Format.CSS.formatHSL(a):me.Format.CSS.formatHSLA(a),d=o?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 swe=class extends V{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new oNe(e,t)))}};swe=D([_(0,fi),_(1,zs),_(2,nt)],swe);aG(swe);async function stt(s,e,t,i=!0){return aNe(new mOt,s,e,t,i)}function rtt(s,e,t,i){return Promise.resolve(t.provideColorPresentations(s,e,i))}class mOt{constructor(){}async compute(e,t,i,n){const r=await e.provideDocumentColors(t,i);if(Array.isArray(r))for(const o of r)n.push({colorInfo:o,provider:e});return Array.isArray(r)}}class _Ot{constructor(){}async compute(e,t,i,n){const r=await e.provideDocumentColors(t,i);if(Array.isArray(r))for(const o of r)n.push({range:o.range,color:[o.color.red,o.color.green,o.color.blue,o.color.alpha]});return Array.isArray(r)}}class vOt{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const r=await e.provideColorPresentations(t,this.colorInfo,Ue.None);return Array.isArray(r)&&n.push(...r),Array.isArray(r)}}async function aNe(s,e,t,i,n){let r=!1,o;const a=[],c=e.ordered(t);for(let l=c.length-1;l>=0;l--){const d=c[l];if(d instanceof oNe)o=d;else try{await s.compute(d,t,i,a)&&(r=!0)}catch(h){Nr(h)}}return r?a:o&&n?(await s.compute(o,t,i,a),a):[]}function ott(s,e){const{colorProvider:t}=s.get(nt),i=s.get(fi).getModel(e);if(!i)throw Fi();const n=s.get(Te).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}vt.registerCommand("_executeDocumentColorProvider",function(s,...e){const[t]=e;if(!(t instanceof N))throw Fi();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:r}=ott(s,t);return aNe(new _Ot,n,i,Ue.None,r)});vt.registerCommand("_executeColorPresentationProvider",function(s,...e){const[t,i]=e,{uri:n,range:r}=i;if(!(n instanceof N)||!Array.isArray(t)||t.length!==4||!F.isIRange(r))throw Fi();const{model:o,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:c}=ott(s,n),[l,d,h,u]=t;return aNe(new vOt({range:r,color:{red:l,green:d,blue:h,alpha:u}}),a,o,Ue.None,c)});var rwe;const att=Object.create({});var YD;let QM=(YD=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 wY(this._editor),this._decoratorLimitReporter=new bOt,this._colorDecorationClassRefs=this._register(new Z),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:rwe.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(r=>{const o=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(x.defaultColorDecorators);const a=o!==this._isColorDecoratorsEnabled||r.hasChanged(x.colorDecoratorsLimit),c=r.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 Em,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Mo(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new Ys(!1),n=await stt(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){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((n,r)=>this._colorDatas.set(n,e[r]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(x.colorDecoratorsLimit);for(let r=0;rthis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},rwe=YD,YD.ID="editor.contrib.colorDetector",YD.RECOMPUTE_TIME=1e3,YD);QM=rwe=D([_(1,Te),_(2,nt),_(3,xp)],QM);class bOt{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(QM.ID,QM,ai.AfterFirstRender);class wOt{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=o.getColor(_Y)||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 SOt(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 SOt 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"),oe(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),oe(this._button,t),oe(t,np(".button"+He.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 AOt extends V{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=np(".colorpicker-body"),oe(e,this._domNode),this._saturationBox=new EOt(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 xOt(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 DOt(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 kOt(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 vy(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new me(new vy(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 vy(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 EOt 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=np(".saturation-wrap"),oe(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",oe(this._domNode,this._canvas),this.selection=np(".saturation-selection"),oe(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 LU);const t=So(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 vy(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 r=i.createLinearGradient(0,0,0,this._canvas.height);r.addColorStop(0,"rgba(0, 0, 0, 0)"),r.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=r,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 ctt 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=oe(e,np(".standalone-strip")),this.overlay=oe(this.domNode,np(".standalone-overlay"))):(this.domNode=oe(e,np(".strip")),this.overlay=oe(this.domNode,np(".overlay"))),this.slider=oe(this.domNode,np(".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 LU),i=So(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangeTop(r.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 xOt extends ctt{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,r=new me(new hn(t,i,n,1)),o=new me(new hn(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${r} 0%, ${o} 100%)`}getValue(e){return e.hsva.a}}class DOt extends ctt{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class kOt extends V{constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=oe(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 Zse=class Zse extends _d{constructor(e,t,i,n,r=!1){super(),this.model=t,this.pixelRatio=i,this._register(W8.getInstance(lt(e)).onDidChange(()=>this.layout())),this._domNode=np(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new COt(this._domNode,this.model,n,r)),this.body=this._register(new AOt(this._domNode,this.model,this.pixelRatio,r))}getId(){return Zse.ID}layout(){this.body.layout()}get domNode(){return this._domNode}};Zse.ID="editor.contrib.colorPickerWidget";let owe=Zse;class IOt{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===uu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let s9=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Yd.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=QM.get(this._editor);if(!n)return[];for(const r of t){if(!n.isColorDecoration(r))continue;const o=n.getColorData(r.range.getStartPosition());if(o)return[await ltt(this,this._editor.getModel(),o.colorInfo,o.provider)]}return[]}renderHoverParts(e,t){const i=dtt(this,this._editor,this._themeService,t,e);if(!i)return new qM([]);this._colorPicker=i.colorPicker;const n={hoverPart:i.hoverPart,hoverElement:this._colorPicker.domNode,dispose(){i.disposables.dispose()}};return new qM([n])}getAccessibleContent(e){return g(5040,"There is a color picker here.")}handleResize(){this._colorPicker?.layout()}isColorPickerVisible(){return!!this._colorPicker}};s9=D([_(1,mn)],s9);class TOt{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let r9=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()||!QM.get(this._editor))return null;const r=await stt(i,this._editor.getModel(),Ue.None);let o=null,a=null;for(const h of r){const u=h.colorInfo;F.containsRange(u.range,e.range)&&(o=u,a=h.provider)}const c=o??e,l=a??t,d=!!o;return{colorHover:await ltt(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 yQ(this._editor.getModel(),t,this._color,i,e),i=htt(this._editor,i,t))}renderHoverParts(e,t){return dtt(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};r9=D([_(1,mn)],r9);async function ltt(s,e,t,i){const n=e.getValueInRange(t.range),{red:r,green:o,blue:a,alpha:c}=t.color,l=new hn(Math.round(r*255),Math.round(o*255),Math.round(a*255),c),d=new me(l),h=await rtt(e,t,i,Ue.None),u=new wOt(d,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(d,n),s instanceof s9?new IOt(s,F.lift(t.range),u,i):new TOt(s,F.lift(t.range),u,i)}function dtt(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 wn(302,u))}const r=new Z,o=i[0],a=e.getModel(),c=o.model,l=r.add(new owe(n.fragment,c,e.getOption(x.pixelRatio),t,s instanceof r9));let d=!1,h=new F(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn);if(s instanceof r9){const u=o.model.color;s.color=u,yQ(a,c,u,h,o),r.add(c.onColorFlushed(f=>{s.color=f}))}else r.add(c.onColorFlushed(async u=>{await yQ(a,c,u,h,o),d=!0,h=htt(e,h,c)}));return r.add(c.onDidChangeColor(u=>{yQ(a,c,u,h,o)})),r.add(e.onDidChangeModelContent(u=>{d?d=!1:(n.hide(),e.focus())})),{hoverPart:o,colorPicker:l,disposables:r}}function htt(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 r=F.lift(n.range),o=s.getModel()._setTrackedRange(null,r,si.GrowsOnlyWhenTypingAfter);return s.executeEdits("colorpicker",i),s.pushUndoStop(),s.getModel()._getTrackedRange(o)??r}async function yQ(s,e,t,i,n){const r=await rtt(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,Ue.None);e.colorPresentations=r||[]}class utt{constructor(e,t){this.range=e,this.direction=t}}class cNe{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new cNe(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){Nr(t),this._isResolved=!1}}}const oO=class oO{static async create(e,t,i,n){const r=[],o=e.ordered(t).reverse().map(a=>i.map(async c=>{try{const l=await a.provideInlayHints(t,c,n);(l?.hints.length||a.onDidChangeInlayHints)&&r.push([l??oO._emptyInlayHintList,a])}catch(l){Nr(l)}}));if(await Promise.all(o.flat()),n.isCancellationRequested||t.isDisposed())throw new Na;return new oO(i,r,t)}constructor(e,t,i){this._disposables=new Z,this.ranges=e,this.provider=new Set;const n=[];for(const[r,o]of t){this._disposables.add(r),this.provider.add(o);for(const a of r.hints){const c=i.validatePosition(a.position);let l="before";const d=oO._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 cNe(a,new utt(h,l),o))}}this.items=n.sort((r,o)=>re.compare(r.hint.position,o.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 r=e.tokenization.getLineTokens(i),o=t.column-1,a=r.findTokenIndexAtOffset(o);let c=r.getStartOffset(a),l=r.getEndOffset(a);return l-c===1&&(c===o&&a>1?(c=r.getStartOffset(a-1),l=r.getEndOffset(a-1)):l===o&&a{if(this._ignoreEditorChange)return;const o=this._editorService.getActiveCodeEditor();if(!o)return;const a=o.getModel(),c=o.getPosition();if(!a||!c)return;let l=!1,d=!1;for(const h of t.references)if(Yi(h.uri,a.uri))l=!0,d=d||F.containsPosition(h.range,c);else if(l)break;(!l||!d)&&this.reset()});this._currentState=Yo(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:dA.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)}};awe=D([_(0,Le),_(1,qt),_(2,wi),_(3,Vt)],awe);ce(Rce,awe,Qt.Delayed);Qe(new class extends uc{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:lNe,kbOpts:{weight:Ae.EditorContrib,primary:S.F12}})}runEditorCommand(s,e){return s.get(Rce).revealNext(e)}});Sr.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:Ae.EditorContrib,when:lNe,primary:S.Escape,handler(s){s.get(Rce).reset()}});let cwe=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(),wt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Yo(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)}};cwe=D([_(0,qt)],cwe);function lwe(s,e){return e.uri.scheme===s.uri.scheme?!0:!R8(e.uri,pe.walkThroughSnippet,pe.vscodeChatCodeBlock,pe.vscodeChatCodeCompareBlock,pe.vscodeCopilotBackingChatCodeBlock)}async function cG(s,e,t,i,n){const o=t.ordered(s,i).map(c=>Promise.resolve(n(c,s,e)).then(void 0,l=>{Nr(l)})),a=await Promise.all(o);return Oi(a.flat()).filter(c=>lwe(s,c))}function lG(s,e,t,i,n){return cG(e,t,s,i,(r,o,a)=>r.provideDefinition(o,a,n))}function dNe(s,e,t,i,n){return cG(e,t,s,i,(r,o,a)=>r.provideDeclaration(o,a,n))}function hNe(s,e,t,i,n){return cG(e,t,s,i,(r,o,a)=>r.provideImplementation(o,a,n))}function uNe(s,e,t,i,n){return cG(e,t,s,i,(r,o,a)=>r.provideTypeDefinition(o,a,n))}function dG(s,e,t,i,n,r){return cG(e,t,s,n,async(o,a,c)=>{const l=(await o.provideReferences(a,c,{includeDeclaration:!0},r))?.filter(h=>lwe(a,h));if(!i||!l||l.length!==2)return l;const d=(await o.provideReferences(a,c,{includeDeclaration:!1},r))?.filter(h=>lwe(a,h));return d&&d.length===1?d:l})}async function wC(s){const e=await s(),t=new cf(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}lg("_executeDefinitionProvider",(s,e,t)=>{const i=s.get(nt),n=lG(i.definitionProvider,e,t,!1,Ue.None);return wC(()=>n)});lg("_executeDefinitionProvider_recursive",(s,e,t)=>{const i=s.get(nt),n=lG(i.definitionProvider,e,t,!0,Ue.None);return wC(()=>n)});lg("_executeTypeDefinitionProvider",(s,e,t)=>{const i=s.get(nt),n=uNe(i.typeDefinitionProvider,e,t,!1,Ue.None);return wC(()=>n)});lg("_executeTypeDefinitionProvider_recursive",(s,e,t)=>{const i=s.get(nt),n=uNe(i.typeDefinitionProvider,e,t,!0,Ue.None);return wC(()=>n)});lg("_executeDeclarationProvider",(s,e,t)=>{const i=s.get(nt),n=dNe(i.declarationProvider,e,t,!1,Ue.None);return wC(()=>n)});lg("_executeDeclarationProvider_recursive",(s,e,t)=>{const i=s.get(nt),n=dNe(i.declarationProvider,e,t,!0,Ue.None);return wC(()=>n)});lg("_executeReferenceProvider",(s,e,t)=>{const i=s.get(nt),n=dG(i.referenceProvider,e,t,!1,!1,Ue.None);return wC(()=>n)});lg("_executeReferenceProvider_recursive",(s,e,t)=>{const i=s.get(nt),n=dG(i.referenceProvider,e,t,!1,!0,Ue.None);return wC(()=>n)});lg("_executeImplementationProvider",(s,e,t)=>{const i=s.get(nt),n=hNe(i.implementationProvider,e,t,!1,Ue.None);return wC(()=>n)});lg("_executeImplementationProvider_recursive",(s,e,t)=>{const i=s.get(nt),n=hNe(i.implementationProvider,e,t,!0,Ue.None);return wC(()=>n)});Yn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextPeek,title:g(1409,"Peek"),group:"navigation",order:100});class IW{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof IW||re.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const t_=class t_ extends mf{static all(){return t_._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of ui.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(t_._patchConfig(t)),this.configuration=e,t_._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const r=e.get(wi),o=e.get(qt),a=e.get(nE),c=e.get(Rce),l=e.get(nt),d=e.get(we),h=t.getModel(),u=t.getPosition(),f=IW.is(i)?i:new IW(h,u),p=new nI(t,jr.Value|jr.Position),m=$_(this._getLocationModel(l,f.model,f.position,p.token),p.token).then(async v=>{if(!v||p.token.isCancellationRequested)return;No(v.ariaMessage);let b;if(v.referenceAt(h.uri,u)){const y=this._getAlternativeCommand(t);!t_._activeAlternativeCommands.has(y)&&t_._allSymbolNavigationCommands.has(y)&&(b=t_._allSymbolNavigationCommands.get(y))}const w=v.references.length;if(w===0){if(!this.configuration.muteMessage){const y=h.getWordAtPosition(u);Mh.get(t)?.showMessage(this._getNoResultFoundMessage(y),u)}}else if(w===1&&b)t_._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(y=>b.runEditorCommand(y,t,i,n).finally(()=>{t_._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(o,c,t,v,n)},v=>{r.error(v)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,r){const o=this._getGoToPreference(i);if(!(i instanceof uf)&&(this.configuration.openInPeek||o==="peek"&&n.references.length>1))this._openInPeek(i,n,r);else{const a=n.firstReference(),c=n.references.length>1&&o==="gotoAndPeek",l=await this._openReference(i,e,a,this.configuration.openToSide,!c);c&&l?this._openInPeek(l,n,r):n.dispose(),o==="goto"&&t.put(a)}}async _openReference(e,t,i,n,r){let o;if(BKe(i)&&(o=i.targetSelectionRange),o||(o=i.range),!o)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:F.collapseToStart(o),selectionRevealType:dA.NearTopIfOutsideViewport,selectionSource:Lb.JUMP}},e,n);if(a){if(r){const c=a.getModel(),l=a.createDecorationsCollection([{range:o,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===c&&l.clear()},350)}return a}}_openInPeek(e,t,i){const n=HM.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Mo(r=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};t_._allSymbolNavigationCommands=new Map,t_._activeAlternativeCommands=new Set;let VA=t_;class hG extends VA{async _getLocationModel(e,t,i,n){return new cf(await lG(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 JD;Et((JD=class extends hG{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:JD.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}]}),vt.registerCommandAlias("editor.action.goToDeclaration",JD.id)}},JD.id="editor.action.revealDefinition",JD));var XD;Et((XD=class extends hG{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:XD.id,title:Pe(1415,"Open Definition to the Side"),precondition:he.and(J.hasDefinitionProvider,J.isInEmbeddedEditor.toNegated()),keybinding:[{when:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,S.F12),weight:Ae.EditorContrib},{when:he.and(J.editorTextFocus,IRe),primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.F12),weight:Ae.EditorContrib}]}),vt.registerCommandAlias("editor.action.openDeclarationToTheSide",XD.id)}},XD.id="editor.action.revealDefinitionAside",XD));var ZD;Et((ZD=class extends hG{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:ZD.id,title:Pe(1416,"Peek Definition"),precondition:he.and(J.hasDefinitionProvider,og.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}}),vt.registerCommandAlias("editor.action.previewDeclaration",ZD.id)}},ZD.id="editor.action.peekDefinition",ZD));class ftt extends VA{async _getLocationModel(e,t,i,n){return new cf(await dNe(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 UL;Et((UL=class extends ftt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:UL.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")}},UL.id="editor.action.revealDeclaration",UL));Et(class extends ftt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Pe(1422,"Peek Declaration"),precondition:he.and(J.hasDeclarationProvider,og.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:3}})}});class ptt extends VA{async _getLocationModel(e,t,i,n){return new cf(await uNe(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 VL;Et((VL=class extends ptt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:VL.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}]})}},VL.ID="editor.action.goToTypeDefinition",VL));var zL;Et((zL=class extends ptt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:zL.ID,title:Pe(1428,"Peek Type Definition"),precondition:he.and(J.hasTypeDefinitionProvider,og.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:4}})}},zL.ID="editor.action.peekTypeDefinition",zL));class mtt extends VA{async _getLocationModel(e,t,i,n){return new cf(await hNe(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 $L;Et(($L=class extends mtt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:$L.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}]})}},$L.ID="editor.action.goToImplementation",$L));var GL;Et((GL=class extends mtt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:GL.ID,title:Pe(1434,"Peek Implementations"),precondition:he.and(J.hasImplementationProvider,og.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}})}},GL.ID="editor.action.peekImplementation",GL));class _tt extends VA{_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}}Et(class extends _tt{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,og.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 cf(await dG(e.referenceProvider,t,i,!0,!1,n),g(1439,"References"))}});Et(class extends _tt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Pe(1440,"Peek References"),precondition:he.and(J.hasReferenceProvider,og.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new cf(await dG(e.referenceProvider,t,i,!1,!1,n),g(1439,"References"))}});class LOt extends VA{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:Pe(1441,"Go to Any Symbol"),precondition:he.and(og.notInPeekEditor,J.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new cf(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""}}vt.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:re.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,r,o)=>{Lt(N.isUri(e)),Lt(re.isIPosition(t)),Lt(Array.isArray(i)),Lt(typeof n>"u"||typeof n=="string"),Lt(typeof o>"u"||typeof o=="boolean");const a=s.get(qt),c=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(jo(c))return c.setPosition(t),c.revealPositionInCenterIfOutsideViewport(t,_t.Smooth),c.invokeWithinContext(l=>{const d=new class extends LOt{_getNoResultFoundMessage(h){return r||super._getNoResultFoundMessage(h)}}({muteMessage:!r,openInPeek:!!o,openToSide:!1},i,n);l.get(we).invokeFunction(d.run.bind(d),c)})}});vt.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:re.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(bi).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});vt.registerCommand({id:"editor.action.findReferences",handler:(s,e,t)=>{Lt(N.isUri(e)),Lt(re.isIPosition(t));const i=s.get(nt),n=s.get(qt);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(r=>{if(!jo(r)||!r.hasModel())return;const o=HM.get(r);if(!o)return;const a=Mo(l=>dG(i.referenceProvider,r.getModel(),re.lift(t),!1,!1,l).then(d=>new cf(d,g(1439,"References")))),c=new F(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(o.toggleWidget(c,a,!1))})}});vt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function ROt(s,e,t,i){const n=s.get(pn),r=s.get(lo),o=s.get(bi),a=s.get(we),c=s.get(wi);if(await i.item.resolve(Ue.None),!i.part.location)return;const l=i.part.location,d=[],h=new Set(Yn.getMenuItems(_e.EditorContext).map(f=>ET(f)?f.command.id:ao()));for(const f of VA.all())h.has(f.desc.id)&&d.push(new an(f.desc.id,Ac.label(f.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await n.createModelReference(l.uri);try{const m=new IW(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 Eo),d.push(new an(f.id,f.title,void 0,!0,async()=>{try{await o.executeCommand(f.id,...f.arguments??[])}catch(p){c.notify({severity:Ze.Error,source:i.item.provider.displayName,message:p})}}))}const u=e.getOption(x.useShadowDOM);r.showContextMenu({domForShadowRoot:u?e.getDomNode()??void 0:void 0,getAnchor:()=>{const f=So(t);return{x:f.left,y:f.top+f.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function vtt(s,e,t,i){const r=await s.get(pn).createModelReference(i.uri);await t.invokeWithinContext(async o=>{const a=e.hasSideBySideModifier,c=o.get(Le),l=og.inPeekEditor.getValue(c),d=!a&&t.getOption(x.definitionLinkOpensInPeek)&&!l;return new hG({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(o,new IW(r.object.textEditorModel,F.getStartPosition(i.range)),F.lift(i.range))}),r.dispose()}var VP;class FX{constructor(){this._entries=new pm(50)}get(e){const t=FX._key(e);return this._entries.get(t)}set(e,t){const i=FX._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const btt=ae("IInlayHintsCache");ce(btt,FX,Qt.Delayed);class dwe{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 MOt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}var PC;(function(s){s[s.Normal=0]="Normal",s[s.Invisible=1]="Invisible"})(PC||(PC={}));var $S;let TW=($S=class{static get(e){return e.getContribution(VP.ID)??void 0}constructor(e,t,i,n,r,o,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=r,this._notificationService=o,this._instaService=a,this._disposables=new Z,this._sessionDisposables=new Z,this._decorationsMetadata=new Map,this._ruleFactory=new wY(this._editor),this._activeRenderMode=PC.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=PC.Normal;else{let a,c;e.enabled==="onUnlessPressed"?(a=PC.Normal,c=PC.Invisible):(a=PC.Invisible,c=PC.Normal),this._activeRenderMode=a,this._sessionDisposables.add(bb.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),o.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 r=new Set,o=new ln(async()=>{const a=Date.now();n?.dispose(!0),n=new li;const c=t.onWillDispose(()=>n?.cancel());try{const l=n.token,d=await PX.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),l);if(o.delay=this._debounceInfo.update(t,Date.now()-a),l.isCancellationRequested){d.dispose();return}for(const h of d.provider)typeof h.onDidChangeInlayHints=="function"&&!r.has(h)&&(r.add(h),this._sessionDisposables.add(h.onDidChangeInlayHints(()=>{o.isScheduled()||o.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(l){bt(l)}finally{n.dispose(),c.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(o),this._sessionDisposables.add(Ee(()=>n?.dispose(!0))),o.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!o.isScheduled())&&o.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{n?.cancel();const c=Math.max(o.delay,1250);o.schedule(c)})),this._sessionDisposables.add(this._installDblClickGesture(()=>o.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Z,t=e.add(new Tce(this._editor)),i=new Z;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(n=>{const[r]=n,o=this._getInlayHintLabelPart(r),a=this._editor.getModel();if(!o||!a){i.clear();return}const c=new li;i.add(Ee(()=>c.dispose(!0))),o.item.resolve(c.token),this._activeInlayHintPart=o.part.command||o.part.location?new MOt(o,r.hasTriggerModifier):void 0;const l=a.validatePosition(o.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 r=this._getInlayHintLabelPart(n);if(r){const o=r.part;o.location?this._instaService.invokeFunction(vtt,n,this._editor,o.location):jj.is(o.command)&&await this._invokeCommand(o.command,r.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(Ue.None),tr(i.item.hint.textEdits))){const n=i.item.hint.textEdits.map(r=>es.replace(F.lift(r.range),r.text));this._editor.executeEdits("inlayHint.default",n),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!Jo(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(ROt,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 Gk&&t?.attachedData instanceof dwe)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:Ze.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 r=e.getDecorationRange(i);if(r){const o=new utt(r,n.item.anchor.direction),a=n.item.with({anchor:o});t.set(n.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),n=[];for(const r of i.sort(F.compareRangesUsingStarts)){const o=t.validateRange(new F(r.startLineNumber-30,r.startColumn,r.endLineNumber+30,r.endColumn));n.length===0||!F.areIntersectingOrTouching(n[n.length-1],o)?n.push(o):n[n.length-1]=F.plusRange(n[n.length-1],o)}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:si.AlwaysGrowsWhenTypingAtEdges,[p.anchor.direction]:this._activeRenderMode===PC.Normal?y:void 0}}})},r=(p,m)=>{const v=this._ruleFactory.createClassNameRef({width:`${o/3|0}px`,display:"inline-block"});n(p,v," ",m?S_.Right:S_.None)},{fontSize:o,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>VP._MAX_LABEL_LEN)continue;p.hint.paddingLeft&&r(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),NOt(A),y&&!p.hint.paddingRight?S_.Right:S_.None,new dwe(p,v)),L)break}if(p.hint.paddingRight&&r(p,!0),i.length>VP._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=ym.capture(this._editor);this._editor.changeDecorations(p=>{const m=p.deltaDecorations(u,i.map(v=>v.decoration));for(let v=0;vi)&&(r=i);const o=e.fontFamily||n;return{fontSize:r,fontFamily:o,padding:t,isUniform:!t&&o===n&&r===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 r=this._decorationsMetadata.get(n.id);r&&!t.has(r.item.hint)&&(t.add(r.item.hint),i.push(r.item))}return i}},VP=$S,$S.ID="editor.contrib.InlayHints",$S._MAX_DECORATORS=1500,$S._MAX_LABEL_LEN=43,$S);TW=VP=D([_(1,nt),_(2,xp),_(3,btt),_(4,bi),_(5,wi),_(6,we)],TW);function NOt(s){return s.replace(/[ \t]/g," ")}vt.registerCommand("_executeInlayHintProvider",async(s,...e)=>{const[t,i]=e;Lt(N.isUri(t)),Lt(F.isIRange(i));const{inlayHintsProvider:n}=s.get(nt),r=await s.get(pn).createModelReference(t);try{const o=await PX.create(n,r.object.textEditorModel,[F.lift(i)],Ue.None),a=o.items.map(c=>c.hint);return setTimeout(()=>o.dispose(),0),a}finally{r.dispose()}});class qUe extends wQ{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let OX=class extends n9{constructor(e,t,i,n,r,o,a,c,l){super(e,t,i,o,c,n,r,l),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!TW.get(this._editor)||e.target.type!==Mt.CONTENT_TEXT)return null;const i=e.target.detail.injectedText?.options;return i instanceof Gk&&i.attachedData instanceof dwe?new qUe(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof qUe?new Yd(async n=>{const{part:r}=e;if(await r.item.resolve(i),i.isCancellationRequested)return;let o;typeof r.item.hint.tooltip=="string"?o=new Nt().appendText(r.item.hint.tooltip):r.item.hint.tooltip&&(o=r.item.hint.tooltip),o&&n.emitOne(new b_(this,e.range,[o],!1,0)),tr(r.item.hint.textEdits)&&n.emitOne(new b_(this,e.range,[new Nt().appendText(g(5175,"Double-click to insert"))],!1,10001));let a;if(typeof r.part.tooltip=="string"?a=new Nt().appendText(r.part.tooltip):r.part.tooltip&&(a=r.part.tooltip),a&&n.emitOne(new b_(this,e.range,[a],!1,1)),r.part.location||r.part.command){let l;const h=this._editor.getOption(x.multiCursorModifier)==="altKey"?jt?g(5176,"cmd + click"):g(5177,"ctrl + click"):jt?g(5178,"option + click"):g(5179,"alt + click");r.part.location&&r.part.command?l=new Nt().appendText(g(5180,"Go to Definition ({0}), right click for more",h)):r.part.location?l=new Nt().appendText(g(5181,"Go to Definition ({0})",h)):r.part.command&&(l=new Nt(`[${g(5182,"Execute Command")}](${gtt(r.part.command)} "${r.part.command.title}") (${h})`,{isTrusted:!0})),l&&n.emitOne(new b_(this,e.range,[l],!1,1e4))}const c=await this._resolveInlayHintLabelPartHover(r,i);for await(const l of c)n.emitOne(l)}):Yd.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return Yd.EMPTY;const{uri:i,range:n}=e.part.location,r=await this._resolverService.createModelReference(i);try{const o=r.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(o)?rNe(this._languageFeaturesService.hoverProvider,o,new re(n.startLineNumber,n.startColumn),t).filter(a=>!tW(a.hover.contents)).map(a=>new b_(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Yd.EMPTY}finally{r.dispose()}}};OX=D([_(1,Di),_(2,Ar),_(3,Vt),_(4,tc),_(5,Te),_(6,pn),_(7,nt),_(8,bi)],OX);class gNe extends V{constructor(e,t,i,n,r,o){super();const a=t.anchor,c=t.hoverParts;this._renderedHoverParts=this._register(new hwe(e,i,c,o,r));const{showAtPosition:l,showAtSecondaryPosition:d}=gNe.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 re(u.startLineNumber,f);n=h.convertViewPositionToModelPosition(p).column}const r=t.startLineNumber;let o=t.startColumn,a;for(const d of i){const h=d.range,u=h.startLineNumber===r,f=h.endLineNumber===r;if(u&&f){const m=h.startColumn,v=Math.min(o,m);o=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 re(r,o);return{showAtPosition:c,showAtSecondaryPosition:l}}}class POt{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 ere=class ere extends V{constructor(e,t,i,n,r){super(),this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=r,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,r,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 r of t){const o=r.range;i=F.plusRange(i,o)}const n=e.createDecorationsCollection();return n.set([{range:i,options:ere._DECORATION_OPTIONS}]),Ee(()=>{n.clear()})}_renderParts(e,t,i,n){const r=new NX(n),o={fragment:this._fragment,statusBar:r,...i},a=new Z;for(const l of e){const d=this._renderHoverPartsForParticipant(t,l,o);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,r);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(o=>o.owner===t);return n.length>0?t.renderHoverParts(i,n):new qM([])}_renderStatusBar(e,t){if(t.hasContent)return new POt(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,r=>{r.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(ue(n,ke.FOCUS_OUT,r=>{r.stopPropagation(),this._focusedHoverPartIndex=-1}))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(i=>i instanceof n9&&!(i instanceof OX));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(i=>i instanceof s9)}focusHoverPartWithIndex(e){e<0||e>=this._renderedParts.length||this._renderedParts[e].hoverElement.focus()}getAccessibleContent(){const e=[];for(let t=0;t1&&this.show(m??u,t,c)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(Qbe,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};TX=D([_(4,we),_(5,UN),_(6,wi)],TX);var p0;const Oet="editor.changePasteType",ZMe=new Q("pasteWidgetVisible",!1,g(4993,"Whether the paste widget is showing")),pue="application/vnd.code.copyMetadata";var OL;let cC=(OL=class extends V{static get(e){return e.getContribution(p0.ID)}constructor(e,t,i,n,r,o,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=r,this._quickInputService=o,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 IX("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(TX,"pasteIntoEditor",e,ZMe,{id:Oet,label:g(4994,"Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},Vu().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()||(Hn&&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 r=i;const o=i.length===1&&i[0].isEmpty();if(o){if(!n)return;r=[new F(r[0].startLineNumber,1,r[0].startLineNumber,1+t.getLineLength(r[0].startLineNumber))]}const a=this._editor._getViewModel()?.getPlainTextToCopy(i,n,jn),l={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:o,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(m=>!!m.prepareDocumentPaste);if(!d.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:l});return}const h=Let(e.clipboardData),u=d.flatMap(m=>m.copyMimeTypes??[]),f=ao();this.setCopyMetadata(e.clipboardData,{id:f,providerCopyMimeTypes:u,defaultPastePayload:l});const p=Mo(async m=>{const v=Oi(await Promise.all(d.map(async b=>{try{return await b.prepareDocumentPaste(t,r,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});p0._currentCopyOperation?.dataTransferPromise.cancel(),p0._currentCopyOperation={handle:f,dataTransferPromise:p}}async handlePaste(e){if(!e.clipboardData||!this._editor.hasTextFocus())return;Mh.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),r=Ret(e.clipboardData);r.delete(pue);const o=[...e.clipboardData.types,...n?.providerCopyMimeTypes??[],Vs.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=>Det(d,o))});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,r,n):this.doPasteInline(a,i,r,n,e)}showPasteAsNoEditMessage(e,t){Mh.get(this._editor)?.showMessage(g(4995,"No paste edits for '{0}' found",t instanceof Jn?t.value:t.providerId),e[0].getStartPosition())}doPasteInline(e,t,i,n,r){const o=this._editor;if(!o.hasModel())return;const a=new nI(o,jr.Value|jr.Selection,void 0),c=Mo(async l=>{const d=this._editor;if(!d.hasModel())return;const h=d.getModel(),u=new Z,f=u.add(new li(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 VM)return this.applyDefaultPasteHandler(i,n,p,r);const v={triggerKind:D8.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 VM)return this.applyDefaultPasteHandler(i,n,p,r);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 hc,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 Pa))},0);return R&&(y.additionalEdit=R.additionalEdit),A(y)}catch(k){return L(k)}})()}),p)}await this.applyDefaultPasteHandler(i,n,p,r)}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,r)}finally{a.dispose()}}}).then(()=>{a.dispose()}),this._currentPasteOperation=c}showPasteAsPick(e,t,i,n,r){const o=Mo(async a=>{const c=this._editor;if(!c.hasModel())return;const l=c.getModel(),d=new Z,h=d.add(new nI(c,jr.Value|jr.Selection,void 0,a));try{if(await this.mergeInDataFromCopy(n,r,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:D8.PasteAs,only:e&&e instanceof Jn?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 Jn?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=Pet(l.uri,i,m);await this._bulkEditService.apply(v,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:fd.Window,title:g(4999,"Running paste handlers")},()=>o)}setCopyMetadata(e,t){e.setData(pue,JSON.stringify(t))}fetchCopyMetadata(e){if(!e.clipboardData)return;const t=e.clipboardData.getData(pue);if(t)try{return JSON.parse(t)}catch{return}const[i,n]=wme.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&&p0._currentCopyOperation?.handle===t.id){const n=await p0._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[r,o]of n)e.replace(r,o)}if(!e.has(Vs.uriList)){const n=await this._clipboardService.readResources();if(i.isCancellationRequested)return;n.length&&e.append(Vs.uriList,rG(rI.create(n)))}}async getPasteEdits(e,t,i,n,r,o){const a=new Z,c=await $_(Promise.all(e.map(async d=>{try{const h=await d.provideDocumentPasteEdits?.(i,n,t,r,o);return h&&a.add(h),h?.edits?.map(u=>({...u,provider:d}))}catch(h){Oo(h)||console.error(h);return}})),o),l=Oi(c??[]).flat().filter(d=>!r.only||r.only.contains(d.kind));return{edits:Fet(l),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,n){const o=await(e.get(Vs.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;const a={clipboardEvent:n,text:o,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 Jn?e.providedPasteEditKinds?e.providedPasteEditKinds.some(i=>t.contains(i)):!0:e.id===t.providerId}},p0=OL,OL.ID="editor.contrib.copyPasteActionController",OL);cC=p0=D([_(1,we),_(2,UN),_(3,gg),_(4,nt),_(5,Tn),_(6,hg)],cC);const Cs=new class{constructor(){this.QuickFix=new Jn("quickfix"),this.Refactor=new Jn("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 Jn("notebook"),this.Source=new Jn("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var od;(function(s){s.IfSingle="ifSingle",s.First="first",s.Never="never"})(od||(od={}));var ag;(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"})(ag||(ag={}));function CFt(s,e){return!(s.include&&!s.include.intersects(e)||s.excludes&&s.excludes.some(t=>Bet(e,t,s.include))||!s.includeSourceActions&&Cs.Source.contains(e))}function SFt(s,e){const t=e.kind?new Jn(e.kind):void 0;return!(s.include&&(!t||!s.include.contains(t))||s.excludes&&t&&s.excludes.some(i=>Bet(t,i,s.include))||!s.includeSourceActions&&t&&Cs.Source.contains(t)||s.onlyIncludePreferredActions&&!e.isPreferred)}function Bet(s,e,t){return!(!e.contains(s)||t&&e.contains(t))}class Jw{static fromUser(e,t){return!e||typeof e!="object"?new Jw(t.kind,t.apply,!1):new Jw(Jw.getKindFromUser(e,t.kind),Jw.getApplyFromUser(e,t.apply),Jw.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return od.First;case"never":return od.Never;case"ifsingle":return od.IfSingle;default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Jn(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 AFt{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){Nr(i)}t&&(this.action.edit=t.edit)}return this}}const eNe="editor.action.codeAction",tNe="editor.action.quickFix",Wet="editor.action.autoFix",iNe="editor.action.refactor",nNe="editor.action.sourceAction",jbe="editor.action.organizeImports",Ybe="editor.action.fixAll";class K5 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:tr(e.diagnostics)?tr(t.diagnostics)?K5.codeActionsPreferredComparator(e,t):-1:tr(t.diagnostics)?1:K5.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(K5.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Cs.QuickFix.contains(new Jn(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 MUe={actions:[],documentation:void 0};async function rB(s,e,t,i,n,r){const o=i.filter||{},a={...o,excludes:[...o.excludes||[],Cs.Notebook]},c={only:o.include?.value,trigger:i.type},l=new nMe(e,r),d=i.type===Ah.Auto,h=EFt(s,e,d?a:o),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 MUe;const b=(v?.actions||[]).filter(y=>y&&SFt(o,y)),w=DFt(m,b,o.include);return{actions:b.map(y=>new AFt(y,m)),documentation:w}}catch(v){if(Oo(v))throw v;return Nr(v),MUe}}),p=s.onDidChange(()=>{const m=s.all(e);ns(m,h)||l.cancel()});try{const m=await Promise.all(f),v=m.map(w=>w.actions).flat(),b=[...Oi(m.map(w=>w.documentation)),...xFt(s,e,i,v)];return new K5(v,b,u)}finally{p.dispose(),l.dispose()}}function EFt(s,e,t){return s.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>CFt(t,new Jn(n))):!0)}function*xFt(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(r=>r.action)))}function DFt(s,e,t){if(!s.documentation)return;const i=s.documentation.map(n=>({kind:new Jn(n.kind),command:n.command}));if(t){let n;for(const r of i)r.kind.contains(t)&&(n?n.kind.contains(r.kind)&&(n=r):n=r);if(n)return n?.command}for(const n of e)if(n.kind){for(const r of i)if(r.kind.contains(new Jn(n.kind)))return r.command}}var Hx;(function(s){s.OnSave="onSave",s.FromProblemsView="fromProblemsView",s.FromCodeActions="fromCodeActions",s.FromAILightbulb="fromAILightbulb"})(Hx||(Hx={}));async function Het(s,e,t,i,n=Ue.None){const r=s.get(UN),o=s.get(bi),a=s.get(Ji),c=s.get(wi);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 r.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Hx.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await o.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(l){const d=kFt(l);c.error(typeof d=="string"?d:g(4521,"An unknown error occurred while applying the code action"))}}function kFt(s){return typeof s=="string"?s:s instanceof Error&&typeof s.message=="string"?s.message:void 0}vt.registerCommand("_executeCodeActionProvider",async function(s,e,t,i,n){if(!(e instanceof N))throw Fi();const{codeActionProvider:r}=s.get(nt),o=s.get(fi).getModel(e);if(!o)throw Fi();const a=ht.isISelection(t)?ht.liftSelection(t):F.isIRange(t)?o.validateRange(t):void 0;if(!a)throw Fi();const c=typeof i=="string"?new Jn(i):void 0,l=await rB(r,o,a,{type:Ah.Invoke,triggerAction:ag.Default,filter:{includeSourceActions:!0,include:c}},hu.None,Ue.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 Jbe,BL;let Xbe=(BL=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Ca(()=>this.keybindingService.getKeybindings().filter(t=>Jbe.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===jbe?i={kind:Cs.SourceOrganizeImports.value}:t.command===Ybe&&(i={kind:Cs.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Jw.fromUser(i,{kind:Jn.None,apply:od.Never})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Jn(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,r)=>n?n.kind.contains(r.kind)?r:n:r,void 0)}},Jbe=BL,BL.codeActionCommands=[iNe,eNe,nNe,jbe,Ybe],BL);Xbe=Jbe=D([_(0,Vt)],Xbe);var IFt='.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}';gt(IFt,{});const Uet="acceptSelectedCodeAction",Vet="previewSelectedCodeAction";var v_;(function(s){s.Action="action",s.Header="header"})(v_||(v_={}));class TFt{get templateId(){return v_.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 Zbe=class{get templateId(){return v_.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 Zk(e,pr);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=He.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=$e(e.group.icon.color.id))):(i.icon.className=He.asClassName(ve.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=zet(e.label),i.keybinding.set(e.keybinding),WTe(!!e.keybinding,i.keybinding.element);const n=this._keybindingService.lookupKeybinding(Uet)?.getLabel(),r=this._keybindingService.lookupKeybinding(Vet)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:n&&r?this._supportsPreview&&e.canPreview?i.container.title=g(11229,"{0} to Apply, {1} to Preview",n,r):i.container.title=g(11230,"{0} to Apply",n):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};Zbe=D([_(1,Vt)],Zbe);class LFt extends UIEvent{constructor(){super("acceptSelectedAction")}}class NUe extends UIEvent{constructor(){super("previewSelectedAction")}}function RFt(s){if(s.kind==="action")return s.label}let ewe=class extends V{constructor(e,t,i,n,r,o){super(),this._delegate=n,this._contextViewService=r,this._keybindingService=o,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new li),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:c=>c.kind===v_.Header?this._headerLineHeight:this._actionLineHeight,getTemplateId:c=>c.kind};this._list=this._register(new Za(e,this.domNode,a,[new Zbe(t,this._keybindingService),new TFt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:RFt},accessibilityProvider:{getAriaLabel:c=>{if(c.kind===v_.Action){let l=c.label?zet(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===v_.Action?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(zN),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===v_.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 r=e;if(this._allMenuItems.length>=50)r=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});r=Math.max(...c,e)}const a=Math.min(n,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,r),this.domNode.style.height=`${a}px`,this._list.domFocus(),r}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 r=e?new NUe:new LFt;this._list.setSelection([i],r)}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 NUe):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===v_.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([])}};ewe=D([_(4,bf),_(5,Vt)],ewe);function zet(s){return s.replace(/\r\n|\r|\n/g," ")}const $et=Object.freeze({kind:Jn.Empty,title:g(9847,"More Actions...")}),MFt=Object.freeze([{kind:Cs.QuickFix,title:g(9848,"Quick Fix")},{kind:Cs.RefactorExtract,title:g(9849,"Extract"),icon:ve.wrench},{kind:Cs.RefactorInline,title:g(9850,"Inline"),icon:ve.wrench},{kind:Cs.RefactorRewrite,title:g(9851,"Rewrite"),icon:ve.wrench},{kind:Cs.RefactorMove,title:g(9852,"Move"),icon:ve.wrench},{kind:Cs.SurroundWith,title:g(9853,"Surround With"),icon:ve.surroundWith},{kind:Cs.Source,title:g(9854,"Source Action"),icon:ve.symbolFile},$et]);function NFt(s,e,t){if(!e)return s.map(r=>({kind:v_.Action,item:r,group:$et,disabled:!!r.action.disabled,label:r.action.disabled||r.action.title,canPreview:!!r.action.edit?.edits.length}));const i=MFt.map(r=>({group:r,actions:[]}));for(const r of s){const o=r.action.kind?new Jn(r.action.kind):Jn.None;for(const a of i)if(a.group.kind.contains(o)){a.actions.push(r);break}}const n=[];for(const r of i)if(r.actions.length){n.push({kind:v_.Header,group:r.group});for(const o of r.actions){const a=r.group;n.push({kind:v_.Action,item:o,group:o.action.isAI?{title:a.title,kind:a.kind,icon:ve.sparkle}:a,label:o.action.title,disabled:!!o.action.disabled,keybinding:t(o.action)})}}return n}var PFt='.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))}';gt(PFt,{});var HP;const PUe=oi("gutter-lightbulb",ve.lightBulb,g(5031,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),FUe=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.")),OUe=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.")),BUe=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.")),WUe=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 xd;(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,r,o,a){this.actions=n,this.trigger=r,this.editorPosition=o,this.widgetPosition=a,this.type=e.Showing}}s.Showing=t})(xd||(xd={}));var zS;let i9=(zS=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=xd.Hidden,this._gutterState=xd.Hidden,this._iconClasses=[],this.gutterDecoration=HP.GUTTER_DECORATION,this._domNode=fe("div.lightBulbWidget"),this._domNode.role="listbox",this._register(md.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const n=this._editor.getModel();(this.state.type!==xd.Type.Showing||!n||this.state.editorPosition.lineNumber>=n.getLineCount())&&this.hide(),(this.gutterState.type!==xd.Type.Showing||!n||this.gutterState.editorPosition.lineNumber>=n.getLineCount())&&this.gutterHide()})),this._register(Fht(this._domNode,i=>{if(this.state.type!==xd.Type.Showing)return;this._editor.focus(),i.preventDefault();const{top:n,height:r}=So(this._domNode),o=this._editor.getOption(x.lineHeight);let a=Math.floor(o/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(Wet)?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding(tNe)?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async i=>{const n=["codicon-"+PUe.id,"codicon-"+BUe.id,"codicon-"+FUe.id,"codicon-"+OUe.id,"codicon-"+WUe.id];if(!i.target.element||!n.some(l=>i.target.element&&i.target.element.classList.contains(l))||this.gutterState.type!==xd.Type.Showing)return;this._editor.focus();const{top:r,height:o}=So(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=o,m=1;if(!u){const w=y=>{const C=r.getLineContent(y);return/^\s*$|^\s+/.test(C)||C.length<=m};if(o>1&&!f(o-1)){const y=r.getLineCount(),C=o===y,A=o>1&&w(o-1),L=!C&&w(o+1),k=w(o),P=!L&&!A;let R=!1;const z=this._editor.getLineDecorations(o);if(z)for(const G of z)G.options.glyphMarginClassName?.includes(ve.debugBreakpoint.id)&&(R=!0);if(!L&&!A&&!R)return this.gutterState=new xd.Showing(e,t,i,{position:{lineNumber:p,column:m},preference:HP._posPref}),this.renderGutterLightbub(),this.hide();A||C||P&&!k?p-=1:(L||P&&k)&&(p+=1)}else{if(o===1&&(o===r.getLineCount()||!w(o+1)&&!w(o)))return this.gutterState=new xd.Showing(e,t,i,{position:{lineNumber:p,column:m},preference:HP._posPref}),this.renderGutterLightbub(),this.hide();if(o{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===xd.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}},HP=zS,zS.GUTTER_DECORATION=Kt.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:He.asClassName(ve.lightBulb),glyphMargin:{position:j_.Left},stickiness:si.NeverGrowsWhenTypingAtEdges}),zS.ID="editor.contrib.lightbulbWidget",zS._posPref=[ts.EXACT],zS);i9=HP=D([_(1,Vt)],i9);W("actionBar.toggledBackground",b6,g(9855,"Background color for toggled action items in action bar."));const zM={Visible:new Q("codeActionMenuVisible",!1,g(9856,"Whether the action widget list is visible"))},YN=ae("actionWidgetService");let $M=class extends V{get isVisible(){return zM.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new yn)}show(e,t,i,n,r,o,a){const c=zM.Visible.bindTo(this._contextKeyService),l=this._instantiationService.createInstance(ewe,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>r,render:d=>(c.set(!0),this._renderWidget(d,l,a??[])),onHide:d=>{c.reset(),this._onWidgetClosed(d)}},o,!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 r=new Z,o=document.createElement("div"),a=e.appendChild(o);a.classList.add("context-view-block"),r.add(ue(a,ke.MOUSE_DOWN,f=>f.stopPropagation()));const c=document.createElement("div"),l=e.appendChild(c);l.classList.add("context-view-pointerBlock"),r.add(ue(l,ke.POINTER_MOVE,()=>l.remove())),r.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),r.add(f),d=f.getContainer().offsetWidth)}const h=this._list.value?.layout(d);n.style.width=`${h}px`;const u=r.add(Ec(e));return r.add(u.onDidBlur(()=>this.hide(!0))),r}_createActionBar(e,t){if(!t.length)return;const i=fe(e),n=new gd(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){this._list.value?.hide(e)}};$M=D([_(0,bf),_(1,Le),_(2,we)],$M);ce(YN,$M,Qt.Delayed);const oG=Ae.EditorContrib+1e3;Et(class extends di{constructor(){super({id:"hideCodeActionWidget",title:Pe(9857,"Hide action widget"),precondition:zM.Visible,keybinding:{weight:oG,primary:S.Escape,secondary:[U.Shift|S.Escape]}})}run(s){s.get(YN).hide(!0)}});Et(class extends di{constructor(){super({id:"selectPrevCodeAction",title:Pe(9858,"Select previous action"),precondition:zM.Visible,keybinding:{weight:oG,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(YN);e instanceof $M&&e.focusPrevious()}});Et(class extends di{constructor(){super({id:"selectNextCodeAction",title:Pe(9859,"Select next action"),precondition:zM.Visible,keybinding:{weight:oG,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(YN);e instanceof $M&&e.focusNext()}});Et(class extends di{constructor(){super({id:Uet,title:Pe(9860,"Accept selected action"),precondition:zM.Visible,keybinding:{weight:oG,primary:S.Enter,secondary:[U.CtrlCmd|S.Period]}})}run(s){const e=s.get(YN);e instanceof $M&&e.acceptSelected()}});Et(class extends di{constructor(){super({id:Vet,title:Pe(9861,"Preview selected action"),precondition:zM.Visible,keybinding:{weight:oG,primary:U.CtrlCmd|S.Enter}})}run(s){const e=s.get(YN);e instanceof $M&&e.acceptSelected(!0)}});const Get=new Q("supportedCodeAction",""),HUe="_typescript.applyFixAllCodeAction";class FFt 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 Em),this._register(this._markerService.onMarkerChanged(r=>this._onMarkerChanges(r))),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=>Yi(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:Ah.Auto,triggerAction:ag.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===Ah.Invoke)return t;const i=this._editor.getOption(x.lightbulb).enabled;if(i!==d_.Off){{if(i===d_.On)return t;if(i===d_.OnCode){if(!t.isEmpty())return t;const r=this._editor.getModel(),{lineNumber:o,column:a}=t.getPosition(),c=r.getLineContent(o);if(c.length===0)return;if(a===1){if(/\s/.test(c[0]))return}else if(a===r.getLineMaxColumn(o)){if(/\s/.test(c[c.length-1]))return}else if(/\s/.test(c[a-2])&&/\s/.test(c[a-1]))return}}return t}}}var Wv;(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,r,o){this.trigger=n,this.position=r,this._cancellablePromise=o,this.type=e.Triggered,this.actions=o.catch(a=>{if(Oo(a))return Ket;throw a})}cancel(){this._cancellablePromise.cancel()}}s.Triggered=t})(Wv||(Wv={}));const Ket=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class OFt extends V{constructor(e,t,i,n,r,o){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=r,this._configurationService=o,this._codeActionOracle=this._register(new yn),this._state=Wv.Empty,this._onDidChangeState=this._register(new I),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=Get.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(Wv.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(Wv.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 FFt(this._editor,this._markerService,i=>{if(!i){this.setState(Wv.Empty);return}const n=i.selection.getStartPosition(),r=Mo(async c=>{if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===Ah.Invoke&&(i.trigger.triggerAction===ag.QuickFix||i.trigger.filter?.include?.contains(Cs.QuickFix))){const l=await rB(this._registry,e,i.selection,i.trigger,hu.None,c),d=[...l.allActions];if(c.isCancellationRequested)return Ket;const h=l.validActions?.some(f=>f.action.kind?Cs.QuickFix.contains(new Jn(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(HUe))&&(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 re(C,y);const L={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:i.trigger.filter?.include?i.trigger.filter?.include:Cs.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:i.trigger.context?.notAvailableMessage||"",position:p}},k=new ht(p.lineNumber,p.column,p.lineNumber,p.column),P=await rB(this._registry,e,k,L,hu.None,c);if(P.validActions.length!==0){for(const R of P.validActions)R.action.command?.arguments?.some(z=>typeof z=="string"&&z.includes(HUe))&&(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 rB(this._registry,e,i.selection,i.trigger,hu.None,c)});i.trigger.type===Ah.Invoke&&this._progressService?.showWhile(r,250);const o=new Wv.Triggered(i.trigger,n,r);let a=!1;this._state.type===Wv.Type.Triggered&&(a=this._state.trigger.type===Ah.Invoke&&o.type===Wv.Type.Triggered&&o.trigger.type===Ah.Auto&&this._state.position!==o.position),a?setTimeout(()=>{this.setState(o)},500):this.setState(o)},void 0),this._codeActionOracle.value.trigger({type:Ah.Auto,triggerAction:ag.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===Wv.Type.Triggered&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var UP;const BFt="quickfix-edit-highlight";var QD;let GM=(QD=class extends V{static get(e){return e.getContribution(UP.ID)}constructor(e,t,i,n,r,o,a,c,l,d){super(),this._commandService=a,this._configurationService=c,this._actionWidgetService=l,this._instantiationService=d,this._activeCodeActions=this._register(new yn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new OFt(this._editor,r.codeActionProvider,t,i,o,c)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new Ca(()=>{const h=this._editor.getContribution(i9.ID);return h&&this._register(h.onClick(u=>this.showCodeActionsFromLightbulb(u.actions,u))),h}),this._resolver=n.createInstance(Xbe),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,Hx.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;Mh.get(this._editor)?.closeMessage();const r=this._editor.getPosition();this._trigger({type:Ah.Invoke,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i,n){try{await this._instantiationService.invokeFunction(Het,e,n,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:Ah.Auto,triggerAction:ag.QuickFix,filter:{}})}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(e.type!==Wv.Type.Triggered){this.hideLightBulbWidget();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===Ah.Invoke){if(e.trigger.filter?.include){const n=this.tryGetValidActionToApply(e.trigger,t);if(n){try{this.hideLightBulbWidget(),await this._applyCodeAction(n,!1,!1,Hx.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const r=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(r&&r.action.disabled){Mh.get(this._editor)?.showMessage(r.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)){Mh.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===od.First&&t.validActions.length===0||e.autoApply===od.IfSingle&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply===od.First&&t.validActions.length>0||e.autoApply===od.IfSingle&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),r=this._editor.getDomNode();if(!r)return;const o=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!o.length)return;const a=re.isIPosition(t)?this.toCoords(t):t,c={onSelect:async(l,d)=>{this._applyCodeAction(l,!0,!!d,i.fromLightbulb?Hx.FromAILightbulb:Hx.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 Jn(u);h=[Cs.RefactorExtract,Cs.RefactorInline,Cs.RefactorRewrite,Cs.RefactorMove,Cs.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:UP.DECORATION})):d.map(f=>({range:f,options:UP.DECORATION}));n.set(u)}else if(h&&h.length>0){const u=h.map(p=>({range:p,options:UP.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;xh(g(5028,"Context: {0} at line {1} and column {2}.",p,f.startLineNumber,f.startColumn))}}}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,NFt(o,this._shouldShowHeaders(),this._resolver.getResolver()),c,a,r,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,_t.Immediate),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=So(this._editor.getDomNode()),n=i.left+t.left,r=i.top+t.top+t.height;return{x:n,y:r}}_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(r=>({id:r.id,label:r.title,tooltip:r.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(r.id,...r.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}},UP=QD,QD.ID="editor.contrib.codeActionController",QD.DECORATION=Kt.register({description:"quickfix-highlight",className:BFt}),QD);GM=UP=D([_(1,Dm),_(2,Le),_(3,we),_(4,nt),_(5,nE),_(6,bi),_(7,Te),_(8,YN),_(9,we)],GM);Ep((s,e)=>{((n,r)=>{r&&e.addRule(`.monaco-editor ${n} { background-color: ${r}; }`)})(".quickfix-edit-highlight",s.getColor(yb));const i=s.getColor(kx);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Fy(s.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var twe;const qet="editor.experimental.dropIntoEditor.defaultProvider",Qet="editor.changeDropType",sNe=new Q("dropWidgetVisible",!1,g(5050,"Whether the drop widget is showing"));var WL;let KM=(WL=class extends V{static get(e){return e.getContribution(twe.ID)}constructor(e,t,i,n,r){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=r,this.treeItemsTransfer=DX.getInstance(),this._dropProgressManager=this._register(t.createInstance(IX,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(TX,"dropIntoEditor",e,sNe,{id:Qet,label:g(5051,"Show drop options...")})),this._register(e.onDropIntoEditor(o=>this.onDropIntoEditor(e,o.position,o.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=Mo(async r=>{const o=new Z,a=o.add(new nI(e,jr.Value,void 0,r));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=o.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,r)}}finally{o.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,r){const o=new Z,a=await $_(Promise.all(e.map(async l=>{try{const d=await l.provideDocumentDropEdits(t,i,n,r.token);return d&&o.add(d),d?.edits.map(h=>({...h,providerId:l.id}))}catch(d){console.error(d)}})),r.token),c=Oi(a??[]).flat();return{edits:Fet(c),dispose:()=>o.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(qet,{resource:e.uri});for(const[n,r]of Object.entries(i)){const o=new Jn(r),a=t.findIndex(c=>o.value===c.providerId&&c.handledMimeType&&Det(n,[c.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new Ice;const t=Ret(e.dataTransfer);if(this.treeItemsTransfer.hasData(bHe.prototype)){const i=this.treeItemsTransfer.getData(bHe.prototype);if(Array.isArray(i))for(const n of i){const r=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(r)for(const[o,a]of r)t.replace(o,a)}}return t}},twe=WL,WL.ID="editor.contrib.dropIntoEditorController",WL);KM=twe=D([_(1,we),_(2,Te),_(3,nt),_(4,ece)],KM);var WFt=".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}";gt(WFt,{});function iwe(s,e){return!!s[e]}class mue{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=iwe(e.event,t.triggerModifier),this.hasSideBySideModifier=iwe(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class UUe{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=iwe(e,t.triggerModifier)}}class RK{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 VUe(s){return s==="altKey"?jt?new RK(S.Meta,"metaKey",S.Alt,"altKey"):new RK(S.Ctrl,"ctrlKey",S.Alt,"altKey"):jt?new RK(S.Alt,"altKey",S.Meta,"metaKey"):new RK(S.Alt,"altKey",S.Ctrl,"ctrlKey")}class Tce 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=VUe(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=VUe(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 mue(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new mue(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new mue(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new UUe(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new UUe(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 HFt=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 LX{constructor(e){this._disposables=new Z;let t=[];for(const[i,n]of e){const r=i.links.map(o=>new HFt(o,n));t=LX._union(t,r),xN(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,r,o,a;for(n=0,o=0,r=e.length,a=t.length;nPromise.resolve(r.provideLinks(e,t)).then(a=>{a&&(i[o]=[a,r])},Nr));return Promise.all(n).then(()=>{const r=new LX(Oi(i));return t.isCancellationRequested?(r.dispose(),new LX([])):r})}vt.registerCommand("_executeLinkProvider",async(s,...e)=>{let[t,i]=e;Lt(t instanceof N),typeof i!="number"&&(i=0);const{linkProvider:n}=s.get(nt),r=s.get(fi).getModel(t);if(!r)return[];const o=await jet(n,r,Ue.None);if(!o)return[];for(let c=0;cthis.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const o=this._register(new Tce(e));this._register(o.onMouseMoveOrRelevantKeyDown(([a,c])=>{this._onEditorMouseMove(a,c)})),this._register(o.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(o.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=Mo(t=>jet(this.providers,e,t));try{const t=new Ys(!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=[],n=Object.keys(this.currentOccurrences);for(const o of n){const a=this.currentOccurrences[o];i.push(a.decorationId)}const r=[];if(e)for(const o of e)r.push(oB.decoration(o,t));this.editor.changeDecorations(o=>{const a=o.deltaDecorations(i,r);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let c=0,l=a.length;c{n.activate(r,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(Ue.None).then(r=>{if(typeof r=="string"&&this.editor.hasModel()){const o=this.editor.getModel().uri;if(o.scheme===pe.file&&r.startsWith(`${pe.file}:`)){const a=N.parse(r);if(a.scheme===pe.file){const c=i_(a);let l=null;c.startsWith("/./")||c.startsWith("\\.\\")?l=`.${c.substr(1)}`:(c.startsWith("//./")||c.startsWith("\\\\.\\"))&&(l=`.${c.substr(2)}`),l&&(r=Ft(o,l))}}}return this.openerService.open(r,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},r=>{const o=r instanceof Error?r.message:r;o==="invalid"?this.notificationService.warn(g(1508,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):o==="missing"?this.notificationService.warn(g(1509,"Failed to open this link because its target is missing.")):bt(r)})}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===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()}},nwe=HL,HL.ID="editor.linkDetector",HL);kW=nwe=D([_(1,Ar),_(2,wi),_(3,nt),_(4,xp)],kW);const zUe={general:Kt.register({description:"detected-link",stickiness:si.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Kt.register({description:"detected-link-active",stickiness:si.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class oB{static decoration(e,t){return{range:e.range,options:oB._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n={...i?zUe.active:zUe.general};return n.hoverMessage=UFt(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,oB._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,oB._getOptions(this.link,t,!1))}}function UFt(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?jt?g(1512,"cmd + click"):g(1513,"ctrl + click"):jt?g(1514,"option + click"):g(1515,"alt + click");if(s.url){let r="";if(/^command:/i.test(s.url.toString())){const a=s.url.toString().match(/^command:([^?#]+)/);if(a){const c=a[1];r=g(1516,"Execute command {0}",c)}}return new Nt("",!0).appendLink(s.url.toString(!0).replace(/ /g,"%20"),i,r).appendMarkdown(` (${n})`)}else return new Nt().appendText(`${i} (${n})`)}class VFt extends it{constructor(){super({id:"editor.action.openLink",label:g(1517,"Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=kW.get(t);if(!i||!t.hasModel())return;const n=t.getSelections();for(const r of n){const o=i.getLinkOccurrence(r.getEndPosition());o&&i.openLinkOccurrence(o,!1)}}}on(kW.ID,kW,ai.AfterFirstRender);Re(VFt);const Lce="editor.contrib.selectionClipboard",Yet="editor.action.showHover",zFt="editor.action.showDefinitionPreviewHover",$Ft="editor.action.scrollUpHover",GFt="editor.action.scrollDownHover",KFt="editor.action.scrollLeftHover",qFt="editor.action.scrollRightHover",QFt="editor.action.pageUpHover",jFt="editor.action.pageDownHover",YFt="editor.action.goToTopHover",JFt="editor.action.goToBottomHover",JU="editor.action.increaseHoverVerbosityLevel",XFt="editor.action.increaseHoverVerbosityLevelFromAccessibleView",ZFt=g(9864,"Increase Hover Verbosity Level"),XU="editor.action.decreaseHoverVerbosityLevel",eOt="editor.action.decreaseHoverVerbosityLevelFromAccessibleView",tOt=g(9865,"Decrease Hover Verbosity Level");var zl;(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"})(zl||(zl={}));var lC;(function(s){s[s.Delayed=0]="Delayed",s[s.Immediate=1]="Immediate"})(lC||(lC={}));var UA;(function(s){s[s.Mouse=0]="Mouse",s[s.Keyboard=1]="Keyboard"})(UA||(UA={}));let iOt=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class Jet 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 ln(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new ln(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new ln(()=>this._triggerLoadingMessage(),0)),this._state=zl.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(zl.SecondWait),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=sht(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===zl.WaitingForAsync||this._state===zl.WaitingForAsyncShowingLoading)&&this._setState(zl.Idle)}catch(e){bt(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?zl.Idle:zl.WaitingForAsync)}_triggerLoadingMessage(){this._state===zl.WaitingForAsync&&this._setState(zl.WaitingForAsyncShowingLoading)}_fireResult(){if(this._state===zl.FirstWait||this._state===zl.SecondWait)return;const e=this._state===zl.Idle,t=this._state===zl.WaitingForAsyncShowingLoading;this._onResult.fire(new iOt(this._result.slice(0),e,t))}start(e){if(e===lC.Delayed)this._state===zl.Idle&&(this._setState(zl.FirstWait),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case zl.Idle:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case zl.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(zl.Idle,!1)}}const nOt=30,sOt=24;class rOt extends V{constructor(e,t=new wn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new qMe),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=wn.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 wn(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?re.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:So(t).top+i.top-nOt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=So(t),r=K_(t.ownerDocument.body),o=n.top+i.top+i.height;return r.height-o-sOt}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),n=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),r=Math.min(Math.max(n,i),e),o=Math.min(e,r);let a;return this._editor.getOption(x.hover).above?a=o<=n?ts.ABOVE:ts.BELOW:a=o<=i?ts.BELOW:ts.ABOVE,a===ts.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 sw;const $Ue=30,oOt=6;var jD;let RX=(jD=class extends rOt{get isVisibleFromKeyboard(){return this._renderedHover?.source===UA.Keyboard}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,n,r){const o=e.getOption(x.lineHeight)+8,a=150,c=new wn(a,o);super(e,c),this._configurationService=i,this._accessibilityService=n,this._keybindingService=r,this._hover=this._register(new jLe),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),oe(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(Ec(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 sw.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,r=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=r}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return sw._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return sw._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,r=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=r}_setHoverWidgetMaxDimensions(e,t){sw._applyMaxDimensions(this._hover.contentsDomNode,e,t),sw._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 wn(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){sw._lastDimensions=new wn(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===ts.ABOVE?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=oOt;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(r=>this._editor.applyFontInfo(r))}_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,sw._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,sw._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?Ir.LeftOfInjectedText:void 0,preference:[this._positionPreference??ts.ABOVE]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=vb(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??ts.ABOVE,this.onContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const r=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&Qje(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._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new wn(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 wn(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 wn(e,this._minimumSize.height)}onContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=vb(e),i=Od(e);if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=vb(e),i=Od(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._renderedHover?.showAtPosition){const n=vb(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})}},sw=jD,jD.ID="editor.contrib.resizableContentHoverWidget",jD._lastDimensions=new wn(0,0),jD);RX=sw=D([_(1,Le),_(2,Te),_(3,_o),_(4,Vt)],RX);function GUe(s,e,t,i,n,r){const o=t+n/2,a=i+r/2,c=Math.max(Math.abs(s-o)-n/2,0),l=Math.max(Math.abs(e-a)-r/2,0);return Math.sqrt(c*c+l*l)}var uu;(function(s){s[s.Range=1]="Range",s[s.ForeignElement=2]="ForeignElement"})(uu||(uu={}));class _ue{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=uu.Range}equals(e){return e.type===uu.Range&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===uu.Range&&t.lineNumber===this.range.startLineNumber}}class wQ{constructor(e,t,i,n,r,o){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=r,this.supportsMarkerHover=o,this.type=uu.ForeignElement}equals(e){return e.type===uu.ForeignElement&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===uu.ForeignElement&&this.owner===e.owner}}class qM{constructor(e){this.renderedHoverParts=e}dispose(){for(const e of this.renderedHoverParts)e.dispose()}}const JN=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class MX{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=UA.Mouse,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==uu.Range&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const r=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(o=>{if(o.options.isWholeLine)return!0;const a=o.range.startLineNumber===n?o.range.startColumn:1,c=o.range.endLineNumber===n?o.range.endColumn:r;if(o.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 Yd.EMPTY;const i=MX._getLineDecorations(this._editor,t);return Yd.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):Yd.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=MX._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Oi(t)}}class Xet{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 aOt(this,this.anchor,t,this.isComplete)}}class aOt extends Xet{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}const KUe=fe;let NX=class extends V{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this.actions=[],this._hasContent=!1,this.hoverElement=KUe("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=oe(this.hoverElement,KUe("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const n=this._register(YLe.render(this.actionsElement,e,i));return this.actions.push(n),n}append(e){const t=oe(this.actionsElement,e);return this._hasContent=!0,t}};NX=D([_(0,Vt)],NX);class cOt{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function lOt(s,e,t,i,n){const r=await Promise.resolve(s.provideHover(t,i,n)).catch(Nr);if(!(!r||!dOt(r)))return new cOt(s,r,e)}function rNe(s,e,t,i,n=!1){const o=s.ordered(e,n).map((a,c)=>lOt(a,c,e,t,i));return Yd.fromPromises(o).coalesce()}function Zet(s,e,t,i,n=!1){return rNe(s,e,t,i,n).map(r=>r.hover).toPromise()}lg("_executeHoverProvider",(s,e,t)=>{const i=s.get(nt);return Zet(i.hoverProvider,e,t,Ue.None)});lg("_executeHoverProvider_recursive",(s,e,t)=>{const i=s.get(nt);return Zet(i.hoverProvider,e,t,Ue.None,!0)});function dOt(s){const e=typeof s.range<"u",t=typeof s.contents<"u"&&s.contents&&s.contents.length>0;return e&&t}const SF=fe,hOt=oi("hover-increase-verbosity",ve.add,g(5160,"Icon for increaseing hover verbosity.")),uOt=oi("hover-decrease-verbosity",ve.remove,g(5161,"Icon for decreasing hover verbosity."));class b_{constructor(e,t,i,n,r,o=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=r,this.source=o}isValidForHoverAnchor(e){return e.type===uu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class ett{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case Nc.Increase:return this.hover.canIncreaseVerbosity??!1;case Nc.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let n9=class{constructor(e,t,i,n,r,o,a,c){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=r,this._keybindingService=o,this._hoverService=a,this._commandService=c,this.hoverOrdinal=3}createLoadingMessage(e){return new b_(this,e.range,[new Nt().appendText(g(5162,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==uu.Range)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,r=i.getLineMaxColumn(n),o=[];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,o.push(new b_(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&&o.push(new b_(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:r,b=p.options.hoverMessage;if(!b||tW(b))continue;p.options.beforeContentClassName&&(f=!0);const w=new F(e.range.startLineNumber,m,e.range.startLineNumber,v);o.push(new b_(this,w,z_(b),f,a++))}return o}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==uu.Range)return Yd.EMPTY;const n=this._editor.getModel(),r=this._languageFeaturesService.hoverProvider;return r.has(n)?this._getMarkdownHovers(r,n,e,i):Yd.EMPTY}_getMarkdownHovers(e,t,i,n){const r=i.range.getStartPosition();return rNe(e,t,r,n).filter(c=>!tW(c.hover.contents)).map(c=>{const l=c.hover.range?F.lift(c.hover.range):i.range,d=new ett(c.hover,c.provider,r);return new b_(this,l,c.hover.contents,!1,c.ordinal,d)})}renderHoverParts(e,t){return this._renderedHoverParts=new gOt(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))}};n9=D([_(1,Di),_(2,Ar),_(3,Te),_(4,nt),_(5,Vt),_(6,tc),_(7,bi)],n9);class MK{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 gOt{constructor(e,t,i,n,r,o,a,c,l,d,h){this._hoverParticipant=i,this._editor=n,this._languageService=r,this._openerService=o,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(Sc(n=>n.ordinal,ru)),e.map(n=>{const r=this._renderHoverPart(n,i);return t.appendChild(r.hoverElement),r})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),n=i.hoverElement,r=e.source,o=new Z;if(o.add(i),!r)return new MK(e,n,o);const a=r.supportsVerbosityAction(Nc.Increase),c=r.supportsVerbosityAction(Nc.Decrease);if(!a&&!c)return new MK(e,n,o);const l=SF("div.verbosity-actions");return n.prepend(l),o.add(this._renderHoverExpansionAction(l,Nc.Increase,a)),o.add(this._renderHoverExpansionAction(l,Nc.Decrease,c)),new MK(e,n,o)}_renderMarkdownHover(e,t){return ttt(this._editor,e,this._languageService,this._openerService,t)}_renderHoverExpansionAction(e,t,i){const n=new Z,r=t===Nc.Increase,o=oe(e,SF(He.asCSSSelector(r?hOt:uOt)));o.tabIndex=0;const a=new RM("mouse",!1,{target:e,position:{hoverPosition:vr.LEFT}},this._configurationService,this._hoverService);if(n.add(this._hoverService.setupManagedHover(a,o,itt(this._keybindingService,t))),!i)return o.classList.add("disabled"),n;o.classList.add("enabled");const c=()=>this._commandService.executeCommand(t===Nc.Increase?JU:XU);return n.add(new jje(o,c)),n.add(new Yje(o,c,[S.Enter,S.Space])),n}async updateMarkdownHoverPartVerbosityLevel(e,t,i=!0){const n=this._editor.getModel();if(!n)return;const r=this._getRenderedHoverPartAtIndex(t),o=r?.hoverPart.source;if(!r||!o?.supportsVerbosityAction(e))return;const a=await this._fetchHover(o,n,e);if(!a)return;const c=new ett(a,o.hoverProvider,o.hoverPosition),l=r.hoverPart,d=new b_(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(o=>o.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===Nc.Increase?1:-1;const r=e.hoverProvider,o=this._ongoingHoverOperations.get(r);o&&(o.tokenSource.cancel(),n+=o.verbosityDelta);const a=new li;this._ongoingHoverOperations.set(r,{verbosityDelta:n,tokenSource:a});const c={verbosityRequest:{verbosityDelta:n,previousHover:e.hover}};let l;try{l=await Promise.resolve(r.provideHover(t,e.hoverPosition,a.token,c))}catch(d){Nr(d)}return a.dispose(),this._ongoingHoverOperations.delete(r),l}_replaceRenderedHoverPartAtIndex(e,t,i){if(e>=this.renderedHoverParts.length||e<0)return;const n=this.renderedHoverParts[e],r=n.hoverElement,o=t.hoverElement,a=Array.from(o.children);r.replaceChildren(...a);const c=new MK(i,r,t.disposables);r.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 fOt(s,e,t,i,n){e.sort(Sc(o=>o.ordinal,ru));const r=[];for(const o of e)r.push(ttt(t,o,i,n,s.onContentsChanged));return new qM(r)}function ttt(s,e,t,i,n){const r=new Z,o=SF("div.hover-row"),a=SF("div.hover-row-contents");o.appendChild(a);const c=e.contents;for(const d of c){if(tW(d))continue;const h=SF("div.markdown-hover"),u=oe(h,SF("div.hover-contents")),f=r.add(new Z_({editor:s},t,i));r.add(f.onDidRenderAsync(()=>{u.className="hover-contents code-hover-contents",n()}));const p=r.add(f.render(d));u.appendChild(p.element),a.appendChild(h)}return{hoverPart:e,hoverElement:o,dispose(){r.dispose()}}}function itt(s,e){switch(e){case Nc.Increase:{const t=s.lookupKeybinding(JU);return t?g(5165,"Increase Hover Verbosity ({0})",t.getLabel()):g(5166,"Increase Hover Verbosity")}case Nc.Decrease:{const t=s.lookupKeybinding(XU);return t?g(5167,"Decrease Hover Verbosity ({0})",t.getLabel()):g(5168,"Decrease Hover Verbosity")}}}const ntt=[];function aG(s){ntt.push(s)}function pOt(){return ntt.slice(0)}class oNe{constructor(e,t){this._editorWorkerClient=new YTe(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,r=t.color,o=r.alpha,a=new me(new hn(Math.round(255*r.red),Math.round(255*r.green),Math.round(255*r.blue),o)),c=o?me.Format.CSS.formatRGB(a):me.Format.CSS.formatRGBA(a),l=o?me.Format.CSS.formatHSL(a):me.Format.CSS.formatHSLA(a),d=o?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 swe=class extends V{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new oNe(e,t)))}};swe=D([_(0,fi),_(1,zs),_(2,nt)],swe);aG(swe);async function stt(s,e,t,i=!0){return aNe(new mOt,s,e,t,i)}function rtt(s,e,t,i){return Promise.resolve(t.provideColorPresentations(s,e,i))}class mOt{constructor(){}async compute(e,t,i,n){const r=await e.provideDocumentColors(t,i);if(Array.isArray(r))for(const o of r)n.push({colorInfo:o,provider:e});return Array.isArray(r)}}class _Ot{constructor(){}async compute(e,t,i,n){const r=await e.provideDocumentColors(t,i);if(Array.isArray(r))for(const o of r)n.push({range:o.range,color:[o.color.red,o.color.green,o.color.blue,o.color.alpha]});return Array.isArray(r)}}class vOt{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const r=await e.provideColorPresentations(t,this.colorInfo,Ue.None);return Array.isArray(r)&&n.push(...r),Array.isArray(r)}}async function aNe(s,e,t,i,n){let r=!1,o;const a=[],c=e.ordered(t);for(let l=c.length-1;l>=0;l--){const d=c[l];if(d instanceof oNe)o=d;else try{await s.compute(d,t,i,a)&&(r=!0)}catch(h){Nr(h)}}return r?a:o&&n?(await s.compute(o,t,i,a),a):[]}function ott(s,e){const{colorProvider:t}=s.get(nt),i=s.get(fi).getModel(e);if(!i)throw Fi();const n=s.get(Te).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}vt.registerCommand("_executeDocumentColorProvider",function(s,...e){const[t]=e;if(!(t instanceof N))throw Fi();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:r}=ott(s,t);return aNe(new _Ot,n,i,Ue.None,r)});vt.registerCommand("_executeColorPresentationProvider",function(s,...e){const[t,i]=e,{uri:n,range:r}=i;if(!(n instanceof N)||!Array.isArray(t)||t.length!==4||!F.isIRange(r))throw Fi();const{model:o,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:c}=ott(s,n),[l,d,h,u]=t;return aNe(new vOt({range:r,color:{red:l,green:d,blue:h,alpha:u}}),a,o,Ue.None,c)});var rwe;const att=Object.create({});var YD;let QM=(YD=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 wY(this._editor),this._decoratorLimitReporter=new bOt,this._colorDecorationClassRefs=this._register(new Z),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:rwe.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(r=>{const o=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(x.defaultColorDecorators);const a=o!==this._isColorDecoratorsEnabled||r.hasChanged(x.colorDecoratorsLimit),c=r.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 Em,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Mo(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new Ys(!1),n=await stt(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){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((n,r)=>this._colorDatas.set(n,e[r]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(x.colorDecoratorsLimit);for(let r=0;rthis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},rwe=YD,YD.ID="editor.contrib.colorDetector",YD.RECOMPUTE_TIME=1e3,YD);QM=rwe=D([_(1,Te),_(2,nt),_(3,xp)],QM);class bOt{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(QM.ID,QM,ai.AfterFirstRender);class wOt{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=o.getColor(_Y)||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 SOt(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 SOt 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"),oe(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),oe(this._button,t),oe(t,np(".button"+He.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 AOt extends V{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=np(".colorpicker-body"),oe(e,this._domNode),this._saturationBox=new EOt(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 xOt(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 DOt(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 kOt(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 vy(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new me(new vy(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 vy(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 EOt 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=np(".saturation-wrap"),oe(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",oe(this._domNode,this._canvas),this.selection=np(".saturation-selection"),oe(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 LU);const t=So(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 vy(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 r=i.createLinearGradient(0,0,0,this._canvas.height);r.addColorStop(0,"rgba(0, 0, 0, 0)"),r.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=r,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 ctt 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=oe(e,np(".standalone-strip")),this.overlay=oe(this.domNode,np(".standalone-overlay"))):(this.domNode=oe(e,np(".strip")),this.overlay=oe(this.domNode,np(".overlay"))),this.slider=oe(this.domNode,np(".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 LU),i=So(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangeTop(r.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 xOt extends ctt{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,r=new me(new hn(t,i,n,1)),o=new me(new hn(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${r} 0%, ${o} 100%)`}getValue(e){return e.hsva.a}}class DOt extends ctt{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class kOt extends V{constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=oe(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 Zse=class Zse extends _d{constructor(e,t,i,n,r=!1){super(),this.model=t,this.pixelRatio=i,this._register(W8.getInstance(lt(e)).onDidChange(()=>this.layout())),this._domNode=np(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new COt(this._domNode,this.model,n,r)),this.body=this._register(new AOt(this._domNode,this.model,this.pixelRatio,r))}getId(){return Zse.ID}layout(){this.body.layout()}get domNode(){return this._domNode}};Zse.ID="editor.contrib.colorPickerWidget";let owe=Zse;class IOt{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===uu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let s9=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Yd.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=QM.get(this._editor);if(!n)return[];for(const r of t){if(!n.isColorDecoration(r))continue;const o=n.getColorData(r.range.getStartPosition());if(o)return[await ltt(this,this._editor.getModel(),o.colorInfo,o.provider)]}return[]}renderHoverParts(e,t){const i=dtt(this,this._editor,this._themeService,t,e);if(!i)return new qM([]);this._colorPicker=i.colorPicker;const n={hoverPart:i.hoverPart,hoverElement:this._colorPicker.domNode,dispose(){i.disposables.dispose()}};return new qM([n])}getAccessibleContent(e){return g(5040,"There is a color picker here.")}handleResize(){this._colorPicker?.layout()}isColorPickerVisible(){return!!this._colorPicker}};s9=D([_(1,mn)],s9);class TOt{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let r9=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()||!QM.get(this._editor))return null;const r=await stt(i,this._editor.getModel(),Ue.None);let o=null,a=null;for(const h of r){const u=h.colorInfo;F.containsRange(u.range,e.range)&&(o=u,a=h.provider)}const c=o??e,l=a??t,d=!!o;return{colorHover:await ltt(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 yQ(this._editor.getModel(),t,this._color,i,e),i=htt(this._editor,i,t))}renderHoverParts(e,t){return dtt(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};r9=D([_(1,mn)],r9);async function ltt(s,e,t,i){const n=e.getValueInRange(t.range),{red:r,green:o,blue:a,alpha:c}=t.color,l=new hn(Math.round(r*255),Math.round(o*255),Math.round(a*255),c),d=new me(l),h=await rtt(e,t,i,Ue.None),u=new wOt(d,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(d,n),s instanceof s9?new IOt(s,F.lift(t.range),u,i):new TOt(s,F.lift(t.range),u,i)}function dtt(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 wn(302,u))}const r=new Z,o=i[0],a=e.getModel(),c=o.model,l=r.add(new owe(n.fragment,c,e.getOption(x.pixelRatio),t,s instanceof r9));let d=!1,h=new F(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn);if(s instanceof r9){const u=o.model.color;s.color=u,yQ(a,c,u,h,o),r.add(c.onColorFlushed(f=>{s.color=f}))}else r.add(c.onColorFlushed(async u=>{await yQ(a,c,u,h,o),d=!0,h=htt(e,h,c)}));return r.add(c.onDidChangeColor(u=>{yQ(a,c,u,h,o)})),r.add(e.onDidChangeModelContent(u=>{d?d=!1:(n.hide(),e.focus())})),{hoverPart:o,colorPicker:l,disposables:r}}function htt(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 r=F.lift(n.range),o=s.getModel()._setTrackedRange(null,r,si.GrowsOnlyWhenTypingAfter);return s.executeEdits("colorpicker",i),s.pushUndoStop(),s.getModel()._getTrackedRange(o)??r}async function yQ(s,e,t,i,n){const r=await rtt(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,Ue.None);e.colorPresentations=r||[]}class utt{constructor(e,t){this.range=e,this.direction=t}}class cNe{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new cNe(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){Nr(t),this._isResolved=!1}}}const oO=class oO{static async create(e,t,i,n){const r=[],o=e.ordered(t).reverse().map(a=>i.map(async c=>{try{const l=await a.provideInlayHints(t,c,n);(l?.hints.length||a.onDidChangeInlayHints)&&r.push([l??oO._emptyInlayHintList,a])}catch(l){Nr(l)}}));if(await Promise.all(o.flat()),n.isCancellationRequested||t.isDisposed())throw new Pa;return new oO(i,r,t)}constructor(e,t,i){this._disposables=new Z,this.ranges=e,this.provider=new Set;const n=[];for(const[r,o]of t){this._disposables.add(r),this.provider.add(o);for(const a of r.hints){const c=i.validatePosition(a.position);let l="before";const d=oO._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 cNe(a,new utt(h,l),o))}}this.items=n.sort((r,o)=>re.compare(r.hint.position,o.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 r=e.tokenization.getLineTokens(i),o=t.column-1,a=r.findTokenIndexAtOffset(o);let c=r.getStartOffset(a),l=r.getEndOffset(a);return l-c===1&&(c===o&&a>1?(c=r.getStartOffset(a-1),l=r.getEndOffset(a-1)):l===o&&a{if(this._ignoreEditorChange)return;const o=this._editorService.getActiveCodeEditor();if(!o)return;const a=o.getModel(),c=o.getPosition();if(!a||!c)return;let l=!1,d=!1;for(const h of t.references)if(Yi(h.uri,a.uri))l=!0,d=d||F.containsPosition(h.range,c);else if(l)break;(!l||!d)&&this.reset()});this._currentState=Yo(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:dA.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)}};awe=D([_(0,Le),_(1,qt),_(2,wi),_(3,Vt)],awe);ce(Rce,awe,Qt.Delayed);Qe(new class extends uc{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:lNe,kbOpts:{weight:Ae.EditorContrib,primary:S.F12}})}runEditorCommand(s,e){return s.get(Rce).revealNext(e)}});Sr.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:Ae.EditorContrib,when:lNe,primary:S.Escape,handler(s){s.get(Rce).reset()}});let cwe=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(),wt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Yo(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)}};cwe=D([_(0,qt)],cwe);function lwe(s,e){return e.uri.scheme===s.uri.scheme?!0:!R8(e.uri,pe.walkThroughSnippet,pe.vscodeChatCodeBlock,pe.vscodeChatCodeCompareBlock,pe.vscodeCopilotBackingChatCodeBlock)}async function cG(s,e,t,i,n){const o=t.ordered(s,i).map(c=>Promise.resolve(n(c,s,e)).then(void 0,l=>{Nr(l)})),a=await Promise.all(o);return Oi(a.flat()).filter(c=>lwe(s,c))}function lG(s,e,t,i,n){return cG(e,t,s,i,(r,o,a)=>r.provideDefinition(o,a,n))}function dNe(s,e,t,i,n){return cG(e,t,s,i,(r,o,a)=>r.provideDeclaration(o,a,n))}function hNe(s,e,t,i,n){return cG(e,t,s,i,(r,o,a)=>r.provideImplementation(o,a,n))}function uNe(s,e,t,i,n){return cG(e,t,s,i,(r,o,a)=>r.provideTypeDefinition(o,a,n))}function dG(s,e,t,i,n,r){return cG(e,t,s,n,async(o,a,c)=>{const l=(await o.provideReferences(a,c,{includeDeclaration:!0},r))?.filter(h=>lwe(a,h));if(!i||!l||l.length!==2)return l;const d=(await o.provideReferences(a,c,{includeDeclaration:!1},r))?.filter(h=>lwe(a,h));return d&&d.length===1?d:l})}async function wC(s){const e=await s(),t=new cf(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}lg("_executeDefinitionProvider",(s,e,t)=>{const i=s.get(nt),n=lG(i.definitionProvider,e,t,!1,Ue.None);return wC(()=>n)});lg("_executeDefinitionProvider_recursive",(s,e,t)=>{const i=s.get(nt),n=lG(i.definitionProvider,e,t,!0,Ue.None);return wC(()=>n)});lg("_executeTypeDefinitionProvider",(s,e,t)=>{const i=s.get(nt),n=uNe(i.typeDefinitionProvider,e,t,!1,Ue.None);return wC(()=>n)});lg("_executeTypeDefinitionProvider_recursive",(s,e,t)=>{const i=s.get(nt),n=uNe(i.typeDefinitionProvider,e,t,!0,Ue.None);return wC(()=>n)});lg("_executeDeclarationProvider",(s,e,t)=>{const i=s.get(nt),n=dNe(i.declarationProvider,e,t,!1,Ue.None);return wC(()=>n)});lg("_executeDeclarationProvider_recursive",(s,e,t)=>{const i=s.get(nt),n=dNe(i.declarationProvider,e,t,!0,Ue.None);return wC(()=>n)});lg("_executeReferenceProvider",(s,e,t)=>{const i=s.get(nt),n=dG(i.referenceProvider,e,t,!1,!1,Ue.None);return wC(()=>n)});lg("_executeReferenceProvider_recursive",(s,e,t)=>{const i=s.get(nt),n=dG(i.referenceProvider,e,t,!1,!0,Ue.None);return wC(()=>n)});lg("_executeImplementationProvider",(s,e,t)=>{const i=s.get(nt),n=hNe(i.implementationProvider,e,t,!1,Ue.None);return wC(()=>n)});lg("_executeImplementationProvider_recursive",(s,e,t)=>{const i=s.get(nt),n=hNe(i.implementationProvider,e,t,!0,Ue.None);return wC(()=>n)});Yn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextPeek,title:g(1409,"Peek"),group:"navigation",order:100});class IW{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof IW||re.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const t_=class t_ extends mf{static all(){return t_._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of ui.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(t_._patchConfig(t)),this.configuration=e,t_._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const r=e.get(wi),o=e.get(qt),a=e.get(nE),c=e.get(Rce),l=e.get(nt),d=e.get(we),h=t.getModel(),u=t.getPosition(),f=IW.is(i)?i:new IW(h,u),p=new nI(t,jr.Value|jr.Position),m=$_(this._getLocationModel(l,f.model,f.position,p.token),p.token).then(async v=>{if(!v||p.token.isCancellationRequested)return;No(v.ariaMessage);let b;if(v.referenceAt(h.uri,u)){const y=this._getAlternativeCommand(t);!t_._activeAlternativeCommands.has(y)&&t_._allSymbolNavigationCommands.has(y)&&(b=t_._allSymbolNavigationCommands.get(y))}const w=v.references.length;if(w===0){if(!this.configuration.muteMessage){const y=h.getWordAtPosition(u);Mh.get(t)?.showMessage(this._getNoResultFoundMessage(y),u)}}else if(w===1&&b)t_._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(y=>b.runEditorCommand(y,t,i,n).finally(()=>{t_._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(o,c,t,v,n)},v=>{r.error(v)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,r){const o=this._getGoToPreference(i);if(!(i instanceof uf)&&(this.configuration.openInPeek||o==="peek"&&n.references.length>1))this._openInPeek(i,n,r);else{const a=n.firstReference(),c=n.references.length>1&&o==="gotoAndPeek",l=await this._openReference(i,e,a,this.configuration.openToSide,!c);c&&l?this._openInPeek(l,n,r):n.dispose(),o==="goto"&&t.put(a)}}async _openReference(e,t,i,n,r){let o;if(BKe(i)&&(o=i.targetSelectionRange),o||(o=i.range),!o)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:F.collapseToStart(o),selectionRevealType:dA.NearTopIfOutsideViewport,selectionSource:Lb.JUMP}},e,n);if(a){if(r){const c=a.getModel(),l=a.createDecorationsCollection([{range:o,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===c&&l.clear()},350)}return a}}_openInPeek(e,t,i){const n=HM.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Mo(r=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};t_._allSymbolNavigationCommands=new Map,t_._activeAlternativeCommands=new Set;let VA=t_;class hG extends VA{async _getLocationModel(e,t,i,n){return new cf(await lG(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 JD;Et((JD=class extends hG{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:JD.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}]}),vt.registerCommandAlias("editor.action.goToDeclaration",JD.id)}},JD.id="editor.action.revealDefinition",JD));var XD;Et((XD=class extends hG{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:XD.id,title:Pe(1415,"Open Definition to the Side"),precondition:he.and(J.hasDefinitionProvider,J.isInEmbeddedEditor.toNegated()),keybinding:[{when:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,S.F12),weight:Ae.EditorContrib},{when:he.and(J.editorTextFocus,IRe),primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.F12),weight:Ae.EditorContrib}]}),vt.registerCommandAlias("editor.action.openDeclarationToTheSide",XD.id)}},XD.id="editor.action.revealDefinitionAside",XD));var ZD;Et((ZD=class extends hG{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:ZD.id,title:Pe(1416,"Peek Definition"),precondition:he.and(J.hasDefinitionProvider,og.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}}),vt.registerCommandAlias("editor.action.previewDeclaration",ZD.id)}},ZD.id="editor.action.peekDefinition",ZD));class ftt extends VA{async _getLocationModel(e,t,i,n){return new cf(await dNe(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 UL;Et((UL=class extends ftt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:UL.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")}},UL.id="editor.action.revealDeclaration",UL));Et(class extends ftt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Pe(1422,"Peek Declaration"),precondition:he.and(J.hasDeclarationProvider,og.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:3}})}});class ptt extends VA{async _getLocationModel(e,t,i,n){return new cf(await uNe(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 VL;Et((VL=class extends ptt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:VL.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}]})}},VL.ID="editor.action.goToTypeDefinition",VL));var zL;Et((zL=class extends ptt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:zL.ID,title:Pe(1428,"Peek Type Definition"),precondition:he.and(J.hasTypeDefinitionProvider,og.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:4}})}},zL.ID="editor.action.peekTypeDefinition",zL));class mtt extends VA{async _getLocationModel(e,t,i,n){return new cf(await hNe(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 $L;Et(($L=class extends mtt{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:$L.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}]})}},$L.ID="editor.action.goToImplementation",$L));var GL;Et((GL=class extends mtt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:GL.ID,title:Pe(1434,"Peek Implementations"),precondition:he.and(J.hasImplementationProvider,og.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}})}},GL.ID="editor.action.peekImplementation",GL));class _tt extends VA{_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}}Et(class extends _tt{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,og.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 cf(await dG(e.referenceProvider,t,i,!0,!1,n),g(1439,"References"))}});Et(class extends _tt{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Pe(1440,"Peek References"),precondition:he.and(J.hasReferenceProvider,og.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new cf(await dG(e.referenceProvider,t,i,!1,!1,n),g(1439,"References"))}});class LOt extends VA{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:Pe(1441,"Go to Any Symbol"),precondition:he.and(og.notInPeekEditor,J.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new cf(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""}}vt.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:re.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,r,o)=>{Lt(N.isUri(e)),Lt(re.isIPosition(t)),Lt(Array.isArray(i)),Lt(typeof n>"u"||typeof n=="string"),Lt(typeof o>"u"||typeof o=="boolean");const a=s.get(qt),c=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(jo(c))return c.setPosition(t),c.revealPositionInCenterIfOutsideViewport(t,_t.Smooth),c.invokeWithinContext(l=>{const d=new class extends LOt{_getNoResultFoundMessage(h){return r||super._getNoResultFoundMessage(h)}}({muteMessage:!r,openInPeek:!!o,openToSide:!1},i,n);l.get(we).invokeFunction(d.run.bind(d),c)})}});vt.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:re.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(bi).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});vt.registerCommand({id:"editor.action.findReferences",handler:(s,e,t)=>{Lt(N.isUri(e)),Lt(re.isIPosition(t));const i=s.get(nt),n=s.get(qt);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(r=>{if(!jo(r)||!r.hasModel())return;const o=HM.get(r);if(!o)return;const a=Mo(l=>dG(i.referenceProvider,r.getModel(),re.lift(t),!1,!1,l).then(d=>new cf(d,g(1439,"References")))),c=new F(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(o.toggleWidget(c,a,!1))})}});vt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function ROt(s,e,t,i){const n=s.get(pn),r=s.get(lo),o=s.get(bi),a=s.get(we),c=s.get(wi);if(await i.item.resolve(Ue.None),!i.part.location)return;const l=i.part.location,d=[],h=new Set(Yn.getMenuItems(_e.EditorContext).map(f=>ET(f)?f.command.id:ao()));for(const f of VA.all())h.has(f.desc.id)&&d.push(new an(f.desc.id,Ac.label(f.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await n.createModelReference(l.uri);try{const m=new IW(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 Eo),d.push(new an(f.id,f.title,void 0,!0,async()=>{try{await o.executeCommand(f.id,...f.arguments??[])}catch(p){c.notify({severity:Ze.Error,source:i.item.provider.displayName,message:p})}}))}const u=e.getOption(x.useShadowDOM);r.showContextMenu({domForShadowRoot:u?e.getDomNode()??void 0:void 0,getAnchor:()=>{const f=So(t);return{x:f.left,y:f.top+f.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function vtt(s,e,t,i){const r=await s.get(pn).createModelReference(i.uri);await t.invokeWithinContext(async o=>{const a=e.hasSideBySideModifier,c=o.get(Le),l=og.inPeekEditor.getValue(c),d=!a&&t.getOption(x.definitionLinkOpensInPeek)&&!l;return new hG({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(o,new IW(r.object.textEditorModel,F.getStartPosition(i.range)),F.lift(i.range))}),r.dispose()}var VP;class FX{constructor(){this._entries=new pm(50)}get(e){const t=FX._key(e);return this._entries.get(t)}set(e,t){const i=FX._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const btt=ae("IInlayHintsCache");ce(btt,FX,Qt.Delayed);class dwe{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 MOt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}var PC;(function(s){s[s.Normal=0]="Normal",s[s.Invisible=1]="Invisible"})(PC||(PC={}));var $S;let TW=($S=class{static get(e){return e.getContribution(VP.ID)??void 0}constructor(e,t,i,n,r,o,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=r,this._notificationService=o,this._instaService=a,this._disposables=new Z,this._sessionDisposables=new Z,this._decorationsMetadata=new Map,this._ruleFactory=new wY(this._editor),this._activeRenderMode=PC.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=PC.Normal;else{let a,c;e.enabled==="onUnlessPressed"?(a=PC.Normal,c=PC.Invisible):(a=PC.Invisible,c=PC.Normal),this._activeRenderMode=a,this._sessionDisposables.add(bb.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),o.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 r=new Set,o=new ln(async()=>{const a=Date.now();n?.dispose(!0),n=new li;const c=t.onWillDispose(()=>n?.cancel());try{const l=n.token,d=await PX.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),l);if(o.delay=this._debounceInfo.update(t,Date.now()-a),l.isCancellationRequested){d.dispose();return}for(const h of d.provider)typeof h.onDidChangeInlayHints=="function"&&!r.has(h)&&(r.add(h),this._sessionDisposables.add(h.onDidChangeInlayHints(()=>{o.isScheduled()||o.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(l){bt(l)}finally{n.dispose(),c.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(o),this._sessionDisposables.add(Ee(()=>n?.dispose(!0))),o.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!o.isScheduled())&&o.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{n?.cancel();const c=Math.max(o.delay,1250);o.schedule(c)})),this._sessionDisposables.add(this._installDblClickGesture(()=>o.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Z,t=e.add(new Tce(this._editor)),i=new Z;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(n=>{const[r]=n,o=this._getInlayHintLabelPart(r),a=this._editor.getModel();if(!o||!a){i.clear();return}const c=new li;i.add(Ee(()=>c.dispose(!0))),o.item.resolve(c.token),this._activeInlayHintPart=o.part.command||o.part.location?new MOt(o,r.hasTriggerModifier):void 0;const l=a.validatePosition(o.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 r=this._getInlayHintLabelPart(n);if(r){const o=r.part;o.location?this._instaService.invokeFunction(vtt,n,this._editor,o.location):jj.is(o.command)&&await this._invokeCommand(o.command,r.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(Ue.None),tr(i.item.hint.textEdits))){const n=i.item.hint.textEdits.map(r=>es.replace(F.lift(r.range),r.text));this._editor.executeEdits("inlayHint.default",n),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!Jo(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(ROt,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 Gk&&t?.attachedData instanceof dwe)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:Ze.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 r=e.getDecorationRange(i);if(r){const o=new utt(r,n.item.anchor.direction),a=n.item.with({anchor:o});t.set(n.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),n=[];for(const r of i.sort(F.compareRangesUsingStarts)){const o=t.validateRange(new F(r.startLineNumber-30,r.startColumn,r.endLineNumber+30,r.endColumn));n.length===0||!F.areIntersectingOrTouching(n[n.length-1],o)?n.push(o):n[n.length-1]=F.plusRange(n[n.length-1],o)}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:si.AlwaysGrowsWhenTypingAtEdges,[p.anchor.direction]:this._activeRenderMode===PC.Normal?y:void 0}}})},r=(p,m)=>{const v=this._ruleFactory.createClassNameRef({width:`${o/3|0}px`,display:"inline-block"});n(p,v," ",m?S_.Right:S_.None)},{fontSize:o,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>VP._MAX_LABEL_LEN)continue;p.hint.paddingLeft&&r(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),NOt(A),y&&!p.hint.paddingRight?S_.Right:S_.None,new dwe(p,v)),L)break}if(p.hint.paddingRight&&r(p,!0),i.length>VP._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=ym.capture(this._editor);this._editor.changeDecorations(p=>{const m=p.deltaDecorations(u,i.map(v=>v.decoration));for(let v=0;vi)&&(r=i);const o=e.fontFamily||n;return{fontSize:r,fontFamily:o,padding:t,isUniform:!t&&o===n&&r===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 r=this._decorationsMetadata.get(n.id);r&&!t.has(r.item.hint)&&(t.add(r.item.hint),i.push(r.item))}return i}},VP=$S,$S.ID="editor.contrib.InlayHints",$S._MAX_DECORATORS=1500,$S._MAX_LABEL_LEN=43,$S);TW=VP=D([_(1,nt),_(2,xp),_(3,btt),_(4,bi),_(5,wi),_(6,we)],TW);function NOt(s){return s.replace(/[ \t]/g," ")}vt.registerCommand("_executeInlayHintProvider",async(s,...e)=>{const[t,i]=e;Lt(N.isUri(t)),Lt(F.isIRange(i));const{inlayHintsProvider:n}=s.get(nt),r=await s.get(pn).createModelReference(t);try{const o=await PX.create(n,r.object.textEditorModel,[F.lift(i)],Ue.None),a=o.items.map(c=>c.hint);return setTimeout(()=>o.dispose(),0),a}finally{r.dispose()}});class qUe extends wQ{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let OX=class extends n9{constructor(e,t,i,n,r,o,a,c,l){super(e,t,i,o,c,n,r,l),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!TW.get(this._editor)||e.target.type!==Mt.CONTENT_TEXT)return null;const i=e.target.detail.injectedText?.options;return i instanceof Gk&&i.attachedData instanceof dwe?new qUe(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof qUe?new Yd(async n=>{const{part:r}=e;if(await r.item.resolve(i),i.isCancellationRequested)return;let o;typeof r.item.hint.tooltip=="string"?o=new Nt().appendText(r.item.hint.tooltip):r.item.hint.tooltip&&(o=r.item.hint.tooltip),o&&n.emitOne(new b_(this,e.range,[o],!1,0)),tr(r.item.hint.textEdits)&&n.emitOne(new b_(this,e.range,[new Nt().appendText(g(5175,"Double-click to insert"))],!1,10001));let a;if(typeof r.part.tooltip=="string"?a=new Nt().appendText(r.part.tooltip):r.part.tooltip&&(a=r.part.tooltip),a&&n.emitOne(new b_(this,e.range,[a],!1,1)),r.part.location||r.part.command){let l;const h=this._editor.getOption(x.multiCursorModifier)==="altKey"?jt?g(5176,"cmd + click"):g(5177,"ctrl + click"):jt?g(5178,"option + click"):g(5179,"alt + click");r.part.location&&r.part.command?l=new Nt().appendText(g(5180,"Go to Definition ({0}), right click for more",h)):r.part.location?l=new Nt().appendText(g(5181,"Go to Definition ({0})",h)):r.part.command&&(l=new Nt(`[${g(5182,"Execute Command")}](${gtt(r.part.command)} "${r.part.command.title}") (${h})`,{isTrusted:!0})),l&&n.emitOne(new b_(this,e.range,[l],!1,1e4))}const c=await this._resolveInlayHintLabelPartHover(r,i);for await(const l of c)n.emitOne(l)}):Yd.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return Yd.EMPTY;const{uri:i,range:n}=e.part.location,r=await this._resolverService.createModelReference(i);try{const o=r.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(o)?rNe(this._languageFeaturesService.hoverProvider,o,new re(n.startLineNumber,n.startColumn),t).filter(a=>!tW(a.hover.contents)).map(a=>new b_(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Yd.EMPTY}finally{r.dispose()}}};OX=D([_(1,Di),_(2,Ar),_(3,Vt),_(4,tc),_(5,Te),_(6,pn),_(7,nt),_(8,bi)],OX);class gNe extends V{constructor(e,t,i,n,r,o){super();const a=t.anchor,c=t.hoverParts;this._renderedHoverParts=this._register(new hwe(e,i,c,o,r));const{showAtPosition:l,showAtSecondaryPosition:d}=gNe.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 re(u.startLineNumber,f);n=h.convertViewPositionToModelPosition(p).column}const r=t.startLineNumber;let o=t.startColumn,a;for(const d of i){const h=d.range,u=h.startLineNumber===r,f=h.endLineNumber===r;if(u&&f){const m=h.startColumn,v=Math.min(o,m);o=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 re(r,o);return{showAtPosition:c,showAtSecondaryPosition:l}}}class POt{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 ere=class ere extends V{constructor(e,t,i,n,r){super(),this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=r,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,r,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 r of t){const o=r.range;i=F.plusRange(i,o)}const n=e.createDecorationsCollection();return n.set([{range:i,options:ere._DECORATION_OPTIONS}]),Ee(()=>{n.clear()})}_renderParts(e,t,i,n){const r=new NX(n),o={fragment:this._fragment,statusBar:r,...i},a=new Z;for(const l of e){const d=this._renderHoverPartsForParticipant(t,l,o);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,r);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(o=>o.owner===t);return n.length>0?t.renderHoverParts(i,n):new qM([])}_renderStatusBar(e,t){if(t.hasContent)return new POt(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,r=>{r.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(ue(n,ke.FOCUS_OUT,r=>{r.stopPropagation(),this._focusedHoverPartIndex=-1}))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(i=>i instanceof n9&&!(i instanceof OX));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(i=>i instanceof s9)}focusHoverPartWithIndex(e){e<0||e>=this._renderedParts.length||this._renderedParts[e].hoverElement.focus()}getAccessibleContent(){const e=[];for(let t=0;to.type==="hoverPart"&&o.participant===e);if(r===-1)throw new Pi;return t-r}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}};ere._DECORATION_OPTIONS=Kt.register({description:"content-hover-highlight",className:"hoverHighlight"});let hwe=ere,uwe=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(RX,this._editor)),this._participants=this._initializeHoverParticipants(),this._computer=new MX(this._editor,this._participants),this._hoverOperation=this._register(new Jet(this._editor,this._computer)),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of JN.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 Xet(this._computer.anchor,t,e.isComplete))})),this._register(Rr(this._contentHoverWidget.getDomNode(),"keydown",e=>{e.equals(S.Escape)&&this.hide()})),this._register(La.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,i,n,r){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=r&&this._contentHoverWidget.isMouseGettingCloser(r.event.posx,r.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,r){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=r,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,r=this._computer.insistOnKeepingHoverVisible;n&&r||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover=new gNe(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,lC.Delayed,UA.Mouse,!1,e);const r=i[0];return this._startShowingOrUpdateHover(r,lC.Delayed,UA.Mouse,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const n of this._participants){if(!n.suggestHoverAnchor)continue;const r=n.suggestHoverAnchor(e);r&&t.push(r)}const i=e.target;switch(i.type){case Mt.CONTENT_TEXT:{t.push(new _ue(0,i.range,e.event.posx,e.event.posy));break}case Mt.CONTENT_EMPTY:{const n=this._editor.getOption(x.fontInfo).typicalHalfwidthCharacterWidth/2;if(!(!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTextr.priority-n.priority),t}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new _ue(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}};uwe=D([_(1,we),_(2,Vt)],uwe);var FOt=".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)}";gt(FOt,{});class OOt{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=j_.Center}computeSync(){const e=r=>({value:r}),t=this._editor.getLineDecorations(this._lineNumber),i=[],n=this._laneOrLine==="lineNo";if(!t)return i;for(const r of t){const o=r.options.glyphMargin?.position??j_.Center;if(!n&&o!==this._laneOrLine)continue;const a=n?r.options.lineNumberHoverMessage:r.options.glyphMarginHoverMessage;!a||tW(a)||i.push(...z_(a).map(e))}return i}}const QUe=fe,tre=class tre 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 jLe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Z_({editor:this._editor},t,i)),this._computer=new OOt(this._editor),this._hoverOperation=this._register(new Jet(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 tre.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(lC.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(lC.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 r=QUe("div.hover-row.markdown-hover"),o=oe(r,QUe("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));o.appendChild(a.element),i.appendChild(r)}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(),r=this._editor.getOption(x.lineHeight),o=this._hover.containerDomNode.clientHeight,a=i-n-(o-r)/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`}};tre.ID="editor.contrib.modesGlyphHoverWidget";let BX=tre;var gwe;const BOt=!1;var AF;(function(s){s[s.Content=0]="Content",s[s.Glyph=1]="Glyph"})(AF||(AF={}));var KL;let Fa=(KL=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 ln(()=>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(gwe.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===BX.ID:!1}_isMouseOnContentHoverWidget(e){const t=e.target;return t?t.type===Mt.CONTENT_WIDGET&&t.detail===RX.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},r=a=>{const c=this._isMouseOnContentHoverWidget(a),l=this._contentWidget?.isColorPickerVisible;return c&&l},o=(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)||r(e)||o(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),r=this._hoverSettings.enabled,o=this._hoverState.activatedByDecoratorClick;if(i&&(n==="click"&&!o||n==="hover"&&!r&&!BOt||n==="clickAndHover"&&!r&&!o)||!i&&!r&&!o){this._hideWidgets();return}this._tryShowHoverWidget(e,AF.Content)||this._tryShowHoverWidget(e,AF.Glyph)||this._hideWidgets()}_tryShowHoverWidget(e,t){const i=this._getOrCreateContentWidget(),n=this._getOrCreateGlyphWidget();let r,o;switch(t){case AF.Content:r=i,o=n;break;case AF.Glyph:r=n,o=i;break;default:throw new Error(`HoverWidgetType ${t} is unrecognized`)}const a=r.showsOrWillShow(e);return a&&o.hide(),a}_onKeyDown(e){if(!this._editor.hasModel())return;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===of.MoreChordsNeeded||t.kind===of.KbFound&&(t.commandId===Yet||t.commandId===JU||t.commandId===XU)&&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||AW.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._glyphWidget?.hide(),this._contentWidget?.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(uwe,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(BX,this._editor)),this._glyphWidget}hideContentHover(){this._hideWidgets()}showContentHover(e,t,i,n,r=!1){this._hoverState.activatedByDecoratorClick=r,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()}},gwe=KL,KL.ID="editor.contrib.hover",KL);Fa=gwe=D([_(1,we),_(2,Vt)],Fa);const WOt=new Q("commentEditorFocused",!1),q5=5*18,HOt=25*18;let LW=class extends Kk{constructor(e,t,i,n,r,o,a,c,l,d,h,u){const f={contributions:[{id:BA.ID,ctor:BA,instantiation:ai.BeforeFirstInteraction},{id:Hb.ID,ctor:Hb,instantiation:ai.BeforeFirstInteraction},{id:tf.ID,ctor:tf,instantiation:ai.Eager},{id:pc.ID,ctor:pc,instantiation:ai.Lazy},{id:HA.ID,ctor:HA,instantiation:ai.Eager},{id:aC.ID,ctor:aC,instantiation:ai.Lazy},...dp.getSomeEditorContributions([cC.ID,KM.ID,kW.ID,Mh.ID,Fa.ID,Lce,mu.ID,GM.ID])],contextMenuId:_e.SimpleEditorContext};super(e,t,f,r,o,a,i,c,l,d,h,u),this._commentEditorFocused=WOt.bindTo(i),this._commentEditorEmpty=I_.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 dp.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")}}};LW=D([_(4,we),_(5,qt),_(6,bi),_(7,mn),_(8,wi),_(9,_o),_(10,zs),_(11,nt)],LW);function wtt(s,e,t){const i=e.getLayoutInfo(),n=e.getOption(x.lineHeight),r=e._getViewModel()?.getLineCount()*n;if(r>i.height||rq5){const o=Math.ceil((r-i.height)/n),a=i.height+n*o;return qa(a,q5,qa(s.getLayoutInfo().height-90,q5,HOt))}return t}var XC;(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"})(XC||(XC={}));const ire=class ire extends di{constructor(){super({id:ire.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=!Uk.getTabFocusMode();Uk.setTabFocusMode(t),No(t?g(1572,"Pressing Tab will now move focus to the next focusable element"):g(1573,"Pressing Tab will now insert the tab character"))}};ire.ID="editor.action.toggleTabFocusMode";let WX=ire;Et(WX);var WE;(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}.",``)})(WE||(WE={}));const UOt="revealInExplorer",VOt="workbench.action.files.revert",zOt="workbench.action.files.saveAs";Pe(5378,"Save As...");const $Ot="workbench.action.files.save";Pe(5379,"Save");const GOt="workbench.action.files.saveWithoutFormatting";Pe(5380,"Save without Formatting");const KOt="saveAll";Pe(5381,"Save All");const ytt="workbench.files.action.saveAllInGroup",qOt="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 QOt="workbench.action.files.newUntitledFile";Pe(5383,"New Untitled Text File");let jUe=class extends V{onClose(){this._editor.focus()}constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._contextKeyService=i,this.id=Wb.Editor,this.options={type:Sm.Help,readMoreUrl:"https://go.microsoft.com/fwlink/?linkid=851010"},this.verbositySettingKey=bo.Editor}provideContent(){const e=this._editor.getOptions(),t=[];e.get(x.inDiffEditor)?e.get(x.readOnly)?t.push(Lg.readonlyDiffEditor):t.push(Lg.editableDiffEditor):e.get(x.readOnly)?t.push(Lg.readonlyEditor):t.push(Lg.editableEditor),t.push(Lg.listSignalSounds),t.push(Lg.listAlerts);const i=jOt(this._keybindingService,this._contextKeyService);i&&t.push(i);const n=Ctt(this._keybindingService,this._contextKeyService,this._editor);return n&&t.push(n),e.get(x.stickyScroll).enabled&&t.push(Lg.stickScroll),e.get(x.tabFocusMode)?t.push(Lg.tabFocusModeOnMsg):t.push(Lg.tabFocusModeOffMsg),t.push(Lg.setBreakpoint),t.push(Lg.debugExecuteSelection),t.join(` +`)}return t.participant.getAccessibleContent(t.hoverPart)}async updateHoverVerbosityLevel(e,t,i){if(!this._markdownHoverParticipant)return;const n=this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant,t);if(n===void 0)return;const r=await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(e,n,i);r&&(this._renderedParts[t]={type:"hoverPart",participant:this._markdownHoverParticipant,hoverPart:r.hoverPart,hoverElement:r.hoverElement},this._context.onContentsChanged())}doesHoverAtIndexSupportVerbosityAction(e,t){if(!this._markdownHoverParticipant)return!1;const i=this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant,e);return i===void 0?!1:this._markdownHoverParticipant.doesMarkdownHoverAtIndexSupportVerbosityAction(i,t)}isColorPickerVisible(){return this._colorHoverParticipant?.isColorPickerVisible()??!1}_normalizedIndexToMarkdownHoverIndexRange(e,t){const i=this._renderedParts[t];if(!i||i.type!=="hoverPart"||!(i.participant===e))return;const r=this._renderedParts.findIndex(o=>o.type==="hoverPart"&&o.participant===e);if(r===-1)throw new Pi;return t-r}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}};ere._DECORATION_OPTIONS=Kt.register({description:"content-hover-highlight",className:"hoverHighlight"});let hwe=ere,uwe=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(RX,this._editor)),this._participants=this._initializeHoverParticipants(),this._computer=new MX(this._editor,this._participants),this._hoverOperation=this._register(new Jet(this._editor,this._computer)),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of JN.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 Xet(this._computer.anchor,t,e.isComplete))})),this._register(Rr(this._contentHoverWidget.getDomNode(),"keydown",e=>{e.equals(S.Escape)&&this.hide()})),this._register(La.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,i,n,r){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=r&&this._contentHoverWidget.isMouseGettingCloser(r.event.posx,r.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,r){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=r,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,r=this._computer.insistOnKeepingHoverVisible;n&&r||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover=new gNe(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,lC.Delayed,UA.Mouse,!1,e);const r=i[0];return this._startShowingOrUpdateHover(r,lC.Delayed,UA.Mouse,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const n of this._participants){if(!n.suggestHoverAnchor)continue;const r=n.suggestHoverAnchor(e);r&&t.push(r)}const i=e.target;switch(i.type){case Mt.CONTENT_TEXT:{t.push(new _ue(0,i.range,e.event.posx,e.event.posy));break}case Mt.CONTENT_EMPTY:{const n=this._editor.getOption(x.fontInfo).typicalHalfwidthCharacterWidth/2;if(!(!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTextr.priority-n.priority),t}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new _ue(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}};uwe=D([_(1,we),_(2,Vt)],uwe);var FOt=".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)}";gt(FOt,{});class OOt{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=j_.Center}computeSync(){const e=r=>({value:r}),t=this._editor.getLineDecorations(this._lineNumber),i=[],n=this._laneOrLine==="lineNo";if(!t)return i;for(const r of t){const o=r.options.glyphMargin?.position??j_.Center;if(!n&&o!==this._laneOrLine)continue;const a=n?r.options.lineNumberHoverMessage:r.options.glyphMarginHoverMessage;!a||tW(a)||i.push(...z_(a).map(e))}return i}}const QUe=fe,tre=class tre 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 jLe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Z_({editor:this._editor},t,i)),this._computer=new OOt(this._editor),this._hoverOperation=this._register(new Jet(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 tre.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(lC.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(lC.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 r=QUe("div.hover-row.markdown-hover"),o=oe(r,QUe("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));o.appendChild(a.element),i.appendChild(r)}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(),r=this._editor.getOption(x.lineHeight),o=this._hover.containerDomNode.clientHeight,a=i-n-(o-r)/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`}};tre.ID="editor.contrib.modesGlyphHoverWidget";let BX=tre;var gwe;const BOt=!1;var AF;(function(s){s[s.Content=0]="Content",s[s.Glyph=1]="Glyph"})(AF||(AF={}));var KL;let Oa=(KL=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 ln(()=>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(gwe.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===BX.ID:!1}_isMouseOnContentHoverWidget(e){const t=e.target;return t?t.type===Mt.CONTENT_WIDGET&&t.detail===RX.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},r=a=>{const c=this._isMouseOnContentHoverWidget(a),l=this._contentWidget?.isColorPickerVisible;return c&&l},o=(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)||r(e)||o(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),r=this._hoverSettings.enabled,o=this._hoverState.activatedByDecoratorClick;if(i&&(n==="click"&&!o||n==="hover"&&!r&&!BOt||n==="clickAndHover"&&!r&&!o)||!i&&!r&&!o){this._hideWidgets();return}this._tryShowHoverWidget(e,AF.Content)||this._tryShowHoverWidget(e,AF.Glyph)||this._hideWidgets()}_tryShowHoverWidget(e,t){const i=this._getOrCreateContentWidget(),n=this._getOrCreateGlyphWidget();let r,o;switch(t){case AF.Content:r=i,o=n;break;case AF.Glyph:r=n,o=i;break;default:throw new Error(`HoverWidgetType ${t} is unrecognized`)}const a=r.showsOrWillShow(e);return a&&o.hide(),a}_onKeyDown(e){if(!this._editor.hasModel())return;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===of.MoreChordsNeeded||t.kind===of.KbFound&&(t.commandId===Yet||t.commandId===JU||t.commandId===XU)&&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||AW.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._glyphWidget?.hide(),this._contentWidget?.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(uwe,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(BX,this._editor)),this._glyphWidget}hideContentHover(){this._hideWidgets()}showContentHover(e,t,i,n,r=!1){this._hoverState.activatedByDecoratorClick=r,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()}},gwe=KL,KL.ID="editor.contrib.hover",KL);Oa=gwe=D([_(1,we),_(2,Vt)],Oa);const WOt=new Q("commentEditorFocused",!1),q5=5*18,HOt=25*18;let LW=class extends Kk{constructor(e,t,i,n,r,o,a,c,l,d,h,u){const f={contributions:[{id:BA.ID,ctor:BA,instantiation:ai.BeforeFirstInteraction},{id:Hb.ID,ctor:Hb,instantiation:ai.BeforeFirstInteraction},{id:tf.ID,ctor:tf,instantiation:ai.Eager},{id:pc.ID,ctor:pc,instantiation:ai.Lazy},{id:HA.ID,ctor:HA,instantiation:ai.Eager},{id:aC.ID,ctor:aC,instantiation:ai.Lazy},...dp.getSomeEditorContributions([cC.ID,KM.ID,kW.ID,Mh.ID,Oa.ID,Lce,mu.ID,GM.ID])],contextMenuId:_e.SimpleEditorContext};super(e,t,f,r,o,a,i,c,l,d,h,u),this._commentEditorFocused=WOt.bindTo(i),this._commentEditorEmpty=I_.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 dp.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")}}};LW=D([_(4,we),_(5,qt),_(6,bi),_(7,mn),_(8,wi),_(9,_o),_(10,zs),_(11,nt)],LW);function wtt(s,e,t){const i=e.getLayoutInfo(),n=e.getOption(x.lineHeight),r=e._getViewModel()?.getLineCount()*n;if(r>i.height||rq5){const o=Math.ceil((r-i.height)/n),a=i.height+n*o;return Qa(a,q5,Qa(s.getLayoutInfo().height-90,q5,HOt))}return t}var XC;(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"})(XC||(XC={}));const ire=class ire extends di{constructor(){super({id:ire.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=!Uk.getTabFocusMode();Uk.setTabFocusMode(t),No(t?g(1572,"Pressing Tab will now move focus to the next focusable element"):g(1573,"Pressing Tab will now insert the tab character"))}};ire.ID="editor.action.toggleTabFocusMode";let WX=ire;Et(WX);var WE;(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}.",``)})(WE||(WE={}));const UOt="revealInExplorer",VOt="workbench.action.files.revert",zOt="workbench.action.files.saveAs";Pe(5378,"Save As...");const $Ot="workbench.action.files.save";Pe(5379,"Save");const GOt="workbench.action.files.saveWithoutFormatting";Pe(5380,"Save without Formatting");const KOt="saveAll";Pe(5381,"Save All");const ytt="workbench.files.action.saveAllInGroup",qOt="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 QOt="workbench.action.files.newUntitledFile";Pe(5383,"New Untitled Text File");let jUe=class extends V{onClose(){this._editor.focus()}constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._contextKeyService=i,this.id=Wb.Editor,this.options={type:Sm.Help,readMoreUrl:"https://go.microsoft.com/fwlink/?linkid=851010"},this.verbositySettingKey=bo.Editor}provideContent(){const e=this._editor.getOptions(),t=[];e.get(x.inDiffEditor)?e.get(x.readOnly)?t.push(Lg.readonlyDiffEditor):t.push(Lg.editableDiffEditor):e.get(x.readOnly)?t.push(Lg.readonlyEditor):t.push(Lg.editableEditor),t.push(Lg.listSignalSounds),t.push(Lg.listAlerts);const i=jOt(this._keybindingService,this._contextKeyService);i&&t.push(i);const n=Ctt(this._keybindingService,this._contextKeyService,this._editor);return n&&t.push(n),e.get(x.stickyScroll).enabled&&t.push(Lg.stickScroll),e.get(x.tabFocusMode)?t.push(Lg.tabFocusModeOnMsg):t.push(Lg.tabFocusModeOffMsg),t.push(Lg.setBreakpoint),t.push(Lg.debugExecuteSelection),t.join(` `)}};jUe=D([_(1,Vt),_(2,Le)],jUe);function Ctt(s,e,t){if(e.getContext(t.getDomNode()).getValue(I_.activeEditorHasCommentingRange.key))return[WE.intro,WE.addComment,WE.nextCommentThread,WE.previousCommentThread,WE.nextRange,WE.previousRange].join(` `)}function jOt(s,e){if(bet.getValue(e))return[Lg.quickChat,Lg.startInlineChat].join(` `)}class YOt{constructor(){this.priority=105,this.name="diff-editor",this.when=IN.create("isInDiffEditor",!0),this.type=Sm.Help}getProvider(e){const t=e.get(ti),i=e.get(qt),n=e.get(Vt),r=e.get(Le);if(!(t.activeTextEditorControl instanceof yp))return;const o=i.getActiveCodeEditor()||i.getFocusedCodeEditor();if(!o)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=Ctt(n,r,o);return h&&d.push(h),new ZZe(Wb.DiffEditor,{type:Sm.Help},()=>d.join(` -`),()=>o.focus(),bo.DiffEditor)}}var MB;let HX=(MB=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 Y3)){const a=qn(this,c=>this._diffEditor.onDidUpdateDiff(c),()=>this._diffEditor.getDiffComputationResult()).map(c=>c&&!c.identical&&c.changes2.length===0);this._register(du((c,l)=>{if(a.read(c)){const d=l.add(this._instantiationService.createInstance(aX,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(Ze.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)}}],{})}))}}},MB.ID="editor.contrib.diffEditorHelper",MB);HX=D([_(1,we),_(2,xc),_(3,wi)],HX);Eqe(HX.ID,HX);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"diffEditor.experimental.collapseUnchangedRegions",migrateFn:(s,e)=>[["diffEditor.hideUnchangedRegions.enabled",{value:s}],["diffEditor.experimental.collapseUnchangedRegions",{value:void 0}]]}]);Z6.register(new YOt);var NB;let UX=(NB=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.",Kr(e.uri.path));this._notificationService.prompt(Ze.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"}})}}},NB.ID="editor.contrib.largeFileOptimizationsWarner",NB);UX=D([_(1,wi),_(2,Te)],UX);on(UX.ID,UX,ai.AfterFirstRender);class JOt{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=Stt(e,this._cursors,this._trimInRegexesAndStrings);for(let n=0,r=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,r=0;const o=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(r"u"))return typeof s=="string"?Ge.fromString(s):{read:()=>{const e=s.read();return typeof e=="string"?Ge.fromString(e):null}}}let fwe=class extends oJe{constructor(e,t,i,n,r){const o=t.map(f=>({provider:f,text:f}));let a=t.indexOf(i);a===-1&&(a=0);const c={...dJe},l=r.getColorTheme(),d=l.getColor(Uc),u=l.getColor(Ace)?.makeOpaque(d)??d;c.selectBackground=u.lighten(.6).toString(),super(null,e,o,a,n,c,{ariaLabel:g(10418,"Switch quick diff base")}),this.optionsItems=o}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)}};fwe=D([_(3,bf),_(4,mn)],fwe);const aO=class aO extends an{constructor(e){super(aO.ID,aO.LABEL,void 0,void 0),this.callback=e}async run(e){return this.callback(e)}};aO.ID="quickDiff.base.switch",aO.LABEL=g(10419,"Switch Quick Diff Base");let pwe=aO;var mwe,m0;class nBt extends q_{runAction(e,t){return e instanceof Ac?e.run(...t):super.runAction(e,t)}}const Att=new Q("dirtyDiffVisible",!1);function sBt(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 _we(s){return s.modifiedEndLineNumber===0?s.modifiedStartLineNumber===0?1:s.modifiedStartLineNumber:s.modifiedEndLineNumber}function rBt(s,e){return s===1&&e.modifiedStartLineNumber===0&&e.modifiedEndLineNumber===0?!0:s>=e.modifiedStartLineNumber&&s<=(e.modifiedEndLineNumber||e.modifiedStartLineNumber)}let Q5=class extends an{constructor(e,t,i,n,r){const o=n.lookupKeybinding(t.id),a=t.label+(o?` (${o.getLabel()})`:"");super(t.id,a,i),this.instantiationService=r,this.action=t,this.editor=e}run(){return Promise.resolve(this.instantiationService.invokeFunction(e=>this.action.run(e,this.editor,null)))}};Q5=D([_(3,Vt),_(4,we)],Q5);var gp;(function(s){s[s.Modify=0]="Modify",s[s.Add=1]="Add",s[s.Delete=2]="Delete"})(gp||(gp={}));function fNe(s){return s.originalEndLineNumber===0?gp.Add:s.modifiedEndLineNumber===0?gp.Delete:gp.Modify}function oBt(s,e){switch(e){case gp.Modify:return s.getColor(pNe);case gp.Add:return s.getColor(mNe);case gp.Delete:return s.getColor(_Ne)}}function uG(s){const e=s.get(qt).listDiffEditors();for(const t of e)if(t.hasTextFocus()&&t instanceof Y3)return t.getParentEditor();return KZe(s)}let vwe=class extends Q3{constructor(e,t,i,n,r,o){super(e,{isResizeable:!0,frameWidth:1,keepEditorSelection:!0,className:"dirty-diff"},n),this.model=t,this.themeService=i,this.menuService=r,this.contextKeyService=o,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&&(o=o.createOverlay([["originalResourceScheme",this.model.original[0].uri.scheme],["originalResourceSchemes",this.model.original.map(a=>a.uri.scheme)]])),this.create(),e.hasModel()?this.title=vi(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 re(_we(n),1),l=this.editor.getOption(x.lineHeight),d=this.editor.getLayoutInfo().height,h=Math.floor(d/l),u=Math.min(sBt(n)+8,Math.floor(h/3));this.renderTitle(i.label);const f=fNe(n),p=oBt(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 o=n;o!==this._index;o>=0?o--:o=this.model.changes.length-1)if(this.model.changes[o].label===t){n=o;break}const r=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(Q5,this.editor,new Ett(this.editor),He.asClassName(GIt)),t=this.instantiationService.createInstance(Q5,this.editor,new xtt(this.editor),He.asClassName(KIt));this._disposables.add(e),this._disposables.add(t);const i=[];this.menu&&this.menu.dispose(),this.menu=this.menuService.createMenu(_e.SCMChangeContext,this.contextKeyService),vC(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 an("peekview.close",g(6337,"Close"),He.asClassName(ve.close),!0,()=>this.dispose()),{label:!1,icon:!0})}_fillHead(e){super._fillHead(e,!0),this.dropdownContainer=nae(this._titleElement,fe(".dropdown")),this.dropdown=this.instantiationService.createInstance(fwe,new pwe(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 nBt;return e.onDidRun(t=>{!(t.action instanceof Q5)&&!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(Y3,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,_t.Immediate)}_applyTheme(e){const t=e.getColor(WMe)||me.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(Ace)||me.transparent,primaryHeadingColor:e.getColor(OMe),secondaryHeadingColor:e.getColor(BMe)})}revealRange(e){this.editor.revealLineInCenterIfOutsideViewport(e.endLineNumber,_t.Smooth)}hasFocus(){return this.diffEditor.hasTextFocus()}dispose(){super.dispose(),this.menu?.dispose()}};vwe=D([_(2,mn),_(3,we),_(4,Ba),_(5,Le)],vwe);class Ett extends it{constructor(e){super({id:"editor.action.dirtydiff.previous",label:g(6338,"Show Previous Change"),alias:"Show Previous Change",precondition:Zae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.F3,weight:Ae.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??uG(e);if(!t)return;const i=dC.get(t);i&&i.canNavigate()&&i.previous()}}Re(Ett);class xtt extends it{constructor(e){super({id:"editor.action.dirtydiff.next",label:g(6339,"Show Next Change"),alias:"Show Next Change",precondition:Zae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Alt|S.F3,weight:Ae.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??uG(e);if(!t)return;const i=dC.get(t);i&&i.canNavigate()&&i.next()}}Re(xtt);Yn.appendMenuItem(_e.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.next",title:g(6340,"Next &&Change")},order:1});Yn.appendMenuItem(_e.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.previous",title:g(6341,"Previous &&Change")},order:2});class aBt extends it{constructor(){super({id:"workbench.action.editor.previousChange",label:g(6342,"Go to Previous Change"),alias:"Go to Previous Change",precondition:Zae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.F5,weight:Ae.EditorContrib}})}async run(e){const t=uG(e),i=e.get(uv),n=e.get(_o),r=e.get(qt);if(!t||!t.hasModel())return;const o=dC.get(t);if(!o||!o.modelRegistry)return;const a=t.getPosition().lineNumber,c=o.modelRegistry.getModel(t.getModel(),t);if(!c||c.changes.length===0)return;const l=c.findPreviousClosestChange(a,!1),d=c.changes[l];await ktt(d.change,i),Dtt(d.change,t,n,r)}}Re(aBt);class cBt extends it{constructor(){super({id:"workbench.action.editor.nextChange",label:g(6343,"Go to Next Change"),alias:"Go to Next Change",precondition:Zae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Alt|S.F5,weight:Ae.EditorContrib}})}async run(e){const t=e.get(uv),i=uG(e),n=e.get(_o),r=e.get(qt);if(!i||!i.hasModel())return;const o=dC.get(i);if(!o||!o.modelRegistry)return;const a=i.getPosition().lineNumber,c=o.modelRegistry.getModel(i.getModel(),i);if(!c||c.changes.length===0)return;const l=c.findNextClosestChange(a,!1),d=c.changes[l].change;await ktt(d,t),Dtt(d,i,n,r)}}function Dtt(s,e,t,i){const n=new re(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 ktt(s,e){switch(fNe(s)){case gp.Add:e.playSignal(ll.diffLineInserted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case gp.Delete:e.playSignal(ll.diffLineDeleted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case gp.Modify:e.playSignal(ll.diffLineModified,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break}}Re(cBt);Sr.registerCommandAndKeybindingRule({id:"closeDirtyDiff",weight:Ae.EditorContrib+50,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(Att),handler:s=>{const e=uG(s);if(!e)return;const t=dC.get(e);t&&t.close()}});var qL;let dC=(qL=class extends V{static get(e){return e.getContribution(mwe.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=fl(void 0,void 0,this._store),this.enabled){this.isDirtyDiffVisible=Att.bindTo(t),this._register(e.onDidChangeModel(()=>this.close()));const r=M.filter(i.onDidChangeConfiguration,o=>o.affectsConfiguration("scm.diffDecorationsGutterAction"));this._register(r(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=` +`),()=>o.focus(),bo.DiffEditor)}}var MB;let HX=(MB=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 Y3)){const a=qn(this,c=>this._diffEditor.onDidUpdateDiff(c),()=>this._diffEditor.getDiffComputationResult()).map(c=>c&&!c.identical&&c.changes2.length===0);this._register(du((c,l)=>{if(a.read(c)){const d=l.add(this._instantiationService.createInstance(aX,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(Ze.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)}}],{})}))}}},MB.ID="editor.contrib.diffEditorHelper",MB);HX=D([_(1,we),_(2,xc),_(3,wi)],HX);Eqe(HX.ID,HX);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:"diffEditor.experimental.collapseUnchangedRegions",migrateFn:(s,e)=>[["diffEditor.hideUnchangedRegions.enabled",{value:s}],["diffEditor.experimental.collapseUnchangedRegions",{value:void 0}]]}]);Z6.register(new YOt);var NB;let UX=(NB=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.",Kr(e.uri.path));this._notificationService.prompt(Ze.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"}})}}},NB.ID="editor.contrib.largeFileOptimizationsWarner",NB);UX=D([_(1,wi),_(2,Te)],UX);on(UX.ID,UX,ai.AfterFirstRender);class JOt{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=Stt(e,this._cursors,this._trimInRegexesAndStrings);for(let n=0,r=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,r=0;const o=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(r"u"))return typeof s=="string"?Ge.fromString(s):{read:()=>{const e=s.read();return typeof e=="string"?Ge.fromString(e):null}}}let fwe=class extends oJe{constructor(e,t,i,n,r){const o=t.map(f=>({provider:f,text:f}));let a=t.indexOf(i);a===-1&&(a=0);const c={...dJe},l=r.getColorTheme(),d=l.getColor(Uc),u=l.getColor(Ace)?.makeOpaque(d)??d;c.selectBackground=u.lighten(.6).toString(),super(null,e,o,a,n,c,{ariaLabel:g(10418,"Switch quick diff base")}),this.optionsItems=o}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)}};fwe=D([_(3,bf),_(4,mn)],fwe);const aO=class aO extends an{constructor(e){super(aO.ID,aO.LABEL,void 0,void 0),this.callback=e}async run(e){return this.callback(e)}};aO.ID="quickDiff.base.switch",aO.LABEL=g(10419,"Switch Quick Diff Base");let pwe=aO;var mwe,m0;class nBt extends q_{runAction(e,t){return e instanceof Ac?e.run(...t):super.runAction(e,t)}}const Att=new Q("dirtyDiffVisible",!1);function sBt(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 _we(s){return s.modifiedEndLineNumber===0?s.modifiedStartLineNumber===0?1:s.modifiedStartLineNumber:s.modifiedEndLineNumber}function rBt(s,e){return s===1&&e.modifiedStartLineNumber===0&&e.modifiedEndLineNumber===0?!0:s>=e.modifiedStartLineNumber&&s<=(e.modifiedEndLineNumber||e.modifiedStartLineNumber)}let Q5=class extends an{constructor(e,t,i,n,r){const o=n.lookupKeybinding(t.id),a=t.label+(o?` (${o.getLabel()})`:"");super(t.id,a,i),this.instantiationService=r,this.action=t,this.editor=e}run(){return Promise.resolve(this.instantiationService.invokeFunction(e=>this.action.run(e,this.editor,null)))}};Q5=D([_(3,Vt),_(4,we)],Q5);var gp;(function(s){s[s.Modify=0]="Modify",s[s.Add=1]="Add",s[s.Delete=2]="Delete"})(gp||(gp={}));function fNe(s){return s.originalEndLineNumber===0?gp.Add:s.modifiedEndLineNumber===0?gp.Delete:gp.Modify}function oBt(s,e){switch(e){case gp.Modify:return s.getColor(pNe);case gp.Add:return s.getColor(mNe);case gp.Delete:return s.getColor(_Ne)}}function uG(s){const e=s.get(qt).listDiffEditors();for(const t of e)if(t.hasTextFocus()&&t instanceof Y3)return t.getParentEditor();return KZe(s)}let vwe=class extends Q3{constructor(e,t,i,n,r,o){super(e,{isResizeable:!0,frameWidth:1,keepEditorSelection:!0,className:"dirty-diff"},n),this.model=t,this.themeService=i,this.menuService=r,this.contextKeyService=o,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&&(o=o.createOverlay([["originalResourceScheme",this.model.original[0].uri.scheme],["originalResourceSchemes",this.model.original.map(a=>a.uri.scheme)]])),this.create(),e.hasModel()?this.title=vi(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 re(_we(n),1),l=this.editor.getOption(x.lineHeight),d=this.editor.getLayoutInfo().height,h=Math.floor(d/l),u=Math.min(sBt(n)+8,Math.floor(h/3));this.renderTitle(i.label);const f=fNe(n),p=oBt(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 o=n;o!==this._index;o>=0?o--:o=this.model.changes.length-1)if(this.model.changes[o].label===t){n=o;break}const r=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(Q5,this.editor,new Ett(this.editor),He.asClassName(GIt)),t=this.instantiationService.createInstance(Q5,this.editor,new xtt(this.editor),He.asClassName(KIt));this._disposables.add(e),this._disposables.add(t);const i=[];this.menu&&this.menu.dispose(),this.menu=this.menuService.createMenu(_e.SCMChangeContext,this.contextKeyService),vC(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 an("peekview.close",g(6337,"Close"),He.asClassName(ve.close),!0,()=>this.dispose()),{label:!1,icon:!0})}_fillHead(e){super._fillHead(e,!0),this.dropdownContainer=nae(this._titleElement,fe(".dropdown")),this.dropdown=this.instantiationService.createInstance(fwe,new pwe(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 nBt;return e.onDidRun(t=>{!(t.action instanceof Q5)&&!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(Y3,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,_t.Immediate)}_applyTheme(e){const t=e.getColor(WMe)||me.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(Ace)||me.transparent,primaryHeadingColor:e.getColor(OMe),secondaryHeadingColor:e.getColor(BMe)})}revealRange(e){this.editor.revealLineInCenterIfOutsideViewport(e.endLineNumber,_t.Smooth)}hasFocus(){return this.diffEditor.hasTextFocus()}dispose(){super.dispose(),this.menu?.dispose()}};vwe=D([_(2,mn),_(3,we),_(4,Wa),_(5,Le)],vwe);class Ett extends it{constructor(e){super({id:"editor.action.dirtydiff.previous",label:g(6338,"Show Previous Change"),alias:"Show Previous Change",precondition:Zae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.F3,weight:Ae.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??uG(e);if(!t)return;const i=dC.get(t);i&&i.canNavigate()&&i.previous()}}Re(Ett);class xtt extends it{constructor(e){super({id:"editor.action.dirtydiff.next",label:g(6339,"Show Next Change"),alias:"Show Next Change",precondition:Zae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Alt|S.F3,weight:Ae.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??uG(e);if(!t)return;const i=dC.get(t);i&&i.canNavigate()&&i.next()}}Re(xtt);Yn.appendMenuItem(_e.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.next",title:g(6340,"Next &&Change")},order:1});Yn.appendMenuItem(_e.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.previous",title:g(6341,"Previous &&Change")},order:2});class aBt extends it{constructor(){super({id:"workbench.action.editor.previousChange",label:g(6342,"Go to Previous Change"),alias:"Go to Previous Change",precondition:Zae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.F5,weight:Ae.EditorContrib}})}async run(e){const t=uG(e),i=e.get(uv),n=e.get(_o),r=e.get(qt);if(!t||!t.hasModel())return;const o=dC.get(t);if(!o||!o.modelRegistry)return;const a=t.getPosition().lineNumber,c=o.modelRegistry.getModel(t.getModel(),t);if(!c||c.changes.length===0)return;const l=c.findPreviousClosestChange(a,!1),d=c.changes[l];await ktt(d.change,i),Dtt(d.change,t,n,r)}}Re(aBt);class cBt extends it{constructor(){super({id:"workbench.action.editor.nextChange",label:g(6343,"Go to Next Change"),alias:"Go to Next Change",precondition:Zae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Alt|S.F5,weight:Ae.EditorContrib}})}async run(e){const t=e.get(uv),i=uG(e),n=e.get(_o),r=e.get(qt);if(!i||!i.hasModel())return;const o=dC.get(i);if(!o||!o.modelRegistry)return;const a=i.getPosition().lineNumber,c=o.modelRegistry.getModel(i.getModel(),i);if(!c||c.changes.length===0)return;const l=c.findNextClosestChange(a,!1),d=c.changes[l].change;await ktt(d,t),Dtt(d,i,n,r)}}function Dtt(s,e,t,i){const n=new re(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 ktt(s,e){switch(fNe(s)){case gp.Add:e.playSignal(ll.diffLineInserted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case gp.Delete:e.playSignal(ll.diffLineDeleted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case gp.Modify:e.playSignal(ll.diffLineModified,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break}}Re(cBt);Sr.registerCommandAndKeybindingRule({id:"closeDirtyDiff",weight:Ae.EditorContrib+50,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(Att),handler:s=>{const e=uG(s);if(!e)return;const t=dC.get(e);t&&t.close()}});var qL;let dC=(qL=class extends V{static get(e){return e.getContribution(mwe.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=fl(void 0,void 0,this._store),this.enabled){this.isDirtyDiffVisible=Att.bindTo(t),this._register(e.onDidChangeModel(()=>this.close()));const r=M.filter(i.onDidChangeConfiguration,o=>o.affectsConfiguration("scm.diffDecorationsGutterAction"));this._register(r(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; } @@ -733,7 +733,7 @@ Its package.json#enabledApiProposals-property declares: ${s.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,n=i.findIndex(r=>r===this.widget.index);t=i[AOe(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(r=>r===this.widget.index);t=i[AOe(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(vwe,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,r=>r.filter(o=>o.diff.length>0).map(o=>o.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,n=e.target.element.offsetLeft,r=i.offsetX-n;r<-3||r>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 n=this.editor.getModel();if(!n)return;const r=this.modelRegistry.getModel(n,this.editor);if(!r)return;const o=r.changes.findIndex(a=>rBt(t,a.change));o<0||(o===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()}},mwe=qL,qL.ID="editor.contrib.dirtydiff",qL);dC=mwe=D([_(1,Le),_(2,Te),_(3,we)],dC);const pNe=W("editorGutter.modifiedBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#2090D3"},g(6344,"Editor gutter background color for lines that are modified.")),mNe=W("editorGutter.addedBackground",{dark:"#487E02",light:"#48985D",hcDark:"#487E02",hcLight:"#48985D"},g(6345,"Editor gutter background color for lines that are added.")),_Ne=W("editorGutter.deletedBackground",FN,g(6346,"Editor gutter background color for lines that are deleted.")),YUe=W("minimapGutter.modifiedBackground",pNe,g(6347,"Minimap gutter background color for lines that are modified.")),JUe=W("minimapGutter.addedBackground",mNe,g(6348,"Minimap gutter background color for lines that are added.")),lBt=W("minimapGutter.deletedBackground",_Ne,g(6349,"Minimap gutter background color for lines that are deleted.")),XUe=W("editorOverviewRuler.modifiedForeground",rt(pNe,.6),g(6350,"Overview ruler marker color for modified content.")),ZUe=W("editorOverviewRuler.addedForeground",rt(mNe,.6),g(6351,"Overview ruler marker color for added content.")),dBt=W("editorOverviewRuler.deletedForeground",rt(_Ne,.6),g(6352,"Overview ruler marker color for deleted content."));let bwe=m0=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:$r(i.overview.color),position:Il.Left}),i.minimap.active&&(n.minimap={color:$r(i.minimap.color),position:Rh.Gutter}),Kt.createDynamic(n)}constructor(e,t,i,n){super(),this.codeEditor=t,this.model=i,this.configurationService=n,this.editorModel=e;const r=n.getValue("scm.diffDecorations"),o=r==="all"||r==="gutter",a=r==="all"||r==="overview",c=r==="all"||r==="minimap",l=g(6353,"Added lines");this.addedOptions=m0.createDecoration("dirty-diff-added",l,{gutter:o,overview:{active:a,color:ZUe},minimap:{active:c,color:JUe},isWholeLine:!0}),this.addedPatternOptions=m0.createDecoration("dirty-diff-added-pattern",l,{gutter:o,overview:{active:a,color:ZUe},minimap:{active:c,color:JUe},isWholeLine:!0});const d=g(6354,"Changed lines");this.modifiedOptions=m0.createDecoration("dirty-diff-modified",d,{gutter:o,overview:{active:a,color:XUe},minimap:{active:c,color:YUe},isWholeLine:!0}),this.modifiedPatternOptions=m0.createDecoration("dirty-diff-modified-pattern",d,{gutter:o,overview:{active:a,color:XUe},minimap:{active:c,color:YUe},isWholeLine:!0}),this.deletedOptions=m0.createDecoration("dirty-diff-deleted",g(6355,"Removed lines"),{gutter:o,overview:{active:a,color:dBt},minimap:{active:c,color:lBt},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,r=fNe(n),o=n.modifiedStartLineNumber,a=n.modifiedEndLineNumber||o;switch(r){case gp.Add:return{range:{startLineNumber:o,startColumn:1,endLineNumber:a,endColumn:1},options:e.added?this.addedPatternOptions:this.addedOptions};case gp.Delete:return{range:{startLineNumber:o,startColumn:Number.MAX_VALUE,endLineNumber:o,endColumn:Number.MAX_VALUE},options:this.deletedOptions};case gp.Modify:return{range:{startLineNumber:o,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}};bwe=m0=D([_(3,Te)],bwe);function e4e(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 hBt(s,e,t,i){const n=await s.getQuickDiffs(e,t,i);return n.length>0?n[0].originalResource:null}let wwe=class extends V{get original(){return this._originalTextModels}get changes(){return this._changes}get mapChanges(){return this._mapChanges}constructor(e,t,i,n,r,o,a){super(),this.scmService=t,this.quickDiffService=i,this.editorWorkerService=n,this.configurationService=r,this.textModelResolverService=o,this.progressService=a,this._quickDiffs=[],this._originalModels=new Map,this._originalTextModels=[],this.diffDelayer=new c6(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(r.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,r=>r===e);t.add(n(()=>wt(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=lTe(this._changes,e,(n,r)=>e4e(n.change,r.change));this._changes=e,this._mapChanges=t,this._onDidChange.fire({changes:e,diff:i})}diff(){return this.progressService.withProgress({location:fd.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",r=[];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&&r.push({change:d,label:c.label,uri:c.originalResource})}const o=r.sort((c,l)=>e4e(c.change,l.change)),a=new Map;for(let c=0;cthis._disposed?[]:e.length===0?(this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],[]):ns(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),eBt(i.object)){const n=this._model.getEncoding();n&&i.object.setEncoding(n,a9.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?Py(this._model.textEditorModel):void 0)}findNextClosestChange(e,t=!0,i){let n;!i&&t&&(n=this.quickDiffs.find(o=>o.isSCM)?.label);const r=[];for(let o=0;o=e)if(n&&a.label!==n)r.push(o);else return o}else if(a.change.modifiedStartLineNumber>e)return o;if(r.length>0&&r.length===c)return r[0]}return r.length>0?r[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 r=this.changes[n].change;if(t){if(r.modifiedStartLineNumber<=e)return n}else if(_we(r)wt(e)),this.repositoryDisposables.clear()}};wwe=D([_(1,kMe),_(2,G6),_(3,Pl),_(4,Te),_(5,pn),_(6,hg)],wwe);class uBt{constructor(e,t){this.model=e,this.decorator=t}dispose(){this.decorator.dispose(),this.model.dispose()}}let t4e=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 gi,this.transientDisposables=this._register(new Z),this.stylesheet=fl(void 0,void 0,this._store);const r=M.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorations"));this._register(r(this.onDidChangeConfiguration,this)),this.onDidChangeConfiguration();const o=M.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterWidth"));this._register(o(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=` + `):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(r=>r===this.widget.index);t=i[AOe(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(r=>r===this.widget.index);t=i[AOe(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(vwe,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,r=>r.filter(o=>o.diff.length>0).map(o=>o.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,n=e.target.element.offsetLeft,r=i.offsetX-n;r<-3||r>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 n=this.editor.getModel();if(!n)return;const r=this.modelRegistry.getModel(n,this.editor);if(!r)return;const o=r.changes.findIndex(a=>rBt(t,a.change));o<0||(o===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()}},mwe=qL,qL.ID="editor.contrib.dirtydiff",qL);dC=mwe=D([_(1,Le),_(2,Te),_(3,we)],dC);const pNe=W("editorGutter.modifiedBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#2090D3"},g(6344,"Editor gutter background color for lines that are modified.")),mNe=W("editorGutter.addedBackground",{dark:"#487E02",light:"#48985D",hcDark:"#487E02",hcLight:"#48985D"},g(6345,"Editor gutter background color for lines that are added.")),_Ne=W("editorGutter.deletedBackground",FN,g(6346,"Editor gutter background color for lines that are deleted.")),YUe=W("minimapGutter.modifiedBackground",pNe,g(6347,"Minimap gutter background color for lines that are modified.")),JUe=W("minimapGutter.addedBackground",mNe,g(6348,"Minimap gutter background color for lines that are added.")),lBt=W("minimapGutter.deletedBackground",_Ne,g(6349,"Minimap gutter background color for lines that are deleted.")),XUe=W("editorOverviewRuler.modifiedForeground",rt(pNe,.6),g(6350,"Overview ruler marker color for modified content.")),ZUe=W("editorOverviewRuler.addedForeground",rt(mNe,.6),g(6351,"Overview ruler marker color for added content.")),dBt=W("editorOverviewRuler.deletedForeground",rt(_Ne,.6),g(6352,"Overview ruler marker color for deleted content."));let bwe=m0=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:$r(i.overview.color),position:Tl.Left}),i.minimap.active&&(n.minimap={color:$r(i.minimap.color),position:Rh.Gutter}),Kt.createDynamic(n)}constructor(e,t,i,n){super(),this.codeEditor=t,this.model=i,this.configurationService=n,this.editorModel=e;const r=n.getValue("scm.diffDecorations"),o=r==="all"||r==="gutter",a=r==="all"||r==="overview",c=r==="all"||r==="minimap",l=g(6353,"Added lines");this.addedOptions=m0.createDecoration("dirty-diff-added",l,{gutter:o,overview:{active:a,color:ZUe},minimap:{active:c,color:JUe},isWholeLine:!0}),this.addedPatternOptions=m0.createDecoration("dirty-diff-added-pattern",l,{gutter:o,overview:{active:a,color:ZUe},minimap:{active:c,color:JUe},isWholeLine:!0});const d=g(6354,"Changed lines");this.modifiedOptions=m0.createDecoration("dirty-diff-modified",d,{gutter:o,overview:{active:a,color:XUe},minimap:{active:c,color:YUe},isWholeLine:!0}),this.modifiedPatternOptions=m0.createDecoration("dirty-diff-modified-pattern",d,{gutter:o,overview:{active:a,color:XUe},minimap:{active:c,color:YUe},isWholeLine:!0}),this.deletedOptions=m0.createDecoration("dirty-diff-deleted",g(6355,"Removed lines"),{gutter:o,overview:{active:a,color:dBt},minimap:{active:c,color:lBt},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,r=fNe(n),o=n.modifiedStartLineNumber,a=n.modifiedEndLineNumber||o;switch(r){case gp.Add:return{range:{startLineNumber:o,startColumn:1,endLineNumber:a,endColumn:1},options:e.added?this.addedPatternOptions:this.addedOptions};case gp.Delete:return{range:{startLineNumber:o,startColumn:Number.MAX_VALUE,endLineNumber:o,endColumn:Number.MAX_VALUE},options:this.deletedOptions};case gp.Modify:return{range:{startLineNumber:o,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}};bwe=m0=D([_(3,Te)],bwe);function e4e(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 hBt(s,e,t,i){const n=await s.getQuickDiffs(e,t,i);return n.length>0?n[0].originalResource:null}let wwe=class extends V{get original(){return this._originalTextModels}get changes(){return this._changes}get mapChanges(){return this._mapChanges}constructor(e,t,i,n,r,o,a){super(),this.scmService=t,this.quickDiffService=i,this.editorWorkerService=n,this.configurationService=r,this.textModelResolverService=o,this.progressService=a,this._quickDiffs=[],this._originalModels=new Map,this._originalTextModels=[],this.diffDelayer=new c6(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(r.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,r=>r===e);t.add(n(()=>wt(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=lTe(this._changes,e,(n,r)=>e4e(n.change,r.change));this._changes=e,this._mapChanges=t,this._onDidChange.fire({changes:e,diff:i})}diff(){return this.progressService.withProgress({location:fd.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",r=[];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&&r.push({change:d,label:c.label,uri:c.originalResource})}const o=r.sort((c,l)=>e4e(c.change,l.change)),a=new Map;for(let c=0;cthis._disposed?[]:e.length===0?(this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],[]):ns(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),eBt(i.object)){const n=this._model.getEncoding();n&&i.object.setEncoding(n,a9.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?Py(this._model.textEditorModel):void 0)}findNextClosestChange(e,t=!0,i){let n;!i&&t&&(n=this.quickDiffs.find(o=>o.isSCM)?.label);const r=[];for(let o=0;o=e)if(n&&a.label!==n)r.push(o);else return o}else if(a.change.modifiedStartLineNumber>e)return o;if(r.length>0&&r.length===c)return r[0]}return r.length>0?r[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 r=this.changes[n].change;if(t){if(r.modifiedStartLineNumber<=e)return n}else if(_we(r)wt(e)),this.repositoryDisposables.clear()}};wwe=D([_(1,kMe),_(2,G6),_(3,Fl),_(4,Te),_(5,pn),_(6,hg)],wwe);class uBt{constructor(e,t){this.model=e,this.decorator=t}dispose(){this.decorator.dispose(),this.model.dispose()}}let t4e=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 gi,this.transientDisposables=this._register(new Z),this.stylesheet=fl(void 0,void 0,this._store);const r=M.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorations"));this._register(r(this.onDidChangeConfiguration,this)),this.onDidChangeConfiguration();const o=M.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterWidth"));this._register(o(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; @@ -751,17 +751,17 @@ Its package.json#enabledApiProposals-property declares: ${s.enabledApiProposals? .monaco-editor .dirty-diff-deleted { opacity: ${e.visibility==="always"?1: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)wt(e.values());this.items.clear(),this.enabled=!1}}onEditorsChanged(){for(const e of this.editorService.visibleTextEditorControls)if(jo(e)){const t=e.getModel(),i=dC.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 r=this.instantiationService.createInstance(wwe,n),o=new bwe(n.textEditorModel,e,r,this.configurationService);this.items.has(t.uri)||this.items.set(t.uri,new Map),this.items.get(t.uri)?.set(e.getId(),new uBt(r,o))}}}for(const[e,t]of this.items)for(const i of t.keys())this.editorService.visibleTextEditorControls.find(n=>jo(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()}};t4e=D([_(0,ti),_(1,we),_(2,Te),_(3,Fr)],t4e);on(dC.ID,dC,ai.AfterFirstRender);Re(class extends it{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(Itt,t.getModel());if(tr(n))return i.invokeFunction(Xae,t,n,cm.Explicit,hu.None,Ue.None,!0)}});async function Itt(s,e){const t=s.get(G6),i=s.get(Pl),n=s.get(pn),r=await hBt(t,e.uri,e.getLanguageId(),Py(e));if(!r)return null;const o=[],a=await n.createModelReference(r);try{if(!i.canComputeDirtyDiff(r,e.uri))return;const c=await i.computeDirtyDiff(r,e.uri,!1);if(!tr(c))return;for(const l of c)o.push(e.validateRange(new F(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber||l.modifiedStartLineNumber,Number.MAX_SAFE_INTEGER)))}finally{a.dispose()}return o}let ywe=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===Sn.AUTO,n)}doTrimTrailingWhitespace(e,t,i){let n=[],r=[];const o=Mce(e,this.codeEditorService);if(o&&(n=o.getSelections(),t)){r=n.map(l=>l.getPosition());const c=pc.get(o)?.getSessionEnclosingRange();if(c)for(let l=c.startLineNumber;l<=c.endLineNumber;l++)r.push(new re(l,e.getLineMaxColumn(l)))}const a=Stt(e,r,i);a.length&&e.pushEditOperations(n,a,c=>n)}};ywe=D([_(0,Te),_(1,qt)],ywe);function Mce(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 Cwe=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=M_(i)===-1;if(!t||n)return;const r=[es.insert(new re(t,e.getLineMaxColumn(t)),e.getEOL())],o=Mce(e,this.codeEditorService);o?o.executeEdits("insertFinalNewLine",r,o.getSelections()):e.pushEditOperations([],r,()=>null)}};Cwe=D([_(0,Te),_(1,qt)],Cwe);let Swe=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===Sn.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=[],r=0;const o=Mce(e,this.codeEditorService);if(o&&(n=o.getSelections(),t))for(let d=0,h=n.length;dr&&(r=u)}const a=this.findLastNonEmptyLine(e),c=Math.max(a+1,r+1),l=e.validateRange(new F(c,1,i,e.getLineMaxColumn(i)));l.isEmpty()||(e.pushEditOperations(n,[es.delete(l)],d=>n),o?.setSelections(n))}};Swe=D([_(0,Te),_(1,qt)],Swe);let Awe=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===Sn.AUTO)return;const r=e.textEditorModel,o={overrideIdentifier:r.getLanguageId(),resource:r.uri},a=new hu(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",o))return;const l=Mce(r,this.codeEditorService)||r,d=this.configurationService.getValue("editor.formatOnSaveMode",o);if(d==="file")await this.instantiationService.invokeFunction($ve,l,cm.Silent,a,n);else{const h=await this.instantiationService.invokeFunction(Itt,jo(l)?l.getModel():l);h===null&&d==="modificationsIfAvailable"?await this.instantiationService.invokeFunction($ve,l,cm.Silent,a,n):h&&await this.instantiationService.invokeFunction(Xae,l,h,cm.Silent,a,n,!1)}}};Awe=D([_(0,Te),_(1,qt),_(2,we)],Awe);let Ewe=class extends V{constructor(e,t,i,n,r,o){super(),this.configurationService=e,this.instantiationService=t,this.languageFeaturesService=i,this.hostService=n,this.editorService=r,this.codeEditorService=o,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"&&Cs.Source.contains(new Jn(a))),r=new li,o=[];for(const a of n)o.push(new Jn(a));await this.applyOnSaveActions(e,o,[],hu.None,r.token)}}async participate(e,t,i,n){if(!e.textEditorModel)return;const r=e.textEditorModel,o={overrideIdentifier:r.getLanguageId(),resource:r.uri},a=this.configurationService.getValue("editor.codeActionsOnSave",o);if(!a||t.reason===Sn.AUTO||t.reason!==Sn.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)=>Cs.SourceFixAll.contains(u)?Cs.SourceFixAll.contains(f)?0:-1:Cs.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 Jn(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===Sn.EXPLICIT);await this.applyOnSaveActions(r,h,d,i,n)}createCodeActionsOnSave(e){const t=e.map(i=>new Jn(i));return t.filter(i=>t.every(n=>n.equals(i)||!n.contains(i)))}async applyOnSaveActions(e,t,i,n,r){const o=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,o,r);if(r.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(Het,l,Hx.OnSave,{},r),r.isCancellationRequested)return}catch{}finally{c.dispose()}}}getActionsToRun(e,t,i,n,r){return rB(this.languageFeaturesService.codeActionProvider,e,e.getFullModelRange(),{type:Ah.Auto,triggerAction:ag.OnSave,filter:{include:t,excludes:i,includeSourceActions:!0}},n,r)}};Ewe=D([_(0,Te),_(1,we),_(2,nt),_(3,Dc),_(4,ti),_(5,qt)],Ewe);let xwe=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(ywe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Ewe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Awe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Cwe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Swe)))}};xwe=D([_(0,we),_(1,Fr)],xwe);const gBt=je.as(hf.Workbench);gBt.registerWorkbenchContribution(xwe,Ms.Restored);const nre=class nre extends di{constructor(){super({id:nre.ID,title:{...Pe(728,"Toggle Minimap"),mnemonicTitle:g(729,"&&Minimap")},category:la.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)}};nre.ID="editor.action.toggleMinimap";let Dwe=nre;Et(Dwe);const cO=class cO extends di{constructor(){super({id:cO.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(cO.multiCursorModifierConfigurationKey,n)}};cO.ID="workbench.action.toggleMultiCursorModifier",cO.multiCursorModifierConfigurationKey="editor.multiCursorModifier";let c9=cO;const vNe=new Q("multiCursorModifier","altKey");let kwe=class extends V{constructor(e,t){super(),this.configurationService=e,this._multiCursorModifier=vNe.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)}};kwe=D([_(0,Te),_(1,Le)],kwe);je.as(hf.Workbench).registerWorkbenchContribution(kwe,Ms.Restored);Et(c9);Yn.appendMenuItem(_e.MenubarSelectionMenu,{group:"4_config",command:{id:c9.ID,title:g(731,"Switch to Alt+Click for Multi-Cursor")},when:vNe.isEqualTo("ctrlCmd"),order:1});Yn.appendMenuItem(_e.MenubarSelectionMenu,{group:"4_config",command:{id:c9.ID,title:jt?g(732,"Switch to Cmd+Click for Multi-Cursor"):g(733,"Switch to Ctrl+Click for Multi-Cursor")},when:vNe.isEqualTo("altKey"),order:1});const sre=class sre extends di{constructor(){super({id:sre.ID,title:{...Pe(734,"Toggle Control Characters"),mnemonicTitle:g(735,"Render &&Control Characters")},category:la.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)}};sre.ID="editor.action.toggleRenderControlCharacter";let Iwe=sre;Et(Iwe);const Ttt="transientWordWrapState",bNe="isWordWrapMinified",wNe="isDominatedByLongLines",Ltt=new Q("canToggleWordWrap",!1,!0),Rtt=new Q("editorWordWrap",!1,g(736,"Whether the editor is currently using word wrapping."));function VX(s,e,t){t.setTransientModelProperty(s,Ttt,e)}function zX(s,e){return e.getTransientModelProperty(s,Ttt)}const Nce="editor.action.toggleWordWrap";class fBt extends it{constructor(){super({id:Nce,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(qt);if(!MW(i,t))return;const n=t.getModel(),r=zX(n,i);let o;r?o=null:o={wordWrapOverride:t.getOption(x.wrappingInfo).wrappingColumn===-1?"on":"off"},VX(n,o,i);const a=pBt(t,i);if(a){const c=a.getOriginalEditor(),l=a.getModifiedEditor(),d=c===t?l:c;MW(i,d)&&(VX(d.getModel(),o,i),a.updateOptions({}))}}}function pBt(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 PB;let $X=(PB=class extends V{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._codeEditorService=i;const r=this._editor.getOptions().get(x.wrappingInfo),o=this._contextKeyService.createKey(bNe,r.isWordWrapMinified),a=this._contextKeyService.createKey(wNe,r.isDominatedByLongLines);let c=!1;this._register(e.onDidChangeConfiguration(d=>{if(!d.hasChanged(x.wrappingInfo))return;const u=this._editor.getOptions().get(x.wrappingInfo);o.set(u.isWordWrapMinified),a.set(u.isDominatedByLongLines),c||l()})),this._register(e.onDidChangeModel(d=>{l()})),this._register(i.onDidChangeTransientModelProperty(()=>{l()}));const l=()=>{if(!MW(this._codeEditorService,this._editor))return;const d=zX(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})}},PB.ID="editor.contrib.toggleWordWrapController",PB);$X=D([_(1,Le),_(2,qt)],$X);var FB;let GX=(FB=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=zX(e.getModel(),this._codeEditorService),n=zX(t.getModel(),this._codeEditorService);i&&!n&&MW(this._codeEditorService,e)&&(VX(t.getModel(),i,this._codeEditorService),this._diffEditor.updateOptions({})),!i&&n&&MW(this._codeEditorService,t)&&(VX(e.getModel(),n,this._codeEditorService),this._diffEditor.updateOptions({}))}},FB.ID="diffeditor.contrib.toggleWordWrapController",FB);GX=D([_(1,qt)],GX);function MW(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 OB;let KX=(OB=class extends V{constructor(e,t,i){super(),this._editorService=e,this._codeEditorService=t,this._contextService=i,this._register(M.runAndSubscribe(sm,({window:n,disposables:r})=>{r.add(ue(n,"focus",()=>this._update(),!0)),r.add(ue(n,"blur",()=>this._update(),!0))},{window:ri,disposables:this._store})),this._register(this._editorService.onDidActiveEditorChange(()=>this._update())),this._canToggleWordWrap=Ltt.bindTo(this._contextService),this._editorWordWrap=Rtt.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(MW(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)}},OB.ID="workbench.contrib.editorWordWrapContextKeyTracker",OB);KX=D([_(0,ti),_(1,qt),_(2,Le)],KX);Ju(KX.ID,KX,Cc.AfterRestored);on($X.ID,$X,ai.Eager);Eqe(GX.ID,GX);Re(fBt);Yn.appendMenuItem(_e.EditorTitle,{command:{id:Nce,title:g(738,"Disable wrapping for this file"),icon:ve.wordWrap},group:"navigation",order:1,when:he.and(he.has(wNe),he.has(bNe))});Yn.appendMenuItem(_e.EditorTitle,{command:{id:Nce,title:g(739,"Enable wrapping for this file"),icon:ve.wordWrap},group:"navigation",order:1,when:he.and(J.inDiffEditor.negate(),he.has(wNe),he.not(bNe))});Yn.appendMenuItem(_e.MenubarViewMenu,{command:{id:Nce,title:g(740,"&&Word Wrap"),toggled:Rtt,precondition:Ltt},order:1,group:"5_editor"});const rre=class rre extends di{constructor(){super({id:rre.ID,title:{...Pe(741,"Toggle Render Whitespace"),mnemonicTitle:g(742,"&&Render Whitespace")},category:la.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)}};rre.ID="editor.action.toggleRenderWhitespace";let Twe=rre;Et(Twe);class mBt{constructor(){this._registeredGutterActionsGenerators=new Set}registerGutterActionsGenerator(e){return this._registeredGutterActionsGenerators.add(e),{dispose:()=>{this._registeredGutterActionsGenerators.delete(e)}}}getGutterActionsGenerators(){return Array.from(this._registeredGutterActionsGenerators.values())}}je.add("gutterActionsRegistry",new mBt);const _Bt=je.as("gutterActionsRegistry");var BB;let qX=(BB=class extends V{constructor(e,t,i,n,r){super(),this.editor=e,this.contextMenuService=t,this.menuService=i,this.contextKeyService=n,this.instantiationService=r,this._register(this.editor.onMouseDown(o=>this.doShow(o,!1)))}show(e){this.doShow(e,!0)}doShow(e,t){const i=this.editor.getModel();if(!e.event.rightButton&&!(jt&&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 n=e.target.position.lineNumber,r=this.contextKeyService.createOverlay([["editorLineNumber",n]]),o=this.menuService.createMenu(_e.EditorLineNumberContext,r),a=[];this.instantiationService.invokeFunction(c=>{for(const d of _Bt.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=o.getActions({arg:{lineNumber:n,uri:i.uri},shouldForwardArgs:!0});if(a.push(...l),e.target.type===Mt.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,Lb.PROGRAMMATIC)}this.contextMenuService.showContextMenu({getAnchor:()=>e.event,getActions:()=>Eo.join(...a.map(d=>d[1])),onHide:()=>o.dispose()})})}},BB.ID="workbench.contrib.editorLineNumberContextMenu",BB);qX=D([_(1,lo),_(2,Ba),_(3,Le),_(4,we)],qX);on(qX.ID,qX,ai.AfterFirstRender);var yu,ry;let xy=(ry=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this._extensionService=e,this._extensionEnablementService=t,this._configService=i,this._notificationService=n,this._dialogService=r,this._quickInputService=o,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(wW.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(yu.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(o=>o==="Formatters"||o==="Programming Languages"),r=i.categories?.find(o=>o==="Formatters"||o==="Programming Languages");return n&&!r?-1:!n&&r?1:t.name.localeCompare(i.name)}),yu.extensionIds.length=0,yu.extensionItemLabels.length=0,yu.extensionDescriptions.length=0,yu.extensionIds.push(null),yu.extensionItemLabels.push(g(4529,"None")),yu.extensionDescriptions.push(g(4530,"None"));for(const t of e)(t.main||t.browser)&&(yu.extensionIds.push(t.identifier.value),yu.extensionItemLabels.push(t.displayName??""),yu.extensionDescriptions.push(t.description??""))}static _maybeQuotes(e){return e.match(/\s/)?`'${e}'`:e}async _analyzeFormatter(e,t,i){const n=this._configService.getValue(yu.configName,{resource:i.uri,overrideIdentifier:i.getLanguageId()});if(n){const a=t.find(l=>An.equals(l.extensionId,n));if(a)return a;const c=await this._extensionService.getExtension(n);if(c&&this._extensionEnablementService.isEnabled(Cce(c))){const l=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return e===bW.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 r=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.",yu._maybeQuotes(r))}async _selectFormatter(e,t,i,n){const r=await this._analyzeFormatter(n,e,t);if(typeof r!="string")return r;if(i!==cm.Silent){const{confirmed:o}=await this._dialogService.confirm({message:g(4535,"Configure Default Formatter"),detail:r,primaryButton:g(4536,"&&Configure...")});if(o)return this._pickAndPersistDefaultFormatter(e,t)}else this._notificationService.prompt(Ze.Info,r,[{label:g(4537,"Configure..."),run:()=>this._pickAndPersistDefaultFormatter(e,t)}],{priority:Z2.SILENT})}async _pickAndPersistDefaultFormatter(e,t){const i=e.map((o,a)=>({index:a,label:o.displayName||(o.extensionId?o.extensionId.value:"?"),description:o.extensionId&&o.extensionId.value})),n=this._languageService.getLanguageName(t.getLanguageId())||t.getLanguageId(),r=await this._quickInputService.pick(i,{placeHolder:g(4538,"Select a default formatter for '{0}' files",yu._maybeQuotes(n))});if(!(!r||!e[r.index].extensionId))return this._configService.updateValue(yu.configName,e[r.index].extensionId.value,{resource:t.uri,overrideIdentifier:t.getLanguageId()}),e[r.index]}_updateStatus(){this._languageStatusStore.clear();const e=m6(this._editorService.activeTextEditorControl);if(!e||!e.hasModel())return;const t=e.getModel(),i=Jae(this._languageFeaturesService.documentFormattingEditProvider,this._languageFeaturesService.documentRangeFormattingEditProvider,t);if(i.length===0)return;const n=new li;this._languageStatusStore.add(Ee(()=>n.dispose(!0))),this._analyzeFormatter(bW.File,i,t).then(r=>{if(n.token.isCancellationRequested||typeof r!="string")return;const o={id:`formatter/configure/dfl/${ao()}`,title:g(4539,"Configure...")};this._languageStatusStore.add(vt.registerCommand(o.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:Ze.Error,label:g(4541,"Formatting"),detail:r,busy:!1,source:"",command:o,accessibilityInfo:void 0}))})}},yu=ry,ry.configName="editor.defaultFormatter",ry.extensionIds=[],ry.extensionItemLabels=[],ry.extensionDescriptions=[],ry);xy=yu=D([_(0,ps),_(1,Fl),_(2,Te),_(3,wi),_(4,ir),_(5,Tn),_(6,Di),_(7,nt),_(8,mce),_(9,ti)],xy);je.as(hf.Workbench).registerWorkbenchContribution(xy,Ms.Restored);je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{[xy.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:xy.extensionIds,enumItemLabels:xy.extensionItemLabels,markdownEnumDescriptions:xy.extensionDescriptions}}});function Mtt(s,e,t,i){function n(r){return r.extensionId?An.toKey(r.extensionId):"unknown"}s.publicLog2("formatterpick",{mode:e,extensions:t.map(n),pick:i?n(i):"none"})}async function Ntt(s,e,t){const i=s.get(Tn),n=s.get(Te),r=s.get(Di),o={resource:e.uri,overrideIdentifier:e.getLanguageId()},a=n.getValue(xy.configName,o);let c;const l=t.map((u,f)=>{const p=An.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=r.getLanguageName(e.getLanguageId())||e.getLanguageId(),f=await i.pick(l,{placeHolder:g(4538,"Select a default formatter for '{0}' files",xy._maybeQuotes(u))});f&&t[f.index].extensionId&&n.updateValue(xy.configName,t[f.index].extensionId.value,o);return}else return h.index;else return}Re(class extends it{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),r=e.get(Ji),o=e.get(nt),a=t.getModel(),c=Jae(o.documentFormattingEditProvider,o.documentRangeFormattingEditProvider,a),l=await n.invokeFunction(Ntt,a,c);typeof l=="number"&&await n.invokeFunction(vXe,c[l],t,cm.Explicit,Ue.None),Mtt(r,"document",c,typeof l=="number"&&c[l]||void 0)}});Re(class extends it{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(nt),r=e.get(Ji),o=t.getModel();let a=t.getSelection();a.isEmpty()&&(a=new F(a.startLineNumber,1,a.startLineNumber,o.getLineMaxColumn(a.startLineNumber)));const c=n.documentRangeFormattingEditProvider.ordered(o),l=await i.invokeFunction(Ntt,o,c);typeof l=="number"&&await i.invokeFunction(_Xe,c[l],t,a,Ue.None,!0),Mtt(r,"range",c,typeof l=="number"&&c[l]||void 0)}});const ZU="workbench.view.extensions";var Qr;(function(s){s[s.Installing=0]="Installing",s[s.Installed=1]="Installed",s[s.Uninstalling=2]="Uninstalling",s[s.Uninstalled=3]="Uninstalled"})(Qr||(Qr={}));var qm;(function(s){s.ReloadWindow="reloadWindow",s.RestartExtensions="restartExtensions",s.DownloadUpdate="downloadUpdate",s.ApplyUpdate="applyUpdate",s.QuitAndInstall="quitAndInstall"})(qm||(qm={}));var l9;(function(s){s.Readme="readme",s.Features="features",s.Changelog="changelog",s.Dependencies="dependencies",s.ExtensionPack="extensionPack"})(l9||(l9={}));const vBt="extensions.autoUpdate";let i4e=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?Ma(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};i4e=D([_(1,Xr)],i4e);const bBt="workbench.extensions.action.toggleIgnoreExtension",wBt="workbench.extensions.action.installVSIX";new Q("hasOutdatedExtensions",!1);new Q("hasGallery",!1);const yBt="_theme_",CBt="0_install",SBt="0_update";new _e("extensionsSearchActionsMenu");g(5291,"Views");const ABt=oi("default-view-icon",ve.window,g(5292,"Default view icon."));var oI;(function(s){s.ViewContainersRegistry="workbench.registry.view.containers",s.ViewsRegistry="workbench.registry.view"})(oI||(oI={}));var io;(function(s){s[s.Sidebar=0]="Sidebar",s[s.Panel=1]="Panel",s[s.AuxiliaryBar=2]="AuxiliaryBar"})(io||(io={}));io.Sidebar,io.Panel,io.AuxiliaryBar;function QX(s){switch(s){case io.Sidebar:return"sidebar";case io.Panel:return"panel";case io.AuxiliaryBar:return"auxiliarybar"}}class EBt 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 r=e;return r.openCommandActionDescriptor=i?.doNotRegisterOpenCommand?void 0:r.openCommandActionDescriptor??{id:r.id},Pj(this.viewContainers,t,[]).push(r),i?.isDefault&&this.defaultViewContainers.push(r),this._onDidRegister.fire({viewContainer:r,viewContainerLocation:t}),r}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)}}je.add(oI.ViewContainersRegistry,new EBt);var jX;(function(s){s.Open="2_open",s.Debug="4_debug",s.SCM="5_scm",s.More="9_more"})(jX||(jX={}));function xBt(s,e){const t=s.group??jX.More,i=e.group??jX.More;return t!==i?t.localeCompare(i):(s.order??5)-(e.order??5)}class DBt 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 q7}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,r]of t)this._viewWelcomeContents.add(e,r),i.set(n,Ee(()=>{this._viewWelcomeContents.delete(e,r),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(xBt)}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=[],r=[];for(const o of i)e.includes(o)?n.push(o):r.push(o);return n.length&&(r.length?this._views.set(t,r):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),n}}je.add(oI.ViewsRegistry,new DBt);var Lwe;(function(s){s[s.Default=0]="Default",s[s.Expand=1]="Expand"})(Lwe||(Lwe={}));var n4e;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(n4e||(n4e={}));class vue{constructor(e,t){this.resolved=!1,this._hasResolve=!1,mp(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 rw 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 kBt(s,e){const t=await s.openPaneComposite(ZU,io.Sidebar,!0);t&&(t?.getViewPaneContainer()).search(e)}Re(class extends it{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(bi),n=e.get(Mm),r=e.get(wi),o=e.get(ir),a=e.get(nt),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())r.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 o.confirm({message:h,primaryButton:g(4551,"&&Install Formatter...")});u&&kBt(n,`category:formatters ${d}`)}}});var Sg,oy;let H1=(oy=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(PA.setFoldingRangeProviderSelector(this._selectFoldingRangeProvider.bind(this))),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered(),Sg.extensionIds.length=0,Sg.extensionItemLabels.length=0,Sg.extensionDescriptions.length=0,Sg.extensionIds.push(null),Sg.extensionItemLabels.push(g(743,"All")),Sg.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(r=>r==="Programming Languages")?e.push(n):t.push(n));const i=(n,r)=>n.name.localeCompare(r.name);for(const n of e.sort(i))Sg.extensionIds.push(n.identifier.value),Sg.extensionItemLabels.push(n.displayName??""),Sg.extensionDescriptions.push(n.description??"");for(const n of t.sort(i))Sg.extensionIds.push(n.identifier.value),Sg.extensionItemLabels.push(n.displayName??""),Sg.extensionDescriptions.push(n.description??"")}_selectFoldingRangeProvider(e,t){const i=this._configurationService.getValue(Sg.configName,{overrideIdentifier:t.getLanguageId()});if(i)return e.filter(n=>n.id===i)}},Sg=oy,oy.configName="editor.defaultFoldingRangeProvider",oy.extensionIds=[],oy.extensionItemLabels=[],oy.extensionDescriptions=[],oy);H1=Sg=D([_(0,ps),_(1,Te)],H1);je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{[H1.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:H1.extensionIds,enumItemLabels:H1.extensionItemLabels,markdownEnumDescriptions:H1.extensionDescriptions}}});je.as(hf.Workbench).registerWorkbenchContribution(H1,Ms.Restored);var IBt=".monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}";gt(IBt,{});let d9=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:(Ns(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,r){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=oe(e,fe("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??Fo("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const o=this._register(new ni(this.el,"click")),a=this._register(new ni(this.el,"keypress")),c=M.chain(a.event,h=>h.map(u=>new xn(u)).filter(u=>u.keyCode===S.Enter)),l=this._register(new ni(this.el,ur.Tap)).event;this._register(md.addTarget(this.el));const d=M.any(o.event,c,l);this._register(d(h=>{this.enabled&&(tn.stop(h,!0),i?.opener?i.opener(this._link.href):r.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)}};d9=D([_(3,tc),_(4,Ar)],d9);var CQ,ek;let jM=(ek=class{static get(e){return e.getContribution(CQ.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=CQ.IsReading.bindTo(t)}dispose(){this._sessionDispoosables.dispose(),this._ctxIsReading.reset(),this._ariaElement.remove()}_reset(){Ns(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 li;this._sessionDispoosables.add(i);for(const c of t)await c.resolve(i.token);if(i.token.isCancellationRequested)return;const n=this._editor.getModel(),r=[];let o=0,a=!1;for(const c of t){const l=n.getValueInRange({startLineNumber:e,startColumn:o+1,endLineNumber:e,endColumn:c.hint.position.column});if(l.length>0&&(r.push(l),o=c.hint.position.column-1),o>750){r.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(d9,d,{href:gtt(u.command),label:u.label,title:u.command.title},void 0);this._sessionDispoosables.add(f)}else d.innerText+=u.label;r.push(d)}a||r.push(n.getValueInRange({startLineNumber:e,startColumn:o+1,endLineNumber:e,endColumn:Number.MAX_SAFE_INTEGER})),ca(this._ariaElement,...r),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=TW.get(this._editor)?.getInlayHintsForLine(e);!t||t.length===0?this._accessibilitySignalService.playSignal(ll.noInlayHints):this._read(e,t)}stopInlayHintsReading(){this._reset(),this._editor.focus()}},CQ=ek,ek.IsReading=new Q("isReadingLineWithInlayHints",!1,{type:"boolean",description:g(746,"Whether the current line and its inlay hints are currently focused")}),ek.ID="editor.contrib.InlayHintsAccessibility",ek);jM=CQ=D([_(1,Le),_(2,uv),_(3,we)],jM);Et(class extends mf{constructor(){super({id:"inlayHints.startReadingLineWithHint",title:Pe(748,"Read Line With Inline Hints"),precondition:J.hasInlayHintsProvider,f1:!0})}runEditorCommand(e,t){jM.get(t)?.startInlayHintsReading()}});Et(class extends mf{constructor(){super({id:"inlayHints.stopReadingLineWithHint",title:Pe(749,"Stop Inlay Hints Reading"),precondition:jM.IsReading,f1:!0,keybinding:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(e,t){jM.get(t)?.stopInlayHintsReading()}});on(jM.ID,jM,ai.Lazy);var Nv;(function(s){s.languages="languages",s.actions="actions",s.kind="kind",s.title="title",s.description="description"})(Nv||(Nv={}));const TBt=Object.freeze({type:"array",markdownDescription:g(4552,"Configure which editor to use for a resource."),items:{type:"object",required:[Nv.languages,Nv.actions],properties:{[Nv.languages]:{type:"array",description:g(4553,"Language modes that the code actions are enabled for."),items:{type:"string"}},[Nv.actions]:{type:"object",required:[Nv.kind,Nv.title],properties:{[Nv.kind]:{type:"string",markdownDescription:g(4554,"`CodeActionKind` of the contributed code action.")},[Nv.title]:{type:"string",description:g(4555,"Label for the code action used in the UI.")},[Nv.description]:{type:"string",description:g(4556,"Description of what the code action does.")}}}}}}),LBt={extensionPoint:"codeActions",deps:[DW],jsonSchema:TBt};class RBt 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(o=>o.actions.map(a=>({...a,languages:o.languages}))).flat(),n=[g(4557,"Title"),g(4558,"Kind"),g(4559,"Description"),g(4560,"Languages")],r=i.sort((o,a)=>o.title.localeCompare(a.title)).map(o=>[o.title,new Nt().appendMarkdown(`\`${o.kind}\``),o.description??"",new Nt().appendMarkdown(`${o.languages.map(a=>`\`${a}\``).join(" ")}`)]);return{data:{headers:n,rows:r},dispose:()=>{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"codeActions",label:g(4561,"Code Actions"),access:{canToggle:!1},renderer:new yi(RBt)});var HE;(function(s){s.when="when",s.title="title",s.command="command"})(HE||(HE={}));const MBt=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:[HE.title,HE.when,HE.command],properties:{[HE.title]:{type:"string",description:g(4565,"Label for the documentation used in the UI.")},[HE.when]:{type:"string",description:g(4566,"When clause.")},[HE.command]:{type:"string",description:g(4567,"Command executed.")}}}}}}),NBt={extensionPoint:"documentation",deps:[DW],jsonSchema:MBt},s4e=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}),r4e=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}),SQ={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:ct.LANGUAGE_OVERRIDABLE},Rwe=Object.freeze({...Kb,properties:{"editor.codeActionsOnSave":SQ}}),AQ={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:{}},PBt=Object.freeze({...Kb,properties:{"notebook.codeActionsOnSave":AQ}});let Mwe=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(r=>r.value).filter(r=>Array.isArray(r.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)&&Cs.Source.contains(new Jn(i))&&this.settings.add(i)})})}updateConfigurationSchema(e){const t={},i={};for(const[n,r]of this.getSourceActions(e))this.settings.add(n),t[n]=s4e(g(4579,"Controls whether '{0}' actions should be run on file save.",r.title)),i[n]=r4e(g(4579,"Controls whether '{0}' actions should be run on file save.",r.title));SQ.properties=t,AQ.properties=i,je.as(Pn.Configuration).notifyConfigurationSchemaUpdated(Rwe)}updateConfigurationSchemaFromContribs(){const e={...SQ.properties},t={...AQ.properties};for(const i of this.settings)e[i]||(e[i]=s4e(g(4579,"Controls whether '{0}' actions should be run on file save.",i)),t[i]=r4e(g(4579,"Controls whether '{0}' actions should be run on file save.",i)));SQ.properties=e,AQ.properties=t,je.as(Pn.Configuration).notifyConfigurationSchemaUpdated(Rwe)}getSourceActions(e){const t=new Map;for(const i of e)for(const n of i.actions){const r=new Jn(n.kind);Cs.Source.contains(r)&&t.set(r.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(r=>r.kind),enumDescriptions:n.map(r=>r.description??r.title)},{type:"string"}]}}}}}}),t=i=>{const n=this._contributedCodeActions.flatMap(o=>o.actions),r=new Map;for(const o of n)!r.has(o.kind)&&i.contains(new Jn(o.kind))&&r.set(o.kind,o);return Array.from(r.values())};return[e(eNe,t(Jn.Empty)),e(iNe,t(Cs.Refactor)),e(nNe,t(Cs.Source))]}};Mwe=D([_(1,Vt),_(2,nt)],Mwe);let Nwe=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 r of n)if(r.value.refactoring)for(const o of r.value.refactoring){const a=he.deserialize(o.when);a&&this.contributions.push({title:o.title,when:a,command:o.command})}})}async provideCodeActions(e,t,i,n){return this.emptyCodeActionsList}_getAdditionalMenuItems(e,t){return e.only!==Cs.Refactor.value&&!t.some(i=>i.kind&&Cs.Refactor.contains(new Jn(i.kind)))?[]:this.contributions.filter(i=>this.contextKeyService.contextMatchesRules(i.when)).map(i=>({id:i.command,title:i.title}))}};Nwe=D([_(1,Le),_(2,nt)],Nwe);const FBt=ih.registerExtensionPoint(LBt),OBt=ih.registerExtensionPoint(NBt);je.as(Pn.Configuration).registerConfiguration(Rwe);je.as(Pn.Configuration).registerConfiguration(PBt);let Pwe=class{constructor(e){e.createInstance(Mwe,FBt),e.createInstance(Nwe,OBt)}};Pwe=D([_(0,we)],Pwe);je.as(hf.Workbench).registerWorkbenchContribution(Pwe,Ms.Eventually);var WB;let YX=(WB=class{constructor(e){e.createKey("listSupportsTypeNavigation",!0),e.createKey("listSupportsKeyboardNavigation",!0)}},WB.ID="workbench.contrib.listContext",WB);YX=D([_(0,Le)],YX);Ju(YX.ID,YX,Cc.BlockStartup);var HB;let JX=(HB=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=pOt();for(const t of e)try{const i=this._instantiationService.createInstance(t);typeof i.dispose=="function"&&this._register(i)}catch(i){bt(i)}}},HB.ID="workbench.contrib.editorFeaturesInstantiator",HB);JX=D([_(0,qt),_(1,we)],JX);Ju(JX.ID,JX,Cc.BlockRestore);let Fwe=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)))}};Fwe=D([_(0,_u),_(1,lo)],Fwe);je.as(hf.Workbench).registerWorkbenchContribution(Fwe,Ms.Eventually);vt.registerCommand("_executeMappedEditsProvider",async(s,e,t,i)=>{const n=s.get(pn),r=s.get(nt),o=await n.createModelReference(e);let a=null;try{const c=r.mappedEditsProvider.ordered(o.object.textEditorModel);if(c.length>0){const l=c[0],d=new li;a=await l.provideMappedEdits(o.object.textEditorModel,t,i,d.token)}}finally{o.dispose()}return a});const NI=_u;var UB;let XX=(UB=class extends V{constructor(e,t,i){super(),this.layoutService=e,this.contextMenuService=t,this.clipboardService=i,this.textInputActions=new Ca(()=>this.createActions()),this.registerListeners()}createActions(){return[new an("undo",g(750,"Undo"),void 0,!0,async()=>Vu().execCommand("undo")),new an("redo",g(751,"Redo"),void 0,!0,async()=>Vu().execCommand("redo")),new Eo,new an("editor.action.clipboardCutAction",g(752,"Cut"),void 0,!0,async()=>Vu().execCommand("cut")),new an("editor.action.clipboardCopyAction",g(753,"Copy"),void 0,!0,async()=>Vu().execCommand("copy")),new an("editor.action.clipboardPasteAction",g(754,"Paste"),void 0,!0,async e=>{if(ld)Vu().execCommand("paste");else{const t=await this.clipboardService.readText();if(tut(e)||iut(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 Eo,new an("editor.action.selectAll",g(755,"Select All"),void 0,!0,async()=>Vu().execCommand("selectAll"))]}registerListeners(){this._register(M.runAndSubscribe(this.layoutService.onDidAddContainer,({container:e,disposables:t})=>{t.add(ue(e,"contextmenu",i=>this.onContextMenu(lt(e),i)))},{container:this.layoutService.mainContainer,disposables:this._store}))}onContextMenu(e,t){if(t.defaultPrevented)return;const i=t.target;if(!Jo(i)||i.nodeName.toLowerCase()!=="input"&&i.nodeName.toLowerCase()!=="textarea")return;tn.stop(t,!0);const n=new Dh(e,t);this.contextMenuService.showContextMenu({getAnchor:()=>n,getActions:()=>this.textInputActions.value,getActionsContext:()=>i})}},UB.ID="workbench.contrib.textInputActionsProvider",UB);XX=D([_(0,NI),_(1,lo),_(2,gg)],XX);Ju(XX.ID,XX,Cc.BlockRestore);var BBt='.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}';gt(BBt,{});const WBt="rendererLog",Ptt="workbench.action.showWindowLog";let kf;const bue=globalThis.vscode;if(typeof bue<"u"&&typeof bue.context<"u"){const s=bue.context.configuration();if(s)kf=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(kf=globalThis._VSCODE_PRODUCT_JSON,N2.VSCODE_DEV&&Object.assign(kf,{nameShort:`${kf.nameShort} Dev`,nameLong:`${kf.nameLong} Dev`,dataFolderName:`${kf.dataFolderName}-dev`,serverDataFolderName:kf.serverDataFolderName?`${kf.serverDataFolderName}-dev`:void 0}),!kf.version){const s=globalThis._VSCODE_PACKAGE_JSON;Object.assign(kf,{version:s.version})}}else kf={},Object.keys(kf).length===0&&Object.assign(kf,{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 HBt=kf;class UBt extends di{constructor(){super({id:"workbench.action.inspectContextKeys",title:Pe(756,"Inspect Context Keys"),category:la.Developer,f1:!0})}run(e){const t=e.get(Le),i=new Z,n=fl(void 0,void 0,i);$f("*","cursor: crosshair !important;",n);const r=document.createElement("div"),o=Vu();o.body.appendChild(r),i.add(Ee(()=>r.remove())),r.style.position="absolute",r.style.pointerEvents="none",r.style.backgroundColor="rgba(255, 0, 0, 0.5)",r.style.zIndex="1000";const a=i.add(new ni(o,"mousemove",!0));i.add(a.event(d=>{const h=d.target,u=So(h);r.style.top=`${u.top}px`,r.style.left=`${u.left}px`,r.style.width=`${u.width}px`,r.style.height=`${u.height}px`}));const c=i.add(new ni(o,"mousedown",!0));M.once(c.event)(d=>{d.preventDefault(),d.stopPropagation()},null,i);const l=i.add(new ni(o,"mouseup",!0));M.once(l.event)(d=>{d.preventDefault(),d.stopPropagation();const h=t.getContext(d.target);console.log(h.collectAllValues()),wt(i)},null,i)}}class EF extends di{constructor(){super({id:"workbench.action.toggleScreencastMode",title:Pe(757,"Toggle Screencast Mode"),category:la.Developer,f1:!0})}run(e){if(EF.disposable){EF.disposable.dispose(),EF.disposable=void 0;return}const t=e.get(_u),i=e.get(Te),n=e.get(Vt),r=new Z,o=t.activeContainer,a=oe(o,fe(".screencast-mouse"));r.add(Ee(()=>a.remove()));const c=oe(o,fe(".screencast-keyboard"));r.add(Ee(()=>c.remove()));const l=r.add(new I),d=r.add(new I),h=r.add(new I);function u(j,ne){ne.add(ne.add(new ni(j,"mousedown",!0)).event(ge=>l.fire(ge))),ne.add(ne.add(new ni(j,"mouseup",!0)).event(ge=>d.fire(ge))),ne.add(ne.add(new ni(j,"mousemove",!0)).event(ge=>h.fire(ge)))}for(const{window:j,disposables:ne}of P8())u(t.getContainer(j),ne);r.add(sm(({window:j,disposables:ne})=>u(t.getContainer(j),ne))),r.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=qa(i.getValue("screencastMode.mouseIndicatorSize")||20,20,100),a.style.height=`${p}px`,a.style.width=`${p}px`};f(),m(),r.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=`${qa(i.getValue("screencastMode.fontSize")||56,20,100)}px`},b=()=>{c.style.bottom=`${qa(i.getValue("screencastMode.verticalOffset")||0,0,90)}%`};let w;const y=()=>{w=qa(i.getValue("screencastMode.keyboardOverlayTimeout")||800,500,5e3)};v(),b(),y(),r.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=r.add(new I),A=r.add(new I),L=r.add(new I),k=r.add(new I);function P(j,ne){ne.add(ne.add(new ni(j,"keydown",!0)).event(ge=>C.fire(ge))),ne.add(ne.add(new ni(j,"compositionstart",!0)).event(ge=>A.fire(ge))),ne.add(ne.add(new ni(j,"compositionupdate",!0)).event(ge=>L.fire(ge))),ne.add(ne.add(new ni(j,"compositionend",!0)).event(ge=>k.fire(ge)))}for(const{window:j,disposables:ne}of P8())P(j,ne);r.add(sm(({window:j,disposables:ne})=>P(j,ne)));let R=0,z,G=!1;const Y=new ln(()=>{c.textContent="",z=void 0,R=0},w);r.add(A.event(j=>{G=!0})),r.add(L.event(j=>{j.data&&G?(R>20&&(c.innerText="",R=0),z=z??oe(c,fe("span.key")),z.textContent=j.data):G&&(c.innerText="",oe(c,fe("span.key",{},"Backspace"))),Y.schedule()})),r.add(k.event(j=>{z=void 0,R++})),r.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 xn(j),De=n.softDispatch(ge,ge.target);if(De.kind===of.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 Be=n.resolveKeyboardEvent(ge),Ct=this._isKbFound(De)&&De.commandId?this.getCommandDetails(De.commandId):void 0;let Ne=Ct?.title,dt=Be.getLabel();if(Ct&&((ne.showCommandGroups??!1)&&Ct.category&&(Ne=`${Ct.category}: ${Ne} `),this._isKbFound(De)&&De.commandId)){const Dt=n.lookupKeybindings(De.commandId).filter(Xi=>Xi.getLabel()?.endsWith(dt??""));Dt.length>0&&(dt=Dt[Dt.length-1].getLabel())}(ne.showCommands??!0)&&Ne&&oe(c,fe("span.title",{},`${Ne} `)),((ne.showKeys??!0)||(ne.showKeybindings??!0)&&this._isKbFound(De))&&(dt=dt?.replace("UpArrow","↑")?.replace("DownArrow","↓")?.replace("LeftArrow","←")?.replace("RightArrow","→"),oe(c,fe("span.key",{},dt??""))),R++,Y.schedule()})),EF.disposable=r}_isKbFound(e){return e.kind===of.KbFound}getCommandDetails(e){const t=Yn.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=vt.getCommand(e);if(i&&i.metadata?.description)return{title:typeof i.metadata.description=="string"?i.metadata.description:i.metadata.description.value}}}class VBt extends di{constructor(){super({id:"workbench.action.logStorage",title:Pe(758,"Log Storage Database Contents"),category:la.Developer,f1:!0})}run(e){const t=e.get(Gi),i=e.get(ir);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 zBt extends di{constructor(){super({id:"workbench.action.logWorkingCopies",title:Pe(761,"Log Working Copies"),category:la.Developer,f1:!0})}async run(e){const t=e.get(Pm),i=e.get(X6),n=e.get(Ke),r=e.get(_ce),o=await i.getBackups(),a=["","[Working Copies]",...t.workingCopies.length>0?t.workingCopies.map(c=>`${c.isDirty()?"● ":""}${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""],"","[Backups]",...o.length>0?o.map(c=>`${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""]];n.info(a.join(` + `}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)wt(e.values());this.items.clear(),this.enabled=!1}}onEditorsChanged(){for(const e of this.editorService.visibleTextEditorControls)if(jo(e)){const t=e.getModel(),i=dC.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 r=this.instantiationService.createInstance(wwe,n),o=new bwe(n.textEditorModel,e,r,this.configurationService);this.items.has(t.uri)||this.items.set(t.uri,new Map),this.items.get(t.uri)?.set(e.getId(),new uBt(r,o))}}}for(const[e,t]of this.items)for(const i of t.keys())this.editorService.visibleTextEditorControls.find(n=>jo(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()}};t4e=D([_(0,ti),_(1,we),_(2,Te),_(3,Fr)],t4e);on(dC.ID,dC,ai.AfterFirstRender);Re(class extends it{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(Itt,t.getModel());if(tr(n))return i.invokeFunction(Xae,t,n,cm.Explicit,hu.None,Ue.None,!0)}});async function Itt(s,e){const t=s.get(G6),i=s.get(Fl),n=s.get(pn),r=await hBt(t,e.uri,e.getLanguageId(),Py(e));if(!r)return null;const o=[],a=await n.createModelReference(r);try{if(!i.canComputeDirtyDiff(r,e.uri))return;const c=await i.computeDirtyDiff(r,e.uri,!1);if(!tr(c))return;for(const l of c)o.push(e.validateRange(new F(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber||l.modifiedStartLineNumber,Number.MAX_SAFE_INTEGER)))}finally{a.dispose()}return o}let ywe=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===Sn.AUTO,n)}doTrimTrailingWhitespace(e,t,i){let n=[],r=[];const o=Mce(e,this.codeEditorService);if(o&&(n=o.getSelections(),t)){r=n.map(l=>l.getPosition());const c=pc.get(o)?.getSessionEnclosingRange();if(c)for(let l=c.startLineNumber;l<=c.endLineNumber;l++)r.push(new re(l,e.getLineMaxColumn(l)))}const a=Stt(e,r,i);a.length&&e.pushEditOperations(n,a,c=>n)}};ywe=D([_(0,Te),_(1,qt)],ywe);function Mce(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 Cwe=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=M_(i)===-1;if(!t||n)return;const r=[es.insert(new re(t,e.getLineMaxColumn(t)),e.getEOL())],o=Mce(e,this.codeEditorService);o?o.executeEdits("insertFinalNewLine",r,o.getSelections()):e.pushEditOperations([],r,()=>null)}};Cwe=D([_(0,Te),_(1,qt)],Cwe);let Swe=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===Sn.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=[],r=0;const o=Mce(e,this.codeEditorService);if(o&&(n=o.getSelections(),t))for(let d=0,h=n.length;dr&&(r=u)}const a=this.findLastNonEmptyLine(e),c=Math.max(a+1,r+1),l=e.validateRange(new F(c,1,i,e.getLineMaxColumn(i)));l.isEmpty()||(e.pushEditOperations(n,[es.delete(l)],d=>n),o?.setSelections(n))}};Swe=D([_(0,Te),_(1,qt)],Swe);let Awe=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===Sn.AUTO)return;const r=e.textEditorModel,o={overrideIdentifier:r.getLanguageId(),resource:r.uri},a=new hu(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",o))return;const l=Mce(r,this.codeEditorService)||r,d=this.configurationService.getValue("editor.formatOnSaveMode",o);if(d==="file")await this.instantiationService.invokeFunction($ve,l,cm.Silent,a,n);else{const h=await this.instantiationService.invokeFunction(Itt,jo(l)?l.getModel():l);h===null&&d==="modificationsIfAvailable"?await this.instantiationService.invokeFunction($ve,l,cm.Silent,a,n):h&&await this.instantiationService.invokeFunction(Xae,l,h,cm.Silent,a,n,!1)}}};Awe=D([_(0,Te),_(1,qt),_(2,we)],Awe);let Ewe=class extends V{constructor(e,t,i,n,r,o){super(),this.configurationService=e,this.instantiationService=t,this.languageFeaturesService=i,this.hostService=n,this.editorService=r,this.codeEditorService=o,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"&&Cs.Source.contains(new Jn(a))),r=new li,o=[];for(const a of n)o.push(new Jn(a));await this.applyOnSaveActions(e,o,[],hu.None,r.token)}}async participate(e,t,i,n){if(!e.textEditorModel)return;const r=e.textEditorModel,o={overrideIdentifier:r.getLanguageId(),resource:r.uri},a=this.configurationService.getValue("editor.codeActionsOnSave",o);if(!a||t.reason===Sn.AUTO||t.reason!==Sn.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)=>Cs.SourceFixAll.contains(u)?Cs.SourceFixAll.contains(f)?0:-1:Cs.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 Jn(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===Sn.EXPLICIT);await this.applyOnSaveActions(r,h,d,i,n)}createCodeActionsOnSave(e){const t=e.map(i=>new Jn(i));return t.filter(i=>t.every(n=>n.equals(i)||!n.contains(i)))}async applyOnSaveActions(e,t,i,n,r){const o=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,o,r);if(r.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(Het,l,Hx.OnSave,{},r),r.isCancellationRequested)return}catch{}finally{c.dispose()}}}getActionsToRun(e,t,i,n,r){return rB(this.languageFeaturesService.codeActionProvider,e,e.getFullModelRange(),{type:Ah.Auto,triggerAction:ag.OnSave,filter:{include:t,excludes:i,includeSourceActions:!0}},n,r)}};Ewe=D([_(0,Te),_(1,we),_(2,nt),_(3,Dc),_(4,ti),_(5,qt)],Ewe);let xwe=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(ywe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Ewe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Awe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Cwe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Swe)))}};xwe=D([_(0,we),_(1,Fr)],xwe);const gBt=je.as(hf.Workbench);gBt.registerWorkbenchContribution(xwe,Ms.Restored);const nre=class nre extends di{constructor(){super({id:nre.ID,title:{...Pe(728,"Toggle Minimap"),mnemonicTitle:g(729,"&&Minimap")},category:la.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)}};nre.ID="editor.action.toggleMinimap";let Dwe=nre;Et(Dwe);const cO=class cO extends di{constructor(){super({id:cO.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(cO.multiCursorModifierConfigurationKey,n)}};cO.ID="workbench.action.toggleMultiCursorModifier",cO.multiCursorModifierConfigurationKey="editor.multiCursorModifier";let c9=cO;const vNe=new Q("multiCursorModifier","altKey");let kwe=class extends V{constructor(e,t){super(),this.configurationService=e,this._multiCursorModifier=vNe.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)}};kwe=D([_(0,Te),_(1,Le)],kwe);je.as(hf.Workbench).registerWorkbenchContribution(kwe,Ms.Restored);Et(c9);Yn.appendMenuItem(_e.MenubarSelectionMenu,{group:"4_config",command:{id:c9.ID,title:g(731,"Switch to Alt+Click for Multi-Cursor")},when:vNe.isEqualTo("ctrlCmd"),order:1});Yn.appendMenuItem(_e.MenubarSelectionMenu,{group:"4_config",command:{id:c9.ID,title:jt?g(732,"Switch to Cmd+Click for Multi-Cursor"):g(733,"Switch to Ctrl+Click for Multi-Cursor")},when:vNe.isEqualTo("altKey"),order:1});const sre=class sre extends di{constructor(){super({id:sre.ID,title:{...Pe(734,"Toggle Control Characters"),mnemonicTitle:g(735,"Render &&Control Characters")},category:la.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)}};sre.ID="editor.action.toggleRenderControlCharacter";let Iwe=sre;Et(Iwe);const Ttt="transientWordWrapState",bNe="isWordWrapMinified",wNe="isDominatedByLongLines",Ltt=new Q("canToggleWordWrap",!1,!0),Rtt=new Q("editorWordWrap",!1,g(736,"Whether the editor is currently using word wrapping."));function VX(s,e,t){t.setTransientModelProperty(s,Ttt,e)}function zX(s,e){return e.getTransientModelProperty(s,Ttt)}const Nce="editor.action.toggleWordWrap";class fBt extends it{constructor(){super({id:Nce,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(qt);if(!MW(i,t))return;const n=t.getModel(),r=zX(n,i);let o;r?o=null:o={wordWrapOverride:t.getOption(x.wrappingInfo).wrappingColumn===-1?"on":"off"},VX(n,o,i);const a=pBt(t,i);if(a){const c=a.getOriginalEditor(),l=a.getModifiedEditor(),d=c===t?l:c;MW(i,d)&&(VX(d.getModel(),o,i),a.updateOptions({}))}}}function pBt(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 PB;let $X=(PB=class extends V{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._codeEditorService=i;const r=this._editor.getOptions().get(x.wrappingInfo),o=this._contextKeyService.createKey(bNe,r.isWordWrapMinified),a=this._contextKeyService.createKey(wNe,r.isDominatedByLongLines);let c=!1;this._register(e.onDidChangeConfiguration(d=>{if(!d.hasChanged(x.wrappingInfo))return;const u=this._editor.getOptions().get(x.wrappingInfo);o.set(u.isWordWrapMinified),a.set(u.isDominatedByLongLines),c||l()})),this._register(e.onDidChangeModel(d=>{l()})),this._register(i.onDidChangeTransientModelProperty(()=>{l()}));const l=()=>{if(!MW(this._codeEditorService,this._editor))return;const d=zX(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})}},PB.ID="editor.contrib.toggleWordWrapController",PB);$X=D([_(1,Le),_(2,qt)],$X);var FB;let GX=(FB=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=zX(e.getModel(),this._codeEditorService),n=zX(t.getModel(),this._codeEditorService);i&&!n&&MW(this._codeEditorService,e)&&(VX(t.getModel(),i,this._codeEditorService),this._diffEditor.updateOptions({})),!i&&n&&MW(this._codeEditorService,t)&&(VX(e.getModel(),n,this._codeEditorService),this._diffEditor.updateOptions({}))}},FB.ID="diffeditor.contrib.toggleWordWrapController",FB);GX=D([_(1,qt)],GX);function MW(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 OB;let KX=(OB=class extends V{constructor(e,t,i){super(),this._editorService=e,this._codeEditorService=t,this._contextService=i,this._register(M.runAndSubscribe(sm,({window:n,disposables:r})=>{r.add(ue(n,"focus",()=>this._update(),!0)),r.add(ue(n,"blur",()=>this._update(),!0))},{window:ri,disposables:this._store})),this._register(this._editorService.onDidActiveEditorChange(()=>this._update())),this._canToggleWordWrap=Ltt.bindTo(this._contextService),this._editorWordWrap=Rtt.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(MW(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)}},OB.ID="workbench.contrib.editorWordWrapContextKeyTracker",OB);KX=D([_(0,ti),_(1,qt),_(2,Le)],KX);Ju(KX.ID,KX,Cc.AfterRestored);on($X.ID,$X,ai.Eager);Eqe(GX.ID,GX);Re(fBt);Yn.appendMenuItem(_e.EditorTitle,{command:{id:Nce,title:g(738,"Disable wrapping for this file"),icon:ve.wordWrap},group:"navigation",order:1,when:he.and(he.has(wNe),he.has(bNe))});Yn.appendMenuItem(_e.EditorTitle,{command:{id:Nce,title:g(739,"Enable wrapping for this file"),icon:ve.wordWrap},group:"navigation",order:1,when:he.and(J.inDiffEditor.negate(),he.has(wNe),he.not(bNe))});Yn.appendMenuItem(_e.MenubarViewMenu,{command:{id:Nce,title:g(740,"&&Word Wrap"),toggled:Rtt,precondition:Ltt},order:1,group:"5_editor"});const rre=class rre extends di{constructor(){super({id:rre.ID,title:{...Pe(741,"Toggle Render Whitespace"),mnemonicTitle:g(742,"&&Render Whitespace")},category:la.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)}};rre.ID="editor.action.toggleRenderWhitespace";let Twe=rre;Et(Twe);class mBt{constructor(){this._registeredGutterActionsGenerators=new Set}registerGutterActionsGenerator(e){return this._registeredGutterActionsGenerators.add(e),{dispose:()=>{this._registeredGutterActionsGenerators.delete(e)}}}getGutterActionsGenerators(){return Array.from(this._registeredGutterActionsGenerators.values())}}je.add("gutterActionsRegistry",new mBt);const _Bt=je.as("gutterActionsRegistry");var BB;let qX=(BB=class extends V{constructor(e,t,i,n,r){super(),this.editor=e,this.contextMenuService=t,this.menuService=i,this.contextKeyService=n,this.instantiationService=r,this._register(this.editor.onMouseDown(o=>this.doShow(o,!1)))}show(e){this.doShow(e,!0)}doShow(e,t){const i=this.editor.getModel();if(!e.event.rightButton&&!(jt&&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 n=e.target.position.lineNumber,r=this.contextKeyService.createOverlay([["editorLineNumber",n]]),o=this.menuService.createMenu(_e.EditorLineNumberContext,r),a=[];this.instantiationService.invokeFunction(c=>{for(const d of _Bt.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=o.getActions({arg:{lineNumber:n,uri:i.uri},shouldForwardArgs:!0});if(a.push(...l),e.target.type===Mt.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,Lb.PROGRAMMATIC)}this.contextMenuService.showContextMenu({getAnchor:()=>e.event,getActions:()=>Eo.join(...a.map(d=>d[1])),onHide:()=>o.dispose()})})}},BB.ID="workbench.contrib.editorLineNumberContextMenu",BB);qX=D([_(1,lo),_(2,Wa),_(3,Le),_(4,we)],qX);on(qX.ID,qX,ai.AfterFirstRender);var yu,ry;let xy=(ry=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this._extensionService=e,this._extensionEnablementService=t,this._configService=i,this._notificationService=n,this._dialogService=r,this._quickInputService=o,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(wW.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(yu.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(o=>o==="Formatters"||o==="Programming Languages"),r=i.categories?.find(o=>o==="Formatters"||o==="Programming Languages");return n&&!r?-1:!n&&r?1:t.name.localeCompare(i.name)}),yu.extensionIds.length=0,yu.extensionItemLabels.length=0,yu.extensionDescriptions.length=0,yu.extensionIds.push(null),yu.extensionItemLabels.push(g(4529,"None")),yu.extensionDescriptions.push(g(4530,"None"));for(const t of e)(t.main||t.browser)&&(yu.extensionIds.push(t.identifier.value),yu.extensionItemLabels.push(t.displayName??""),yu.extensionDescriptions.push(t.description??""))}static _maybeQuotes(e){return e.match(/\s/)?`'${e}'`:e}async _analyzeFormatter(e,t,i){const n=this._configService.getValue(yu.configName,{resource:i.uri,overrideIdentifier:i.getLanguageId()});if(n){const a=t.find(l=>An.equals(l.extensionId,n));if(a)return a;const c=await this._extensionService.getExtension(n);if(c&&this._extensionEnablementService.isEnabled(Cce(c))){const l=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return e===bW.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 r=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.",yu._maybeQuotes(r))}async _selectFormatter(e,t,i,n){const r=await this._analyzeFormatter(n,e,t);if(typeof r!="string")return r;if(i!==cm.Silent){const{confirmed:o}=await this._dialogService.confirm({message:g(4535,"Configure Default Formatter"),detail:r,primaryButton:g(4536,"&&Configure...")});if(o)return this._pickAndPersistDefaultFormatter(e,t)}else this._notificationService.prompt(Ze.Info,r,[{label:g(4537,"Configure..."),run:()=>this._pickAndPersistDefaultFormatter(e,t)}],{priority:Z2.SILENT})}async _pickAndPersistDefaultFormatter(e,t){const i=e.map((o,a)=>({index:a,label:o.displayName||(o.extensionId?o.extensionId.value:"?"),description:o.extensionId&&o.extensionId.value})),n=this._languageService.getLanguageName(t.getLanguageId())||t.getLanguageId(),r=await this._quickInputService.pick(i,{placeHolder:g(4538,"Select a default formatter for '{0}' files",yu._maybeQuotes(n))});if(!(!r||!e[r.index].extensionId))return this._configService.updateValue(yu.configName,e[r.index].extensionId.value,{resource:t.uri,overrideIdentifier:t.getLanguageId()}),e[r.index]}_updateStatus(){this._languageStatusStore.clear();const e=m6(this._editorService.activeTextEditorControl);if(!e||!e.hasModel())return;const t=e.getModel(),i=Jae(this._languageFeaturesService.documentFormattingEditProvider,this._languageFeaturesService.documentRangeFormattingEditProvider,t);if(i.length===0)return;const n=new li;this._languageStatusStore.add(Ee(()=>n.dispose(!0))),this._analyzeFormatter(bW.File,i,t).then(r=>{if(n.token.isCancellationRequested||typeof r!="string")return;const o={id:`formatter/configure/dfl/${ao()}`,title:g(4539,"Configure...")};this._languageStatusStore.add(vt.registerCommand(o.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:Ze.Error,label:g(4541,"Formatting"),detail:r,busy:!1,source:"",command:o,accessibilityInfo:void 0}))})}},yu=ry,ry.configName="editor.defaultFormatter",ry.extensionIds=[],ry.extensionItemLabels=[],ry.extensionDescriptions=[],ry);xy=yu=D([_(0,ps),_(1,Ol),_(2,Te),_(3,wi),_(4,ir),_(5,Tn),_(6,Di),_(7,nt),_(8,mce),_(9,ti)],xy);je.as(hf.Workbench).registerWorkbenchContribution(xy,Ms.Restored);je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{[xy.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:xy.extensionIds,enumItemLabels:xy.extensionItemLabels,markdownEnumDescriptions:xy.extensionDescriptions}}});function Mtt(s,e,t,i){function n(r){return r.extensionId?An.toKey(r.extensionId):"unknown"}s.publicLog2("formatterpick",{mode:e,extensions:t.map(n),pick:i?n(i):"none"})}async function Ntt(s,e,t){const i=s.get(Tn),n=s.get(Te),r=s.get(Di),o={resource:e.uri,overrideIdentifier:e.getLanguageId()},a=n.getValue(xy.configName,o);let c;const l=t.map((u,f)=>{const p=An.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=r.getLanguageName(e.getLanguageId())||e.getLanguageId(),f=await i.pick(l,{placeHolder:g(4538,"Select a default formatter for '{0}' files",xy._maybeQuotes(u))});f&&t[f.index].extensionId&&n.updateValue(xy.configName,t[f.index].extensionId.value,o);return}else return h.index;else return}Re(class extends it{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),r=e.get(Ji),o=e.get(nt),a=t.getModel(),c=Jae(o.documentFormattingEditProvider,o.documentRangeFormattingEditProvider,a),l=await n.invokeFunction(Ntt,a,c);typeof l=="number"&&await n.invokeFunction(vXe,c[l],t,cm.Explicit,Ue.None),Mtt(r,"document",c,typeof l=="number"&&c[l]||void 0)}});Re(class extends it{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(nt),r=e.get(Ji),o=t.getModel();let a=t.getSelection();a.isEmpty()&&(a=new F(a.startLineNumber,1,a.startLineNumber,o.getLineMaxColumn(a.startLineNumber)));const c=n.documentRangeFormattingEditProvider.ordered(o),l=await i.invokeFunction(Ntt,o,c);typeof l=="number"&&await i.invokeFunction(_Xe,c[l],t,a,Ue.None,!0),Mtt(r,"range",c,typeof l=="number"&&c[l]||void 0)}});const ZU="workbench.view.extensions";var Qr;(function(s){s[s.Installing=0]="Installing",s[s.Installed=1]="Installed",s[s.Uninstalling=2]="Uninstalling",s[s.Uninstalled=3]="Uninstalled"})(Qr||(Qr={}));var qm;(function(s){s.ReloadWindow="reloadWindow",s.RestartExtensions="restartExtensions",s.DownloadUpdate="downloadUpdate",s.ApplyUpdate="applyUpdate",s.QuitAndInstall="quitAndInstall"})(qm||(qm={}));var l9;(function(s){s.Readme="readme",s.Features="features",s.Changelog="changelog",s.Dependencies="dependencies",s.ExtensionPack="extensionPack"})(l9||(l9={}));const vBt="extensions.autoUpdate";let i4e=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?Na(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};i4e=D([_(1,Xr)],i4e);const bBt="workbench.extensions.action.toggleIgnoreExtension",wBt="workbench.extensions.action.installVSIX";new Q("hasOutdatedExtensions",!1);new Q("hasGallery",!1);const yBt="_theme_",CBt="0_install",SBt="0_update";new _e("extensionsSearchActionsMenu");g(5291,"Views");const ABt=oi("default-view-icon",ve.window,g(5292,"Default view icon."));var oI;(function(s){s.ViewContainersRegistry="workbench.registry.view.containers",s.ViewsRegistry="workbench.registry.view"})(oI||(oI={}));var io;(function(s){s[s.Sidebar=0]="Sidebar",s[s.Panel=1]="Panel",s[s.AuxiliaryBar=2]="AuxiliaryBar"})(io||(io={}));io.Sidebar,io.Panel,io.AuxiliaryBar;function QX(s){switch(s){case io.Sidebar:return"sidebar";case io.Panel:return"panel";case io.AuxiliaryBar:return"auxiliarybar"}}class EBt 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 r=e;return r.openCommandActionDescriptor=i?.doNotRegisterOpenCommand?void 0:r.openCommandActionDescriptor??{id:r.id},Pj(this.viewContainers,t,[]).push(r),i?.isDefault&&this.defaultViewContainers.push(r),this._onDidRegister.fire({viewContainer:r,viewContainerLocation:t}),r}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)}}je.add(oI.ViewContainersRegistry,new EBt);var jX;(function(s){s.Open="2_open",s.Debug="4_debug",s.SCM="5_scm",s.More="9_more"})(jX||(jX={}));function xBt(s,e){const t=s.group??jX.More,i=e.group??jX.More;return t!==i?t.localeCompare(i):(s.order??5)-(e.order??5)}class DBt 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 q7}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,r]of t)this._viewWelcomeContents.add(e,r),i.set(n,Ee(()=>{this._viewWelcomeContents.delete(e,r),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(xBt)}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=[],r=[];for(const o of i)e.includes(o)?n.push(o):r.push(o);return n.length&&(r.length?this._views.set(t,r):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),n}}je.add(oI.ViewsRegistry,new DBt);var Lwe;(function(s){s[s.Default=0]="Default",s[s.Expand=1]="Expand"})(Lwe||(Lwe={}));var n4e;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(n4e||(n4e={}));class vue{constructor(e,t){this.resolved=!1,this._hasResolve=!1,mp(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 rw 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 kBt(s,e){const t=await s.openPaneComposite(ZU,io.Sidebar,!0);t&&(t?.getViewPaneContainer()).search(e)}Re(class extends it{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(bi),n=e.get(Mm),r=e.get(wi),o=e.get(ir),a=e.get(nt),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())r.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 o.confirm({message:h,primaryButton:g(4551,"&&Install Formatter...")});u&&kBt(n,`category:formatters ${d}`)}}});var Sg,oy;let H1=(oy=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(PA.setFoldingRangeProviderSelector(this._selectFoldingRangeProvider.bind(this))),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered(),Sg.extensionIds.length=0,Sg.extensionItemLabels.length=0,Sg.extensionDescriptions.length=0,Sg.extensionIds.push(null),Sg.extensionItemLabels.push(g(743,"All")),Sg.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(r=>r==="Programming Languages")?e.push(n):t.push(n));const i=(n,r)=>n.name.localeCompare(r.name);for(const n of e.sort(i))Sg.extensionIds.push(n.identifier.value),Sg.extensionItemLabels.push(n.displayName??""),Sg.extensionDescriptions.push(n.description??"");for(const n of t.sort(i))Sg.extensionIds.push(n.identifier.value),Sg.extensionItemLabels.push(n.displayName??""),Sg.extensionDescriptions.push(n.description??"")}_selectFoldingRangeProvider(e,t){const i=this._configurationService.getValue(Sg.configName,{overrideIdentifier:t.getLanguageId()});if(i)return e.filter(n=>n.id===i)}},Sg=oy,oy.configName="editor.defaultFoldingRangeProvider",oy.extensionIds=[],oy.extensionItemLabels=[],oy.extensionDescriptions=[],oy);H1=Sg=D([_(0,ps),_(1,Te)],H1);je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{[H1.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:H1.extensionIds,enumItemLabels:H1.extensionItemLabels,markdownEnumDescriptions:H1.extensionDescriptions}}});je.as(hf.Workbench).registerWorkbenchContribution(H1,Ms.Restored);var IBt=".monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}";gt(IBt,{});let d9=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:(Ns(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,r){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=oe(e,fe("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??Fo("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const o=this._register(new ni(this.el,"click")),a=this._register(new ni(this.el,"keypress")),c=M.chain(a.event,h=>h.map(u=>new xn(u)).filter(u=>u.keyCode===S.Enter)),l=this._register(new ni(this.el,ur.Tap)).event;this._register(md.addTarget(this.el));const d=M.any(o.event,c,l);this._register(d(h=>{this.enabled&&(tn.stop(h,!0),i?.opener?i.opener(this._link.href):r.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)}};d9=D([_(3,tc),_(4,Ar)],d9);var CQ,ek;let jM=(ek=class{static get(e){return e.getContribution(CQ.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=CQ.IsReading.bindTo(t)}dispose(){this._sessionDispoosables.dispose(),this._ctxIsReading.reset(),this._ariaElement.remove()}_reset(){Ns(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 li;this._sessionDispoosables.add(i);for(const c of t)await c.resolve(i.token);if(i.token.isCancellationRequested)return;const n=this._editor.getModel(),r=[];let o=0,a=!1;for(const c of t){const l=n.getValueInRange({startLineNumber:e,startColumn:o+1,endLineNumber:e,endColumn:c.hint.position.column});if(l.length>0&&(r.push(l),o=c.hint.position.column-1),o>750){r.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(d9,d,{href:gtt(u.command),label:u.label,title:u.command.title},void 0);this._sessionDispoosables.add(f)}else d.innerText+=u.label;r.push(d)}a||r.push(n.getValueInRange({startLineNumber:e,startColumn:o+1,endLineNumber:e,endColumn:Number.MAX_SAFE_INTEGER})),ca(this._ariaElement,...r),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=TW.get(this._editor)?.getInlayHintsForLine(e);!t||t.length===0?this._accessibilitySignalService.playSignal(ll.noInlayHints):this._read(e,t)}stopInlayHintsReading(){this._reset(),this._editor.focus()}},CQ=ek,ek.IsReading=new Q("isReadingLineWithInlayHints",!1,{type:"boolean",description:g(746,"Whether the current line and its inlay hints are currently focused")}),ek.ID="editor.contrib.InlayHintsAccessibility",ek);jM=CQ=D([_(1,Le),_(2,uv),_(3,we)],jM);Et(class extends mf{constructor(){super({id:"inlayHints.startReadingLineWithHint",title:Pe(748,"Read Line With Inline Hints"),precondition:J.hasInlayHintsProvider,f1:!0})}runEditorCommand(e,t){jM.get(t)?.startInlayHintsReading()}});Et(class extends mf{constructor(){super({id:"inlayHints.stopReadingLineWithHint",title:Pe(749,"Stop Inlay Hints Reading"),precondition:jM.IsReading,f1:!0,keybinding:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(e,t){jM.get(t)?.stopInlayHintsReading()}});on(jM.ID,jM,ai.Lazy);var Nv;(function(s){s.languages="languages",s.actions="actions",s.kind="kind",s.title="title",s.description="description"})(Nv||(Nv={}));const TBt=Object.freeze({type:"array",markdownDescription:g(4552,"Configure which editor to use for a resource."),items:{type:"object",required:[Nv.languages,Nv.actions],properties:{[Nv.languages]:{type:"array",description:g(4553,"Language modes that the code actions are enabled for."),items:{type:"string"}},[Nv.actions]:{type:"object",required:[Nv.kind,Nv.title],properties:{[Nv.kind]:{type:"string",markdownDescription:g(4554,"`CodeActionKind` of the contributed code action.")},[Nv.title]:{type:"string",description:g(4555,"Label for the code action used in the UI.")},[Nv.description]:{type:"string",description:g(4556,"Description of what the code action does.")}}}}}}),LBt={extensionPoint:"codeActions",deps:[DW],jsonSchema:TBt};class RBt 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(o=>o.actions.map(a=>({...a,languages:o.languages}))).flat(),n=[g(4557,"Title"),g(4558,"Kind"),g(4559,"Description"),g(4560,"Languages")],r=i.sort((o,a)=>o.title.localeCompare(a.title)).map(o=>[o.title,new Nt().appendMarkdown(`\`${o.kind}\``),o.description??"",new Nt().appendMarkdown(`${o.languages.map(a=>`\`${a}\``).join(" ")}`)]);return{data:{headers:n,rows:r},dispose:()=>{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"codeActions",label:g(4561,"Code Actions"),access:{canToggle:!1},renderer:new yi(RBt)});var HE;(function(s){s.when="when",s.title="title",s.command="command"})(HE||(HE={}));const MBt=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:[HE.title,HE.when,HE.command],properties:{[HE.title]:{type:"string",description:g(4565,"Label for the documentation used in the UI.")},[HE.when]:{type:"string",description:g(4566,"When clause.")},[HE.command]:{type:"string",description:g(4567,"Command executed.")}}}}}}),NBt={extensionPoint:"documentation",deps:[DW],jsonSchema:MBt},s4e=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}),r4e=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}),SQ={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:ct.LANGUAGE_OVERRIDABLE},Rwe=Object.freeze({...Kb,properties:{"editor.codeActionsOnSave":SQ}}),AQ={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:{}},PBt=Object.freeze({...Kb,properties:{"notebook.codeActionsOnSave":AQ}});let Mwe=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(r=>r.value).filter(r=>Array.isArray(r.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)&&Cs.Source.contains(new Jn(i))&&this.settings.add(i)})})}updateConfigurationSchema(e){const t={},i={};for(const[n,r]of this.getSourceActions(e))this.settings.add(n),t[n]=s4e(g(4579,"Controls whether '{0}' actions should be run on file save.",r.title)),i[n]=r4e(g(4579,"Controls whether '{0}' actions should be run on file save.",r.title));SQ.properties=t,AQ.properties=i,je.as(Pn.Configuration).notifyConfigurationSchemaUpdated(Rwe)}updateConfigurationSchemaFromContribs(){const e={...SQ.properties},t={...AQ.properties};for(const i of this.settings)e[i]||(e[i]=s4e(g(4579,"Controls whether '{0}' actions should be run on file save.",i)),t[i]=r4e(g(4579,"Controls whether '{0}' actions should be run on file save.",i)));SQ.properties=e,AQ.properties=t,je.as(Pn.Configuration).notifyConfigurationSchemaUpdated(Rwe)}getSourceActions(e){const t=new Map;for(const i of e)for(const n of i.actions){const r=new Jn(n.kind);Cs.Source.contains(r)&&t.set(r.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(r=>r.kind),enumDescriptions:n.map(r=>r.description??r.title)},{type:"string"}]}}}}}}),t=i=>{const n=this._contributedCodeActions.flatMap(o=>o.actions),r=new Map;for(const o of n)!r.has(o.kind)&&i.contains(new Jn(o.kind))&&r.set(o.kind,o);return Array.from(r.values())};return[e(eNe,t(Jn.Empty)),e(iNe,t(Cs.Refactor)),e(nNe,t(Cs.Source))]}};Mwe=D([_(1,Vt),_(2,nt)],Mwe);let Nwe=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 r of n)if(r.value.refactoring)for(const o of r.value.refactoring){const a=he.deserialize(o.when);a&&this.contributions.push({title:o.title,when:a,command:o.command})}})}async provideCodeActions(e,t,i,n){return this.emptyCodeActionsList}_getAdditionalMenuItems(e,t){return e.only!==Cs.Refactor.value&&!t.some(i=>i.kind&&Cs.Refactor.contains(new Jn(i.kind)))?[]:this.contributions.filter(i=>this.contextKeyService.contextMatchesRules(i.when)).map(i=>({id:i.command,title:i.title}))}};Nwe=D([_(1,Le),_(2,nt)],Nwe);const FBt=ih.registerExtensionPoint(LBt),OBt=ih.registerExtensionPoint(NBt);je.as(Pn.Configuration).registerConfiguration(Rwe);je.as(Pn.Configuration).registerConfiguration(PBt);let Pwe=class{constructor(e){e.createInstance(Mwe,FBt),e.createInstance(Nwe,OBt)}};Pwe=D([_(0,we)],Pwe);je.as(hf.Workbench).registerWorkbenchContribution(Pwe,Ms.Eventually);var WB;let YX=(WB=class{constructor(e){e.createKey("listSupportsTypeNavigation",!0),e.createKey("listSupportsKeyboardNavigation",!0)}},WB.ID="workbench.contrib.listContext",WB);YX=D([_(0,Le)],YX);Ju(YX.ID,YX,Cc.BlockStartup);var HB;let JX=(HB=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=pOt();for(const t of e)try{const i=this._instantiationService.createInstance(t);typeof i.dispose=="function"&&this._register(i)}catch(i){bt(i)}}},HB.ID="workbench.contrib.editorFeaturesInstantiator",HB);JX=D([_(0,qt),_(1,we)],JX);Ju(JX.ID,JX,Cc.BlockRestore);let Fwe=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)))}};Fwe=D([_(0,_u),_(1,lo)],Fwe);je.as(hf.Workbench).registerWorkbenchContribution(Fwe,Ms.Eventually);vt.registerCommand("_executeMappedEditsProvider",async(s,e,t,i)=>{const n=s.get(pn),r=s.get(nt),o=await n.createModelReference(e);let a=null;try{const c=r.mappedEditsProvider.ordered(o.object.textEditorModel);if(c.length>0){const l=c[0],d=new li;a=await l.provideMappedEdits(o.object.textEditorModel,t,i,d.token)}}finally{o.dispose()}return a});const NI=_u;var UB;let XX=(UB=class extends V{constructor(e,t,i){super(),this.layoutService=e,this.contextMenuService=t,this.clipboardService=i,this.textInputActions=new Ca(()=>this.createActions()),this.registerListeners()}createActions(){return[new an("undo",g(750,"Undo"),void 0,!0,async()=>Vu().execCommand("undo")),new an("redo",g(751,"Redo"),void 0,!0,async()=>Vu().execCommand("redo")),new Eo,new an("editor.action.clipboardCutAction",g(752,"Cut"),void 0,!0,async()=>Vu().execCommand("cut")),new an("editor.action.clipboardCopyAction",g(753,"Copy"),void 0,!0,async()=>Vu().execCommand("copy")),new an("editor.action.clipboardPasteAction",g(754,"Paste"),void 0,!0,async e=>{if(ld)Vu().execCommand("paste");else{const t=await this.clipboardService.readText();if(tut(e)||iut(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 Eo,new an("editor.action.selectAll",g(755,"Select All"),void 0,!0,async()=>Vu().execCommand("selectAll"))]}registerListeners(){this._register(M.runAndSubscribe(this.layoutService.onDidAddContainer,({container:e,disposables:t})=>{t.add(ue(e,"contextmenu",i=>this.onContextMenu(lt(e),i)))},{container:this.layoutService.mainContainer,disposables:this._store}))}onContextMenu(e,t){if(t.defaultPrevented)return;const i=t.target;if(!Jo(i)||i.nodeName.toLowerCase()!=="input"&&i.nodeName.toLowerCase()!=="textarea")return;tn.stop(t,!0);const n=new Dh(e,t);this.contextMenuService.showContextMenu({getAnchor:()=>n,getActions:()=>this.textInputActions.value,getActionsContext:()=>i})}},UB.ID="workbench.contrib.textInputActionsProvider",UB);XX=D([_(0,NI),_(1,lo),_(2,gg)],XX);Ju(XX.ID,XX,Cc.BlockRestore);var BBt='.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}';gt(BBt,{});const WBt="rendererLog",Ptt="workbench.action.showWindowLog";let kf;const bue=globalThis.vscode;if(typeof bue<"u"&&typeof bue.context<"u"){const s=bue.context.configuration();if(s)kf=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(kf=globalThis._VSCODE_PRODUCT_JSON,N2.VSCODE_DEV&&Object.assign(kf,{nameShort:`${kf.nameShort} Dev`,nameLong:`${kf.nameLong} Dev`,dataFolderName:`${kf.dataFolderName}-dev`,serverDataFolderName:kf.serverDataFolderName?`${kf.serverDataFolderName}-dev`:void 0}),!kf.version){const s=globalThis._VSCODE_PACKAGE_JSON;Object.assign(kf,{version:s.version})}}else kf={},Object.keys(kf).length===0&&Object.assign(kf,{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 HBt=kf;class UBt extends di{constructor(){super({id:"workbench.action.inspectContextKeys",title:Pe(756,"Inspect Context Keys"),category:la.Developer,f1:!0})}run(e){const t=e.get(Le),i=new Z,n=fl(void 0,void 0,i);$f("*","cursor: crosshair !important;",n);const r=document.createElement("div"),o=Vu();o.body.appendChild(r),i.add(Ee(()=>r.remove())),r.style.position="absolute",r.style.pointerEvents="none",r.style.backgroundColor="rgba(255, 0, 0, 0.5)",r.style.zIndex="1000";const a=i.add(new ni(o,"mousemove",!0));i.add(a.event(d=>{const h=d.target,u=So(h);r.style.top=`${u.top}px`,r.style.left=`${u.left}px`,r.style.width=`${u.width}px`,r.style.height=`${u.height}px`}));const c=i.add(new ni(o,"mousedown",!0));M.once(c.event)(d=>{d.preventDefault(),d.stopPropagation()},null,i);const l=i.add(new ni(o,"mouseup",!0));M.once(l.event)(d=>{d.preventDefault(),d.stopPropagation();const h=t.getContext(d.target);console.log(h.collectAllValues()),wt(i)},null,i)}}class EF extends di{constructor(){super({id:"workbench.action.toggleScreencastMode",title:Pe(757,"Toggle Screencast Mode"),category:la.Developer,f1:!0})}run(e){if(EF.disposable){EF.disposable.dispose(),EF.disposable=void 0;return}const t=e.get(_u),i=e.get(Te),n=e.get(Vt),r=new Z,o=t.activeContainer,a=oe(o,fe(".screencast-mouse"));r.add(Ee(()=>a.remove()));const c=oe(o,fe(".screencast-keyboard"));r.add(Ee(()=>c.remove()));const l=r.add(new I),d=r.add(new I),h=r.add(new I);function u(j,ne){ne.add(ne.add(new ni(j,"mousedown",!0)).event(ge=>l.fire(ge))),ne.add(ne.add(new ni(j,"mouseup",!0)).event(ge=>d.fire(ge))),ne.add(ne.add(new ni(j,"mousemove",!0)).event(ge=>h.fire(ge)))}for(const{window:j,disposables:ne}of P8())u(t.getContainer(j),ne);r.add(sm(({window:j,disposables:ne})=>u(t.getContainer(j),ne))),r.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=Qa(i.getValue("screencastMode.mouseIndicatorSize")||20,20,100),a.style.height=`${p}px`,a.style.width=`${p}px`};f(),m(),r.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=`${Qa(i.getValue("screencastMode.fontSize")||56,20,100)}px`},b=()=>{c.style.bottom=`${Qa(i.getValue("screencastMode.verticalOffset")||0,0,90)}%`};let w;const y=()=>{w=Qa(i.getValue("screencastMode.keyboardOverlayTimeout")||800,500,5e3)};v(),b(),y(),r.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=r.add(new I),A=r.add(new I),L=r.add(new I),k=r.add(new I);function P(j,ne){ne.add(ne.add(new ni(j,"keydown",!0)).event(ge=>C.fire(ge))),ne.add(ne.add(new ni(j,"compositionstart",!0)).event(ge=>A.fire(ge))),ne.add(ne.add(new ni(j,"compositionupdate",!0)).event(ge=>L.fire(ge))),ne.add(ne.add(new ni(j,"compositionend",!0)).event(ge=>k.fire(ge)))}for(const{window:j,disposables:ne}of P8())P(j,ne);r.add(sm(({window:j,disposables:ne})=>P(j,ne)));let R=0,z,G=!1;const Y=new ln(()=>{c.textContent="",z=void 0,R=0},w);r.add(A.event(j=>{G=!0})),r.add(L.event(j=>{j.data&&G?(R>20&&(c.innerText="",R=0),z=z??oe(c,fe("span.key")),z.textContent=j.data):G&&(c.innerText="",oe(c,fe("span.key",{},"Backspace"))),Y.schedule()})),r.add(k.event(j=>{z=void 0,R++})),r.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 xn(j),De=n.softDispatch(ge,ge.target);if(De.kind===of.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 Be=n.resolveKeyboardEvent(ge),Ct=this._isKbFound(De)&&De.commandId?this.getCommandDetails(De.commandId):void 0;let Ne=Ct?.title,dt=Be.getLabel();if(Ct&&((ne.showCommandGroups??!1)&&Ct.category&&(Ne=`${Ct.category}: ${Ne} `),this._isKbFound(De)&&De.commandId)){const Dt=n.lookupKeybindings(De.commandId).filter(Xi=>Xi.getLabel()?.endsWith(dt??""));Dt.length>0&&(dt=Dt[Dt.length-1].getLabel())}(ne.showCommands??!0)&&Ne&&oe(c,fe("span.title",{},`${Ne} `)),((ne.showKeys??!0)||(ne.showKeybindings??!0)&&this._isKbFound(De))&&(dt=dt?.replace("UpArrow","↑")?.replace("DownArrow","↓")?.replace("LeftArrow","←")?.replace("RightArrow","→"),oe(c,fe("span.key",{},dt??""))),R++,Y.schedule()})),EF.disposable=r}_isKbFound(e){return e.kind===of.KbFound}getCommandDetails(e){const t=Yn.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=vt.getCommand(e);if(i&&i.metadata?.description)return{title:typeof i.metadata.description=="string"?i.metadata.description:i.metadata.description.value}}}class VBt extends di{constructor(){super({id:"workbench.action.logStorage",title:Pe(758,"Log Storage Database Contents"),category:la.Developer,f1:!0})}run(e){const t=e.get(Gi),i=e.get(ir);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 zBt extends di{constructor(){super({id:"workbench.action.logWorkingCopies",title:Pe(761,"Log Working Copies"),category:la.Developer,f1:!0})}async run(e){const t=e.get(Pm),i=e.get(X6),n=e.get(Ke),r=e.get(_ce),o=await i.getBackups(),a=["","[Working Copies]",...t.workingCopies.length>0?t.workingCopies.map(c=>`${c.isDirty()?"● ":""}${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""],"","[Backups]",...o.length>0?o.map(c=>`${c.resource.toString(!0)} (typeId: ${c.typeId||""})`):[""]];n.info(a.join(` `)),r.showChannel(WBt,!0)}}const ore=class ore extends di{constructor(){super({id:"workbench.action.removeLargeStorageDatabaseEntries",title:Pe(762,"Remove Large Storage Database Entries..."),category:la.Developer,f1:!0})}async run(e){const t=e.get(Gi),i=e.get(Tn),n=e.get(pg),r=e.get(ir),o=e.get(ec),a=[];for(const h of[Ie.APPLICATION,Ie.PROFILE,Ie.WORKSPACE])if(!(h===Ie.PROFILE&&n.currentProfile.isDefault))for(const u of[cn.MACHINE,cn.USER])for(const f of t.keys(h,u)){const p=t.get(f,h);p&&(!o.isBuilt||p.length>ore.SIZE_THRESHOLD)&&a.push({key:f,scope:h,target:u,size:p.length,label:f,description:Pc.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===cn.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 r.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(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)}};ore.SIZE_THRESHOLD=1024*16;let Owe=ore,U1,ZX=new Set;const FT=new Q("dirtyWorkingCopies","stopped");class $Bt extends di{constructor(){super({id:"workbench.action.startTrackDisposables",title:Pe(775,"Start Tracking Disposables"),category:la.Developer,f1:!0,precondition:he.and(FT.isEqualTo("pending").negate(),FT.isEqualTo("started").negate())})}run(e){FT.bindTo(e.get(Le)).set("started"),ZX.clear(),U1=new pfe,oKe(U1)}}class GBt extends di{constructor(){super({id:"workbench.action.snapshotTrackedDisposables",title:Pe(776,"Snapshot Tracked Disposables"),category:la.Developer,f1:!0,precondition:FT.isEqualTo("started")})}run(e){FT.bindTo(e.get(Le)).set("pending"),ZX=new Set(U1?.computeLeakingDisposables(1e3)?.leaks.map(i=>i.value))}}class KBt extends di{constructor(){super({id:"workbench.action.stopTrackDisposables",title:Pe(777,"Stop Tracking Disposables"),category:la.Developer,f1:!0,precondition:FT.isEqualTo("pending")})}run(e){const t=e.get(ti);if(FT.bindTo(e.get(Le)).set("stopped"),U1){const n=new Set;for(const o of new Set(U1.computeLeakingDisposables(1e3)?.leaks)??[])ZX.has(o.value)&&n.add(o);const r=U1.computeLeakingDisposables(1e3,Array.from(n));r&&t.openEditor({resource:void 0,contents:r.details})}oKe(null),U1=void 0,ZX.clear()}}Et(UBt);Et(EF);Et(VBt);Et(zBt);Et(Owe);HBt.commit||(Et($Bt),Et(GBt),Et(KBt));const qBt=je.as(Pn.Configuration);qBt.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.")}}});Et(oNt);Et(YZe);Et(JZe);Yn.appendMenuItem(_e.EditorTitle,{command:{id:new JZe().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"))});Yn.appendMenuItem(_e.EditorTitle,{command:{id:new YZe().desc.id,title:g(1325,"Show Moved Code Blocks"),icon:ve.move,toggled:IN.create("config.diffEditor.experimental.showMoves",!0),precondition:he.has("isInDiffEditor")},order:10,group:"1_diff",when:he.has("isInDiffEditor")});Et(pbe);for(const s of[{icon:ve.arrowRight,key:J.diffEditorInlineMode.toNegated()},{icon:ve.discard,key:J.diffEditorInlineMode}])Yn.appendMenuItem(_e.DiffEditorHunkToolbar,{command:{id:new pbe().desc.id,title:g(1326,"Revert Block"),icon:s.icon},when:he.and(J.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),Yn.appendMenuItem(_e.DiffEditorSelectionToolbar,{command:{id:new pbe().desc.id,title:g(1327,"Revert Selection"),icon:s.icon},when:he.and(J.diffEditorModifiedWritable,s.key),order:5,group:"primary"});Et(aNt);Et(cNt);Et(lNt);Et(dNt);Yn.appendMenuItem(_e.EditorTitle,{command:{id:SW.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"))});vt.registerCommandAlias("editor.action.diffReview.next",SW.id);Et(SW);vt.registerCommandAlias("editor.action.diffReview.prev",J3.id);Et(J3);var QBt=".monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}";gt(QBt,{});var Bwe;const Pce=new Q("selectionAnchorSet",!1);var QL;let aI=(QL=class{static get(e){return e.getContribution(Bwe.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(ht.fromPositions(e,e),{description:"selection-anchor",stickiness:si.NeverGrowsWhenTypingAtEdges,hoverMessage:new Nt().appendText(g(1329,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),No(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(ht.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()}},Bwe=QL,QL.ID="editor.contrib.selectionAnchorController",QL);aI=Bwe=D([_(1,Le)],aI);class jBt extends it{constructor(){super({id:"editor.action.setSelectionAnchor",label:g(1331,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyB),weight:Ae.EditorContrib}})}async run(e,t){aI.get(t)?.setSelectionAnchor()}}class YBt extends it{constructor(){super({id:"editor.action.goToSelectionAnchor",label:g(1332,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Pce})}async run(e,t){aI.get(t)?.goToSelectionAnchor()}}class JBt extends it{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:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyK),weight:Ae.EditorContrib}})}async run(e,t){aI.get(t)?.selectFromAnchorToCursor()}}class XBt extends it{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){aI.get(t)?.cancelSelectionAnchor()}}on(aI.ID,aI,ai.Lazy);Re(jBt);Re(YBt);Re(JBt);Re(XBt);var ZBt=".monaco-editor .bracket-match{background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border);box-sizing:border-box}";gt(ZBt,{});const e2t=W("editorOverviewRuler.bracketMatchForeground","#A0A0A0",g(1337,"Overview ruler marker color for matching brackets."));class t2t extends it{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){zA.get(t)?.jumpToBracket()}}class i2t extends it{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),zA.get(t)?.selectToBracket(n)}}class n2t extends it{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){zA.get(t)?.removeBrackets(this.id)}}class s2t{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const XE=class XE extends V{static get(e){return e.getContribution(XE.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new ln(()=>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(),r=e.bracketPairs.matchBracket(n);let o=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?o=r[1].getStartPosition():r[1].containsPosition(n)&&(o=r[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)o=a[1].getStartPosition();else{const c=e.bracketPairs.findNextBracket(n);c&&c.range&&(o=c.range.getStartPosition())}}return o?new ht(o.lineNumber,o.column,o.lineNumber,o.column):new ht(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 r=n.getStartPosition();let o=t.bracketPairs.matchBracket(r);if(!o&&(o=t.bracketPairs.findEnclosingBrackets(r),!o)){const l=t.bracketPairs.findNextBracket(r);l&&l.range&&(o=t.bracketPairs.matchBracket(l.range.getStartPosition()))}let a=null,c=null;if(o){o.sort(F.compareRangesUsingStarts);const[l,d]=o;if(a=e?l.getStartPosition():l.getEndPosition(),c=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(r)){const h=a;a=c,c=h}}a&&c&&i.push(new ht(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 r=t.bracketPairs.matchBracket(n);r||(r=t.bracketPairs.findEnclosingBrackets(n)),r&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:r[0],text:""},{range:r[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 r=[];let o=0;for(let h=0,u=e.length;h1&&r.sort(re.compare);const a=[];let c=0,l=0;const d=n.length;for(let h=0,u=r.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Re(c2t);const YM="9_cutcopypaste",l2t=ld||document.queryCommandSupported("cut"),Ott=ld||document.queryCommandSupported("copy"),d2t=typeof navigator.clipboard>"u"||lf?document.queryCommandSupported("paste"):!0;function yNe(s){return s.register(),s}const h2t=l2t?yNe(new xI({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:ld?{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:YM,title:g(1347,"Cut"),when:J.writable,order:1},{menuId:_e.CommandPalette,group:"",title:g(1347,"Cut"),order:1},{menuId:_e.SimpleEditorContext,group:YM,title:g(1347,"Cut"),when:J.writable,order:1}]})):void 0,u2t=Ott?yNe(new xI({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:ld?{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:YM,title:g(1349,"Copy"),order:2},{menuId:_e.CommandPalette,group:"",title:g(1349,"Copy"),order:1},{menuId:_e.SimpleEditorContext,group:YM,title:g(1349,"Copy"),order:2}]})):void 0;Yn.appendMenuItem(_e.MenubarEditMenu,{submenu:_e.MenubarCopy,title:Pe(1350,"Copy As"),group:"2_ccp",order:3});Yn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextCopy,title:Pe(1350,"Copy As"),group:YM,order:3});Yn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextShare,title:Pe(1351,"Share"),group:"11_share",order:-1,when:he.and(he.notEquals("resourceScheme","output"),J.editorTextFocus)});Yn.appendMenuItem(_e.ExplorerContext,{submenu:_e.ExplorerContextShare,title:Pe(1351,"Share"),group:"11_share",order:-1});const wue=d2t?yNe(new xI({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:ld?{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:YM,title:g(1353,"Paste"),when:J.writable,order:4},{menuId:_e.CommandPalette,group:"",title:g(1353,"Paste"),order:1},{menuId:_e.SimpleEditorContext,group:YM,title:g(1353,"Paste"),when:J.writable,order:4}]})):void 0;class g2t extends it{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()||(vme.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),vme.forceCopyWithSyntaxHighlighting=!1)}}function Btt(s,e){s&&(s.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(qt).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const r=n.getOption(x.emptySelectionClipboard),o=n.getSelection();return o&&o.isEmpty()&&!r||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),s.addImplementation(0,"generic-dom",(t,i)=>(Vu().execCommand(e),!0)))}Btt(h2t,"cut");Btt(u2t,"copy");wue&&(wue.addImplementation(1e4,"code-editor",(s,e)=>{const t=s.get(qt),i=s.get(gg),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?n.getContainerDomNode().ownerDocument.execCommand("paste")?cC.get(n)?.finishedPaste()??Promise.resolve():Hn?(async()=>{const o=await i.readText();if(o!==""){const a=r3.INSTANCE.get(o);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:o,pasteOnNewLine:c,multicursorText:l,mode:d})}})():!0:!1}),wue.addImplementation(0,"generic-dom",(s,e)=>(Vu().execCommand("paste"),!0)));Ott&&Re(g2t);function gG(s){return he.regex(Get.keys()[0],new RegExp("(\\s|^)"+Nh(s.value)+"\\b"))}const CNe={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:od.IfSingle,enum:[od.First,od.IfSingle,od.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 XN(s,e,t,i,n=ag.Default){s.hasModel()&&GM.get(s)?.manualTriggerAtCurrentPosition(e,n,t,i)}class f2t extends it{constructor(){super({id:tNe,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 XN(t,g(5007,"No code actions available"),void 0,void 0,ag.QuickFix)}}class p2t extends uc{constructor(){super({id:eNe,precondition:he.and(J.writable,J.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:CNe}]}})}runEditorCommand(e,t,i){const n=Jw.fromUser(i,{kind:Jn.Empty,apply:od.IfSingle});return XN(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 m2t extends it{constructor(){super({id:iNe,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,gG(Cs.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:CNe}]}})}run(e,t,i){const n=Jw.fromUser(i,{kind:Cs.Refactor,apply:od.Never});return XN(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:Cs.Refactor.contains(n.kind)?n.kind:Jn.None,onlyIncludePreferredActions:n.preferred},n.apply,ag.Refactor)}}class _2t extends it{constructor(){super({id:nNe,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,gG(Cs.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:CNe}]}})}run(e,t,i){const n=Jw.fromUser(i,{kind:Cs.Source,apply:od.Never});return XN(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:Cs.Source.contains(n.kind)?n.kind:Jn.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,ag.SourceAction)}}class v2t extends it{constructor(){super({id:jbe,label:g(5022,"Organize Imports"),alias:"Organize Imports",precondition:he.and(J.writable,gG(Cs.SourceOrganizeImports)),kbOpts:{kbExpr:J.textInputFocus,primary:U.Shift|U.Alt|S.KeyO,weight:Ae.EditorContrib}})}run(e,t){return XN(t,g(5023,"No organize imports action available"),{include:Cs.SourceOrganizeImports,includeSourceActions:!0},od.IfSingle,ag.OrganizeImports)}}class b2t extends it{constructor(){super({id:Ybe,label:g(5024,"Fix All"),alias:"Fix All",precondition:he.and(J.writable,gG(Cs.SourceFixAll))})}run(e,t){return XN(t,g(5025,"No fix all action available"),{include:Cs.SourceFixAll,includeSourceActions:!0},od.IfSingle,ag.FixAll)}}class w2t extends it{constructor(){super({id:Wet,label:g(5026,"Auto Fix..."),alias:"Auto Fix...",precondition:he.and(J.writable,gG(Cs.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 XN(t,g(5027,"No auto fixes available"),{include:Cs.QuickFix,onlyIncludePreferredActions:!0},od.IfSingle,ag.AutoFix)}}on(GM.ID,GM,ai.Eventually);on(i9.ID,i9,ai.Lazy);Re(f2t);Re(m2t);Re(_2t);Re(v2t);Re(w2t);Re(b2t);Qe(new p2t);je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:ct.LANGUAGE_OVERRIDABLE,description:g(1355,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:ct.LANGUAGE_OVERRIDABLE,description:g(1356,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:ct.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 Wwe{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 Wtt(s,e,t){const i=s.ordered(e),n=new Map,r=new Wwe,o=i.map(async(a,c)=>{n.set(a,c);try{const l=await Promise.resolve(a.provideCodeLenses(e,t));l&&r.add(l,a)}catch(l){Nr(l)}});return await Promise.all(o),r.lenses=r.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),r}vt.registerCommand("_executeCodeLensProvider",function(s,...e){let[t,i]=e;Lt(N.isUri(t)),Lt(typeof i=="number"||!i);const{codeLensProvider:n}=s.get(nt),r=s.get(fi).getModel(t);if(!r)throw Fi();const o=[],a=new Z;return Wtt(n,r,Ue.None).then(c=>{a.add(c);const l=[];for(const d of c.lenses)i==null||d.symbol.command?o.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&l.push(Promise.resolve(d.provider.resolveCodeLens(r,d.symbol,Ue.None)).then(h=>o.push(h||d.symbol)));return Promise.all(l)}).then(()=>o).finally(()=>{setTimeout(()=>a.dispose(),100)})});const Htt=ae("ICodeLensCache");class o4e{constructor(e,t){this.lineCount=e,this.data=t}}let Hwe=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new pm(20,.75);const t="codelens/cache";sF(ri,()=>e.remove(t,Ie.WORKSPACE));const i="codelens/cache2",n=e.get(i,Ie.WORKSPACE,"{}");this._deserialize(n);const r=M.filter(e.onWillSaveState,o=>o.reason===Ay.SHUTDOWN);M.once(r)(o=>{e.store(i,this._serialize(),Ie.WORKSPACE,cn.MACHINE)})}put(e,t){const i=t.lenses.map(o=>({range:o.symbol.range,command:o.symbol.command&&{id:"",title:o.symbol.command?.title}})),n=new Wwe;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const r=new o4e(e.getLineCount(),n);this._cache.set(e.uri.toString(),r)}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 r of i.data.lenses)n.add(r.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],r=[];for(const a of n.lines)r.push({range:new F(a,1,a,11)});const o=new Wwe;o.add({lenses:r,dispose(){}},this._fakeProvider),this._cache.set(i,new o4e(n.lineCount,o))}}catch{}}};Hwe=D([_(0,Gi)],Hwe);ce(Htt,Hwe,Qt.Delayed);var y2t=".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}";gt(y2t,{});class C2t{constructor(e,t,i){this.afterColumn=Vn.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 t8=class t8{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${t8._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 r=0;r{l.symbol.command&&c.push(l.symbol),i.addDecoration({range:l.symbol.range,options:a4e},h=>this._decorationIds[d]=h),a?a=F.plusRange(a,l.symbol.range):a=F.lift(l.symbol.range)}),this._viewZone=new C2t(a.startLineNumber-1,r,o),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 Uwe(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:a4e},r=>this._decorationIds[n]=r)})}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:r}=this._editor.getContainerDomNode();r.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),r.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),r.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(r.setProperty("--vscode-editorCodeLens-fontFamily",i),r.setProperty("--vscode-editorCodeLens-fontFamilyDefault",dd.fontFamily)),this._editor.changeViewZones(o=>{for(const a of this._lenses)a.updateHeight(e,o)})}_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&&Zy(()=>{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 r=n.onDidChange(()=>i.schedule());this._localToDispose.add(r)}const i=new ln(()=>{const n=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=Mo(r=>Wtt(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const o=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=o,this._renderCodeLensSymbols(r),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(n=>{this._editor.changeViewZones(r=>{const o=[];let a=-1;this._lenses.forEach(l=>{!l.isValid()||a===l.getLineNumber()?o.push(l):(l.update(r),a=l.getLineNumber())});const c=new yue;o.forEach(l=>{l.dispose(c,r),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=ym.capture(this._editor);this._editor.changeDecorations(r=>{this._editor.changeViewZones(o=>{this._disposeAllLenses(r,o)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==Mt.CONTENT_WIDGET)return;let r=n.target.element;if(r?.tagName==="SPAN"&&(r=r.parentElement),r?.tagName==="A")for(const o of this._lenses){const a=o.getCommand(r);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(c=>this._notificationService.error(c));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new yue;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 r=ym.capture(this._editor),o=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(c=>{const l=new yue;let d=0,h=0;for(;hthis._resolveCodeLensesInViewportSoon())),d++,h++)}for(;dthis._resolveCodeLensesInViewportSoon())),h++;l.commit(a)})}),r.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(o=>{const a=o.computeIfNecessary(e);a&&(t.push(a),i.push(o))}),t.length===0)return;const n=Date.now(),r=Mo(o=>{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,o)).then(p=>{d[f]=p},Nr):(d[f]=u.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!o.isCancellationRequested&&!i[l].isDisposed()&&i[l].updateCommands(d)})});return Promise.all(a)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const o=this._resolveCodeLensesDebounce.update(e,Date.now()-n);this._resolveCodeLensesScheduler.delay=o,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},o=>{bt(o),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}},VB.ID="css.editor.codeLens",VB);h9=D([_(1,nt),_(2,xp),_(3,bi),_(4,wi),_(5,Htt)],h9);on(h9.ID,h9,ai.AfterFirstRender);Re(class extends it{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(Tn),n=e.get(bi),r=e.get(wi),o=t.getSelection().positionLineNumber,a=t.getContribution(h9.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===o&&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===o&&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){r.error(u)}}});const are=class are 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!==Mt.CONTENT_TEXT||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==att||!i.range)return;const n=this._editor.getContribution(Fa.ID);if(n&&!n.isColorPickerVisible){const r=new F(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(r,lC.Immediate,UA.Mouse,!1,!0)}}};are.ID="editor.contrib.colorContribution",are.RECOMPUTE_TIME=1e3;let eZ=are;on(eZ.ID,eZ,ai.BeforeFirstInteraction);JN.register(s9);var Vwe,zwe,jL;let JM=(jL=class extends V{constructor(e,t,i,n,r,o,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=r,this._languageFeatureService=o,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 $we(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(Vwe.ID)}},Vwe=jL,jL.ID="editor.contrib.standaloneColorPickerController",jL);JM=Vwe=D([_(1,Le),_(2,fi),_(3,Vt),_(4,we),_(5,nt),_(6,zs)],JM);on(JM.ID,JM,ai.AfterFirstRender);const l4e=8,S2t=22;var YL;let $we=(YL=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=r,this._keybindingService=o,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(r9,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(Ec(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 zwe.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?[ts.ABOVE,ts.BELOW]:[ts.BELOW,ts.ABOVE],positionAffinity:Ir.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 A2t(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 oNe(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 NX(this._keybindingService)),r={fragment:i,statusBar:n,onContentsChanged:()=>{},hide:()=>this.hide()};this._colorHover=e;const o=this._standaloneColorPickerParticipant.renderHoverParts(r,[e]);if(!o)return;this._register(o.disposables);const a=o.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-S2t-l4e,h=a.body.enterButton;h?.onClicked(()=>{this.updateEditor(),this.hide()});const u=a.header,f=u.pickedColorNode;f.style.width=l+l4e+"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)}},zwe=YL,YL.ID="editor.contrib.standaloneColorPickerWidget",YL);$we=zwe=D([_(3,we),_(4,fi),_(5,Vt),_(6,nt),_(7,zs)],$we);class A2t{constructor(e,t){this.value=e,this.foundInEditor=t}}class E2t extends mf{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){JM.get(t)?.showOrFocus()}}class x2t extends it{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){JM.get(t)?.hide()}}class D2t extends it{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){JM.get(t)?.insertColor()}}Re(x2t);Re(D2t);Et(E2t);class Ux{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,r=e.length;if(i+n>r)return!1;for(let o=0;o=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,r,o){const a=e.startLineNumber,c=e.startColumn,l=e.endLineNumber,d=e.endColumn,h=r.getLineContent(a),u=r.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=Ux._createRemoveBlockCommentOperations(new F(a,f+t.length+1,l,p+1),t,i)):(m=Ux._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)o.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return F.isEmpty(e)?n.push(es.delete(new F(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(es.delete(new F(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(es.delete(new F(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const r=[];return F.isEmpty(e)?r.push(es.replace(new F(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(r.push(es.insert(new re(e.startLineNumber,e.startColumn),t+(n?" ":""))),r.push(es.insert(new re(e.endLineNumber,e.endColumn),(n?" ":"")+i))),r}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const r=e.getLanguageIdAtPosition(i,n),o=this.languageConfigurationService.getLanguageConfiguration(r).comments;!o||!o.blockCommentStartToken||!o.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,o.blockCommentStartToken,o.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],r=i[1];return new ht(n.range.endLineNumber,n.range.endColumn,r.range.startLineNumber,r.range.startColumn)}else{const n=i[0].range,r=this._usedEndToken?-this._usedEndToken.length-1:0;return new ht(n.endLineNumber,n.endColumn+r,n.endLineNumber,n.endColumn+r)}}}var Xw;(function(s){s[s.Toggle=0]="Toggle",s[s.ForceAdd=1]="ForceAdd",s[s.ForceRemove=2]="ForceRemove"})(Xw||(Xw={}));class FC{constructor(e,t,i,n,r,o,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=n,this._insertSpace=r,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=o,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const r=e.getLanguageIdAtPosition(t,1),o=n.getLanguageConfiguration(r).comments,a=o?o.lineCommentToken:null;if(!a)return null;const c=[];for(let l=0,d=i-t+1;lr?t[c].commentStrOffset=o-1:t[c].commentStrOffset=o}}}class SNe extends it{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(zs);if(!t.hasModel())return;const n=t.getModel(),r=[],o=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 Cue(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new Sue(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 Sue(new Cue(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 Sue(new Cue(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}};cre.ID="editor.contrib.cursorUndoRedoController";let NW=cre;class R2t extends it{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){NW.get(t)?.cursorUndo()}}class M2t extends it{constructor(){super({id:"cursorRedo",label:g(1384,"Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){NW.get(t)?.cursorRedo()}}on(NW.ID,NW,ai.Eager);Re(R2t);Re(M2t);var N2t=".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}";gt(N2t,{});class P2t{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 ht(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 ht(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)||(yP(e)&&(this._modifierPressed=!0),this._mouseDown&&yP(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(yP(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===qC.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(r=>t.position&&r.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}yP(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 re(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:r,selectionStartColumn:o}=n;i=[new ht(r,o,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new ht(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",Bi.Explicit)}else(!this._dragSelection.containsPosition(t)||(yP(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(qC.ID,new P2t(this._dragSelection,t,yP(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:qC._DECORATION_OPTIONS}]),this._editor.revealPosition(e,_t.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()}};qC.ID="editor.contrib.dragAndDrop",qC.TRIGGER_KEY_VALUE=jt?S.Alt:S.Ctrl,qC._DECORATION_OPTIONS=Kt.register({description:"dnd-target",className:"dnd-target"});let tZ=qC;on(tZ.ID,tZ,ai.BeforeFirstInteraction);on(cC.ID,cC,ai.Eager);aG(Gbe);Qe(new class extends uc{constructor(){super({id:Oet,precondition:ZMe,kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Period}})}runEditorCommand(s,e){return cC.get(e)?.changePasteType()}});Qe(new class extends uc{constructor(){super({id:"editor.hidePasteWidget",precondition:ZMe,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(s,e){cC.get(e)?.clearWidgets()}});var JL;Re((JL=class extends it{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:JL.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),cC.get(t)?.pasteAs(n?new Jn(n):void 0)}},JL.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.")}}},JL));Re(class extends it{constructor(){super({id:"editor.action.pasteAsText",label:g(1387,"Paste as Text"),alias:"Paste as Text",precondition:J.writable})}run(s,e){return cC.get(e)?.pasteAs({providerId:VM.id})}});on(KM.ID,KM,ai.BeforeFirstInteraction);aG($be);Qe(new class extends uc{constructor(){super({id:Qet,precondition:sNe,kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Period}})}runEditorCommand(s,e,t){KM.get(e)?.changeDropType()}});Qe(new class extends uc{constructor(){super({id:"editor.hideDropWidget",precondition:sNe,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(s,e,t){KM.get(e)?.clearWidgets()}});je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{[qet]:{type:"object",scope:ct.LANGUAGE_OVERRIDABLE,description:g(1388,"Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});const dh=class dh{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,dh._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,dh._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let r=this._editor.getModel().getDecorationRange(t);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){const o=r.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(o);r=new F(r.startLineNumber,r.startColumn,o,a)}this._rangeHighlightDecorationId=n.addDecoration(r,dh._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=dh._FIND_MATCH_DECORATION;const r=[];if(e.length>1e3){n=dh._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):(r.push({range:new F(h,1,u,1),options:dh._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,u=m.endLineNumber)}r.push({range:new F(h,1,u,1),options:dh._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const o=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,dh._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 r;if(!(r.startColumn0){const i=[];for(let o=0;oF.compareRangesUsingStarts(o.range,a.range));const n=[];let r=i[0];for(let o=1;o0?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 d4e(s,e,t){return s[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&s[0].split(t).length===e.split(t).length}function h4e(s,e,t){const i=e.split(t),n=s[0].split(t);let r="";return i.forEach((o,a)=>{r+=Utt([n[a]],o)+t}),r.slice(0,-1)}var PW;(function(s){s[s.StaticValue=0]="StaticValue",s[s.DynamicPieces=1]="DynamicPieces"})(PW||(PW={}));class u4e{constructor(e){this.staticValue=e,this.kind=PW.StaticValue}}class O2t{constructor(e){this.pieces=e,this.kind=PW.DynamicPieces}}class FW{static fromStaticValue(e){return new FW([bD.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===PW.DynamicPieces}constructor(e){!e||e.length===0?this._state=new u4e(""):e.length===1&&e[0].staticValue!==null?this._state=new u4e(e[0].staticValue):this._state=new O2t(e)}buildReplaceString(e,t){if(this._state.kind===PW.StaticValue)return t?Utt(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,r=this._state.pieces.length;n0){const c=[],l=o.caseOps.length;let d=0;for(let h=0,u=a.length;h=l){c.push(a.slice(h));break}switch(o.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 o=s.charCodeAt(i);switch(o){case B.Backslash:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case B.n:t.emitUnchanged(i-1),t.emitStatic(` +`)),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)}};ore.SIZE_THRESHOLD=1024*16;let Owe=ore,U1,ZX=new Set;const FT=new Q("dirtyWorkingCopies","stopped");class $Bt extends di{constructor(){super({id:"workbench.action.startTrackDisposables",title:Pe(775,"Start Tracking Disposables"),category:la.Developer,f1:!0,precondition:he.and(FT.isEqualTo("pending").negate(),FT.isEqualTo("started").negate())})}run(e){FT.bindTo(e.get(Le)).set("started"),ZX.clear(),U1=new pfe,oKe(U1)}}class GBt extends di{constructor(){super({id:"workbench.action.snapshotTrackedDisposables",title:Pe(776,"Snapshot Tracked Disposables"),category:la.Developer,f1:!0,precondition:FT.isEqualTo("started")})}run(e){FT.bindTo(e.get(Le)).set("pending"),ZX=new Set(U1?.computeLeakingDisposables(1e3)?.leaks.map(i=>i.value))}}class KBt extends di{constructor(){super({id:"workbench.action.stopTrackDisposables",title:Pe(777,"Stop Tracking Disposables"),category:la.Developer,f1:!0,precondition:FT.isEqualTo("pending")})}run(e){const t=e.get(ti);if(FT.bindTo(e.get(Le)).set("stopped"),U1){const n=new Set;for(const o of new Set(U1.computeLeakingDisposables(1e3)?.leaks)??[])ZX.has(o.value)&&n.add(o);const r=U1.computeLeakingDisposables(1e3,Array.from(n));r&&t.openEditor({resource:void 0,contents:r.details})}oKe(null),U1=void 0,ZX.clear()}}Et(UBt);Et(EF);Et(VBt);Et(zBt);Et(Owe);HBt.commit||(Et($Bt),Et(GBt),Et(KBt));const qBt=je.as(Pn.Configuration);qBt.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.")}}});Et(oNt);Et(YZe);Et(JZe);Yn.appendMenuItem(_e.EditorTitle,{command:{id:new JZe().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"))});Yn.appendMenuItem(_e.EditorTitle,{command:{id:new YZe().desc.id,title:g(1325,"Show Moved Code Blocks"),icon:ve.move,toggled:IN.create("config.diffEditor.experimental.showMoves",!0),precondition:he.has("isInDiffEditor")},order:10,group:"1_diff",when:he.has("isInDiffEditor")});Et(pbe);for(const s of[{icon:ve.arrowRight,key:J.diffEditorInlineMode.toNegated()},{icon:ve.discard,key:J.diffEditorInlineMode}])Yn.appendMenuItem(_e.DiffEditorHunkToolbar,{command:{id:new pbe().desc.id,title:g(1326,"Revert Block"),icon:s.icon},when:he.and(J.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),Yn.appendMenuItem(_e.DiffEditorSelectionToolbar,{command:{id:new pbe().desc.id,title:g(1327,"Revert Selection"),icon:s.icon},when:he.and(J.diffEditorModifiedWritable,s.key),order:5,group:"primary"});Et(aNt);Et(cNt);Et(lNt);Et(dNt);Yn.appendMenuItem(_e.EditorTitle,{command:{id:SW.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"))});vt.registerCommandAlias("editor.action.diffReview.next",SW.id);Et(SW);vt.registerCommandAlias("editor.action.diffReview.prev",J3.id);Et(J3);var QBt=".monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}";gt(QBt,{});var Bwe;const Pce=new Q("selectionAnchorSet",!1);var QL;let aI=(QL=class{static get(e){return e.getContribution(Bwe.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(ht.fromPositions(e,e),{description:"selection-anchor",stickiness:si.NeverGrowsWhenTypingAtEdges,hoverMessage:new Nt().appendText(g(1329,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),No(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(ht.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()}},Bwe=QL,QL.ID="editor.contrib.selectionAnchorController",QL);aI=Bwe=D([_(1,Le)],aI);class jBt extends it{constructor(){super({id:"editor.action.setSelectionAnchor",label:g(1331,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyB),weight:Ae.EditorContrib}})}async run(e,t){aI.get(t)?.setSelectionAnchor()}}class YBt extends it{constructor(){super({id:"editor.action.goToSelectionAnchor",label:g(1332,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Pce})}async run(e,t){aI.get(t)?.goToSelectionAnchor()}}class JBt extends it{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:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyK),weight:Ae.EditorContrib}})}async run(e,t){aI.get(t)?.selectFromAnchorToCursor()}}class XBt extends it{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){aI.get(t)?.cancelSelectionAnchor()}}on(aI.ID,aI,ai.Lazy);Re(jBt);Re(YBt);Re(JBt);Re(XBt);var ZBt=".monaco-editor .bracket-match{background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border);box-sizing:border-box}";gt(ZBt,{});const e2t=W("editorOverviewRuler.bracketMatchForeground","#A0A0A0",g(1337,"Overview ruler marker color for matching brackets."));class t2t extends it{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){zA.get(t)?.jumpToBracket()}}class i2t extends it{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),zA.get(t)?.selectToBracket(n)}}class n2t extends it{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){zA.get(t)?.removeBrackets(this.id)}}class s2t{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const XE=class XE extends V{static get(e){return e.getContribution(XE.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new ln(()=>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(),r=e.bracketPairs.matchBracket(n);let o=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?o=r[1].getStartPosition():r[1].containsPosition(n)&&(o=r[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)o=a[1].getStartPosition();else{const c=e.bracketPairs.findNextBracket(n);c&&c.range&&(o=c.range.getStartPosition())}}return o?new ht(o.lineNumber,o.column,o.lineNumber,o.column):new ht(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 r=n.getStartPosition();let o=t.bracketPairs.matchBracket(r);if(!o&&(o=t.bracketPairs.findEnclosingBrackets(r),!o)){const l=t.bracketPairs.findNextBracket(r);l&&l.range&&(o=t.bracketPairs.matchBracket(l.range.getStartPosition()))}let a=null,c=null;if(o){o.sort(F.compareRangesUsingStarts);const[l,d]=o;if(a=e?l.getStartPosition():l.getEndPosition(),c=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(r)){const h=a;a=c,c=h}}a&&c&&i.push(new ht(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 r=t.bracketPairs.matchBracket(n);r||(r=t.bracketPairs.findEnclosingBrackets(n)),r&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:r[0],text:""},{range:r[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 r=[];let o=0;for(let h=0,u=e.length;h1&&r.sort(re.compare);const a=[];let c=0,l=0;const d=n.length;for(let h=0,u=r.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Re(c2t);const YM="9_cutcopypaste",l2t=ld||document.queryCommandSupported("cut"),Ott=ld||document.queryCommandSupported("copy"),d2t=typeof navigator.clipboard>"u"||lf?document.queryCommandSupported("paste"):!0;function yNe(s){return s.register(),s}const h2t=l2t?yNe(new xI({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:ld?{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:YM,title:g(1347,"Cut"),when:J.writable,order:1},{menuId:_e.CommandPalette,group:"",title:g(1347,"Cut"),order:1},{menuId:_e.SimpleEditorContext,group:YM,title:g(1347,"Cut"),when:J.writable,order:1}]})):void 0,u2t=Ott?yNe(new xI({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:ld?{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:YM,title:g(1349,"Copy"),order:2},{menuId:_e.CommandPalette,group:"",title:g(1349,"Copy"),order:1},{menuId:_e.SimpleEditorContext,group:YM,title:g(1349,"Copy"),order:2}]})):void 0;Yn.appendMenuItem(_e.MenubarEditMenu,{submenu:_e.MenubarCopy,title:Pe(1350,"Copy As"),group:"2_ccp",order:3});Yn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextCopy,title:Pe(1350,"Copy As"),group:YM,order:3});Yn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextShare,title:Pe(1351,"Share"),group:"11_share",order:-1,when:he.and(he.notEquals("resourceScheme","output"),J.editorTextFocus)});Yn.appendMenuItem(_e.ExplorerContext,{submenu:_e.ExplorerContextShare,title:Pe(1351,"Share"),group:"11_share",order:-1});const wue=d2t?yNe(new xI({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:ld?{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:YM,title:g(1353,"Paste"),when:J.writable,order:4},{menuId:_e.CommandPalette,group:"",title:g(1353,"Paste"),order:1},{menuId:_e.SimpleEditorContext,group:YM,title:g(1353,"Paste"),when:J.writable,order:4}]})):void 0;class g2t extends it{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()||(vme.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),vme.forceCopyWithSyntaxHighlighting=!1)}}function Btt(s,e){s&&(s.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(qt).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const r=n.getOption(x.emptySelectionClipboard),o=n.getSelection();return o&&o.isEmpty()&&!r||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),s.addImplementation(0,"generic-dom",(t,i)=>(Vu().execCommand(e),!0)))}Btt(h2t,"cut");Btt(u2t,"copy");wue&&(wue.addImplementation(1e4,"code-editor",(s,e)=>{const t=s.get(qt),i=s.get(gg),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?n.getContainerDomNode().ownerDocument.execCommand("paste")?cC.get(n)?.finishedPaste()??Promise.resolve():Hn?(async()=>{const o=await i.readText();if(o!==""){const a=r3.INSTANCE.get(o);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:o,pasteOnNewLine:c,multicursorText:l,mode:d})}})():!0:!1}),wue.addImplementation(0,"generic-dom",(s,e)=>(Vu().execCommand("paste"),!0)));Ott&&Re(g2t);function gG(s){return he.regex(Get.keys()[0],new RegExp("(\\s|^)"+Nh(s.value)+"\\b"))}const CNe={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:od.IfSingle,enum:[od.First,od.IfSingle,od.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 XN(s,e,t,i,n=ag.Default){s.hasModel()&&GM.get(s)?.manualTriggerAtCurrentPosition(e,n,t,i)}class f2t extends it{constructor(){super({id:tNe,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 XN(t,g(5007,"No code actions available"),void 0,void 0,ag.QuickFix)}}class p2t extends uc{constructor(){super({id:eNe,precondition:he.and(J.writable,J.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:CNe}]}})}runEditorCommand(e,t,i){const n=Jw.fromUser(i,{kind:Jn.Empty,apply:od.IfSingle});return XN(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 m2t extends it{constructor(){super({id:iNe,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,gG(Cs.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:CNe}]}})}run(e,t,i){const n=Jw.fromUser(i,{kind:Cs.Refactor,apply:od.Never});return XN(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:Cs.Refactor.contains(n.kind)?n.kind:Jn.None,onlyIncludePreferredActions:n.preferred},n.apply,ag.Refactor)}}class _2t extends it{constructor(){super({id:nNe,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,gG(Cs.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:CNe}]}})}run(e,t,i){const n=Jw.fromUser(i,{kind:Cs.Source,apply:od.Never});return XN(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:Cs.Source.contains(n.kind)?n.kind:Jn.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,ag.SourceAction)}}class v2t extends it{constructor(){super({id:jbe,label:g(5022,"Organize Imports"),alias:"Organize Imports",precondition:he.and(J.writable,gG(Cs.SourceOrganizeImports)),kbOpts:{kbExpr:J.textInputFocus,primary:U.Shift|U.Alt|S.KeyO,weight:Ae.EditorContrib}})}run(e,t){return XN(t,g(5023,"No organize imports action available"),{include:Cs.SourceOrganizeImports,includeSourceActions:!0},od.IfSingle,ag.OrganizeImports)}}class b2t extends it{constructor(){super({id:Ybe,label:g(5024,"Fix All"),alias:"Fix All",precondition:he.and(J.writable,gG(Cs.SourceFixAll))})}run(e,t){return XN(t,g(5025,"No fix all action available"),{include:Cs.SourceFixAll,includeSourceActions:!0},od.IfSingle,ag.FixAll)}}class w2t extends it{constructor(){super({id:Wet,label:g(5026,"Auto Fix..."),alias:"Auto Fix...",precondition:he.and(J.writable,gG(Cs.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 XN(t,g(5027,"No auto fixes available"),{include:Cs.QuickFix,onlyIncludePreferredActions:!0},od.IfSingle,ag.AutoFix)}}on(GM.ID,GM,ai.Eventually);on(i9.ID,i9,ai.Lazy);Re(f2t);Re(m2t);Re(_2t);Re(v2t);Re(w2t);Re(b2t);Qe(new p2t);je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:ct.LANGUAGE_OVERRIDABLE,description:g(1355,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:ct.LANGUAGE_OVERRIDABLE,description:g(1356,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:ct.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 Wwe{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 Wtt(s,e,t){const i=s.ordered(e),n=new Map,r=new Wwe,o=i.map(async(a,c)=>{n.set(a,c);try{const l=await Promise.resolve(a.provideCodeLenses(e,t));l&&r.add(l,a)}catch(l){Nr(l)}});return await Promise.all(o),r.lenses=r.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),r}vt.registerCommand("_executeCodeLensProvider",function(s,...e){let[t,i]=e;Lt(N.isUri(t)),Lt(typeof i=="number"||!i);const{codeLensProvider:n}=s.get(nt),r=s.get(fi).getModel(t);if(!r)throw Fi();const o=[],a=new Z;return Wtt(n,r,Ue.None).then(c=>{a.add(c);const l=[];for(const d of c.lenses)i==null||d.symbol.command?o.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&l.push(Promise.resolve(d.provider.resolveCodeLens(r,d.symbol,Ue.None)).then(h=>o.push(h||d.symbol)));return Promise.all(l)}).then(()=>o).finally(()=>{setTimeout(()=>a.dispose(),100)})});const Htt=ae("ICodeLensCache");class o4e{constructor(e,t){this.lineCount=e,this.data=t}}let Hwe=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new pm(20,.75);const t="codelens/cache";sF(ri,()=>e.remove(t,Ie.WORKSPACE));const i="codelens/cache2",n=e.get(i,Ie.WORKSPACE,"{}");this._deserialize(n);const r=M.filter(e.onWillSaveState,o=>o.reason===Ay.SHUTDOWN);M.once(r)(o=>{e.store(i,this._serialize(),Ie.WORKSPACE,cn.MACHINE)})}put(e,t){const i=t.lenses.map(o=>({range:o.symbol.range,command:o.symbol.command&&{id:"",title:o.symbol.command?.title}})),n=new Wwe;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const r=new o4e(e.getLineCount(),n);this._cache.set(e.uri.toString(),r)}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 r of i.data.lenses)n.add(r.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],r=[];for(const a of n.lines)r.push({range:new F(a,1,a,11)});const o=new Wwe;o.add({lenses:r,dispose(){}},this._fakeProvider),this._cache.set(i,new o4e(n.lineCount,o))}}catch{}}};Hwe=D([_(0,Gi)],Hwe);ce(Htt,Hwe,Qt.Delayed);var y2t=".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}";gt(y2t,{});class C2t{constructor(e,t,i){this.afterColumn=Vn.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 t8=class t8{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${t8._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 r=0;r{l.symbol.command&&c.push(l.symbol),i.addDecoration({range:l.symbol.range,options:a4e},h=>this._decorationIds[d]=h),a?a=F.plusRange(a,l.symbol.range):a=F.lift(l.symbol.range)}),this._viewZone=new C2t(a.startLineNumber-1,r,o),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 Uwe(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:a4e},r=>this._decorationIds[n]=r)})}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:r}=this._editor.getContainerDomNode();r.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),r.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),r.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(r.setProperty("--vscode-editorCodeLens-fontFamily",i),r.setProperty("--vscode-editorCodeLens-fontFamilyDefault",dd.fontFamily)),this._editor.changeViewZones(o=>{for(const a of this._lenses)a.updateHeight(e,o)})}_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&&Zy(()=>{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 r=n.onDidChange(()=>i.schedule());this._localToDispose.add(r)}const i=new ln(()=>{const n=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=Mo(r=>Wtt(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const o=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=o,this._renderCodeLensSymbols(r),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(n=>{this._editor.changeViewZones(r=>{const o=[];let a=-1;this._lenses.forEach(l=>{!l.isValid()||a===l.getLineNumber()?o.push(l):(l.update(r),a=l.getLineNumber())});const c=new yue;o.forEach(l=>{l.dispose(c,r),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=ym.capture(this._editor);this._editor.changeDecorations(r=>{this._editor.changeViewZones(o=>{this._disposeAllLenses(r,o)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==Mt.CONTENT_WIDGET)return;let r=n.target.element;if(r?.tagName==="SPAN"&&(r=r.parentElement),r?.tagName==="A")for(const o of this._lenses){const a=o.getCommand(r);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(c=>this._notificationService.error(c));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new yue;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 r=ym.capture(this._editor),o=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(c=>{const l=new yue;let d=0,h=0;for(;hthis._resolveCodeLensesInViewportSoon())),d++,h++)}for(;dthis._resolveCodeLensesInViewportSoon())),h++;l.commit(a)})}),r.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(o=>{const a=o.computeIfNecessary(e);a&&(t.push(a),i.push(o))}),t.length===0)return;const n=Date.now(),r=Mo(o=>{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,o)).then(p=>{d[f]=p},Nr):(d[f]=u.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!o.isCancellationRequested&&!i[l].isDisposed()&&i[l].updateCommands(d)})});return Promise.all(a)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const o=this._resolveCodeLensesDebounce.update(e,Date.now()-n);this._resolveCodeLensesScheduler.delay=o,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},o=>{bt(o),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}},VB.ID="css.editor.codeLens",VB);h9=D([_(1,nt),_(2,xp),_(3,bi),_(4,wi),_(5,Htt)],h9);on(h9.ID,h9,ai.AfterFirstRender);Re(class extends it{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(Tn),n=e.get(bi),r=e.get(wi),o=t.getSelection().positionLineNumber,a=t.getContribution(h9.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===o&&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===o&&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){r.error(u)}}});const are=class are 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!==Mt.CONTENT_TEXT||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==att||!i.range)return;const n=this._editor.getContribution(Oa.ID);if(n&&!n.isColorPickerVisible){const r=new F(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(r,lC.Immediate,UA.Mouse,!1,!0)}}};are.ID="editor.contrib.colorContribution",are.RECOMPUTE_TIME=1e3;let eZ=are;on(eZ.ID,eZ,ai.BeforeFirstInteraction);JN.register(s9);var Vwe,zwe,jL;let JM=(jL=class extends V{constructor(e,t,i,n,r,o,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=r,this._languageFeatureService=o,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 $we(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(Vwe.ID)}},Vwe=jL,jL.ID="editor.contrib.standaloneColorPickerController",jL);JM=Vwe=D([_(1,Le),_(2,fi),_(3,Vt),_(4,we),_(5,nt),_(6,zs)],JM);on(JM.ID,JM,ai.AfterFirstRender);const l4e=8,S2t=22;var YL;let $we=(YL=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=r,this._keybindingService=o,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(r9,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(Ec(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 zwe.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?[ts.ABOVE,ts.BELOW]:[ts.BELOW,ts.ABOVE],positionAffinity:Ir.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 A2t(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 oNe(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 NX(this._keybindingService)),r={fragment:i,statusBar:n,onContentsChanged:()=>{},hide:()=>this.hide()};this._colorHover=e;const o=this._standaloneColorPickerParticipant.renderHoverParts(r,[e]);if(!o)return;this._register(o.disposables);const a=o.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-S2t-l4e,h=a.body.enterButton;h?.onClicked(()=>{this.updateEditor(),this.hide()});const u=a.header,f=u.pickedColorNode;f.style.width=l+l4e+"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)}},zwe=YL,YL.ID="editor.contrib.standaloneColorPickerWidget",YL);$we=zwe=D([_(3,we),_(4,fi),_(5,Vt),_(6,nt),_(7,zs)],$we);class A2t{constructor(e,t){this.value=e,this.foundInEditor=t}}class E2t extends mf{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){JM.get(t)?.showOrFocus()}}class x2t extends it{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){JM.get(t)?.hide()}}class D2t extends it{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){JM.get(t)?.insertColor()}}Re(x2t);Re(D2t);Et(E2t);class Ux{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,r=e.length;if(i+n>r)return!1;for(let o=0;o=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,r,o){const a=e.startLineNumber,c=e.startColumn,l=e.endLineNumber,d=e.endColumn,h=r.getLineContent(a),u=r.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=Ux._createRemoveBlockCommentOperations(new F(a,f+t.length+1,l,p+1),t,i)):(m=Ux._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const v of m)o.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return F.isEmpty(e)?n.push(es.delete(new F(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(es.delete(new F(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(es.delete(new F(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const r=[];return F.isEmpty(e)?r.push(es.replace(new F(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(r.push(es.insert(new re(e.startLineNumber,e.startColumn),t+(n?" ":""))),r.push(es.insert(new re(e.endLineNumber,e.endColumn),(n?" ":"")+i))),r}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const r=e.getLanguageIdAtPosition(i,n),o=this.languageConfigurationService.getLanguageConfiguration(r).comments;!o||!o.blockCommentStartToken||!o.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,o.blockCommentStartToken,o.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],r=i[1];return new ht(n.range.endLineNumber,n.range.endColumn,r.range.startLineNumber,r.range.startColumn)}else{const n=i[0].range,r=this._usedEndToken?-this._usedEndToken.length-1:0;return new ht(n.endLineNumber,n.endColumn+r,n.endLineNumber,n.endColumn+r)}}}var Xw;(function(s){s[s.Toggle=0]="Toggle",s[s.ForceAdd=1]="ForceAdd",s[s.ForceRemove=2]="ForceRemove"})(Xw||(Xw={}));class FC{constructor(e,t,i,n,r,o,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=n,this._insertSpace=r,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=o,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const r=e.getLanguageIdAtPosition(t,1),o=n.getLanguageConfiguration(r).comments,a=o?o.lineCommentToken:null;if(!a)return null;const c=[];for(let l=0,d=i-t+1;lr?t[c].commentStrOffset=o-1:t[c].commentStrOffset=o}}}class SNe extends it{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(zs);if(!t.hasModel())return;const n=t.getModel(),r=[],o=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 Cue(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new Sue(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 Sue(new Cue(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 Sue(new Cue(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}};cre.ID="editor.contrib.cursorUndoRedoController";let NW=cre;class R2t extends it{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){NW.get(t)?.cursorUndo()}}class M2t extends it{constructor(){super({id:"cursorRedo",label:g(1384,"Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){NW.get(t)?.cursorRedo()}}on(NW.ID,NW,ai.Eager);Re(R2t);Re(M2t);var N2t=".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}";gt(N2t,{});class P2t{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 ht(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 ht(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)||(yP(e)&&(this._modifierPressed=!0),this._mouseDown&&yP(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(yP(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===qC.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(r=>t.position&&r.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}yP(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 re(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:r,selectionStartColumn:o}=n;i=[new ht(r,o,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new ht(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",Bi.Explicit)}else(!this._dragSelection.containsPosition(t)||(yP(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(qC.ID,new P2t(this._dragSelection,t,yP(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:qC._DECORATION_OPTIONS}]),this._editor.revealPosition(e,_t.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()}};qC.ID="editor.contrib.dragAndDrop",qC.TRIGGER_KEY_VALUE=jt?S.Alt:S.Ctrl,qC._DECORATION_OPTIONS=Kt.register({description:"dnd-target",className:"dnd-target"});let tZ=qC;on(tZ.ID,tZ,ai.BeforeFirstInteraction);on(cC.ID,cC,ai.Eager);aG(Gbe);Qe(new class extends uc{constructor(){super({id:Oet,precondition:ZMe,kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Period}})}runEditorCommand(s,e){return cC.get(e)?.changePasteType()}});Qe(new class extends uc{constructor(){super({id:"editor.hidePasteWidget",precondition:ZMe,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(s,e){cC.get(e)?.clearWidgets()}});var JL;Re((JL=class extends it{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:JL.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),cC.get(t)?.pasteAs(n?new Jn(n):void 0)}},JL.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.")}}},JL));Re(class extends it{constructor(){super({id:"editor.action.pasteAsText",label:g(1387,"Paste as Text"),alias:"Paste as Text",precondition:J.writable})}run(s,e){return cC.get(e)?.pasteAs({providerId:VM.id})}});on(KM.ID,KM,ai.BeforeFirstInteraction);aG($be);Qe(new class extends uc{constructor(){super({id:Qet,precondition:sNe,kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Period}})}runEditorCommand(s,e,t){KM.get(e)?.changeDropType()}});Qe(new class extends uc{constructor(){super({id:"editor.hideDropWidget",precondition:sNe,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(s,e,t){KM.get(e)?.clearWidgets()}});je.as(Pn.Configuration).registerConfiguration({...Kb,properties:{[qet]:{type:"object",scope:ct.LANGUAGE_OVERRIDABLE,description:g(1388,"Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});const dh=class dh{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,dh._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,dh._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let r=this._editor.getModel().getDecorationRange(t);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){const o=r.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(o);r=new F(r.startLineNumber,r.startColumn,o,a)}this._rangeHighlightDecorationId=n.addDecoration(r,dh._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=dh._FIND_MATCH_DECORATION;const r=[];if(e.length>1e3){n=dh._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):(r.push({range:new F(h,1,u,1),options:dh._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,u=m.endLineNumber)}r.push({range:new F(h,1,u,1),options:dh._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const o=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,dh._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 r;if(!(r.startColumn0){const i=[];for(let o=0;oF.compareRangesUsingStarts(o.range,a.range));const n=[];let r=i[0];for(let o=1;o0?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 d4e(s,e,t){return s[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&s[0].split(t).length===e.split(t).length}function h4e(s,e,t){const i=e.split(t),n=s[0].split(t);let r="";return i.forEach((o,a)=>{r+=Utt([n[a]],o)+t}),r.slice(0,-1)}var PW;(function(s){s[s.StaticValue=0]="StaticValue",s[s.DynamicPieces=1]="DynamicPieces"})(PW||(PW={}));class u4e{constructor(e){this.staticValue=e,this.kind=PW.StaticValue}}class O2t{constructor(e){this.pieces=e,this.kind=PW.DynamicPieces}}class FW{static fromStaticValue(e){return new FW([bD.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===PW.DynamicPieces}constructor(e){!e||e.length===0?this._state=new u4e(""):e.length===1&&e[0].staticValue!==null?this._state=new u4e(e[0].staticValue):this._state=new O2t(e)}buildReplaceString(e,t){if(this._state.kind===PW.StaticValue)return t?Utt(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,r=this._state.pieces.length;n0){const c=[],l=o.caseOps.length;let d=0;for(let h=0,u=a.length;h=l){c.push(a.slice(h));break}switch(o.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 o=s.charCodeAt(i);switch(o){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(o));break}continue}if(r===B.DollarSign){if(i++,i>=n)break;const o=s.charCodeAt(i);if(o===B.DollarSign){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(o===B.Digit0||o===B.Ampersand){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(B.Digit1<=o&&o<=B.Digit9){let a=o-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===Bi.Explicit||i.reason===Bi.Undo||i.reason===Bi.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,wt(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)},H2t)):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,Vx);this._decorations.set(n,i);const r=this._editor.getSelection();let o=this._decorations.getCurrentMatchesPosition(r);if(o===0&&n.length>0){const a=D2(n.map(c=>c.range),c=>F.compareRangesUsingStarts(c,r)>=0);o=a>0?a-1+1:o}this._state.changeMatchInfo(o,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,_t.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,_t.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 r=this._editor.getModel();return t||n===1?(i===1?i=r.getLineCount():i--,n=r.getLineMaxColumn(i)):n--,new re(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 r=this._editor.getModel();return t||n===r.getLineMaxColumn(i)?(i===r.getLineCount()?i=1:i++,n=1):n++,new re(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()j5._getSearchRange(this._editor.getModel(),r));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>=Vx?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new jC(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(),r=n.getValue(gr.LF),o=n.getFullModelRange(),a=this._getReplacePattern();let c;const l=this._state.preserveCase;a.hasReplacementPatterns||l?c=r.replace(i,function(){return a.buildReplaceString(arguments,l)}):c=r.replace(i,a.buildReplaceString(null,l));const d=new fLe(o,c,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,Vn.MAX_SAFE_SMALL_INTEGER),n=[];for(let o=0,a=i.length;oo.range),n);this._executeEditorCommand("replaceAll",r)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,Vn.MAX_SAFE_SMALL_INTEGER).map(r=>new ht(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn));const n=this._editor.getSelection();for(let r=0,o=i.length;rthis._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:$e(uae),inputActiveOptionForeground:$e(gae),inputActiveOptionBackground:$e(b6)},r=this._register(Yk());this.caseSensitive=this._register(new bJe({appendTitle:this._keybindingLabelFor(zr.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverDelegate:r,...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 wJe({appendTitle:this._keybindingLabelFor(zr.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverDelegate:r,...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 yJe({appendTitle:this._keybindingLabelFor(zr.ToggleRegexCommand),isChecked:this._state.isRegex,hoverDelegate:r,...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(o=>{let a=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(ue(this._domNode,ke.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(ue(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return lre.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Vg.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")}};lre.ID="editor.contrib.findOptionsWidget";let Kwe=lre;var bh;(function(s){s[s.NotSet=0]="NotSet",s[s.True=1]="True",s[s.False=2]="False"})(bh||(bh={}));function WK(s,e){return s===bh.True?!0:s===bh.False?!1:e}class V2t 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 WK(this._isRegexOverride,this._isRegex)}get wholeWord(){return WK(this._wholeWordOverride,this._wholeWord)}get matchCase(){return WK(this._matchCaseOverride,this._matchCase)}get preserveCase(){return WK(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=bh.NotSet,this._wholeWord=!1,this._wholeWordOverride=bh.NotSet,this._matchCase=!1,this._matchCaseOverride=bh.NotSet,this._preserveCase=!1,this._preserveCaseOverride=bh.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 r=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,r=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,r=!0),typeof i<"u"&&(F.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,r=!0)),r&&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 r=!1;const o=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,r=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,n.replaceString=!0,r=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,n.isRevealed=!0,r=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,n.isReplaceRevealed=!0,r=!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,r=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,n.loop=!0,r=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,n.isSearching=!0,r=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,n.filters=!0,r=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:bh.NotSet,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:bh.NotSet,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:bh.NotSet,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:bh.NotSet,o!==this.isRegex&&(r=!0,n.isRegex=!0),a!==this.wholeWord&&(r=!0,n.wholeWord=!0),c!==this.matchCase&&(r=!0,n.matchCase=!0),l!==this.preserveCase&&(r=!0,n.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(n)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Vx}}var z2t=".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}";gt(z2t,{});function iZ(s){return s.lookupKeybinding("history.showPrevious")?.getElectronAccelerator()==="Up"&&s.lookupKeybinding("history.showNext")?.getElectronAccelerator()==="Down"}const g4e=oi("find-collapsed",ve.chevronRight,g(5053,"Icon to indicate that the editor find widget is collapsed.")),f4e=oi("find-expanded",ve.chevronDown,g(5054,"Icon to indicate that the editor find widget is expanded.")),$2t=oi("find-selection",ve.selection,g(5055,"Icon for 'Find in Selection' in the editor find widget.")),G2t=oi("find-replace",ve.replace,g(5056,"Icon for 'Replace' in the editor find widget.")),K2t=oi("find-replace-all",ve.replaceAll,g(5057,"Icon for 'Replace All' in the editor find widget.")),q2t=oi("find-previous-match",ve.arrowUp,g(5058,"Icon for 'Find Previous' in the editor find widget.")),Q2t=oi("find-next-match",ve.arrowDown,g(5059,"Icon for 'Find Next' in the editor find widget.")),j2t=g(5060,"Find / Replace"),Y2t=g(5061,"Find"),J2t=g(5062,"Find"),X2t=g(5063,"Previous Match"),Z2t=g(5064,"Next Match"),eWt=g(5065,"Find in Selection"),tWt=g(5066,"Close"),iWt=g(5067,"Replace"),nWt=g(5068,"Replace"),sWt=g(5069,"Replace"),rWt=g(5070,"Replace All"),oWt=g(5071,"Toggle Replace"),aWt=g(5072,"Only the first {0} results are highlighted, but all find operations work on the entire text.",Vx),cWt=g(5073,"{0} of {1}"),p4e=g(5074,"No results"),ew=419,lWt=275,dWt=lWt-54;let L4=69;const hWt=33,m4e="ctrlEnterReplaceAll.windows.donotask",_4e=jt?U.WinCtrl:U.CtrlCmd;class Aue{constructor(e){this.afterLineNumber=e,this.heightInPx=hWt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function v4e(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){s.stopPropagation();return}}function b4e(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 Aue(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=Fce.bindTo(o),this._findFocusTracker=this._register(Ec(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=ANe.bindTo(o),this._replaceFocusTracker=this._register(Ec(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 Aue(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 dre.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:Vg.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=Od(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=L4+"px",this._state.matchesCount>=Vx?this._matchesCount.title=aWt:this._matchesCount.title="",this._matchesCount.firstChild?.remove();let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=Vx&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=qp(cWt,i,t)}else e=p4e;this._matchesCount.appendChild(document.createTextNode(e)),No(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),L4=Math.max(L4,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===p4e)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),r=this._codeEditor.getModel();return r&&t.startLineNumber<=r.getLineCount()&&t.startLineNumber>=1?`${r.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=So(i),r=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),o=n.left+(r?r.left:0),a=r?r.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const c=tY(this._domNode).left;o>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 Aue(0));const i=this._viewZone;this._codeEditor.changeViewZones(n=>{if(this._viewZoneId!==void 0){const r=this._getHeight();if(r===i.heightInPx)return;const o=r-i.heightInPx;i.heightInPx=r,n.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o);return}else{let r=this._getHeight();if(r-=this._codeEditor.getOption(x.padding).top,r<=0)return;i.heightInPx=r,this._viewZoneId=n.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r)}})}_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 r=!1,o=!1,a=!1;if(this._resized&&Od(this._domNode)>ew){this._domNode.style.maxWidth=`${i-28-n-15}px`,this._replaceInput.width=Od(this._findInput.domNode);return}if(ew+28+n>=i&&(o=!0),ew+28+n-L4>=i&&(a=!0),ew+28+n-L4>=i+50&&(r=!0),this._domNode.classList.toggle("collapsed-find-widget",r),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",o),!a&&!r&&(this._domNode.style.maxWidth=`${i-28-n-15}px`),this._findInput.layout({collapsedFindWidget:r,narrowFindWidget:a,reducedFindWidget:o}),this._resized){const c=this._findInput.inputBox.element.clientWidth;c>0&&(this._replaceInput.width=c)}else this._isReplaceVisible&&(this._replaceInput.width=Od(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(_4e|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 v4e(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(S.DownArrow))return b4e(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(_4e|S.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{jn&&ld&&!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(m4e,!0,Ie.PROFILE,cn.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 v4e(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(S.DownArrow))return b4e(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 xbe(null,this._contextViewProvider,{width:dWt,label:Y2t,placeholder:J2t,appendCaseSensitiveLabel:this._keybindingLabelFor(zr.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(zr.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(zr.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:()=>iZ(this._keybindingService),inputBoxStyles:LM,toggleStyles:dJ},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()})),mo&&this._register(this._findInput.onMouseDown(d=>this._onFindInputMouseDown(d))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(Yk());this._prevBtn=this._register(new CP({label:X2t+this._keybindingLabelFor(zr.PreviousMatchFindAction),icon:q2t,hoverDelegate:i,onTrigger:()=>{Qn(this._codeEditor.getAction(zr.PreviousMatchFindAction)).run().then(void 0,bt)}},this._hoverService)),this._nextBtn=this._register(new CP({label:Z2t+this._keybindingLabelFor(zr.NextMatchFindAction),icon:Q2t,hoverDelegate:i,onTrigger:()=>{Qn(this._codeEditor.getAction(zr.NextMatchFindAction)).run().then(void 0,bt)}},this._hoverService));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const r=document.createElement("div");r.className="find-actions",n.appendChild(r),r.appendChild(this._matchesCount),r.appendChild(this._prevBtn.domNode),r.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new sE({icon:$2t,title:eWt+this._keybindingLabelFor(zr.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:$e(b6),inputActiveOptionBorder:$e(uae),inputActiveOptionForeground:$e(gae)})),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)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new CP({label:tWt+this._keybindingLabelFor(zr.CloseFindWidgetCommand),icon:QJe,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 Dbe(null,void 0,{label:iWt,placeholder:nWt,appendPreserveCaseLabel:this._keybindingLabelFor(zr.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>iZ(this._keybindingService),inputBoxStyles:LM,toggleStyles:dJ},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 o=this._register(Yk());this._replaceBtn=this._register(new CP({label:sWt+this._keybindingLabelFor(zr.ReplaceOneAction),icon:G2t,hoverDelegate:o,onTrigger:()=>{this._controller.replace()},onKeyDown:d=>{d.equals(U.Shift|S.Tab)&&(this._closeBtn.focus(),d.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new CP({label:rWt+this._keybindingLabelFor(zr.ReplaceAllAction),icon:K2t,hoverDelegate:o,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 CP({label:oWt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Od(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=j2t,this._domNode.role="dialog",this._domNode.style.width=`${ew}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 Wd(this._domNode,this,{orientation:pi.VERTICAL,size:2})),this._resized=!1;let l=ew;this._register(this._resizeSash.onDidStart(()=>{l=Od(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=Od(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const d=Od(this._domNode);if(dthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}};dre.ID="editor.contrib.findWidget";let qwe=dre;class CP extends _d{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+He.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??Fo("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(...He.asClassNameArray(g4e)),this._domNode.classList.add(...He.asClassNameArray(f4e))):(this._domNode.classList.remove(...He.asClassNameArray(f4e)),this._domNode.classList.add(...He.asClassNameArray(g4e)))}}Ep((s,e)=>{const t=s.getColor(kx);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Fy(s.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=s.getColor(Npt);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${Fy(s.type)?"dashed":"solid"} ${i}; }`);const n=s.getColor(yt);n&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${n}; }`);const r=s.getColor(Rpt);r&&e.addRule(`.monaco-editor .findMatchInline { color: ${r}; }`);const o=s.getColor(Mpt);o&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${o}; }`)});var Qwe;const uWt=524288;function jwe(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)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:iv.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,cn.MACHINE),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,Ie.WORKSPACE,cn.MACHINE),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,Ie.WORKSPACE,cn.MACHINE),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,Ie.WORKSPACE,cn.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!!Fce.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=Nh(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=jwe(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);n&&(this._state.isRegex?i.searchString=Nh(n):i.searchString=n)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const n=jwe(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(r=>!r.isEmpty())&&(i.searchScope=n)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new j5(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)}},Qwe=XL,XL.ID="editor.contrib.findController",XL);cg=Qwe=D([_(1,Le),_(2,Gi),_(3,gg),_(4,wi),_(5,tc)],cg);let Ywe=class extends cg{constructor(e,t,i,n,r,o,a,c,l){super(e,i,a,c,o,l),this._contextViewService=t,this._keybindingService=n,this._themeService=r,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===iv.FocusReplaceInput?this._widget.focusReplaceInput():e.shouldFocus===iv.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 qwe(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new Kwe(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}};Ywe=D([_(1,bf),_(2,Le),_(3,Vt),_(4,mn),_(5,wi),_(6,Gi),_(7,gg),_(8,tc)],Ywe);const gWt=Aqe(new Sqe({id:zr.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}}));gWt.addImplementation(0,(s,e,t)=>{const i=cg.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:iv.FocusFindInput,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop}):!1});const fWt={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 pWt extends it{constructor(){super({id:zr.StartFindWithArgs,label:g(1395,"Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:Ae.EditorContrib},metadata:fWt})}async run(e,t,i){const n=cg.get(t);if(n){const r=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:iv.FocusFindInput,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(x.find).loop},r),n.setGlobalBufferTerm(n.getState().searchString)}}}class mWt extends it{constructor(){super({id:zr.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=cg.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:iv.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class Vtt extends it{async run(e,t){const i=cg.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:iv.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class _Wt extends Vtt{constructor(){super({id:zr.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,Fce),primary:S.Enter,weight:Ae.EditorContrib}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class vWt extends Vtt{constructor(){super({id:zr.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,Fce),primary:U.Shift|S.Enter,weight:Ae.EditorContrib}]})}_run(e){return e.moveToPrevMatch()}}class bWt extends it{constructor(){super({id:zr.GoToMatchFindAction,label:g(1399,"Go to Match..."),alias:"Go to Match...",precondition:lE}),this._highlightDecorations=[]}run(e,t,i){const n=cg.get(t);if(!n)return;const r=n.getState().matchesCount;if(r<1){e.get(wi).notify({severity:Ze.Warning,message:g(1400,"No matches. Try searching for something else.")});return}const a=e.get(Tn).createInputBox();a.placeholder=g(1401,"Type a number to go to a specific match (between 1 and {0})",r);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:$r(JQe),position:Il.Full}}}])})}}class ztt extends it{async run(e,t){const i=cg.get(t);if(!i)return;const n=jwe(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:iv.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class wWt extends ztt{constructor(){super({id:zr.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 yWt extends ztt{constructor(){super({id:zr.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 CWt=Aqe(new Sqe({id:zr.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}}));CWt.addImplementation(0,(s,e,t)=>{if(!e.hasModel()||e.getOption(x.readOnly))return!1;const i=cg.get(e);if(!i)return!1;const n=e.getSelection(),r=i.isFindInputFocused(),o=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(x.find).seedSearchStringFromSelection!=="never"&&!r,a=r||o?iv.FocusReplaceInput:iv.FocusFindInput;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:o?"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(cg.ID,Ywe,ai.Eager);Re(pWt);Re(mWt);Re(_Wt);Re(vWt);Re(bWt);Re(wWt);Re(yWt);const Qb=uc.bindToContribution(cg.get);Qe(new Qb({id:zr.CloseFindWidgetCommand,precondition:lE,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 Qb({id:zr.ToggleCaseSensitiveCommand,precondition:void 0,handler:s=>s.toggleCaseSensitive(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:NK.primary,mac:NK.mac,win:NK.win,linux:NK.linux}}));Qe(new Qb({id:zr.ToggleWholeWordCommand,precondition:void 0,handler:s=>s.toggleWholeWords(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:PK.primary,mac:PK.mac,win:PK.win,linux:PK.linux}}));Qe(new Qb({id:zr.ToggleRegexCommand,precondition:void 0,handler:s=>s.toggleRegex(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:FK.primary,mac:FK.mac,win:FK.win,linux:FK.linux}}));Qe(new Qb({id:zr.ToggleSearchScopeCommand,precondition:void 0,handler:s=>s.toggleSearchScope(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:OK.primary,mac:OK.mac,win:OK.win,linux:OK.linux}}));Qe(new Qb({id:zr.TogglePreserveCaseCommand,precondition:void 0,handler:s=>s.togglePreserveCase(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:BK.primary,mac:BK.mac,win:BK.win,linux:BK.linux}}));Qe(new Qb({id:zr.ReplaceOneAction,precondition:lE,handler:s=>s.replace(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.CtrlCmd|U.Shift|S.Digit1}}));Qe(new Qb({id:zr.ReplaceOneAction,precondition:lE,handler:s=>s.replace(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,ANe),primary:S.Enter}}));Qe(new Qb({id:zr.ReplaceAllAction,precondition:lE,handler:s=>s.replaceAll(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.CtrlCmd|U.Alt|S.Enter}}));Qe(new Qb({id:zr.ReplaceAllAction,precondition:lE,handler:s=>s.replaceAll(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,ANe),primary:void 0,mac:{primary:U.CtrlCmd|S.Enter}}}));Qe(new Qb({id:zr.SelectAllMatchesAction,precondition:lE,handler:s=>s.selectAllMatches(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.Alt|S.Enter}}));class SWt extends it{constructor(){super({id:"editor.action.fontZoomIn",label:g(1389,"Increase Editor Font Size"),alias:"Increase Editor Font Size",precondition:void 0})}run(e,t){Jp.setZoomLevel(Jp.getZoomLevel()+1)}}class AWt extends it{constructor(){super({id:"editor.action.fontZoomOut",label:g(1390,"Decrease Editor Font Size"),alias:"Decrease Editor Font Size",precondition:void 0})}run(e,t){Jp.setZoomLevel(Jp.getZoomLevel()-1)}}class EWt extends it{constructor(){super({id:"editor.action.fontZoomReset",label:g(1391,"Reset Editor Font Size"),alias:"Reset Editor Font Size",precondition:void 0})}run(e,t){Jp.setZoomLevel(0)}}Re(SWt);Re(AWt);Re(EWt);var zB;let nZ=(zB=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(r=>{r.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 cY;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(n=>{const r=n.charCodeAt(n.length-1);i.has(r)&&this._trigger(String.fromCharCode(r))}))}_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 li,r=this._editor.onDidChangeModelContent(o=>{if(o.isFlush){n.cancel(),r.dispose();return}for(let a=0,c=o.changes.length;a{n.token.isCancellationRequested||tr(o)&&(this._accessibilitySignalService.playSignal(ll.format,{userGesture:!1}),vW.execute(this._editor,o,!0))}).finally(()=>{r.dispose()})}},zB.ID="editor.contrib.autoFormat",zB);nZ=D([_(1,nt),_(2,Pl),_(3,uv)],nZ);var $B;let sZ=($B=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(Xae,this.editor,e,cm.Silent,hu.None,Ue.None,!1).catch(bt))}},$B.ID="editor.contrib.formatOnPaste",$B);sZ=D([_(1,nt),_(2,we)],sZ);class xWt extends it{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(nE).showWhile(i.invokeFunction($ve,t,cm.Explicit,hu.None,Ue.None,!0),250)}}}class DWt extends it{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:oo(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(),r=t.getSelections().map(a=>a.isEmpty()?new F(a.startLineNumber,1,a.startLineNumber,n.getLineMaxColumn(a.startLineNumber)):a);await e.get(nE).showWhile(i.invokeFunction(Xae,t,r,cm.Explicit,hu.None,Ue.None,!0),250)}}on(nZ.ID,nZ,ai.BeforeFirstInteraction);on(sZ.ID,sZ,ai.BeforeFirstInteraction);Re(xWt);Re(DWt);vt.registerCommand("editor.action.format",async s=>{const e=s.get(qt).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=s.get(bi);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});class Zw{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 r=0;t.children.get(n)!==void 0;r++)n=`${i}_${r}`;return n}static getElementById(e,t){if(!e)return;const i=Qy(e,t.id);if(i===e.length)return t;if(!(i0&&F.areIntersecting(e[n-1],t.symbol.range)&&(n-=1)):n=i;const r=[];let o;for(;no)&&(o=a.severity)}for(const[,a]of t.children)this._updateMarker(r,a);o&&(t.marker={count:r.length,topSev:o}),vM(e)}}class Nw extends Zw{static create(e,t,i){const n=new li(i),r=new Nw(t.uri),o=e.ordered(t),a=o.map((l,d)=>{const h=Zw.findId(`provider_${d}`,r),u=new Xwe(h,r,l.displayName??"Unknown Outline Provider",d);return Promise.resolve(l.provideDocumentSymbols(t,n.token)).then(f=>{for(const p of f||[])Nw._makeOutlineElement(p,u);return u},f=>(Nr(f),u)).then(f=>{Zw.empty(f)?f.remove():r._groups.set(h,f)})}),c=e.onDidChange(()=>{const l=e.ordered(t);ns(l,o)||n.cancel()});return Promise.all(a).then(()=>n.token.isCancellationRequested&&!i.isCancellationRequested?Nw.create(e,t,i):r._compact()).finally(()=>{n.dispose(),c.dispose(),n.dispose()})}static _makeOutlineElement(e,t){const i=Zw.findId(e,t),n=new Jwe(i,t,e);if(e.children)for(const r of e.children)Nw._makeOutlineElement(r,n);t.children.set(n.id,n)}static get(e){for(;e;){if(e instanceof Nw)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=ui.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 r=t.parent;for(;r&&!i;)r instanceof Xwe&&(i=r),r=r.parent}let n;for(const[,r]of this._groups)if(n=r.getItemEnclosingPosition(e),n&&(!i||i===r))break;return n}getItemById(e){return Zw.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 Jwe?e.push(t.symbol):e.push(...ui.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 Nw._flattenDocumentSymbols(t,e,""),t.sort((i,n)=>re.compare(F.getStartPosition(i.range),F.getStartPosition(n.range))||re.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&&Nw._flattenDocumentSymbols(e,n.children,n.name)}}const fG=ae("IOutlineModelService");let Zwe=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new Z,this._cache=new pm(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 r=this._cache.get(e.id);if(!r||r.versionId!==e.getVersionId()||!ns(r.provider,n)){const a=new li;r={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:a,promise:Nw.create(i,e,a.token),model:void 0},this._cache.set(e.id,r);const c=Date.now();r.promise.then(l=>{r.model=l,this._debounceInformation.update(e,Date.now()-c)}).catch(l=>{this._cache.delete(e.id)})}if(r.model)return r.model;r.promiseCnt+=1;const o=t.onCancellationRequested(()=>{--r.promiseCnt===0&&(r.source.cancel(),this._cache.delete(e.id))});try{return await r.promise}finally{o.dispose()}}getDebounceValue(e){return this._debounceInformation.get(e)}};Zwe=D([_(0,nt),_(1,xp),_(2,fi)],Zwe);ce(fG,Zwe,Qt.Delayed);vt.registerCommand("_executeDocumentSymbolProvider",async function(s,...e){const[t]=e;Lt(N.isUri(t));const i=s.get(fG),r=await s.get(pn).createModelReference(t);try{return(await i.getOrCreate(r.object.textEditorModel,Ue.None)).getTopLevelSymbols()}finally{r.dispose()}});const hre=class hre extends it{constructor(){super({id:hre.ID,label:g(5080,"Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:he.and(J.writable,Xu.inlineSuggestionVisible),kbOpts:{weight:100,primary:U.Alt|S.BracketRight}})}async run(e,t){mu.get(t)?.model.get()?.next()}};hre.ID=net;let eye=hre;const ure=class ure extends it{constructor(){super({id:ure.ID,label:g(5081,"Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:he.and(J.writable,Xu.inlineSuggestionVisible),kbOpts:{weight:100,primary:U.Alt|S.BracketLeft}})}async run(e,t){mu.get(t)?.model.get()?.previous()}};ure.ID=iet;let tye=ure;class kWt extends it{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=mu.get(t);await QYe(async n=>{await i?.model.get()?.triggerExplicitly(n),i?.playAccessibilitySignal(n)})}}class IWt extends it{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,Xu.inlineSuggestionVisible),kbOpts:{weight:Ae.EditorContrib+1,primary:U.CtrlCmd|S.RightArrow,kbExpr:he.and(J.writable,Xu.inlineSuggestionVisible)},menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5084,"Accept Word"),group:"primary",order:2}]})}async run(e,t){const i=mu.get(t);await i?.model.get()?.acceptNextWord(i.editor)}}class TWt extends it{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,Xu.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=mu.get(t);await i?.model.get()?.acceptNextLine(i.editor)}}class LWt extends it{constructor(){super({id:tet,label:g(5087,"Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:Xu.inlineSuggestionVisible,menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5088,"Accept"),group:"primary",order:1}],kbOpts:{primary:S.Tab,weight:200,kbExpr:he.and(Xu.inlineSuggestionVisible,J.tabMovesFocus.toNegated(),Xu.inlineSuggestionHasIndentationLessThanTabSize,Vi.Visible.toNegated(),J.hoverFocused.toNegated())}})}async run(e,t){const i=mu.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const gre=class gre extends it{constructor(){super({id:gre.ID,label:g(5089,"Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:Xu.inlineSuggestionVisible,kbOpts:{weight:100,primary:S.Escape}})}async run(e,t){const i=mu.get(t);is(n=>{i?.model.get()?.stop(n)})}};gre.ID="editor.action.inlineSuggest.hide";let iye=gre;const fre=class fre extends di{constructor(){super({id:fre.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),r=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",r)}};fre.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let nye=fre;class RWt{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===uu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let sye=class{constructor(e,t,i,n,r,o){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=r,this._telemetryService=o,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=mu.get(this._editor);if(!t)return null;const i=e.target;if(i.type===Mt.CONTENT_VIEW_ZONE){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new wQ(1e3,this,F.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}return i.type===Mt.CONTENT_EMPTY&&t.shouldShowHoverAt(i.range)?new wQ(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===Mt.CONTENT_TEXT&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new wQ(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=mu.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new RWt(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 r=n.controller.model.get(),o=this._instantiationService.createInstance(AW,this._editor,!1,rd(null),r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands),a=o.getDomNode();e.fragment.appendChild(a),r.triggerExplicitly(),i.add(o);const c={hoverPart:n,hoverElement:a,dispose(){i.dispose()}};return new qM([c])}getAccessibleContent(e){return g(5091,"There are inline completions here")}renderScreenReaderText(e,t){const i=new Z,n=fe,r=n("div.hover-row.markdown-hover"),o=oe(r,n("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new Z_({editor:this._editor},this._languageService,this._openerService)),c=l=>{i.add(a.onDidRenderAsync(()=>{o.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=g(5092,"Suggestion:"),h=i.add(a.render(new Nt().appendText(d).appendCodeblock("text",l)));o.replaceChildren(h.element)};return i.add(ci(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 ca(o)})),e.fragment.appendChild(r),i}};sye=D([_(1,Di),_(2,Ar),_(3,_o),_(4,we),_(5,Ji)],sye);class MWt{constructor(){this.type=Sm.View,this.priority=95,this.name="inline-completions",this.when=he.and(Xu.inlineSuggestionVisible)}getProvider(e){const t=e.get(qt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const n=mu.get(i)?.model.get();if(n?.state.get())return new NWt(i,n)}}class NWt 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=Wb.InlineCompletions,this.verbositySettingKey="accessibility.verbosity.inlineCompletions",this.options={language:this._editor.getModel()?.getLanguageId()??void 0,type:Sm.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(mu.ID,mu,ai.Eventually);Re(kWt);Re(eye);Re(tye);Re(IWt);Re(TWt);Re(LWt);Re(iye);Et(nye);JN.register(sye);Z6.register(new MWt);var PWt=".monaco-editor .goto-definition-link{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer;text-decoration:underline}";gt(PWt,{});var SV,tk;let XM=(tk=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 r=new Tce(e);this.toUnhook.add(r),this.toUnhook.add(r.onMouseMoveOrRelevantKeyDown(([o,a])=>{this.startFindDefinitionFromMouse(o,a??void 0)})),this.toUnhook.add(r.onExecute(o=>{this.isEnabled(o)&&this.gotoDefinition(o.target.position,o.hasSideBySideModifier).catch(a=>{bt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(r.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(SV.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 Yae(this.editor,jr.Position|jr.Value|jr.Selection|jr.Scroll);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Mo(o=>this.findDefinition(e,o));let n;try{n=await this.previousPromise}catch(o){bt(o);return}if(!n||!n.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const r=n[0].originSelectionRange?F.lift(n[0].originSelectionRange):new F(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(n.length>1){let o=r;for(const{originSelectionRange:a}of n)a&&(o=F.plusRange(o,a));this.addDecoration(o,new Nt().appendText(g(1444,"Click to show {0} definitions.",n.length)))}else{const o=n[0];if(!o.uri)return;this.textModelResolverService.createModelReference(o.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:c}}=a,{startLineNumber:l}=o.range;if(l<1||l>c.getLineCount()){a.dispose();return}const d=this.getPreviewValue(c,l,o),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(r,d?new Nt().appendCodeblock(h||"",d):void 0),a.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=SV.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let r=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const n=!t&&this.editor.getOption(x.definitionLinkOpensInPeek)&&!this.isInPeekEditor(i);return new hG({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Le);return og.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},SV=tk,tk.ID="editor.contrib.gotodefinitionatposition",tk.MAX_SOURCE_PREVIEW_LINES=8,tk);XM=SV=D([_(1,pn),_(2,Di),_(3,nt)],XM);on(XM.ID,XM,ai.BeforeFirstInteraction);class w4e{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let rye=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"),r=(a,c)=>{let l=mm(a.resource.toString(),c.resource.toString());return l===0&&(n==="position"?l=F.compareRangesUsingStarts(a,c)||Hs.compare(a.severity,c.severity):l=Hs.compare(a.severity,c.severity)||F.compareRangesUsingStarts(a,c)),l},o=()=>{this._markers=this._markerService.read({resource:N.isUri(e)?e:void 0,severities:Hs.Error|Hs.Warning|Hs.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(r)};o(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(c=>this._resourceFilter(c)))&&(o(),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 w4e(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,r=this._markers.findIndex(o=>o.resource.toString()===e.uri.toString());r<0&&(r=k2(this._markers,{resource:e.uri},(o,a)=>mm(o.resource.toString(),a.resource.toString())),r<0&&(r=~r));for(let o=r;on.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 rye(e,this._markerService,this._configService)}};oye=D([_(0,Dm),_(1,Te)],oye);ce($tt,oye,Qt.Delayed);var FWt='.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}';gt(FWt,{});var OWt=".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)}";gt(OWt,{});var aye;(function(s){function e(t){switch(t){case Ze.Ignore:return"severity-ignore "+He.asClassName(ve.info);case Ze.Info:return He.asClassName(ve.info);case Ze.Warning:return He.asClassName(ve.warning);case Ze.Error:return He.asClassName(ve.error);default:return""}}s.className=e})(aye||(aye={}));var cye;class BWt{constructor(e,t,i,n,r){this._openerService=n,this._labelService=r,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Z,this._editor=t;const o=document.createElement("div");o.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),o.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),o.appendChild(this._relatedBlock),this._disposables.add(Rr(this._relatedBlock,"click",a=>{a.preventDefault();const c=this._relatedDiagnostics.get(a.target);c&&i(c)})),this._scrollable=new $Qe(o,{horizontal:Cr.Auto,vertical:Cr.Auto,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{o.style.left=`-${a.scrollLeft}px`,o.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){wt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:r}=e;let o=(t?.length||0)+2;r&&(typeof r=="string"?o+=r.length:o+=r.value.length);const a=cv(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+o,this._longestLineLength);Ns(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||r){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(r)if(typeof r=="string"){const f=document.createElement("span");f.innerText=`(${r})`,f.classList.add("code"),u.appendChild(f)}else{this._codeLink=fe("a.code-link"),this._codeLink.setAttribute("href",`${r.target.toString()}`),this._codeLink.onclick=p=>{this._openerService.open(r.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()};const f=oe(this._codeLink,fe("span"));f.innerText=r.value,u.appendChild(this._codeLink)}}if(Ns(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),tr(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 Hs.Error:t=g(5123,"Error");break;case Hs.Warning:t=g(5124,"Warning");break;case Hs.Info:t=g(5125,"Info");break;case Hs.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 ZL;let u9=(ZL=class extends Q3{constructor(e,t,i,n,r,o,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},r),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=o,this._labelService=a,this._callOnDispose=new Z,this._onDidSelectRelatedInformation=new I,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Hs.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(VWt);let t=lye,i=WWt;this._severity===Hs.Warning?(t=EQ,i=HWt):this._severity===Hs.Info&&(t=dye,i=UWt);const n=e.getColor(t),r=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:r,primaryHeadingColor:e.getColor(OMe),secondaryHeadingColor:e.getColor(BMe)})}_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(cye.TitleMenu,this._contextKeyService);vC(i,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=oe(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 BWt(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),r=this.editor.getPosition(),o=r&&n.containsPosition(r)?r:n.getStartPosition();super.show(o,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(vi(a.uri),c)}this._icon.className=`codicon ${aye.className(Hs.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(o,_t.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()}},cye=ZL,ZL.TitleMenu=new _e("gotoErrorTitleMenu"),ZL);u9=cye=D([_(1,mn),_(2,Ar),_(3,Ba),_(4,we),_(5,Le),_(6,Os)],u9);const y4e=j8(FN,Dpt),C4e=j8(vm,Y8),S4e=j8(bm,J8),lye=W("editorMarkerNavigationError.background",{dark:y4e,light:y4e,hcDark:yt,hcLight:yt},g(5130,"Editor marker navigation widget error color.")),WWt=W("editorMarkerNavigationError.headerBackground",{dark:rt(lye,.1),light:rt(lye,.1),hcDark:null,hcLight:null},g(5131,"Editor marker navigation widget error heading background.")),EQ=W("editorMarkerNavigationWarning.background",{dark:C4e,light:C4e,hcDark:yt,hcLight:yt},g(5132,"Editor marker navigation widget warning color.")),HWt=W("editorMarkerNavigationWarning.headerBackground",{dark:rt(EQ,.1),light:rt(EQ,.1),hcDark:"#0C141F",hcLight:rt(EQ,.2)},g(5133,"Editor marker navigation widget warning heading background.")),dye=W("editorMarkerNavigationInfo.background",{dark:S4e,light:S4e,hcDark:yt,hcLight:yt},g(5134,"Editor marker navigation widget info color.")),UWt=W("editorMarkerNavigationInfo.headerBackground",{dark:rt(dye,.1),light:rt(dye,.1),hcDark:null,hcLight:null},g(5135,"Editor marker navigation widget info heading background.")),VWt=W("editorMarkerNavigation.background",Uc,g(5136,"Editor marker navigation widget background."));var AV,eR;let ZM=(eR=class{static get(e){return e.getContribution(AV.ID)}constructor(e,t,i,n,r){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=r,this._sessionDispoables=new Z,this._editor=e,this._widgetVisible=Gtt.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(u9,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 re(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:dA.NearTop,selection:i.selected.marker}},this._editor);n&&(AV.get(n)?.close(),AV.get(n)?.nagivate(e,t))}else this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}}},AV=eR,eR.ID="editor.contrib.markerController",eR);ZM=AV=D([_(1,$tt),_(2,Le),_(3,qt),_(4,we)],ZM);class Oce extends it{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&ZM.get(t)?.nagivate(this._next,this._multiFile)}}const C1=class C1 extends Oce{constructor(){super(!0,!1,{id:C1.ID,label:C1.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:u9.TitleMenu,title:C1.LABEL,icon:oi("marker-navigation-next",ve.arrowDown,g(1446,"Icon for goto next marker.")),group:"navigation",order:1}})}};C1.ID="editor.action.marker.next",C1.LABEL=g(1445,"Go to Next Problem (Error, Warning, Info)");let rZ=C1;const S1=class S1 extends Oce{constructor(){super(!1,!1,{id:S1.ID,label:S1.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:u9.TitleMenu,title:S1.LABEL,icon:oi("marker-navigation-previous",ve.arrowUp,g(1448,"Icon for goto previous marker.")),group:"navigation",order:2}})}};S1.ID="editor.action.marker.prev",S1.LABEL=g(1447,"Go to Previous Problem (Error, Warning, Info)");let hye=S1;class zWt extends Oce{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 $Wt extends Oce{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(ZM.ID,ZM,ai.Lazy);Re(rZ);Re(hye);Re(zWt);Re($Wt);const Gtt=new Q("markersNavigationVisible",!1),GWt=uc.bindToContribution(ZM.get);Qe(new GWt({id:"closeMarkersNavigation",precondition:Gtt,handler:s=>s.close(),kbOpts:{weight:Ae.EditorContrib+50,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));var Pv;(function(s){s.NoAutoFocus="noAutoFocus",s.FocusIfVisible="focusIfVisible",s.AutoFocusImmediately="autoFocusImmediately"})(Pv||(Pv={}));class KWt extends it{constructor(){super({id:Yet,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:[Pv.NoAutoFocus,Pv.FocusIfVisible,Pv.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:Pv.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyI),weight:Ae.EditorContrib}})}run(e,t,i){if(!t.hasModel())return;const n=Fa.get(t);if(!n)return;const r=i?.focus;let o=Pv.FocusIfVisible;Object.values(Pv).includes(r)?o=r:typeof r=="boolean"&&r&&(o=Pv.AutoFocusImmediately);const a=l=>{const d=t.getPosition(),h=new F(d.lineNumber,d.column,d.lineNumber,d.column);n.showContentHover(h,lC.Immediate,UA.Keyboard,l)},c=t.getOption(x.accessibilitySupport)===Zl.Enabled;n.isHoverVisible?o!==Pv.NoAutoFocus?n.focus():a(c):a(c||o===Pv.AutoFocusImmediately)}}class qWt extends it{constructor(){super({id:zFt,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=Fa.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const r=new F(n.lineNumber,n.column,n.lineNumber,n.column),o=XM.get(t);if(!o)return;o.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(r,lC.Immediate,UA.Keyboard,!0)})}}class QWt extends it{constructor(){super({id:$Ft,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=Fa.get(t);i&&i.scrollUp()}}class jWt extends it{constructor(){super({id:GFt,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=Fa.get(t);i&&i.scrollDown()}}class YWt extends it{constructor(){super({id:KFt,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=Fa.get(t);i&&i.scrollLeft()}}class JWt extends it{constructor(){super({id:qFt,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=Fa.get(t);i&&i.scrollRight()}}class XWt extends it{constructor(){super({id:QFt,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=Fa.get(t);i&&i.pageUp()}}class ZWt extends it{constructor(){super({id:jFt,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=Fa.get(t);i&&i.pageDown()}}class eHt extends it{constructor(){super({id:YFt,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=Fa.get(t);i&&i.goToTop()}}class tHt extends it{constructor(){super({id:JFt,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=Fa.get(t);i&&i.goToBottom()}}class iHt extends it{constructor(){super({id:JU,label:ZFt,alias:"Increase Hover Verbosity Level",precondition:J.hoverVisible})}run(e,t,i){const n=Fa.get(t);if(!n)return;const r=i?.index!==void 0?i.index:n.focusedHoverPartIndex();n.updateHoverVerbosityLevel(Nc.Increase,r,i?.focus)}}class nHt extends it{constructor(){super({id:XU,label:tOt,alias:"Decrease Hover Verbosity Level",precondition:J.hoverVisible})}run(e,t,i){const n=Fa.get(t);if(!n)return;const r=i?.index!==void 0?i.index:n.focusedHoverPartIndex();Fa.get(t)?.updateHoverVerbosityLevel(Nc.Decrease,r,i?.focus)}}const Om=fe;class sHt{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===uu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const A4e={type:Ah.Invoke,filter:{include:Cs.QuickFix},triggerAction:ag.QuickFixHover};let uye=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!==uu.Range&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,r=i.getLineMaxColumn(n),o=[];for(const a of t){const c=a.range.startLineNumber===n?a.range.startColumn:1,l=a.range.endLineNumber===n?a.range.endColumn:r,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const h=new F(e.range.startLineNumber,c,e.range.startLineNumber,l);o.push(new sHt(this,h,d))}return o}renderHoverParts(e,t){if(!t.length)return new qM([]);const i=new Z,n=[];t.forEach(o=>{const a=this._renderMarkerHover(o);e.fragment.appendChild(a.hoverElement),n.push(a)});const r=t.length===1?t[0]:t.sort((o,a)=>Hs.compare(o.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(e,r,i),new qM(n)}getAccessibleContent(e){return e.marker.message}_renderMarkerHover(e){const t=new Z,i=Om("div.hover-row"),n=oe(i,Om("div.marker.hover-contents")),{source:r,message:o,code:a,relatedInformation:c}=e.marker;this._editor.applyFontInfo(n);const l=oe(n,Om("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=o,r||a)if(a&&typeof a!="string"){const h=Om("span");if(r){const m=oe(h,Om("span"));m.innerText=r}const u=oe(h,Om("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=oe(u,Om("span"));f.innerText=a.value;const p=oe(n,h);p.style.opacity="0.6",p.style.paddingLeft="6px"}else{const h=oe(n,Om("span"));h.style.opacity="0.6",h.style.paddingLeft="6px",h.innerText=r&&a?`${r}(${a})`:r||`(${a})`}if(tr(c))for(const{message:h,resource:u,startLineNumber:f,startColumn:p}of c){const m=oe(n,Om("div"));m.style.marginTop="8px";const v=oe(m,Om("a"));v.innerText=`${vi(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(bt)}));const b=oe(m,Om("span"));b.innerText=h,this._editor.applyFontInfo(b)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Hs.Error||t.marker.severity===Hs.Warning||t.marker.severity===Hs.Info){const n=ZM.get(this._editor);n&&e.statusBar.addAction({label:g(5169,"View Problem"),commandId:rZ.ID,run:()=>{e.hide(),n.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(x.readOnly)){const n=e.statusBar.append(Om("div"));this.recentMarkerCodeActionsInfo&&(uJ.makeKey(this.recentMarkerCodeActionsInfo.marker)===uJ.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=g(5170,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const r=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?V.None:Zy(()=>n.textContent=g(5171,"Checking for quick fixes..."),200,i);n.textContent||(n.textContent=" ");const o=this.getCodeActions(t.marker);i.add(Ee(()=>o.cancel())),o.then(a=>{if(r.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:tNe,run:l=>{c=!0;const d=GM.get(this._editor),h=So(l);e.hide(),d?.showCodeActions(A4e,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},bt)}}getCodeActions(e){return Mo(t=>rB(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new F(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),A4e,hu.None,t))}};uye=D([_(1,eLe),_(2,Ar),_(3,nt)],uye);var oZ;(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.",``)})(oZ||(oZ={}));class rHt{constructor(){this.type=Sm.View,this.priority=95,this.name="hover",this.when=J.hoverFocused}getProvider(e){const t=e.get(qt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const n=Fa.get(i);if(!n)return;const r=e.get(Vt);return e.get(we).createInstance(aHt,r,i,n)}}class oHt{constructor(){this.priority=100,this.name="hover",this.type=Sm.Help,this.when=J.hoverVisible}getProvider(e){const t=e.get(qt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const n=Fa.get(i);if(n)return e.get(we).createInstance(qtt,n)}}class Ktt extends V{constructor(e){super(),this._hoverController=e,this.id=Wb.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(` +`),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 v4e(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(S.DownArrow))return b4e(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 xbe(null,this._contextViewProvider,{width:dWt,label:Y2t,placeholder:J2t,appendCaseSensitiveLabel:this._keybindingLabelFor(zr.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(zr.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(zr.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:()=>iZ(this._keybindingService),inputBoxStyles:LM,toggleStyles:dJ},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()})),mo&&this._register(this._findInput.onMouseDown(d=>this._onFindInputMouseDown(d))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(Yk());this._prevBtn=this._register(new CP({label:X2t+this._keybindingLabelFor(zr.PreviousMatchFindAction),icon:q2t,hoverDelegate:i,onTrigger:()=>{Qn(this._codeEditor.getAction(zr.PreviousMatchFindAction)).run().then(void 0,bt)}},this._hoverService)),this._nextBtn=this._register(new CP({label:Z2t+this._keybindingLabelFor(zr.NextMatchFindAction),icon:Q2t,hoverDelegate:i,onTrigger:()=>{Qn(this._codeEditor.getAction(zr.NextMatchFindAction)).run().then(void 0,bt)}},this._hoverService));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const r=document.createElement("div");r.className="find-actions",n.appendChild(r),r.appendChild(this._matchesCount),r.appendChild(this._prevBtn.domNode),r.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new sE({icon:$2t,title:eWt+this._keybindingLabelFor(zr.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:$e(b6),inputActiveOptionBorder:$e(uae),inputActiveOptionForeground:$e(gae)})),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)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new CP({label:tWt+this._keybindingLabelFor(zr.CloseFindWidgetCommand),icon:QJe,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 Dbe(null,void 0,{label:iWt,placeholder:nWt,appendPreserveCaseLabel:this._keybindingLabelFor(zr.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>iZ(this._keybindingService),inputBoxStyles:LM,toggleStyles:dJ},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 o=this._register(Yk());this._replaceBtn=this._register(new CP({label:sWt+this._keybindingLabelFor(zr.ReplaceOneAction),icon:G2t,hoverDelegate:o,onTrigger:()=>{this._controller.replace()},onKeyDown:d=>{d.equals(U.Shift|S.Tab)&&(this._closeBtn.focus(),d.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new CP({label:rWt+this._keybindingLabelFor(zr.ReplaceAllAction),icon:K2t,hoverDelegate:o,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 CP({label:oWt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Od(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=j2t,this._domNode.role="dialog",this._domNode.style.width=`${ew}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 Wd(this._domNode,this,{orientation:pi.VERTICAL,size:2})),this._resized=!1;let l=ew;this._register(this._resizeSash.onDidStart(()=>{l=Od(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=Od(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const d=Od(this._domNode);if(dthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}};dre.ID="editor.contrib.findWidget";let qwe=dre;class CP extends _d{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+He.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??Fo("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(...He.asClassNameArray(g4e)),this._domNode.classList.add(...He.asClassNameArray(f4e))):(this._domNode.classList.remove(...He.asClassNameArray(f4e)),this._domNode.classList.add(...He.asClassNameArray(g4e)))}}Ep((s,e)=>{const t=s.getColor(kx);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Fy(s.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=s.getColor(Npt);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${Fy(s.type)?"dashed":"solid"} ${i}; }`);const n=s.getColor(yt);n&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${n}; }`);const r=s.getColor(Rpt);r&&e.addRule(`.monaco-editor .findMatchInline { color: ${r}; }`);const o=s.getColor(Mpt);o&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${o}; }`)});var Qwe;const uWt=524288;function jwe(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)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:iv.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,cn.MACHINE),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,Ie.WORKSPACE,cn.MACHINE),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,Ie.WORKSPACE,cn.MACHINE),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,Ie.WORKSPACE,cn.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!!Fce.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=Nh(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=jwe(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);n&&(this._state.isRegex?i.searchString=Nh(n):i.searchString=n)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const n=jwe(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(r=>!r.isEmpty())&&(i.searchScope=n)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new j5(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)}},Qwe=XL,XL.ID="editor.contrib.findController",XL);cg=Qwe=D([_(1,Le),_(2,Gi),_(3,gg),_(4,wi),_(5,tc)],cg);let Ywe=class extends cg{constructor(e,t,i,n,r,o,a,c,l){super(e,i,a,c,o,l),this._contextViewService=t,this._keybindingService=n,this._themeService=r,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===iv.FocusReplaceInput?this._widget.focusReplaceInput():e.shouldFocus===iv.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 qwe(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new Kwe(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}};Ywe=D([_(1,bf),_(2,Le),_(3,Vt),_(4,mn),_(5,wi),_(6,Gi),_(7,gg),_(8,tc)],Ywe);const gWt=Aqe(new Sqe({id:zr.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}}));gWt.addImplementation(0,(s,e,t)=>{const i=cg.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:iv.FocusFindInput,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop}):!1});const fWt={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 pWt extends it{constructor(){super({id:zr.StartFindWithArgs,label:g(1395,"Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:Ae.EditorContrib},metadata:fWt})}async run(e,t,i){const n=cg.get(t);if(n){const r=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:iv.FocusFindInput,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(x.find).loop},r),n.setGlobalBufferTerm(n.getState().searchString)}}}class mWt extends it{constructor(){super({id:zr.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=cg.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:iv.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class Vtt extends it{async run(e,t){const i=cg.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:iv.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class _Wt extends Vtt{constructor(){super({id:zr.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,Fce),primary:S.Enter,weight:Ae.EditorContrib}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class vWt extends Vtt{constructor(){super({id:zr.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,Fce),primary:U.Shift|S.Enter,weight:Ae.EditorContrib}]})}_run(e){return e.moveToPrevMatch()}}class bWt extends it{constructor(){super({id:zr.GoToMatchFindAction,label:g(1399,"Go to Match..."),alias:"Go to Match...",precondition:lE}),this._highlightDecorations=[]}run(e,t,i){const n=cg.get(t);if(!n)return;const r=n.getState().matchesCount;if(r<1){e.get(wi).notify({severity:Ze.Warning,message:g(1400,"No matches. Try searching for something else.")});return}const a=e.get(Tn).createInputBox();a.placeholder=g(1401,"Type a number to go to a specific match (between 1 and {0})",r);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:$r(JQe),position:Tl.Full}}}])})}}class ztt extends it{async run(e,t){const i=cg.get(t);if(!i)return;const n=jwe(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:iv.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class wWt extends ztt{constructor(){super({id:zr.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 yWt extends ztt{constructor(){super({id:zr.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 CWt=Aqe(new Sqe({id:zr.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}}));CWt.addImplementation(0,(s,e,t)=>{if(!e.hasModel()||e.getOption(x.readOnly))return!1;const i=cg.get(e);if(!i)return!1;const n=e.getSelection(),r=i.isFindInputFocused(),o=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(x.find).seedSearchStringFromSelection!=="never"&&!r,a=r||o?iv.FocusReplaceInput:iv.FocusFindInput;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:o?"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(cg.ID,Ywe,ai.Eager);Re(pWt);Re(mWt);Re(_Wt);Re(vWt);Re(bWt);Re(wWt);Re(yWt);const Qb=uc.bindToContribution(cg.get);Qe(new Qb({id:zr.CloseFindWidgetCommand,precondition:lE,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 Qb({id:zr.ToggleCaseSensitiveCommand,precondition:void 0,handler:s=>s.toggleCaseSensitive(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:NK.primary,mac:NK.mac,win:NK.win,linux:NK.linux}}));Qe(new Qb({id:zr.ToggleWholeWordCommand,precondition:void 0,handler:s=>s.toggleWholeWords(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:PK.primary,mac:PK.mac,win:PK.win,linux:PK.linux}}));Qe(new Qb({id:zr.ToggleRegexCommand,precondition:void 0,handler:s=>s.toggleRegex(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:FK.primary,mac:FK.mac,win:FK.win,linux:FK.linux}}));Qe(new Qb({id:zr.ToggleSearchScopeCommand,precondition:void 0,handler:s=>s.toggleSearchScope(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:OK.primary,mac:OK.mac,win:OK.win,linux:OK.linux}}));Qe(new Qb({id:zr.TogglePreserveCaseCommand,precondition:void 0,handler:s=>s.togglePreserveCase(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:BK.primary,mac:BK.mac,win:BK.win,linux:BK.linux}}));Qe(new Qb({id:zr.ReplaceOneAction,precondition:lE,handler:s=>s.replace(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.CtrlCmd|U.Shift|S.Digit1}}));Qe(new Qb({id:zr.ReplaceOneAction,precondition:lE,handler:s=>s.replace(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,ANe),primary:S.Enter}}));Qe(new Qb({id:zr.ReplaceAllAction,precondition:lE,handler:s=>s.replaceAll(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.CtrlCmd|U.Alt|S.Enter}}));Qe(new Qb({id:zr.ReplaceAllAction,precondition:lE,handler:s=>s.replaceAll(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,ANe),primary:void 0,mac:{primary:U.CtrlCmd|S.Enter}}}));Qe(new Qb({id:zr.SelectAllMatchesAction,precondition:lE,handler:s=>s.selectAllMatches(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.Alt|S.Enter}}));class SWt extends it{constructor(){super({id:"editor.action.fontZoomIn",label:g(1389,"Increase Editor Font Size"),alias:"Increase Editor Font Size",precondition:void 0})}run(e,t){Jp.setZoomLevel(Jp.getZoomLevel()+1)}}class AWt extends it{constructor(){super({id:"editor.action.fontZoomOut",label:g(1390,"Decrease Editor Font Size"),alias:"Decrease Editor Font Size",precondition:void 0})}run(e,t){Jp.setZoomLevel(Jp.getZoomLevel()-1)}}class EWt extends it{constructor(){super({id:"editor.action.fontZoomReset",label:g(1391,"Reset Editor Font Size"),alias:"Reset Editor Font Size",precondition:void 0})}run(e,t){Jp.setZoomLevel(0)}}Re(SWt);Re(AWt);Re(EWt);var zB;let nZ=(zB=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(r=>{r.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 cY;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(n=>{const r=n.charCodeAt(n.length-1);i.has(r)&&this._trigger(String.fromCharCode(r))}))}_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 li,r=this._editor.onDidChangeModelContent(o=>{if(o.isFlush){n.cancel(),r.dispose();return}for(let a=0,c=o.changes.length;a{n.token.isCancellationRequested||tr(o)&&(this._accessibilitySignalService.playSignal(ll.format,{userGesture:!1}),vW.execute(this._editor,o,!0))}).finally(()=>{r.dispose()})}},zB.ID="editor.contrib.autoFormat",zB);nZ=D([_(1,nt),_(2,Fl),_(3,uv)],nZ);var $B;let sZ=($B=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(Xae,this.editor,e,cm.Silent,hu.None,Ue.None,!1).catch(bt))}},$B.ID="editor.contrib.formatOnPaste",$B);sZ=D([_(1,nt),_(2,we)],sZ);class xWt extends it{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(nE).showWhile(i.invokeFunction($ve,t,cm.Explicit,hu.None,Ue.None,!0),250)}}}class DWt extends it{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:oo(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(),r=t.getSelections().map(a=>a.isEmpty()?new F(a.startLineNumber,1,a.startLineNumber,n.getLineMaxColumn(a.startLineNumber)):a);await e.get(nE).showWhile(i.invokeFunction(Xae,t,r,cm.Explicit,hu.None,Ue.None,!0),250)}}on(nZ.ID,nZ,ai.BeforeFirstInteraction);on(sZ.ID,sZ,ai.BeforeFirstInteraction);Re(xWt);Re(DWt);vt.registerCommand("editor.action.format",async s=>{const e=s.get(qt).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=s.get(bi);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});class Zw{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 r=0;t.children.get(n)!==void 0;r++)n=`${i}_${r}`;return n}static getElementById(e,t){if(!e)return;const i=Qy(e,t.id);if(i===e.length)return t;if(!(i0&&F.areIntersecting(e[n-1],t.symbol.range)&&(n-=1)):n=i;const r=[];let o;for(;no)&&(o=a.severity)}for(const[,a]of t.children)this._updateMarker(r,a);o&&(t.marker={count:r.length,topSev:o}),vM(e)}}class Nw extends Zw{static create(e,t,i){const n=new li(i),r=new Nw(t.uri),o=e.ordered(t),a=o.map((l,d)=>{const h=Zw.findId(`provider_${d}`,r),u=new Xwe(h,r,l.displayName??"Unknown Outline Provider",d);return Promise.resolve(l.provideDocumentSymbols(t,n.token)).then(f=>{for(const p of f||[])Nw._makeOutlineElement(p,u);return u},f=>(Nr(f),u)).then(f=>{Zw.empty(f)?f.remove():r._groups.set(h,f)})}),c=e.onDidChange(()=>{const l=e.ordered(t);ns(l,o)||n.cancel()});return Promise.all(a).then(()=>n.token.isCancellationRequested&&!i.isCancellationRequested?Nw.create(e,t,i):r._compact()).finally(()=>{n.dispose(),c.dispose(),n.dispose()})}static _makeOutlineElement(e,t){const i=Zw.findId(e,t),n=new Jwe(i,t,e);if(e.children)for(const r of e.children)Nw._makeOutlineElement(r,n);t.children.set(n.id,n)}static get(e){for(;e;){if(e instanceof Nw)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=ui.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 r=t.parent;for(;r&&!i;)r instanceof Xwe&&(i=r),r=r.parent}let n;for(const[,r]of this._groups)if(n=r.getItemEnclosingPosition(e),n&&(!i||i===r))break;return n}getItemById(e){return Zw.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 Jwe?e.push(t.symbol):e.push(...ui.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 Nw._flattenDocumentSymbols(t,e,""),t.sort((i,n)=>re.compare(F.getStartPosition(i.range),F.getStartPosition(n.range))||re.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&&Nw._flattenDocumentSymbols(e,n.children,n.name)}}const fG=ae("IOutlineModelService");let Zwe=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new Z,this._cache=new pm(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 r=this._cache.get(e.id);if(!r||r.versionId!==e.getVersionId()||!ns(r.provider,n)){const a=new li;r={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:a,promise:Nw.create(i,e,a.token),model:void 0},this._cache.set(e.id,r);const c=Date.now();r.promise.then(l=>{r.model=l,this._debounceInformation.update(e,Date.now()-c)}).catch(l=>{this._cache.delete(e.id)})}if(r.model)return r.model;r.promiseCnt+=1;const o=t.onCancellationRequested(()=>{--r.promiseCnt===0&&(r.source.cancel(),this._cache.delete(e.id))});try{return await r.promise}finally{o.dispose()}}getDebounceValue(e){return this._debounceInformation.get(e)}};Zwe=D([_(0,nt),_(1,xp),_(2,fi)],Zwe);ce(fG,Zwe,Qt.Delayed);vt.registerCommand("_executeDocumentSymbolProvider",async function(s,...e){const[t]=e;Lt(N.isUri(t));const i=s.get(fG),r=await s.get(pn).createModelReference(t);try{return(await i.getOrCreate(r.object.textEditorModel,Ue.None)).getTopLevelSymbols()}finally{r.dispose()}});const hre=class hre extends it{constructor(){super({id:hre.ID,label:g(5080,"Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:he.and(J.writable,Xu.inlineSuggestionVisible),kbOpts:{weight:100,primary:U.Alt|S.BracketRight}})}async run(e,t){mu.get(t)?.model.get()?.next()}};hre.ID=net;let eye=hre;const ure=class ure extends it{constructor(){super({id:ure.ID,label:g(5081,"Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:he.and(J.writable,Xu.inlineSuggestionVisible),kbOpts:{weight:100,primary:U.Alt|S.BracketLeft}})}async run(e,t){mu.get(t)?.model.get()?.previous()}};ure.ID=iet;let tye=ure;class kWt extends it{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=mu.get(t);await QYe(async n=>{await i?.model.get()?.triggerExplicitly(n),i?.playAccessibilitySignal(n)})}}class IWt extends it{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,Xu.inlineSuggestionVisible),kbOpts:{weight:Ae.EditorContrib+1,primary:U.CtrlCmd|S.RightArrow,kbExpr:he.and(J.writable,Xu.inlineSuggestionVisible)},menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5084,"Accept Word"),group:"primary",order:2}]})}async run(e,t){const i=mu.get(t);await i?.model.get()?.acceptNextWord(i.editor)}}class TWt extends it{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,Xu.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=mu.get(t);await i?.model.get()?.acceptNextLine(i.editor)}}class LWt extends it{constructor(){super({id:tet,label:g(5087,"Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:Xu.inlineSuggestionVisible,menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5088,"Accept"),group:"primary",order:1}],kbOpts:{primary:S.Tab,weight:200,kbExpr:he.and(Xu.inlineSuggestionVisible,J.tabMovesFocus.toNegated(),Xu.inlineSuggestionHasIndentationLessThanTabSize,Vi.Visible.toNegated(),J.hoverFocused.toNegated())}})}async run(e,t){const i=mu.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const gre=class gre extends it{constructor(){super({id:gre.ID,label:g(5089,"Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:Xu.inlineSuggestionVisible,kbOpts:{weight:100,primary:S.Escape}})}async run(e,t){const i=mu.get(t);is(n=>{i?.model.get()?.stop(n)})}};gre.ID="editor.action.inlineSuggest.hide";let iye=gre;const fre=class fre extends di{constructor(){super({id:fre.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),r=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",r)}};fre.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let nye=fre;class RWt{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===uu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let sye=class{constructor(e,t,i,n,r,o){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=r,this._telemetryService=o,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=mu.get(this._editor);if(!t)return null;const i=e.target;if(i.type===Mt.CONTENT_VIEW_ZONE){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new wQ(1e3,this,F.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}return i.type===Mt.CONTENT_EMPTY&&t.shouldShowHoverAt(i.range)?new wQ(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===Mt.CONTENT_TEXT&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new wQ(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=mu.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new RWt(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 r=n.controller.model.get(),o=this._instantiationService.createInstance(AW,this._editor,!1,rd(null),r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands),a=o.getDomNode();e.fragment.appendChild(a),r.triggerExplicitly(),i.add(o);const c={hoverPart:n,hoverElement:a,dispose(){i.dispose()}};return new qM([c])}getAccessibleContent(e){return g(5091,"There are inline completions here")}renderScreenReaderText(e,t){const i=new Z,n=fe,r=n("div.hover-row.markdown-hover"),o=oe(r,n("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new Z_({editor:this._editor},this._languageService,this._openerService)),c=l=>{i.add(a.onDidRenderAsync(()=>{o.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=g(5092,"Suggestion:"),h=i.add(a.render(new Nt().appendText(d).appendCodeblock("text",l)));o.replaceChildren(h.element)};return i.add(ci(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 ca(o)})),e.fragment.appendChild(r),i}};sye=D([_(1,Di),_(2,Ar),_(3,_o),_(4,we),_(5,Ji)],sye);class MWt{constructor(){this.type=Sm.View,this.priority=95,this.name="inline-completions",this.when=he.and(Xu.inlineSuggestionVisible)}getProvider(e){const t=e.get(qt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const n=mu.get(i)?.model.get();if(n?.state.get())return new NWt(i,n)}}class NWt 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=Wb.InlineCompletions,this.verbositySettingKey="accessibility.verbosity.inlineCompletions",this.options={language:this._editor.getModel()?.getLanguageId()??void 0,type:Sm.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(mu.ID,mu,ai.Eventually);Re(kWt);Re(eye);Re(tye);Re(IWt);Re(TWt);Re(LWt);Re(iye);Et(nye);JN.register(sye);Z6.register(new MWt);var PWt=".monaco-editor .goto-definition-link{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer;text-decoration:underline}";gt(PWt,{});var SV,tk;let XM=(tk=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 r=new Tce(e);this.toUnhook.add(r),this.toUnhook.add(r.onMouseMoveOrRelevantKeyDown(([o,a])=>{this.startFindDefinitionFromMouse(o,a??void 0)})),this.toUnhook.add(r.onExecute(o=>{this.isEnabled(o)&&this.gotoDefinition(o.target.position,o.hasSideBySideModifier).catch(a=>{bt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(r.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(SV.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 Yae(this.editor,jr.Position|jr.Value|jr.Selection|jr.Scroll);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Mo(o=>this.findDefinition(e,o));let n;try{n=await this.previousPromise}catch(o){bt(o);return}if(!n||!n.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const r=n[0].originSelectionRange?F.lift(n[0].originSelectionRange):new F(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(n.length>1){let o=r;for(const{originSelectionRange:a}of n)a&&(o=F.plusRange(o,a));this.addDecoration(o,new Nt().appendText(g(1444,"Click to show {0} definitions.",n.length)))}else{const o=n[0];if(!o.uri)return;this.textModelResolverService.createModelReference(o.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:c}}=a,{startLineNumber:l}=o.range;if(l<1||l>c.getLineCount()){a.dispose();return}const d=this.getPreviewValue(c,l,o),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(r,d?new Nt().appendCodeblock(h||"",d):void 0),a.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=SV.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let r=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const n=!t&&this.editor.getOption(x.definitionLinkOpensInPeek)&&!this.isInPeekEditor(i);return new hG({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Le);return og.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},SV=tk,tk.ID="editor.contrib.gotodefinitionatposition",tk.MAX_SOURCE_PREVIEW_LINES=8,tk);XM=SV=D([_(1,pn),_(2,Di),_(3,nt)],XM);on(XM.ID,XM,ai.BeforeFirstInteraction);class w4e{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let rye=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"),r=(a,c)=>{let l=mm(a.resource.toString(),c.resource.toString());return l===0&&(n==="position"?l=F.compareRangesUsingStarts(a,c)||Hs.compare(a.severity,c.severity):l=Hs.compare(a.severity,c.severity)||F.compareRangesUsingStarts(a,c)),l},o=()=>{this._markers=this._markerService.read({resource:N.isUri(e)?e:void 0,severities:Hs.Error|Hs.Warning|Hs.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(r)};o(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(c=>this._resourceFilter(c)))&&(o(),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 w4e(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,r=this._markers.findIndex(o=>o.resource.toString()===e.uri.toString());r<0&&(r=k2(this._markers,{resource:e.uri},(o,a)=>mm(o.resource.toString(),a.resource.toString())),r<0&&(r=~r));for(let o=r;on.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 rye(e,this._markerService,this._configService)}};oye=D([_(0,Dm),_(1,Te)],oye);ce($tt,oye,Qt.Delayed);var FWt='.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}';gt(FWt,{});var OWt=".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)}";gt(OWt,{});var aye;(function(s){function e(t){switch(t){case Ze.Ignore:return"severity-ignore "+He.asClassName(ve.info);case Ze.Info:return He.asClassName(ve.info);case Ze.Warning:return He.asClassName(ve.warning);case Ze.Error:return He.asClassName(ve.error);default:return""}}s.className=e})(aye||(aye={}));var cye;class BWt{constructor(e,t,i,n,r){this._openerService=n,this._labelService=r,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Z,this._editor=t;const o=document.createElement("div");o.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),o.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),o.appendChild(this._relatedBlock),this._disposables.add(Rr(this._relatedBlock,"click",a=>{a.preventDefault();const c=this._relatedDiagnostics.get(a.target);c&&i(c)})),this._scrollable=new $Qe(o,{horizontal:Cr.Auto,vertical:Cr.Auto,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{o.style.left=`-${a.scrollLeft}px`,o.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){wt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:r}=e;let o=(t?.length||0)+2;r&&(typeof r=="string"?o+=r.length:o+=r.value.length);const a=cv(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+o,this._longestLineLength);Ns(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||r){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(r)if(typeof r=="string"){const f=document.createElement("span");f.innerText=`(${r})`,f.classList.add("code"),u.appendChild(f)}else{this._codeLink=fe("a.code-link"),this._codeLink.setAttribute("href",`${r.target.toString()}`),this._codeLink.onclick=p=>{this._openerService.open(r.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()};const f=oe(this._codeLink,fe("span"));f.innerText=r.value,u.appendChild(this._codeLink)}}if(Ns(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),tr(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 Hs.Error:t=g(5123,"Error");break;case Hs.Warning:t=g(5124,"Warning");break;case Hs.Info:t=g(5125,"Info");break;case Hs.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 ZL;let u9=(ZL=class extends Q3{constructor(e,t,i,n,r,o,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},r),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=o,this._labelService=a,this._callOnDispose=new Z,this._onDidSelectRelatedInformation=new I,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Hs.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(VWt);let t=lye,i=WWt;this._severity===Hs.Warning?(t=EQ,i=HWt):this._severity===Hs.Info&&(t=dye,i=UWt);const n=e.getColor(t),r=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:r,primaryHeadingColor:e.getColor(OMe),secondaryHeadingColor:e.getColor(BMe)})}_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(cye.TitleMenu,this._contextKeyService);vC(i,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=oe(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 BWt(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),r=this.editor.getPosition(),o=r&&n.containsPosition(r)?r:n.getStartPosition();super.show(o,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(vi(a.uri),c)}this._icon.className=`codicon ${aye.className(Hs.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(o,_t.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()}},cye=ZL,ZL.TitleMenu=new _e("gotoErrorTitleMenu"),ZL);u9=cye=D([_(1,mn),_(2,Ar),_(3,Wa),_(4,we),_(5,Le),_(6,Os)],u9);const y4e=j8(FN,Dpt),C4e=j8(vm,Y8),S4e=j8(bm,J8),lye=W("editorMarkerNavigationError.background",{dark:y4e,light:y4e,hcDark:yt,hcLight:yt},g(5130,"Editor marker navigation widget error color.")),WWt=W("editorMarkerNavigationError.headerBackground",{dark:rt(lye,.1),light:rt(lye,.1),hcDark:null,hcLight:null},g(5131,"Editor marker navigation widget error heading background.")),EQ=W("editorMarkerNavigationWarning.background",{dark:C4e,light:C4e,hcDark:yt,hcLight:yt},g(5132,"Editor marker navigation widget warning color.")),HWt=W("editorMarkerNavigationWarning.headerBackground",{dark:rt(EQ,.1),light:rt(EQ,.1),hcDark:"#0C141F",hcLight:rt(EQ,.2)},g(5133,"Editor marker navigation widget warning heading background.")),dye=W("editorMarkerNavigationInfo.background",{dark:S4e,light:S4e,hcDark:yt,hcLight:yt},g(5134,"Editor marker navigation widget info color.")),UWt=W("editorMarkerNavigationInfo.headerBackground",{dark:rt(dye,.1),light:rt(dye,.1),hcDark:null,hcLight:null},g(5135,"Editor marker navigation widget info heading background.")),VWt=W("editorMarkerNavigation.background",Uc,g(5136,"Editor marker navigation widget background."));var AV,eR;let ZM=(eR=class{static get(e){return e.getContribution(AV.ID)}constructor(e,t,i,n,r){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=r,this._sessionDispoables=new Z,this._editor=e,this._widgetVisible=Gtt.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(u9,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 re(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:dA.NearTop,selection:i.selected.marker}},this._editor);n&&(AV.get(n)?.close(),AV.get(n)?.nagivate(e,t))}else this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}}},AV=eR,eR.ID="editor.contrib.markerController",eR);ZM=AV=D([_(1,$tt),_(2,Le),_(3,qt),_(4,we)],ZM);class Oce extends it{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&ZM.get(t)?.nagivate(this._next,this._multiFile)}}const C1=class C1 extends Oce{constructor(){super(!0,!1,{id:C1.ID,label:C1.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:u9.TitleMenu,title:C1.LABEL,icon:oi("marker-navigation-next",ve.arrowDown,g(1446,"Icon for goto next marker.")),group:"navigation",order:1}})}};C1.ID="editor.action.marker.next",C1.LABEL=g(1445,"Go to Next Problem (Error, Warning, Info)");let rZ=C1;const S1=class S1 extends Oce{constructor(){super(!1,!1,{id:S1.ID,label:S1.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:u9.TitleMenu,title:S1.LABEL,icon:oi("marker-navigation-previous",ve.arrowUp,g(1448,"Icon for goto previous marker.")),group:"navigation",order:2}})}};S1.ID="editor.action.marker.prev",S1.LABEL=g(1447,"Go to Previous Problem (Error, Warning, Info)");let hye=S1;class zWt extends Oce{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 $Wt extends Oce{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(ZM.ID,ZM,ai.Lazy);Re(rZ);Re(hye);Re(zWt);Re($Wt);const Gtt=new Q("markersNavigationVisible",!1),GWt=uc.bindToContribution(ZM.get);Qe(new GWt({id:"closeMarkersNavigation",precondition:Gtt,handler:s=>s.close(),kbOpts:{weight:Ae.EditorContrib+50,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));var Pv;(function(s){s.NoAutoFocus="noAutoFocus",s.FocusIfVisible="focusIfVisible",s.AutoFocusImmediately="autoFocusImmediately"})(Pv||(Pv={}));class KWt extends it{constructor(){super({id:Yet,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:[Pv.NoAutoFocus,Pv.FocusIfVisible,Pv.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:Pv.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyI),weight:Ae.EditorContrib}})}run(e,t,i){if(!t.hasModel())return;const n=Oa.get(t);if(!n)return;const r=i?.focus;let o=Pv.FocusIfVisible;Object.values(Pv).includes(r)?o=r:typeof r=="boolean"&&r&&(o=Pv.AutoFocusImmediately);const a=l=>{const d=t.getPosition(),h=new F(d.lineNumber,d.column,d.lineNumber,d.column);n.showContentHover(h,lC.Immediate,UA.Keyboard,l)},c=t.getOption(x.accessibilitySupport)===Zl.Enabled;n.isHoverVisible?o!==Pv.NoAutoFocus?n.focus():a(c):a(c||o===Pv.AutoFocusImmediately)}}class qWt extends it{constructor(){super({id:zFt,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=Oa.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const r=new F(n.lineNumber,n.column,n.lineNumber,n.column),o=XM.get(t);if(!o)return;o.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(r,lC.Immediate,UA.Keyboard,!0)})}}class QWt extends it{constructor(){super({id:$Ft,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=Oa.get(t);i&&i.scrollUp()}}class jWt extends it{constructor(){super({id:GFt,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=Oa.get(t);i&&i.scrollDown()}}class YWt extends it{constructor(){super({id:KFt,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=Oa.get(t);i&&i.scrollLeft()}}class JWt extends it{constructor(){super({id:qFt,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=Oa.get(t);i&&i.scrollRight()}}class XWt extends it{constructor(){super({id:QFt,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=Oa.get(t);i&&i.pageUp()}}class ZWt extends it{constructor(){super({id:jFt,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=Oa.get(t);i&&i.pageDown()}}class eHt extends it{constructor(){super({id:YFt,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=Oa.get(t);i&&i.goToTop()}}class tHt extends it{constructor(){super({id:JFt,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=Oa.get(t);i&&i.goToBottom()}}class iHt extends it{constructor(){super({id:JU,label:ZFt,alias:"Increase Hover Verbosity Level",precondition:J.hoverVisible})}run(e,t,i){const n=Oa.get(t);if(!n)return;const r=i?.index!==void 0?i.index:n.focusedHoverPartIndex();n.updateHoverVerbosityLevel(Nc.Increase,r,i?.focus)}}class nHt extends it{constructor(){super({id:XU,label:tOt,alias:"Decrease Hover Verbosity Level",precondition:J.hoverVisible})}run(e,t,i){const n=Oa.get(t);if(!n)return;const r=i?.index!==void 0?i.index:n.focusedHoverPartIndex();Oa.get(t)?.updateHoverVerbosityLevel(Nc.Decrease,r,i?.focus)}}const Om=fe;class sHt{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===uu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const A4e={type:Ah.Invoke,filter:{include:Cs.QuickFix},triggerAction:ag.QuickFixHover};let uye=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!==uu.Range&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,r=i.getLineMaxColumn(n),o=[];for(const a of t){const c=a.range.startLineNumber===n?a.range.startColumn:1,l=a.range.endLineNumber===n?a.range.endColumn:r,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const h=new F(e.range.startLineNumber,c,e.range.startLineNumber,l);o.push(new sHt(this,h,d))}return o}renderHoverParts(e,t){if(!t.length)return new qM([]);const i=new Z,n=[];t.forEach(o=>{const a=this._renderMarkerHover(o);e.fragment.appendChild(a.hoverElement),n.push(a)});const r=t.length===1?t[0]:t.sort((o,a)=>Hs.compare(o.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(e,r,i),new qM(n)}getAccessibleContent(e){return e.marker.message}_renderMarkerHover(e){const t=new Z,i=Om("div.hover-row"),n=oe(i,Om("div.marker.hover-contents")),{source:r,message:o,code:a,relatedInformation:c}=e.marker;this._editor.applyFontInfo(n);const l=oe(n,Om("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=o,r||a)if(a&&typeof a!="string"){const h=Om("span");if(r){const m=oe(h,Om("span"));m.innerText=r}const u=oe(h,Om("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=oe(u,Om("span"));f.innerText=a.value;const p=oe(n,h);p.style.opacity="0.6",p.style.paddingLeft="6px"}else{const h=oe(n,Om("span"));h.style.opacity="0.6",h.style.paddingLeft="6px",h.innerText=r&&a?`${r}(${a})`:r||`(${a})`}if(tr(c))for(const{message:h,resource:u,startLineNumber:f,startColumn:p}of c){const m=oe(n,Om("div"));m.style.marginTop="8px";const v=oe(m,Om("a"));v.innerText=`${vi(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(bt)}));const b=oe(m,Om("span"));b.innerText=h,this._editor.applyFontInfo(b)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Hs.Error||t.marker.severity===Hs.Warning||t.marker.severity===Hs.Info){const n=ZM.get(this._editor);n&&e.statusBar.addAction({label:g(5169,"View Problem"),commandId:rZ.ID,run:()=>{e.hide(),n.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(x.readOnly)){const n=e.statusBar.append(Om("div"));this.recentMarkerCodeActionsInfo&&(uJ.makeKey(this.recentMarkerCodeActionsInfo.marker)===uJ.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=g(5170,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const r=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?V.None:Zy(()=>n.textContent=g(5171,"Checking for quick fixes..."),200,i);n.textContent||(n.textContent=" ");const o=this.getCodeActions(t.marker);i.add(Ee(()=>o.cancel())),o.then(a=>{if(r.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:tNe,run:l=>{c=!0;const d=GM.get(this._editor),h=So(l);e.hide(),d?.showCodeActions(A4e,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},bt)}}getCodeActions(e){return Mo(t=>rB(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new F(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),A4e,hu.None,t))}};uye=D([_(1,eLe),_(2,Ar),_(3,nt)],uye);var oZ;(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.",``)})(oZ||(oZ={}));class rHt{constructor(){this.type=Sm.View,this.priority=95,this.name="hover",this.when=J.hoverFocused}getProvider(e){const t=e.get(qt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const n=Oa.get(i);if(!n)return;const r=e.get(Vt);return e.get(we).createInstance(aHt,r,i,n)}}class oHt{constructor(){this.priority=100,this.name="hover",this.type=Sm.Help,this.when=J.hoverVisible}getProvider(e){const t=e.get(qt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const n=Oa.get(i);if(n)return e.get(we).createInstance(qtt,n)}}class Ktt extends V{constructor(e){super(),this._hoverController=e,this.id=Wb.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(Nc.Increase,e);i!==void 0&&t.push(i);const n=this._descriptionOfVerbosityActionForIndex(Nc.Decrease,e);return n!==void 0&&t.push(n),t}_descriptionOfVerbosityActionForIndex(e,t){if(this._hoverController.doesHoverAtIndexSupportVerbosityAction(t,e))switch(e){case Nc.Increase:return oZ.increaseVerbosity;case Nc.Decrease:return oZ.decreaseVerbosity}}}class qtt extends Ktt{constructor(e){super(e),this.options={type:Sm.Help}}provideContent(){return this.provideContentAtIndex(this._focusedHoverPartIndex,!0)}}class aHt extends Ktt{constructor(e,t,i){super(i),this._keybindingService=e,this._editor=t,this.options={type:Sm.View},this._initializeOptions(this._editor,i)}provideContent(){return this.provideContentAtIndex(this._focusedHoverPartIndex,!1)}get actions(){const e=[];return e.push(this._getActionFor(this._editor,Nc.Increase)),e.push(this._getActionFor(this._editor,Nc.Decrease)),e}_getActionFor(e,t){let i,n,r;switch(t){case Nc.Increase:i=JU,n=XFt,r=ve.add;break;case Nc.Decrease:i=XU,n=eOt,r=ve.remove;break}const o=itt(this._keybindingService,t),a=this._hoverController.doesHoverAtIndexSupportVerbosityAction(this._focusedHoverPartIndex,t);return new an(n,o,He.asClassName(r),a,()=>{e.getAction(i)?.run({index:this._focusedHoverPartIndex,focus:!1})})}_initializeOptions(e,t){const i=this._register(new qtt(t));this.options.language=e.getModel()?.getLanguageId(),this.options.customHelp=()=>i.provideContentAtIndex(this._focusedHoverPartIndex,!0)}}class cHt{constructor(){this.type=Sm.View,this.priority=90,this.name="extension-hover"}getProvider(e){const i=e.get(bf).getContextViewElement(),n=i?.textContent??void 0,r=e.get(tc);if(!(i.classList.contains("accessible-view-container")||!n))return new ZZe(Wb.Hover,{language:"typescript",type:Sm.View},()=>n,()=>{r.showAndFocusLastHover()},"accessibility.verbosity.hover")}}on(Fa.ID,Fa,ai.BeforeFirstInteraction);Re(KWt);Re(qWt);Re(QWt);Re(jWt);Re(YWt);Re(JWt);Re(XWt);Re(ZWt);Re(eHt);Re(tHt);Re(iHt);Re(nHt);JN.register(n9);JN.register(uye);Ep((s,e)=>{const t=s.getColor(yQe);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)}; }`))});Z6.register(new rHt);Z6.register(new oHt);Z6.register(new cHt);function Mg(s,e){let t=0;for(let i=0;ii-1)return[];const{tabSize:o,indentSize:a,insertSpaces:c}=s.getOptions(),l=(m,v)=>(v=v||1,wm.shiftIndent(m,m.length+v,o,a,c)),d=(m,v)=>(v=v||1,wm.unshiftIndent(m,m.length+v,o,a,c)),h=[],u=s.getLineContent(t);let f=hr(u),p=f;r.shouldIncrease(t)?(p=l(p),f=l(f)):r.shouldIndentNextLine(t)&&(p=l(p)),t++;for(let m=t;m<=i;m++){if(lHt(s,m))continue;const v=s.getLineContent(m),b=hr(v),w=p;r.shouldDecrease(m,w)&&(p=d(p),f=d(f)),b!==p&&h.push(es.replaceMove(new ht(m,1,m,b.length+1),gLe(p,a,c))),!r.shouldIgnore(m)&&(r.shouldIncrease(m,w)?(f=l(f),p=f):r.shouldIndentNextLine(m,w)?p=l(p):p=f)}return h}function lHt(s,e){return s.tokenization.isCheapToTokenize(e)?s.tokenization.getLineTokens(e).getStandardTokenType(0)===no.String:!1}const pre=class pre extends it{constructor(){super({id:pre.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(),r=t.getSelection();if(!r)return;const o=new fHt(r,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};pre.ID="editor.action.indentationToSpaces";let gye=pre;const mre=class mre extends it{constructor(){super({id:mre.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(),r=t.getSelection();if(!r)return;const o=new pHt(r,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};mre.ID="editor.action.indentationToTabs";let fye=mre;class ENe extends it{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(Tn),n=e.get(fi),r=t.getModel();if(!r)return;const o=n.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget),a=r.getOptions(),c=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===o.tabSize&&d===a.tabSize?g(1457,"Configured Tab Size"):d===o.tabSize?g(1458,"Default Tab Size"):d===a.tabSize?g(1459,"Current Tab Size"):void 0})),l=Math.min(r.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(c,{placeHolder:g(1460,"Select Tab Size for Current File"),activeItem:c[l]}).then(d=>{if(d&&r&&!r.isDisposed()){const h=parseInt(d.label,10);this.displaySizeOnly?r.updateOptions({tabSize:h}):r.updateOptions({tabSize:h,indentSize:h,insertSpaces:this.insertSpaces})}})},50)}}const _re=class _re extends ENe{constructor(){super(!1,!1,{id:_re.ID,label:g(1461,"Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:Pe(1462,"Use indentation with tabs.")}})}};_re.ID="editor.action.indentUsingTabs";let pye=_re;const vre=class vre extends ENe{constructor(){super(!0,!1,{id:vre.ID,label:g(1463,"Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:Pe(1464,"Use indentation with spaces.")}})}};vre.ID="editor.action.indentUsingSpaces";let mye=vre;const bre=class bre extends ENe{constructor(){super(!0,!0,{id:bre.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.")}})}};bre.ID="editor.action.changeTabDisplaySize";let _ye=bre;const wre=class wre extends it{constructor(){super({id:wre.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(fi),n=t.getModel();if(!n)return;const r=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(r.insertSpaces,r.tabSize)}};wre.ID="editor.action.detectIndentation";let vye=wre;class dHt extends it{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(zs),n=t.getModel();if(!n)return;const r=Qtt(n,i,1,n.getLineCount());r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class hHt extends it{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(zs),n=t.getModel();if(!n)return;const r=t.getSelections();if(r===null)return;const o=[];for(const a of r){let c=a.startLineNumber,l=a.endLineNumber;if(c!==l&&a.endColumn===1&&l--,c===1){if(c===l)continue}else c--;const d=Qtt(n,i,c,l);o.push(...d)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class uHt{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 GB;let aZ=(GB=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)||gHt(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const r=this.editor.getOption(x.autoIndent),{tabSize:o,indentSize:a,insertSpaces:c}=i.getOptions(),l=[],d={shiftIndent:p=>wm.shiftIndent(p,p.length+1,o,a,c),unshiftIndent:p=>wm.unshiftIndent(p,p.length+1,o,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=p5(r,i,i.getLanguageId(),h,d,this._languageConfigurationService);if(p!==null){const m=hr(u),v=Mg(p,o),b=Mg(m,o);if(v!==b){const w=Y5(v,o,c);l.push({range:new F(h,1,h,m.length+1),text:w}),u=w+u.substring(m.length)}else{const w=HQe(i,h,this._languageConfigurationService);if(w===0||w===wb.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=Mg(m,o),b=Mg(hr(i.getLineContent(h+1)),o);if(v!==b){const w=v-b;for(let y=h+1;y<=e.endLineNumber;y++){const C=i.getLineContent(y),A=hr(C),k=Mg(A,o)+w,P=Y5(k,o,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 uHt(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",p),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=r=>r.trim().length===0;let n=!0;if(t.startLineNumber===t.endLineNumber){const o=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);n=i(o)}else for(let r=t.startLineNumber;r<=t.endLineNumber;r++){const o=e.getLineContent(r);if(r===t.startLineNumber){const a=o.substring(t.startColumn-1);n=i(a)}else if(r===t.endLineNumber){const a=o.substring(0,t.endColumn-1);n=i(a)}else n=e.getLineFirstNonWhitespaceColumn(r)===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 r=n.findTokenIndexAtOffset(i);if(r>=0&&n.getStandardTokenType(r)===no.Comment)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},GB.ID="editor.contrib.autoIndentOnPaste",GB);aZ=D([_(1,zs)],aZ);function gHt(s,e){const t=i=>Kft(s,i)===no.String;return t(e.getStartPosition())||t(e.getEndPosition())}function jtt(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let n="";for(let o=0;othis.editorWorkerService.navigateValueSet(a,r,t)),this.currentRequest.then(c=>{if(!c||!c.range||!c.value||!o.validate(this.editor))return;const l=F.lift(c.range);let d=c.range;const h=c.value.length-(r.endColumn-r.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+c.value.length},h>1&&(r=new ht(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn+h-1));const u=new mHt(l,r,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:xQ.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=Ao(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(bt)}).catch(bt)):Promise.resolve(void 0)}},xQ=ik,ik.ID="editor.contrib.inPlaceReplaceController",ik.DECORATION=Kt.register({description:"in-place-replace",className:"valueSetReplacement"}),ik);OW=xQ=D([_(1,Pl)],OW);class vHt extends it{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=OW.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class bHt extends it{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=OW.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}on(OW.ID,OW,ai.Lazy);Re(vHt);Re(bHt);class wHt extends it{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,Bi.Explicit,wl.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}}Re(wHt);class Ytt{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=h_.LTR,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber{e.getAction(i)?.run({index:this._focusedHoverPartIndex,focus:!1})})}_initializeOptions(e,t){const i=this._register(new qtt(t));this.options.language=e.getModel()?.getLanguageId(),this.options.customHelp=()=>i.provideContentAtIndex(this._focusedHoverPartIndex,!0)}}class cHt{constructor(){this.type=Sm.View,this.priority=90,this.name="extension-hover"}getProvider(e){const i=e.get(bf).getContextViewElement(),n=i?.textContent??void 0,r=e.get(tc);if(!(i.classList.contains("accessible-view-container")||!n))return new ZZe(Wb.Hover,{language:"typescript",type:Sm.View},()=>n,()=>{r.showAndFocusLastHover()},"accessibility.verbosity.hover")}}on(Oa.ID,Oa,ai.BeforeFirstInteraction);Re(KWt);Re(qWt);Re(QWt);Re(jWt);Re(YWt);Re(JWt);Re(XWt);Re(ZWt);Re(eHt);Re(tHt);Re(iHt);Re(nHt);JN.register(n9);JN.register(uye);Ep((s,e)=>{const t=s.getColor(yQe);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)}; }`))});Z6.register(new rHt);Z6.register(new oHt);Z6.register(new cHt);function Mg(s,e){let t=0;for(let i=0;ii-1)return[];const{tabSize:o,indentSize:a,insertSpaces:c}=s.getOptions(),l=(m,v)=>(v=v||1,wm.shiftIndent(m,m.length+v,o,a,c)),d=(m,v)=>(v=v||1,wm.unshiftIndent(m,m.length+v,o,a,c)),h=[],u=s.getLineContent(t);let f=hr(u),p=f;r.shouldIncrease(t)?(p=l(p),f=l(f)):r.shouldIndentNextLine(t)&&(p=l(p)),t++;for(let m=t;m<=i;m++){if(lHt(s,m))continue;const v=s.getLineContent(m),b=hr(v),w=p;r.shouldDecrease(m,w)&&(p=d(p),f=d(f)),b!==p&&h.push(es.replaceMove(new ht(m,1,m,b.length+1),gLe(p,a,c))),!r.shouldIgnore(m)&&(r.shouldIncrease(m,w)?(f=l(f),p=f):r.shouldIndentNextLine(m,w)?p=l(p):p=f)}return h}function lHt(s,e){return s.tokenization.isCheapToTokenize(e)?s.tokenization.getLineTokens(e).getStandardTokenType(0)===no.String:!1}const pre=class pre extends it{constructor(){super({id:pre.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(),r=t.getSelection();if(!r)return;const o=new fHt(r,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};pre.ID="editor.action.indentationToSpaces";let gye=pre;const mre=class mre extends it{constructor(){super({id:mre.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(),r=t.getSelection();if(!r)return;const o=new pHt(r,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};mre.ID="editor.action.indentationToTabs";let fye=mre;class ENe extends it{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(Tn),n=e.get(fi),r=t.getModel();if(!r)return;const o=n.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget),a=r.getOptions(),c=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===o.tabSize&&d===a.tabSize?g(1457,"Configured Tab Size"):d===o.tabSize?g(1458,"Default Tab Size"):d===a.tabSize?g(1459,"Current Tab Size"):void 0})),l=Math.min(r.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(c,{placeHolder:g(1460,"Select Tab Size for Current File"),activeItem:c[l]}).then(d=>{if(d&&r&&!r.isDisposed()){const h=parseInt(d.label,10);this.displaySizeOnly?r.updateOptions({tabSize:h}):r.updateOptions({tabSize:h,indentSize:h,insertSpaces:this.insertSpaces})}})},50)}}const _re=class _re extends ENe{constructor(){super(!1,!1,{id:_re.ID,label:g(1461,"Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:Pe(1462,"Use indentation with tabs.")}})}};_re.ID="editor.action.indentUsingTabs";let pye=_re;const vre=class vre extends ENe{constructor(){super(!0,!1,{id:vre.ID,label:g(1463,"Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:Pe(1464,"Use indentation with spaces.")}})}};vre.ID="editor.action.indentUsingSpaces";let mye=vre;const bre=class bre extends ENe{constructor(){super(!0,!0,{id:bre.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.")}})}};bre.ID="editor.action.changeTabDisplaySize";let _ye=bre;const wre=class wre extends it{constructor(){super({id:wre.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(fi),n=t.getModel();if(!n)return;const r=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(r.insertSpaces,r.tabSize)}};wre.ID="editor.action.detectIndentation";let vye=wre;class dHt extends it{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(zs),n=t.getModel();if(!n)return;const r=Qtt(n,i,1,n.getLineCount());r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class hHt extends it{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(zs),n=t.getModel();if(!n)return;const r=t.getSelections();if(r===null)return;const o=[];for(const a of r){let c=a.startLineNumber,l=a.endLineNumber;if(c!==l&&a.endColumn===1&&l--,c===1){if(c===l)continue}else c--;const d=Qtt(n,i,c,l);o.push(...d)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class uHt{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 GB;let aZ=(GB=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)||gHt(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const r=this.editor.getOption(x.autoIndent),{tabSize:o,indentSize:a,insertSpaces:c}=i.getOptions(),l=[],d={shiftIndent:p=>wm.shiftIndent(p,p.length+1,o,a,c),unshiftIndent:p=>wm.unshiftIndent(p,p.length+1,o,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=p5(r,i,i.getLanguageId(),h,d,this._languageConfigurationService);if(p!==null){const m=hr(u),v=Mg(p,o),b=Mg(m,o);if(v!==b){const w=Y5(v,o,c);l.push({range:new F(h,1,h,m.length+1),text:w}),u=w+u.substring(m.length)}else{const w=HQe(i,h,this._languageConfigurationService);if(w===0||w===wb.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=Mg(m,o),b=Mg(hr(i.getLineContent(h+1)),o);if(v!==b){const w=v-b;for(let y=h+1;y<=e.endLineNumber;y++){const C=i.getLineContent(y),A=hr(C),k=Mg(A,o)+w,P=Y5(k,o,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 uHt(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",p),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=r=>r.trim().length===0;let n=!0;if(t.startLineNumber===t.endLineNumber){const o=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);n=i(o)}else for(let r=t.startLineNumber;r<=t.endLineNumber;r++){const o=e.getLineContent(r);if(r===t.startLineNumber){const a=o.substring(t.startColumn-1);n=i(a)}else if(r===t.endLineNumber){const a=o.substring(0,t.endColumn-1);n=i(a)}else n=e.getLineFirstNonWhitespaceColumn(r)===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 r=n.findTokenIndexAtOffset(i);if(r>=0&&n.getStandardTokenType(r)===no.Comment)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},GB.ID="editor.contrib.autoIndentOnPaste",GB);aZ=D([_(1,zs)],aZ);function gHt(s,e){const t=i=>Kft(s,i)===no.String;return t(e.getStartPosition())||t(e.getEndPosition())}function jtt(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let n="";for(let o=0;othis.editorWorkerService.navigateValueSet(a,r,t)),this.currentRequest.then(c=>{if(!c||!c.range||!c.value||!o.validate(this.editor))return;const l=F.lift(c.range);let d=c.range;const h=c.value.length-(r.endColumn-r.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+c.value.length},h>1&&(r=new ht(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn+h-1));const u=new mHt(l,r,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:xQ.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=Ao(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(bt)}).catch(bt)):Promise.resolve(void 0)}},xQ=ik,ik.ID="editor.contrib.inPlaceReplaceController",ik.DECORATION=Kt.register({description:"in-place-replace",className:"valueSetReplacement"}),ik);OW=xQ=D([_(1,Fl)],OW);class vHt extends it{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=OW.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class bHt extends it{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=OW.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}on(OW.ID,OW,ai.Lazy);Re(vHt);Re(bHt);class wHt extends it{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,Bi.Explicit,yl.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}}Re(wHt);class Ytt{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=h_.LTR,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumberh.label).join `)}else if(h=o.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new F(h,1,h+1,1),null),t.addEditOperation(new F(o.endLineNumber,e.getLineMaxColumn(o.endLineNumber),o.endLineNumber,e.getLineMaxColumn(o.endLineNumber)),` `+u),this.shouldAutoIndent(e,o)){const f={tokenization:{getLineTokens:m=>m===h?e.tokenization.getLineTokens(o.startLineNumber):e.tokenization.getLineTokens(m),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:m=>m===h?e.getLineContent(o.startLineNumber):e.getLineContent(m)},p=this.matchEnterRule(e,d,a,o.startLineNumber,o.startLineNumber-2);if(p!==null)p!==0&&this.getIndentEditsOfMovingBlock(e,t,o,a,l,p);else{const m=p5(this._autoIndent,f,e.getLanguageIdAtPosition(o.startLineNumber,1),h,d,this._languageConfigurationService);if(m!==null){const v=hr(e.getLineContent(o.startLineNumber)),b=Mg(m,a),w=Mg(v,a);if(b!==w){const y=b-w;this.getIndentEditsOfMovingBlock(e,t,o,a,l,y)}}}}}this._selectionId=t.trackSelection(o)}buildIndentConverter(e,t,i){return{shiftIndent:n=>wm.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>wm.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,r){if(r){let o=r.indentation;r.indentAction===Co.None||r.indentAction===Co.Indent?o=r.indentation+r.appendText:r.indentAction===Co.IndentOutdent?o=r.indentation:r.indentAction===Co.Outdent&&(o=t.unshiftIndent(r.indentation)+r.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(o))>=0){const c=hr(e.getLineContent(n));let l=hr(o);const d=HQe(e,n,this._languageConfigurationService);d!==null&&d&wb.DECREASE_MASK&&(l=t.unshiftIndent(l));const h=Mg(l,i),u=Mg(c,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,r,o){if(M_(o)>=0){const a=e.getLineMaxColumn(r),c=UO(this._autoIndent,e,new F(r,a,r,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(M_(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=UO(this._autoIndent,e,new F(a,c,a,c),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}}matchEnterRule(e,t,i,n,r,o){let a=r;for(;a>=1;){let d;if(a===r&&o!==void 0?d=o:d=e.getLineContent(a),M_(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=UO(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 r=[];for(let a=i;a<=n;a++)r.push(s.getLineContent(a));let o=r.slice(0);return o.sort(g9.getCollator().compare),t===!0&&(o=o.reverse()),{startLineNumber:i,endLineNumber:n,before:r,after:o}}function yHt(s,e,t){const i=Jtt(s,e,t);return i?es.replace(new F(i.startLineNumber,1,i.endLineNumber,s.getLineMaxColumn(i.endLineNumber)),i.after.join(` `)):null}class Xtt extends it{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((o,a)=>({selection:o,index:a,ignore:!1}));i.sort((o,a)=>F.compareRangesUsingStarts(o.selection,a.selection));let n=i[0];for(let o=1;onew re(d.positionLineNumber,d.positionColumn)));const r=t.getSelection();if(r===null)return;const o=e.get(Te),a=t.getModel(),c=o.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),l=new JOt(r,n,c);t.pushUndoStop(),t.executeCommands(this.id,[l]),t.pushUndoStop()}};yre.ID="editor.action.trimTrailingWhitespace";let wye=yre;class THt extends it{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 r=0;const o=[],a=[];for(let c=0,l=i.length;c1&&(h-=1,f=n.getLineMaxColumn(h)),o.push(es.replace(new ht(h,f,u,p),"")),a.push(new ht(h-r,d.positionColumn,h-r,d.positionColumn)),r+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,o,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(r=>{let o=r.endLineNumber;return r.startLineNumberr.startLineNumber===o.startLineNumber?r.endLineNumber-o.endLineNumber:r.startLineNumber-o.startLineNumber);const i=[];let n=t[0];for(let r=1;r=t[r].startLineNumber?n.endLineNumber=t[r].endLineNumber:(i.push(n),n=t[r]);return i.push(n),i}}class LHt extends it{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,nx.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class RHt extends it{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){VO.Outdent.runEditorCommand(e,t,null)}}class MHt extends it{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,bae.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class NHt extends it{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,bae.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class tit extends it{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),r=[];for(let c=0,l=n.length-1;ces.replace(c,""));t.pushUndoStop(),t.executeEdits(this.id,a,o),t.pushUndoStop()}}class PHt extends tit{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 r=0;return t.forEach(o=>{let a;if(o.endColumn===1&&r>0){const c=o.startLineNumber-r;a=new ht(c,o.startColumn,c,o.startColumn)}else a=new ht(o.startLineNumber,o.startColumn,o.startLineNumber,o.startColumn);r+=o.endLineNumber-o.startLineNumber,o.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(r=>{if(r.isEmpty())if(r.startColumn===1){const o=Math.max(1,r.startLineNumber-1),a=r.startLineNumber===1?1:n.getLineLength(o)+1;return new F(o,a,r.startLineNumber,1)}else return new F(r.startLineNumber,1,r.startLineNumber,r.startColumn);else return new F(r.startLineNumber,1,r.endLineNumber,r.endColumn)}),i)}}class FHt extends tit{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 r=0,o=t.length,a=0;r{if(r.isEmpty()){const o=t.getLineMaxColumn(r.startLineNumber);return r.startColumn===o?new F(r.startLineNumber,r.startColumn,r.startLineNumber+1,1):new F(r.startLineNumber,r.startColumn,r.startLineNumber,o)}return r});return n.sort(F.compareRangesUsingStarts),n}}class OHt extends it{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 r=[],o=i.reduce((u,f)=>u.isEmpty()?u.endLineNumber===f.startLineNumber?(n.equalsSelection(u)&&(n=f),f):f.startLineNumber>u.endLineNumber+1?(r.push(u),f):new ht(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(r.push(u),f):new ht(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));r.push(o);const a=t.getModel();if(a===null)return;const c=[],l=[];let d=n,h=0;for(let u=0,f=r.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(es.replace(L,A)),k=new ht(L.startLineNumber-h,A.length-b+1,m-h,A.length-b+1)):p.startLineNumber===p.endLineNumber?(c.push(es.replace(L,A)),k=new ht(p.startLineNumber-h,p.startColumn,p.endLineNumber-h,p.endColumn)):(c.push(es.replace(L,A)),k=new ht(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 BHt extends it{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 r=[];for(let o=0,a=i.length;o=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("");r.push(new nd(new ht(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("");r.push(new fLe(h,u,new ht(l.lineNumber,l.column+1,l.lineNumber,l.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class ZN extends it{run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const r=t.getOption(x.wordSeparators),o=[];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);o.push(es.replace(d,this._modifyText(h,r)))}else{const c=n.getValueInRange(a);o.push(es.replace(a,this._modifyText(c,r)))}t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop()}}class WHt extends ZN{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 HHt extends ZN{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 fA{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 Cre=class Cre extends ZN{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=Cre.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,n=>n.toLocaleUpperCase()):e}};Cre.titleBoundary=new fA("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let cZ=Cre;const dO=class dO extends ZN{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=dO.caseBoundary.get(),n=dO.singleLetters.get();return!i||!n?e:e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase()}};dO.caseBoundary=new fA("(\\p{Ll})(\\p{Lu})","gmu"),dO.singleLetters=new fA("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let J5=dO;const Sre=class Sre extends ZN{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=Sre.wordBoundary.get();if(!i)return e;const n=e.split(i);return n.shift()+n.map(o=>o.substring(0,1).toLocaleUpperCase()+o.substring(1)).join("")}};Sre.wordBoundary=new fA("[_\\s-]","gm");let lZ=Sre;const hO=class hO extends ZN{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=hO.wordBoundary.get(),n=hO.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("")}};hO.wordBoundary=new fA("[_\\s-]","gm"),hO.wordBoundaryToMaintain=new fA("(?<=\\.)","gm");let dZ=hO;const ZE=class ZE extends ZN{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=ZE.caseBoundary.get(),n=ZE.singleLetters.get(),r=ZE.underscoreBoundary.get();return!i||!n||!r?e:e.replace(r,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase()}};ZE.caseBoundary=new fA("(\\p{Ll})(\\p{Lu})","gmu"),ZE.singleLetters=new fA("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),ZE.underscoreBoundary=new fA("(\\S)(_)(\\S)","gm");let hZ=ZE;Re(CHt);Re(SHt);Re(AHt);Re(EHt);Re(xHt);Re(DHt);Re(kHt);Re(IHt);Re(wye);Re(THt);Re(LHt);Re(RHt);Re(MHt);Re(NHt);Re(PHt);Re(FHt);Re(OHt);Re(BHt);Re(WHt);Re(HHt);J5.caseBoundary.isSupported()&&J5.singleLetters.isSupported()&&Re(J5);lZ.wordBoundary.isSupported()&&Re(lZ);dZ.wordBoundary.isSupported()&&Re(dZ);cZ.titleBoundary.isSupported()&&Re(cZ);hZ.isSupported()&&Re(hZ);var UHt=".monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}";gt(UHt,{});var DQ;const iit=new Q("LinkedEditingInputVisible",!1),VHt="linked-editing-decoration";var nk;let BW=(nk=class extends V{static get(e){return e.getContribution(DQ.ID)}constructor(e,t,i,n,r){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=iit.bindTo(t),this._debounceInformation=r.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(o=>{(o.hasChanged(x.linkedEditing)||o.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 Ph(this._debounceInformation.get(t)),r=()=>{this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},o=new Ph(0),a=c=>{this._rangeSyncTriggerPromise=o.trigger(()=>this._syncRanges(c))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{r()})),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}}r()})),this._localToDispose.add({dispose:()=>{n.dispose(),o.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 o=n.match(this._currentWordPattern);if((o?o[0].length:0)!==n.length)return this.clearRanges()}const r=[];for(let o=1,a=this._currentDecorations.length;o1){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 o=this._currentDecorations.getRange(0);if(o&&o.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=n;const r=this._currentRequestCts=new li;try{const o=new Ys(!1),a=await nit(this._providers,i,t,r.token);if(this._debounceInformation.update(i,o.elapsed()),r!==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:DQ.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(o){Oo(o)||bt(o),(this._currentRequestCts===r||!this._currentRequestCts)&&this.clearRanges()}}setDebounceDuration(e){this._debounceDuration=e}},DQ=nk,nk.ID="editor.contrib.linkedEditing",nk.DECORATION=Kt.register({description:"linked-editing",stickiness:si.AlwaysGrowsWhenTypingAtEdges,className:VHt}),nk);BW=DQ=D([_(1,Le),_(2,nt),_(3,zs),_(4,xp)],BW);class zHt extends it{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(qt),[n,r]=Array.isArray(t)&&t||[void 0,void 0];return N.isUri(n)&&re.isIPosition(r)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(r),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},bt):super.runCommand(e,t)}run(e,t){const i=BW.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const $Ht=uc.bindToContribution(BW.get);Qe(new $Ht({id:"cancelLinkedEditingInput",precondition:iit,handler:s=>s.clearRanges(),kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib+99,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));function nit(s,e,t,i){const n=s.ordered(e);return eae(n.map(r=>async()=>{try{return await r.provideLinkedEditingRanges(e,t,i)}catch(o){Nr(o);return}}),r=>!!r&&tr(r?.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."));lg("_executeLinkedEditingProvider",(s,e,t)=>{const{linkedEditingRangeProvider:i}=s.get(nt);return nit(i,e,t,Ue.None)});on(BW.ID,BW,ai.AfterFirstRender);Re(zHt);const Are=class Are extends V{static get(e){return e.getContribution(Are.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})}))}};Are.ID="editor.contrib.longLinesHelper";let uZ=Are;on(uZ.ID,uZ,ai.BeforeFirstInteraction);var GHt=".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}";gt(GHt,{});const KHt=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",KHt,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 qHt=W("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Xs,hcLight:Xs},g(5186,"Border color of a symbol during read-access, like reading a variable."));W("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Xs,hcLight:Xs},g(5187,"Border color of a symbol during write-access, like writing to a variable."));W("editor.wordHighlightTextBorder",qHt,g(5188,"Border color of a textual occurrence for a symbol."));const QHt=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),jHt=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),YHt=W("editorOverviewRuler.wordHighlightTextForeground",SQe,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),JHt=Kt.register({description:"word-highlight-strong",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"wordHighlightStrong",overviewRuler:{color:$r(jHt),position:Il.Center},minimap:{color:$r(hae),position:Rh.Inline}}),XHt=Kt.register({description:"word-highlight-text",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"wordHighlightText",overviewRuler:{color:$r(YHt),position:Il.Center},minimap:{color:$r(hae),position:Rh.Inline}}),ZHt=Kt.register({description:"selection-highlight-overview",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight",overviewRuler:{color:$r(SQe),position:Il.Center},minimap:{color:$r(hae),position:Rh.Inline}}),eUt=Kt.register({description:"selection-highlight",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight"}),tUt=Kt.register({description:"word-highlight",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"wordHighlight",overviewRuler:{color:$r(QHt),position:Il.Center},minimap:{color:$r(hae),position:Rh.Inline}});function iUt(s){return s===k8.Write?JHt:s===k8.Text?XHt:tUt}function nUt(s){return s?eUt:ZHt}Ep((s,e)=>{const t=s.getColor(nLe);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var yye;function PI(s,e){const t=e.filter(i=>!s.find(n=>n.equals(i)));if(t.length>=1){const i=t.map(r=>`line ${r.viewState.position.lineNumber} column ${r.viewState.position.column}`).join(", "),n=t.length===1?g(1518,"Cursor added: {0}",i):g(1519,"Cursors added: {0}",i);xh(n)}}class sUt extends it{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 r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const o=r.getCursorStates();r.setCursorStates(i.source,Bi.Explicit,wl.addCursorUp(r,o,n)),r.revealTopMostCursor(i.source),PI(o,r.getCursorStates())}}class rUt extends it{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 r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const o=r.getCursorStates();r.setCursorStates(i.source,Bi.Explicit,wl.addCursorDown(r,o,n)),r.revealBottomMostCursor(i.source),PI(o,r.getCursorStates())}}class oUt extends it{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 ht(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),r=t._getViewModel(),o=r.getCursorStates(),a=[];n.forEach(c=>this.getCursorsForSelection(c,i,a)),a.length>0&&t.setSelections(a),PI(o,r.getCursorStates())}}class aUt extends it{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(),r=[];for(let c=i[0].startLineNumber;c<=n;c++)r.push(new ht(c,i[0].startColumn,c,i[0].endColumn));const o=t._getViewModel(),a=o.getCursorStates();r.length>0&&t.setSelections(r),PI(a,o.getCursorStates())}}class cUt extends it{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 ht(a,i[0].startColumn,a,i[0].endColumn));const r=t._getViewModel(),o=r.getCursorStates();n.length>0&&t.setSelections(n),PI(o,r.getCursorStates())}}class HK{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class f9{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new f9(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n=!1,r,o;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(n=!0,r=!0,o=!0):(r=i.wholeWord,o=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 ht(c.startLineNumber,h.startColumn,c.startLineNumber,h.endColumn)}else l=e.getModel().getValueInRange(c).replace(/\r\n/g,` -`);return new f9(e,t,n,l,r,o,d)}constructor(e,t,i,n,r,o,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=r,this.matchCase=o,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 HK(t.concat(e),e,_t.Smooth)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new HK(t.slice(0,t.length-1).concat(e),e,_t.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 ht(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 HK(t.concat(e),e,_t.Smooth)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new HK(t.slice(0,t.length-1).concat(e),e,_t.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 ht(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,Vn.MAX_SAFE_SMALL_INTEGER):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Vn.MAX_SAFE_SMALL_INTEGER)}}const Ere=class Ere extends V{static get(e){return e.getContribution(Ere.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=f9.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=bh.True,i.matchCaseOverride=bh.True,i.isRegexOverride=bh.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:bh.NotSet,matchCaseOverride:bh.NotSet,isRegexOverride:bh.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 ht(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(!sit(this._editor.getModel(),t,n)){const o=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,Vn.MAX_SAFE_SMALL_INTEGER):t=n.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Vn.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 r=0,o=t.length;rnew ht(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn)))}}selectAllUsingSelections(e){e.length>0&&this._setSelections(e)}};Ere.ID="editor.contrib.multiCursorController";let WW=Ere;class e4 extends it{run(e,t){const i=WW.get(t);if(!i)return;const n=t._getViewModel();if(n){const r=n.getCursorStates(),o=cg.get(t);if(o)this._run(i,o);else{const a=e.get(we).createInstance(cg,t);this._run(i,a),a.dispose()}PI(r,n.getCursorStates())}}}class lUt extends e4{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 dUt extends e4{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 hUt extends e4{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:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyD),weight:Ae.EditorContrib}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class uUt extends e4{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 gUt extends e4{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 fUt extends e4{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 pUt{constructor(e,t,i,n,r){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,r&&this._model===r._model&&this._searchText===r._searchText&&this._matchCase===r._matchCase&&this._wordSeparators===r._wordSeparators&&this._modelVersionId===r._modelVersionId&&(this._cachedFindMatches=r._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 tR;let gZ=(tR=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 ln(()=>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===Bi.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=cg.get(e);i&&this._register(i.getState().onFindReplaceStateChange(n=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(yye._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 r=WW.get(i);if(!r)return null;const o=cg.get(i);if(!o)return null;let a=r.getSession(o);if(!a){const d=i.getSelections();if(d.length>1){const u=o.getState().matchCase;if(!sit(i.getModel(),d,u))return null}a=f9.create(i,o)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const c=o.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 pUt(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 r=[];for(let l=0,d=0,h=i.length,u=n.length;l=u)r.push(f),l++;else{const p=F.compareRangesUsingStarts(f,n[d]);p<0?((n[d].isEmpty()||!F.areIntersecting(f,n[d]))&&r.push(f),l++):(p>0||l++,d++)}}const o=this.editor.getOption(x.occurrencesHighlight)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&o,c=r.map(l=>({range:l,options:nUt(a)}));this._decorations.set(c)}dispose(){this._setState(null),super.dispose()}},yye=tR,tR.ID="editor.contrib.selectionHighlighter",tR);gZ=yye=D([_(1,nt)],gZ);function sit(s,e,t){const i=E4e(s,e[0],!t);for(let n=1,r=e.length;nthis.editor.getModel()),this.uiState=et(this,n=>{if(this.isDisposed.read(n))return;const r=this.currentTextModel.read(n);if(r!==this.model.targetTextModel.read(n))return;const o=this.model.ghostText.read(n);if(!o)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)&&o.parts.length===1&&o.parts[0].lines.length===1,l=o.parts.length===1&&o.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 iu(C.content.length+1,C.content.length+1+w[0].length,y,Xa.Regular)),C.content+=w[0],w=w.slice(1)}for(const C of w)h.push({content:C,decorations:y?[new iu(1,C.length+1,y,Xa.Regular)]:[]})}const f=r.getLineContent(o.lineNumber);let p,m=0;if(!l&&(c||!a)){for(const w of o.parts){let y=w.lines;a&&!c&&(u(y,Eue),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,Eue),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 ret(p,f.length+1):void 0,b=c||!a?o.lineNumber:a.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:v,lineNumber:b,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:r,range:a,isSingleLine:c,isPureRemove:l}}),this.decorations=et(this,n=>{const r=this.uiState.read(n);if(!r)return[];const o=[];if(r.hiddenRange&&o.push({range:r.hiddenRange.toRange(r.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),r.range){const a=[];if(r.isSingleLine)a.push(r.range);else if(!r.isPureRemove){const c=r.range.endLineNumber-r.range.startLineNumber;for(let l=0;l{const r=this.uiState.read(n);return r&&!r.isPureRemove&&(r.isSingleLine||!r.range)?{lineNumber:r.lineNumber,additionalLines:r.additionalLines,minReservedLineCount:r.additionalReservedLineCount,targetTextModel:r.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(oet(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};Cye=D([_(2,Di)],Cye);var SUt=".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}";gt(SUt,{});var kQ;let Sye=class extends V{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=qn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).showToolbar==="always"),this.sessionPosition=void 0,this.position=et(this,n=>{const r=this.model.read(n)?.model.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!r||r.parts.length===0)return this.sessionPosition=void 0,null;const o=r.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==r.lineNumber&&(this.sessionPosition=void 0);const a=new re(r.lineNumber,Math.min(o,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(du((n,r)=>{if(!this.model.read(n)||!this.alwaysShowToolbar.read(n))return;const a=r.add(this.instantiationService.createInstance(Aye,this.editor,!0,this.position));e.addContentWidget(a),r.add(Ee(()=>e.removeContentWidget(a)))}))}};Sye=D([_(2,we)],Sye);var sk;let Aye=(sk=class extends V{static get dropDownVisible(){return this._dropDownVisible}constructor(e,t,i,n,r,o){super(),this.editor=e,this.withBorder=t,this._position=i,this._contextKeyService=r,this._menuService=o,this.id=`InlineEditHintsContentWidget${kQ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Wt("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[Wt("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(_e.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(n.createInstance(Eye,this.nodes.toolBar,this.editor,_e.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,c)=>{if(a instanceof Ac)return n.createInstance(AUt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{kQ._dropDownVisible=a})),this._register(ci(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(ci(a=>{const c=[];for(const[l,d]of this.inlineCompletionsActionsMenus.getActions())for(const h of d)h instanceof Ac&&c.push(h);c.length>0&&c.unshift(new Eo),this.toolBar.setAdditionalSecondaryActions(c)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[ts.ABOVE,ts.BELOW],positionAffinity:Ir.LeftOfInjectedText}}},kQ=sk,sk._dropDownVisible=!1,sk.id=0,sk);Aye=kQ=D([_(3,we),_(4,Le),_(5,Ba)],Aye);class AUt extends Pb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Wt("div.keybinding").root;this._register(new Zk(t,pr,{disableTitle:!0,...OJe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let Eye=class extends mW{constructor(e,t,i,n,r,o,a,c,l,d){super(e,{resetMenu:i,...n},r,o,a,c,l,d),this.editor=t,this.menuId=i,this.options2=n,this.menuService=r,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._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const e=[],t=[];vC(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){ns(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){ns(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};Eye=D([_(4,Ba),_(5,Le),_(6,lo),_(7,Vt),_(8,bi),_(9,Ji)],Eye);var EUt=".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}";gt(EUt,{});var EV,xye;function*xUt(s,e,t=1){e===void 0&&([e,s]=[s,0]);for(let i=s;ii.replace(new RegExp("^"+e),"")),shift:t}}var iR;let Dye=(iR=class extends V{static _createUniqueUri(){return N.from({scheme:"inline-edit-widget",path:new Date().toString()+String(EV._modelId++)})}constructor(e,t,i,n,r){super(),this._editor=e,this._model=t,this._instantiationService=i,this._diffProviderFactoryService=n,this._modelService=r,this._position=et(this,o=>{const a=this._model.read(o);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(xUt(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 re(u,h);return{top:a.range.startLineNumber,left:f}}),this._text=et(this,o=>{const a=this._model.read(o);if(!a)return{text:"",shift:0};const c=xue(a.text.split(` +`))),r.push(p),o+=l.endLineNumber-l.startLineNumber+1-h.length}t.pushUndoStop(),t.executeEdits(this.id,n,a?r:void 0),t.pushUndoStop()}}const yre=class yre extends it{constructor(){super({id:yre.ID,label:g(1489,"Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyX),weight:Ae.EditorContrib}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(d=>new re(d.positionLineNumber,d.positionColumn)));const r=t.getSelection();if(r===null)return;const o=e.get(Te),a=t.getModel(),c=o.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),l=new JOt(r,n,c);t.pushUndoStop(),t.executeCommands(this.id,[l]),t.pushUndoStop()}};yre.ID="editor.action.trimTrailingWhitespace";let wye=yre;class THt extends it{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 r=0;const o=[],a=[];for(let c=0,l=i.length;c1&&(h-=1,f=n.getLineMaxColumn(h)),o.push(es.replace(new ht(h,f,u,p),"")),a.push(new ht(h-r,d.positionColumn,h-r,d.positionColumn)),r+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,o,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(r=>{let o=r.endLineNumber;return r.startLineNumberr.startLineNumber===o.startLineNumber?r.endLineNumber-o.endLineNumber:r.startLineNumber-o.startLineNumber);const i=[];let n=t[0];for(let r=1;r=t[r].startLineNumber?n.endLineNumber=t[r].endLineNumber:(i.push(n),n=t[r]);return i.push(n),i}}class LHt extends it{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,nx.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class RHt extends it{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){VO.Outdent.runEditorCommand(e,t,null)}}class MHt extends it{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,bae.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class NHt extends it{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,bae.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class tit extends it{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),r=[];for(let c=0,l=n.length-1;ces.replace(c,""));t.pushUndoStop(),t.executeEdits(this.id,a,o),t.pushUndoStop()}}class PHt extends tit{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 r=0;return t.forEach(o=>{let a;if(o.endColumn===1&&r>0){const c=o.startLineNumber-r;a=new ht(c,o.startColumn,c,o.startColumn)}else a=new ht(o.startLineNumber,o.startColumn,o.startLineNumber,o.startColumn);r+=o.endLineNumber-o.startLineNumber,o.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(r=>{if(r.isEmpty())if(r.startColumn===1){const o=Math.max(1,r.startLineNumber-1),a=r.startLineNumber===1?1:n.getLineLength(o)+1;return new F(o,a,r.startLineNumber,1)}else return new F(r.startLineNumber,1,r.startLineNumber,r.startColumn);else return new F(r.startLineNumber,1,r.endLineNumber,r.endColumn)}),i)}}class FHt extends tit{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 r=0,o=t.length,a=0;r{if(r.isEmpty()){const o=t.getLineMaxColumn(r.startLineNumber);return r.startColumn===o?new F(r.startLineNumber,r.startColumn,r.startLineNumber+1,1):new F(r.startLineNumber,r.startColumn,r.startLineNumber,o)}return r});return n.sort(F.compareRangesUsingStarts),n}}class OHt extends it{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 r=[],o=i.reduce((u,f)=>u.isEmpty()?u.endLineNumber===f.startLineNumber?(n.equalsSelection(u)&&(n=f),f):f.startLineNumber>u.endLineNumber+1?(r.push(u),f):new ht(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(r.push(u),f):new ht(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));r.push(o);const a=t.getModel();if(a===null)return;const c=[],l=[];let d=n,h=0;for(let u=0,f=r.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(es.replace(L,A)),k=new ht(L.startLineNumber-h,A.length-b+1,m-h,A.length-b+1)):p.startLineNumber===p.endLineNumber?(c.push(es.replace(L,A)),k=new ht(p.startLineNumber-h,p.startColumn,p.endLineNumber-h,p.endColumn)):(c.push(es.replace(L,A)),k=new ht(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 BHt extends it{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 r=[];for(let o=0,a=i.length;o=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("");r.push(new nd(new ht(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("");r.push(new fLe(h,u,new ht(l.lineNumber,l.column+1,l.lineNumber,l.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class ZN extends it{run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const r=t.getOption(x.wordSeparators),o=[];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);o.push(es.replace(d,this._modifyText(h,r)))}else{const c=n.getValueInRange(a);o.push(es.replace(a,this._modifyText(c,r)))}t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop()}}class WHt extends ZN{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 HHt extends ZN{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 fA{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 Cre=class Cre extends ZN{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=Cre.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,n=>n.toLocaleUpperCase()):e}};Cre.titleBoundary=new fA("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let cZ=Cre;const dO=class dO extends ZN{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=dO.caseBoundary.get(),n=dO.singleLetters.get();return!i||!n?e:e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase()}};dO.caseBoundary=new fA("(\\p{Ll})(\\p{Lu})","gmu"),dO.singleLetters=new fA("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let J5=dO;const Sre=class Sre extends ZN{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=Sre.wordBoundary.get();if(!i)return e;const n=e.split(i);return n.shift()+n.map(o=>o.substring(0,1).toLocaleUpperCase()+o.substring(1)).join("")}};Sre.wordBoundary=new fA("[_\\s-]","gm");let lZ=Sre;const hO=class hO extends ZN{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=hO.wordBoundary.get(),n=hO.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("")}};hO.wordBoundary=new fA("[_\\s-]","gm"),hO.wordBoundaryToMaintain=new fA("(?<=\\.)","gm");let dZ=hO;const ZE=class ZE extends ZN{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=ZE.caseBoundary.get(),n=ZE.singleLetters.get(),r=ZE.underscoreBoundary.get();return!i||!n||!r?e:e.replace(r,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase()}};ZE.caseBoundary=new fA("(\\p{Ll})(\\p{Lu})","gmu"),ZE.singleLetters=new fA("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),ZE.underscoreBoundary=new fA("(\\S)(_)(\\S)","gm");let hZ=ZE;Re(CHt);Re(SHt);Re(AHt);Re(EHt);Re(xHt);Re(DHt);Re(kHt);Re(IHt);Re(wye);Re(THt);Re(LHt);Re(RHt);Re(MHt);Re(NHt);Re(PHt);Re(FHt);Re(OHt);Re(BHt);Re(WHt);Re(HHt);J5.caseBoundary.isSupported()&&J5.singleLetters.isSupported()&&Re(J5);lZ.wordBoundary.isSupported()&&Re(lZ);dZ.wordBoundary.isSupported()&&Re(dZ);cZ.titleBoundary.isSupported()&&Re(cZ);hZ.isSupported()&&Re(hZ);var UHt=".monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}";gt(UHt,{});var DQ;const iit=new Q("LinkedEditingInputVisible",!1),VHt="linked-editing-decoration";var nk;let BW=(nk=class extends V{static get(e){return e.getContribution(DQ.ID)}constructor(e,t,i,n,r){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=iit.bindTo(t),this._debounceInformation=r.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(o=>{(o.hasChanged(x.linkedEditing)||o.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 Ph(this._debounceInformation.get(t)),r=()=>{this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},o=new Ph(0),a=c=>{this._rangeSyncTriggerPromise=o.trigger(()=>this._syncRanges(c))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{r()})),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}}r()})),this._localToDispose.add({dispose:()=>{n.dispose(),o.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 o=n.match(this._currentWordPattern);if((o?o[0].length:0)!==n.length)return this.clearRanges()}const r=[];for(let o=1,a=this._currentDecorations.length;o1){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 o=this._currentDecorations.getRange(0);if(o&&o.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=n;const r=this._currentRequestCts=new li;try{const o=new Ys(!1),a=await nit(this._providers,i,t,r.token);if(this._debounceInformation.update(i,o.elapsed()),r!==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:DQ.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(o){Oo(o)||bt(o),(this._currentRequestCts===r||!this._currentRequestCts)&&this.clearRanges()}}setDebounceDuration(e){this._debounceDuration=e}},DQ=nk,nk.ID="editor.contrib.linkedEditing",nk.DECORATION=Kt.register({description:"linked-editing",stickiness:si.AlwaysGrowsWhenTypingAtEdges,className:VHt}),nk);BW=DQ=D([_(1,Le),_(2,nt),_(3,zs),_(4,xp)],BW);class zHt extends it{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(qt),[n,r]=Array.isArray(t)&&t||[void 0,void 0];return N.isUri(n)&&re.isIPosition(r)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(r),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},bt):super.runCommand(e,t)}run(e,t){const i=BW.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const $Ht=uc.bindToContribution(BW.get);Qe(new $Ht({id:"cancelLinkedEditingInput",precondition:iit,handler:s=>s.clearRanges(),kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib+99,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));function nit(s,e,t,i){const n=s.ordered(e);return eae(n.map(r=>async()=>{try{return await r.provideLinkedEditingRanges(e,t,i)}catch(o){Nr(o);return}}),r=>!!r&&tr(r?.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."));lg("_executeLinkedEditingProvider",(s,e,t)=>{const{linkedEditingRangeProvider:i}=s.get(nt);return nit(i,e,t,Ue.None)});on(BW.ID,BW,ai.AfterFirstRender);Re(zHt);const Are=class Are extends V{static get(e){return e.getContribution(Are.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})}))}};Are.ID="editor.contrib.longLinesHelper";let uZ=Are;on(uZ.ID,uZ,ai.BeforeFirstInteraction);var GHt=".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}";gt(GHt,{});const KHt=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",KHt,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 qHt=W("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Xs,hcLight:Xs},g(5186,"Border color of a symbol during read-access, like reading a variable."));W("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Xs,hcLight:Xs},g(5187,"Border color of a symbol during write-access, like writing to a variable."));W("editor.wordHighlightTextBorder",qHt,g(5188,"Border color of a textual occurrence for a symbol."));const QHt=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),jHt=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),YHt=W("editorOverviewRuler.wordHighlightTextForeground",SQe,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),JHt=Kt.register({description:"word-highlight-strong",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"wordHighlightStrong",overviewRuler:{color:$r(jHt),position:Tl.Center},minimap:{color:$r(hae),position:Rh.Inline}}),XHt=Kt.register({description:"word-highlight-text",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"wordHighlightText",overviewRuler:{color:$r(YHt),position:Tl.Center},minimap:{color:$r(hae),position:Rh.Inline}}),ZHt=Kt.register({description:"selection-highlight-overview",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight",overviewRuler:{color:$r(SQe),position:Tl.Center},minimap:{color:$r(hae),position:Rh.Inline}}),eUt=Kt.register({description:"selection-highlight",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight"}),tUt=Kt.register({description:"word-highlight",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"wordHighlight",overviewRuler:{color:$r(QHt),position:Tl.Center},minimap:{color:$r(hae),position:Rh.Inline}});function iUt(s){return s===k8.Write?JHt:s===k8.Text?XHt:tUt}function nUt(s){return s?eUt:ZHt}Ep((s,e)=>{const t=s.getColor(nLe);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var yye;function PI(s,e){const t=e.filter(i=>!s.find(n=>n.equals(i)));if(t.length>=1){const i=t.map(r=>`line ${r.viewState.position.lineNumber} column ${r.viewState.position.column}`).join(", "),n=t.length===1?g(1518,"Cursor added: {0}",i):g(1519,"Cursors added: {0}",i);xh(n)}}class sUt extends it{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 r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const o=r.getCursorStates();r.setCursorStates(i.source,Bi.Explicit,yl.addCursorUp(r,o,n)),r.revealTopMostCursor(i.source),PI(o,r.getCursorStates())}}class rUt extends it{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 r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const o=r.getCursorStates();r.setCursorStates(i.source,Bi.Explicit,yl.addCursorDown(r,o,n)),r.revealBottomMostCursor(i.source),PI(o,r.getCursorStates())}}class oUt extends it{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 ht(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),r=t._getViewModel(),o=r.getCursorStates(),a=[];n.forEach(c=>this.getCursorsForSelection(c,i,a)),a.length>0&&t.setSelections(a),PI(o,r.getCursorStates())}}class aUt extends it{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(),r=[];for(let c=i[0].startLineNumber;c<=n;c++)r.push(new ht(c,i[0].startColumn,c,i[0].endColumn));const o=t._getViewModel(),a=o.getCursorStates();r.length>0&&t.setSelections(r),PI(a,o.getCursorStates())}}class cUt extends it{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 ht(a,i[0].startColumn,a,i[0].endColumn));const r=t._getViewModel(),o=r.getCursorStates();n.length>0&&t.setSelections(n),PI(o,r.getCursorStates())}}class HK{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class f9{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new f9(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n=!1,r,o;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(n=!0,r=!0,o=!0):(r=i.wholeWord,o=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 ht(c.startLineNumber,h.startColumn,c.startLineNumber,h.endColumn)}else l=e.getModel().getValueInRange(c).replace(/\r\n/g,` +`);return new f9(e,t,n,l,r,o,d)}constructor(e,t,i,n,r,o,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=r,this.matchCase=o,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 HK(t.concat(e),e,_t.Smooth)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new HK(t.slice(0,t.length-1).concat(e),e,_t.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 ht(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 HK(t.concat(e),e,_t.Smooth)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new HK(t.slice(0,t.length-1).concat(e),e,_t.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 ht(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,Vn.MAX_SAFE_SMALL_INTEGER):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Vn.MAX_SAFE_SMALL_INTEGER)}}const Ere=class Ere extends V{static get(e){return e.getContribution(Ere.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=f9.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=bh.True,i.matchCaseOverride=bh.True,i.isRegexOverride=bh.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:bh.NotSet,matchCaseOverride:bh.NotSet,isRegexOverride:bh.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 ht(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(!sit(this._editor.getModel(),t,n)){const o=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,Vn.MAX_SAFE_SMALL_INTEGER):t=n.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Vn.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 r=0,o=t.length;rnew ht(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn)))}}selectAllUsingSelections(e){e.length>0&&this._setSelections(e)}};Ere.ID="editor.contrib.multiCursorController";let WW=Ere;class e4 extends it{run(e,t){const i=WW.get(t);if(!i)return;const n=t._getViewModel();if(n){const r=n.getCursorStates(),o=cg.get(t);if(o)this._run(i,o);else{const a=e.get(we).createInstance(cg,t);this._run(i,a),a.dispose()}PI(r,n.getCursorStates())}}}class lUt extends e4{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 dUt extends e4{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 hUt extends e4{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:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyD),weight:Ae.EditorContrib}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class uUt extends e4{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 gUt extends e4{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 fUt extends e4{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 pUt{constructor(e,t,i,n,r){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,r&&this._model===r._model&&this._searchText===r._searchText&&this._matchCase===r._matchCase&&this._wordSeparators===r._wordSeparators&&this._modelVersionId===r._modelVersionId&&(this._cachedFindMatches=r._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 tR;let gZ=(tR=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 ln(()=>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===Bi.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=cg.get(e);i&&this._register(i.getState().onFindReplaceStateChange(n=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(yye._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 r=WW.get(i);if(!r)return null;const o=cg.get(i);if(!o)return null;let a=r.getSession(o);if(!a){const d=i.getSelections();if(d.length>1){const u=o.getState().matchCase;if(!sit(i.getModel(),d,u))return null}a=f9.create(i,o)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const c=o.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 pUt(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 r=[];for(let l=0,d=0,h=i.length,u=n.length;l=u)r.push(f),l++;else{const p=F.compareRangesUsingStarts(f,n[d]);p<0?((n[d].isEmpty()||!F.areIntersecting(f,n[d]))&&r.push(f),l++):(p>0||l++,d++)}}const o=this.editor.getOption(x.occurrencesHighlight)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&o,c=r.map(l=>({range:l,options:nUt(a)}));this._decorations.set(c)}dispose(){this._setState(null),super.dispose()}},yye=tR,tR.ID="editor.contrib.selectionHighlighter",tR);gZ=yye=D([_(1,nt)],gZ);function sit(s,e,t){const i=E4e(s,e[0],!t);for(let n=1,r=e.length;nthis.editor.getModel()),this.uiState=et(this,n=>{if(this.isDisposed.read(n))return;const r=this.currentTextModel.read(n);if(r!==this.model.targetTextModel.read(n))return;const o=this.model.ghostText.read(n);if(!o)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)&&o.parts.length===1&&o.parts[0].lines.length===1,l=o.parts.length===1&&o.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 iu(C.content.length+1,C.content.length+1+w[0].length,y,Xa.Regular)),C.content+=w[0],w=w.slice(1)}for(const C of w)h.push({content:C,decorations:y?[new iu(1,C.length+1,y,Xa.Regular)]:[]})}const f=r.getLineContent(o.lineNumber);let p,m=0;if(!l&&(c||!a)){for(const w of o.parts){let y=w.lines;a&&!c&&(u(y,Eue),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,Eue),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 ret(p,f.length+1):void 0,b=c||!a?o.lineNumber:a.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:v,lineNumber:b,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:r,range:a,isSingleLine:c,isPureRemove:l}}),this.decorations=et(this,n=>{const r=this.uiState.read(n);if(!r)return[];const o=[];if(r.hiddenRange&&o.push({range:r.hiddenRange.toRange(r.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),r.range){const a=[];if(r.isSingleLine)a.push(r.range);else if(!r.isPureRemove){const c=r.range.endLineNumber-r.range.startLineNumber;for(let l=0;l{const r=this.uiState.read(n);return r&&!r.isPureRemove&&(r.isSingleLine||!r.range)?{lineNumber:r.lineNumber,additionalLines:r.additionalLines,minReservedLineCount:r.additionalReservedLineCount,targetTextModel:r.targetTextModel}:void 0}))),this._register(Ee(()=>{this.isDisposed.set(!0,void 0)})),this._register(oet(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};Cye=D([_(2,Di)],Cye);var SUt=".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}";gt(SUt,{});var kQ;let Sye=class extends V{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=qn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).showToolbar==="always"),this.sessionPosition=void 0,this.position=et(this,n=>{const r=this.model.read(n)?.model.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!r||r.parts.length===0)return this.sessionPosition=void 0,null;const o=r.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==r.lineNumber&&(this.sessionPosition=void 0);const a=new re(r.lineNumber,Math.min(o,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(du((n,r)=>{if(!this.model.read(n)||!this.alwaysShowToolbar.read(n))return;const a=r.add(this.instantiationService.createInstance(Aye,this.editor,!0,this.position));e.addContentWidget(a),r.add(Ee(()=>e.removeContentWidget(a)))}))}};Sye=D([_(2,we)],Sye);var sk;let Aye=(sk=class extends V{static get dropDownVisible(){return this._dropDownVisible}constructor(e,t,i,n,r,o){super(),this.editor=e,this.withBorder=t,this._position=i,this._contextKeyService=r,this._menuService=o,this.id=`InlineEditHintsContentWidget${kQ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Wt("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[Wt("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(_e.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(n.createInstance(Eye,this.nodes.toolBar,this.editor,_e.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,c)=>{if(a instanceof Ac)return n.createInstance(AUt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{kQ._dropDownVisible=a})),this._register(ci(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(ci(a=>{const c=[];for(const[l,d]of this.inlineCompletionsActionsMenus.getActions())for(const h of d)h instanceof Ac&&c.push(h);c.length>0&&c.unshift(new Eo),this.toolBar.setAdditionalSecondaryActions(c)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[ts.ABOVE,ts.BELOW],positionAffinity:Ir.LeftOfInjectedText}}},kQ=sk,sk._dropDownVisible=!1,sk.id=0,sk);Aye=kQ=D([_(3,we),_(4,Le),_(5,Wa)],Aye);class AUt extends Pb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Wt("div.keybinding").root;this._register(new Zk(t,pr,{disableTitle:!0,...OJe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let Eye=class extends mW{constructor(e,t,i,n,r,o,a,c,l,d){super(e,{resetMenu:i,...n},r,o,a,c,l,d),this.editor=t,this.menuId=i,this.options2=n,this.menuService=r,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._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const e=[],t=[];vC(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){ns(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){ns(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};Eye=D([_(4,Wa),_(5,Le),_(6,lo),_(7,Vt),_(8,bi),_(9,Ji)],Eye);var EUt=".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}";gt(EUt,{});var EV,xye;function*xUt(s,e,t=1){e===void 0&&([e,s]=[s,0]);for(let i=s;ii.replace(new RegExp("^"+e),"")),shift:t}}var iR;let Dye=(iR=class extends V{static _createUniqueUri(){return N.from({scheme:"inline-edit-widget",path:new Date().toString()+String(EV._modelId++)})}constructor(e,t,i,n,r){super(),this._editor=e,this._model=t,this._instantiationService=i,this._diffProviderFactoryService=n,this._modelService=r,this._position=et(this,o=>{const a=this._model.read(o);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(xUt(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 re(u,h);return{top:a.range.startLineNumber,left:f}}),this._text=et(this,o=>{const a=this._model.read(o);if(!a)return{text:"",shift:0};const c=xue(a.text.split(` `));return{text:c.text.join(` `),shift:c.shift}}),this._originalModel=vh(()=>this._modelService.createModel("",null,EV._createUniqueUri())).keepObserved(this._store),this._modifiedModel=vh(()=>this._modelService.createModel("",null,EV._createUniqueUri())).keepObserved(this._store),this._diff=et(this,o=>this._diffPromise.read(o)?.promiseResult.read(o)?.data),this._diffPromise=et(this,o=>{const a=this._model.read(o);if(!a)return;const c=this._editor.getModel();if(!c)return;const l=xue(c.getValueInRange(a.range).split(` `)).text.join(` @@ -789,11 +789,11 @@ This action is irreversible and may result in data loss!`,c.map(h=>h.label).join `)&&(t=e.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[es.replace(F.lift(e.range),t)]),e.accepted&&await this._commandService.executeCommand(e.accepted.id,...e.accepted.arguments||[]).then(void 0,Nr),this.freeEdit(e),is(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=re.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,Nr),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,r=i.model;if(F.containsPosition(n.range,e.getStartPosition())||F.containsPosition(n.range,e.getEndPosition()))return!0;const a=r.ghostText.get();return a?a.parts.some(c=>e.containsPosition(new re(a.lineNumber,c.column))):!1}shouldShowHoverAtViewZone(e){return this._currentWidget.get()?.ownsViewZone(e)??!1}},xV=$p,$p.ID="editor.contrib.inlineEditController",$p.inlineEditVisibleKey="inlineEditVisible",$p.inlineEditVisibleContext=new Q($p.inlineEditVisibleKey,!1),$p.cursorAtInlineEditKey="cursorAtInlineEdit",$p.cursorAtInlineEditContext=new Q($p.cursorAtInlineEditKey,!1),$p);su=xV=D([_(1,we),_(2,Le),_(3,nt),_(4,bi),_(5,Te),_(6,B6),_(7,fi)],su);function DUt(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 kUt=class extends it{constructor(){super({id:vUt,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:he.and(J.writable,su.inlineEditVisibleContext),kbOpts:[{weight:Ae.EditorContrib+1,primary:S.Tab,kbExpr:he.and(J.writable,su.inlineEditVisibleContext,su.cursorAtInlineEditContext)}],menuOpts:[{menuId:_e.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){await su.get(t)?.accept()}};class IUt extends it{constructor(){const e=he.and(J.writable,he.not(su.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){su.get(t)?.trigger()}}class TUt extends it{constructor(){const e=he.and(J.writable,su.inlineEditVisibleContext,he.not(su.cursorAtInlineEditKey));super({id:wUt,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){su.get(t)?.jumpToCurrent()}}class LUt extends it{constructor(){const e=he.and(J.writable,su.cursorAtInlineEditContext);super({id:yUt,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){su.get(t)?.jumpBack()}}class RUt extends it{constructor(){const e=he.and(J.writable,su.inlineEditVisibleContext);super({id:bUt,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 su.get(t)?.clear()}}Re(kUt);Re(RUt);Re(TUt);Re(LUt);Re(IUt);on(su.ID,su,ai.Eventually);const MUt="editor.action.inlineEdits.accept",NUt="editor.action.inlineEdits.showPrevious",PUt="editor.action.inlineEdits.showNext",HW=new Q("inlineEditsVisible",!1,g(9879,"Whether an inline edit is visible")),FUt=new Q("inlineEditsIsPinned",!1,g(9880,"Whether an inline edit is visible"));var OUt=".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)}}}";gt(OUt,{});const xre=class xre extends V{static get(e){return e.getContribution(xre.ID)}constructor(e){super(),this._editor=e,this._editorObs=eu(this._editor),this._placeholderText=this._editorObs.getOption(x.placeholder),this._state=Zh({owner:this,equalsFn:cJ},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:i}}),this._shouldViewBeAlive=BUt(this,t=>this._state.read(t)?.placeholder!==void 0),this._view=TI((t,i)=>{if(!this._shouldViewBeAlive.read(t))return;const n=Wt("div.editorPlaceholder");i.add(ci(r=>{const o=this._state.read(r),a=o?.placeholder!==void 0;n.root.style.display=a?"block":"none",n.root.innerText=o?.placeholder??""})),i.add(ci(r=>{const o=this._editorObs.layoutInfo.read(r);n.root.style.left=`${o.contentLeft}px`,n.root.style.width=o.contentWidth-o.verticalScrollbarWidth+"px",n.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),i.add(ci(r=>{n.root.style.fontFamily=this._editorObs.getOption(x.fontFamily).read(r),n.root.style.fontSize=this._editorObs.getOption(x.fontSize).read(r)+"px",n.root.style.lineHeight=this._editorObs.getOption(x.lineHeight).read(r)+"px"})),i.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:rd(0),position:rd(null),domNode:n.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};xre.ID="editor.contrib.placeholderText";let p9=xre;function BUt(s,e){return L6(s,(t,i)=>i===!0?!0:e(t))}let WUt=class{constructor(e,t,i){this.range=e,this.newLines=t,this.changes=i}},Iye=class extends V{constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._userPrompt=i,this._instantiationService=n,this._editorObs=eu(this._editor),this._elements=Wt("div.inline-edits-widget",{style:{position:"absolute",overflow:"visible",top:"0px",left:"0px"}},[Wt("div@editorContainer",{style:{position:"absolute",top:"0px",left:"0px",width:"500px",height:"500px"}},[Wt("div.toolbar@toolbar",{style:{position:"absolute",top:"-25px",left:"0px"}}),Wt("div.promptEditor@promptEditor",{style:{position:"absolute",top:"-25px",left:"80px",width:"300px",height:"22px"}}),Wt("div.preview@editor",{style:{position:"absolute",top:"0px",left:"0px"}})]),aP("svg",{style:{overflow:"visible",pointerEvents:"none"}},[aP("defs",[aP("linearGradient",{id:"Gradient2",x1:"0",y1:"0",x2:"1",y2:"0"},[aP("stop",{offset:"0%",class:"gradient-stop"}),aP("stop",{offset:"100%",class:"gradient-stop"})])]),aP("path@path",{d:"",fill:"url(#Gradient2)"})])]),this._toolbar=this._register(this._instantiationService.createInstance(Cm,this._elements.toolbar,_e.InlineEditsActions,{toolbarOptions:{primaryGroup:o=>o.startsWith("primary")}})),this._previewTextModel=this._register(this._instantiationService.createInstance(E_,"",Sa,E_.DEFAULT_CREATION_OPTIONS,null)),this._setText=et(o=>{const a=this._edit.read(o);a&&this._previewTextModel.setValue(a.newLines.join(` `))}).recomputeInitiallyAndOnChange(this._store),this._promptTextModel=this._register(this._instantiationService.createInstance(E_,"",Sa,E_.DEFAULT_CREATION_OPTIONS,null)),this._promptEditor=this._register(this._instantiationService.createInstance(uf,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:ELe},{contributions:dp.getSomeEditorContributions([tf.ID,p9.ID,Hb.ID]),isSimpleWidget:!0},this._editor)),this._previewEditor=this._register(this._instantiationService.createInstance(uf,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=eu(this._previewEditor),this._decorations=et(this,o=>{this._setText.read(o);const a=this._edit.read(o)?.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:W3}),d.modified.isEmpty||l.push({range:d.modified.toInclusiveRange(),options:OJ}),d.modified.isEmpty||d.original.isEmpty)d.original.isEmpty||c.push({range:d.original.toInclusiveRange(),options:JRe}),d.modified.isEmpty||l.push({range:d.modified.toInclusiveRange(),options:jRe});else for(const h of d.innerChanges||[])d.original.contains(h.originalRange.startLineNumber)&&c.push({range:h.originalRange,options:h.originalRange.isEmpty()?XRe:pW}),d.modified.contains(h.modifiedRange.startLineNumber)&&l.push({range:h.modifiedRange,options:h.modifiedRange.isEmpty()?YRe:BJ});return l}),this._layout1=et(this,o=>{const a=this._editor.getModel(),c=this._edit.read(o);if(!c)return null;const l=c.range;let d=0;for(let f=l.startLineNumber;f{const a=this._edit.read(o);if(!a)return null;const c=a.range,l=this._editorObs.scrollLeft.read(o),d=this._layout1.read(o).left+20-l,h=this._editor.getTopForLineNumber(c.startLineNumber)-this._editorObs.scrollTop.read(o),u=this._editor.getTopForLineNumber(c.endLineNumberExclusive)-this._editorObs.scrollTop.read(o),f=new V1(d,h),p=new V1(d,u),m=u-h,v=50,b=this._editor.getOption(x.lineHeight)*a.newLines.length,w=m-b,y=new V1(d+v,h+w/2),C=new V1(d+v,u-w/2);return{topCode:f,bottomCode:p,codeHeight:m,topEdit:y,bottomEdit:C,editHeight:b}});const r=et(this,o=>this._edit.read(o)!==void 0||this._userPrompt.read(o)!==void 0);this._register(NA(this._elements.root,{display:et(this,o=>r.read(o)?"block":"none")})),this._register(bF(this._editor.getDomNode(),this._elements.root)),this._register(eu(e).createOverlayWidget({domNode:this._elements.root,position:rd(null),allowEditorOverflow:!1,minContentWidthInPx:et(o=>{const a=this._layout1.read(o)?.left;if(a===void 0)return 0;const c=this._previewEditorObs.contentWidth.read(o);return a+c})})),this._previewEditor.setModel(this._previewTextModel),this._register(this._previewEditorObs.setDecorations(this._decorations)),this._register(ci(o=>{const a=this._layout.read(o);if(!a)return;const{topCode:c,bottomCode:l,topEdit:d,bottomEdit:h,editHeight:u}=a,f=10,p=0,m=40,v=new UUt().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(o);this._previewEditor.layout({height:u,width:b})})),this._promptEditor.setModel(this._promptTextModel),this._promptEditor.layout(),this._register(VUt(HUt(this._userPrompt,o=>o??"",o=>o),eu(this._promptEditor).value)),this._register(ci(o=>{const a=eu(this._promptEditor).isFocused.read(o);this._elements.root.classList.toggle("focused",a)}))}};Iye=D([_(3,we)],Iye);function HUt(s,e,t){return I6(void 0,i=>e(s.read(i)),(i,n)=>s.set(t(i),n))}class V1{constructor(e,t){this.x=e,this.y=t}add(e){return new V1(this.x+e.x,this.y+e.y)}deltaX(e){return new V1(this.x+e,this.y)}}class UUt{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 VUt(s,e){const t=new Z;return t.add(ci(i=>{const n=s.read(i);e.set(n,void 0)})),t.add(ci(i=>{const n=e.read(i);s.set(n,void 0)})),t}var DV,nR;let Tye=(nR=class extends V{static _createUniqueUri(){return N.from({scheme:"inline-edits",path:new Date().toString()+String(DV._modelId++)})}constructor(e,t,i,n,r,o,a){super(),this.textModel=e,this._textModelVersionId=t,this._selection=i,this._debounceValue=n,this.languageFeaturesService=r,this._diffProviderFactoryService=o,this._modelService=a,this._forceUpdateExplicitlySignal=_C(this),this._selectedInlineCompletionId=Yt(this,void 0),this._isActive=Yt(this,!1),this._originalModel=vh(()=>this._modelService.createModel("",null,DV._createUniqueUri())).keepObserved(this._store),this._modifiedModel=vh(()=>this._modelService.createModel("",null,DV._createUniqueUri())).keepObserved(this._store),this._pinnedRange=new $Ut(this.textModel,this._textModelVersionId),this.isPinned=this._pinnedRange.range.map(c=>!!c),this.userPrompt=Yt(this,void 0),this.inlineEdit=et(this,c=>this._inlineEdit.read(c)?.promiseResult.read(c)?.data),this._inlineEdit=et(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 O6.fromFn(async()=>{const v=await m.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},Ue.None);if(!v.identical)return new WUt(mi.fromRangeInclusive(d),u(h),v.changes)})}),this._fetchStore=this._register(new Z),this._inlineEditsFetchResult=C3(this,void 0),this._inlineEdits=Zh({owner:this,equalsFn:cJ},c=>this._inlineEditsFetchResult.read(c)?.completions.map(l=>new zUt(l))??[]),this._fetchInlineEditsPromise=jYe({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:nm.Automatic}),handleChange:(c,l)=>(c.didChange(this._forceUpdateExplicitlySignal)&&(l.inlineCompletionTriggerKind=nm.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=bfe(this._fetchStore);await Ao(200,f);const p=await det(this.languageFeaturesService.inlineCompletionsProvider,h,this.textModel,u,f);f.isCancellationRequested||this._inlineEditsFetchResult.set(p,void 0)}),this._filteredInlineEditItems=Zh({owner:this,equalsFn:sW()},c=>this._inlineEdits.read(c)),this.selectedInlineCompletionIndex=et(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=et(this,c=>{const l=this._filteredInlineEditItems.read(c),d=this.selectedInlineCompletionIndex.read(c);return l[d]}),this.activeCommands=Zh({owner:this,equalsFn:sW()},c=>this.selectedInlineEdit.read(c)?.inlineCompletion.source.inlineCompletions.commands??[]),this._register(VN(this._fetchInlineEditsPromise))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineEditsPromise.get()}async triggerExplicitly(e){IM(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){IM(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 Pi;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}},DV=nR,nR._modelId=0,nR);Tye=DV=D([_(4,nt),_(5,B6),_(6,fi)],Tye);class zUt{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class $Ut extends V{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=Yt(this,[]),this.range=et(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 Lye,sR;let $A=(sR=class extends V{static get(e){return e.getContribution(Lye.ID)}constructor(e,t,i,n,r,o){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._debounceService=n,this._languageFeaturesService=r,this._configurationService=o,this._enabled=QRe("editor.inlineEdits.enabled",!1,this._configurationService),this._editorObs=eu(this.editor),this._selection=et(this,a=>this._editorObs.cursorSelection.read(a)??new ht(1,1,1,1)),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineEditsDebounce",{min:50,max:50}),this.model=vh(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(Wg(Tye,a),c,this._editorObs.versionId,this._selection,this._debounceValue):void 0}),this._hadInlineEdit=L6(this,(a,c)=>c||this.model.read(a)?.inlineEdit.read(a)!==void 0),this._widget=vh(this,a=>{if(this._hadInlineEdit.read(a))return this._instantiationService.createInstance(Wg(Iye,a),this.editor,this.model.map((c,l)=>c?.inlineEdit.read(l)),GUt(c=>this.model.read(c)?.userPrompt??Yt("empty","")))}),this._register(Rv(HW,this._contextKeyService,a=>!!this.model.read(a)?.inlineEdit.read(a))),this._register(Rv(FUt,this._contextKeyService,a=>!!this.model.read(a)?.isPinned.read(a))),this.model.recomputeInitiallyAndOnChange(this._store),this._widget.recomputeInitiallyAndOnChange(this._store)}},Lye=sR,sR.ID="editor.contrib.inlineEditsController",sR);$A=Lye=D([_(1,we),_(2,Le),_(3,xp),_(4,nt),_(5,Te)],$A);function GUt(s){return I6(void 0,e=>s(e).read(e),(e,t)=>{s(void 0).set(e,t)})}function pG(s){return{label:s.value,alias:s.original}}const Dre=class Dre extends it{constructor(){super({id:Dre.ID,...pG(Pe(5192,"Show Next Inline Edit")),precondition:he.and(J.writable,HW),kbOpts:{weight:100,primary:U.Alt|S.BracketRight}})}async run(e,t){$A.get(t)?.model.get()?.next()}};Dre.ID=PUt;let Rye=Dre;const kre=class kre extends it{constructor(){super({id:kre.ID,...pG(Pe(5193,"Show Previous Inline Edit")),precondition:he.and(J.writable,HW),kbOpts:{weight:100,primary:U.Alt|S.BracketLeft}})}async run(e,t){$A.get(t)?.model.get()?.previous()}};kre.ID=NUt;let Mye=kre;class KUt extends it{constructor(){super({id:"editor.action.inlineEdits.trigger",...pG(Pe(5194,"Trigger Inline Edit")),precondition:J.writable})}async run(e,t){const i=$A.get(t);await QYe(async n=>{await i?.model.get()?.triggerExplicitly(n)})}}class qUt extends it{constructor(){super({id:MUt,...pG(Pe(5195,"Accept Inline Edit")),precondition:HW,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:HW}})}async run(e,t){t instanceof uf&&(t=t.getParentEditor());const i=$A.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const Ire=class Ire extends it{constructor(){super({id:Ire.ID,...pG(Pe(5197,"Hide Inline Edit")),precondition:HW,kbOpts:{weight:100,primary:S.Escape}})}async run(e,t){const i=$A.get(t);is(n=>{i?.model.get()?.stop(n)})}};Ire.ID="editor.action.inlineEdits.hide";let Nye=Ire;on($A.ID,$A,ai.Eventually);Re(KUt);Re(Rye);Re(Mye);Re(qUt);Re(Nye);const eN={Visible:new Q("parameterHintsVisible",!1),MultipleSignatures:new Q("parameterHintsMultipleSignatures",!1)};async function rit(s,e,t,i,n){const r=s.ordered(e);for(const o of r)try{const a=await o.provideSignatureHelp(e,t,n,i);if(a)return a}catch(a){Nr(a)}}vt.registerCommand("_executeSignatureHelpProvider",async(s,...e)=>{const[t,i,n]=e;Lt(N.isUri(t)),Lt(re.isIPosition(i)),Lt(typeof n=="string"||!n);const r=s.get(nt),o=await s.get(pn).createModelReference(t);try{const a=await rit(r.signatureHelpProvider,o.object.textEditorModel,re.lift(i),{triggerKind:Ly.Invoke,isRetrigger:!1,triggerCharacter:n},Ue.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{o.dispose()}});var lh;(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(r,o){this.request=r,this.previouslyActiveHints=o,this.type=e.Pending}}s.Pending=t;class i{constructor(r){this.hints=r,this.type=e.Active}}s.Active=i})(lh||(lh={}));const Tre=class Tre extends V{constructor(e,t,i=Tre.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new I),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=lh.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new yn),this.triggerChars=new cY,this.retriggerChars=new cY,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Ph(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===lh.Type.Pending&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=lh.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(bt)}next(){if(this.state.type!==lh.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!==lh.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===lh.Type.Active&&(this.state=new lh.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===lh.Type.Active||this.state.type===lh.Type.Pending,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const n=this._pendingTriggers.reduce(QUt);this._pendingTriggers=[];const r={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const o=this.editor.getModel(),a=this.editor.getPosition();this.state=new lh.Pending(Mo(c=>rit(this.providers,o,a,r,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 lh.Active(c.value),this._lastSignatureHelpResult.value=c,this._onChangedHints.fire(this.state.hints),!0)}catch(c){return e===this.triggerId&&(this.state=lh.Default),bt(c),!1}}getLastActiveHints(){switch(this.state.type){case lh.Type.Active:return this.state.hints;case lh.Type.Pending:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===lh.Type.Active||this.state.type===lh.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:Ly.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Ly.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Ly.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(x.parameterHints).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};Tre.DEFAULT_DELAY=120;let Pye=Tre;function QUt(s,e){switch(e.triggerKind){case Ly.Invoke:return e;case Ly.ContentChange:return s;case Ly.TriggerCharacter:default:return e}}var jUt='.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}';gt(jUt,{});var Fye;const Ef=fe,YUt=oi("parameter-hints-next",ve.chevronDown,g(5198,"Icon for show next parameter hint.")),JUt=oi("parameter-hints-previous",ve.chevronUp,g(5199,"Icon for show previous parameter hint."));var rR;let Oye=(rR=class extends V{constructor(e,t,i,n,r,o){super(),this.editor=e,this.model=t,this.telemetryService=o,this.renderDisposeables=this._register(new Z),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Z_({editor:e},r,n)),this.keyVisible=eN.Visible.bindTo(i),this.keyMultipleSignatures=eN.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=Ef(".editor-widget.parameter-hints-widget"),t=oe(e,Ef(".phwrapper"));t.tabIndex=-1;const i=oe(t,Ef(".controls")),n=oe(i,Ef(".button"+He.asCSSSelector(JUt))),r=oe(i,Ef(".overloads")),o=oe(i,Ef(".button"+He.asCSSSelector(YUt)));this._register(ue(n,"click",u=>{tn.stop(u),this.previous()})),this._register(ue(o,"click",u=>{tn.stop(u),this.next()}));const a=Ef(".body"),c=new MU(a,{alwaysConsumeMouseWheel:!0});this._register(c),t.appendChild(c.getDomNode());const l=oe(a,Ef(".signature")),d=oe(a,Ef(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:r,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",dd.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:[ts.ABOVE,ts.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=oe(this.domNodes.signature,Ef(".code")),r=i.parameters.length>0,o=i.activeParameter??e.activeParameter;if(r)this.renderParameters(n,i,o);else{const l=oe(n,Ef("span"));l.textContent=i.label}const a=i.parameters[o];if(a?.documentation){const l=Ef("span.documentation");if(typeof a.documentation=="string")l.textContent=a.documentation;else{const d=this.renderMarkdownDocs(a.documentation);l.appendChild(d.element)}oe(this.domNodes.docs,Ef("p",{},l))}if(i.documentation!==void 0)if(typeof i.documentation=="string")oe(this.domNodes.docs,Ef("p",{},i.documentation));else{const l=this.renderMarkdownDocs(i.documentation);oe(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[o];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&&(No(g(5200,"{0}, hint",l)),this.announcedLabel=l)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new Ys,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,r]=this.getParameterLabelOffsets(t,i),o=document.createElement("span");o.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,r),a.className="parameter active";const c=document.createElement("span");c.textContent=t.label.substring(r),oe(e,o,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|^)${Nh(i.label)}(?=\\W|$)`,"g");n.test(e.label);const r=n.lastIndex-i.label.length;return r>=0?[r,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 Fye.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)}},Fye=rR,rR.ID="editor.widget.parameterHintsWidget",rR);Oye=Fye=D([_(2,Le),_(3,Ar),_(4,Di),_(5,Ji)],Oye);W("editorHoverWidget.highlightForeground",lF,g(5201,"Foreground color of the active item in the parameter hint."));var Bye,oR;let UW=(oR=class extends V{static get(e){return e.getContribution(Bye.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 Ca(()=>this._register(t.createInstance(Oye,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)}},Bye=oR,oR.ID="editor.controller.parameterHints",oR);UW=Bye=D([_(1,we),_(2,nt)],UW);class XUt extends it{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){UW.get(t)?.trigger({triggerKind:Ly.Invoke})}}on(UW.ID,UW,ai.BeforeFirstInteraction);Re(XUt);const xNe=Ae.EditorContrib+75,DNe=uc.bindToContribution(UW.get);Qe(new DNe({id:"closeParameterHints",precondition:eN.Visible,handler:s=>s.cancel(),kbOpts:{weight:xNe,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));Qe(new DNe({id:"showPrevParameterHint",precondition:he.and(eN.Visible,eN.MultipleSignatures),handler:s=>s.previous(),kbOpts:{weight:xNe,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 DNe({id:"showNextParameterHint",precondition:he.and(eN.Visible,eN.MultipleSignatures),handler:s=>s.next(),kbOpts:{weight:xNe,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 ZUt=".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}}";gt(ZUt,{});class oit{constructor(e){this.instantiationService=e}init(...e){}}function e4t(s,e){return class extends e{constructor(){super(...arguments),this._autorun=void 0}init(...i){this._autorun=du((n,r)=>{const o=Wg(s(),n);r.add(this.instantiationService.createInstance(o,...i))})}dispose(){this._autorun?.dispose()}}}let x4e=class extends oit{constructor(e){super(e),this.init()}};x4e=D([_(0,we)],x4e);function t4t(s){return Qae()?e4t(s,Wye):s()}let Wye=class extends oit{constructor(e,t){super(t),this.init(e)}};Wye=D([_(1,we)],Wye);on(p9.ID,t4t(()=>p9),ai.Eager);W("editor.placeholder.foreground",Vvt,g(1542,"Foreground color of the placeholder text in the editor."));var i4t=".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}";gt(i4t,{});const t4=new Q("renameInputVisible",!1,g(5202,"Whether the rename input widget is visible"));let Hye=class{constructor(e,t,i,n,r,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=o,this.allowEditorOverflow=!0,this._disposables=new Z,this._visibleContextKey=t4.bindTo(r),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new Ys,this._inputWithButton=new n4t,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 kNe(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(kI),i=e.getColor(q2);this._domNode.style.backgroundColor=String(e.getColor(kh)??""),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(AQe)??"");const n=e.getColor(g5);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(Y2)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(Y2)??""),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;Lt(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=K_(this.getDomNode().ownerDocument.body),t=So(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:r}=m9.getLayoutInfo({lineHeight:n}),o=this._nPxAvailableBelow>r*6?[ts.BELOW,ts.ABOVE]:[ts.ABOVE,ts.BELOW];return{position:this._position,preference:o}}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;Lt(this._renameCandidateListView),Lt(this._nPxAvailableAbove!==void 0),Lt(this._nPxAvailableBelow!==void 0);const t=vb(this._inputWithButton.domNode),i=vb(this._label);let n;e===ts.BELOW?n=this._nPxAvailableBelow:n=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:Od(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,r){const{start:o,end:a}=this._getSelection(e,t);this._renameCts=r;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 xn(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 re(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",o.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,r.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 hc;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"),Lt(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(r.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),Lt(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new li;const i=t?CM.Invoke:CM.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){Lt(this._editor.hasModel());const i=this._editor.getSelection();let n=0,r=t.length;return!F.isEmpty(i)&&!F.spansMultipleLines(i)&&F.containsRange(e,i)&&(n=Math.max(0,i.startColumn-e.startColumn),r=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:r}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,_t.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 r=await $_(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),r===void 0){n("returning early - received updateRenameCandidates results - undefined");return}const o=r.flatMap(l=>l.status==="fulfilled"&&Oc(l.value)?l.value:[]);n(`received updateRenameCandidates results - total (unfiltered) ${o.length} candidates.`);const a=Ya(o,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 - ${o.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)}};Hye=D([_(2,mn),_(3,Vt),_(4,Le),_(5,Ke)],Hye);class kNe{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=kNe._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($N({listInactiveFocusForeground:e3,listInactiveFocusBackground:t3}))}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`,xh(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}=m9.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(o){return"candidate"}getHeight(o){return t}},r=new class{constructor(){this.templateId="candidate"}renderTemplate(o){return new m9(o,i)}renderElement(o,a,c){c.populate(o)}disposeTemplate(o){o.dispose()}};return new Za("NewSymbolNameCandidates",e,n,[r],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class n4t{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=xm().setupManagedHover(Fo("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 xn(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 Lt(this._inputNode),this._inputNode}get button(){return Lt(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??=eC(ve.sparkle),Ns(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??=eC(ve.primitiveSquare),Ns(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 i8=class i8{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=`${i8._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=eC(ve.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),kl(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(Rfe.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+i8._PADDING*2}}dispose(){}};i8._PADDING=2;let m9=i8;var Uye;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(` +`));const m=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return O6.fromFn(async()=>{const v=await m.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},Ue.None);if(!v.identical)return new WUt(mi.fromRangeInclusive(d),u(h),v.changes)})}),this._fetchStore=this._register(new Z),this._inlineEditsFetchResult=C3(this,void 0),this._inlineEdits=Zh({owner:this,equalsFn:cJ},c=>this._inlineEditsFetchResult.read(c)?.completions.map(l=>new zUt(l))??[]),this._fetchInlineEditsPromise=jYe({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:nm.Automatic}),handleChange:(c,l)=>(c.didChange(this._forceUpdateExplicitlySignal)&&(l.inlineCompletionTriggerKind=nm.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=bfe(this._fetchStore);await Ao(200,f);const p=await det(this.languageFeaturesService.inlineCompletionsProvider,h,this.textModel,u,f);f.isCancellationRequested||this._inlineEditsFetchResult.set(p,void 0)}),this._filteredInlineEditItems=Zh({owner:this,equalsFn:sW()},c=>this._inlineEdits.read(c)),this.selectedInlineCompletionIndex=et(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=et(this,c=>{const l=this._filteredInlineEditItems.read(c),d=this.selectedInlineCompletionIndex.read(c);return l[d]}),this.activeCommands=Zh({owner:this,equalsFn:sW()},c=>this.selectedInlineEdit.read(c)?.inlineCompletion.source.inlineCompletions.commands??[]),this._register(VN(this._fetchInlineEditsPromise))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineEditsPromise.get()}async triggerExplicitly(e){IM(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){IM(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 Pi;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}},DV=nR,nR._modelId=0,nR);Tye=DV=D([_(4,nt),_(5,B6),_(6,fi)],Tye);class zUt{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class $Ut extends V{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=Yt(this,[]),this.range=et(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 Lye,sR;let $A=(sR=class extends V{static get(e){return e.getContribution(Lye.ID)}constructor(e,t,i,n,r,o){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._debounceService=n,this._languageFeaturesService=r,this._configurationService=o,this._enabled=QRe("editor.inlineEdits.enabled",!1,this._configurationService),this._editorObs=eu(this.editor),this._selection=et(this,a=>this._editorObs.cursorSelection.read(a)??new ht(1,1,1,1)),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineEditsDebounce",{min:50,max:50}),this.model=vh(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(Wg(Tye,a),c,this._editorObs.versionId,this._selection,this._debounceValue):void 0}),this._hadInlineEdit=L6(this,(a,c)=>c||this.model.read(a)?.inlineEdit.read(a)!==void 0),this._widget=vh(this,a=>{if(this._hadInlineEdit.read(a))return this._instantiationService.createInstance(Wg(Iye,a),this.editor,this.model.map((c,l)=>c?.inlineEdit.read(l)),GUt(c=>this.model.read(c)?.userPrompt??Yt("empty","")))}),this._register(Rv(HW,this._contextKeyService,a=>!!this.model.read(a)?.inlineEdit.read(a))),this._register(Rv(FUt,this._contextKeyService,a=>!!this.model.read(a)?.isPinned.read(a))),this.model.recomputeInitiallyAndOnChange(this._store),this._widget.recomputeInitiallyAndOnChange(this._store)}},Lye=sR,sR.ID="editor.contrib.inlineEditsController",sR);$A=Lye=D([_(1,we),_(2,Le),_(3,xp),_(4,nt),_(5,Te)],$A);function GUt(s){return I6(void 0,e=>s(e).read(e),(e,t)=>{s(void 0).set(e,t)})}function pG(s){return{label:s.value,alias:s.original}}const Dre=class Dre extends it{constructor(){super({id:Dre.ID,...pG(Pe(5192,"Show Next Inline Edit")),precondition:he.and(J.writable,HW),kbOpts:{weight:100,primary:U.Alt|S.BracketRight}})}async run(e,t){$A.get(t)?.model.get()?.next()}};Dre.ID=PUt;let Rye=Dre;const kre=class kre extends it{constructor(){super({id:kre.ID,...pG(Pe(5193,"Show Previous Inline Edit")),precondition:he.and(J.writable,HW),kbOpts:{weight:100,primary:U.Alt|S.BracketLeft}})}async run(e,t){$A.get(t)?.model.get()?.previous()}};kre.ID=NUt;let Mye=kre;class KUt extends it{constructor(){super({id:"editor.action.inlineEdits.trigger",...pG(Pe(5194,"Trigger Inline Edit")),precondition:J.writable})}async run(e,t){const i=$A.get(t);await QYe(async n=>{await i?.model.get()?.triggerExplicitly(n)})}}class qUt extends it{constructor(){super({id:MUt,...pG(Pe(5195,"Accept Inline Edit")),precondition:HW,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:HW}})}async run(e,t){t instanceof uf&&(t=t.getParentEditor());const i=$A.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const Ire=class Ire extends it{constructor(){super({id:Ire.ID,...pG(Pe(5197,"Hide Inline Edit")),precondition:HW,kbOpts:{weight:100,primary:S.Escape}})}async run(e,t){const i=$A.get(t);is(n=>{i?.model.get()?.stop(n)})}};Ire.ID="editor.action.inlineEdits.hide";let Nye=Ire;on($A.ID,$A,ai.Eventually);Re(KUt);Re(Rye);Re(Mye);Re(qUt);Re(Nye);const eN={Visible:new Q("parameterHintsVisible",!1),MultipleSignatures:new Q("parameterHintsMultipleSignatures",!1)};async function rit(s,e,t,i,n){const r=s.ordered(e);for(const o of r)try{const a=await o.provideSignatureHelp(e,t,n,i);if(a)return a}catch(a){Nr(a)}}vt.registerCommand("_executeSignatureHelpProvider",async(s,...e)=>{const[t,i,n]=e;Lt(N.isUri(t)),Lt(re.isIPosition(i)),Lt(typeof n=="string"||!n);const r=s.get(nt),o=await s.get(pn).createModelReference(t);try{const a=await rit(r.signatureHelpProvider,o.object.textEditorModel,re.lift(i),{triggerKind:Ly.Invoke,isRetrigger:!1,triggerCharacter:n},Ue.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{o.dispose()}});var lh;(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(r,o){this.request=r,this.previouslyActiveHints=o,this.type=e.Pending}}s.Pending=t;class i{constructor(r){this.hints=r,this.type=e.Active}}s.Active=i})(lh||(lh={}));const Tre=class Tre extends V{constructor(e,t,i=Tre.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new I),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=lh.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new yn),this.triggerChars=new cY,this.retriggerChars=new cY,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Ph(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===lh.Type.Pending&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=lh.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(bt)}next(){if(this.state.type!==lh.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!==lh.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===lh.Type.Active&&(this.state=new lh.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===lh.Type.Active||this.state.type===lh.Type.Pending,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const n=this._pendingTriggers.reduce(QUt);this._pendingTriggers=[];const r={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const o=this.editor.getModel(),a=this.editor.getPosition();this.state=new lh.Pending(Mo(c=>rit(this.providers,o,a,r,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 lh.Active(c.value),this._lastSignatureHelpResult.value=c,this._onChangedHints.fire(this.state.hints),!0)}catch(c){return e===this.triggerId&&(this.state=lh.Default),bt(c),!1}}getLastActiveHints(){switch(this.state.type){case lh.Type.Active:return this.state.hints;case lh.Type.Pending:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===lh.Type.Active||this.state.type===lh.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:Ly.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Ly.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Ly.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(x.parameterHints).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};Tre.DEFAULT_DELAY=120;let Pye=Tre;function QUt(s,e){switch(e.triggerKind){case Ly.Invoke:return e;case Ly.ContentChange:return s;case Ly.TriggerCharacter:default:return e}}var jUt='.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}';gt(jUt,{});var Fye;const Ef=fe,YUt=oi("parameter-hints-next",ve.chevronDown,g(5198,"Icon for show next parameter hint.")),JUt=oi("parameter-hints-previous",ve.chevronUp,g(5199,"Icon for show previous parameter hint."));var rR;let Oye=(rR=class extends V{constructor(e,t,i,n,r,o){super(),this.editor=e,this.model=t,this.telemetryService=o,this.renderDisposeables=this._register(new Z),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Z_({editor:e},r,n)),this.keyVisible=eN.Visible.bindTo(i),this.keyMultipleSignatures=eN.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=Ef(".editor-widget.parameter-hints-widget"),t=oe(e,Ef(".phwrapper"));t.tabIndex=-1;const i=oe(t,Ef(".controls")),n=oe(i,Ef(".button"+He.asCSSSelector(JUt))),r=oe(i,Ef(".overloads")),o=oe(i,Ef(".button"+He.asCSSSelector(YUt)));this._register(ue(n,"click",u=>{tn.stop(u),this.previous()})),this._register(ue(o,"click",u=>{tn.stop(u),this.next()}));const a=Ef(".body"),c=new MU(a,{alwaysConsumeMouseWheel:!0});this._register(c),t.appendChild(c.getDomNode());const l=oe(a,Ef(".signature")),d=oe(a,Ef(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:r,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",dd.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:[ts.ABOVE,ts.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=oe(this.domNodes.signature,Ef(".code")),r=i.parameters.length>0,o=i.activeParameter??e.activeParameter;if(r)this.renderParameters(n,i,o);else{const l=oe(n,Ef("span"));l.textContent=i.label}const a=i.parameters[o];if(a?.documentation){const l=Ef("span.documentation");if(typeof a.documentation=="string")l.textContent=a.documentation;else{const d=this.renderMarkdownDocs(a.documentation);l.appendChild(d.element)}oe(this.domNodes.docs,Ef("p",{},l))}if(i.documentation!==void 0)if(typeof i.documentation=="string")oe(this.domNodes.docs,Ef("p",{},i.documentation));else{const l=this.renderMarkdownDocs(i.documentation);oe(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[o];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&&(No(g(5200,"{0}, hint",l)),this.announcedLabel=l)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new Ys,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,r]=this.getParameterLabelOffsets(t,i),o=document.createElement("span");o.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,r),a.className="parameter active";const c=document.createElement("span");c.textContent=t.label.substring(r),oe(e,o,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|^)${Nh(i.label)}(?=\\W|$)`,"g");n.test(e.label);const r=n.lastIndex-i.label.length;return r>=0?[r,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 Fye.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)}},Fye=rR,rR.ID="editor.widget.parameterHintsWidget",rR);Oye=Fye=D([_(2,Le),_(3,Ar),_(4,Di),_(5,Ji)],Oye);W("editorHoverWidget.highlightForeground",lF,g(5201,"Foreground color of the active item in the parameter hint."));var Bye,oR;let UW=(oR=class extends V{static get(e){return e.getContribution(Bye.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 Ca(()=>this._register(t.createInstance(Oye,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)}},Bye=oR,oR.ID="editor.controller.parameterHints",oR);UW=Bye=D([_(1,we),_(2,nt)],UW);class XUt extends it{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){UW.get(t)?.trigger({triggerKind:Ly.Invoke})}}on(UW.ID,UW,ai.BeforeFirstInteraction);Re(XUt);const xNe=Ae.EditorContrib+75,DNe=uc.bindToContribution(UW.get);Qe(new DNe({id:"closeParameterHints",precondition:eN.Visible,handler:s=>s.cancel(),kbOpts:{weight:xNe,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));Qe(new DNe({id:"showPrevParameterHint",precondition:he.and(eN.Visible,eN.MultipleSignatures),handler:s=>s.previous(),kbOpts:{weight:xNe,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 DNe({id:"showNextParameterHint",precondition:he.and(eN.Visible,eN.MultipleSignatures),handler:s=>s.next(),kbOpts:{weight:xNe,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 ZUt=".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}}";gt(ZUt,{});class oit{constructor(e){this.instantiationService=e}init(...e){}}function e4t(s,e){return class extends e{constructor(){super(...arguments),this._autorun=void 0}init(...i){this._autorun=du((n,r)=>{const o=Wg(s(),n);r.add(this.instantiationService.createInstance(o,...i))})}dispose(){this._autorun?.dispose()}}}let x4e=class extends oit{constructor(e){super(e),this.init()}};x4e=D([_(0,we)],x4e);function t4t(s){return Qae()?e4t(s,Wye):s()}let Wye=class extends oit{constructor(e,t){super(t),this.init(e)}};Wye=D([_(1,we)],Wye);on(p9.ID,t4t(()=>p9),ai.Eager);W("editor.placeholder.foreground",Vvt,g(1542,"Foreground color of the placeholder text in the editor."));var i4t=".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}";gt(i4t,{});const t4=new Q("renameInputVisible",!1,g(5202,"Whether the rename input widget is visible"));let Hye=class{constructor(e,t,i,n,r,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=o,this.allowEditorOverflow=!0,this._disposables=new Z,this._visibleContextKey=t4.bindTo(r),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new Ys,this._inputWithButton=new n4t,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 kNe(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(kI),i=e.getColor(q2);this._domNode.style.backgroundColor=String(e.getColor(kh)??""),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(AQe)??"");const n=e.getColor(g5);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(Y2)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(Y2)??""),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;Lt(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=K_(this.getDomNode().ownerDocument.body),t=So(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:r}=m9.getLayoutInfo({lineHeight:n}),o=this._nPxAvailableBelow>r*6?[ts.BELOW,ts.ABOVE]:[ts.ABOVE,ts.BELOW];return{position:this._position,preference:o}}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;Lt(this._renameCandidateListView),Lt(this._nPxAvailableAbove!==void 0),Lt(this._nPxAvailableBelow!==void 0);const t=vb(this._inputWithButton.domNode),i=vb(this._label);let n;e===ts.BELOW?n=this._nPxAvailableBelow:n=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:Od(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,r){const{start:o,end:a}=this._getSelection(e,t);this._renameCts=r;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 xn(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 re(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",o.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,r.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 hc;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"),Lt(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(r.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),Lt(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new li;const i=t?CM.Invoke:CM.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){Lt(this._editor.hasModel());const i=this._editor.getSelection();let n=0,r=t.length;return!F.isEmpty(i)&&!F.spansMultipleLines(i)&&F.containsRange(e,i)&&(n=Math.max(0,i.startColumn-e.startColumn),r=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:r}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,_t.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 r=await $_(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),r===void 0){n("returning early - received updateRenameCandidates results - undefined");return}const o=r.flatMap(l=>l.status==="fulfilled"&&Oc(l.value)?l.value:[]);n(`received updateRenameCandidates results - total (unfiltered) ${o.length} candidates.`);const a=Ya(o,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 - ${o.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)}};Hye=D([_(2,mn),_(3,Vt),_(4,Le),_(5,Ke)],Hye);class kNe{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=kNe._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($N({listInactiveFocusForeground:e3,listInactiveFocusBackground:t3}))}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`,xh(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}=m9.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(o){return"candidate"}getHeight(o){return t}},r=new class{constructor(){this.templateId="candidate"}renderTemplate(o){return new m9(o,i)}renderElement(o,a,c){c.populate(o)}disposeTemplate(o){o.dispose()}};return new Za("NewSymbolNameCandidates",e,n,[r],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class n4t{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=xm().setupManagedHover(Fo("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 xn(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 Lt(this._inputNode),this._inputNode}get button(){return Lt(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??=eC(ve.sparkle),Ns(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??=eC(ve.primitiveSquare),Ns(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 i8=class i8{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=`${i8._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=eC(ve.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),Il(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(Rfe.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+i8._PADDING*2}}dispose(){}};i8._PADDING=2;let m9=i8;var Uye;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 r=this._providers[t];if(!r)return{edits:[],rejectReason:i.join(` -`)};const o=await r.provideRenameEdits(this.model,this.position,e,n);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(g(1543,"No result.")),n);return o}}async function s4t(s,e,t,i){const n=new INe(e,t,s),r=await n.resolveRenameLocation(Ue.None);return r?.rejectReason?{edits:[],rejectReason:r.rejectReason}:n.provideRenameEdits(i,Ue.None)}var aR;let cI=(aR=class{static get(e){return e.getContribution(Uye.ID)}constructor(e,t,i,n,r,o,a,c,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=r,this._logService=o,this._configService=a,this._languageFeaturesService=c,this._telemetryService=l,this._disposableStore=new Z,this._cts=new li,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(Hye,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 li,!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 nI(this.editor,jr.Position|jr.Value,void 0,this._cts.token);let r;try{e("resolving rename location");const p=i.resolveRenameLocation(n.token);this._progressService.showWhile(p,250),r=await p,e("resolved rename location")}catch(p){p instanceof Na?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"||ud(p))&&Mh.get(this.editor)?.showMessage(p||g(1544,"An unknown error occurred while resolving rename location"),t));return}finally{n.dispose()}if(!r){e("returning early - no loc");return}if(r.rejectReason){e(`returning early - rejected with reason: ${r.rejectReason}`,r.rejectReason),Mh.get(this.editor)?.showMessage(r.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const o=new nI(this.editor,jr.Position|jr.Value,r.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===CM.Automatic&&(v=v.filter(([b,w])=>w)),v.map(([b])=>b.provideNewSymbolNames(a,r.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(r.range,r.text,h,c.length>0?d:void 0,o);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(),o.dispose();return}this.editor.focus(),e("requesting rename edits");const f=$_(i.provideRenameEdits(u.newName,o.token),o.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}'",r?.text,u.newName),code:"undoredo.rename",quotableLabel:g(1546,"Renaming {0} to {1}",r?.text,u.newName),respectAutoSaveConfig:!0}).then(m=>{e("edits applied"),m.ariaSummary&&No(g(1547,"Successfully renamed '{0}' to '{1}'. Summary: {2}",r.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(()=>{o.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)}},Uye=aR,aR.ID="editor.contrib.renameController",aR);cI=Uye=D([_(1,we),_(2,wi),_(3,UN),_(4,nE),_(5,Ke),_(6,xc),_(7,nt),_(8,Ji)],cI);class r4t extends it{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(qt),[n,r]=Array.isArray(t)&&t||[void 0,void 0];return N.isUri(n)&&re.isIPosition(r)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(r),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},bt):super.runCommand(e,t)}run(e,t){const i=e.get(Ke),n=cI.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}on(cI.ID,cI,ai.Lazy);Re(r4t);const TNe=uc.bindToContribution(cI.get);Qe(new TNe({id:"acceptRenameInput",precondition:t4,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:he.and(J.focus,he.not("isComposing")),primary:S.Enter}}));Qe(new TNe({id:"acceptRenameInputWithPreview",precondition:he.and(t4,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 TNe({id:"cancelRenameInput",precondition:t4,handler:s=>s.cancelRenameInput(),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));Et(class extends di{constructor(){super({id:"focusNextRenameSuggestion",title:{...Pe(1551,"Focus Next Rename Suggestion")},precondition:t4,keybinding:[{primary:S.DownArrow,weight:Ae.EditorContrib+99}]})}run(e){const t=e.get(qt).getFocusedCodeEditor();if(!t)return;const i=cI.get(t);i&&i.focusNextRenameSuggestion()}});Et(class extends di{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Pe(1552,"Focus Previous Rename Suggestion")},precondition:t4,keybinding:[{primary:S.UpArrow,weight:Ae.EditorContrib+99}]})}run(e){const t=e.get(qt).getFocusedCodeEditor();if(!t)return;const i=cI.get(t);i&&i.focusPreviousRenameSuggestion()}});lg("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;Lt(typeof n=="string");const{renameProvider:r}=s.get(nt);return s4t(r,e,t,n)});lg("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(nt),r=await new INe(e,t,i).resolveRenameLocation(Ue.None);if(r?.rejectReason)throw new Error(r.rejectReason);return r});je.as(Pn.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:ct.LANGUAGE_OVERRIDABLE,description:g(1553,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var KB;let fZ=(KB=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 r=this.editor.getModel()?.getLanguageId();r&&n.affects(r)&&(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 ln(()=>{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(r=>{if(!r.shouldBeInComments)return!0;const o=t.validateRange(r.range),a=t.tokenization.getLineTokens(o.startLineNumber),c=a.findTokenIndexAtOffset(o.startColumn-1),l=a.getStandardTokenType(c);return a.getLanguageId(c)===t.getLanguageId()&&l===no.Comment}));const i=Object.values(this.currentOccurrences).map(r=>r.decorationId),n=e.map(r=>o4t(r));this.editor.changeDecorations(r=>{const o=r.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,c=o.length;a0&&(h=e.subarray(t,t+d),t+=d),o[a]={start:c,deleteCount:l,data:h}}return{id:i,type:"delta",deltas:o}}function Bce(s){return s&&!!s.data}function cit(s){return s&&Array.isArray(s.edits)}class d4t{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function lit(s,e){return s.has(e)}function h4t(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function dit(s,e,t,i,n){const r=h4t(s,e),o=await Promise.all(r.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||!Bce(c)&&!cit(c))&&(c=null),new d4t(a,c,l)}));for(const a of o){if(a.error)throw a.error;if(a.tokens)return a}return o.length>0?o[0]:null}function u4t(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class g4t{constructor(e,t){this.provider=e,this.tokens=t}}function f4t(s,e){return s.has(e)}function hit(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function LNe(s,e,t,i){const n=hit(s,e),r=await Promise.all(n.map(async o=>{let a;try{a=await o.provideDocumentRangeSemanticTokens(e,t,i)}catch(c){Nr(c),a=null}return(!a||!Bce(a))&&(a=null),new g4t(o,a)}));for(const o of r)if(o.tokens)return o;return r.length>0?r[0]:null}vt.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;Lt(t instanceof N);const i=s.get(fi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(nt),r=u4t(n,i);return r?r[0].getLegend():s.get(bi).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});vt.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;Lt(t instanceof N);const i=s.get(fi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(nt);if(!lit(n,i))return s.get(bi).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const r=await dit(n,i,null,null,Ue.None);if(!r)return;const{provider:o,tokens:a}=r;if(!a||!Bce(a))return;const c=v9({id:0,type:"full",data:a.data});return a.resultId&&o.releaseDocumentSemanticTokens(a.resultId),c});vt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;Lt(t instanceof N);const n=s.get(fi).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(nt),o=hit(r,n);if(o.length===0)return;if(o.length===1)return o[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"),o[0].getLegend();const a=await LNe(r,n,F.lift(i),Ue.None);if(a)return a.provider.getLegend()});vt.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;Lt(t instanceof N),Lt(F.isIRange(i));const n=s.get(fi).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(nt),o=await LNe(r,n,F.lift(i),Ue.None);if(!(!o||!o.tokens))return v9({id:0,type:"full",data:o.tokens.data})});const RNe="editor.semanticHighlighting";function IQ(s,e,t){const i=t.getValue(RNe,{overrideIdentifier:s.getLanguageId(),resource:s.uri})?.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var kE;let Vye=class extends V{constructor(e,t,i,n,r,o){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new zye(d,e,i,r,o)},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()];IQ(d,i,n)?h||a(d):h&&c(d,h)}};t.getModels().forEach(d=>{IQ(d,i,n)&&a(d)}),this._register(t.onModelAdded(d=>{IQ(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(RNe)&&l()})),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};Vye=D([_(0,Dae),_(1,fi),_(2,mn),_(3,Te),_(4,xp),_(5,nt)],Vye);var ok;let zye=(ok=class extends V{constructor(e,t,i,n,r){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:kE.REQUEST_MIN_DELAY,max:kE.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new ln(()=>this._fetchDocumentSemanticTokensNow(),kE.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 o=()=>{wt(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)}))};o(),this._register(this._provider.onDidChange(()=>{o(),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),wt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!lit(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new li,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=dit(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const r=[],o=this._model.onDidChangeContent(c=>{r.push(c)}),a=new Ys(!1);n.then(c=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),!c)this._setDocumentSemanticTokens(null,null,null,r);else{const{provider:l,tokens:d}=c,h=this._semanticTokensStylingService.getStyling(l);this._setDocumentSemanticTokens(l,d||null,h,r)}},c=>{c&&(Oo(c)||typeof c.message=="string"&&c.message.indexOf("busy")!==-1)||bt(c),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(r.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,r){r=Math.min(r,i.length-n,e.length-t);for(let o=0;o{(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),o();return}if(cit(t)){if(!r){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:r.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const c=r.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(r.resultId,t.resultId,u,f.start,c.length),this._model.tokenization.setSemanticTokens(null,!0);return}const p=d-(f.start+f.deleteCount);p>0&&(kE._copy(c,d-p,l,h-p,p),h-=p),f.data&&(kE._copy(f.data,0,l,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&kE._copy(c,0,l,0,d),t={resultId:t.resultId,data:l}}}if(Bce(t)){this._currentDocumentResponse=new p4t(e,t.resultId,t.data);const a=Vje(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);o()}},kE=ok,ok.REQUEST_MIN_DELAY=300,ok.REQUEST_MAX_DELAY=2e3,ok);zye=kE=D([_(1,Dae),_(2,mn),_(3,xp),_(4,nt)],zye);class p4t{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}aG(Vye);var $ye,cR;let VW=(cR=class extends V{static get(e){return e.getContribution($ye.ID)}constructor(e,t,i,n,r,o){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new ln(()=>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(RNe)&&(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=Mo(o=>Promise.resolve(LNe(this._provider,e,t,o))),r=new Ys(!1);return n.then(o=>{if(this._debounceInformation.update(e,r.elapsed()),!o||!o.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:c}=o,l=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,Vje(c,l,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},$ye=cR,cR.ID="editor.contrib.viewportSemanticTokens",cR);VW=$ye=D([_(1,Dae),_(2,mn),_(3,Te),_(4,xp),_(5,nt)],VW);on(VW.ID,VW,ai.AfterFirstRender);class m4t{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const r=[];i.push(r),this.selectSubwords&&this._addInWordRanges(r,e,n),this._addWordRanges(r,e,n),this._addWhitespaceLine(r,e,n),r.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:r,startColumn:o}=n,a=i.column-o;let c=a,l=a,d=0;for(;c>=0;c--){const h=r.charCodeAt(c);if(c!==a&&(h===B.Underline||h===B.Dash))break;if(Ex(h)&&Uw(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 Gye;class MNe{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 MNe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var lR;let tN=(lR=class{static get(e){return e.getContribution(Gye.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 git(this._languageFeaturesService.selectionRangeProvider,i,t.map(r=>r.getPosition()),this._editor.getOption(x.smartSelect),Ue.None).then(r=>{if(!(!tr(r)||r.length!==t.length)&&!(!this._editor.hasModel()||!ns(this._editor.getSelections(),t,(o,a)=>o.equalsSelection(a)))){for(let o=0;oa.containsPosition(t[o].getStartPosition())&&a.containsPosition(t[o].getEndPosition())),r[o].unshift(t[o]);this._state=r.map(o=>new MNe(0,o)),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(r=>r.mov(e));const n=this._state.map(r=>ht.fromPositions(r.ranges[r.index].getStartPosition(),r.ranges[r.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},Gye=lR,lR.ID="editor.contrib.smartSelectController",lR);tN=Gye=D([_(1,nt)],tN);class uit extends it{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=tN.get(t);i&&await i.run(this._forward)}}class _4t extends uit{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}})}}vt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class v4t extends uit{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(tN.ID,tN,ai.Lazy);Re(_4t);Re(v4t);async function git(s,e,t,i,n){const r=s.all(e).concat(new m4t(i.selectSubwords));r.length===1&&r.unshift(new yX);const o=[],a=[];for(const c of r)o.push(Promise.resolve(c.provideSelectionRanges(e,t,n)).then(l=>{if(tr(l)&&l.length===t.length)for(let d=0;d{if(c.length===0)return[];c.sort((u,f)=>re.isBefore(u.getStartPosition(),f.getStartPosition())?1:re.isBefore(f.getStartPosition(),u.getStartPosition())||re.isBefore(u.getEndPosition(),f.getEndPosition())?-1:re.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}),Due="data-sticky-line-index",k4e="data-sticky-is-line",w4t="data-sticky-is-line-number",I4e="data-sticky-is-folding-icon";class y4t 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 uf),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),r=n?void 0:e,o=n?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(r,t,o),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(r=>!i.startLineNumbers.includes(r));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 r=this._editor._getViewModel();if(!r)return;const o=r.coordinatesConverter.convertModelPositionToViewPosition(new re(t,1)).lineNumber,a=r.getViewLineRenderingData(o),c=this._editor.getOption(x.lineNumbers);let l;try{l=iu.filter(a.inlineDecorations,o,a.minColumn,a.maxColumn)}catch{l=[]}const d=new DI(!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 kU(2e3),u=p6(d,h);let f;D4e?f=D4e.createHTML(h.build()):f=h.build();const p=document.createElement("span");p.setAttribute(Due,String(e)),p.setAttribute(k4e,""),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(Due,String(e)),m.setAttribute(w4t,""),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===yo.On||c.renderType===yo.Interval&&t%10===0?b.innerText=t.toString():c.renderType===yo.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 C4t(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,r=t===this._lineNumbers.length-1,o="0",a="1";i.style.zIndex=r?o:a,n.style.zIndex=r?o:a;const c=`${t*this._lineHeight+this._lastLineRelativePosition+(e.foldingIcon?.isCollapsed?1:0)}px`,l=`${t*this._lineHeight}px`;return i.style.top=r?c:l,n.style.top=r?c:l,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(x.showFoldingControls);if(!e||i==="never")return;const n=e.regions,r=n.findRange(t),o=n.getStartLineNumber(r);if(!(t===o))return;const c=n.isCollapsed(r),l=new S4t(c,o,n.getEndLineNumber(r),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:Vg.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=uLe(t.characterMapping,e,0);return new re(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,Due);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,k4e)!==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 C4t{constructor(e,t,i,n,r,o,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=r,this.characterMapping=o,this.scrollWidth=a}}class S4t{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=He.asClassName(e?KJ:GJ)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class Z5{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class mZ{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class fit{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var ez;(function(s){s.OUTLINE_MODEL="outlineModel",s.FOLDING_PROVIDER_MODEL="foldingProviderModel",s.INDENTATION_MODEL="indentationModel"})(ez||(ez={}));var zx;(function(s){s[s.VALID=0]="VALID",s[s.INVALID=1]="INVALID",s[s.CANCELED=2]="CANCELED"})(zx||(zx={}));let Kye=class extends V{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Ph(300)),this._updateOperation=this._register(new Z),this._editor.getOption(x.stickyScroll).defaultModel){case ez.OUTLINE_MODEL:this._modelProviders.push(new qye(this._editor,n));case ez.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new jye(this._editor,t,n));case ez.INDENTATION_MODEL:this._modelProviders.push(new Qye(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 r=await i;if(this._modelPromise!==n)return null;switch(r){case zx.CANCELED:return this._updateOperation.clear(),null;case zx.VALID:return t.stickyModel}}return null}).catch(t=>(bt(t),null))}};Kye=D([_(2,we),_(3,nt)],Kye);class pit extends V{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,zx.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Mo(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?zx.CANCELED:(this._stickyModel=this.createStickyModel(e,i),zx.VALID):this._invalid()).then(void 0,i=>(bt(i),zx.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let qye=class extends pit{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Nw.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),r=this._editor.getModel();return new fit(r.uri,r.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(ui.first(e.children.values())instanceof Xwe){const a=ui.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=[],r=Array.from(i.values()).sort((a,c)=>{const l=new Z5(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new Z5(c.symbol.range.startLineNumber,c.symbol.range.endLineNumber);return this._comparator(l,d)});for(const a of r)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new mZ(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const r of e.children.values())if(r.symbol.selectionRange.startLineNumber!==r.symbol.range.endLineNumber)if(r.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(r,r.symbol.selectionRange.startLineNumber));else for(const o of r.children.values())i.push(this._stickyModelFromOutlineElement(o,r.symbol.selectionRange.startLineNumber));i.sort((r,o)=>this._comparator(r.range,o.range));const n=new Z5(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new mZ(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 Jwe?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};qye=D([_(1,nt)],qye);class mit extends pit{constructor(e){super(e),this._foldingLimitReporter=new CXe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new fit(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new mZ(void 0,[],void 0);for(let r=0;r0&&(this.provider=this._register(new lMe(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){return this.provider?.compute(e)??null}};jye=D([_(2,nt)],jye);class A4t{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}var qB;let Yye=(qB=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 ln(()=>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 Kye(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new li,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,r){if(t.children.length===0)return;let o=r;const a=[];for(let d=0;dd-h)),l=this.updateIndex(k2(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!==o&&(o=u,i.push(new A4t(u,f-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n+1,u))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n,r)}}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(r=>!(r.startLineNumber>=n.startLineNumber&&r.endLineNumber<=n.endLineNumber+1));return t}},qB.ID="store.contrib.stickyScrollController",qB);Yye=D([_(1,nt),_(2,zs)],Yye);var Jye,dR;let GA=(dR=class extends V{constructor(e,t,i,n,r,o,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 y4t(this._editor),this._stickyLineCandidateProvider=new Yye(this._editor,i,r),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=X5.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(lt(c),d)})),this._stickyScrollFocusedContextKey=J.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=J.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(Ec(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(Jye.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,_t.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 Tce(this._editor,{extractLineNumberFromMouseEvent:r=>{const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);return o?o.lineNumber:0}})),i=r=>{if(!this._editor.hasModel()||r.target.type!==Mt.OVERLAY_WIDGET||r.target.detail!==this._stickyScrollWidget.getId())return null;const o=r.target.element;if(!o||o.innerText!==o.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(o);return a?{range:new F(a.lineNumber,a.column,a.lineNumber,a.column+o.innerText.length),textElement:o}:null},n=this._stickyScrollWidget.getDomNode();this._register(Rr(n,ke.CLICK,r=>{if(r.ctrlKey||r.altKey||r.metaKey||!r.leftButton)return;if(r.shiftKey){const l=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(l===null)return;const d=new re(this._endLineNumbers[l],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(r.target)){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);this._toggleFoldingRegionForLine(l);return}if(!this._stickyScrollWidget.isInStickyLine(r.target))return;let c=this._stickyScrollWidget.getEditorPositionFromNode(r.target);if(!c){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);if(l===null)return;c=new re(l,1)}this._revealPosition(c)})),this._register(Rr(n,ke.MOUSE_MOVE,r=>{if(r.shiftKey){const o=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(o===null||this._showEndForLine!==null&&this._showEndForLine===o)return;this._showEndForLine=o,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(ue(n,ke.MOUSE_LEAVE,r=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([r,o])=>{const a=i(r);if(!a||!r.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 li;e.add(Ee(()=>d.dispose(!0)));let h;lG(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new re(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 r=>{if(r.target.type!==Mt.OVERLAY_WIDGET||r.target.detail!==this._stickyScrollWidget.getId())return;const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);o&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:o.lineNumber,column:1})),this._instaService.invokeFunction(vtt,r,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new Dh(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;rMe(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===yo.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 o=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(o)||(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 PA.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=X5.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 r=[],o=[],a=this._editor.getVisibleRanges();if(a.length!==0){const c=new Z5(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){r.push(h),o.push(u+1),n=w-m;break}else m>v&&m<=w&&(r.push(h),o.push(u+1));if(r.length===t)break}}}return this._endLineNumbers=o,new X5(r,o,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},Jye=dR,dR.ID="store.contrib.stickyScrollController",dR);GA=Jye=D([_(1,lo),_(2,nt),_(3,we),_(4,zs),_(5,xp),_(6,Le)],GA);class E4t extends di{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:la.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 Wce=Ae.EditorContrib;class x4t extends mf{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){GA.get(t)?.focus()}}class D4t extends mf{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Pe(5224,"Select the next editor sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Wce,primary:S.DownArrow}})}runEditorCommand(e,t){GA.get(t)?.focusNext()}}class k4t extends mf{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Pe(5225,"Select the previous sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Wce,primary:S.UpArrow}})}runEditorCommand(e,t){GA.get(t)?.focusPrevious()}}class I4t extends mf{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Pe(5226,"Go to the focused sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Wce,primary:S.Enter}})}runEditorCommand(e,t){GA.get(t)?.goToFocused()}}class T4t extends mf{constructor(){super({id:"editor.action.selectEditor",title:Pe(5227,"Select Editor"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Wce,primary:S.Escape}})}runEditorCommand(e,t){GA.get(t)?.selectEditor()}}on(GA.ID,GA,ai.AfterFirstRender);Et(E4t);Et(x4t);Et(k4t);Et(D4t);Et(I4t);Et(T4t);class L4t{constructor(e,t,i,n,r,o){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=r,this.completion=o}}let Xye=class extends bTe{constructor(e,t,i,n,r,o){super(r.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=o}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(Ue.None)}return e}};Xye=D([_(5,kce)],Xye);let Zye=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 r;for(const f of this._editorService.listCodeEditors())if(f.getModel()===e){r=f;break}if(!r)return;const o=r.getOption(x.quickSuggestions);if(CF.isAllOff(o))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(CF.valueFor(o,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 kUe(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),h=this._lastResult}else{const f=await zMe(this._languageFeatureService.completionProvider,e,t,new Z3(void 0,SX.createSuggestFilter(r).itemKind,d?.providers),d&&{triggerKind:ju.TriggerCharacter,triggerCharacter:d.ch},n);let p;f.needsClipboard&&(p=await this._clipboardService.readText());const m=new lx(f.items,t.column,new kUe(u,0),CX.None,r.getOption(x.suggest),r.getOption(x.snippetSuggestions),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new Xye(e,t.lineNumber,l,m,f,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(Ue.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 r of this._languageFeatureService.completionProvider.all(e))r.triggerCharacters?.includes(i)&&n.add(r);if(n.size!==0)return{providers:n,ch:i}}};Zye=D([_(0,nt),_(1,gg),_(2,kce),_(3,qt)],Zye);aG(Zye);class R4t extends it{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 Ys;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Re(R4t);var M4t=".monaco-editor .unicode-highlight{background-color:var(--vscode-editorUnicodeHighlight-background);border:1px solid var(--vscode-editorUnicodeHighlight-border);box-sizing:border-box}";gt(M4t,{});var N4t=".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)}";gt(N4t,{});const P4t=26;let eCe=class extends V{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(tCe))}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,P4t)}};eCe=D([_(1,we)],eCe);let tCe=class extends V{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Z_,{}),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(){Ns(this.element)}show(e){Ns(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=oe(this.element,fe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(fe(`div${He.asCSSSelector(e.icon)}`));const n=oe(this.element,fe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=oe(this.element,fe("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(d9,this.messageActionsContainer,{...o,tabIndex:-1},{}));const r=oe(this.element,fe("div.action-container"));this.actionBar=this._register(new gd(r)),this.actionBar.push(this._register(new an("banner.close","Close Banner",He.asClassName(QJe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};tCe=D([_(0,we)],tCe);const F4t=oi("extensions-warning-message",ve.warning,g(1574,"Icon shown with a warning message in the extensions editor."));var QB;let b9=(QB=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=r=>{if(r&&r.hasMore){if(this._bannerClosed)return;const o=Math.max(r.ambiguousCharacterCount,r.nonBasicAsciiCharacterCount,r.invisibleCharacterCount);let a;if(r.nonBasicAsciiCharacterCount>=o)a={message:g(1575,"This document contains many non-basic ASCII unicode characters"),command:new y9};else if(r.ambiguousCharacterCount>=o)a={message:g(1576,"This document contains many ambiguous unicode characters"),command:new iN};else if(r.invisibleCharacterCount>=o)a={message:g(1577,"This document contains many invisible unicode characters"),command:new w9};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:F4t,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(eCe,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(x.unicodeHighlighting),this._register(i.onDidChangeTrust(r=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(r=>{r.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=O4t(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"?jl:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new iCe(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new B4t(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},QB.ID="editor.contrib.unicodeHighlighter",QB);b9=D([_(1,Pl),_(2,mC),_(3,we)],b9);function O4t(s,e){return{nonBasicASCII:e.nonBasicASCII===Lf?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Lf?!s:e.includeComments,includeStrings:e.includeStrings===Lf?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let iCe=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 ln(()=>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:_Z.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!VLe(t,e))return null;const i=t.getValueInRange(e.range);return{reason:vit(i,this._options),inComment:zLe(t,e),inString:$Le(t,e)}}};iCe=D([_(3,Pl)],iCe);class B4t 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 ln(()=>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 r=KTe.computeUnicodeHighlights(this._model,this._options,n);for(const o of r.ranges)i.ranges.push(o);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||r.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:_Z.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 VLe(t,e)?{reason:vit(i,this._options),inComment:zLe(t,e),inString:$Le(t,e)}:null}}const _it=g(1578,"Configure Unicode Highlight Options");let nCe=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!==uu.Range)return[];const i=this._editor.getModel(),n=this._editor.getContribution(b9.ID);if(!n)return[];const r=[],o=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=kue(h);let f;switch(l.reason.kind){case A_.Ambiguous:{X7(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,kue(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,kue(l.reason.confusableWith.codePointAt(0)));break}case A_.Invisible:f=g(1581,"The character {0} is invisible.",u);break;case A_.NonBasicAscii:f=g(1582,"The character {0} is not a basic ASCII character.",u);break}if(o.has(f))continue;o.add(f);const p={codePoint:h,reason:l.reason,inComment:l.inComment,inString:l.inString},m=g(1583,"Adjust settings"),v=`command:${vZ.ID}?${encodeURIComponent(JSON.stringify(p))}`,b=new Nt("",!0).appendMarkdown(f).appendText(" ").appendLink(v,m,_it);r.push(new b_(this,c.range,[b],!1,a++))}return r}renderHoverParts(e,t){return fOt(e,t,this._editor,this._languageService,this._openerService)}getAccessibleContent(e){return e.contents.map(t=>t.value).join(` -`)}};nCe=D([_(1,Di),_(2,Ar)],nCe);function sCe(s){return`U+${s.toString(16).padStart(4,"0")}`}function kue(s){let e=`\`${sCe(s)}\``;return yT.isInvisibleCharacter(s)||(e+=` "${`${W4t(s)}`}"`),e}function W4t(s){return s===B.BackTick?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function vit(s,e){return KTe.computeUnicodeHighlightReason(s,e)}const Lre=class Lre{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=Kt.createDynamic({description:"unicode-highlight",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};Lre.instance=new Lre;let _Z=Lre;const MFe=class MFe extends it{constructor(){super({id:iN.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(Pu.includeComments,!1,At.USER)}};MFe.ID="editor.action.unicodeHighlight.disableHighlightingInComments";let rCe=MFe;const NFe=class NFe extends it{constructor(){super({id:iN.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(Pu.includeStrings,!1,At.USER)}};NFe.ID="editor.action.unicodeHighlight.disableHighlightingInStrings";let oCe=NFe;const Rre=class Rre extends it{constructor(){super({id:Rre.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(Pu.ambiguousCharacters,!1,At.USER)}};Rre.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let iN=Rre;const Mre=class Mre extends it{constructor(){super({id:Mre.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(Pu.invisibleCharacters,!1,At.USER)}};Mre.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let w9=Mre;const Nre=class Nre extends it{constructor(){super({id:Nre.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(Pu.nonBasicASCII,!1,At.USER)}};Nre.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let y9=Nre;const Pre=class Pre extends it{constructor(){super({id:Pre.ID,label:g(1594,"Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:r,inString:o,inComment:a}=i,c=String.fromCodePoint(n),l=e.get(Tn),d=e.get(Te);function h(p){return yT.isInvisibleCharacter(p)?g(1595,"Exclude {0} (invisible character) from being highlighted",sCe(p)):g(1596,"Exclude {0} from being highlighted",`${sCe(p)} "${c}"`)}const u=[];if(r.kind===A_.Ambiguous)for(const p of r.notAmbiguousInLocales)u.push({label:g(1597,'Allow unicode characters that are more common in the language "{0}".',p),run:async()=>{U4t(d,[p])}});if(u.push({label:h(n),run:()=>H4t(d,[n])}),a){const p=new rCe;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o){const p=new oCe;u.push({label:p.label,run:async()=>p.runAction(d)})}if(r.kind===A_.Ambiguous){const p=new iN;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(r.kind===A_.Invisible){const p=new w9;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(r.kind===A_.NonBasicAscii){const p=new y9;u.push({label:p.label,run:async()=>p.runAction(d)})}else V4t(r);const f=await l.pick(u,{title:_it});f&&await f.run()}};Pre.ID="editor.action.unicodeHighlight.showExcludeOptions";let vZ=Pre;async function H4t(s,e){const t=s.getValue(Pu.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(Pu.allowedCharacters,i,At.USER)}async function U4t(s,e){const t=s.inspect(Pu.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(Pu.allowedLocales,i,At.USER)}function V4t(s){throw new Error(`Unexpected value: ${s}`)}Re(iN);Re(w9);Re(y9);Re(vZ);on(b9.ID,b9,ai.AfterFirstRender);JN.register(nCe);const bit="ignoreUnusualLineTerminators";function z4t(s,e,t){s.setModelProperty(e.uri,bit,t)}function $4t(s,e){return s.getModelProperty(e.uri,bit)}var jB;let bZ=(jB=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()||$4t(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`.",vi(e.uri)),primaryButton:g(1601,"&&Remove Unusual Line Terminators"),cancelButton:g(1602,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){z4t(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},jB.ID="editor.contrib.unusualLineTerminatorsDetector",jB);bZ=D([_(1,ir),_(2,qt)],bZ);on(bZ.ID,bZ,ai.AfterFirstRender);var vc,aCe;const Hce=new Q("hasWordHighlights",!1);function wit(s,e,t,i){const n=s.ordered(e);return eae(n.map(r=>()=>Promise.resolve(r.provideDocumentHighlights(e,t,i)).then(void 0,Nr)),tr).then(r=>{if(r){const o=new gi;return o.set(e.uri,r),o}return new gi})}function G4t(s,e,t,i,n,r){const o=s.ordered(e);return eae(o.map(a=>()=>{const c=r.filter(l=>Py(l)).filter(l=>kae(a.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,c,n)).then(void 0,Nr)}),a=>a instanceof gi&&a.size>0)}class NNe{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=Mo(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,r=t.startColumn,o=t.endColumn,a=this._getCurrentWordRange(e,t);let c=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let l=0,d=i.length;!c&&l=o&&(c=!0)}return c}cancel(){this.result.cancel()}}class K4t extends NNe{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return wit(this._providers,e,t.getPosition(),n).then(r=>r||new gi)}}class q4t extends NNe{constructor(e,t,i,n,r){super(e,t,i),this._providers=n,this._otherModels=r}_compute(e,t,i,n){return G4t(this._providers,e,t.getPosition(),i,n,this._otherModels).then(r=>r||new gi)}}class yit extends NNe{constructor(e,t,i,n,r){super(e,t,n),this._otherModels=r,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,n){return Ao(250,n).then(()=>{const r=new gi;let o;if(this._word?o=this._word:o=e.getWordAtPosition(t.getPosition()),!o)return new gi;const a=[e,...this._otherModels];for(const c of a){if(c.isDisposed())continue;const d=c.findMatches(o.word,!0,!1,!0,i,!1).map(h=>({range:h.range,kind:k8.Text}));d&&r.set(c.uri,d)}return r})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty!==n?!1:super.isValid(e,t,i)}}function Q4t(s,e,t,i,n){return s.has(e)?new K4t(e,t,n,s):new yit(e,t,i,n,[])}function j4t(s,e,t,i,n,r){return s.has(e)?new q4t(e,t,n,s,r):new yit(e,t,i,n,r)}lg("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(nt);return(await wit(i.documentHighlightProvider,e,t,Ue.None))?.get(e.uri)});var ak;let cCe=(ak=class{constructor(e,t,i,n,r){this.toUnhook=new Z,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new gi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this._hasWordHighlights=Hce.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(x.occurrencesHighlight),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(o)})),this.toUnhook.add(e.onDidFocusEditorText(o=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this._run())})),this.toUnhook.add(e.onDidChangeModelContent(o=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(o=>{!o.newModelUrl&&o.oldModelUrl?this._stopSingular():vc.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{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,vc.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(r=>r.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);No(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.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 r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);No(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=vc.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),vc.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=vc.storedDecorations.get(i.getModel().uri);if(!n)continue;i.removeDecorations(n),t.push(i.getModel().uri);const r=fp.get(i);r?.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const i of t)vc.storedDecorations.delete(i)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==pe.vscodeNotebookCell&&vc.query?.modelInfo?.model.uri.scheme!==pe.vscodeNotebookCell?(vc.query=null,this._run()):vc.query?.modelInfo&&(vc.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!==Bi.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 r=[],o=this.codeEditorService.listCodeEditors();for(const a of o){const c=a.getModel();c&&c!==e&&c.uri.scheme===pe.vscodeNotebookCell&&r.push(c)}return r}const i=[],n=this.codeEditorService.listCodeEditors();for(const r of n){if(!rm(r))continue;const o=r.getModel();o&&e===o.modified&&i.push(o.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const r of n){const o=r.getModel();o&&o!==e&&i.push(o)}return i}_run(){let e;if(this.editor.hasTextFocus()){const i=this.editor.getSelection();if(!i||i.startLineNumber!==i.endLineNumber){vc.query=null,this._stopAll();return}const n=i.startColumn,r=i.endColumn,o=this._getWord();if(!o||o.startColumn>n||o.endColumn{i===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=r||[],this._beginRenderDecorations())},bt)}}computeWithModel(e,t,i,n){return n.length?j4t(this.multiDocumentProviders,e,t,i,this.editor.getOption(x.wordSeparators),n):Q4t(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=fp.get(t);if(!i)continue;const n=[],r=t.getModel()?.uri;if(r&&this.workerRequestValue.has(r)){const o=vc.storedDecorations.get(r),a=this.workerRequestValue.get(r);if(a)for(const l of a)l.range&&n.push({range:l.range,options:iUt(l.kind)});let c=[];t.changeDecorations(l=>{c=l.deltaDecorations(o??[],n)}),vc.storedDecorations=vc.storedDecorations.set(r,c),n.length>0&&(i.wordHighlighter?.decorations.set(n),i.wordHighlighter?._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},vc=ak,ak.storedDecorations=new gi,ak.query=null,ak);cCe=vc=D([_(4,qt)],cCe);var hR;let fp=(hR=class extends V{static get(e){return e.getContribution(aCe.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const r=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new cCe(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(o=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),r()})),r()}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()}},aCe=hR,hR.ID="editor.contrib.wordHighlighter",hR);fp=aCe=D([_(1,Le),_(2,nt),_(3,qt)],fp);class Cit extends it{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=fp.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class Y4t extends Cit{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:g(1603,"Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:Hce,kbOpts:{kbExpr:J.editorTextFocus,primary:S.F7,weight:Ae.EditorContrib}})}}class J4t extends Cit{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:g(1604,"Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:Hce,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|S.F7,weight:Ae.EditorContrib}})}}class X4t extends it{constructor(){super({id:"editor.action.wordHighlight.trigger",label:g(1605,"Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:Hce.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:0,weight:Ae.EditorContrib}})}run(e,t,i){const n=fp.get(t);n&&n.restoreViewState(!0)}}on(fp.ID,fp,ai.Eager);Re(Y4t);Re(J4t);Re(X4t);class Uce extends uc{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=_m(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),r=t.getModel(),o=t.getSelections(),a=o.length>1,c=o.map(l=>{const d=new re(l.positionLineNumber,l.positionColumn),h=this._move(n,r,d,this._wordNavigationType,a);return this._moveTo(l,h,this._inSelectionMode)});if(r.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",Bi.Explicit,c.map(l=>Mn.fromModelSelection(l))),c.length===1){const l=new re(c[0].positionLineNumber,c[0].positionColumn);t.revealPosition(l,_t.Smooth)}}_moveTo(e,t,i){return i?new ht(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new ht(t.lineNumber,t.column,t.lineNumber,t.column)}}class FI extends Uce{_move(e,t,i,n,r){return us.moveWordLeft(e,t,i,n,r)}}class OI extends Uce{_move(e,t,i,n,r){return us.moveWordRight(e,t,i,n)}}class Z4t extends FI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordStart,id:"cursorWordStartLeft",precondition:void 0})}}class eVt extends FI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordEnd,id:"cursorWordEndLeft",precondition:void 0})}}class tVt extends FI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordStartFast,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(s6,P6)?.negate()),primary:U.CtrlCmd|S.LeftArrow,mac:{primary:U.Alt|S.LeftArrow},weight:Ae.EditorContrib}})}}class iVt extends FI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordStart,id:"cursorWordStartLeftSelect",precondition:void 0})}}class nVt extends FI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordEnd,id:"cursorWordEndLeftSelect",precondition:void 0})}}class sVt extends FI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordStartFast,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(s6,P6)?.negate()),primary:U.CtrlCmd|U.Shift|S.LeftArrow,mac:{primary:U.Alt|U.Shift|S.LeftArrow},weight:Ae.EditorContrib}})}}class rVt extends FI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordAccessibility,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,r){return super._move(_m(Ch.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class oVt extends FI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordAccessibility,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(_m(Ch.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class aVt extends OI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordStart,id:"cursorWordStartRight",precondition:void 0})}}class cVt extends OI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordEnd,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(s6,P6)?.negate()),primary:U.CtrlCmd|S.RightArrow,mac:{primary:U.Alt|S.RightArrow},weight:Ae.EditorContrib}})}}class lVt extends OI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordEnd,id:"cursorWordRight",precondition:void 0})}}class dVt extends OI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordStart,id:"cursorWordStartRightSelect",precondition:void 0})}}class hVt extends OI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordEnd,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(s6,P6)?.negate()),primary:U.CtrlCmd|U.Shift|S.RightArrow,mac:{primary:U.Alt|U.Shift|S.RightArrow},weight:Ae.EditorContrib}})}}class uVt extends OI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordEnd,id:"cursorWordRightSelect",precondition:void 0})}}class gVt extends OI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordAccessibility,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,r){return super._move(_m(Ch.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class fVt extends OI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordAccessibility,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(_m(Ch.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Vce extends uc{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(zs);if(!t.hasModel())return;const r=_m(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),a=t.getSelections(),c=t.getOption(x.autoClosingBrackets),l=t.getOption(x.autoClosingQuotes),d=n.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const p=this._delete({wordSeparators:r,model:o,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(x.autoClosingDelete),autoClosingBrackets:c,autoClosingQuotes:l,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new nd(p,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class PNe extends Vce{_delete(e,t){const i=us.deleteWordLeft(e,t);return i||new F(1,1,1,1)}}class FNe extends Vce{_delete(e,t){const i=us.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new F(n,r,n,r)}}class pVt extends PNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:fs.WordStart,id:"deleteWordStartLeft",precondition:J.writable})}}class mVt extends PNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:fs.WordEnd,id:"deleteWordEndLeft",precondition:J.writable})}}class _Vt extends PNe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:fs.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 vVt extends FNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:fs.WordStart,id:"deleteWordStartRight",precondition:J.writable})}}class bVt extends FNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:fs.WordEnd,id:"deleteWordEndRight",precondition:J.writable})}}class wVt extends FNe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:fs.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 yVt extends it{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=_m(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),r=t.getModel(),a=t.getSelections().map(c=>{const l=us.deleteInsideWord(n,r,c);return new nd(l,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Qe(new Z4t);Qe(new eVt);Qe(new tVt);Qe(new iVt);Qe(new nVt);Qe(new sVt);Qe(new aVt);Qe(new cVt);Qe(new lVt);Qe(new dVt);Qe(new hVt);Qe(new uVt);Qe(new rVt);Qe(new oVt);Qe(new gVt);Qe(new fVt);Qe(new pVt);Qe(new mVt);Qe(new _Vt);Qe(new vVt);Qe(new bVt);Qe(new wVt);Re(yVt);class CVt extends Vce{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:fs.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=vae.deleteWordPartLeft(e);return i||new F(1,1,1,1)}}class SVt extends Vce{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:fs.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=vae.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new F(n,r,n,r)}}class Sit extends Uce{_move(e,t,i,n,r){return vae.moveWordPartLeft(e,t,i,r)}}class AVt extends Sit{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordStart,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.LeftArrow},weight:Ae.EditorContrib}})}}vt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class EVt extends Sit{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.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}})}}vt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Ait extends Uce{_move(e,t,i,n,r){return vae.moveWordPartRight(e,t,i)}}class xVt extends Ait{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordEnd,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.RightArrow},weight:Ae.EditorContrib}})}}class DVt extends Ait{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.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 CVt);Qe(new SVt);Qe(new AVt);Qe(new EVt);Qe(new xVt);Qe(new DVt);const PFe=class PFe extends V{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Mh.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(x.readOnlyMessage);t||(this.editor.isSimpleWidget?t=new Nt(g(1606,"Cannot edit in read-only input")):t=new Nt(g(1607,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};PFe.ID="editor.contrib.readOnlyMessageController";let wZ=PFe;on(wZ.ID,wZ,ai.BeforeFirstInteraction);let lCe=class extends V{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Yt(this,void 0);const n=sd("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),r=sd("_textModel.onDidChangeContent",M.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(du(async(o,a)=>{n.read(o),r.read(o);const c=a.add(new E0t),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(r=>e.contains(r.range.startLineNumber)&&!e.contains(r.range.endLineNumber));return n.sort(GGe(Sc(r=>r.range.endLineNumber-r.range.startLineNumber,ru))),n.map(r=>({name:r.name,kind:r.kind,startLineNumber:r.range.startLineNumber}))}};lCe=D([_(1,nt),_(2,fG)],lCe);HJ.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(lCe,s));var kVt='.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}';gt(kVt,{});const FFe=class FFe extends V{constructor(e){super(),this.editor=e,this.widget=null,gm&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(x.readOnly);!this.widget&&e?this.widget=new dCe(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};FFe.ID="editor.contrib.iPadShowKeyboard";let yZ=FFe;const Fre=class Fre 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 Fre.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Vg.BOTTOM_RIGHT_CORNER}}};Fre.ID="editor.contrib.ShowKeyboardWidget";let dCe=Fre;on(yZ.ID,yZ,ai.Eventually);function hCe(s){return!!s.workspaceUri}function TQ(s){return!!s.folderUri}function IVt(s){return!!s.fileUri}function TVt(s){const e=LVt(s),t=s.getValue("window.menuBarVisibility");return t==="default"||e&&t==="compact"||jt&&ld?"classic":t}var T4e;(function(s){s.TITLE_BAR_STYLE="window.titleBarStyle",s.CUSTOM_TITLE_BAR_VISIBILITY="window.customTitleBarVisibility"})(T4e||(T4e={}));var Pw;(function(s){s.NATIVE="native",s.CUSTOM="custom"})(Pw||(Pw={}));var L4e;(function(s){s.AUTO="auto",s.WINDOWED="windowed",s.NEVER="never"})(L4e||(L4e={}));function LVt(s,e){return e||(e=ONe(s)),e===Pw.NATIVE}function ONe(s){if(Hn)return Pw.CUSTOM;const e=s.getValue("window");if(e){if(jt&&e.nativeTabs===!0||jt&&e.nativeFullScreen===!1)return Pw.NATIVE;const n=e.titleBarStyle;if(n===Pw.NATIVE||n===Pw.CUSTOM)return n}return mo?Pw.NATIVE:Pw.CUSTOM}function BNe(s){return{id:Eit(s),configPath:s}}function RVt(s){return{id:Eit(s),uri:s}}function Eit(s){return Hc(s.toString()).toString(16)}const uCe=60,gCe=uCe*60,C9=gCe*24,R4e=C9*7,M4e=C9*30,N4e=C9*365;function WNe(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}",WNe(new Date().getTime()+n*1e3,!1));if(n<30)return g(794,"now");let r;return n{await Promise.all(Fit.map(t=>t(e)))}),await s.invokeFunction(async e=>{UYe((t,i)=>s.createInstance(RM,t,i,{})),sJe(e.get(tc))}),await s.invokeFunction(async e=>{const t=e.get(rg);await Promise.all(Oit.map(i=>i(e))),t.phase=2}),await s.invokeFunction(async e=>{await Promise.all(Bit.map(t=>t(e)))}),UNe.open(),Pit.fire(),s.invokeFunction(async e=>{const t=e.get(rg);je.as(hf.Workbench).start(e),je.as(rC.EditorFactory).start(e),Rit.fire(e),Mit.fire(e),await Promise.race([e.get(NI).whenRestored,Ao(2e3)]),t.phase=3,new ln(()=>{FO(window,()=>{t.phase=4},2500)},2500).schedule()})}let Wit=!1;kt.withServices(()=>(Wit=!0,V.None));async function Hit(){await UNe.wait()}function Uit(){if(Wit)throw new Error("Services are already initialized")}const Vit="inQuickOpen",UVt=new Q(Vit,!1,g(4610,"Whether keyboard focus is inside the quick open control")),yC=he.has(Vit),VVt="inFilesPicker",zit=he.and(yC,he.has(VVt));function zce(s,e){return t=>{const i=t.get(Vt),n=t.get(Tn),o={keybindings:i.lookupKeybindings(s)};n.navigate(!!e,o)}}let P4e=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:_pt(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()}};P4e=D([_(0,ti),_(1,Pr)],P4e);let fCe=class extends LJ{constructor(e,t,i,n,r,o){super(t,n,r,o,e),this.keybindingService=i,this.inQuickInputContext=UVt.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})}};fCe=D([_(0,Te),_(1,we),_(2,Vt),_(3,Le),_(4,mn),_(5,_u)],fCe);function zVt(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class tz{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,r=[];for(const[o,a]of this.documents){if(t.isCancellationRequested)return[];for(const c of a.chunks){const l=this.computeSimilarityScore(c,i,n);l>0&&r.push({key:o,score:l})}}return r}static termFrequencies(e){return zVt(tz.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 r of n)r.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(r)&&(yield t(r))}}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 r=tz.termFrequencies(n);for(const o of r.keys())this.chunkOccurrences.set(o,(this.chunkOccurrences.get(o)??0)+1);i.push({text:n,tf:r})}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 r=this.chunkOccurrences.get(n);if(typeof r=="number"){const o=r-1;o<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,o)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[r,o]of Object.entries(t)){const a=e.tf.get(r);if(!a)continue;let c=i.get(r);typeof c!="number"&&(c=this.computeIdf(r),i.set(r,c));const l=a*c;n+=l*o}return n}computeEmbedding(e){const t=tz.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 r=this.computeIdf(i);r>0&&(t[i]=n*r)}return t}}function $Vt(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 MS;(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"})(MS||(MS={}));function Iue(s){const e=s;return Array.isArray(e.items)}function F4e(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class zNe 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 r;const o=n.add(new yn),a=async()=>{const l=o.value=new Z;r?.dispose(!0),e.busy=!1,r=new li(t);const d=r.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(Iue(m)?(b=m.items,w=m.active):b=m,b.length===0){if(v)return!1;(h.length>0||e.hideInput)&&this.options?.noResultsPick&&(I2(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 Ao(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;Iue(m.picks)?(y=m.picks.items,C=m.picks.active):y=m.picks;let A,L;if(Iue(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(F4e(u))await p(u);else if(!(u instanceof Promise))f(u);else{e.busy=!0;try{const m=await u;if(d.isCancellationRequested)return;F4e(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 MS.NO_ACTION:break;case MS.CLOSE_PICKER:e.hide();break;case MS.REFRESH_PICKER:a();break;case MS.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 _0,sa,ay;let pCe=(ay=class extends zNe{constructor(e,t,i,n,r,o){super(_0.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=r,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance(S9)),this.options=e}async _getPicks(e,t,i,n){const r=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const o=fm(()=>{const f=new tz;f.updateDocuments(r.map(m=>({key:m.commandId,textChunks:[this.getTfIdfChunk(m)]})));const p=f.calculateScores(e,i);return $Vt(p).filter(m=>m.score>_0.TFIDF_THRESHOLD).slice(0,_0.TFIDF_MAX_RESULTS)}),a=[];for(const f of r){const p=_0.WORD_FILTER(e,f.label)??void 0,m=f.commandAlias?_0.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=o();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(r,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(r){Oo(r)||this.dialogService.error(g(4616,"Command '{0}' resulted in an error",e.label),Po(r))}}}}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}},_0=ay,ay.PREFIX=">",ay.TFIDF_THRESHOLD=.5,ay.TFIDF_MAX_RESULTS=5,ay.WORD_FILTER=eW(kM,PE,Iae),ay);pCe=_0=D([_(1,we),_(2,Vt),_(3,bi),_(4,Ji),_(5,ir)],pCe);var nb;let S9=(nb=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===Ay.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=sa.getConfiguredCommandHistoryLength(this.configurationService),sa.cache&&sa.cache.limit!==this.configuredCommandsHistoryLength&&(sa.cache.limit=this.configuredCommandsHistoryLength,sa.hasChanges=!0))}load(){const e=this.storageService.get(sa.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=sa.cache=new pm(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((r,o)=>r.value-o.value),n.forEach(r=>i.set(r.key,r.value))}sa.counter=this.storageService.getNumber(sa.PREF_KEY_COUNTER,Ie.PROFILE,sa.counter)}push(e){sa.cache&&(sa.cache.set(e,sa.counter++),sa.hasChanges=!0)}peek(e){return sa.cache?.peek(e)}saveState(){if(!sa.cache||!sa.hasChanges)return;const e={usesLRU:!0,entries:[]};sa.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(sa.PREF_KEY_CACHE,JSON.stringify(e),Ie.PROFILE,cn.USER),this.storageService.store(sa.PREF_KEY_COUNTER,sa.counter,Ie.PROFILE,cn.USER),sa.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const i=e.getValue().workbench?.commandPalette?.history;return typeof i=="number"?i:sa.DEFAULT_COMMANDS_HISTORY_LENGTH}static clearHistory(e,t){const i=sa.getConfiguredCommandHistoryLength(e);sa.cache=new pm(i),sa.counter=1,sa.hasChanges=!0}},sa=nb,nb.DEFAULT_COMMANDS_HISTORY_LENGTH=50,nb.PREF_KEY_CACHE="commandPalette.mru.cache",nb.PREF_KEY_COUNTER="commandPalette.mru.counter",nb.counter=1,nb.hasChanges=!1,nb);S9=sa=D([_(0,Gi),_(1,Te),_(2,Ke)],S9);class GVt extends pCe{constructor(e,t,i,n,r,o){super(e,t,i,n,r,o)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let n;i.metadata?.description&&(vRe(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:Tae(i.label)||i.id})}return t}}class Ub extends EXe{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 xi.Readonly}hasCapability(e){return e===xi.None?this.capabilities===xi.None:(this.capabilities&e)!==0}isReadonly(){return this.hasCapability(xi.Readonly)}getName(){return`Editor ${this.typeId}`}getDescription(e){}getTitle(e){return this.getName()}getLabelExtraClasses(){return[]}getAriaLabel(){return this.getTitle(Rs.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(ya(e))return this===e;const t=e.options?.override;return this.editorId!==t&&t!==void 0&&this.editorId!==void 0?!1:Yi(this.resource,Pa.getCanonicalUri(e))}prefersEditorPane(e){return um(e)}toUntyped(e){}isDisposed(){return this._store.isDisposed}dispose(){this.isDisposed()||this._onWillDispose.fire(),super.dispose()}}class KVt{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 qVt extends V{constructor(e){super(),this.counter=0,this.logger=e.createLogger("network",{name:g(4590,"Network Requests"),when:KCt.isEqualTo(f3(Kn.Trace)).serialize()})}async logAndRequest(e,t,i){const n=`${e} #${++this.counter}: ${t.url}`;this.logger.trace(`${n} - begin`,t.type,new KVt(t.headers??{}));try{const r=await i();return this.logger.trace(`${n} - end`,t.type,r.res.statusCode,r.res.headers),r}catch(r){throw this.logger.error(`${n} - error`,t.type,ou(r)),r}}}function $it(s){return s.res.statusCode&&s.res.statusCode>=200&&s.res.statusCode<300||s.res.statusCode===1223}function Git(s){return s.res.statusCode===204}async function QVt(s){return Git(s)?null:(await oD(s.stream)).toString()}async function jVt(s){if(!$it(s))throw new Error("Server returned "+s.res.statusCode);return QVt(s)}async function YVt(s){if(!$it(s))throw new Error("Server returned "+s.res.statusCode);if(Git(s))return null;const t=(await oD(s.stream)).toString();try{return JSON.parse(t)}catch(i){throw i.message+=`: +`)};const o=await r.provideRenameEdits(this.model,this.position,e,n);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(g(1543,"No result.")),n);return o}}async function s4t(s,e,t,i){const n=new INe(e,t,s),r=await n.resolveRenameLocation(Ue.None);return r?.rejectReason?{edits:[],rejectReason:r.rejectReason}:n.provideRenameEdits(i,Ue.None)}var aR;let cI=(aR=class{static get(e){return e.getContribution(Uye.ID)}constructor(e,t,i,n,r,o,a,c,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=r,this._logService=o,this._configService=a,this._languageFeaturesService=c,this._telemetryService=l,this._disposableStore=new Z,this._cts=new li,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(Hye,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 li,!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 nI(this.editor,jr.Position|jr.Value,void 0,this._cts.token);let r;try{e("resolving rename location");const p=i.resolveRenameLocation(n.token);this._progressService.showWhile(p,250),r=await p,e("resolved rename location")}catch(p){p instanceof Pa?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"||ud(p))&&Mh.get(this.editor)?.showMessage(p||g(1544,"An unknown error occurred while resolving rename location"),t));return}finally{n.dispose()}if(!r){e("returning early - no loc");return}if(r.rejectReason){e(`returning early - rejected with reason: ${r.rejectReason}`,r.rejectReason),Mh.get(this.editor)?.showMessage(r.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const o=new nI(this.editor,jr.Position|jr.Value,r.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===CM.Automatic&&(v=v.filter(([b,w])=>w)),v.map(([b])=>b.provideNewSymbolNames(a,r.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(r.range,r.text,h,c.length>0?d:void 0,o);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(),o.dispose();return}this.editor.focus(),e("requesting rename edits");const f=$_(i.provideRenameEdits(u.newName,o.token),o.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}'",r?.text,u.newName),code:"undoredo.rename",quotableLabel:g(1546,"Renaming {0} to {1}",r?.text,u.newName),respectAutoSaveConfig:!0}).then(m=>{e("edits applied"),m.ariaSummary&&No(g(1547,"Successfully renamed '{0}' to '{1}'. Summary: {2}",r.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(()=>{o.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)}},Uye=aR,aR.ID="editor.contrib.renameController",aR);cI=Uye=D([_(1,we),_(2,wi),_(3,UN),_(4,nE),_(5,Ke),_(6,xc),_(7,nt),_(8,Ji)],cI);class r4t extends it{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(qt),[n,r]=Array.isArray(t)&&t||[void 0,void 0];return N.isUri(n)&&re.isIPosition(r)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(r),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},bt):super.runCommand(e,t)}run(e,t){const i=e.get(Ke),n=cI.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}on(cI.ID,cI,ai.Lazy);Re(r4t);const TNe=uc.bindToContribution(cI.get);Qe(new TNe({id:"acceptRenameInput",precondition:t4,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:he.and(J.focus,he.not("isComposing")),primary:S.Enter}}));Qe(new TNe({id:"acceptRenameInputWithPreview",precondition:he.and(t4,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 TNe({id:"cancelRenameInput",precondition:t4,handler:s=>s.cancelRenameInput(),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));Et(class extends di{constructor(){super({id:"focusNextRenameSuggestion",title:{...Pe(1551,"Focus Next Rename Suggestion")},precondition:t4,keybinding:[{primary:S.DownArrow,weight:Ae.EditorContrib+99}]})}run(e){const t=e.get(qt).getFocusedCodeEditor();if(!t)return;const i=cI.get(t);i&&i.focusNextRenameSuggestion()}});Et(class extends di{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Pe(1552,"Focus Previous Rename Suggestion")},precondition:t4,keybinding:[{primary:S.UpArrow,weight:Ae.EditorContrib+99}]})}run(e){const t=e.get(qt).getFocusedCodeEditor();if(!t)return;const i=cI.get(t);i&&i.focusPreviousRenameSuggestion()}});lg("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;Lt(typeof n=="string");const{renameProvider:r}=s.get(nt);return s4t(r,e,t,n)});lg("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(nt),r=await new INe(e,t,i).resolveRenameLocation(Ue.None);if(r?.rejectReason)throw new Error(r.rejectReason);return r});je.as(Pn.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:ct.LANGUAGE_OVERRIDABLE,description:g(1553,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var KB;let fZ=(KB=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 r=this.editor.getModel()?.getLanguageId();r&&n.affects(r)&&(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 ln(()=>{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(r=>{if(!r.shouldBeInComments)return!0;const o=t.validateRange(r.range),a=t.tokenization.getLineTokens(o.startLineNumber),c=a.findTokenIndexAtOffset(o.startColumn-1),l=a.getStandardTokenType(c);return a.getLanguageId(c)===t.getLanguageId()&&l===no.Comment}));const i=Object.values(this.currentOccurrences).map(r=>r.decorationId),n=e.map(r=>o4t(r));this.editor.changeDecorations(r=>{const o=r.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,c=o.length;a0&&(h=e.subarray(t,t+d),t+=d),o[a]={start:c,deleteCount:l,data:h}}return{id:i,type:"delta",deltas:o}}function Bce(s){return s&&!!s.data}function cit(s){return s&&Array.isArray(s.edits)}class d4t{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function lit(s,e){return s.has(e)}function h4t(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function dit(s,e,t,i,n){const r=h4t(s,e),o=await Promise.all(r.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||!Bce(c)&&!cit(c))&&(c=null),new d4t(a,c,l)}));for(const a of o){if(a.error)throw a.error;if(a.tokens)return a}return o.length>0?o[0]:null}function u4t(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class g4t{constructor(e,t){this.provider=e,this.tokens=t}}function f4t(s,e){return s.has(e)}function hit(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function LNe(s,e,t,i){const n=hit(s,e),r=await Promise.all(n.map(async o=>{let a;try{a=await o.provideDocumentRangeSemanticTokens(e,t,i)}catch(c){Nr(c),a=null}return(!a||!Bce(a))&&(a=null),new g4t(o,a)}));for(const o of r)if(o.tokens)return o;return r.length>0?r[0]:null}vt.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;Lt(t instanceof N);const i=s.get(fi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(nt),r=u4t(n,i);return r?r[0].getLegend():s.get(bi).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});vt.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;Lt(t instanceof N);const i=s.get(fi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(nt);if(!lit(n,i))return s.get(bi).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const r=await dit(n,i,null,null,Ue.None);if(!r)return;const{provider:o,tokens:a}=r;if(!a||!Bce(a))return;const c=v9({id:0,type:"full",data:a.data});return a.resultId&&o.releaseDocumentSemanticTokens(a.resultId),c});vt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;Lt(t instanceof N);const n=s.get(fi).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(nt),o=hit(r,n);if(o.length===0)return;if(o.length===1)return o[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"),o[0].getLegend();const a=await LNe(r,n,F.lift(i),Ue.None);if(a)return a.provider.getLegend()});vt.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;Lt(t instanceof N),Lt(F.isIRange(i));const n=s.get(fi).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(nt),o=await LNe(r,n,F.lift(i),Ue.None);if(!(!o||!o.tokens))return v9({id:0,type:"full",data:o.tokens.data})});const RNe="editor.semanticHighlighting";function IQ(s,e,t){const i=t.getValue(RNe,{overrideIdentifier:s.getLanguageId(),resource:s.uri})?.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var kE;let Vye=class extends V{constructor(e,t,i,n,r,o){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new zye(d,e,i,r,o)},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()];IQ(d,i,n)?h||a(d):h&&c(d,h)}};t.getModels().forEach(d=>{IQ(d,i,n)&&a(d)}),this._register(t.onModelAdded(d=>{IQ(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(RNe)&&l()})),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};Vye=D([_(0,Dae),_(1,fi),_(2,mn),_(3,Te),_(4,xp),_(5,nt)],Vye);var ok;let zye=(ok=class extends V{constructor(e,t,i,n,r){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:kE.REQUEST_MIN_DELAY,max:kE.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new ln(()=>this._fetchDocumentSemanticTokensNow(),kE.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 o=()=>{wt(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)}))};o(),this._register(this._provider.onDidChange(()=>{o(),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),wt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!lit(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new li,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=dit(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const r=[],o=this._model.onDidChangeContent(c=>{r.push(c)}),a=new Ys(!1);n.then(c=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),!c)this._setDocumentSemanticTokens(null,null,null,r);else{const{provider:l,tokens:d}=c,h=this._semanticTokensStylingService.getStyling(l);this._setDocumentSemanticTokens(l,d||null,h,r)}},c=>{c&&(Oo(c)||typeof c.message=="string"&&c.message.indexOf("busy")!==-1)||bt(c),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(r.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,r){r=Math.min(r,i.length-n,e.length-t);for(let o=0;o{(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),o();return}if(cit(t)){if(!r){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:r.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const c=r.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(r.resultId,t.resultId,u,f.start,c.length),this._model.tokenization.setSemanticTokens(null,!0);return}const p=d-(f.start+f.deleteCount);p>0&&(kE._copy(c,d-p,l,h-p,p),h-=p),f.data&&(kE._copy(f.data,0,l,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&kE._copy(c,0,l,0,d),t={resultId:t.resultId,data:l}}}if(Bce(t)){this._currentDocumentResponse=new p4t(e,t.resultId,t.data);const a=Vje(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);o()}},kE=ok,ok.REQUEST_MIN_DELAY=300,ok.REQUEST_MAX_DELAY=2e3,ok);zye=kE=D([_(1,Dae),_(2,mn),_(3,xp),_(4,nt)],zye);class p4t{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}aG(Vye);var $ye,cR;let VW=(cR=class extends V{static get(e){return e.getContribution($ye.ID)}constructor(e,t,i,n,r,o){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new ln(()=>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(RNe)&&(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=Mo(o=>Promise.resolve(LNe(this._provider,e,t,o))),r=new Ys(!1);return n.then(o=>{if(this._debounceInformation.update(e,r.elapsed()),!o||!o.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:c}=o,l=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,Vje(c,l,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},$ye=cR,cR.ID="editor.contrib.viewportSemanticTokens",cR);VW=$ye=D([_(1,Dae),_(2,mn),_(3,Te),_(4,xp),_(5,nt)],VW);on(VW.ID,VW,ai.AfterFirstRender);class m4t{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const r=[];i.push(r),this.selectSubwords&&this._addInWordRanges(r,e,n),this._addWordRanges(r,e,n),this._addWhitespaceLine(r,e,n),r.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:r,startColumn:o}=n,a=i.column-o;let c=a,l=a,d=0;for(;c>=0;c--){const h=r.charCodeAt(c);if(c!==a&&(h===B.Underline||h===B.Dash))break;if(Ex(h)&&Uw(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 Gye;class MNe{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 MNe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var lR;let tN=(lR=class{static get(e){return e.getContribution(Gye.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 git(this._languageFeaturesService.selectionRangeProvider,i,t.map(r=>r.getPosition()),this._editor.getOption(x.smartSelect),Ue.None).then(r=>{if(!(!tr(r)||r.length!==t.length)&&!(!this._editor.hasModel()||!ns(this._editor.getSelections(),t,(o,a)=>o.equalsSelection(a)))){for(let o=0;oa.containsPosition(t[o].getStartPosition())&&a.containsPosition(t[o].getEndPosition())),r[o].unshift(t[o]);this._state=r.map(o=>new MNe(0,o)),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(r=>r.mov(e));const n=this._state.map(r=>ht.fromPositions(r.ranges[r.index].getStartPosition(),r.ranges[r.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},Gye=lR,lR.ID="editor.contrib.smartSelectController",lR);tN=Gye=D([_(1,nt)],tN);class uit extends it{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=tN.get(t);i&&await i.run(this._forward)}}class _4t extends uit{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}})}}vt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class v4t extends uit{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(tN.ID,tN,ai.Lazy);Re(_4t);Re(v4t);async function git(s,e,t,i,n){const r=s.all(e).concat(new m4t(i.selectSubwords));r.length===1&&r.unshift(new yX);const o=[],a=[];for(const c of r)o.push(Promise.resolve(c.provideSelectionRanges(e,t,n)).then(l=>{if(tr(l)&&l.length===t.length)for(let d=0;d{if(c.length===0)return[];c.sort((u,f)=>re.isBefore(u.getStartPosition(),f.getStartPosition())?1:re.isBefore(f.getStartPosition(),u.getStartPosition())||re.isBefore(u.getEndPosition(),f.getEndPosition())?-1:re.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}),Due="data-sticky-line-index",k4e="data-sticky-is-line",w4t="data-sticky-is-line-number",I4e="data-sticky-is-folding-icon";class y4t 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 uf),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),r=n?void 0:e,o=n?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(r,t,o),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(r=>!i.startLineNumbers.includes(r));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 r=this._editor._getViewModel();if(!r)return;const o=r.coordinatesConverter.convertModelPositionToViewPosition(new re(t,1)).lineNumber,a=r.getViewLineRenderingData(o),c=this._editor.getOption(x.lineNumbers);let l;try{l=iu.filter(a.inlineDecorations,o,a.minColumn,a.maxColumn)}catch{l=[]}const d=new DI(!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 kU(2e3),u=p6(d,h);let f;D4e?f=D4e.createHTML(h.build()):f=h.build();const p=document.createElement("span");p.setAttribute(Due,String(e)),p.setAttribute(k4e,""),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(Due,String(e)),m.setAttribute(w4t,""),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===yo.On||c.renderType===yo.Interval&&t%10===0?b.innerText=t.toString():c.renderType===yo.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 C4t(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,r=t===this._lineNumbers.length-1,o="0",a="1";i.style.zIndex=r?o:a,n.style.zIndex=r?o:a;const c=`${t*this._lineHeight+this._lastLineRelativePosition+(e.foldingIcon?.isCollapsed?1:0)}px`,l=`${t*this._lineHeight}px`;return i.style.top=r?c:l,n.style.top=r?c:l,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(x.showFoldingControls);if(!e||i==="never")return;const n=e.regions,r=n.findRange(t),o=n.getStartLineNumber(r);if(!(t===o))return;const c=n.isCollapsed(r),l=new S4t(c,o,n.getEndLineNumber(r),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:Vg.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=uLe(t.characterMapping,e,0);return new re(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,Due);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,k4e)!==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 C4t{constructor(e,t,i,n,r,o,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=r,this.characterMapping=o,this.scrollWidth=a}}class S4t{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=He.asClassName(e?KJ:GJ)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class Z5{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class mZ{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class fit{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var ez;(function(s){s.OUTLINE_MODEL="outlineModel",s.FOLDING_PROVIDER_MODEL="foldingProviderModel",s.INDENTATION_MODEL="indentationModel"})(ez||(ez={}));var zx;(function(s){s[s.VALID=0]="VALID",s[s.INVALID=1]="INVALID",s[s.CANCELED=2]="CANCELED"})(zx||(zx={}));let Kye=class extends V{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Ph(300)),this._updateOperation=this._register(new Z),this._editor.getOption(x.stickyScroll).defaultModel){case ez.OUTLINE_MODEL:this._modelProviders.push(new qye(this._editor,n));case ez.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new jye(this._editor,t,n));case ez.INDENTATION_MODEL:this._modelProviders.push(new Qye(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 r=await i;if(this._modelPromise!==n)return null;switch(r){case zx.CANCELED:return this._updateOperation.clear(),null;case zx.VALID:return t.stickyModel}}return null}).catch(t=>(bt(t),null))}};Kye=D([_(2,we),_(3,nt)],Kye);class pit extends V{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,zx.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Mo(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?zx.CANCELED:(this._stickyModel=this.createStickyModel(e,i),zx.VALID):this._invalid()).then(void 0,i=>(bt(i),zx.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let qye=class extends pit{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Nw.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),r=this._editor.getModel();return new fit(r.uri,r.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(ui.first(e.children.values())instanceof Xwe){const a=ui.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=[],r=Array.from(i.values()).sort((a,c)=>{const l=new Z5(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new Z5(c.symbol.range.startLineNumber,c.symbol.range.endLineNumber);return this._comparator(l,d)});for(const a of r)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new mZ(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const r of e.children.values())if(r.symbol.selectionRange.startLineNumber!==r.symbol.range.endLineNumber)if(r.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(r,r.symbol.selectionRange.startLineNumber));else for(const o of r.children.values())i.push(this._stickyModelFromOutlineElement(o,r.symbol.selectionRange.startLineNumber));i.sort((r,o)=>this._comparator(r.range,o.range));const n=new Z5(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new mZ(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 Jwe?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};qye=D([_(1,nt)],qye);class mit extends pit{constructor(e){super(e),this._foldingLimitReporter=new CXe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new fit(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new mZ(void 0,[],void 0);for(let r=0;r0&&(this.provider=this._register(new lMe(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){return this.provider?.compute(e)??null}};jye=D([_(2,nt)],jye);class A4t{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}var qB;let Yye=(qB=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 ln(()=>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 Kye(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new li,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,r){if(t.children.length===0)return;let o=r;const a=[];for(let d=0;dd-h)),l=this.updateIndex(k2(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!==o&&(o=u,i.push(new A4t(u,f-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n+1,u))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n,r)}}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(r=>!(r.startLineNumber>=n.startLineNumber&&r.endLineNumber<=n.endLineNumber+1));return t}},qB.ID="store.contrib.stickyScrollController",qB);Yye=D([_(1,nt),_(2,zs)],Yye);var Jye,dR;let GA=(dR=class extends V{constructor(e,t,i,n,r,o,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 y4t(this._editor),this._stickyLineCandidateProvider=new Yye(this._editor,i,r),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=X5.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(lt(c),d)})),this._stickyScrollFocusedContextKey=J.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=J.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(Ec(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(Jye.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,_t.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 Tce(this._editor,{extractLineNumberFromMouseEvent:r=>{const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);return o?o.lineNumber:0}})),i=r=>{if(!this._editor.hasModel()||r.target.type!==Mt.OVERLAY_WIDGET||r.target.detail!==this._stickyScrollWidget.getId())return null;const o=r.target.element;if(!o||o.innerText!==o.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(o);return a?{range:new F(a.lineNumber,a.column,a.lineNumber,a.column+o.innerText.length),textElement:o}:null},n=this._stickyScrollWidget.getDomNode();this._register(Rr(n,ke.CLICK,r=>{if(r.ctrlKey||r.altKey||r.metaKey||!r.leftButton)return;if(r.shiftKey){const l=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(l===null)return;const d=new re(this._endLineNumbers[l],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(r.target)){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);this._toggleFoldingRegionForLine(l);return}if(!this._stickyScrollWidget.isInStickyLine(r.target))return;let c=this._stickyScrollWidget.getEditorPositionFromNode(r.target);if(!c){const l=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);if(l===null)return;c=new re(l,1)}this._revealPosition(c)})),this._register(Rr(n,ke.MOUSE_MOVE,r=>{if(r.shiftKey){const o=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(o===null||this._showEndForLine!==null&&this._showEndForLine===o)return;this._showEndForLine=o,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(ue(n,ke.MOUSE_LEAVE,r=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([r,o])=>{const a=i(r);if(!a||!r.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 li;e.add(Ee(()=>d.dispose(!0)));let h;lG(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new re(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 r=>{if(r.target.type!==Mt.OVERLAY_WIDGET||r.target.detail!==this._stickyScrollWidget.getId())return;const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);o&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:o.lineNumber,column:1})),this._instaService.invokeFunction(vtt,r,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new Dh(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;rMe(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===yo.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 o=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(o)||(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 PA.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=X5.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 r=[],o=[],a=this._editor.getVisibleRanges();if(a.length!==0){const c=new Z5(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){r.push(h),o.push(u+1),n=w-m;break}else m>v&&m<=w&&(r.push(h),o.push(u+1));if(r.length===t)break}}}return this._endLineNumbers=o,new X5(r,o,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},Jye=dR,dR.ID="store.contrib.stickyScrollController",dR);GA=Jye=D([_(1,lo),_(2,nt),_(3,we),_(4,zs),_(5,xp),_(6,Le)],GA);class E4t extends di{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:la.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 Wce=Ae.EditorContrib;class x4t extends mf{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){GA.get(t)?.focus()}}class D4t extends mf{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Pe(5224,"Select the next editor sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Wce,primary:S.DownArrow}})}runEditorCommand(e,t){GA.get(t)?.focusNext()}}class k4t extends mf{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Pe(5225,"Select the previous sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Wce,primary:S.UpArrow}})}runEditorCommand(e,t){GA.get(t)?.focusPrevious()}}class I4t extends mf{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Pe(5226,"Go to the focused sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Wce,primary:S.Enter}})}runEditorCommand(e,t){GA.get(t)?.goToFocused()}}class T4t extends mf{constructor(){super({id:"editor.action.selectEditor",title:Pe(5227,"Select Editor"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Wce,primary:S.Escape}})}runEditorCommand(e,t){GA.get(t)?.selectEditor()}}on(GA.ID,GA,ai.AfterFirstRender);Et(E4t);Et(x4t);Et(k4t);Et(D4t);Et(I4t);Et(T4t);class L4t{constructor(e,t,i,n,r,o){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=r,this.completion=o}}let Xye=class extends bTe{constructor(e,t,i,n,r,o){super(r.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=o}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(Ue.None)}return e}};Xye=D([_(5,kce)],Xye);let Zye=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 r;for(const f of this._editorService.listCodeEditors())if(f.getModel()===e){r=f;break}if(!r)return;const o=r.getOption(x.quickSuggestions);if(CF.isAllOff(o))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(CF.valueFor(o,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 kUe(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),h=this._lastResult}else{const f=await zMe(this._languageFeatureService.completionProvider,e,t,new Z3(void 0,SX.createSuggestFilter(r).itemKind,d?.providers),d&&{triggerKind:ju.TriggerCharacter,triggerCharacter:d.ch},n);let p;f.needsClipboard&&(p=await this._clipboardService.readText());const m=new lx(f.items,t.column,new kUe(u,0),CX.None,r.getOption(x.suggest),r.getOption(x.snippetSuggestions),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new Xye(e,t.lineNumber,l,m,f,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(Ue.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 r of this._languageFeatureService.completionProvider.all(e))r.triggerCharacters?.includes(i)&&n.add(r);if(n.size!==0)return{providers:n,ch:i}}};Zye=D([_(0,nt),_(1,gg),_(2,kce),_(3,qt)],Zye);aG(Zye);class R4t extends it{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 Ys;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Re(R4t);var M4t=".monaco-editor .unicode-highlight{background-color:var(--vscode-editorUnicodeHighlight-background);border:1px solid var(--vscode-editorUnicodeHighlight-border);box-sizing:border-box}";gt(M4t,{});var N4t=".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)}";gt(N4t,{});const P4t=26;let eCe=class extends V{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(tCe))}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,P4t)}};eCe=D([_(1,we)],eCe);let tCe=class extends V{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Z_,{}),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(){Ns(this.element)}show(e){Ns(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=oe(this.element,fe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(fe(`div${He.asCSSSelector(e.icon)}`));const n=oe(this.element,fe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=oe(this.element,fe("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(d9,this.messageActionsContainer,{...o,tabIndex:-1},{}));const r=oe(this.element,fe("div.action-container"));this.actionBar=this._register(new gd(r)),this.actionBar.push(this._register(new an("banner.close","Close Banner",He.asClassName(QJe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};tCe=D([_(0,we)],tCe);const F4t=oi("extensions-warning-message",ve.warning,g(1574,"Icon shown with a warning message in the extensions editor."));var QB;let b9=(QB=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=r=>{if(r&&r.hasMore){if(this._bannerClosed)return;const o=Math.max(r.ambiguousCharacterCount,r.nonBasicAsciiCharacterCount,r.invisibleCharacterCount);let a;if(r.nonBasicAsciiCharacterCount>=o)a={message:g(1575,"This document contains many non-basic ASCII unicode characters"),command:new y9};else if(r.ambiguousCharacterCount>=o)a={message:g(1576,"This document contains many ambiguous unicode characters"),command:new iN};else if(r.invisibleCharacterCount>=o)a={message:g(1577,"This document contains many invisible unicode characters"),command:new w9};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:F4t,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(eCe,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(x.unicodeHighlighting),this._register(i.onDidChangeTrust(r=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(r=>{r.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=O4t(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"?jl:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new iCe(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new B4t(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},QB.ID="editor.contrib.unicodeHighlighter",QB);b9=D([_(1,Fl),_(2,mC),_(3,we)],b9);function O4t(s,e){return{nonBasicASCII:e.nonBasicASCII===Lf?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Lf?!s:e.includeComments,includeStrings:e.includeStrings===Lf?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let iCe=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 ln(()=>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:_Z.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!VLe(t,e))return null;const i=t.getValueInRange(e.range);return{reason:vit(i,this._options),inComment:zLe(t,e),inString:$Le(t,e)}}};iCe=D([_(3,Fl)],iCe);class B4t 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 ln(()=>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 r=KTe.computeUnicodeHighlights(this._model,this._options,n);for(const o of r.ranges)i.ranges.push(o);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||r.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:_Z.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 VLe(t,e)?{reason:vit(i,this._options),inComment:zLe(t,e),inString:$Le(t,e)}:null}}const _it=g(1578,"Configure Unicode Highlight Options");let nCe=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!==uu.Range)return[];const i=this._editor.getModel(),n=this._editor.getContribution(b9.ID);if(!n)return[];const r=[],o=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=kue(h);let f;switch(l.reason.kind){case A_.Ambiguous:{X7(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,kue(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,kue(l.reason.confusableWith.codePointAt(0)));break}case A_.Invisible:f=g(1581,"The character {0} is invisible.",u);break;case A_.NonBasicAscii:f=g(1582,"The character {0} is not a basic ASCII character.",u);break}if(o.has(f))continue;o.add(f);const p={codePoint:h,reason:l.reason,inComment:l.inComment,inString:l.inString},m=g(1583,"Adjust settings"),v=`command:${vZ.ID}?${encodeURIComponent(JSON.stringify(p))}`,b=new Nt("",!0).appendMarkdown(f).appendText(" ").appendLink(v,m,_it);r.push(new b_(this,c.range,[b],!1,a++))}return r}renderHoverParts(e,t){return fOt(e,t,this._editor,this._languageService,this._openerService)}getAccessibleContent(e){return e.contents.map(t=>t.value).join(` +`)}};nCe=D([_(1,Di),_(2,Ar)],nCe);function sCe(s){return`U+${s.toString(16).padStart(4,"0")}`}function kue(s){let e=`\`${sCe(s)}\``;return yT.isInvisibleCharacter(s)||(e+=` "${`${W4t(s)}`}"`),e}function W4t(s){return s===B.BackTick?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function vit(s,e){return KTe.computeUnicodeHighlightReason(s,e)}const Lre=class Lre{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=Kt.createDynamic({description:"unicode-highlight",stickiness:si.NeverGrowsWhenTypingAtEdges,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};Lre.instance=new Lre;let _Z=Lre;const MFe=class MFe extends it{constructor(){super({id:iN.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(Pu.includeComments,!1,At.USER)}};MFe.ID="editor.action.unicodeHighlight.disableHighlightingInComments";let rCe=MFe;const NFe=class NFe extends it{constructor(){super({id:iN.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(Pu.includeStrings,!1,At.USER)}};NFe.ID="editor.action.unicodeHighlight.disableHighlightingInStrings";let oCe=NFe;const Rre=class Rre extends it{constructor(){super({id:Rre.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(Pu.ambiguousCharacters,!1,At.USER)}};Rre.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let iN=Rre;const Mre=class Mre extends it{constructor(){super({id:Mre.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(Pu.invisibleCharacters,!1,At.USER)}};Mre.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let w9=Mre;const Nre=class Nre extends it{constructor(){super({id:Nre.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(Pu.nonBasicASCII,!1,At.USER)}};Nre.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let y9=Nre;const Pre=class Pre extends it{constructor(){super({id:Pre.ID,label:g(1594,"Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:r,inString:o,inComment:a}=i,c=String.fromCodePoint(n),l=e.get(Tn),d=e.get(Te);function h(p){return yT.isInvisibleCharacter(p)?g(1595,"Exclude {0} (invisible character) from being highlighted",sCe(p)):g(1596,"Exclude {0} from being highlighted",`${sCe(p)} "${c}"`)}const u=[];if(r.kind===A_.Ambiguous)for(const p of r.notAmbiguousInLocales)u.push({label:g(1597,'Allow unicode characters that are more common in the language "{0}".',p),run:async()=>{U4t(d,[p])}});if(u.push({label:h(n),run:()=>H4t(d,[n])}),a){const p=new rCe;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o){const p=new oCe;u.push({label:p.label,run:async()=>p.runAction(d)})}if(r.kind===A_.Ambiguous){const p=new iN;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(r.kind===A_.Invisible){const p=new w9;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(r.kind===A_.NonBasicAscii){const p=new y9;u.push({label:p.label,run:async()=>p.runAction(d)})}else V4t(r);const f=await l.pick(u,{title:_it});f&&await f.run()}};Pre.ID="editor.action.unicodeHighlight.showExcludeOptions";let vZ=Pre;async function H4t(s,e){const t=s.getValue(Pu.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(Pu.allowedCharacters,i,At.USER)}async function U4t(s,e){const t=s.inspect(Pu.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(Pu.allowedLocales,i,At.USER)}function V4t(s){throw new Error(`Unexpected value: ${s}`)}Re(iN);Re(w9);Re(y9);Re(vZ);on(b9.ID,b9,ai.AfterFirstRender);JN.register(nCe);const bit="ignoreUnusualLineTerminators";function z4t(s,e,t){s.setModelProperty(e.uri,bit,t)}function $4t(s,e){return s.getModelProperty(e.uri,bit)}var jB;let bZ=(jB=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()||$4t(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`.",vi(e.uri)),primaryButton:g(1601,"&&Remove Unusual Line Terminators"),cancelButton:g(1602,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){z4t(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},jB.ID="editor.contrib.unusualLineTerminatorsDetector",jB);bZ=D([_(1,ir),_(2,qt)],bZ);on(bZ.ID,bZ,ai.AfterFirstRender);var vc,aCe;const Hce=new Q("hasWordHighlights",!1);function wit(s,e,t,i){const n=s.ordered(e);return eae(n.map(r=>()=>Promise.resolve(r.provideDocumentHighlights(e,t,i)).then(void 0,Nr)),tr).then(r=>{if(r){const o=new gi;return o.set(e.uri,r),o}return new gi})}function G4t(s,e,t,i,n,r){const o=s.ordered(e);return eae(o.map(a=>()=>{const c=r.filter(l=>Py(l)).filter(l=>kae(a.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,c,n)).then(void 0,Nr)}),a=>a instanceof gi&&a.size>0)}class NNe{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=Mo(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,r=t.startColumn,o=t.endColumn,a=this._getCurrentWordRange(e,t);let c=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let l=0,d=i.length;!c&&l=o&&(c=!0)}return c}cancel(){this.result.cancel()}}class K4t extends NNe{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return wit(this._providers,e,t.getPosition(),n).then(r=>r||new gi)}}class q4t extends NNe{constructor(e,t,i,n,r){super(e,t,i),this._providers=n,this._otherModels=r}_compute(e,t,i,n){return G4t(this._providers,e,t.getPosition(),i,n,this._otherModels).then(r=>r||new gi)}}class yit extends NNe{constructor(e,t,i,n,r){super(e,t,n),this._otherModels=r,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,n){return Ao(250,n).then(()=>{const r=new gi;let o;if(this._word?o=this._word:o=e.getWordAtPosition(t.getPosition()),!o)return new gi;const a=[e,...this._otherModels];for(const c of a){if(c.isDisposed())continue;const d=c.findMatches(o.word,!0,!1,!0,i,!1).map(h=>({range:h.range,kind:k8.Text}));d&&r.set(c.uri,d)}return r})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty!==n?!1:super.isValid(e,t,i)}}function Q4t(s,e,t,i,n){return s.has(e)?new K4t(e,t,n,s):new yit(e,t,i,n,[])}function j4t(s,e,t,i,n,r){return s.has(e)?new q4t(e,t,n,s,r):new yit(e,t,i,n,r)}lg("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(nt);return(await wit(i.documentHighlightProvider,e,t,Ue.None))?.get(e.uri)});var ak;let cCe=(ak=class{constructor(e,t,i,n,r){this.toUnhook=new Z,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new gi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this._hasWordHighlights=Hce.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(x.occurrencesHighlight),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(o)})),this.toUnhook.add(e.onDidFocusEditorText(o=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this._run())})),this.toUnhook.add(e.onDidChangeModelContent(o=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(o=>{!o.newModelUrl&&o.oldModelUrl?this._stopSingular():vc.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{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,vc.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(r=>r.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);No(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.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 r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);No(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=vc.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),vc.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=vc.storedDecorations.get(i.getModel().uri);if(!n)continue;i.removeDecorations(n),t.push(i.getModel().uri);const r=fp.get(i);r?.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const i of t)vc.storedDecorations.delete(i)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==pe.vscodeNotebookCell&&vc.query?.modelInfo?.model.uri.scheme!==pe.vscodeNotebookCell?(vc.query=null,this._run()):vc.query?.modelInfo&&(vc.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!==Bi.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 r=[],o=this.codeEditorService.listCodeEditors();for(const a of o){const c=a.getModel();c&&c!==e&&c.uri.scheme===pe.vscodeNotebookCell&&r.push(c)}return r}const i=[],n=this.codeEditorService.listCodeEditors();for(const r of n){if(!rm(r))continue;const o=r.getModel();o&&e===o.modified&&i.push(o.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const r of n){const o=r.getModel();o&&o!==e&&i.push(o)}return i}_run(){let e;if(this.editor.hasTextFocus()){const i=this.editor.getSelection();if(!i||i.startLineNumber!==i.endLineNumber){vc.query=null,this._stopAll();return}const n=i.startColumn,r=i.endColumn,o=this._getWord();if(!o||o.startColumn>n||o.endColumn{i===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=r||[],this._beginRenderDecorations())},bt)}}computeWithModel(e,t,i,n){return n.length?j4t(this.multiDocumentProviders,e,t,i,this.editor.getOption(x.wordSeparators),n):Q4t(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=fp.get(t);if(!i)continue;const n=[],r=t.getModel()?.uri;if(r&&this.workerRequestValue.has(r)){const o=vc.storedDecorations.get(r),a=this.workerRequestValue.get(r);if(a)for(const l of a)l.range&&n.push({range:l.range,options:iUt(l.kind)});let c=[];t.changeDecorations(l=>{c=l.deltaDecorations(o??[],n)}),vc.storedDecorations=vc.storedDecorations.set(r,c),n.length>0&&(i.wordHighlighter?.decorations.set(n),i.wordHighlighter?._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},vc=ak,ak.storedDecorations=new gi,ak.query=null,ak);cCe=vc=D([_(4,qt)],cCe);var hR;let fp=(hR=class extends V{static get(e){return e.getContribution(aCe.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const r=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new cCe(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(o=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),r()})),r()}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()}},aCe=hR,hR.ID="editor.contrib.wordHighlighter",hR);fp=aCe=D([_(1,Le),_(2,nt),_(3,qt)],fp);class Cit extends it{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=fp.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class Y4t extends Cit{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:g(1603,"Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:Hce,kbOpts:{kbExpr:J.editorTextFocus,primary:S.F7,weight:Ae.EditorContrib}})}}class J4t extends Cit{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:g(1604,"Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:Hce,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|S.F7,weight:Ae.EditorContrib}})}}class X4t extends it{constructor(){super({id:"editor.action.wordHighlight.trigger",label:g(1605,"Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:Hce.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:0,weight:Ae.EditorContrib}})}run(e,t,i){const n=fp.get(t);n&&n.restoreViewState(!0)}}on(fp.ID,fp,ai.Eager);Re(Y4t);Re(J4t);Re(X4t);class Uce extends uc{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=_m(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),r=t.getModel(),o=t.getSelections(),a=o.length>1,c=o.map(l=>{const d=new re(l.positionLineNumber,l.positionColumn),h=this._move(n,r,d,this._wordNavigationType,a);return this._moveTo(l,h,this._inSelectionMode)});if(r.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",Bi.Explicit,c.map(l=>Mn.fromModelSelection(l))),c.length===1){const l=new re(c[0].positionLineNumber,c[0].positionColumn);t.revealPosition(l,_t.Smooth)}}_moveTo(e,t,i){return i?new ht(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new ht(t.lineNumber,t.column,t.lineNumber,t.column)}}class FI extends Uce{_move(e,t,i,n,r){return us.moveWordLeft(e,t,i,n,r)}}class OI extends Uce{_move(e,t,i,n,r){return us.moveWordRight(e,t,i,n)}}class Z4t extends FI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordStart,id:"cursorWordStartLeft",precondition:void 0})}}class eVt extends FI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordEnd,id:"cursorWordEndLeft",precondition:void 0})}}class tVt extends FI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordStartFast,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(s6,P6)?.negate()),primary:U.CtrlCmd|S.LeftArrow,mac:{primary:U.Alt|S.LeftArrow},weight:Ae.EditorContrib}})}}class iVt extends FI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordStart,id:"cursorWordStartLeftSelect",precondition:void 0})}}class nVt extends FI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordEnd,id:"cursorWordEndLeftSelect",precondition:void 0})}}class sVt extends FI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordStartFast,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(s6,P6)?.negate()),primary:U.CtrlCmd|U.Shift|S.LeftArrow,mac:{primary:U.Alt|U.Shift|S.LeftArrow},weight:Ae.EditorContrib}})}}class rVt extends FI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordAccessibility,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,r){return super._move(_m(Ch.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class oVt extends FI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordAccessibility,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(_m(Ch.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class aVt extends OI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordStart,id:"cursorWordStartRight",precondition:void 0})}}class cVt extends OI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordEnd,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(s6,P6)?.negate()),primary:U.CtrlCmd|S.RightArrow,mac:{primary:U.Alt|S.RightArrow},weight:Ae.EditorContrib}})}}class lVt extends OI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordEnd,id:"cursorWordRight",precondition:void 0})}}class dVt extends OI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordStart,id:"cursorWordStartRightSelect",precondition:void 0})}}class hVt extends OI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordEnd,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(s6,P6)?.negate()),primary:U.CtrlCmd|U.Shift|S.RightArrow,mac:{primary:U.Alt|U.Shift|S.RightArrow},weight:Ae.EditorContrib}})}}class uVt extends OI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordEnd,id:"cursorWordRightSelect",precondition:void 0})}}class gVt extends OI{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordAccessibility,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,r){return super._move(_m(Ch.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class fVt extends OI{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.WordAccessibility,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(_m(Ch.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Vce extends uc{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(zs);if(!t.hasModel())return;const r=_m(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),a=t.getSelections(),c=t.getOption(x.autoClosingBrackets),l=t.getOption(x.autoClosingQuotes),d=n.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const p=this._delete({wordSeparators:r,model:o,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(x.autoClosingDelete),autoClosingBrackets:c,autoClosingQuotes:l,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new nd(p,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class PNe extends Vce{_delete(e,t){const i=us.deleteWordLeft(e,t);return i||new F(1,1,1,1)}}class FNe extends Vce{_delete(e,t){const i=us.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new F(n,r,n,r)}}class pVt extends PNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:fs.WordStart,id:"deleteWordStartLeft",precondition:J.writable})}}class mVt extends PNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:fs.WordEnd,id:"deleteWordEndLeft",precondition:J.writable})}}class _Vt extends PNe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:fs.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 vVt extends FNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:fs.WordStart,id:"deleteWordStartRight",precondition:J.writable})}}class bVt extends FNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:fs.WordEnd,id:"deleteWordEndRight",precondition:J.writable})}}class wVt extends FNe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:fs.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 yVt extends it{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=_m(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),r=t.getModel(),a=t.getSelections().map(c=>{const l=us.deleteInsideWord(n,r,c);return new nd(l,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Qe(new Z4t);Qe(new eVt);Qe(new tVt);Qe(new iVt);Qe(new nVt);Qe(new sVt);Qe(new aVt);Qe(new cVt);Qe(new lVt);Qe(new dVt);Qe(new hVt);Qe(new uVt);Qe(new rVt);Qe(new oVt);Qe(new gVt);Qe(new fVt);Qe(new pVt);Qe(new mVt);Qe(new _Vt);Qe(new vVt);Qe(new bVt);Qe(new wVt);Re(yVt);class CVt extends Vce{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:fs.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=vae.deleteWordPartLeft(e);return i||new F(1,1,1,1)}}class SVt extends Vce{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:fs.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=vae.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new F(n,r,n,r)}}class Sit extends Uce{_move(e,t,i,n,r){return vae.moveWordPartLeft(e,t,i,r)}}class AVt extends Sit{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordStart,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.LeftArrow},weight:Ae.EditorContrib}})}}vt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class EVt extends Sit{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.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}})}}vt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Ait extends Uce{_move(e,t,i,n,r){return vae.moveWordPartRight(e,t,i)}}class xVt extends Ait{constructor(){super({inSelectionMode:!1,wordNavigationType:fs.WordEnd,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.RightArrow},weight:Ae.EditorContrib}})}}class DVt extends Ait{constructor(){super({inSelectionMode:!0,wordNavigationType:fs.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 CVt);Qe(new SVt);Qe(new AVt);Qe(new EVt);Qe(new xVt);Qe(new DVt);const PFe=class PFe extends V{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Mh.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(x.readOnlyMessage);t||(this.editor.isSimpleWidget?t=new Nt(g(1606,"Cannot edit in read-only input")):t=new Nt(g(1607,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};PFe.ID="editor.contrib.readOnlyMessageController";let wZ=PFe;on(wZ.ID,wZ,ai.BeforeFirstInteraction);let lCe=class extends V{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Yt(this,void 0);const n=sd("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),r=sd("_textModel.onDidChangeContent",M.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(du(async(o,a)=>{n.read(o),r.read(o);const c=a.add(new E0t),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(r=>e.contains(r.range.startLineNumber)&&!e.contains(r.range.endLineNumber));return n.sort(GGe(Sc(r=>r.range.endLineNumber-r.range.startLineNumber,ru))),n.map(r=>({name:r.name,kind:r.kind,startLineNumber:r.range.startLineNumber}))}};lCe=D([_(1,nt),_(2,fG)],lCe);HJ.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(lCe,s));var kVt='.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}';gt(kVt,{});const FFe=class FFe extends V{constructor(e){super(),this.editor=e,this.widget=null,gm&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(x.readOnly);!this.widget&&e?this.widget=new dCe(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};FFe.ID="editor.contrib.iPadShowKeyboard";let yZ=FFe;const Fre=class Fre 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 Fre.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Vg.BOTTOM_RIGHT_CORNER}}};Fre.ID="editor.contrib.ShowKeyboardWidget";let dCe=Fre;on(yZ.ID,yZ,ai.Eventually);function hCe(s){return!!s.workspaceUri}function TQ(s){return!!s.folderUri}function IVt(s){return!!s.fileUri}function TVt(s){const e=LVt(s),t=s.getValue("window.menuBarVisibility");return t==="default"||e&&t==="compact"||jt&&ld?"classic":t}var T4e;(function(s){s.TITLE_BAR_STYLE="window.titleBarStyle",s.CUSTOM_TITLE_BAR_VISIBILITY="window.customTitleBarVisibility"})(T4e||(T4e={}));var Pw;(function(s){s.NATIVE="native",s.CUSTOM="custom"})(Pw||(Pw={}));var L4e;(function(s){s.AUTO="auto",s.WINDOWED="windowed",s.NEVER="never"})(L4e||(L4e={}));function LVt(s,e){return e||(e=ONe(s)),e===Pw.NATIVE}function ONe(s){if(Hn)return Pw.CUSTOM;const e=s.getValue("window");if(e){if(jt&&e.nativeTabs===!0||jt&&e.nativeFullScreen===!1)return Pw.NATIVE;const n=e.titleBarStyle;if(n===Pw.NATIVE||n===Pw.CUSTOM)return n}return mo?Pw.NATIVE:Pw.CUSTOM}function BNe(s){return{id:Eit(s),configPath:s}}function RVt(s){return{id:Eit(s),uri:s}}function Eit(s){return Hc(s.toString()).toString(16)}const uCe=60,gCe=uCe*60,C9=gCe*24,R4e=C9*7,M4e=C9*30,N4e=C9*365;function WNe(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}",WNe(new Date().getTime()+n*1e3,!1));if(n<30)return g(794,"now");let r;return n{await Promise.all(Fit.map(t=>t(e)))}),await s.invokeFunction(async e=>{UYe((t,i)=>s.createInstance(RM,t,i,{})),sJe(e.get(tc))}),await s.invokeFunction(async e=>{const t=e.get(rg);await Promise.all(Oit.map(i=>i(e))),t.phase=2}),await s.invokeFunction(async e=>{await Promise.all(Bit.map(t=>t(e)))}),UNe.open(),Pit.fire(),s.invokeFunction(async e=>{const t=e.get(rg);je.as(hf.Workbench).start(e),je.as(rC.EditorFactory).start(e),Rit.fire(e),Mit.fire(e),await Promise.race([e.get(NI).whenRestored,Ao(2e3)]),t.phase=3,new ln(()=>{FO(window,()=>{t.phase=4},2500)},2500).schedule()})}let Wit=!1;kt.withServices(()=>(Wit=!0,V.None));async function Hit(){await UNe.wait()}function Uit(){if(Wit)throw new Error("Services are already initialized")}const Vit="inQuickOpen",UVt=new Q(Vit,!1,g(4610,"Whether keyboard focus is inside the quick open control")),yC=he.has(Vit),VVt="inFilesPicker",zit=he.and(yC,he.has(VVt));function zce(s,e){return t=>{const i=t.get(Vt),n=t.get(Tn),o={keybindings:i.lookupKeybindings(s)};n.navigate(!!e,o)}}let P4e=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:_pt(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()}};P4e=D([_(0,ti),_(1,Pr)],P4e);let fCe=class extends LJ{constructor(e,t,i,n,r,o){super(t,n,r,o,e),this.keybindingService=i,this.inQuickInputContext=UVt.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})}};fCe=D([_(0,Te),_(1,we),_(2,Vt),_(3,Le),_(4,mn),_(5,_u)],fCe);function zVt(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class tz{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,r=[];for(const[o,a]of this.documents){if(t.isCancellationRequested)return[];for(const c of a.chunks){const l=this.computeSimilarityScore(c,i,n);l>0&&r.push({key:o,score:l})}}return r}static termFrequencies(e){return zVt(tz.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 r of n)r.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(r)&&(yield t(r))}}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 r=tz.termFrequencies(n);for(const o of r.keys())this.chunkOccurrences.set(o,(this.chunkOccurrences.get(o)??0)+1);i.push({text:n,tf:r})}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 r=this.chunkOccurrences.get(n);if(typeof r=="number"){const o=r-1;o<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,o)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[r,o]of Object.entries(t)){const a=e.tf.get(r);if(!a)continue;let c=i.get(r);typeof c!="number"&&(c=this.computeIdf(r),i.set(r,c));const l=a*c;n+=l*o}return n}computeEmbedding(e){const t=tz.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 r=this.computeIdf(i);r>0&&(t[i]=n*r)}return t}}function $Vt(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 MS;(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"})(MS||(MS={}));function Iue(s){const e=s;return Array.isArray(e.items)}function F4e(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class zNe 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 r;const o=n.add(new yn),a=async()=>{const l=o.value=new Z;r?.dispose(!0),e.busy=!1,r=new li(t);const d=r.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(Iue(m)?(b=m.items,w=m.active):b=m,b.length===0){if(v)return!1;(h.length>0||e.hideInput)&&this.options?.noResultsPick&&(I2(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 Ao(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;Iue(m.picks)?(y=m.picks.items,C=m.picks.active):y=m.picks;let A,L;if(Iue(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(F4e(u))await p(u);else if(!(u instanceof Promise))f(u);else{e.busy=!0;try{const m=await u;if(d.isCancellationRequested)return;F4e(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 MS.NO_ACTION:break;case MS.CLOSE_PICKER:e.hide();break;case MS.REFRESH_PICKER:a();break;case MS.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 _0,sa,ay;let pCe=(ay=class extends zNe{constructor(e,t,i,n,r,o){super(_0.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=r,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance(S9)),this.options=e}async _getPicks(e,t,i,n){const r=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const o=fm(()=>{const f=new tz;f.updateDocuments(r.map(m=>({key:m.commandId,textChunks:[this.getTfIdfChunk(m)]})));const p=f.calculateScores(e,i);return $Vt(p).filter(m=>m.score>_0.TFIDF_THRESHOLD).slice(0,_0.TFIDF_MAX_RESULTS)}),a=[];for(const f of r){const p=_0.WORD_FILTER(e,f.label)??void 0,m=f.commandAlias?_0.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=o();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(r,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(r){Oo(r)||this.dialogService.error(g(4616,"Command '{0}' resulted in an error",e.label),Po(r))}}}}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}},_0=ay,ay.PREFIX=">",ay.TFIDF_THRESHOLD=.5,ay.TFIDF_MAX_RESULTS=5,ay.WORD_FILTER=eW(kM,PE,Iae),ay);pCe=_0=D([_(1,we),_(2,Vt),_(3,bi),_(4,Ji),_(5,ir)],pCe);var nb;let S9=(nb=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===Ay.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=sa.getConfiguredCommandHistoryLength(this.configurationService),sa.cache&&sa.cache.limit!==this.configuredCommandsHistoryLength&&(sa.cache.limit=this.configuredCommandsHistoryLength,sa.hasChanges=!0))}load(){const e=this.storageService.get(sa.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=sa.cache=new pm(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((r,o)=>r.value-o.value),n.forEach(r=>i.set(r.key,r.value))}sa.counter=this.storageService.getNumber(sa.PREF_KEY_COUNTER,Ie.PROFILE,sa.counter)}push(e){sa.cache&&(sa.cache.set(e,sa.counter++),sa.hasChanges=!0)}peek(e){return sa.cache?.peek(e)}saveState(){if(!sa.cache||!sa.hasChanges)return;const e={usesLRU:!0,entries:[]};sa.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(sa.PREF_KEY_CACHE,JSON.stringify(e),Ie.PROFILE,cn.USER),this.storageService.store(sa.PREF_KEY_COUNTER,sa.counter,Ie.PROFILE,cn.USER),sa.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const i=e.getValue().workbench?.commandPalette?.history;return typeof i=="number"?i:sa.DEFAULT_COMMANDS_HISTORY_LENGTH}static clearHistory(e,t){const i=sa.getConfiguredCommandHistoryLength(e);sa.cache=new pm(i),sa.counter=1,sa.hasChanges=!0}},sa=nb,nb.DEFAULT_COMMANDS_HISTORY_LENGTH=50,nb.PREF_KEY_CACHE="commandPalette.mru.cache",nb.PREF_KEY_COUNTER="commandPalette.mru.counter",nb.counter=1,nb.hasChanges=!1,nb);S9=sa=D([_(0,Gi),_(1,Te),_(2,Ke)],S9);class GVt extends pCe{constructor(e,t,i,n,r,o){super(e,t,i,n,r,o)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let n;i.metadata?.description&&(vRe(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:Tae(i.label)||i.id})}return t}}class Ub extends EXe{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 xi.Readonly}hasCapability(e){return e===xi.None?this.capabilities===xi.None:(this.capabilities&e)!==0}isReadonly(){return this.hasCapability(xi.Readonly)}getName(){return`Editor ${this.typeId}`}getDescription(e){}getTitle(e){return this.getName()}getLabelExtraClasses(){return[]}getAriaLabel(){return this.getTitle(Rs.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(ya(e))return this===e;const t=e.options?.override;return this.editorId!==t&&t!==void 0&&this.editorId!==void 0?!1:Yi(this.resource,Fa.getCanonicalUri(e))}prefersEditorPane(e){return um(e)}toUntyped(e){}isDisposed(){return this._store.isDisposed}dispose(){this.isDisposed()||this._onWillDispose.fire(),super.dispose()}}class KVt{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 qVt extends V{constructor(e){super(),this.counter=0,this.logger=e.createLogger("network",{name:g(4590,"Network Requests"),when:KCt.isEqualTo(f3(Kn.Trace)).serialize()})}async logAndRequest(e,t,i){const n=`${e} #${++this.counter}: ${t.url}`;this.logger.trace(`${n} - begin`,t.type,new KVt(t.headers??{}));try{const r=await i();return this.logger.trace(`${n} - end`,t.type,r.res.statusCode,r.res.headers),r}catch(r){throw this.logger.error(`${n} - error`,t.type,ou(r)),r}}}function $it(s){return s.res.statusCode&&s.res.statusCode>=200&&s.res.statusCode<300||s.res.statusCode===1223}function Git(s){return s.res.statusCode===204}async function QVt(s){return Git(s)?null:(await oD(s.stream)).toString()}async function jVt(s){if(!$it(s))throw new Error("Server returned "+s.res.statusCode);return QVt(s)}async function YVt(s){if(!$it(s))throw new Error("Server returned "+s.res.statusCode);if(Git(s))return null;const t=(await oD(s.stream)).toString();try{return JSON.parse(t)}catch(i){throw i.message+=`: `+t,i}}let Tue;function JVt(s){const e=je.as(Pn.Configuration),t=Tue;Tue={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:[Tue],remove:t?[t]:[]})}JVt(ct.APPLICATION);var kV,To;(function(s){s.Panel="panel",s.Terminal="terminal",s.Notebook="notebook",s.Editor="editor"})(To||(To={}));(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})(To||(To={}));var YB;let O4e=(YB=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=bet.bindTo(this.contextKeyService)}registerAgent(e,t){if(this.getAgent(e))throw new Error(`Agent already registered: ${JSON.stringify(e)}`);const n=this,r=t.slashCommands;t={...t,get slashCommands(){return r.filter(a=>!a.when||n.contextKeyService.contextMatchesRules(he.deserialize(a.when)))}};const o={data:t};return this._agents.set(e,o),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 UK(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 UK(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 UK(i.data,i.impl))}getDefaultAgent(e){return Tk(this.getActivatedAgents(),t=>!!t.isDefault&&t.locations.includes(e))}getContributedDefaultAgent(e){return this.getAgents().find(t=>!!t.isDefault&&t.locations.includes(e))}getSecondaryAgent(){return ui.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=ui.find(this._agents.values(),i=>$ce(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 UK(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,r){const o=this._agents.get(e);if(!o?.impl)throw new Error(`No activated agent with id "${e}"`);return await o.impl.invoke(t,i,n,r)}async getFollowups(e,t,i,n,r){const o=this._agents.get(e);if(!o?.impl)throw new Error(`No activated agent with id "${e}"`);return o.impl?.provideFollowups?o.impl.provideFollowups(t,i,n,r):[]}},YB.AGENT_LEADER="@",YB);O4e=D([_(0,Le)],O4e);class UK{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 uR;let B4e=(uR=class{constructor(e,t,i,n){if(this.requestService=t,this.logService=i,this.storageService=n,this.registry=Yt(this,Object.create(null)),this.disposed=!1,!e.chatParticipantRegistry)return;this.url=e.chatParticipantRegistry;const r=n.get(kV.StorageKey,Ie.APPLICATION);try{this.registry.set(JSON.parse(r??"{}"),void 0)}catch{n.remove(kV.StorageKey,Ie.APPLICATION)}this.refresh()}refresh(){this.disposed||this.update().catch(e=>this.logService.warn("Failed to fetch chat participant registry",e)).then(()=>Ao(5*60*1e3)).then(()=>this.refresh())}async update(){const e=await this.requestService.request({type:"GET",url:this.url},Ue.None);if(e.res.statusCode!==200)throw new Error("Could not get extensions report.");const t=await YVt(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(kV.StorageKey,JSON.stringify(i),Ie.APPLICATION,cn.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(r=>ga(r,r.includes(".")?t.extensionId.value:t.extensionPublisherId)):!0)}dispose(){this.disposed=!0}},kV=uR,uR.StorageKey="chat.participantNameRegistry",uR);B4e=kV=D([_(0,xo),_(1,U6),_(2,Ke),_(3,Gi)],B4e);function $ce(s){return`${s.extensionId.value}.${s.id}`}function Kit(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 An("")),Mr(e)}var xC;const XVt=oi("chat-editor-label-icon",ve.commentDiscussion,g(7137,"Icon of the chat editor label."));var GS;let mCe=(GS=class extends Ub{static getNewEditorUri(){const e=Math.floor(Math.random()*1e9);return CZ.generate(e)}static getNextCount(){let e=0;for(;xC.countsInUse.has(e);)e++;return e}constructor(e,t,i){if(super(),this.resource=e,this.options=t,this.chatService=i,typeof CZ.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=xC.getNextCount(),xC.countsInUse.add(this.inputCount),this._register(Ee(()=>xC.countsInUse.delete(this.inputCount)))}get editorId(){return xC.EditorID}get capabilities(){return super.capabilities|xi.Singleton}matches(e){return e instanceof xC&&e.resource.toString()===this.resource.toString()}get typeId(){return xC.TypeID}getName(){return this.model?.title||g(7138,"Chat")+(this.inputCount>0?` ${this.inputCount+1}`:"")}getIcon(){return XVt}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(To.Panel,Ue.None),this.model?(this.sessionId=this.model.sessionId,this._register(this.model.onDidChange(()=>this._onDidChangeLabel.fire())),this._register(new ZVt(this.model))):null}dispose(){super.dispose(),this.sessionId&&this.chatService.clearSession(this.sessionId)}},xC=GS,GS.countsInUse=new Set,GS.TypeID="workbench.input.chatSession",GS.EditorID="workbench.editor.chatSession",GS);mCe=xC=D([_(2,Lm)],mCe);class ZVt 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 CZ;(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 r=i.path.match(/chat-(\d+)/)?.[1];if(typeof r!="string")return;const o=parseInt(r);if(!isNaN(o))return{handle:o}}s.parse=t})(CZ||(CZ={}));const e5t="copilot";async function t5t(s){return(await s.openView(n5t))?.widget}const i5t=g(7002,"Generating"),n5t=`workbench.panel.chat.view.${e5t}`,Ore=class Ore{constructor(e,t,i){this.range=e,this.editorRange=t,this.text=i,this.kind=Ore.Kind}get promptText(){return this.text}};Ore.Kind="text";let ub=Ore;const $Ne="#",i4="@",lI="/",Bre=class Bre{constructor(e,t,i,n,r){this.range=e,this.editorRange=t,this.variableName=i,this.variableArg=n,this.variableId=r,this.kind=Bre.Kind}get text(){const e=this.variableArg?`:${this.variableArg}`:"";return`${$Ne}${this.variableName}${e}`}get promptText(){return this.text}};Bre.Kind="var";let A9=Bre;const Wre=class Wre{constructor(e,t,i){this.range=e,this.editorRange=t,this.agent=i,this.kind=Wre.Kind}get text(){return`${i4}${this.agent.name}`}get promptText(){return""}};Wre.Kind="agent";let qg=Wre;const Hre=class Hre{constructor(e,t,i){this.range=e,this.editorRange=t,this.command=i,this.kind=Hre.Kind}get text(){return`${lI}${this.command.name}`}get promptText(){return""}};Hre.Kind="subcommand";let nN=Hre;const Ure=class Ure{constructor(e,t,i){this.range=e,this.editorRange=t,this.slashCommand=i,this.kind=Ure.Kind}get text(){return`${lI}${this.slashCommand.command}`}get promptText(){return`${lI}${this.slashCommand.command}`}};Ure.Kind="slash";let zW=Ure;const Vre=class Vre{constructor(e,t,i,n,r,o){this.range=e,this.editorRange=t,this.text=i,this.id=n,this.modelDescription=r,this.data=o,this.kind=Vre.Kind}get referenceText(){return this.text.replace($Ne,"")}get promptText(){return this.text}};Vre.Kind="dynamic";let $W=Vre;function s5t(s){return{text:s.text,parts:s.parts.map(e=>{if(e.kind===ub.Kind)return new ub(new _i(e.range.start,e.range.endExclusive),e.editorRange,e.text);if(e.kind===A9.Kind)return new A9(new _i(e.range.start,e.range.endExclusive),e.editorRange,e.variableName,e.variableArg,e.variableName||"");if(e.kind===qg.Kind){let t=e.agent;return t=Kit(t),new qg(new _i(e.range.start,e.range.endExclusive),e.editorRange,t)}else{if(e.kind===nN.Kind)return new nN(new _i(e.range.start,e.range.endExclusive),e.editorRange,e.command);if(e.kind===zW.Kind)return new zW(new _i(e.range.start,e.range.endExclusive),e.editorRange,e.slashCommand);if(e.kind===$W.Kind)return new $W(new _i(e.range.start,e.range.endExclusive),e.editorRange,e.text,e.id,e.modelDescription,Mr(e.data));throw new Error(`Unknown chat request part: ${e.kind}`)}})}}function r5t(s){const e=s.parts.find(i=>i instanceof qg),t=s.parts.find(i=>i instanceof nN);return{agentPart:e,commandPart:t}}function o5t(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 a5t(s){return!!s&&typeof s=="object"&&"documents"in s&&Array.isArray(s.documents)&&s.documents.every(o5t)}var GW;(function(s){s[s.Complete=1]="Complete",s[s.Partial=2]="Partial",s[s.Omitted=3]="Omitted"})(GW||(GW={}));var KW;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(KW||(KW={}));var W4e;(function(s){s[s.Action=1]="Action",s[s.Toolbar=2]="Toolbar"})(W4e||(W4e={}));var _Ce,vCe;const zre=class zre{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,r){this._session=e,this.message=t,this._variableData=i,this._attempt=n,this._locationData=r,this.id="request_"+zre.nextId++}adoptTo(e){this._session=e}};zre.nextId=0;let SZ=zre,c5t=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=z_(e).map(t=>ud(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"||!qit(n.content,e.content)?this._responseParts.push(e):n.content=LQ(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(r=>{n.dispose(),typeof r=="string"&&(this._responseParts[i].content=new Nt(r)),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"?vi("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(` @@ -808,13 +808,13 @@ ${t.message}`:t.content.value).filter(t=>t.length>0).join(` `),u=a-(h+1)+1,f=(c+o).lastIndexOf(` `),p=a+o.length-(f+1)+1;try{JSON.parse(decodeURIComponent(r)).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)+o+t.substring(a+n.length)}return{newText:t,vulnerabilities:e}}function GNe(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,r=s.substring(0,n);return{value:r,returnedWordCount:i.length===0?r.length?1:0:i.length,isFullString:n>=s.length,totalWordCount:t.length}}function Yit(s){return GNe(s,Number.MAX_SAFE_INTEGER).returnedWordCount}function zu(s){return!!s&&typeof s=="object"&&"message"in s}function bs(s){return!!s&&typeof s.setVote<"u"}function aB(s){return!!s&&typeof s=="object"&&"content"in s}let wCe=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,r)=>{const o=this.instantiationService.createInstance(U4e,n);this._items.push(o),this.updateCodeBlockTextModels(o),n.response&&this.onAddResponse(n.response)}),this._register(e.onDidDispose(()=>this._onDidDisposeModel.fire())),this._register(e.onDidChange(n=>{if(n.kind==="addRequest"){const o=this.instantiationService.createInstance(U4e,n.request);this._items.push(o),this.updateCodeBlockTextModels(o),n.request.response&&this.onAddResponse(n.request.response)}else if(n.kind==="addResponse")this.onAddResponse(n.response);else if(n.kind==="removeRequest"){const o=this._items.findIndex(c=>zu(c)&&c.id===n.requestId);o>=0&&this._items.splice(o,1);const a=n.responseId&&this._items.findIndex(c=>bs(c)&&c.id===n.responseId);if(typeof a=="number"&&a>=0){const l=this._items.splice(a,1)[0];l instanceof iz&&l.dispose()}}const r=n.kind==="addRequest"?{kind:"addRequest"}:n.kind==="initialize"?{kind:"initialize"}:null;this._onDidChange.fire(r)}))}onAddResponse(e){const t=this.instantiationService.createInstance(iz,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 iz).forEach(e=>e.dispose())}updateCodeBlockTextModels(e){let t;zu(e)?t=e.messageText:t=d5t(e.response.value).map(r=>r.content.value).join("");let i=0;const n=new Ku.Renderer;n.code=(r,o)=>(o??="",this.codeBlockModelCollection.update(this._model.sessionId,e,i++,{text:r,languageId:o}),""),Ku.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(),r=Yit(e.response.toString()),o=Math.max(n-this._contentUpdateTimings.firstWordTime,250),a=this._contentUpdateTimings.lastWordCount/(o/1e3);this.trace("onDidChange",`Update- got ${this._contentUpdateTimings.lastWordCount} words over last ${o}ms = ${a} words/s. ${r} 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:r}}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)}};iz=D([_(1,Ke),_(2,lce)],iz);var qW;(function(s){s[s.UP=0]="UP",s[s.DOWN=1]="DOWN",s[s.LEFT=2]="LEFT",s[s.RIGHT=3]="RIGHT"})(qW||(qW={}));var V4e;(function(s){s[s.HORIZONTAL=0]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL"})(V4e||(V4e={}));var yCe;(function(s){s[s.FIRST=0]="FIRST",s[s.LAST=1]="LAST",s[s.NEXT=2]="NEXT",s[s.PREVIOUS=3]="PREVIOUS"})(yCe||(yCe={}));var z4e;(function(s){s[s.MAXIMIZE=0]="MAXIMIZE",s[s.EXPAND=1]="EXPAND",s[s.EVEN=2]="EVEN"})(z4e||(z4e={}));var $4e;(function(s){s[s.COPY_EDITORS=0]="COPY_EDITORS",s[s.MOVE_EDITORS=1]="MOVE_EDITORS"})($4e||($4e={}));function G4e(s){const e=s;return ya(e?.editor)&&ya(e?.replacement)}var gu;(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"})(gu||(gu={}));function KNe(s){const e=s;return!!e&&typeof e.id=="number"&&Array.isArray(e.editors)}function QW(s){return s.getValue("workbench.editor.openSideBySideDirection")==="down"?qW.DOWN:qW.RIGHT}const pA=-1,nv=-2,u5t=-3;function Jit(s){return typeof s=="number"||KNe(s)}const Xit=Pe(4617,"Chat"),g5t="workbench.action.chat.open";var Kh;(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"})(Kh||(Kh={}));var Hy;(function(s){s.Live="live",s.Preview="preview"})(Hy||(Hy={}));je.as(Pn.Configuration).registerConfiguration({id:"editor",properties:{[Kh.Mode]:{description:g(7041,"Configure if changes crafted with inline chat are applied directly to the document or are previewed first."),default:Hy.Live,type:"string",enum:[Hy.Live,Hy.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"]},[Kh.FinishOnType]:{description:g(7044,"Whether to finish an inline chat session when typing outside of changed regions."),default:!1,type:"boolean"},[Kh.AcceptedOrDiscardBeforeSave]:{description:g(7045,"Whether pending inline chat sessions prevent saving."),default:!0,type:"boolean"},[Kh.HoldToSpeech]:{description:g(7046,"Whether holding the inline chat keybinding will automatically enable speech recognition."),default:!0,type:"boolean"},[Kh.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.")]},[Kh.ExpTextButtons]:{description:g(7051,"Whether to use textual buttons."),default:!1,type:"boolean",tags:["experimental"]}}});const K4e="interactiveEditor";var z1;(function(s){s.None="none",s.Messages="messages",s.MessagesAndEdits="messagesAndEdits"})(z1||(z1={}));const f5t=new Q("inlineChatHasProvider",!1,g(7052,"Whether a provider for interactive editors exists")),p5t=new Q("inlineChatVisible",!1,g(7053,"Whether the interactive editor input is visible")),m5t=new Q("inlineChatFocused",!1,g(7054,"Whether the interactive editor input is focused")),_5t=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 v5t=new Q("inlineChatOuterCursorPosition","",g(7061,"Whether the cursor of the outer editor is above or below the interactive editor input")),b5t=new Q("inlineChatHasStashedSession",!1,g(7062,"Whether interactive editor has kept a session for quick restore")),w5t=new Q("inlineChatUserDidEdit",void 0,g(7063,"Whether the user did changes ontop of the inline chat")),y5t=new Q("inlineChatDocumentChanged",!1,g(7064,"Whether the document has changed concurrently")),C5t=new Q("inlineChatChangeHasDiff",!1,g(7065,"Whether the current change supports showing a diff")),S5t=new Q("inlineChatChangeShowsDiff",!1,g(7066,"Whether the current change showing a diff"));new Q("config.inlineChat.mode",Hy.Live);const A5t=new Q("inlineChatRequestInProgress",!1,g(7067,"Whether an inline chat request is currently in progress")),E5t=new Q("inlineChatResponseType",z1.None,g(7068,"What type was the responses have been receieved, nothing yet, just messages, or messaged and local edits"));he.equals(`config.${[Kh.ExpTextButtons]}`,!0);const x5t="inlineChat.acceptChanges",D5t="inlineChat.regenerate",k5t="inlineChat.toggleDiff",Zit=_e.for("inlineChat.execute"),I5t=_e.for("inlineChat.content.status"),T5t=_e.for("inlineChatWidget.status"),L5t=W("inlineChat.foreground",PN,g(7069,"Foreground color of the interactive editor widget")),CCe=W("inlineChat.background",kh,g(7070,"Background color of the interactive editor widget"));W("inlineChat.border",v6,g(7071,"Border color of the interactive editor widget"));W("inlineChat.shadow",kI,g(7072,"Shadow color of the interactive editor widget"));W("inlineChatInput.border",v6,g(7073,"Border color of the interactive editor input"));W("inlineChatInput.focusBorder",bp,g(7074,"Border color of the interactive editor input when focused"));W("inlineChatInput.placeholderForeground",tmt,g(7075,"Foreground color of the interactive editor input placeholder"));W("inlineChatInput.background",Y2,g(7076,"Background color of the interactive editor input"));W("inlineChatDiff.inserted",rt(wy,.5),g(7077,"Background color of inserted text in the interactive editor input"));const R5t=W("editorOverviewRuler.inlineChatInserted",{dark:rt(wy,.6),light:rt(wy,.8),hcDark:rt(wy,.6),hcLight:rt(wy,.8)},g(7078,"Overview ruler marker color for inline chat inserted content.")),M5t=W("editorOverviewRuler.inlineChatInserted",{dark:rt(wy,.6),light:rt(wy,.8),hcDark:rt(wy,.6),hcLight:rt(wy,.8)},g(7078,"Overview ruler marker color for inline chat inserted content."));W("inlineChatDiff.removed",rt(cF,.5),g(7079,"Background color of removed text in the interactive editor input"));W("editorOverviewRuler.inlineChatRemoved",{dark:rt(cF,.6),light:rt(cF,.8),hcDark:rt(cF,.6),hcLight:rt(cF,.8)},g(7080,"Overview ruler marker color for inline chat removed content."));var v0;const n8=class n8{constructor(e,t){this._textModel=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._decorationIds=[],this._decorationIds=e.deltaDecorations([],[{range:t,options:n8._options}])}dispose(){this._onDidChange.dispose(),this._textModel.isDisposed()||this._textModel.deltaDecorations(this._decorationIds,[])}fixup(e){const t=[];for(const{modified:o}of e){const a=o.isEmpty?new F(o.startLineNumber,1,o.startLineNumber,this._textModel.getLineLength(o.startLineNumber)):new F(o.startLineNumber,1,o.endLineNumberExclusive-1,this._textModel.getLineLength(o.endLineNumberExclusive-1));t.push({range:a,options:n8._options})}const[i,...n]=this._decorationIds,r=this._textModel.deltaDecorations(n,t);this._decorationIds=[i].concat(r),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}};n8._options=Kt.register({description:"inlineChat/session/wholeRange"});let SCe=n8;class N5t{constructor(e,t,i,n,r,o,a,c){this.editMode=e,this.targetUri=t,this.textModel0=i,this.textModelN=n,this.agent=r,this.wholeRange=o,this.hunkData=a,this.chatModel=c,this._isUnstashed=!1,this._exchanges=[],this._startTime=new Date,this.textModelNAltVersion=n.getAlternativeVersionId(),this._teldata={extension:An.toKey(r.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}};ECe=D([_(3,Le),_(4,xMe),_(5,Ke)],ECe);function q4e(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 ck;let xCe=(ck=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:r,textModel0Decorations:o,state:a}of this._data.values())if(a===Vh.Pending)for(let c=1;cF.compareRangesUsingStarts(r.rangeN,o.rangeN)),i.sort(F.compareRangesUsingStarts);const n=[];for(const r of e.changes){let o=!1,a=0;for(const{rangeN:f,range0:p}of t)if(f.getEndPosition().isBefore(F.getStartPosition(r.range)))a+=this._textModelN.getValueLengthInRange(f),a-=this._textModel0.getValueLengthInRange(p);else if(F.areIntersectingOrTouching(f,r.range)){o=!0;break}else break;if(o)continue;const c=r.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+r.rangeLength);n.push(es.replace(F.fromPositions(h,u),r.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 r=1;rnew O5t(r.original,r.modified,r.innerChanges??[]));this._textModelN.changeDecorations(r=>{this._textModel0.changeDecorations(o=>{for(const{textModelNDecorations:a,textModel0Decorations:c}of this._data.values())a.forEach(r.removeDecoration,r),c.forEach(o.removeDecoration,o);this._data.clear();for(const a of n){const c=[],l=[];c.push(r.addDecoration(q4e(a.modified,this._textModelN),v0._HUNK_TRACKED_RANGE)),l.push(o.addDecoration(q4e(a.original,this._textModel0),v0._HUNK_TRACKED_RANGE));for(const d of a.changes)c.push(r.addDecoration(d.modifiedRange,v0._HUNK_TRACKED_RANGE)),l.push(o.addDecoration(d.originalRange,v0._HUNK_TRACKED_RANGE));this._data.set(a,{editState:e,textModelNDecorations:c,textModel0Decorations:l,state:Vh.Pending})}})})}get size(){return this._data.size}get pending(){return ui.reduce(this._data.values(),(e,{state:t})=>e+(t===Vh.Pending?1:0),0)}_discardEdits(e){const t=[],i=e.getRangesN(),n=e.getRanges0();for(let r=1;r(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 r=i.textModelNDecorations.map(o=>this._textModelN.getDecorationRange(o));return vM(r),r},getRanges0:()=>{const r=i.textModel0Decorations.map(o=>this._textModel0.getDecorationRange(o));return vM(r),r},discardChanges:()=>{if(i.state===Vh.Pending){const r=this._discardEdits(n);this._textModelN.pushEditOperations(null,r,()=>null),i.state=Vh.Rejected}},acceptChanges:()=>{if(i.state===Vh.Pending){const r=[],o=n.getRangesN(),a=n.getRanges0();for(let c=1;cnull),i.state=Vh.Accepted,i.editState.applied+=1}}};e.push(n)}return e}},v0=ck,ck._HUNK_TRACKED_RANGE=Kt.register({description:"inline-chat-hunk-tracked-range",stickiness:si.AlwaysGrowsWhenTypingAtEdges}),ck._HUNK_THRESHOLD=8,ck);xCe=v0=D([_(0,Pl)],xCe);class O5t{constructor(e,t,i){this.original=e,this.modified=t,this.changes=i}}var Vh;(function(s){s[s.Pending=0]="Pending",s[s.Accepted=1]="Accepted",s[s.Rejected=2]="Rejected"})(Vh||(Vh={}));async function B5t(s,e,t,i){const[n]=s.deltaDecorations([],[{range:e.range,options:{description:"asyncTextEdit",stickiness:si.AlwaysGrowsWhenTypingAtEdges}}]);let r=!0;for await(const o 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=r?es.replace(a,o):es.insert(a.getEndPosition(),o);i?.start(),s.pushEditOperations(null,[c],l=>(t?.report(l),null)),i?.stop(),r=!1}}function W5t(s,e,t,i){t=Math.max(30,t);const n=new V2;let r=e.text??"";s.cancelAndSet(()=>{if(i.isCancellationRequested)return;const a=GNe(r,1);n.emitOne(a.value),r=r.substring(a.value.length),a.isFullString&&(s.cancel(),n.resolve(),o.dispose())},1e3/t);const o=i.onCancellationRequested(()=>{s.cancel(),n.resolve(),o.dispose()});return{range:e.range,newText:n.asyncIterable}}var H5t=".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}";gt(H5t,{});function qNe(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 U5t(){return{isSimpleWidget:!0,contributions:dp.getSomeEditorContributions([BA.ID,Lce,Hb.ID,tf.ID,pc.ID,HA.ID])}}function tw(s){if(!(!s||!s.resource))return N.isUri(s.resource)?s.resource:s.resource.primary}const V5t={onDidChangeVisibility:M.None};let KA=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this.instantiationService=t,this.configurationService=i,this.modelService=n,this.workspaceService=r,this.languageService=o,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(aRe)&&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(kCe,e,t),n={element:i.element,onDidRender:i.onDidRender,setLabel:(r,o,a)=>i.setLabel(r,o,a),setResource:(r,o)=>i.setResource(r,o),setFile:(r,o)=>i.setFile(r,o),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)),wt(e)}clear(){this.widgets=wt(this.widgets),this.labels=[]}dispose(){super.dispose(),this.clear()}};KA=D([_(1,we),_(2,Te),_(3,fi),_(4,Ci),_(5,Di),_(6,aE),_(7,mn),_(8,Os),_(9,Fr)],KA);let DCe=class extends KA{get element(){return this.label}constructor(e,t,i,n,r,o,a,c,l,d,h){super(V5t,i,n,r,o,a,c,l,d,h),this.label=this._register(this.create(e,t))}};DCe=D([_(2,we),_(3,Te),_(4,fi),_(5,Ci),_(6,Di),_(7,aE),_(8,mn),_(9,Os),_(10,Fr)],DCe);var s1;(function(s){s[s.Basic=1]="Basic",s[s.Full=2]="Full"})(s1||(s1={}));let kCe=class extends P3{constructor(e,t,i,n,r,o,a,c,l){super(e,t),this.languageService=i,this.modelService=n,this.decorationsService=r,this.labelService=o,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 yn),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===s1.Full,updateDecoration:this.needsRedraw===s1.Full}),this.needsRedraw=void 0))}notifyModelLanguageChanged(e){this.handleModelEvent(e)}notifyModelAdded(e){this.handleModelEvent(e)}handleModelEvent(e){const t=tw(this.label);t&&Yi(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=tw(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){tw(this.label)?.scheme===e&&this.render({updateIcon:!1,updateDecoration:!1})}notifyUntitledLabelChange(e){Yi(e,tw(this.label))&&this.render({updateIcon:!1,updateDecoration:!1})}notifyWorkspaceFoldersChange(){if(typeof this.computedWorkspaceFolderLabel=="string"){const e=tw(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===wa.ROOT_FOLDER){const o=this.contextService.getWorkspaceFolder(e);o&&(n=o.name,this.computedWorkspaceFolderLabel=n)}n||(n=Yw(TA(e)))}let r;if(!t?.hidePath){const o=this.labelService.getUriLabel(Ro(e),{relative:!0});o&&o!=="."&&(r=o)}this.setResource({resource:e,name:n,description:r,range:t?.range},t)}setResource(e,t=Object.create(null)){const i=tw(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 r=this.hasResourceChanged(e),o=r||this.hasPathLabelChanged(e),a=this.hasFileKindChanged(t),c=this.hasIconChanged(t);this.label=e,this.options=t,r&&(this.computedLanguageId=void 0),o&&(this.computedPathLabel=void 0),this.render({updateIcon:r||a||c,updateDecoration:r||a})}hasFileKindChanged(e){const t=e?.fileKind,i=this.options?.fileKind;return t!==i}hasResourceChanged(e){const t=tw(e),i=tw(this.label);return t&&i?t.toString()!==i.toString():!(!t&&!i)}hasPathLabelChanged(e){const t=tw(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!==s1.Full&&(this.needsRedraw=e.updateIcon||e.updateDecoration?s1.Full:s1.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=tw(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=Wx(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!==wa.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 r=`${t.title.markdown} • ${n.tooltip}`;t.title={markdown:r,markdownNotSupportedFallback:r}}}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}};kCe=D([_(2,Di),_(3,fi),_(4,aE),_(5,Os),_(6,Fr),_(7,Ci),_(8,RZe)],kCe);const a_=fe,z5t="vscode-local-file";function $5t(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 ey=10;let ICe=class extends V{constructor(e,t,i,n,r,o,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=a_(".interactive-result-code-block"),this.contextKeyService=this._register(o.createScoped(this.element));const d=this._register(r.createChild(new Vc([Le,this.contextKeyService]))),h=oe(this.element,a_(".interactive-result-editor"));this.editor=this.createEditor(d,h,{...qNe(this.configurationService),readOnly:!0,lineNumbers:"off",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:8,dragAndDrop:!1,padding:{top:ey,bottom:ey},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=oe(this.element,a_(".interactive-result-code-block-toolbar")),f=this.editor.contextKeyService.createScoped(u),p=this._register(d.createChild(new Vc([Le,f])));this.toolbar=this._register(p.createInstance(Cm,u,t,{menuOptions:{shouldForwardArgs:!0}}));const m=oe(this.element,a_(".interactive-result-vulns")),v=oe(m,a_(".interactive-result-vulns-header",void 0));this.vulnsButton=this._register(new Zd(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=oe(m,a_("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(bo.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"),fp.get(this.editor)?.stopHighlighting(),this.clearWidgets()})),this._register(this.editor.onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),fp.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(Kk,t,i,{isSimpleWidget:!1,contributions:dp.getSomeEditorContributions([BA.ID,Lce,Hb.ID,fp.ID,VW.ID,zA.ID,tN.ID,Fa.ID,Mh.ID,XM.ID,QM.ID])}))}focus(){this.editor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.editor.getLayoutInfo().contentWidth,t=this.editor.getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(ey-t,2):ey;this.editor.updateOptions({padding:{top:ey,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(bo.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"?dd.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(()=>Uk.setTabFocusMode(!0))),this.disposableStore.add(this.editor.onDidBlurEditorWidget(()=>Uk.setTabFocusMode(!1)))),this.editor.updateOptions({ariaLabel:g(10582,"Code block {0}",e.codeBlockIndex+1),readOnly:!i}),e.hideToolbar?Gd(this.toolbar.getElement()):Xh(this.toolbar.getElement()),e.vulns?.length&&bs(e.element)?(Ns(this.vulnsListElement),this.element.classList.remove("no-vulns"),this.element.classList.toggle("chat-vulnerabilities-collapsed",!e.element.vulnerabilitiesListExpanded),oe(this.vulnsListElement,...e.vulns.map(n=>a_("li",void 0,a_("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(){Fa.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,_t.Immediate)),this.toolbar.context={code:t.getTextBuffer().getValueInRange(e.range??t.getFullModelRange(),gr.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})`}};ICe=D([_(4,we),_(5,Le),_(6,fi),_(7,Te),_(8,_o)],ICe);let TCe=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)}};TCe=D([_(0,pn),_(1,fi)],TCe);let LCe=class extends V{constructor(e,t,i,n,r,o,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 yn),this.currentScrollWidth=0,this.element=a_(".interactive-result-code-block"),this.element.classList.add("compare"),this.messageElement=oe(this.element,a_(".message")),this.messageElement.setAttribute("role","status"),this.messageElement.tabIndex=0,this.contextKeyService=this._register(o.createScoped(this.element));const u=this._register(r.createChild(new Vc([Le,this.contextKeyService]))),f=oe(this.element,a_(".interactive-result-header.show-file-icons")),p=oe(this.element,a_(".interactive-result-editor"));this.diffEditor=this.createDiffEditor(u,p,{...qNe(this.configurationService),lineNumbers:"on",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:12,dragAndDrop:!1,padding:{top:ey,bottom:ey},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(DCe,f,{supportIcons:!0}));const m=this.diffEditor.getModifiedEditor().contextKeyService.createScoped(f),v=this._register(u.createChild(new Vc([Le,m])));this.toolbar=this._register(v.createInstance(Cm,f,t,{menuOptions:{shouldForwardArgs:!0}})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(b=>{b.affectedKeys.has(bo.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"),fp.get(this.diffEditor.getModifiedEditor())?.stopHighlighting(),this.clearWidgets()})),this._register(this.diffEditor.getModifiedEditor().onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),fp.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:dp.getSomeEditorContributions([BA.ID,Lce,Hb.ID,fp.ID,VW.ID,zA.ID,tN.ID,Fa.ID,XM.ID])};return this._register(e.createInstance(yp,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(ey-t,2):ey;this.diffEditor.updateOptions({padding:{top:ey,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(bo.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"?dd.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:wa.FILE,fileDecorations:{colors:!0,badges:!1}})}reset(){this.clearWidgets()}clearWidgets(){Fa.get(this.diffEditor.getOriginalEditor())?.hideContentHover(),Fa.get(this.diffEditor.getModifiedEditor())?.hideContentHover()}async updateEditor(e,t){if(!bs(e.element))return;const i=!!(e.edit.state?.applied??0);if($Pt.bindTo(this.contextKeyService).set(i),this.element.classList.toggle("no-diff",i),e.edit.state?.applied){const r=this.labelService.getUriLabel(e.edit.uri,{relative:!0,noPrefix:!0});let o;e.edit.state.applied===1?o=g(10588,"Made 1 change in [[``{0}``]]",r):e.edit.state.applied<0?o=g(10589,"Edits in [[``{0}``]] have been rejected",r):o=g(10590,"Made {0} changes in [[``{1}``]]",e.edit.state.applied,r);const a=JLe(o,{renderCodeSegments:!0,actionHandler:{callback:()=>{this.openerService.open(e.edit.uri,{fromUserGesture:!0,allowCommands:!1})},disposables:this._store}});ca(this.messageElement,a)}const n=await e.diffData;if(n){if(i)this.diffEditor.setModel(null),this._lastDiffEditorViewModel.value=void 0;else{const r=this.diffEditor.createViewModel({original:n.original,modified:n.modified});if(await r.waitForDiff(),t.isCancellationRequested)return;this.diffEditor.setModel(r),this._lastDiffEditorViewModel.value=r}this.toolbar.context={edit:e.edit,element:e.element,diffEditor:this.diffEditor}}}clearModel(){this.diffEditor.setModel(null)}};LCe=D([_(4,we),_(5,Le),_(6,fi),_(7,Te),_(8,_o),_(9,Os),_(10,Ar)],LCe);let RCe=class{constructor(e,t,i){this.modelService=e,this.editorService=t,this.dialogService=i,this._sha1=new oW}async apply(e,t,i){if(!e.response.value.includes(t)||t.state?.applied)return;if(!i)for(const r of this.editorService.listDiffEditors()){if(!r.getContainerDomNode().isConnected)continue;const o=r.getModel();if(!o||!Yi(o.original.uri,t.uri)||o.modified.uri.scheme!==pe.vscodeChatCodeCompareBlock){i=r;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 r=new Mve(i.modified),o=n.changes2.map(a=>a.toRangeMapping().toTextEdit(r).toSingleEditOperation());return i.original.pushStackElement(),i.original.pushEditOperations(null,o,()=>null),i.original.pushStackElement(),o.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 r=n.map(TTe.asEditOperation);t.object.textEditorModel.pushEditOperations(null,r,()=>null),i+=r.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))}};RCe=D([_(0,pn),_(1,qt),_(2,ir)],RCe);var MCe,fR;let EZ=(fR=class{constructor(e,t,i,n,r){this._session=e,this._editor=t,this._zone=i,this._textFileService=n,this._instaService=r,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(RCe);for(const n of this._session.chatModel.getRequests())if(n.response?.response){for(const r of n.response.response.value)if(r.kind==="textEditGroup"&&!(e&&Yi(r.uri,this._session.textModelN.uri))&&(await i.apply(n.response,r,void 0),r.uri.scheme===pe.untitled)){const o=this._textFileService.untitled.get(r.uri);o&&t.push(o)}}for(const n of t)n.isDisposed()||(await n.resolve(),await n.save({reason:Sn.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:MCe._decoBlock});return vM(t),t}},MCe=fR,fR._decoBlock=Kt.register({description:"inline-chat",showIfCollapsed:!1,isWholeLine:!0,className:"inline-chat-block-selection"}),fR);EZ=MCe=D([_(3,Fr),_(4,we)],EZ);let NCe=class extends EZ{constructor(e,t,i,n,r,o,a){super(e,t,i,o,a),this._ctxDocumentChanged=y5t.bindTo(r);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()}};NCe=D([_(3,fi),_(4,Le),_(5,Fr),_(6,we)],NCe);let PCe=class extends EZ{constructor(e,t,i,n,r,o,a,c,l){super(e,t,i,c,l),this._editorWorkerService=r,this._accessibilityService=o,this._configService=a,this._decoInsertedText=Kt.register({description:"inline-modified-line",className:"inline-chat-inserted-range-linehighlight",isWholeLine:!0,overviewRuler:{position:Il.Full,color:DOe(R5t)},minimap:{position:Rh.Inline,color:DOe(M5t)}}),this._decoInsertedTextRange=Kt.register({description:"inline-chat-inserted-range-linehighlight",className:"inline-chat-inserted-range",stickiness:si.NeverGrowsWhenTypingAtEdges}),this._editCount=0,this.acceptHunk=()=>super.acceptHunk(),this.discardHunk=()=>super.discardHunk(),this._hunkDisplayData=new Map,this._ctxCurrentChangeHasDiff=C5t.bindTo(n),this._ctxCurrentChangeShowsDiff=S5t.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 r=new hu(o=>{const a=new Set;for(const d of o)mi.fromRange(d.range).forEach(h=>a.add(h));const c=this._progressiveEditingDecorations.getRanges().map(mi.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,r,n)}async _makeChanges(e,t,i,n,r){if(r&&this._editor.pushUndoStop(),this._editCount++,i){const o=i.duration/1e3;for(const a of e){const l=Yit(a.text??"")/o,d=W5t(new d6(this._zone.domNode),a,l,i.token);await B5t(this._session.textModelN,d,n,t)}}else t.start(),this._session.textModelN.pushEditOperations(null,e,o=>(n?.report(o),null)),t.stop()}async renderChanges(){this._progressiveEditingDecorations.clear();const e=()=>{let t;if(Rue(this._editor,(i,n)=>{const r=new Set(this._hunkDisplayData.keys());t=void 0;for(const o of this._session.hunkData.getInfo()){r.delete(o);const a=o.getRangesN();let c=this._hunkDisplayData.get(o);if(c)if(o.getState()!==Vh.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{o.acceptChanges(),e()},h=()=>{o.discardChanges(),e()},u=this._session.textModel0.mightContainNonBasicASCII(),f=this._session.textModel0.mightContainRTL(),p=jae.fromEditor(this._editor),m=o.getRanges0()[0],v=new aXe(mi.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:oXe(v,p,[new WO(new F(m.startLineNumber,1,m.startLineNumber,1),"",Xa.Regular)],b).heightInLines,domNode:b},C=()=>{const R=ym.capture(this._editor);Rue(this._editor,(z,G)=>{if(Lt(c),c.viewZoneId)G.removeZone(c.viewZoneId),c.viewZoneId=void 0;else{const[Y]=o.getRangesN();y.afterLineNumber=Y.startLineNumber-1,c.viewZoneId=G.addZone(y)}}),this._ctxCurrentChangeShowsDiff.set(typeof c?.viewZoneId=="string"),R.restore(this._editor)},A=()=>{Rue(this._editor,(R,z)=>{Lt(c);for(const G of c.decorationIds)R.removeDecoration(G);c.viewZoneId&&z.removeZone(c.viewZoneId),c.decorationIds=[],c.viewZoneId=void 0})},L=R=>{Lt(t);const z=[];for(const G of this._session.hunkData.getInfo())G.getState()===Vh.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=r=>t.move(r)}else if(this._hunkDisplayData.size>0){let i=!1;for(const n of this._session.hunkData.getInfo())if(n.getState()===Vh.Accepted){i=!0;break}i?this._onDidAccept.fire():this._onDidDiscard.fire()}return t};return e()?.position}_updateSummaryMessage(e,t){const i=this._configService.getValue(Kh.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 r;i&&(r=g(10598,"Review (accept or discard) all changes before continuing")),this._zone.widget.updateStatus(n,{title:r})}hasFocus(){return this._zone.widget.hasFocus()}getWholeRangeDecoration(){return[]}};PCe=D([_(3,Le),_(4,Pl),_(5,_o),_(6,Te),_(7,Fr),_(8,we)],PCe);function Rue(s,e){s.changeDecorations(t=>{s.changeViewZones(i=>{e(t,i)})})}var G5t=".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}";gt(G5t,{});let FCe=class extends ADt{constructor(e,t,i,n,r,o){super(e),this._options=t,this._contextMenuService=i,this._keybindingService=n,this._hoverService=o,this._store=new Z,this._updateStore=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._actionRunner=this._store.add(new q_),t?.telemetrySource&&this._actionRunner.onDidRun(a=>{r.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(Yk());for(let r=0;r0,a=e[r];let c,l;if(a instanceof Hk&&a.actions.length>0){const[u,...f]=a.actions;c=u,l=this.addButtonWithDropdown({secondary:i(c)?.isSecondary??o,actionRunner:this._actionRunner,actions:f,contextMenuProvider:this._contextMenuService,ariaLabel:c.label})}else c=a,l=this.addButton({secondary:i(c)?.isSecondary??o,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 Ac&&He.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 r=this.addButton({secondary:!0,ariaLabel:g(11520,"More Actions")});r.icon=ve.dropDownButton,r.element.classList.add("default-colors","monaco-text-button"),r.enabled=!0,this._updateStore.add(this._hoverService.setupManagedHover(n,r.element,g(11520,"More Actions"))),this._updateStore.add(r.onDidClick(async()=>{this._contextMenuService.showContextMenu({getAnchor:()=>r.element,getActions:()=>t,actionRunner:this._actionRunner,onHide:()=>r.element.setAttribute("aria-expanded","false")}),r.element.setAttribute("aria-expanded","true")}))}this._onDidChange.fire(this)}};FCe=D([_(2,lo),_(3,Vt),_(4,Ji),_(5,tc)],FCe);let OCe=class extends FCe{constructor(e,t,i,n,r,o,a,c,l){super(e,i,o,a,c,l);const d=n.createMenu(t,r);this._store.add(d);const h=()=>{this.clear();const u=[],f=[];vC(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")}};OCe=D([_(3,Ba),_(4,Le),_(5,lo),_(6,Vt),_(7,Ji),_(8,tc)],OCe);var K5t='.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}';gt(K5t,{});var q5t=".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}";gt(q5t,{});let BCe=class{constructor(e){this._accessibleViewService=e}getWidgetRole(){return"list"}getRole(e){return"listitem"}getWidgetAriaLabel(){return g(7005,"Chat")}getAriaLabel(e){return zu(e)?e.messageText:bs(e)?this._getLabelWithCodeBlockCount(e):aB(e)?e.content.map(t=>"value"in t?t.value:t.map(i=>i.message).join(` +`)}};wCe=D([_(2,we)],wCe);class U4e{get id(){return this._model.id}get dataId(){return this.id+`_${Ng[this._model.session.initState]}_${Hc(this.variables)}`}get sessionId(){return this._model.session.sessionId}get username(){return this._model.username}get avatarIcon(){return this._model.avatarIconUri}get message(){return this._model.message}get messageText(){return this.message.text}get attempt(){return this._model.attempt}get variables(){return this._model.variableData.variables}get contentReferences(){return this._model.response?.contentReferences}constructor(e){this._model=e}}let iz=class extends V{get model(){return this._model}get id(){return this._model.id}get dataId(){return this._model.id+`_${this._modelChangeCount}_${Ng[this._model.session.initState]}`}get sessionId(){return this._model.session.sessionId}get username(){return this.agent?this.chatAgentNameService.getAgentNameRestriction(this.agent)?this.agent.fullName||this.agent.name:$ce(this.agent):this._model.username}get avatarIcon(){return this._model.avatarIcon}get agent(){return this._model.agent}get slashCommand(){return this._model.slashCommand}get agentOrSlashCommandDetected(){return this._model.agentOrSlashCommandDetected}get response(){return this._model.response}get usedContext(){return this._model.usedContext}get contentReferences(){return this._model.contentReferences}get codeCitations(){return this._model.codeCitations}get progressMessages(){return this._model.progressMessages}get isComplete(){return this._model.isComplete}get isCanceled(){return this._model.isCanceled}get replyFollowups(){return this._model.followups?.filter(e=>e.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(),r=Yit(e.response.toString()),o=Math.max(n-this._contentUpdateTimings.firstWordTime,250),a=this._contentUpdateTimings.lastWordCount/(o/1e3);this.trace("onDidChange",`Update- got ${this._contentUpdateTimings.lastWordCount} words over last ${o}ms = ${a} words/s. ${r} 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:r}}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)}};iz=D([_(1,Ke),_(2,lce)],iz);var qW;(function(s){s[s.UP=0]="UP",s[s.DOWN=1]="DOWN",s[s.LEFT=2]="LEFT",s[s.RIGHT=3]="RIGHT"})(qW||(qW={}));var V4e;(function(s){s[s.HORIZONTAL=0]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL"})(V4e||(V4e={}));var yCe;(function(s){s[s.FIRST=0]="FIRST",s[s.LAST=1]="LAST",s[s.NEXT=2]="NEXT",s[s.PREVIOUS=3]="PREVIOUS"})(yCe||(yCe={}));var z4e;(function(s){s[s.MAXIMIZE=0]="MAXIMIZE",s[s.EXPAND=1]="EXPAND",s[s.EVEN=2]="EVEN"})(z4e||(z4e={}));var $4e;(function(s){s[s.COPY_EDITORS=0]="COPY_EDITORS",s[s.MOVE_EDITORS=1]="MOVE_EDITORS"})($4e||($4e={}));function G4e(s){const e=s;return ya(e?.editor)&&ya(e?.replacement)}var gu;(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"})(gu||(gu={}));function KNe(s){const e=s;return!!e&&typeof e.id=="number"&&Array.isArray(e.editors)}function QW(s){return s.getValue("workbench.editor.openSideBySideDirection")==="down"?qW.DOWN:qW.RIGHT}const pA=-1,nv=-2,u5t=-3;function Jit(s){return typeof s=="number"||KNe(s)}const Xit=Pe(4617,"Chat"),g5t="workbench.action.chat.open";var Kh;(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"})(Kh||(Kh={}));var Hy;(function(s){s.Live="live",s.Preview="preview"})(Hy||(Hy={}));je.as(Pn.Configuration).registerConfiguration({id:"editor",properties:{[Kh.Mode]:{description:g(7041,"Configure if changes crafted with inline chat are applied directly to the document or are previewed first."),default:Hy.Live,type:"string",enum:[Hy.Live,Hy.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"]},[Kh.FinishOnType]:{description:g(7044,"Whether to finish an inline chat session when typing outside of changed regions."),default:!1,type:"boolean"},[Kh.AcceptedOrDiscardBeforeSave]:{description:g(7045,"Whether pending inline chat sessions prevent saving."),default:!0,type:"boolean"},[Kh.HoldToSpeech]:{description:g(7046,"Whether holding the inline chat keybinding will automatically enable speech recognition."),default:!0,type:"boolean"},[Kh.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.")]},[Kh.ExpTextButtons]:{description:g(7051,"Whether to use textual buttons."),default:!1,type:"boolean",tags:["experimental"]}}});const K4e="interactiveEditor";var z1;(function(s){s.None="none",s.Messages="messages",s.MessagesAndEdits="messagesAndEdits"})(z1||(z1={}));const f5t=new Q("inlineChatHasProvider",!1,g(7052,"Whether a provider for interactive editors exists")),p5t=new Q("inlineChatVisible",!1,g(7053,"Whether the interactive editor input is visible")),m5t=new Q("inlineChatFocused",!1,g(7054,"Whether the interactive editor input is focused")),_5t=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 v5t=new Q("inlineChatOuterCursorPosition","",g(7061,"Whether the cursor of the outer editor is above or below the interactive editor input")),b5t=new Q("inlineChatHasStashedSession",!1,g(7062,"Whether interactive editor has kept a session for quick restore")),w5t=new Q("inlineChatUserDidEdit",void 0,g(7063,"Whether the user did changes ontop of the inline chat")),y5t=new Q("inlineChatDocumentChanged",!1,g(7064,"Whether the document has changed concurrently")),C5t=new Q("inlineChatChangeHasDiff",!1,g(7065,"Whether the current change supports showing a diff")),S5t=new Q("inlineChatChangeShowsDiff",!1,g(7066,"Whether the current change showing a diff"));new Q("config.inlineChat.mode",Hy.Live);const A5t=new Q("inlineChatRequestInProgress",!1,g(7067,"Whether an inline chat request is currently in progress")),E5t=new Q("inlineChatResponseType",z1.None,g(7068,"What type was the responses have been receieved, nothing yet, just messages, or messaged and local edits"));he.equals(`config.${[Kh.ExpTextButtons]}`,!0);const x5t="inlineChat.acceptChanges",D5t="inlineChat.regenerate",k5t="inlineChat.toggleDiff",Zit=_e.for("inlineChat.execute"),I5t=_e.for("inlineChat.content.status"),T5t=_e.for("inlineChatWidget.status"),L5t=W("inlineChat.foreground",PN,g(7069,"Foreground color of the interactive editor widget")),CCe=W("inlineChat.background",kh,g(7070,"Background color of the interactive editor widget"));W("inlineChat.border",v6,g(7071,"Border color of the interactive editor widget"));W("inlineChat.shadow",kI,g(7072,"Shadow color of the interactive editor widget"));W("inlineChatInput.border",v6,g(7073,"Border color of the interactive editor input"));W("inlineChatInput.focusBorder",bp,g(7074,"Border color of the interactive editor input when focused"));W("inlineChatInput.placeholderForeground",tmt,g(7075,"Foreground color of the interactive editor input placeholder"));W("inlineChatInput.background",Y2,g(7076,"Background color of the interactive editor input"));W("inlineChatDiff.inserted",rt(wy,.5),g(7077,"Background color of inserted text in the interactive editor input"));const R5t=W("editorOverviewRuler.inlineChatInserted",{dark:rt(wy,.6),light:rt(wy,.8),hcDark:rt(wy,.6),hcLight:rt(wy,.8)},g(7078,"Overview ruler marker color for inline chat inserted content.")),M5t=W("editorOverviewRuler.inlineChatInserted",{dark:rt(wy,.6),light:rt(wy,.8),hcDark:rt(wy,.6),hcLight:rt(wy,.8)},g(7078,"Overview ruler marker color for inline chat inserted content."));W("inlineChatDiff.removed",rt(cF,.5),g(7079,"Background color of removed text in the interactive editor input"));W("editorOverviewRuler.inlineChatRemoved",{dark:rt(cF,.6),light:rt(cF,.8),hcDark:rt(cF,.6),hcLight:rt(cF,.8)},g(7080,"Overview ruler marker color for inline chat removed content."));var v0;const n8=class n8{constructor(e,t){this._textModel=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._decorationIds=[],this._decorationIds=e.deltaDecorations([],[{range:t,options:n8._options}])}dispose(){this._onDidChange.dispose(),this._textModel.isDisposed()||this._textModel.deltaDecorations(this._decorationIds,[])}fixup(e){const t=[];for(const{modified:o}of e){const a=o.isEmpty?new F(o.startLineNumber,1,o.startLineNumber,this._textModel.getLineLength(o.startLineNumber)):new F(o.startLineNumber,1,o.endLineNumberExclusive-1,this._textModel.getLineLength(o.endLineNumberExclusive-1));t.push({range:a,options:n8._options})}const[i,...n]=this._decorationIds,r=this._textModel.deltaDecorations(n,t);this._decorationIds=[i].concat(r),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}};n8._options=Kt.register({description:"inlineChat/session/wholeRange"});let SCe=n8;class N5t{constructor(e,t,i,n,r,o,a,c){this.editMode=e,this.targetUri=t,this.textModel0=i,this.textModelN=n,this.agent=r,this.wholeRange=o,this.hunkData=a,this.chatModel=c,this._isUnstashed=!1,this._exchanges=[],this._startTime=new Date,this.textModelNAltVersion=n.getAlternativeVersionId(),this._teldata={extension:An.toKey(r.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}};ECe=D([_(3,Le),_(4,xMe),_(5,Ke)],ECe);function q4e(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 ck;let xCe=(ck=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:r,textModel0Decorations:o,state:a}of this._data.values())if(a===Vh.Pending)for(let c=1;cF.compareRangesUsingStarts(r.rangeN,o.rangeN)),i.sort(F.compareRangesUsingStarts);const n=[];for(const r of e.changes){let o=!1,a=0;for(const{rangeN:f,range0:p}of t)if(f.getEndPosition().isBefore(F.getStartPosition(r.range)))a+=this._textModelN.getValueLengthInRange(f),a-=this._textModel0.getValueLengthInRange(p);else if(F.areIntersectingOrTouching(f,r.range)){o=!0;break}else break;if(o)continue;const c=r.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+r.rangeLength);n.push(es.replace(F.fromPositions(h,u),r.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 r=1;rnew O5t(r.original,r.modified,r.innerChanges??[]));this._textModelN.changeDecorations(r=>{this._textModel0.changeDecorations(o=>{for(const{textModelNDecorations:a,textModel0Decorations:c}of this._data.values())a.forEach(r.removeDecoration,r),c.forEach(o.removeDecoration,o);this._data.clear();for(const a of n){const c=[],l=[];c.push(r.addDecoration(q4e(a.modified,this._textModelN),v0._HUNK_TRACKED_RANGE)),l.push(o.addDecoration(q4e(a.original,this._textModel0),v0._HUNK_TRACKED_RANGE));for(const d of a.changes)c.push(r.addDecoration(d.modifiedRange,v0._HUNK_TRACKED_RANGE)),l.push(o.addDecoration(d.originalRange,v0._HUNK_TRACKED_RANGE));this._data.set(a,{editState:e,textModelNDecorations:c,textModel0Decorations:l,state:Vh.Pending})}})})}get size(){return this._data.size}get pending(){return ui.reduce(this._data.values(),(e,{state:t})=>e+(t===Vh.Pending?1:0),0)}_discardEdits(e){const t=[],i=e.getRangesN(),n=e.getRanges0();for(let r=1;r(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 r=i.textModelNDecorations.map(o=>this._textModelN.getDecorationRange(o));return vM(r),r},getRanges0:()=>{const r=i.textModel0Decorations.map(o=>this._textModel0.getDecorationRange(o));return vM(r),r},discardChanges:()=>{if(i.state===Vh.Pending){const r=this._discardEdits(n);this._textModelN.pushEditOperations(null,r,()=>null),i.state=Vh.Rejected}},acceptChanges:()=>{if(i.state===Vh.Pending){const r=[],o=n.getRangesN(),a=n.getRanges0();for(let c=1;cnull),i.state=Vh.Accepted,i.editState.applied+=1}}};e.push(n)}return e}},v0=ck,ck._HUNK_TRACKED_RANGE=Kt.register({description:"inline-chat-hunk-tracked-range",stickiness:si.AlwaysGrowsWhenTypingAtEdges}),ck._HUNK_THRESHOLD=8,ck);xCe=v0=D([_(0,Fl)],xCe);class O5t{constructor(e,t,i){this.original=e,this.modified=t,this.changes=i}}var Vh;(function(s){s[s.Pending=0]="Pending",s[s.Accepted=1]="Accepted",s[s.Rejected=2]="Rejected"})(Vh||(Vh={}));async function B5t(s,e,t,i){const[n]=s.deltaDecorations([],[{range:e.range,options:{description:"asyncTextEdit",stickiness:si.AlwaysGrowsWhenTypingAtEdges}}]);let r=!0;for await(const o 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=r?es.replace(a,o):es.insert(a.getEndPosition(),o);i?.start(),s.pushEditOperations(null,[c],l=>(t?.report(l),null)),i?.stop(),r=!1}}function W5t(s,e,t,i){t=Math.max(30,t);const n=new V2;let r=e.text??"";s.cancelAndSet(()=>{if(i.isCancellationRequested)return;const a=GNe(r,1);n.emitOne(a.value),r=r.substring(a.value.length),a.isFullString&&(s.cancel(),n.resolve(),o.dispose())},1e3/t);const o=i.onCancellationRequested(()=>{s.cancel(),n.resolve(),o.dispose()});return{range:e.range,newText:n.asyncIterable}}var H5t=".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}";gt(H5t,{});function qNe(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 U5t(){return{isSimpleWidget:!0,contributions:dp.getSomeEditorContributions([BA.ID,Lce,Hb.ID,tf.ID,pc.ID,HA.ID])}}function tw(s){if(!(!s||!s.resource))return N.isUri(s.resource)?s.resource:s.resource.primary}const V5t={onDidChangeVisibility:M.None};let KA=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this.instantiationService=t,this.configurationService=i,this.modelService=n,this.workspaceService=r,this.languageService=o,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(aRe)&&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(kCe,e,t),n={element:i.element,onDidRender:i.onDidRender,setLabel:(r,o,a)=>i.setLabel(r,o,a),setResource:(r,o)=>i.setResource(r,o),setFile:(r,o)=>i.setFile(r,o),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)),wt(e)}clear(){this.widgets=wt(this.widgets),this.labels=[]}dispose(){super.dispose(),this.clear()}};KA=D([_(1,we),_(2,Te),_(3,fi),_(4,Ci),_(5,Di),_(6,aE),_(7,mn),_(8,Os),_(9,Fr)],KA);let DCe=class extends KA{get element(){return this.label}constructor(e,t,i,n,r,o,a,c,l,d,h){super(V5t,i,n,r,o,a,c,l,d,h),this.label=this._register(this.create(e,t))}};DCe=D([_(2,we),_(3,Te),_(4,fi),_(5,Ci),_(6,Di),_(7,aE),_(8,mn),_(9,Os),_(10,Fr)],DCe);var s1;(function(s){s[s.Basic=1]="Basic",s[s.Full=2]="Full"})(s1||(s1={}));let kCe=class extends P3{constructor(e,t,i,n,r,o,a,c,l){super(e,t),this.languageService=i,this.modelService=n,this.decorationsService=r,this.labelService=o,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 yn),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===s1.Full,updateDecoration:this.needsRedraw===s1.Full}),this.needsRedraw=void 0))}notifyModelLanguageChanged(e){this.handleModelEvent(e)}notifyModelAdded(e){this.handleModelEvent(e)}handleModelEvent(e){const t=tw(this.label);t&&Yi(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=tw(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){tw(this.label)?.scheme===e&&this.render({updateIcon:!1,updateDecoration:!1})}notifyUntitledLabelChange(e){Yi(e,tw(this.label))&&this.render({updateIcon:!1,updateDecoration:!1})}notifyWorkspaceFoldersChange(){if(typeof this.computedWorkspaceFolderLabel=="string"){const e=tw(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===wa.ROOT_FOLDER){const o=this.contextService.getWorkspaceFolder(e);o&&(n=o.name,this.computedWorkspaceFolderLabel=n)}n||(n=Yw(TA(e)))}let r;if(!t?.hidePath){const o=this.labelService.getUriLabel(Ro(e),{relative:!0});o&&o!=="."&&(r=o)}this.setResource({resource:e,name:n,description:r,range:t?.range},t)}setResource(e,t=Object.create(null)){const i=tw(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 r=this.hasResourceChanged(e),o=r||this.hasPathLabelChanged(e),a=this.hasFileKindChanged(t),c=this.hasIconChanged(t);this.label=e,this.options=t,r&&(this.computedLanguageId=void 0),o&&(this.computedPathLabel=void 0),this.render({updateIcon:r||a||c,updateDecoration:r||a})}hasFileKindChanged(e){const t=e?.fileKind,i=this.options?.fileKind;return t!==i}hasResourceChanged(e){const t=tw(e),i=tw(this.label);return t&&i?t.toString()!==i.toString():!(!t&&!i)}hasPathLabelChanged(e){const t=tw(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!==s1.Full&&(this.needsRedraw=e.updateIcon||e.updateDecoration?s1.Full:s1.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=tw(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=Wx(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!==wa.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 r=`${t.title.markdown} • ${n.tooltip}`;t.title={markdown:r,markdownNotSupportedFallback:r}}}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}};kCe=D([_(2,Di),_(3,fi),_(4,aE),_(5,Os),_(6,Fr),_(7,Ci),_(8,RZe)],kCe);const a_=fe,z5t="vscode-local-file";function $5t(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 ey=10;let ICe=class extends V{constructor(e,t,i,n,r,o,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=a_(".interactive-result-code-block"),this.contextKeyService=this._register(o.createScoped(this.element));const d=this._register(r.createChild(new Vc([Le,this.contextKeyService]))),h=oe(this.element,a_(".interactive-result-editor"));this.editor=this.createEditor(d,h,{...qNe(this.configurationService),readOnly:!0,lineNumbers:"off",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:8,dragAndDrop:!1,padding:{top:ey,bottom:ey},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=oe(this.element,a_(".interactive-result-code-block-toolbar")),f=this.editor.contextKeyService.createScoped(u),p=this._register(d.createChild(new Vc([Le,f])));this.toolbar=this._register(p.createInstance(Cm,u,t,{menuOptions:{shouldForwardArgs:!0}}));const m=oe(this.element,a_(".interactive-result-vulns")),v=oe(m,a_(".interactive-result-vulns-header",void 0));this.vulnsButton=this._register(new Zd(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=oe(m,a_("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(bo.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"),fp.get(this.editor)?.stopHighlighting(),this.clearWidgets()})),this._register(this.editor.onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),fp.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(Kk,t,i,{isSimpleWidget:!1,contributions:dp.getSomeEditorContributions([BA.ID,Lce,Hb.ID,fp.ID,VW.ID,zA.ID,tN.ID,Oa.ID,Mh.ID,XM.ID,QM.ID])}))}focus(){this.editor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.editor.getLayoutInfo().contentWidth,t=this.editor.getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(ey-t,2):ey;this.editor.updateOptions({padding:{top:ey,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(bo.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"?dd.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(()=>Uk.setTabFocusMode(!0))),this.disposableStore.add(this.editor.onDidBlurEditorWidget(()=>Uk.setTabFocusMode(!1)))),this.editor.updateOptions({ariaLabel:g(10582,"Code block {0}",e.codeBlockIndex+1),readOnly:!i}),e.hideToolbar?Gd(this.toolbar.getElement()):Xh(this.toolbar.getElement()),e.vulns?.length&&bs(e.element)?(Ns(this.vulnsListElement),this.element.classList.remove("no-vulns"),this.element.classList.toggle("chat-vulnerabilities-collapsed",!e.element.vulnerabilitiesListExpanded),oe(this.vulnsListElement,...e.vulns.map(n=>a_("li",void 0,a_("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(){Oa.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,_t.Immediate)),this.toolbar.context={code:t.getTextBuffer().getValueInRange(e.range??t.getFullModelRange(),gr.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})`}};ICe=D([_(4,we),_(5,Le),_(6,fi),_(7,Te),_(8,_o)],ICe);let TCe=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)}};TCe=D([_(0,pn),_(1,fi)],TCe);let LCe=class extends V{constructor(e,t,i,n,r,o,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 yn),this.currentScrollWidth=0,this.element=a_(".interactive-result-code-block"),this.element.classList.add("compare"),this.messageElement=oe(this.element,a_(".message")),this.messageElement.setAttribute("role","status"),this.messageElement.tabIndex=0,this.contextKeyService=this._register(o.createScoped(this.element));const u=this._register(r.createChild(new Vc([Le,this.contextKeyService]))),f=oe(this.element,a_(".interactive-result-header.show-file-icons")),p=oe(this.element,a_(".interactive-result-editor"));this.diffEditor=this.createDiffEditor(u,p,{...qNe(this.configurationService),lineNumbers:"on",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:12,dragAndDrop:!1,padding:{top:ey,bottom:ey},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(DCe,f,{supportIcons:!0}));const m=this.diffEditor.getModifiedEditor().contextKeyService.createScoped(f),v=this._register(u.createChild(new Vc([Le,m])));this.toolbar=this._register(v.createInstance(Cm,f,t,{menuOptions:{shouldForwardArgs:!0}})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(b=>{b.affectedKeys.has(bo.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"),fp.get(this.diffEditor.getModifiedEditor())?.stopHighlighting(),this.clearWidgets()})),this._register(this.diffEditor.getModifiedEditor().onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),fp.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:dp.getSomeEditorContributions([BA.ID,Lce,Hb.ID,fp.ID,VW.ID,zA.ID,tN.ID,Oa.ID,XM.ID])};return this._register(e.createInstance(yp,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(ey-t,2):ey;this.diffEditor.updateOptions({padding:{top:ey,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(bo.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"?dd.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:wa.FILE,fileDecorations:{colors:!0,badges:!1}})}reset(){this.clearWidgets()}clearWidgets(){Oa.get(this.diffEditor.getOriginalEditor())?.hideContentHover(),Oa.get(this.diffEditor.getModifiedEditor())?.hideContentHover()}async updateEditor(e,t){if(!bs(e.element))return;const i=!!(e.edit.state?.applied??0);if($Pt.bindTo(this.contextKeyService).set(i),this.element.classList.toggle("no-diff",i),e.edit.state?.applied){const r=this.labelService.getUriLabel(e.edit.uri,{relative:!0,noPrefix:!0});let o;e.edit.state.applied===1?o=g(10588,"Made 1 change in [[``{0}``]]",r):e.edit.state.applied<0?o=g(10589,"Edits in [[``{0}``]] have been rejected",r):o=g(10590,"Made {0} changes in [[``{1}``]]",e.edit.state.applied,r);const a=JLe(o,{renderCodeSegments:!0,actionHandler:{callback:()=>{this.openerService.open(e.edit.uri,{fromUserGesture:!0,allowCommands:!1})},disposables:this._store}});ca(this.messageElement,a)}const n=await e.diffData;if(n){if(i)this.diffEditor.setModel(null),this._lastDiffEditorViewModel.value=void 0;else{const r=this.diffEditor.createViewModel({original:n.original,modified:n.modified});if(await r.waitForDiff(),t.isCancellationRequested)return;this.diffEditor.setModel(r),this._lastDiffEditorViewModel.value=r}this.toolbar.context={edit:e.edit,element:e.element,diffEditor:this.diffEditor}}}clearModel(){this.diffEditor.setModel(null)}};LCe=D([_(4,we),_(5,Le),_(6,fi),_(7,Te),_(8,_o),_(9,Os),_(10,Ar)],LCe);let RCe=class{constructor(e,t,i){this.modelService=e,this.editorService=t,this.dialogService=i,this._sha1=new oW}async apply(e,t,i){if(!e.response.value.includes(t)||t.state?.applied)return;if(!i)for(const r of this.editorService.listDiffEditors()){if(!r.getContainerDomNode().isConnected)continue;const o=r.getModel();if(!o||!Yi(o.original.uri,t.uri)||o.modified.uri.scheme!==pe.vscodeChatCodeCompareBlock){i=r;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 r=new Mve(i.modified),o=n.changes2.map(a=>a.toRangeMapping().toTextEdit(r).toSingleEditOperation());return i.original.pushStackElement(),i.original.pushEditOperations(null,o,()=>null),i.original.pushStackElement(),o.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 r=n.map(TTe.asEditOperation);t.object.textEditorModel.pushEditOperations(null,r,()=>null),i+=r.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))}};RCe=D([_(0,pn),_(1,qt),_(2,ir)],RCe);var MCe,fR;let EZ=(fR=class{constructor(e,t,i,n,r){this._session=e,this._editor=t,this._zone=i,this._textFileService=n,this._instaService=r,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(RCe);for(const n of this._session.chatModel.getRequests())if(n.response?.response){for(const r of n.response.response.value)if(r.kind==="textEditGroup"&&!(e&&Yi(r.uri,this._session.textModelN.uri))&&(await i.apply(n.response,r,void 0),r.uri.scheme===pe.untitled)){const o=this._textFileService.untitled.get(r.uri);o&&t.push(o)}}for(const n of t)n.isDisposed()||(await n.resolve(),await n.save({reason:Sn.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:MCe._decoBlock});return vM(t),t}},MCe=fR,fR._decoBlock=Kt.register({description:"inline-chat",showIfCollapsed:!1,isWholeLine:!0,className:"inline-chat-block-selection"}),fR);EZ=MCe=D([_(3,Fr),_(4,we)],EZ);let NCe=class extends EZ{constructor(e,t,i,n,r,o,a){super(e,t,i,o,a),this._ctxDocumentChanged=y5t.bindTo(r);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()}};NCe=D([_(3,fi),_(4,Le),_(5,Fr),_(6,we)],NCe);let PCe=class extends EZ{constructor(e,t,i,n,r,o,a,c,l){super(e,t,i,c,l),this._editorWorkerService=r,this._accessibilityService=o,this._configService=a,this._decoInsertedText=Kt.register({description:"inline-modified-line",className:"inline-chat-inserted-range-linehighlight",isWholeLine:!0,overviewRuler:{position:Tl.Full,color:DOe(R5t)},minimap:{position:Rh.Inline,color:DOe(M5t)}}),this._decoInsertedTextRange=Kt.register({description:"inline-chat-inserted-range-linehighlight",className:"inline-chat-inserted-range",stickiness:si.NeverGrowsWhenTypingAtEdges}),this._editCount=0,this.acceptHunk=()=>super.acceptHunk(),this.discardHunk=()=>super.discardHunk(),this._hunkDisplayData=new Map,this._ctxCurrentChangeHasDiff=C5t.bindTo(n),this._ctxCurrentChangeShowsDiff=S5t.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 r=new hu(o=>{const a=new Set;for(const d of o)mi.fromRange(d.range).forEach(h=>a.add(h));const c=this._progressiveEditingDecorations.getRanges().map(mi.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,r,n)}async _makeChanges(e,t,i,n,r){if(r&&this._editor.pushUndoStop(),this._editCount++,i){const o=i.duration/1e3;for(const a of e){const l=Yit(a.text??"")/o,d=W5t(new d6(this._zone.domNode),a,l,i.token);await B5t(this._session.textModelN,d,n,t)}}else t.start(),this._session.textModelN.pushEditOperations(null,e,o=>(n?.report(o),null)),t.stop()}async renderChanges(){this._progressiveEditingDecorations.clear();const e=()=>{let t;if(Rue(this._editor,(i,n)=>{const r=new Set(this._hunkDisplayData.keys());t=void 0;for(const o of this._session.hunkData.getInfo()){r.delete(o);const a=o.getRangesN();let c=this._hunkDisplayData.get(o);if(c)if(o.getState()!==Vh.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{o.acceptChanges(),e()},h=()=>{o.discardChanges(),e()},u=this._session.textModel0.mightContainNonBasicASCII(),f=this._session.textModel0.mightContainRTL(),p=jae.fromEditor(this._editor),m=o.getRanges0()[0],v=new aXe(mi.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:oXe(v,p,[new WO(new F(m.startLineNumber,1,m.startLineNumber,1),"",Xa.Regular)],b).heightInLines,domNode:b},C=()=>{const R=ym.capture(this._editor);Rue(this._editor,(z,G)=>{if(Lt(c),c.viewZoneId)G.removeZone(c.viewZoneId),c.viewZoneId=void 0;else{const[Y]=o.getRangesN();y.afterLineNumber=Y.startLineNumber-1,c.viewZoneId=G.addZone(y)}}),this._ctxCurrentChangeShowsDiff.set(typeof c?.viewZoneId=="string"),R.restore(this._editor)},A=()=>{Rue(this._editor,(R,z)=>{Lt(c);for(const G of c.decorationIds)R.removeDecoration(G);c.viewZoneId&&z.removeZone(c.viewZoneId),c.decorationIds=[],c.viewZoneId=void 0})},L=R=>{Lt(t);const z=[];for(const G of this._session.hunkData.getInfo())G.getState()===Vh.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=r=>t.move(r)}else if(this._hunkDisplayData.size>0){let i=!1;for(const n of this._session.hunkData.getInfo())if(n.getState()===Vh.Accepted){i=!0;break}i?this._onDidAccept.fire():this._onDidDiscard.fire()}return t};return e()?.position}_updateSummaryMessage(e,t){const i=this._configService.getValue(Kh.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 r;i&&(r=g(10598,"Review (accept or discard) all changes before continuing")),this._zone.widget.updateStatus(n,{title:r})}hasFocus(){return this._zone.widget.hasFocus()}getWholeRangeDecoration(){return[]}};PCe=D([_(3,Le),_(4,Fl),_(5,_o),_(6,Te),_(7,Fr),_(8,we)],PCe);function Rue(s,e){s.changeDecorations(t=>{s.changeViewZones(i=>{e(t,i)})})}var G5t=".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}";gt(G5t,{});let FCe=class extends ADt{constructor(e,t,i,n,r,o){super(e),this._options=t,this._contextMenuService=i,this._keybindingService=n,this._hoverService=o,this._store=new Z,this._updateStore=new Z,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._actionRunner=this._store.add(new q_),t?.telemetrySource&&this._actionRunner.onDidRun(a=>{r.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(Yk());for(let r=0;r0,a=e[r];let c,l;if(a instanceof Hk&&a.actions.length>0){const[u,...f]=a.actions;c=u,l=this.addButtonWithDropdown({secondary:i(c)?.isSecondary??o,actionRunner:this._actionRunner,actions:f,contextMenuProvider:this._contextMenuService,ariaLabel:c.label})}else c=a,l=this.addButton({secondary:i(c)?.isSecondary??o,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 Ac&&He.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 r=this.addButton({secondary:!0,ariaLabel:g(11520,"More Actions")});r.icon=ve.dropDownButton,r.element.classList.add("default-colors","monaco-text-button"),r.enabled=!0,this._updateStore.add(this._hoverService.setupManagedHover(n,r.element,g(11520,"More Actions"))),this._updateStore.add(r.onDidClick(async()=>{this._contextMenuService.showContextMenu({getAnchor:()=>r.element,getActions:()=>t,actionRunner:this._actionRunner,onHide:()=>r.element.setAttribute("aria-expanded","false")}),r.element.setAttribute("aria-expanded","true")}))}this._onDidChange.fire(this)}};FCe=D([_(2,lo),_(3,Vt),_(4,Ji),_(5,tc)],FCe);let OCe=class extends FCe{constructor(e,t,i,n,r,o,a,c,l){super(e,i,o,a,c,l);const d=n.createMenu(t,r);this._store.add(d);const h=()=>{this.clear();const u=[],f=[];vC(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")}};OCe=D([_(3,Wa),_(4,Le),_(5,lo),_(6,Vt),_(7,Ji),_(8,tc)],OCe);var K5t='.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}';gt(K5t,{});var q5t=".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}";gt(q5t,{});let BCe=class{constructor(e){this._accessibleViewService=e}getWidgetRole(){return"list"}getRole(e){return"listitem"}getWidgetAriaLabel(){return g(7005,"Chat")}getAriaLabel(e){return zu(e)?e.messageText:bs(e)?this._getLabelWithCodeBlockCount(e):aB(e)?e.content.map(t=>"value"in t?t.value:t.map(i=>i.message).join(` `)).join(` `):""}_getLabelWithCodeBlockCount(e){const t=this._accessibleViewService.getOpenAriaHint(bo.Chat);let i="";const n=e.response.value.filter(a=>!("value"in a))?.length??0;let r="";switch(n){case 0:break;case 1:r=g(7006,"1 file tree");break;default:r=g(7007,"{0} file trees",n);break}const o=Ku.lexer(e.response.toString()).filter(a=>a.type==="code")?.length??0;switch(o){case 0:i=t?g(7008,"{0} {1} {2}",r,e.response.toString(),t):g(7009,"{0} {1}",r,e.response.toString());break;case 1:i=t?g(7010,"{0} 1 code block: {1} {2}",r,e.response.toString(),t):g(7011,"{0} 1 code block: {1}",r,e.response.toString());break;default:i=t?g(7012,"{0} {1} code blocks: {2}",r,o,e.response.toString(),t):g(7013,"{0} {1} code blocks",r,o,e.response.toString());break}return i}};BCe=D([_(0,Tm)],BCe);let WCe=class extends Kf{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,n,r,o,a,c,l,d,h){super(null,e,{hoverDelegate:o?.hoverDelegate}),this._contextMenuProvider=r,this._options=o,this._container=null,this._dropdownContainer=null,this._primaryAction=new Pb(e,{hoverDelegate:o?.hoverDelegate},a,c,l,d,r,h),o?.actionRunner&&(this._primaryAction.actionRunner=o.actionRunner),this._dropdown=new cA(t,i,this._contextMenuProvider,{menuAsChild:o?.menuAsChild??!0,classNames:n?["codicon","codicon-chevron-down",n]:["codicon","codicon-chevron-down"],actionRunner:this._options?.actionRunner,keybindingProvider:this._options?.getKeyBinding,hoverDelegate:o?.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(oe(this._container,t)),this._dropdownContainer=fe(".dropdown-action-container"),this._dropdown.render(oe(this._container,this._dropdownContainer)),this._register(ue(t,ke.KEY_DOWN,i=>{const n=new xn(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 xn(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 cA(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()}};WCe=D([_(6,Vt),_(7,wi),_(8,Le),_(9,mn),_(10,_o)],WCe);const Gre=class Gre extends di{constructor(){super({id:Gre.ID,title:Pe(7120,"Send"),f1:!1,category:Xit,icon:ve.send,precondition:he.and(jMe,e9.negate()),keybinding:{when:YMe,primary:S.Enter,weight:Ae.EditorContrib},menu:[{id:_e.ChatExecuteSecondary,group:"group_1"},{id:_e.ChatExecute,when:e9.negate(),group:"navigation"}]})}run(e,...t){const i=t[0],n=e.get(qN);(i?.widget??n.lastFocusedWidget)?.acceptInput(i?.inputValue)}};Gre.ID="workbench.action.chat.submit";let HCe=Gre;const Kre=class Kre extends di{constructor(){super({id:Kre.ID,title:Pe(7121,"Submit to Secondary Agent"),precondition:he.and(jMe,wet.negate(),e9.negate()),keybinding:{when:YMe,primary:U.CtrlCmd|S.Enter,weight:Ae.EditorContrib},menu:{id:_e.ChatExecuteSecondary,group:"group_1"}})}run(e,...t){const i=t[0],r=e.get(wf).getSecondaryAgent();if(!r)return;const o=e.get(qN),a=i?.widget??o.lastFocusedWidget;a&&(r5t(a.parsedInput).agentPart?a.acceptInput():(a.lastSelectedAgent=r,a.acceptInputWithPrefix(`${i4}${r.name}`)))}};Kre.ID="workbench.action.chat.submitSecondaryAgent";let UCe=Kre;const qre=class qre extends di{constructor(){super({id:qre.ID,title:Pe(7123,"Cancel"),f1:!1,category:Xit,icon:ve.debugStop,menu:{id:_e.ChatExecute,when:e9,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(qN),r=i?.widget??n.lastFocusedWidget;if(!r)return;const o=e.get(Lm);r.viewModel&&o.cancelCurrentRequestForSession(r.viewModel.sessionId)}};qre.ID="workbench.action.chat.cancel";let VCe=qre;const Q5t=fe;let xZ=class extends V{constructor(e,t,i,n,r,o){super(),this.location=i,this.options=n,this.clickHandler=r,this.chatAgentService=o;const a=oe(e,Q5t(".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+=`${i4}${c.name} `,"subCommand"in t&&t.subCommand&&(i+=`${lI}${t.subCommand} `)}const n=t.kind==="reply"?t.title||t.message:t.title,r=t.kind==="reply"?t.message:t.title,o=(i+("tooltip"in t&&t.tooltip||r)).trim(),a=this._register(new Zd(e,{...this.options,title:o}));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 Nt(n),this._register(a.onDidClick(()=>this.clickHandler(t)))}};xZ=D([_(5,wf)],xZ);var RQ;const jI=fe,Q4e=250;var lk;let DZ=(lk=class extends V{get attachedContext(){return this._attachedContext}get inputPartHeight(){return this._inputPartHeight}get inputEditor(){return this._inputEditor}constructor(e,t,i,n,r,o,a,c,l,d){super(),this.location=e,this.options=t,this.historyService=i,this.modelService=n,this.instantiationService=r,this.contextKeyService=o,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(KA,{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(`${RQ.INPUT_SCHEME}:input-${RQ._counter++}`),this.inputEditorMaxHeight=this.options.renderStyle==="compact"?Q4e/3:Q4e,this.inputEditorHasText=jMe.bindTo(o),this.chatCursorAtTop=qPt.bindTo(o),this.inputEditorHasFocus=GPt.bindTo(o),this.history=this.loadHistory(),this._register(this.historyService.onDidClearHistory(()=>this.history=new AWe([{text:""}],50,j4e))),this._register(this.configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration(bo.Chat)&&this.inputEditor.updateOptions({ariaLabel:this._getAriaLabel()})}))}loadHistory(){const e=this.historyService.getHistory(this.location);return e.length===0&&e.push({text:""}),new AWe(e,50,j4e)}_getAriaLabel(){if(this.configurationService.getValue(bo.Chat)){const t=this.keybindingService.lookupKeybinding(eh.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(xh(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(Y4e(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()&&jt?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=oe(e,jI(".interactive-input-part")),this.container.classList.toggle("compact",this.options.renderStyle==="compact"),this.followupsContainer=oe(this.container,jI(".interactive-input-followups")),this.attachedContextContainer=oe(this.container,jI(".chat-attached-context")),this.initAttachedContext(this.attachedContextContainer);const n=oe(this.container,jI(".interactive-input-and-side-toolbar")),r=oe(n,jI(".interactive-input-and-execute-toolbar")),o=this._register(this.contextKeyService.createScoped(r));YMe.bindTo(o).set(!0);const a=this._register(this.instantiationService.createChild(new Vc([Le,o]))),{historyNavigationBackwardsEnablement:c,historyNavigationForwardsEnablement:l}=this._register(Ece(o,this));this.historyNavigationBackwardsEnablement=c,this.historyNavigationForewardsEnablement=l;const d=qNe(this.configurationService);d.overflowWidgetsDomNode=this.options.editorOverflowWidgetsDomNode,d.readOnly=!1,d.ariaLabel=this._getAriaLabel(),d.fontFamily=ELe,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=oe(r,jI(".interactive-input-editor"));const h=U5t();if(h.contributions?.push(...dp.getSomeEditorContributions([Fa.ID])),this._inputEditor=this._register(a.createInstance(Kk,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(),r.classList.toggle("focused",!0)})),this._register(this._inputEditor.onDidBlurEditorText(()=>{this.inputEditorHasFocus.set(!1),r.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(Y4e(p)))})),this.toolbar=this._register(this.instantiationService.createInstance(Cm,r,this.options.menus.executeToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0},hiddenItemStrategy:hA.Ignore,actionViewItemProvider:(f,p)=>{if(this.location===To.Panel&&(f.id===HCe.ID||f.id===VCe.ID)&&f instanceof Ac){const m=this.instantiationService.createInstance(Ac,{id:"chat.moreExecuteActions",title:g(7017,"More..."),icon:ve.chevronDown},void 0,void 0,void 0,void 0);return this.instantiationService.createInstance(zCe,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(Cm,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;Ns(e),this.attachedContextDisposables.clear(),WTe(!!this.attachedContext.size,this.attachedContextContainer),this.attachedContext.size||(this._indexOfLastAttachedContextDeletedWithKeyboard=-1),[...this.attachedContext.values()].forEach((i,n)=>{const r=oe(e,jI(".chat-attached-context-attachment.show-file-icons")),o=this._contextResourceLabels.create(r,{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=Kr(a.path),u=xb(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);o.setFile(a,{fileKind:wa.FILE,hidePath:!0,range:c}),r.ariaLabel=p,r.tabIndex=0}else{const h=i.fullName??i.name,u=i.icon?.id?`$(${i.icon.id}) ${h}`:h;o.setLabel(u,void 0),r.ariaLabel=g(7020,"Attached context, {0}",i.name),r.tabIndex=0}const l=new Zd(r,{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(),g_(h)){const u=new xn(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(),Ns(this.followupsContainer),e&&e.length>0&&this.followupsDisposables.add(this.instantiationService.createInstance(xZ,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 wn(t,e),this._layout(e,t)}_layout(e,t,i=!0){this.initAttachedContext(this.attachedContextContainer);const n=this.getLayoutData(),r=Math.min(n.inputPartEditorHeight,e-n.followupsHeight-n.inputPartVerticalPadding),o=t-n.inputPartHorizontalPadding;this.followupsContainer.style.width=`${o}px`,this._inputPartHeight=n.followupsHeight+r+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:r};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?Od(this.inputSideToolbarContainer)+4:0}}saveState(){const e=[...this.history];this.historyService.saveHistory(this.location,e)}},RQ=lk,lk.INPUT_SCHEME="chatSessionInput",lk._counter=0,lk);DZ=RQ=D([_(2,YXe),_(3,fi),_(4,we),_(5,Le),_(6,Te),_(7,Vt),_(8,_o),_(9,Ke)],DZ);const j4e=s=>JSON.stringify(s);function Y4e(s){return{lineNumber:s.getLineCount(),column:s.getLineLength(s.getLineCount())+1}}let zCe=class extends WCe{constructor(e,t,i,n,r,o,a,c,l,d){super(e,t,[],"",n,{getKeyBinding:f=>a.lookupKeybinding(f.id,o)},a,c,o,l,d);const h=i.createMenu(_e.ChatExecuteSecondary,o),u=()=>{const f=[];vC(h,{shouldForwardArgs:!0},f);const p=r.getSecondaryAgent();p&&f.forEach(m=>(m.id===UCe.ID&&(m.label=g(7021,"Send to @{0}",p.name)),m)),this.update(t,f)};u(),this._register(h.onDidChange(()=>u()))}};zCe=D([_(2,Ba),_(3,lo),_(4,wf),_(5,Le),_(6,Vt),_(7,wi),_(8,mn),_(9,_o)],zCe);var j5t='.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}';gt(j5t,{});const Y5t="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 J4e=["{"," // 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 X4e;(function(s){s[s.Local=1]="Local",s[s.Remote=2]="Remote",s[s.Web=3]="Web"})(X4e||(X4e={}));g(7542,"Extensions");var Ko;(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"})(Ko||(Ko={}));var $Ce;(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"})($Ce||($Ce={}));const J5t="addRootFolder";Pe(5518,"Add Folder to Workspace...");const X5t="setRootFolder",tnt="_workbench.pickWorkspaceFolder";vt.registerCommand({id:"workbench.action.files.openFileFolderInNewWindow",handler:s=>s.get(dg).pickFileFolderAndOpen({forceNewWindow:!0})});vt.registerCommand({id:"_files.pickFolderAndOpen",handler:(s,e)=>s.get(dg).pickFolderAndOpen(e)});vt.registerCommand({id:"workbench.action.files.openFolderInNewWindow",handler:s=>s.get(dg).pickFolderAndOpen({forceNewWindow:!0})});vt.registerCommand({id:"workbench.action.files.openFileInNewWindow",handler:s=>s.get(dg).pickFileAndOpen({forceNewWindow:!0})});vt.registerCommand({id:"workbench.action.openWorkspaceInNewWindow",handler:s=>s.get(dg).pickWorkspaceAndOpen({forceNewWindow:!0})});vt.registerCommand({id:J5t,handler:async s=>{const e=s.get(oC),t=await int(s);!t||!t.length||await e.addFolders(t.map(i=>({uri:i})))}});vt.registerCommand({id:X5t,handler:async s=>{const e=s.get(oC),t=s.get(Ci),i=await int(s);!i||!i.length||await e.updateFolders(0,t.getWorkspace().folders.length,i.map(n=>({uri:n})))}});async function int(s){const e=s.get(dg),t=s.get(Cf);return await e.showOpenDialog({openLabel:GMe(g(5519,"&&Add")),title:g(5520,"Add Folder to Workspace"),canSelectFolders:!0,canSelectMany:!0,defaultUri:await e.defaultFolderPath(),availableFileSystems:[t.defaultUriScheme]})}vt.registerCommand(tnt,async function(s,e){const t=s.get(Tn),i=s.get(Os),n=s.get(Ci),r=s.get(fi),o=s.get(Di),a=n.getWorkspace().folders;if(!a.length)return;const c=a.map(u=>{const f=u.name,p=i.getUriLabel(Ro(u.uri),{relative:!0});return{label:f,description:p!==f?p:void 0,folder:u,iconClasses:Wx(r,o,u.uri,wa.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)||Ue.None,h=await t.pick(c,l,d);if(h)return a[c.indexOf(h)]});vt.registerCommand({id:"vscode.openFolder",handler:(s,e,t)=>{const i=s.get(bi);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),r={forceNewWindow:t?.forceNewWindow,forceReuseWindow:t?.forceReuseWindow,noRecentEntry:t?.noRecentEntry,remoteAuthority:t?.forceLocalWindow?null:void 0,forceProfile:t?.forceProfile,forceTempProfile:t?.forceTempProfile},o=Fae(n)||n.scheme===pe.untitled?{workspaceUri:n}:{folderUri:n};return i.executeCommand("_files.windowOpen",[o],r)},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"}]}});vt.registerCommand({id:"vscode.newWindow",handler:(s,e)=>{const t=s.get(bi),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"}]}});vt.registerCommand("_workbench.removeFromRecentlyOpened",function(s,e){return s.get(RI).removeRecentlyOpened([e])});vt.registerCommand({id:"vscode.removeFromRecentlyOpened",handler:(s,e)=>{const t=s.get(RI);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}]}});vt.registerCommand("_workbench.addToRecentlyOpened",async function(s,e){const t=s.get(RI),i=e.uri,n=e.label,r=e.remoteAuthority;let o;return e.type==="workspace"?o={workspace:await t.getWorkspaceIdentifier(i),label:n,remoteAuthority:r}:e.type==="folder"?o={folderUri:i,label:n,remoteAuthority:r}:o={fileUri:i,label:n,remoteAuthority:r},t.addRecentlyOpened([o])});vt.registerCommand("_workbench.getRecentlyOpened",async function(s){return s.get(RI).getRecentlyOpened()});const mG=mn,DF=".vscode/extensions.json";let Z4e=class extends V{constructor(e,t,i,n,r,o){super(),this.workspaceContextService=e,this.fileService=t,this.quickInputService=i,this.modelService=n,this.languageService=r,this.jsonEditingService=o,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(DF))))&&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 Ya(e.flatMap(t=>t.recommendations?t.recommendations.map(i=>i.toLowerCase()):[]))}async getUnwantedRecommendations(){const e=await this.getExtensionsConfigs();return Ya(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 gi;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);n.set(l.uri,d)}));const r=i&&i.recommendations?.some(l=>l.toLowerCase()===e),o=t.folders.filter(l=>n.get(l.uri)?.recommendations?.some(d=>d.toLowerCase()===e)),a=r||o.length>0,c=a?await this.pickWorkspaceOrFolders(o,r?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)m_e(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 gi;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);n.set(l.uri,d)}));const r=i&&i.unwantedRecommendations?.some(l=>l===e),o=t.folders.filter(l=>n.get(l.uri)?.unwantedRecommendations?.some(d=>d===e)),a=r||o.length>0,c=a?await this.pickWorkspaceOrFolders(o,r?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)m_e(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 r=[];if(n){Array.isArray(i.recommendations)?r.push({path:["recommendations",-1],value:e}):r.push({path:["recommendations"],value:[e]});const o=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);o&&r.push(o)}else if(i.recommendations){const o=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);o&&r.push(o)}if(r.length)return this.jsonEditingService.write(t.toResource(DF),r,!0)}async addOrRemoveWorkspaceRecommendation(e,t,i,n){const r=[];if(i){if(n){const o=["extensions","recommendations"];Array.isArray(i.recommendations)?r.push({path:[...o,-1],value:e}):r.push({path:o,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);a&&r.push(a)}else if(i.recommendations){const o=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);o&&r.push(o)}}else n&&r.push({path:["extensions"],value:{recommendations:[e]}});if(r.length)return this.jsonEditingService.write(t.configuration,r,!0)}async addOrRemoveWorkspaceFolderUnwantedRecommendation(e,t,i,n){const r=[];if(n){const o=["unwantedRecommendations"];Array.isArray(i.unwantedRecommendations)?r.push({path:[...o,-1],value:e}):r.push({path:o,value:[e]});const a=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);a&&r.push(a)}else if(i.unwantedRecommendations){const o=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);o&&r.push(o)}if(r.length)return this.jsonEditingService.write(t.toResource(DF),r,!0)}async addOrRemoveWorkspaceUnwantedRecommendation(e,t,i,n){const r=[];if(i){if(n){const o=["extensions","unwantedRecommendations"];Array.isArray(i.recommendations)?r.push({path:[...o,-1],value:e}):r.push({path:o,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);a&&r.push(a)}else if(i.unwantedRecommendations){const o=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);o&&r.push(o)}}else n&&r.push({path:["extensions"],value:{unwantedRecommendations:[e]}});if(r.length)return this.jsonEditingService.write(t.configuration,r,!0)}async pickWorkspaceOrFolders(e,t,i){const n=t?[...e,t]:[...e];if(n.length===1)return n;const r=e.map(a=>({label:a.name,description:g(3849,"Workspace Folder"),workspaceOrFolder:a,iconClasses:Wx(this.modelService,this.languageService,a.uri,wa.ROOT_FOLDER)}));return t&&(r.push({type:"separator"}),r.push({label:g(3850,"Workspace"),workspaceOrFolder:t})),(await this.quickInputService.pick(r,{placeHolder:i,canPickMany:!0})||[]).map(a=>a.workspaceOrFolder)}async resolveWorkspaceExtensionConfig(e){try{const t=await this.fileService.readFile(e),i=af(t.value.toString()).extensions;return i?this.parseExtensionConfig(i):void 0}catch{}}async resolveWorkspaceFolderExtensionConfig(e){try{const t=await this.fileService.readFile(e.toResource(DF)),i=af(t.value.toString());return this.parseExtensionConfig(i)}catch{}return{}}parseExtensionConfig(e){return{recommendations:Ya((e.recommendations||[]).map(t=>t.toLowerCase())),unwantedRecommendations:Ya((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}}};Z4e=D([_(0,Ci),_(1,Xt),_(2,Tn),_(3,fi),_(4,Di),_(5,MI)],Z4e);oi("extensions-view-icon",ve.extensions,g(9483,"View icon of the extensions view."));const Z5t=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 ezt=oi("extensions-sync-enabled",ve.sync,g(9491,"Icon to indicate that an extension is synced.")),tzt=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 izt=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 ZC=oi("extensions-error-message",ve.error,g(9502,"Icon shown with a error message in the extensions editor.")),uh=oi("extensions-warning-message",ve.warning,g(9503,"Icon shown with a warning message in the extensions editor.")),n_=oi("extensions-info-message",ve.info,g(9504,"Icon shown with an info message in the extensions editor.")),YI=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 GCe(s){return s.scheme!==pe.file&&s.scheme!==pe.vscodeRemote}function QNe(s){if(s.folders.length)return s.folders.every(e=>GCe(e.uri))?s.folders[0].uri:void 0;if(s.configuration&&GCe(s.configuration))return s.configuration}function nnt(s){return QNe(s)?.scheme}function snt(s){return QNe(s)!==void 0}function Gce(s){return s.tags.find(e=>e.startsWith("lp-"))?.split("lp-")[1]}let eVe=class extends V{constructor(e){super(),this.extensionGalleryService=e}async getAvailableLanguages(){const e=new li;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(r=>r.properties.localizedLanguages?.length&&r.tags.some(o=>o.startsWith("lp-"))).map(r=>{const o=r.properties.localizedLanguages?.[0],a=Gce(r);return{...this.createQuickPickItem(a,o,r),extensionId:r.identifier.id,galleryExtension:r}});return n.push(this.createQuickPickItem("en","English")),n}createQuickPickItem(e,t,i){const n=t??e;let r;if(n!==e&&(r=`(${e})`),e.toLowerCase()===jl.toLowerCase()&&(r??="",r+=g(3255," (Current)")),i?.installCount){r??="";const o=i.installCount;let a;o>1e6?a=`${Math.floor(o/1e5)/10}M`:o>1e3?a=`${Math.floor(o/1e3)}K`:a=String(o),r+=` $(cloud-download) ${a}`}return{id:e,label:n,description:r}}};eVe=D([_(0,LI)],eVe);var IV,b0,DC,zP,w0,MQ,TV,$P,y0,NQ,PQ,FQ,OQ,BQ,LV,C0,S0,A0,E0,x0,WQ,HQ,UQ,VQ,RV,MV,IE,zQ,$Q;let YW=class extends an{constructor(e,t,i,n,r,o,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=r,this.openerService=o,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(Oo(this.error))return;if(this.logService.error(this.error),this.error.name===mw.Unsupported){const o=Hn?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,o),{confirmed:c}=await this.dialogService.confirm({type:Ze.Info,message:a,primaryButton:g(7876,"&&More Information"),cancelButton:g(7877,"Close")});c&&this.openerService.open(Hn?N.parse("https://aka.ms/vscode-web-extensions-guide"):N.parse("https://aka.ms/vscode-remote"));return}if(mw.ReleaseVersionNotFound===this.error.name){await this.dialogService.prompt({type:"error",message:ou(this.error),buttons:[{label:g(7878,"Install Pre-Release"),run:()=>{const o=this.instantiationService.createInstance(OT,{installPreReleaseVersion:!0});return o.extension=this.extension,o.run()}}],cancelButton:g(7879,"Cancel")});return}if([mw.Incompatible,mw.IncompatibleApi,mw.IncompatibleTargetPlatform,mw.Malicious,mw.Deprecated].includes(this.error.name)){await this.dialogService.info(ou(this.error));return}if(mw.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 o=this.instantiationService.createInstance(OT,{donotVerifySignature:!0});return o.extension=this.extension,o.run()}}],cancelButton:g(7879,"Cancel")});return}const e=this.installOperation===FA.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:${Ptt}`),i.push({label:g(7885,"Try Downloading Manually..."),run:()=>this.openerService.open(n).then(()=>{this.notificationService.prompt(Ze.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(wBt)}])})}));const r=`${e}${t?` ${t}`:""}`;this.notificationService.prompt(Ze.Error,r,i)}async getDownloadUrl(){if(gm||!this.extension.gallery||!this.productService.extensionsGallery||!this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionManagementServerService.remoteExtensionManagementServer)return;let e=this.extension.gallery.properties.targetPlatform;if(e!==xs.UNIVERSAL&&e!==xs.UNDEFINED&&this.extensionManagementServerService.remoteExtensionManagementServer)try{const t=await this.galleryService.getManifest(this.extension.gallery,Ue.None);t&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(t)&&(e=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform())}catch(t){this.logService.error(t);return}if(e!==xs.UNKNOWN)return N.parse(`${this.productService.extensionsGallery.serviceUrl}/publishers/${this.extension.publisher}/vsextensions/${this.extension.name}/${this.version}/vspackage${e!==xs.UNDEFINED?`?targetPlatform=${e}`:""}`)}};YW=D([_(4,xo),_(5,Ar),_(6,wi),_(7,ir),_(8,bi),_(9,Ke),_(10,gv),_(11,we),_(12,LI),_(13,Rm)],YW);const Bv=class Bv extends an{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)}};Bv.EXTENSION_ACTION_CLASS="extension-action",Bv.TEXT_ACTION_CLASS=`${Bv.EXTENSION_ACTION_CLASS} text`,Bv.LABEL_ACTION_CLASS=`${Bv.EXTENSION_ACTION_CLASS} label`,Bv.PROMINENT_LABEL_ACTION_CLASS=`${Bv.LABEL_ACTION_CLASS} prominent`,Bv.ICON_ACTION_CLASS=`${Bv.EXTENSION_ACTION_CLASS} icon`;let Cn=Bv;class jNe extends Cn{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(r=>!r.hidden));let i=[];for(const n of t)n.length&&(i=[...i,...n,new Eo]);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 cy;let OT=(cy=class extends Cn{set manifest(e){this._manifest=e,this.updateLabel()}constructor(e,t,i,n,r,o,a,c,l,d){super("extensions.install",g(7888,"Install"),IV.CLASS,!1),this.extensionsWorkbenchService=t,this.instantiationService=i,this.runtimeExtensionService=n,this.workbenchThemeService=r,this.labelService=o,this.dialogService=a,this.preferencesService=c,this.telemetryService=l,this.contextService=d,this._manifest=null,this.updateThrottler=new a6,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=IV.HIDE,this.hidden=!0,this.extension&&(this.extension.isBuiltin||this.extensionsWorkbenchService.canSetLanguage(this.extension)||this.extension.state===Qr.Uninstalled&&(this.options.installPreReleaseVersion&&!this.extension.hasPreReleaseVersion||!this.options.installPreReleaseVersion&&!this.extension.hasReleaseVersion||(this.hidden=!1,this.class=IV.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(o){o[o.InstallAnyway=0]="InstallAnyway",o[o.ShowAlternateExtension=1]="ShowAlternateExtension",o[o.ConfigureSettings=2]="ConfigureSettings",o[o.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 o=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:o.id,preRelease:o.preRelease}],Ue.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 o=this.extension.deprecationInfo.settings;n.push({label:g(7893,"&&Configure Settings"),run:async()=>(await this.preferencesService.openSettings({query:o.map(a=>`@id:${a}`).join(" ")}),i.ConfigureSettings)})}else this.extension.deprecationInfo.additionalInfo&&(t=new Nt(`${t} ${this.extension.deprecationInfo.additionalInfo}`));const{result:r}=await this.dialogService.prompt({type:Ze.Warning,message:g(7894,"Are you sure you want to install '{0}'?",this.extension.displayName),detail:Rt(t)?t:void 0,custom:Rt(t)?void 0:{markdownDetails:[{markdown:t}]},buttons:n,cancelButton:{run:()=>i.Cancel}});if(r!==i.InstallAnyway)return}this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:this.options.installPreReleaseVersion}),No(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){No(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(r=>Uy(r,e)))return this.instantiationService.createInstance(XCe);if((await this.workbenchThemeService.getFileIconThemes()).some(r=>Uy(r,e)))return this.instantiationService.createInstance(ZCe);if((await this.workbenchThemeService.getProductIconThemes()).some(r=>Uy(r,e)))return this.instantiationService.createInstance(eSe)}async install(e){try{return await this.extensionsWorkbenchService.install(e,this.options)}catch(t){await this.instantiationService.createInstance(YW,e,e.latestVersion,FA.Install,t).run();return}}async getRunningExtension(e){const t=await this.runtimeExtensionService.getExtension(e.identifier.id);return t||(this.runtimeExtensionService.canAddExtension(mD(e))?new Promise((i,n)=>{const r=this.runtimeExtensionService.onDidChangeExtensions(async()=>{const o=await this.runtimeExtensionService.getExtension(e.identifier.id);o&&(r.dispose(),i(o))})}):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")}},IV=cy,cy.CLASS=`${cy.LABEL_ACTION_CLASS} prominent install`,cy.HIDE=`${cy.CLASS} hide`,cy);OT=IV=D([_(1,Xr),_(2,we),_(3,ps),_(4,mG),_(5,Os),_(6,ir),_(7,Y6),_(8,Ji),_(9,Ci)],OT);let tVe=class extends jNe{set manifest(e){this.extensionActions.forEach(t=>t.manifest=e),this.update()}constructor(e,t){super("extensions.installActions",OT.CLASS,[[e.createInstance(OT,{installPreReleaseVersion:t.preferPreReleases}),e.createInstance(OT,{installPreReleaseVersion:!t.preferPreReleases})]])}getLabel(e){return e.getLabel(!0)}};tVe=D([_(0,we),_(1,Xr)],tVe);const A1=class A1 extends Cn{constructor(){super("extension.installing",A1.LABEL,A1.CLASS,!1)}update(){this.class=`${A1.CLASS}${this.extension&&this.extension.state===Qr.Installing?"":" hide"}`}};A1.LABEL=g(7901,"Installing"),A1.CLASS=`${Cn.LABEL_ACTION_CLASS} install installing`;let iVe=A1;var ly;let JW=(ly=class extends Cn{constructor(e,t,i,n,r,o){super(e,b0.INSTALL_LABEL,b0.Class,!1),this.server=t,this.canInstallAnyWhere=i,this.extensionsWorkbenchService=n,this.extensionManagementServerService=r,this.extensionManifestPropertiesService=o,this.updateWhenCounterExtensionChanges=!0,this.update()}update(){if(this.enabled=!1,this.class=b0.Class,this.canInstall()){const e=this.extensionsWorkbenchService.installed.filter(t=>Ma(t.identifier,this.extension.identifier)&&t.server===this.server)[0];e?e.state===Qr.Installing&&!e.local&&(this.enabled=!0,this.label=b0.INSTALLING_LABEL,this.class=b0.InstallingClass):(this.enabled=!0,this.label=this.getInstallLabel())}}canInstall(){return!this.extension||!this.server||!this.extension.local||this.extension.state!==Qr.Installed||this.extension.type!==wo.User||this.extension.enablementState===Ko.DisabledByEnvironment||this.extension.enablementState===Ko.DisabledByTrustRequirement||this.extension.enablementState===Ko.DisabledByVirtualWorkspace?!1:!!(sMe(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),No(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)}},b0=ly,ly.INSTALL_LABEL=g(7888,"Install"),ly.INSTALLING_LABEL=g(7901,"Installing"),ly.Class=`${Cn.LABEL_ACTION_CLASS} prominent install-other-server`,ly.InstallingClass=`${Cn.LABEL_ACTION_CLASS} install-other-server installing`,ly);JW=b0=D([_(3,Xr),_(4,gv),_(5,Rm)],JW);let KCe=class extends JW{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):JW.INSTALL_LABEL}};KCe=D([_(1,Xr),_(2,gv),_(3,Rm)],KCe);let nVe=class extends JW{constructor(e,t,i){super("extensions.localinstall",t.localExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(7903,"Install Locally")}};nVe=D([_(0,Xr),_(1,gv),_(2,Rm)],nVe);let sVe=class extends JW{constructor(e,t,i){super("extensions.webInstall",t.webExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(7904,"Install in Browser")}};sVe=D([_(0,Xr),_(1,gv),_(2,Rm)],sVe);var dy;let qCe=(dy=class extends Cn{constructor(e,t){super("extensions.uninstall",DC.UninstallLabel,DC.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===Qr.Uninstalling){this.label=DC.UninstallingLabel,this.class=DC.UnInstallingClass,this.enabled=!1;return}if(this.label=DC.UninstallLabel,this.class=DC.UninstallClass,this.tooltip=DC.UninstallLabel,e!==Qr.Installed){this.enabled=!1;return}if(this.extension.isBuiltin){this.enabled=!1;return}this.enabled=!0}async run(){if(this.extension){No(g(7907,"Uninstalling extension {0} started.",this.extension.displayName));try{await this.extensionsWorkbenchService.uninstall(this.extension),No(g(7908,"Please reload Visual Studio Code to complete the uninstallation of the extension {0}.",this.extension.displayName))}catch(e){Oo(e)||this.dialogService.error(ou(e))}}}},DC=dy,dy.UninstallLabel=g(7905,"Uninstall"),dy.UninstallingLabel=g(7906,"Uninstalling"),dy.UninstallClass=`${Cn.LABEL_ACTION_CLASS} uninstall`,dy.UnInstallingClass=`${Cn.LABEL_ACTION_CLASS} uninstall uninstalling`,dy);qCe=DC=D([_(0,Xr),_(1,ir)],qCe);var hy;let rVe=(hy=class extends Cn{constructor(e,t,i,n,r){super("extensions.update",g(7909,"Update"),zP.DisabledClass,!1),this.verbose=e,this.extensionsWorkbenchService=t,this.dialogService=i,this.openerService=n,this.instantiationService=r,this.updateThrottler=new a6,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=zP.DisabledClass,!this.extension||this.extension.deprecationInfo)return;const e=await this.extensionsWorkbenchService.canInstall(this.extension),t=this.extension.state===Qr.Installed;this.enabled=e&&t&&this.extension.outdated,this.class=this.enabled?zP.EnabledClass:zP.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} +`);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(xh(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(Y4e(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()&&jt?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=oe(e,jI(".interactive-input-part")),this.container.classList.toggle("compact",this.options.renderStyle==="compact"),this.followupsContainer=oe(this.container,jI(".interactive-input-followups")),this.attachedContextContainer=oe(this.container,jI(".chat-attached-context")),this.initAttachedContext(this.attachedContextContainer);const n=oe(this.container,jI(".interactive-input-and-side-toolbar")),r=oe(n,jI(".interactive-input-and-execute-toolbar")),o=this._register(this.contextKeyService.createScoped(r));YMe.bindTo(o).set(!0);const a=this._register(this.instantiationService.createChild(new Vc([Le,o]))),{historyNavigationBackwardsEnablement:c,historyNavigationForwardsEnablement:l}=this._register(Ece(o,this));this.historyNavigationBackwardsEnablement=c,this.historyNavigationForewardsEnablement=l;const d=qNe(this.configurationService);d.overflowWidgetsDomNode=this.options.editorOverflowWidgetsDomNode,d.readOnly=!1,d.ariaLabel=this._getAriaLabel(),d.fontFamily=ELe,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=oe(r,jI(".interactive-input-editor"));const h=U5t();if(h.contributions?.push(...dp.getSomeEditorContributions([Oa.ID])),this._inputEditor=this._register(a.createInstance(Kk,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(),r.classList.toggle("focused",!0)})),this._register(this._inputEditor.onDidBlurEditorText(()=>{this.inputEditorHasFocus.set(!1),r.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(Y4e(p)))})),this.toolbar=this._register(this.instantiationService.createInstance(Cm,r,this.options.menus.executeToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0},hiddenItemStrategy:hA.Ignore,actionViewItemProvider:(f,p)=>{if(this.location===To.Panel&&(f.id===HCe.ID||f.id===VCe.ID)&&f instanceof Ac){const m=this.instantiationService.createInstance(Ac,{id:"chat.moreExecuteActions",title:g(7017,"More..."),icon:ve.chevronDown},void 0,void 0,void 0,void 0);return this.instantiationService.createInstance(zCe,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(Cm,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;Ns(e),this.attachedContextDisposables.clear(),WTe(!!this.attachedContext.size,this.attachedContextContainer),this.attachedContext.size||(this._indexOfLastAttachedContextDeletedWithKeyboard=-1),[...this.attachedContext.values()].forEach((i,n)=>{const r=oe(e,jI(".chat-attached-context-attachment.show-file-icons")),o=this._contextResourceLabels.create(r,{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=Kr(a.path),u=xb(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);o.setFile(a,{fileKind:wa.FILE,hidePath:!0,range:c}),r.ariaLabel=p,r.tabIndex=0}else{const h=i.fullName??i.name,u=i.icon?.id?`$(${i.icon.id}) ${h}`:h;o.setLabel(u,void 0),r.ariaLabel=g(7020,"Attached context, {0}",i.name),r.tabIndex=0}const l=new Zd(r,{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(),g_(h)){const u=new xn(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(),Ns(this.followupsContainer),e&&e.length>0&&this.followupsDisposables.add(this.instantiationService.createInstance(xZ,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 wn(t,e),this._layout(e,t)}_layout(e,t,i=!0){this.initAttachedContext(this.attachedContextContainer);const n=this.getLayoutData(),r=Math.min(n.inputPartEditorHeight,e-n.followupsHeight-n.inputPartVerticalPadding),o=t-n.inputPartHorizontalPadding;this.followupsContainer.style.width=`${o}px`,this._inputPartHeight=n.followupsHeight+r+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:r};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?Od(this.inputSideToolbarContainer)+4:0}}saveState(){const e=[...this.history];this.historyService.saveHistory(this.location,e)}},RQ=lk,lk.INPUT_SCHEME="chatSessionInput",lk._counter=0,lk);DZ=RQ=D([_(2,YXe),_(3,fi),_(4,we),_(5,Le),_(6,Te),_(7,Vt),_(8,_o),_(9,Ke)],DZ);const j4e=s=>JSON.stringify(s);function Y4e(s){return{lineNumber:s.getLineCount(),column:s.getLineLength(s.getLineCount())+1}}let zCe=class extends WCe{constructor(e,t,i,n,r,o,a,c,l,d){super(e,t,[],"",n,{getKeyBinding:f=>a.lookupKeybinding(f.id,o)},a,c,o,l,d);const h=i.createMenu(_e.ChatExecuteSecondary,o),u=()=>{const f=[];vC(h,{shouldForwardArgs:!0},f);const p=r.getSecondaryAgent();p&&f.forEach(m=>(m.id===UCe.ID&&(m.label=g(7021,"Send to @{0}",p.name)),m)),this.update(t,f)};u(),this._register(h.onDidChange(()=>u()))}};zCe=D([_(2,Wa),_(3,lo),_(4,wf),_(5,Le),_(6,Vt),_(7,wi),_(8,mn),_(9,_o)],zCe);var j5t='.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}';gt(j5t,{});const Y5t="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 J4e=["{"," // 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 X4e;(function(s){s[s.Local=1]="Local",s[s.Remote=2]="Remote",s[s.Web=3]="Web"})(X4e||(X4e={}));g(7542,"Extensions");var Ko;(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"})(Ko||(Ko={}));var $Ce;(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"})($Ce||($Ce={}));const J5t="addRootFolder";Pe(5518,"Add Folder to Workspace...");const X5t="setRootFolder",tnt="_workbench.pickWorkspaceFolder";vt.registerCommand({id:"workbench.action.files.openFileFolderInNewWindow",handler:s=>s.get(dg).pickFileFolderAndOpen({forceNewWindow:!0})});vt.registerCommand({id:"_files.pickFolderAndOpen",handler:(s,e)=>s.get(dg).pickFolderAndOpen(e)});vt.registerCommand({id:"workbench.action.files.openFolderInNewWindow",handler:s=>s.get(dg).pickFolderAndOpen({forceNewWindow:!0})});vt.registerCommand({id:"workbench.action.files.openFileInNewWindow",handler:s=>s.get(dg).pickFileAndOpen({forceNewWindow:!0})});vt.registerCommand({id:"workbench.action.openWorkspaceInNewWindow",handler:s=>s.get(dg).pickWorkspaceAndOpen({forceNewWindow:!0})});vt.registerCommand({id:J5t,handler:async s=>{const e=s.get(oC),t=await int(s);!t||!t.length||await e.addFolders(t.map(i=>({uri:i})))}});vt.registerCommand({id:X5t,handler:async s=>{const e=s.get(oC),t=s.get(Ci),i=await int(s);!i||!i.length||await e.updateFolders(0,t.getWorkspace().folders.length,i.map(n=>({uri:n})))}});async function int(s){const e=s.get(dg),t=s.get(Cf);return await e.showOpenDialog({openLabel:GMe(g(5519,"&&Add")),title:g(5520,"Add Folder to Workspace"),canSelectFolders:!0,canSelectMany:!0,defaultUri:await e.defaultFolderPath(),availableFileSystems:[t.defaultUriScheme]})}vt.registerCommand(tnt,async function(s,e){const t=s.get(Tn),i=s.get(Os),n=s.get(Ci),r=s.get(fi),o=s.get(Di),a=n.getWorkspace().folders;if(!a.length)return;const c=a.map(u=>{const f=u.name,p=i.getUriLabel(Ro(u.uri),{relative:!0});return{label:f,description:p!==f?p:void 0,folder:u,iconClasses:Wx(r,o,u.uri,wa.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)||Ue.None,h=await t.pick(c,l,d);if(h)return a[c.indexOf(h)]});vt.registerCommand({id:"vscode.openFolder",handler:(s,e,t)=>{const i=s.get(bi);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),r={forceNewWindow:t?.forceNewWindow,forceReuseWindow:t?.forceReuseWindow,noRecentEntry:t?.noRecentEntry,remoteAuthority:t?.forceLocalWindow?null:void 0,forceProfile:t?.forceProfile,forceTempProfile:t?.forceTempProfile},o=Fae(n)||n.scheme===pe.untitled?{workspaceUri:n}:{folderUri:n};return i.executeCommand("_files.windowOpen",[o],r)},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"}]}});vt.registerCommand({id:"vscode.newWindow",handler:(s,e)=>{const t=s.get(bi),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"}]}});vt.registerCommand("_workbench.removeFromRecentlyOpened",function(s,e){return s.get(RI).removeRecentlyOpened([e])});vt.registerCommand({id:"vscode.removeFromRecentlyOpened",handler:(s,e)=>{const t=s.get(RI);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}]}});vt.registerCommand("_workbench.addToRecentlyOpened",async function(s,e){const t=s.get(RI),i=e.uri,n=e.label,r=e.remoteAuthority;let o;return e.type==="workspace"?o={workspace:await t.getWorkspaceIdentifier(i),label:n,remoteAuthority:r}:e.type==="folder"?o={folderUri:i,label:n,remoteAuthority:r}:o={fileUri:i,label:n,remoteAuthority:r},t.addRecentlyOpened([o])});vt.registerCommand("_workbench.getRecentlyOpened",async function(s){return s.get(RI).getRecentlyOpened()});const mG=mn,DF=".vscode/extensions.json";let Z4e=class extends V{constructor(e,t,i,n,r,o){super(),this.workspaceContextService=e,this.fileService=t,this.quickInputService=i,this.modelService=n,this.languageService=r,this.jsonEditingService=o,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(DF))))&&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 Ya(e.flatMap(t=>t.recommendations?t.recommendations.map(i=>i.toLowerCase()):[]))}async getUnwantedRecommendations(){const e=await this.getExtensionsConfigs();return Ya(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 gi;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);n.set(l.uri,d)}));const r=i&&i.recommendations?.some(l=>l.toLowerCase()===e),o=t.folders.filter(l=>n.get(l.uri)?.recommendations?.some(d=>d.toLowerCase()===e)),a=r||o.length>0,c=a?await this.pickWorkspaceOrFolders(o,r?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)m_e(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 gi;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);n.set(l.uri,d)}));const r=i&&i.unwantedRecommendations?.some(l=>l===e),o=t.folders.filter(l=>n.get(l.uri)?.unwantedRecommendations?.some(d=>d===e)),a=r||o.length>0,c=a?await this.pickWorkspaceOrFolders(o,r?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)m_e(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 r=[];if(n){Array.isArray(i.recommendations)?r.push({path:["recommendations",-1],value:e}):r.push({path:["recommendations"],value:[e]});const o=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);o&&r.push(o)}else if(i.recommendations){const o=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);o&&r.push(o)}if(r.length)return this.jsonEditingService.write(t.toResource(DF),r,!0)}async addOrRemoveWorkspaceRecommendation(e,t,i,n){const r=[];if(i){if(n){const o=["extensions","recommendations"];Array.isArray(i.recommendations)?r.push({path:[...o,-1],value:e}):r.push({path:o,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);a&&r.push(a)}else if(i.recommendations){const o=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);o&&r.push(o)}}else n&&r.push({path:["extensions"],value:{recommendations:[e]}});if(r.length)return this.jsonEditingService.write(t.configuration,r,!0)}async addOrRemoveWorkspaceFolderUnwantedRecommendation(e,t,i,n){const r=[];if(n){const o=["unwantedRecommendations"];Array.isArray(i.unwantedRecommendations)?r.push({path:[...o,-1],value:e}):r.push({path:o,value:[e]});const a=this.getEditToRemoveValueFromArray(["recommendations"],i.recommendations,e);a&&r.push(a)}else if(i.unwantedRecommendations){const o=this.getEditToRemoveValueFromArray(["unwantedRecommendations"],i.unwantedRecommendations,e);o&&r.push(o)}if(r.length)return this.jsonEditingService.write(t.toResource(DF),r,!0)}async addOrRemoveWorkspaceUnwantedRecommendation(e,t,i,n){const r=[];if(i){if(n){const o=["extensions","unwantedRecommendations"];Array.isArray(i.recommendations)?r.push({path:[...o,-1],value:e}):r.push({path:o,value:[e]});const a=this.getEditToRemoveValueFromArray(["extensions","recommendations"],i.recommendations,e);a&&r.push(a)}else if(i.unwantedRecommendations){const o=this.getEditToRemoveValueFromArray(["extensions","unwantedRecommendations"],i.unwantedRecommendations,e);o&&r.push(o)}}else n&&r.push({path:["extensions"],value:{unwantedRecommendations:[e]}});if(r.length)return this.jsonEditingService.write(t.configuration,r,!0)}async pickWorkspaceOrFolders(e,t,i){const n=t?[...e,t]:[...e];if(n.length===1)return n;const r=e.map(a=>({label:a.name,description:g(3849,"Workspace Folder"),workspaceOrFolder:a,iconClasses:Wx(this.modelService,this.languageService,a.uri,wa.ROOT_FOLDER)}));return t&&(r.push({type:"separator"}),r.push({label:g(3850,"Workspace"),workspaceOrFolder:t})),(await this.quickInputService.pick(r,{placeHolder:i,canPickMany:!0})||[]).map(a=>a.workspaceOrFolder)}async resolveWorkspaceExtensionConfig(e){try{const t=await this.fileService.readFile(e),i=af(t.value.toString()).extensions;return i?this.parseExtensionConfig(i):void 0}catch{}}async resolveWorkspaceFolderExtensionConfig(e){try{const t=await this.fileService.readFile(e.toResource(DF)),i=af(t.value.toString());return this.parseExtensionConfig(i)}catch{}return{}}parseExtensionConfig(e){return{recommendations:Ya((e.recommendations||[]).map(t=>t.toLowerCase())),unwantedRecommendations:Ya((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}}};Z4e=D([_(0,Ci),_(1,Xt),_(2,Tn),_(3,fi),_(4,Di),_(5,MI)],Z4e);oi("extensions-view-icon",ve.extensions,g(9483,"View icon of the extensions view."));const Z5t=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 ezt=oi("extensions-sync-enabled",ve.sync,g(9491,"Icon to indicate that an extension is synced.")),tzt=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 izt=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 ZC=oi("extensions-error-message",ve.error,g(9502,"Icon shown with a error message in the extensions editor.")),uh=oi("extensions-warning-message",ve.warning,g(9503,"Icon shown with a warning message in the extensions editor.")),n_=oi("extensions-info-message",ve.info,g(9504,"Icon shown with an info message in the extensions editor.")),YI=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 GCe(s){return s.scheme!==pe.file&&s.scheme!==pe.vscodeRemote}function QNe(s){if(s.folders.length)return s.folders.every(e=>GCe(e.uri))?s.folders[0].uri:void 0;if(s.configuration&&GCe(s.configuration))return s.configuration}function nnt(s){return QNe(s)?.scheme}function snt(s){return QNe(s)!==void 0}function Gce(s){return s.tags.find(e=>e.startsWith("lp-"))?.split("lp-")[1]}let eVe=class extends V{constructor(e){super(),this.extensionGalleryService=e}async getAvailableLanguages(){const e=new li;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(r=>r.properties.localizedLanguages?.length&&r.tags.some(o=>o.startsWith("lp-"))).map(r=>{const o=r.properties.localizedLanguages?.[0],a=Gce(r);return{...this.createQuickPickItem(a,o,r),extensionId:r.identifier.id,galleryExtension:r}});return n.push(this.createQuickPickItem("en","English")),n}createQuickPickItem(e,t,i){const n=t??e;let r;if(n!==e&&(r=`(${e})`),e.toLowerCase()===jl.toLowerCase()&&(r??="",r+=g(3255," (Current)")),i?.installCount){r??="";const o=i.installCount;let a;o>1e6?a=`${Math.floor(o/1e5)/10}M`:o>1e3?a=`${Math.floor(o/1e3)}K`:a=String(o),r+=` $(cloud-download) ${a}`}return{id:e,label:n,description:r}}};eVe=D([_(0,LI)],eVe);var IV,b0,DC,zP,w0,MQ,TV,$P,y0,NQ,PQ,FQ,OQ,BQ,LV,C0,S0,A0,E0,x0,WQ,HQ,UQ,VQ,RV,MV,IE,zQ,$Q;let YW=class extends an{constructor(e,t,i,n,r,o,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=r,this.openerService=o,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(Oo(this.error))return;if(this.logService.error(this.error),this.error.name===mw.Unsupported){const o=Hn?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,o),{confirmed:c}=await this.dialogService.confirm({type:Ze.Info,message:a,primaryButton:g(7876,"&&More Information"),cancelButton:g(7877,"Close")});c&&this.openerService.open(Hn?N.parse("https://aka.ms/vscode-web-extensions-guide"):N.parse("https://aka.ms/vscode-remote"));return}if(mw.ReleaseVersionNotFound===this.error.name){await this.dialogService.prompt({type:"error",message:ou(this.error),buttons:[{label:g(7878,"Install Pre-Release"),run:()=>{const o=this.instantiationService.createInstance(OT,{installPreReleaseVersion:!0});return o.extension=this.extension,o.run()}}],cancelButton:g(7879,"Cancel")});return}if([mw.Incompatible,mw.IncompatibleApi,mw.IncompatibleTargetPlatform,mw.Malicious,mw.Deprecated].includes(this.error.name)){await this.dialogService.info(ou(this.error));return}if(mw.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 o=this.instantiationService.createInstance(OT,{donotVerifySignature:!0});return o.extension=this.extension,o.run()}}],cancelButton:g(7879,"Cancel")});return}const e=this.installOperation===FA.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:${Ptt}`),i.push({label:g(7885,"Try Downloading Manually..."),run:()=>this.openerService.open(n).then(()=>{this.notificationService.prompt(Ze.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(wBt)}])})}));const r=`${e}${t?` ${t}`:""}`;this.notificationService.prompt(Ze.Error,r,i)}async getDownloadUrl(){if(gm||!this.extension.gallery||!this.productService.extensionsGallery||!this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionManagementServerService.remoteExtensionManagementServer)return;let e=this.extension.gallery.properties.targetPlatform;if(e!==xs.UNIVERSAL&&e!==xs.UNDEFINED&&this.extensionManagementServerService.remoteExtensionManagementServer)try{const t=await this.galleryService.getManifest(this.extension.gallery,Ue.None);t&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(t)&&(e=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform())}catch(t){this.logService.error(t);return}if(e!==xs.UNKNOWN)return N.parse(`${this.productService.extensionsGallery.serviceUrl}/publishers/${this.extension.publisher}/vsextensions/${this.extension.name}/${this.version}/vspackage${e!==xs.UNDEFINED?`?targetPlatform=${e}`:""}`)}};YW=D([_(4,xo),_(5,Ar),_(6,wi),_(7,ir),_(8,bi),_(9,Ke),_(10,gv),_(11,we),_(12,LI),_(13,Rm)],YW);const Bv=class Bv extends an{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)}};Bv.EXTENSION_ACTION_CLASS="extension-action",Bv.TEXT_ACTION_CLASS=`${Bv.EXTENSION_ACTION_CLASS} text`,Bv.LABEL_ACTION_CLASS=`${Bv.EXTENSION_ACTION_CLASS} label`,Bv.PROMINENT_LABEL_ACTION_CLASS=`${Bv.LABEL_ACTION_CLASS} prominent`,Bv.ICON_ACTION_CLASS=`${Bv.EXTENSION_ACTION_CLASS} icon`;let Cn=Bv;class jNe extends Cn{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(r=>!r.hidden));let i=[];for(const n of t)n.length&&(i=[...i,...n,new Eo]);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 cy;let OT=(cy=class extends Cn{set manifest(e){this._manifest=e,this.updateLabel()}constructor(e,t,i,n,r,o,a,c,l,d){super("extensions.install",g(7888,"Install"),IV.CLASS,!1),this.extensionsWorkbenchService=t,this.instantiationService=i,this.runtimeExtensionService=n,this.workbenchThemeService=r,this.labelService=o,this.dialogService=a,this.preferencesService=c,this.telemetryService=l,this.contextService=d,this._manifest=null,this.updateThrottler=new a6,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=IV.HIDE,this.hidden=!0,this.extension&&(this.extension.isBuiltin||this.extensionsWorkbenchService.canSetLanguage(this.extension)||this.extension.state===Qr.Uninstalled&&(this.options.installPreReleaseVersion&&!this.extension.hasPreReleaseVersion||!this.options.installPreReleaseVersion&&!this.extension.hasReleaseVersion||(this.hidden=!1,this.class=IV.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(o){o[o.InstallAnyway=0]="InstallAnyway",o[o.ShowAlternateExtension=1]="ShowAlternateExtension",o[o.ConfigureSettings=2]="ConfigureSettings",o[o.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 o=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:o.id,preRelease:o.preRelease}],Ue.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 o=this.extension.deprecationInfo.settings;n.push({label:g(7893,"&&Configure Settings"),run:async()=>(await this.preferencesService.openSettings({query:o.map(a=>`@id:${a}`).join(" ")}),i.ConfigureSettings)})}else this.extension.deprecationInfo.additionalInfo&&(t=new Nt(`${t} ${this.extension.deprecationInfo.additionalInfo}`));const{result:r}=await this.dialogService.prompt({type:Ze.Warning,message:g(7894,"Are you sure you want to install '{0}'?",this.extension.displayName),detail:Rt(t)?t:void 0,custom:Rt(t)?void 0:{markdownDetails:[{markdown:t}]},buttons:n,cancelButton:{run:()=>i.Cancel}});if(r!==i.InstallAnyway)return}this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:this.options.installPreReleaseVersion}),No(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){No(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(r=>Uy(r,e)))return this.instantiationService.createInstance(XCe);if((await this.workbenchThemeService.getFileIconThemes()).some(r=>Uy(r,e)))return this.instantiationService.createInstance(ZCe);if((await this.workbenchThemeService.getProductIconThemes()).some(r=>Uy(r,e)))return this.instantiationService.createInstance(eSe)}async install(e){try{return await this.extensionsWorkbenchService.install(e,this.options)}catch(t){await this.instantiationService.createInstance(YW,e,e.latestVersion,FA.Install,t).run();return}}async getRunningExtension(e){const t=await this.runtimeExtensionService.getExtension(e.identifier.id);return t||(this.runtimeExtensionService.canAddExtension(mD(e))?new Promise((i,n)=>{const r=this.runtimeExtensionService.onDidChangeExtensions(async()=>{const o=await this.runtimeExtensionService.getExtension(e.identifier.id);o&&(r.dispose(),i(o))})}):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")}},IV=cy,cy.CLASS=`${cy.LABEL_ACTION_CLASS} prominent install`,cy.HIDE=`${cy.CLASS} hide`,cy);OT=IV=D([_(1,Xr),_(2,we),_(3,ps),_(4,mG),_(5,Os),_(6,ir),_(7,Y6),_(8,Ji),_(9,Ci)],OT);let tVe=class extends jNe{set manifest(e){this.extensionActions.forEach(t=>t.manifest=e),this.update()}constructor(e,t){super("extensions.installActions",OT.CLASS,[[e.createInstance(OT,{installPreReleaseVersion:t.preferPreReleases}),e.createInstance(OT,{installPreReleaseVersion:!t.preferPreReleases})]])}getLabel(e){return e.getLabel(!0)}};tVe=D([_(0,we),_(1,Xr)],tVe);const A1=class A1 extends Cn{constructor(){super("extension.installing",A1.LABEL,A1.CLASS,!1)}update(){this.class=`${A1.CLASS}${this.extension&&this.extension.state===Qr.Installing?"":" hide"}`}};A1.LABEL=g(7901,"Installing"),A1.CLASS=`${Cn.LABEL_ACTION_CLASS} install installing`;let iVe=A1;var ly;let JW=(ly=class extends Cn{constructor(e,t,i,n,r,o){super(e,b0.INSTALL_LABEL,b0.Class,!1),this.server=t,this.canInstallAnyWhere=i,this.extensionsWorkbenchService=n,this.extensionManagementServerService=r,this.extensionManifestPropertiesService=o,this.updateWhenCounterExtensionChanges=!0,this.update()}update(){if(this.enabled=!1,this.class=b0.Class,this.canInstall()){const e=this.extensionsWorkbenchService.installed.filter(t=>Na(t.identifier,this.extension.identifier)&&t.server===this.server)[0];e?e.state===Qr.Installing&&!e.local&&(this.enabled=!0,this.label=b0.INSTALLING_LABEL,this.class=b0.InstallingClass):(this.enabled=!0,this.label=this.getInstallLabel())}}canInstall(){return!this.extension||!this.server||!this.extension.local||this.extension.state!==Qr.Installed||this.extension.type!==wo.User||this.extension.enablementState===Ko.DisabledByEnvironment||this.extension.enablementState===Ko.DisabledByTrustRequirement||this.extension.enablementState===Ko.DisabledByVirtualWorkspace?!1:!!(sMe(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),No(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)}},b0=ly,ly.INSTALL_LABEL=g(7888,"Install"),ly.INSTALLING_LABEL=g(7901,"Installing"),ly.Class=`${Cn.LABEL_ACTION_CLASS} prominent install-other-server`,ly.InstallingClass=`${Cn.LABEL_ACTION_CLASS} install-other-server installing`,ly);JW=b0=D([_(3,Xr),_(4,gv),_(5,Rm)],JW);let KCe=class extends JW{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):JW.INSTALL_LABEL}};KCe=D([_(1,Xr),_(2,gv),_(3,Rm)],KCe);let nVe=class extends JW{constructor(e,t,i){super("extensions.localinstall",t.localExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(7903,"Install Locally")}};nVe=D([_(0,Xr),_(1,gv),_(2,Rm)],nVe);let sVe=class extends JW{constructor(e,t,i){super("extensions.webInstall",t.webExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(7904,"Install in Browser")}};sVe=D([_(0,Xr),_(1,gv),_(2,Rm)],sVe);var dy;let qCe=(dy=class extends Cn{constructor(e,t){super("extensions.uninstall",DC.UninstallLabel,DC.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===Qr.Uninstalling){this.label=DC.UninstallingLabel,this.class=DC.UnInstallingClass,this.enabled=!1;return}if(this.label=DC.UninstallLabel,this.class=DC.UninstallClass,this.tooltip=DC.UninstallLabel,e!==Qr.Installed){this.enabled=!1;return}if(this.extension.isBuiltin){this.enabled=!1;return}this.enabled=!0}async run(){if(this.extension){No(g(7907,"Uninstalling extension {0} started.",this.extension.displayName));try{await this.extensionsWorkbenchService.uninstall(this.extension),No(g(7908,"Please reload Visual Studio Code to complete the uninstallation of the extension {0}.",this.extension.displayName))}catch(e){Oo(e)||this.dialogService.error(ou(e))}}}},DC=dy,dy.UninstallLabel=g(7905,"Uninstall"),dy.UninstallingLabel=g(7906,"Uninstalling"),dy.UninstallClass=`${Cn.LABEL_ACTION_CLASS} uninstall`,dy.UnInstallingClass=`${Cn.LABEL_ACTION_CLASS} uninstall uninstalling`,dy);qCe=DC=D([_(0,Xr),_(1,ir)],qCe);var hy;let rVe=(hy=class extends Cn{constructor(e,t,i,n,r){super("extensions.update",g(7909,"Update"),zP.DisabledClass,!1),this.verbose=e,this.extensionsWorkbenchService=t,this.dialogService=i,this.openerService=n,this.instantiationService=r,this.updateThrottler=new a6,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=zP.DisabledClass,!this.extension||this.extension.deprecationInfo)return;const e=await this.extensionsWorkbenchService.canInstall(this.extension),t=this.extension.state===Qr.Installed;this.enabled=e&&t&&this.extension.outdated,this.class=this.enabled?zP.EnabledClass:zP.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:l9.Changelog}):this.extension.repository?this.openerService.open(this.extension.repository):this.extensionsWorkbenchService.open(this.extension)}return No(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),No(g(7915,"Updating extension {0} to version {1} completed.",e.displayName,e.latestVersion))}catch(t){this.instantiationService.createInstance(YW,e,e.latestVersion,FA.Update,t).run()}}},zP=hy,hy.EnabledClass=`${hy.LABEL_ACTION_CLASS} prominent update`,hy.DisabledClass=`${hy.EnabledClass} disabled`,hy);rVe=zP=D([_(1,Xr),_(2,ir),_(3,Ar),_(4,we)],rVe);var sb;let QCe=(sb=class extends Cn{constructor(e,t,i){super(w0.ID,w0.LABEL.value,w0.DisabledClass),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this._register(i.onDidChangeConfiguration(n=>{n.affectsConfiguration(vBt)&&this.update()})),this.update()}update(){this.enabled=!1,this.class=w0.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=w0.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),No(e?g(7917,"Enabled auto updates for",this.extension.displayName):g(7918,"Disabled auto updates for",this.extension.displayName))}},w0=sb,sb.ID="workbench.extensions.action.toggleAutoUpdateForExtension",sb.LABEL=Pe(7916,"Auto Update"),sb.EnabledClass=`${Cn.EXTENSION_ACTION_CLASS} auto-update`,sb.DisabledClass=`${sb.EnabledClass} hide`,sb);QCe=w0=D([_(0,Xr),_(1,Fl),_(2,Te)],QCe);var dk;let jCe=(dk=class extends Cn{constructor(e){super(MQ.ID,MQ.LABEL),this.extensionsWorkbenchService=e}update(){}async run(){if(!this.extension)return;No(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),No(e?g(7917,"Enabled auto updates for",this.extension.displayName):g(7918,"Disabled auto updates for",this.extension.displayName))}},MQ=dk,dk.ID="workbench.extensions.action.toggleAutoUpdatesForPublisher",dk.LABEL=g(7919,"Auto Update All (From Publisher)"),dk);jCe=MQ=D([_(0,Xr)],jCe);var KS;let oVe=(KS=class extends Cn{constructor(e,t){super("extensionsAction.migrateDeprecatedExtension",g(7921,"Migrate"),TV.DisabledClass,!1),this.small=e,this.extensionsWorkbenchService=t,this.update()}update(){if(this.enabled=!1,this.class=TV.DisabledClass,!this.extension?.local||this.extension.state!==Qr.Installed||!this.extension.deprecationInfo?.extension)return;const e=this.extension.deprecationInfo.extension.id;this.extensionsWorkbenchService.local.some(t=>Ma(t.identifier,{id:e}))||(this.enabled=!0,this.class=TV.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}],Ue.None);await this.extensionsWorkbenchService.install(t,{isMachineScoped:e?.isMachineScoped})}},TV=KS,KS.EnabledClass=`${Cn.LABEL_ACTION_CLASS} migrate`,KS.DisabledClass=`${KS.EnabledClass} disabled`,KS);oVe=TV=D([_(1,Xr)],oVe);let kZ=class extends Cn{constructor(e,t,i,n,r){super(e,t,i,n),this.instantiationService=r,this._actionViewItem=null}createActionViewItem(e){return this._actionViewItem=this.instantiationService.createInstance(YCe,this,e),this._actionViewItem}run({actionGroups:e,disposeActionsOnHide:t}){return this._actionViewItem?.showMenu(e,t),Promise.resolve()}};kZ=D([_(4,we)],kZ);let YCe=class extends tC{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=So(this.element),r={x:n.left,y:n.top+n.height+10};this.contextMenuService.showContextMenu({getAnchor:()=>r,getActions:()=>i,actionRunner:this.actionRunner,onHide:()=>{t&&rct(i)}})}}getActions(e){let t=[];for(const i of e)t=[...t,...i,new Eo];return t.length?t.slice(0,t.length-1):t}};YCe=D([_(2,lo)],YCe);async function nzt(s,e,t){return t.invokeFunction(async i=>{const n=i.get(Xr),r=i.get(Fl),o=i.get(Ba),a=i.get(IZe),c=i.get(pce),l=i.get(mG),d=[];if(s){switch(d.push(["extension",s.identifier.id]),d.push(["isBuiltinExtension",s.isBuiltin]),d.push(["isDefaultApplicationScopedExtension",s.local&&v1t(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===$Ce.Workspace]),d.push(["isUserIgnoredRecommendation",c.globalIgnoredRecommendations.some(m=>m===s.identifier.id.toLowerCase())]),d.push(["isExtensionPinned",s.pinned]),d.push(["isExtensionEnabled",r.isEnabledEnablementState(s.enablementState)]),s.state){case Qr.Installing:d.push(["extensionStatus","installing"]);break;case Qr.Installed:d.push(["extensionStatus","installed"]);break;case Qr.Uninstalling:d.push(["extensionStatus","uninstalling"]);break;case Qr.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=>Uy(m,s))]),d.push(["extensionHasFileIconThemes",f.some(m=>Uy(m,s))]),d.push(["extensionHasProductIconThemes",p.some(m=>Uy(m,s))]),d.push(["canSetLanguage",n.canSetLanguage(s)]),d.push(["isActiveLanguagePackExtension",s.gallery&&jl===Gce(s.gallery)])}return o.getMenuActions(_e.ExtensionContext,e.createOverlay(d),{shouldForwardArgs:!0})})}function VK(s,e){const t=[];for(const[,i]of s)t.push(i.map(n=>n instanceof Hk?n:e.createInstance(JCe,n)));return t}var uy;let aVe=(uy=class extends kZ{constructor(e,t,i){super($P.ID,"","",!0,e),this.extensionService=t,this.contextKeyService=i,this.tooltip=g(7924,"Manage"),this.update()}async getActionGroups(){const e=[],t=await nzt(this.extension,this.contextKeyService,this.instantiationService),i=[],n=[],r=[],o=[];for(const[a,c]of t)a===CBt?n.push(...VK([[a,c]],this.instantiationService)[0]):a===SBt?r.push(...VK([[a,c]],this.instantiationService)[0]):a===yBt?i.push(...VK([[a,c]],this.instantiationService)[0]):o.push(...VK([[a,c]],this.instantiationService));return i.length&&e.push(i),e.push([this.instantiationService.createInstance(TZ),this.instantiationService.createInstance(IZ)]),e.push([this.instantiationService.createInstance(RZ),this.instantiationService.createInstance(LZ)]),r.length&&e.push(r),e.push([...n.length?n:[],this.instantiationService.createInstance(x9,this.extension,!1),this.instantiationService.createInstance(qCe)]),o.forEach(a=>e.push(a)),e.forEach(a=>a.forEach(c=>{c instanceof Cn&&(c.extension=this.extension)})),e}async run(){return await this.extensionService.whenInstalledExtensionsRegistered(),super.run({actionGroups:await this.getActionGroups(),disposeActionsOnHide:!0})}update(){if(this.class=$P.HideManageExtensionClass,this.enabled=!1,this.extension){const e=this.extension.state;this.enabled=e===Qr.Installed,this.class=this.enabled||e===Qr.Uninstalling?$P.Class:$P.HideManageExtensionClass}}},$P=uy,uy.ID="extensions.manage",uy.Class=`${Cn.ICON_ACTION_CLASS} manage `+He.asClassName(Z5t),uy.HideManageExtensionClass=`${uy.Class} hide`,uy);aVe=$P=D([_(0,we),_(1,ps),_(2,Le)],aVe);let JCe=class extends Cn{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===bBt?this.checked=!this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension):this.action.id===QCe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension):this.action.id===jCe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher):this.checked=this.action.checked)}async run(){if(this.extension){const e=this.extension.local?OM(this.extension.local.manifest.publisher,this.extension.local.manifest.name):this.extension.gallery?OM(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)}}};JCe=D([_(1,Xr)],JCe);var rb;let cVe=(rb=class extends Cn{constructor(e){super(y0.ID,y0.LABEL,y0.DisabledClass),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=y0.DisabledClass,this.extension&&(this.extension.isBuiltin||this.extension.state===Qr.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=y0.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))}},y0=rb,rb.ID="workbench.extensions.action.togglePreRlease",rb.LABEL=g(7925,"Pre-Release"),rb.EnabledClass=`${Cn.LABEL_ACTION_CLASS} pre-release`,rb.DisabledClass=`${rb.EnabledClass} hide`,rb);cVe=y0=D([_(0,Xr)],cVe);var hk;let x9=(hk=class extends Cn{constructor(e,t,i,n,r,o,a,c){super(NQ.ID,NQ.LABEL,Cn.LABEL_ACTION_CLASS),this.whenInstalled=t,this.extensionsWorkbenchService=i,this.extensionManagementService=n,this.extensionGalleryService=r,this.quickInputService=o,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===Qr.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((r,o)=>({id:r.version,label:r.version,description:`${WNe(new Date(Date.parse(r.date)),!0)}${r.isPreReleaseVersion?` (${g(7932,"pre-release")})`:""}${r.version===this.extension?.local?.manifest.version?` (${g(7933,"current")})`:""}`,ariaLabel:`${r.isPreReleaseVersion?"Pre-Release version":"Release version"} ${r.version}`,isPreReleaseVersion:r.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(r){this.instantiationService.createInstance(YW,this.extension,n.id,FA.Install,r).run()}}return null}},NQ=hk,hk.ID="workbench.extensions.action.install.anotherVersion",hk.LABEL=g(7930,"Install Specific Version..."),hk);x9=NQ=D([_(2,Xr),_(3,q6),_(4,LI),_(5,Tn),_(6,we),_(7,ir)],x9);var uk;let IZ=(uk=class extends Cn{constructor(e,t){super(PQ.ID,PQ.LABEL,Cn.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===Qr.Installed&&!this.extensionEnablementService.isEnabled(this.extension.local)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Ko.EnabledWorkspace)}},PQ=uk,uk.ID="extensions.enableForWorkspace",uk.LABEL=g(7935,"Enable (Workspace)"),uk);IZ=PQ=D([_(0,Xr),_(1,Fl)],IZ);var gk;let TZ=(gk=class extends Cn{constructor(e,t){super(FQ.ID,FQ.LABEL,Cn.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===Qr.Installed&&this.extensionEnablementService.isDisabledGlobally(this.extension.local)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Ko.EnabledGlobally)}},FQ=gk,gk.ID="extensions.enableGlobally",gk.LABEL=g(7937,"Enable"),gk);TZ=FQ=D([_(0,Xr),_(1,Fl)],TZ);var fk;let LZ=(fk=class extends Cn{constructor(e,t,i,n){super(OQ.ID,OQ.LABEL,Cn.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=>Ma({id:e.identifier.value,uuid:e.uuid},this.extension.identifier)&&this.workspaceContextService.getWorkbenchState()!==Qi.EMPTY)&&(this.enabled=this.extension.state===Qr.Installed&&(this.extension.enablementState===Ko.EnabledGlobally||this.extension.enablementState===Ko.EnabledWorkspace)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Ko.DisabledWorkspace)}},OQ=fk,fk.ID="extensions.disableForWorkspace",fk.LABEL=g(7939,"Disable (Workspace)"),fk);LZ=OQ=D([_(0,Ci),_(1,Xr),_(2,Fl),_(3,ps)],LZ);var pk;let RZ=(pk=class extends Cn{constructor(e,t,i){super(BQ.ID,BQ.LABEL,Cn.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=>Ma({id:e.identifier.value,uuid:e.uuid},this.extension.identifier))&&(this.enabled=this.extension.state===Qr.Installed&&(this.extension.enablementState===Ko.EnabledGlobally||this.extension.enablementState===Ko.EnabledWorkspace)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Ko.DisabledGlobally)}},BQ=pk,pk.ID="extensions.disableGlobally",pk.LABEL=g(7941,"Disable"),pk);RZ=BQ=D([_(0,Xr),_(1,Fl),_(2,ps)],RZ);let lVe=class extends jNe{constructor(e){super("extensions.enable",Cn.LABEL_ACTION_CLASS,[[e.createInstance(TZ),e.createInstance(IZ)]])}};lVe=D([_(0,we)],lVe);let dVe=class extends jNe{constructor(e){super("extensions.disable",Cn.LABEL_ACTION_CLASS,[[e.createInstance(RZ),e.createInstance(LZ)]])}};dVe=D([_(0,we)],dVe);var qS;let hVe=(qS=class extends Cn{constructor(e,t,i,n,r,o){super("extensions.runtimeState","",LV.DisabledClass,!1),this.hostService=e,this.extensionsWorkbenchService=t,this.updateService=i,this.extensionService=n,this.productService=r,this.telemetryService=o,this.updateWhenCounterExtensionChanges=!0,this._register(this.extensionService.onDidChangeExtensions(()=>this.update())),this.update()}update(){if(this.enabled=!1,this.tooltip="",this.class=LV.DisabledClass,!this.extension)return;const e=this.extension.state;if(e===Qr.Installing||e===Qr.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=LV.EnabledClass,this.tooltip=t.reason,this.label=t.action===qm.ReloadWindow?g(7943,"Reload Window"):t.action===qm.RestartExtensions?g(7944,"Restart Extensions"):t.action===qm.QuitAndInstall?g(7945,"Restart to Update"):t.action===qm.ApplyUpdate||t.action===qm.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===qm.ReloadWindow)return this.hostService.reload();if(e?.action===qm.RestartExtensions)return this.extensionsWorkbenchService.updateRunningExtensions();if(e?.action===qm.DownloadUpdate)return this.updateService.downloadUpdate();if(e?.action===qm.ApplyUpdate)return this.updateService.applyUpdate();if(e?.action===qm.QuitAndInstall)return this.updateService.quitAndInstall()}}},LV=qS,qS.EnabledClass=`${Cn.LABEL_ACTION_CLASS} reload`,qS.DisabledClass=`${qS.EnabledClass} disabled`,qS);hVe=LV=D([_(0,Dc),_(1,Xr),_(2,OXe),_(3,ps),_(4,xo),_(5,Ji)],hVe);function Uy(s,e){return!!(e&&s.extensionData&&An.equals(s.extensionData.extensionId,e.identifier.id))}function YNe(s,e,t,i){const n=[];for(const r of s)Uy(r,t)&&!(i&&r===e)&&n.push({label:r.label,id:r.id});return i&&(n.push({type:"separator",label:g(7933,"current")}),n.push({label:e.label,id:e.id})),n}var ob;let XCe=(ob=class extends Cn{constructor(e,t,i,n){super(C0.ID,C0.TITLE.value,C0.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?C0.EnabledClass:C0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Uy(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(),r=new Ph(100),o=YNe(i,n,this.extension,e),a=await this.quickInputService.pick(o,{placeHolder:g(7948,"Select Color Theme"),onDidFocus:c=>r.trigger(()=>this.workbenchThemeService.setColorTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setColorTheme(a?a.id:n.id,"auto")}},C0=ob,ob.ID="workbench.extensions.action.setColorTheme",ob.TITLE=Pe(7947,"Set Color Theme"),ob.EnabledClass=`${Cn.LABEL_ACTION_CLASS} theme`,ob.DisabledClass=`${ob.EnabledClass} disabled`,ob);XCe=C0=D([_(0,ps),_(1,mG),_(2,Tn),_(3,Fl)],XCe);var ab;let ZCe=(ab=class extends Cn{constructor(e,t,i,n){super(S0.ID,S0.TITLE.value,S0.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?S0.EnabledClass:S0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Uy(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(),r=new Ph(100),o=YNe(i,n,this.extension,e),a=await this.quickInputService.pick(o,{placeHolder:g(7950,"Select File Icon Theme"),onDidFocus:c=>r.trigger(()=>this.workbenchThemeService.setFileIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setFileIconTheme(a?a.id:n.id,"auto")}},S0=ab,ab.ID="workbench.extensions.action.setFileIconTheme",ab.TITLE=Pe(7949,"Set File Icon Theme"),ab.EnabledClass=`${Cn.LABEL_ACTION_CLASS} theme`,ab.DisabledClass=`${ab.EnabledClass} disabled`,ab);ZCe=S0=D([_(0,ps),_(1,mG),_(2,Tn),_(3,Fl)],ZCe);var cb;let eSe=(cb=class extends Cn{constructor(e,t,i,n){super(A0.ID,A0.TITLE.value,A0.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?A0.EnabledClass:A0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Uy(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(),r=new Ph(100),o=YNe(i,n,this.extension,e),a=await this.quickInputService.pick(o,{placeHolder:g(7952,"Select Product Icon Theme"),onDidFocus:c=>r.trigger(()=>this.workbenchThemeService.setProductIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setProductIconTheme(a?a.id:n.id,"auto")}},A0=cb,cb.ID="workbench.extensions.action.setProductIconTheme",cb.TITLE=Pe(7951,"Set Product Icon Theme"),cb.EnabledClass=`${Cn.LABEL_ACTION_CLASS} theme`,cb.DisabledClass=`${cb.EnabledClass} disabled`,cb);eSe=A0=D([_(0,ps),_(1,mG),_(2,Tn),_(3,Fl)],eSe);var lb;let uVe=(lb=class extends Cn{constructor(e){super(E0.ID,E0.TITLE.value,E0.DisabledClass,!1),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=E0.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&jl===Gce(this.extension.gallery)||(this.enabled=!0,this.class=E0.EnabledClass))}async run(){return this.extension&&this.extensionsWorkbenchService.setLanguage(this.extension)}},E0=lb,lb.ID="workbench.extensions.action.setDisplayLanguage",lb.TITLE=Pe(7953,"Set Display Language"),lb.EnabledClass=`${Cn.LABEL_ACTION_CLASS} language`,lb.DisabledClass=`${lb.EnabledClass} disabled`,lb);uVe=E0=D([_(0,Xr)],uVe);var db;let gVe=(db=class extends Cn{constructor(e,t){super(x0.ID,x0.TITLE.value,x0.DisabledClass,!1),this.extensionsWorkbenchService=e,this.localeService=t,this.update()}update(){this.enabled=!1,this.class=x0.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&jl!==Gce(this.extension.gallery)||(this.enabled=!0,this.class=x0.EnabledClass))}async run(){return this.extension&&this.localeService.clearLocalePreference()}},x0=db,db.ID="workbench.extensions.action.clearLanguage",db.TITLE=Pe(7954,"Clear Display Language"),db.EnabledClass=`${Cn.LABEL_ACTION_CLASS} language`,db.DisabledClass=`${db.EnabledClass} disabled`,db);gVe=x0=D([_(0,Xr),_(1,LZe)],gVe);var mk;let fVe=(mk=class extends an{constructor(e,t,i){super(WQ.ID,WQ.LABEL,void 0,!1),this.paneCompositeService=t,this.extensionWorkbenchService=i,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(ZU,io.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},Ue.None);return i?this.extensionWorkbenchService.open(i):null}},WQ=mk,mk.ID="workbench.extensions.action.showRecommendedExtension",mk.LABEL=g(7955,"Show Recommended Extension"),mk);fVe=WQ=D([_(1,Mm),_(2,Xr)],fVe);var _k;let pVe=(_k=class extends an{constructor(e,t,i,n){super(HQ.ID,HQ.LABEL,void 0,!1),this.paneCompositeService=t,this.instantiationService=i,this.extensionWorkbenchService=n,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(ZU,io.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},Ue.None);if(i){await this.extensionWorkbenchService.open(i);try{await this.extensionWorkbenchService.install(i)}catch(n){this.instantiationService.createInstance(YW,i,i.latestVersion,FA.Install,n).run()}}}},HQ=_k,_k.ID="workbench.extensions.action.installRecommendedExtension",_k.LABEL=g(7956,"Install Recommended Extension"),_k);pVe=HQ=D([_(1,Mm),_(2,we),_(3,Xr)],pVe);var vk;let mVe=(vk=class extends an{constructor(e,t){super(UQ.ID,"Ignore Recommendation"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=UQ.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()}},UQ=vk,vk.ID="extensions.ignore",vk.Class=`${Cn.LABEL_ACTION_CLASS} ignore`,vk);mVe=UQ=D([_(1,pce)],mVe);var bk;let _Ve=(bk=class extends an{constructor(e,t){super(VQ.ID,"Undo"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=VQ.Class,this.tooltip=g(7958,"Undo"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!1),Promise.resolve()}},VQ=bk,bk.ID="extensions.ignore",bk.Class=`${Cn.LABEL_ACTION_CLASS} undo-ignore`,bk);_Ve=VQ=D([_(1,pce)],_Ve);let MZ=class extends an{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(ZU,io.Sidebar,!0))?.getViewPaneContainer();e.search(this.searchValue),e.focus()}};MZ=D([_(1,Mm)],MZ);let NZ=class extends an{constructor(e,t,i,n,r,o,a,c){super(e,t),this.contextService=i,this.fileService=n,this.textFileService=r,this.editorService=o,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=af(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=rRe(e),r=p_e(n,i);if(r&&r.parent&&r.parent.children){const o=r.parent.children[1],a=o.children&&o.children.length?o.children[o.children.length-1]:null,c=a?a.offset+a.length:o.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,J4e).then(()=>({created:!0,extensionsFileResource:e,content:J4e})))}};NZ=D([_(2,Ci),_(3,Xt),_(4,Fr),_(5,ti),_(6,MI),_(7,pn)],NZ);var pR;let vVe=(pR=class extends NZ{constructor(e,t,i,n,r,o,a,c){super(e,t,r,i,n,o,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(DF));case Qi.WORKSPACE:return this.openWorkspaceConfigurationFile(this.contextService.getWorkspace().configuration)}return Promise.resolve()}},pR.ID="workbench.extensions.action.configureWorkspaceRecommendedExtensions",pR.LABEL=g(7961,"Configure Recommended Extensions (Workspace)"),pR);vVe=D([_(2,Xt),_(3,Fr),_(4,Ci),_(5,ti),_(6,MI),_(7,pn)],vVe);var mR;let bVe=(mR=class extends NZ{constructor(e,t,i,n,r,o,a,c,l){super(e,t,r,i,n,o,a,c),this.commandService=l}run(){const t=this.contextService.getWorkspace().folders.length===1?Promise.resolve(this.contextService.getWorkspace().folders[0]):this.commandService.executeCommand(tnt);return Promise.resolve(t).then(i=>i?this.openExtensionsFile(i.toResource(DF)):null)}},mR.ID="workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions",mR.LABEL=g(7962,"Configure Recommended Extensions (Workspace Folder)"),mR);bVe=D([_(2,Xt),_(3,Fr),_(4,Ci),_(5,ti),_(6,MI),_(7,pn),_(8,bi)],bVe);var QS;let wVe=(QS=class extends an{get extension(){return this._extension}set extension(e){this._extension&&e&&Ma(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","",RV.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?RV.ENABLED_CLASS:RV.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 o=this.extensionService.extensions.filter(a=>Ma({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0];return this.extension.local?o&&this.extension.version===o.version?!0:this.extensionService.canAddExtension(mD(this.extension.local)):!1},r=()=>this.extension.local?this.extensionService.extensions.every(o=>!(Ma({id:o.identifier.value,uuid:o.uuid},this.extension.identifier)&&this.extension.server===this.extensionManagementServerService.getExtensionManagementServer(Cce(o))))?!0:this.extensionService.canRemoveExtension(mD(this.extension.local)):!1;if(e!==null){if(e===Qr.Installing&&this.status===Qr.Installed)return n()?this.initialStatus===Qr.Installed&&this.version!==t?g(7963,"Updated"):g(7964,"Installed"):null;if(e===Qr.Uninstalling&&this.status===Qr.Uninstalled)return this.initialStatus=this.status,r()?g(7965,"Uninstalled"):null}if(i!==null){const o=this.extensionEnablementService.isEnabledEnablementState(i),a=this.extensionEnablementService.isEnabledEnablementState(this.enablementState);if(!o&&a)return n()?g(7966,"Enabled"):null;if(o&&!a)return r()?g(7967,"Disabled"):null}return null}run(){return Promise.resolve()}},RV=QS,QS.ENABLED_CLASS=`${Cn.TEXT_ACTION_CLASS} extension-status-label`,QS.DISABLED_CLASS=`${QS.ENABLED_CLASS} hide`,QS);wVe=RV=D([_(0,ps),_(1,gv),_(2,Fl)],wVe);var jS;let yVe=(jS=class extends kZ{constructor(e,t,i,n){super("extensions.sync","",MV.SYNC_CLASS,!1,n),this.configurationService=e,this.extensionsWorkbenchService=t,this.userDataSyncEnablementService=i,this._register(M.filter(this.configurationService.onDidChangeConfiguration,r=>r.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===Qr.Installed,this.extension){const e=this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);this.class=e?MV.IGNORED_SYNC_CLASS:MV.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 an("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})}},MV=jS,jS.IGNORED_SYNC_CLASS=`${Cn.ICON_ACTION_CLASS} extension-sync ${He.asClassName(tzt)}`,jS.SYNC_CLASS=`${jS.ICON_ACTION_CLASS} extension-sync ${He.asClassName(ezt)}`,jS);yVe=MV=D([_(0,Te),_(1,Xr),_(2,BXe),_(3,we)],yVe);var _R;let CVe=(_R=class extends Cn{get status(){return this._status}constructor(e,t,i,n,r,o,a,c,l,d,h,u){super("extensions.status","",`${IE.CLASS} hide`,!1),this.extensionManagementServerService=e,this.labelService=t,this.commandService=i,this.workspaceTrustEnablementService=n,this.workspaceTrustService=r,this.extensionsWorkbenchService=o,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 a6,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:uh,message:new Nt(g(7972,"This extension was reported to be problematic."))},!0);return}if(this.extension.deprecationInfo){if(this.extension.deprecationInfo.extension){const r=`[${this.extension.deprecationInfo.extension.displayName}](${N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.extension.id]))}`)})`;this.updateStatus({icon:uh,message:new Nt(g(7973,"This extension is deprecated. Use the {0} extension instead.",r))},!0)}else if(this.extension.deprecationInfo.settings){const r=`[${g(7974,"settings")}](${N.parse(`command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.settings.map(o=>`@id:${o}`).join(" ")]))}`)})`;this.updateStatus({icon:uh,message:new Nt(g(7975,"This extension is deprecated as this functionality is now built-in to VS Code. Configure these {0} to use this functionality.",r))},!0)}else{const r=new Nt(g(7976,"This extension is deprecated as it is no longer being maintained."));this.extension.deprecationInfo.additionalInfo&&r.appendMarkdown(` ${this.extension.deprecationInfo.additionalInfo}`),this.updateStatus({icon:uh,message:r},!0)}return}if(this.extensionsWorkbenchService.canSetLanguage(this.extension))return;if(this.extension.outdated&&this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension)){const r=await this.extensionsWorkbenchService.shouldRequireConsentToUpdate(this.extension);if(r){const o=new Nt;o.appendMarkdown(`${r} `),o.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,l9.Changelog]))}`).toString():this.extension.repository?this.extension.repository:N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id]))}`).toString())),this.updateStatus({icon:uh,message:o},!0)}}if(this.extension.gallery&&this.extension.state===Qr.Uninstalled&&!await this.extensionsWorkbenchService.canInstall(this.extension)){if(this.extensionManagementServerService.localExtensionManagementServer||this.extensionManagementServerService.remoteExtensionManagementServer){const r=await(this.extensionManagementServerService.localExtensionManagementServer?this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform():this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform()),o=new Nt(`${g(7978,"The '{0}' extension is not available in {1} for {2}.",this.extension.displayName||this.extension.identifier.id,this.productService.nameLong,YRt(r))} [${g(7979,"Learn More")}](https://aka.ms/vscode-platform-specific-extensions)`);this.updateStatus({icon:uh,message:o},!0);return}if(this.extensionManagementServerService.webExtensionManagementServer){const r=g(7874,"{0} for the Web",this.productService.nameLong),o=new Nt(`${g(7980,"The '{0}' extension is not available in {1}.",this.extension.displayName||this.extension.identifier.id,r)} [${g(7981,"Learn Why")}](https://aka.ms/vscode-web-extensions-guide)`);this.updateStatus({icon:uh,message:o},!0);return}}if(!this.extension.local||!this.extension.server||this.extension.state!==Qr.Installed)return;if(this.extension.enablementState===Ko.DisabledByEnvironment){this.updateStatus({message:new Nt(g(7982,"This extension is disabled by the environment."))},!0);return}if(this.extension.enablementState===Ko.EnabledByEnvironment){this.updateStatus({message:new Nt(g(7983,"This extension is enabled because it is required in the current environment."))},!0);return}if(this.extension.enablementState===Ko.DisabledByVirtualWorkspace){const r=CK(this.extension.local.manifest.capabilities?.virtualWorkspaces);this.updateStatus({icon:n_,message:new Nt(r?uV(r):g(7984,"This extension has been disabled because it does not support virtual workspaces."))},!0);return}if(snt(this.contextService.getWorkspace())){const r=this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(this.extension.local.manifest),o=CK(this.extension.local.manifest.capabilities?.virtualWorkspaces);if(r==="limited"||o){this.updateStatus({icon:uh,message:new Nt(o?uV(o):g(7985,"This extension has limited features because the current workspace is virtual."))},!0);return}}if(this.extension.enablementState===Ko.DisabledByTrustRequirement||this.extension.enablementState===Ko.DisabledByExtensionDependency&&this.workbenchExtensionEnablementService.getDependenciesEnablementStates(this.extension.local).every(([,r])=>this.workbenchExtensionEnablementService.isEnabledEnablementState(r)||r===Ko.DisabledByTrustRequirement)){this.enabled=!0;const r=CK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);this.updateStatus({icon:YI,message:new Nt(r?uV(r):g(7986,"This extension has been disabled because the current workspace is not trusted."))},!0);return}if(this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()&&!this.workspaceTrustService.isWorkspaceTrusted()){const r=this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(this.extension.local.manifest),o=CK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);if(r==="limited"||o){this.enabled=!0,this.updateStatus({icon:YI,message:new Nt(o?uV(o):g(7987,"This extension has limited features because the current workspace is not trusted."))},!0);return}}if(this.extension.enablementState===Ko.DisabledByExtensionKind&&!this.extensionsWorkbenchService.installed.some(r=>Ma(r.identifier,this.extension.identifier)&&r.server!==this.extension.server)){let r;this.extensionManagementServerService.localExtensionManagementServer===this.extension.server?this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.extensionManagementServerService.remoteExtensionManagementServer&&(r=new Nt(`${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?r=new Nt(`${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)`):Hn&&(r=new Nt(`${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&&(r=new Nt(`${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)`)),r&&this.updateStatus({icon:uh,message:r},!0);return}const e=new An(this.extension.identifier.id),t=je.as(ev.ExtensionFeaturesRegistry).getExtensionFeatures();for(const r of t){const o=this.extensionFeaturesManagementService.getAccessData(e,r.id)?.current?.status,a=`[${g(7992,"Manage Access")}](${N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,l9.Features,!1,r.id]))}`)})`;if(o?.severity===Ze.Error){this.updateStatus({icon:ZC,message:new Nt().appendText(o.message).appendMarkdown(` ${a}`)},!0);return}if(o?.severity===Ze.Warning){this.updateStatus({icon:uh,message:new Nt().appendText(o.message).appendMarkdown(` ${a}`)},!0);return}}if(this.extensionManagementServerService.remoteExtensionManagementServer){if(sMe(this.extension.local.manifest)){if(!this.extensionsWorkbenchService.installed.some(a=>Ma(a.identifier,this.extension.identifier)&&a.server!==this.extension.server)){const a=this.extension.server===this.extensionManagementServerService.localExtensionManagementServer?new Nt(g(7993,"Install the language pack extension on '{0}' to enable it there also.",this.extensionManagementServerService.remoteExtensionManagementServer.label)):new Nt(g(7994,"Install the language pack extension locally to enable it there also."));this.updateStatus({icon:n_,message:a},!0)}return}const r=this.extensionService.extensions.filter(a=>Ma({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0],o=r?this.extensionManagementServerService.getExtensionManagementServer(Cce(r)):null;if(this.extension.server===this.extensionManagementServerService.localExtensionManagementServer&&o===this.extensionManagementServerService.remoteExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.updateStatus({icon:n_,message:new Nt(`${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&&o===this.extensionManagementServerService.localExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)&&this.updateStatus({icon:n_,message:new Nt(`${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&&o===this.extensionManagementServerService.webExtensionManagementServer){this.extensionManifestPropertiesService.canExecuteOnWeb(this.extension.local.manifest)&&this.updateStatus({icon:n_,message:new Nt(`${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===Ko.DisabledByExtensionDependency){this.updateStatus({icon:uh,message:new Nt(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(r=>Ma({id:r.identifier.value,uuid:r.uuid},this.extension.identifier));if(!this.extension.isWorkspaceScoped&&i&&n){if(this.extension.enablementState===Ko.EnabledWorkspace){this.updateStatus({message:new Nt(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 Nt(g(8e3,"Extension is enabled on '{0}'",this.extension.server.label))},!0);return}if(this.extension.enablementState===Ko.EnabledGlobally)return}if(!i&&!n){if(this.extension.enablementState===Ko.DisabledGlobally){this.updateStatus({message:new Nt(g(8001,"This extension is disabled globally by the user."))},!0);return}if(this.extension.enablementState===Ko.DisabledWorkspace){this.updateStatus({message:new Nt(g(8002,"This extension is disabled for this workspace by the user."))},!0);return}}if(i&&!n&&!this.extension.local.isValid){const r=this.extension.local.validations.filter(([o])=>o===Ze.Error).map(([,o])=>o);this.updateStatus({icon:ZC,message:new Nt(r.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===YI?-1:i.icon===YI?1:n.icon===ZC?-1:i.icon===ZC?1:n.icon===uh?-1:i.icon===uh?1:n.icon===n_?-1:i.icon===n_?1:0)),t&&(e?.icon===ZC?this.class=`${IE.CLASS} extension-status-error ${He.asClassName(ZC)}`:e?.icon===uh?this.class=`${IE.CLASS} extension-status-warning ${He.asClassName(uh)}`:e?.icon===n_?this.class=`${IE.CLASS} extension-status-info ${He.asClassName(n_)}`:e?.icon===YI?this.class=`${IE.CLASS} ${He.asClassName(YI)}`:this.class=`${IE.CLASS} hide`),this._onDidChangeStatus.fire()}async run(){if(this._status[0]?.icon===YI)return this.commandService.executeCommand("workbench.trust.manage")}},IE=_R,_R.CLASS=`${Cn.ICON_ACTION_CLASS} extension-status`,_R);CVe=IE=D([_(0,gv),_(1,Os),_(2,bi),_(3,Oae),_(4,mC),_(5,Xr),_(6,ps),_(7,Rm),_(8,Ci),_(9,xo),_(10,Fl),_(11,kZe)],CVe);var wk;let SVe=(wk=class extends an{constructor(e=zQ.ID,t=zQ.LABEL,i,n,r,o,a,c,l){super(e,t),this.extensionsWorkbenchService=i,this.extensionManagementServerService=n,this.quickInputService=r,this.notificationService=o,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(MZ,"@installed ").run().then(()=>this.extensionsWorkbenchService.reinstall(e).then(t=>{const i=!(t.local&&this.extensionService.canAddExtension(mD(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),r=i?[{label:g(8007,"Reload Now"),run:()=>this.hostService.reload()}]:[];this.notificationService.prompt(Ze.Info,n,r,{sticky:!0})},t=>this.notificationService.error(t)))}},zQ=wk,wk.ID="workbench.extensions.action.reinstall",wk.LABEL=g(8003,"Reinstall Extension..."),wk);SVe=zQ=D([_(2,Xr),_(3,gv),_(4,Tn),_(5,wi),_(6,Dc),_(7,we),_(8,ps)],SVe);var yk;let AVe=(yk=class extends an{constructor(e=$Q.ID,t=$Q.LABEL,i,n,r,o){super(e,t),this.extensionsWorkbenchService=i,this.quickInputService=n,this.instantiationService=r,this.extensionEnablementService=o}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(x9,e.extension,!0).run(),await this.instantiationService.createInstance(MZ,e.extension.identifier.id).run())}isEnabled(e){return this.instantiationService.createInstance(x9,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))}},$Q=yk,yk.ID="workbench.extensions.action.install.specificVersion",yk.LABEL=g(8008,"Install Specific Version of Extension..."),yk);AVe=$Q=D([_(2,Xr),_(3,Tn),_(4,we),_(5,Fl)],AVe);let PZ=class extends an{constructor(e,t,i,n,r){super(e),this.extensionsWorkbenchService=t,this.quickInputService=i,this.notificationService=n,this.progressService=r,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,r)=>n.displayName.localeCompare(r.displayName)),e.items=i.map(n=>({extension:n,label:n.displayName,description:n.version}))):(e.hide(),e.dispose(),this.notificationService.notify({severity:Ze.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:fd.Notification,title:g(8012,"Installing Extensions...")},()=>this.installExtensions(t)),this.notificationService.info(g(8013,"Successfully installed extensions.")))}}};PZ=D([_(1,Xr),_(2,Tn),_(3,wi),_(4,hg)],PZ);let EVe=class extends PZ{constructor(e,t,i,n,r,o,a,c,l){super("workbench.extensions.actions.installLocalExtensionsInRemote",e,t,n,i),this.extensionManagementServerService=r,this.extensionGalleryService=o,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(KCe,!0);return i.extension=t,i.enabled})}async installExtensions(e){const t=[],i=[],n=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform();await er.settled(e.map(async r=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...r.identifier,preRelease:!!r.local?.preRelease}],{targetPlatform:n,compatible:!0},Ue.None))[0];if(a){t.push(a);return}}const o=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.zip(r.local);i.push(o)})),await er.settled(t.map(r=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(r)));try{await er.settled(i.map(r=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.install(r)))}finally{try{await Promise.allSettled(i.map(r=>this.fileService.del(r)))}catch(r){this.logService.error(r)}}}};EVe=D([_(0,Xr),_(1,Tn),_(2,hg),_(3,wi),_(4,gv),_(5,LI),_(6,we),_(7,Xt),_(8,Ke)],EVe);let xVe=class extends PZ{constructor(e,t,i,n,r,o,a,c,l){super(e,t,i,r,n),this.extensionManagementServerService=o,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===wo.User&&t.server!==this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionsWorkbenchService.installed.some(i=>i.server===this.extensionManagementServerService.localExtensionManagementServer&&Ma(i.identifier,t.identifier)))}async installExtensions(e){const t=[],i=[],n=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform();await er.settled(e.map(async r=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...r.identifier,preRelease:!!r.local?.preRelease}],{targetPlatform:n,compatible:!0},Ue.None))[0];if(a){t.push(a);return}}const o=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.zip(r.local);i.push(o)})),await er.settled(t.map(r=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(r)));try{await er.settled(i.map(r=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(r)))}finally{try{await Promise.allSettled(i.map(r=>this.fileService.del(r)))}catch(r){this.logService.error(r)}}}};xVe=D([_(1,Xr),_(2,Tn),_(3,hg),_(4,wi),_(5,gv),_(6,LI),_(7,Xt),_(8,Ke)],xVe);vt.registerCommand("workbench.extensions.action.showExtensionsForLanguage",function(s,e){return s.get(Mm).openPaneComposite(ZU,io.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{i.search(`ext:${e.replace(/^\./,"")}`),i.focus()})});const tSe="workbench.extensions.action.showExtensionsWithIds";vt.registerCommand(tSe,function(s,e){return s.get(Mm).openPaneComposite(ZU,io.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{const n=e.map(r=>`@id:${r}`).join(" ");i.search(n),i.focus()})});W("extensionButton.background",{dark:yy,light:yy,hcDark:null,hcLight:null},g(8018,"Button background color for extension actions."));W("extensionButton.foreground",{dark:EM,light:EM,hcDark:null,hcLight:null},g(8019,"Button foreground color for extension actions."));W("extensionButton.hoverBackground",{dark:X8,light:X8,hcDark:null,hcLight:null},g(8020,"Button background hover color for extension actions."));W("extensionButton.separator",kQe,g(8021,"Button separator color for extension actions"));W("extensionButton.prominentBackground",{dark:yy,light:yy,hcDark:null,hcLight:null},g(8022,"Button background color for extension actions that stand out (e.g. install button)."));W("extensionButton.prominentForeground",{dark:EM,light:EM,hcDark:null,hcLight:null},g(8023,"Button foreground color for extension actions that stand out (e.g. install button)."));W("extensionButton.prominentHoverBackground",{dark:X8,light:X8,hcDark:null,hcLight:null},g(8024,"Button background hover color for extension actions that stand out (e.g. install button)."));Ep((s,e)=>{const t=s.getColor(FN);t&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${He.asCSSSelector(ZC)} { color: ${t}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${He.asCSSSelector(ZC)} { color: ${t}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${He.asCSSSelector(ZC)} { color: ${t}; }`));const i=s.getColor(vm);i&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${He.asCSSSelector(uh)} { color: ${i}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${He.asCSSSelector(uh)} { color: ${i}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${He.asCSSSelector(uh)} { color: ${i}; }`));const n=s.getColor(bm);n&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${He.asCSSSelector(n_)} { color: ${n}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${He.asCSSSelector(n_)} { color: ${n}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${He.asCSSSelector(n_)} { color: ${n}; }`))});let FZ=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=Wt(".chat-agent-hover@root",[Wt(".chat-agent-hover-header",[Wt(".chat-agent-hover-icon@icon"),Wt(".chat-agent-hover-details",[Wt(".chat-agent-hover-name@name"),Wt(".chat-agent-hover-extension",[Wt(".chat-agent-hover-extension-name@extensionName"),Wt(".chat-agent-hover-separator@separator"),Wt(".chat-agent-hover-publisher@publisher")])])]),Wt(".chat-agent-hover-warning@warning"),Wt("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 r=fe("span.extension-verified-publisher",void 0,eC(izt));this.publisherName=fe("span.chat-agent-hover-publisher-name"),oe(n.publisher,r,this.publisherName),n.warning.appendChild(eC(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 r=fe("img.icon");r.src=sf.uriToBrowserUri(t.metadata.icon).toString(!0),this.icon.replaceChildren(fe(".avatar",void 0,r))}else if(t.metadata.themeIcon){const r=fe(He.asCSSSelector(t.metadata.themeIcon));this.icon.replaceChildren(fe(".avatar.codicon-avatar",void 0,r))}this.domNode.classList.toggle("noExtensionName",!!t.isDynamic);const i=this.chatAgentNameService.getAgentNameRestriction(t);this.name.textContent=i?`@${t.name}`:$ce(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 r=this._register(new li);this.extensionService.getExtensions([{id:t.extensionId.value}],r.token).then(o=>{r.dispose(),o[0]?.publisherDomain?.verified&&(this.domNode.classList.toggle("verifiedPublisher",!0),this._onDidChangeContents.fire())})}}};FZ=D([_(0,wf),_(1,Xr),_(2,lce)],FZ);function rnt(s,e){return{actions:[{commandId:tSe,label:g(10557,"View Extension"),run:()=>{const t=s();t&&e.executeCommand(tSe,[t.extensionId.value])}}]}}let iSe=class extends V{constructor(e,t=[],i=fe(".chat-attached-context"),n,r){super(),this.variables=e,this.contentReferences=t,this.domNode=i,this.instantiationService=n,this.openerService=r,this.attachedContextDisposables=this._register(new Z),this._onDidChangeVisibility=this._register(new I),this._contextResourceLabels=this.instantiationService.createInstance(KA,{onDidChangeVisibility:this._onDidChangeVisibility.event}),this.initAttachedContext(i)}initAttachedContext(e){Ns(e),this.attachedContextDisposables.clear(),WTe(!!this.variables.length,this.domNode),this.variables.forEach(t=>{const i=oe(e,fe(".chat-attached-context-attachment.show-file-icons")),n=this._contextResourceLabels.create(i,{supportIcons:!0}),r=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,o=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===GW.Omitted,l=c||a?.options?.status?.kind===GW.Partial;if(r){const h=Kr(r.path),u=xb(r.path),f=`${h} ${u}`;let p;c?p=o?g(10558,"Omitted: {0}, line {1} to line {2}.",f,o.startLineNumber,o.endLineNumber):g(10559,"Omitted: {0}.",f):l?p=o?g(10560,"Partially attached: {0}, line {1} to line {2}.",f,o.startLineNumber,o.endLineNumber):g(10561,"Partially attached: {0}.",f):p=o?g(10562,"Attached: {0}, line {1} to line {2}.",f,o.startLineNumber,o.endLineNumber):g(10563,"Attached: {0}.",f),n.setFile(r,{fileKind:wa.FILE,hidePath:!0,range:o,title:a?.options?.status?.description}),i.ariaLabel=p,i.tabIndex=0,i.style.cursor="pointer",this.attachedContextDisposables.add(ue(i,ke.CLICK,async m=>{tn.stop(m,!0),r&&this.openerService.open(r,{fromUserGesture:!0,editorOptions:{selection:o}})}))}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")}}})}};iSe=D([_(3,we),_(4,Ar)],iSe);let nSe=class extends V{constructor(e,t,i,n){super(),this.editorService=i,this.telemetryService=n;const r=Qit(e.citations),o=Wt(".chat-code-citation-message@root",[Wt("span.chat-code-citation-label@label"),Wt(".chat-code-citation-button-container@button")]);o.label.textContent=r+" - ";const a=this._register(new Zd(o.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 +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:l9.Changelog}):this.extension.repository?this.openerService.open(this.extension.repository):this.extensionsWorkbenchService.open(this.extension)}return No(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),No(g(7915,"Updating extension {0} to version {1} completed.",e.displayName,e.latestVersion))}catch(t){this.instantiationService.createInstance(YW,e,e.latestVersion,FA.Update,t).run()}}},zP=hy,hy.EnabledClass=`${hy.LABEL_ACTION_CLASS} prominent update`,hy.DisabledClass=`${hy.EnabledClass} disabled`,hy);rVe=zP=D([_(1,Xr),_(2,ir),_(3,Ar),_(4,we)],rVe);var sb;let QCe=(sb=class extends Cn{constructor(e,t,i){super(w0.ID,w0.LABEL.value,w0.DisabledClass),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this._register(i.onDidChangeConfiguration(n=>{n.affectsConfiguration(vBt)&&this.update()})),this.update()}update(){this.enabled=!1,this.class=w0.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=w0.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),No(e?g(7917,"Enabled auto updates for",this.extension.displayName):g(7918,"Disabled auto updates for",this.extension.displayName))}},w0=sb,sb.ID="workbench.extensions.action.toggleAutoUpdateForExtension",sb.LABEL=Pe(7916,"Auto Update"),sb.EnabledClass=`${Cn.EXTENSION_ACTION_CLASS} auto-update`,sb.DisabledClass=`${sb.EnabledClass} hide`,sb);QCe=w0=D([_(0,Xr),_(1,Ol),_(2,Te)],QCe);var dk;let jCe=(dk=class extends Cn{constructor(e){super(MQ.ID,MQ.LABEL),this.extensionsWorkbenchService=e}update(){}async run(){if(!this.extension)return;No(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),No(e?g(7917,"Enabled auto updates for",this.extension.displayName):g(7918,"Disabled auto updates for",this.extension.displayName))}},MQ=dk,dk.ID="workbench.extensions.action.toggleAutoUpdatesForPublisher",dk.LABEL=g(7919,"Auto Update All (From Publisher)"),dk);jCe=MQ=D([_(0,Xr)],jCe);var KS;let oVe=(KS=class extends Cn{constructor(e,t){super("extensionsAction.migrateDeprecatedExtension",g(7921,"Migrate"),TV.DisabledClass,!1),this.small=e,this.extensionsWorkbenchService=t,this.update()}update(){if(this.enabled=!1,this.class=TV.DisabledClass,!this.extension?.local||this.extension.state!==Qr.Installed||!this.extension.deprecationInfo?.extension)return;const e=this.extension.deprecationInfo.extension.id;this.extensionsWorkbenchService.local.some(t=>Na(t.identifier,{id:e}))||(this.enabled=!0,this.class=TV.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}],Ue.None);await this.extensionsWorkbenchService.install(t,{isMachineScoped:e?.isMachineScoped})}},TV=KS,KS.EnabledClass=`${Cn.LABEL_ACTION_CLASS} migrate`,KS.DisabledClass=`${KS.EnabledClass} disabled`,KS);oVe=TV=D([_(1,Xr)],oVe);let kZ=class extends Cn{constructor(e,t,i,n,r){super(e,t,i,n),this.instantiationService=r,this._actionViewItem=null}createActionViewItem(e){return this._actionViewItem=this.instantiationService.createInstance(YCe,this,e),this._actionViewItem}run({actionGroups:e,disposeActionsOnHide:t}){return this._actionViewItem?.showMenu(e,t),Promise.resolve()}};kZ=D([_(4,we)],kZ);let YCe=class extends tC{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=So(this.element),r={x:n.left,y:n.top+n.height+10};this.contextMenuService.showContextMenu({getAnchor:()=>r,getActions:()=>i,actionRunner:this.actionRunner,onHide:()=>{t&&rct(i)}})}}getActions(e){let t=[];for(const i of e)t=[...t,...i,new Eo];return t.length?t.slice(0,t.length-1):t}};YCe=D([_(2,lo)],YCe);async function nzt(s,e,t){return t.invokeFunction(async i=>{const n=i.get(Xr),r=i.get(Ol),o=i.get(Wa),a=i.get(IZe),c=i.get(pce),l=i.get(mG),d=[];if(s){switch(d.push(["extension",s.identifier.id]),d.push(["isBuiltinExtension",s.isBuiltin]),d.push(["isDefaultApplicationScopedExtension",s.local&&v1t(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===$Ce.Workspace]),d.push(["isUserIgnoredRecommendation",c.globalIgnoredRecommendations.some(m=>m===s.identifier.id.toLowerCase())]),d.push(["isExtensionPinned",s.pinned]),d.push(["isExtensionEnabled",r.isEnabledEnablementState(s.enablementState)]),s.state){case Qr.Installing:d.push(["extensionStatus","installing"]);break;case Qr.Installed:d.push(["extensionStatus","installed"]);break;case Qr.Uninstalling:d.push(["extensionStatus","uninstalling"]);break;case Qr.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=>Uy(m,s))]),d.push(["extensionHasFileIconThemes",f.some(m=>Uy(m,s))]),d.push(["extensionHasProductIconThemes",p.some(m=>Uy(m,s))]),d.push(["canSetLanguage",n.canSetLanguage(s)]),d.push(["isActiveLanguagePackExtension",s.gallery&&jl===Gce(s.gallery)])}return o.getMenuActions(_e.ExtensionContext,e.createOverlay(d),{shouldForwardArgs:!0})})}function VK(s,e){const t=[];for(const[,i]of s)t.push(i.map(n=>n instanceof Hk?n:e.createInstance(JCe,n)));return t}var uy;let aVe=(uy=class extends kZ{constructor(e,t,i){super($P.ID,"","",!0,e),this.extensionService=t,this.contextKeyService=i,this.tooltip=g(7924,"Manage"),this.update()}async getActionGroups(){const e=[],t=await nzt(this.extension,this.contextKeyService,this.instantiationService),i=[],n=[],r=[],o=[];for(const[a,c]of t)a===CBt?n.push(...VK([[a,c]],this.instantiationService)[0]):a===SBt?r.push(...VK([[a,c]],this.instantiationService)[0]):a===yBt?i.push(...VK([[a,c]],this.instantiationService)[0]):o.push(...VK([[a,c]],this.instantiationService));return i.length&&e.push(i),e.push([this.instantiationService.createInstance(TZ),this.instantiationService.createInstance(IZ)]),e.push([this.instantiationService.createInstance(RZ),this.instantiationService.createInstance(LZ)]),r.length&&e.push(r),e.push([...n.length?n:[],this.instantiationService.createInstance(x9,this.extension,!1),this.instantiationService.createInstance(qCe)]),o.forEach(a=>e.push(a)),e.forEach(a=>a.forEach(c=>{c instanceof Cn&&(c.extension=this.extension)})),e}async run(){return await this.extensionService.whenInstalledExtensionsRegistered(),super.run({actionGroups:await this.getActionGroups(),disposeActionsOnHide:!0})}update(){if(this.class=$P.HideManageExtensionClass,this.enabled=!1,this.extension){const e=this.extension.state;this.enabled=e===Qr.Installed,this.class=this.enabled||e===Qr.Uninstalling?$P.Class:$P.HideManageExtensionClass}}},$P=uy,uy.ID="extensions.manage",uy.Class=`${Cn.ICON_ACTION_CLASS} manage `+He.asClassName(Z5t),uy.HideManageExtensionClass=`${uy.Class} hide`,uy);aVe=$P=D([_(0,we),_(1,ps),_(2,Le)],aVe);let JCe=class extends Cn{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===bBt?this.checked=!this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension):this.action.id===QCe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension):this.action.id===jCe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher):this.checked=this.action.checked)}async run(){if(this.extension){const e=this.extension.local?OM(this.extension.local.manifest.publisher,this.extension.local.manifest.name):this.extension.gallery?OM(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)}}};JCe=D([_(1,Xr)],JCe);var rb;let cVe=(rb=class extends Cn{constructor(e){super(y0.ID,y0.LABEL,y0.DisabledClass),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=y0.DisabledClass,this.extension&&(this.extension.isBuiltin||this.extension.state===Qr.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=y0.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))}},y0=rb,rb.ID="workbench.extensions.action.togglePreRlease",rb.LABEL=g(7925,"Pre-Release"),rb.EnabledClass=`${Cn.LABEL_ACTION_CLASS} pre-release`,rb.DisabledClass=`${rb.EnabledClass} hide`,rb);cVe=y0=D([_(0,Xr)],cVe);var hk;let x9=(hk=class extends Cn{constructor(e,t,i,n,r,o,a,c){super(NQ.ID,NQ.LABEL,Cn.LABEL_ACTION_CLASS),this.whenInstalled=t,this.extensionsWorkbenchService=i,this.extensionManagementService=n,this.extensionGalleryService=r,this.quickInputService=o,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===Qr.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((r,o)=>({id:r.version,label:r.version,description:`${WNe(new Date(Date.parse(r.date)),!0)}${r.isPreReleaseVersion?` (${g(7932,"pre-release")})`:""}${r.version===this.extension?.local?.manifest.version?` (${g(7933,"current")})`:""}`,ariaLabel:`${r.isPreReleaseVersion?"Pre-Release version":"Release version"} ${r.version}`,isPreReleaseVersion:r.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(r){this.instantiationService.createInstance(YW,this.extension,n.id,FA.Install,r).run()}}return null}},NQ=hk,hk.ID="workbench.extensions.action.install.anotherVersion",hk.LABEL=g(7930,"Install Specific Version..."),hk);x9=NQ=D([_(2,Xr),_(3,q6),_(4,LI),_(5,Tn),_(6,we),_(7,ir)],x9);var uk;let IZ=(uk=class extends Cn{constructor(e,t){super(PQ.ID,PQ.LABEL,Cn.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===Qr.Installed&&!this.extensionEnablementService.isEnabled(this.extension.local)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Ko.EnabledWorkspace)}},PQ=uk,uk.ID="extensions.enableForWorkspace",uk.LABEL=g(7935,"Enable (Workspace)"),uk);IZ=PQ=D([_(0,Xr),_(1,Ol)],IZ);var gk;let TZ=(gk=class extends Cn{constructor(e,t){super(FQ.ID,FQ.LABEL,Cn.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===Qr.Installed&&this.extensionEnablementService.isDisabledGlobally(this.extension.local)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Ko.EnabledGlobally)}},FQ=gk,gk.ID="extensions.enableGlobally",gk.LABEL=g(7937,"Enable"),gk);TZ=FQ=D([_(0,Xr),_(1,Ol)],TZ);var fk;let LZ=(fk=class extends Cn{constructor(e,t,i,n){super(OQ.ID,OQ.LABEL,Cn.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=>Na({id:e.identifier.value,uuid:e.uuid},this.extension.identifier)&&this.workspaceContextService.getWorkbenchState()!==Qi.EMPTY)&&(this.enabled=this.extension.state===Qr.Installed&&(this.extension.enablementState===Ko.EnabledGlobally||this.extension.enablementState===Ko.EnabledWorkspace)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Ko.DisabledWorkspace)}},OQ=fk,fk.ID="extensions.disableForWorkspace",fk.LABEL=g(7939,"Disable (Workspace)"),fk);LZ=OQ=D([_(0,Ci),_(1,Xr),_(2,Ol),_(3,ps)],LZ);var pk;let RZ=(pk=class extends Cn{constructor(e,t,i){super(BQ.ID,BQ.LABEL,Cn.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=>Na({id:e.identifier.value,uuid:e.uuid},this.extension.identifier))&&(this.enabled=this.extension.state===Qr.Installed&&(this.extension.enablementState===Ko.EnabledGlobally||this.extension.enablementState===Ko.EnabledWorkspace)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Ko.DisabledGlobally)}},BQ=pk,pk.ID="extensions.disableGlobally",pk.LABEL=g(7941,"Disable"),pk);RZ=BQ=D([_(0,Xr),_(1,Ol),_(2,ps)],RZ);let lVe=class extends jNe{constructor(e){super("extensions.enable",Cn.LABEL_ACTION_CLASS,[[e.createInstance(TZ),e.createInstance(IZ)]])}};lVe=D([_(0,we)],lVe);let dVe=class extends jNe{constructor(e){super("extensions.disable",Cn.LABEL_ACTION_CLASS,[[e.createInstance(RZ),e.createInstance(LZ)]])}};dVe=D([_(0,we)],dVe);var qS;let hVe=(qS=class extends Cn{constructor(e,t,i,n,r,o){super("extensions.runtimeState","",LV.DisabledClass,!1),this.hostService=e,this.extensionsWorkbenchService=t,this.updateService=i,this.extensionService=n,this.productService=r,this.telemetryService=o,this.updateWhenCounterExtensionChanges=!0,this._register(this.extensionService.onDidChangeExtensions(()=>this.update())),this.update()}update(){if(this.enabled=!1,this.tooltip="",this.class=LV.DisabledClass,!this.extension)return;const e=this.extension.state;if(e===Qr.Installing||e===Qr.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=LV.EnabledClass,this.tooltip=t.reason,this.label=t.action===qm.ReloadWindow?g(7943,"Reload Window"):t.action===qm.RestartExtensions?g(7944,"Restart Extensions"):t.action===qm.QuitAndInstall?g(7945,"Restart to Update"):t.action===qm.ApplyUpdate||t.action===qm.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===qm.ReloadWindow)return this.hostService.reload();if(e?.action===qm.RestartExtensions)return this.extensionsWorkbenchService.updateRunningExtensions();if(e?.action===qm.DownloadUpdate)return this.updateService.downloadUpdate();if(e?.action===qm.ApplyUpdate)return this.updateService.applyUpdate();if(e?.action===qm.QuitAndInstall)return this.updateService.quitAndInstall()}}},LV=qS,qS.EnabledClass=`${Cn.LABEL_ACTION_CLASS} reload`,qS.DisabledClass=`${qS.EnabledClass} disabled`,qS);hVe=LV=D([_(0,Dc),_(1,Xr),_(2,OXe),_(3,ps),_(4,xo),_(5,Ji)],hVe);function Uy(s,e){return!!(e&&s.extensionData&&An.equals(s.extensionData.extensionId,e.identifier.id))}function YNe(s,e,t,i){const n=[];for(const r of s)Uy(r,t)&&!(i&&r===e)&&n.push({label:r.label,id:r.id});return i&&(n.push({type:"separator",label:g(7933,"current")}),n.push({label:e.label,id:e.id})),n}var ob;let XCe=(ob=class extends Cn{constructor(e,t,i,n){super(C0.ID,C0.TITLE.value,C0.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?C0.EnabledClass:C0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Uy(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(),r=new Ph(100),o=YNe(i,n,this.extension,e),a=await this.quickInputService.pick(o,{placeHolder:g(7948,"Select Color Theme"),onDidFocus:c=>r.trigger(()=>this.workbenchThemeService.setColorTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setColorTheme(a?a.id:n.id,"auto")}},C0=ob,ob.ID="workbench.extensions.action.setColorTheme",ob.TITLE=Pe(7947,"Set Color Theme"),ob.EnabledClass=`${Cn.LABEL_ACTION_CLASS} theme`,ob.DisabledClass=`${ob.EnabledClass} disabled`,ob);XCe=C0=D([_(0,ps),_(1,mG),_(2,Tn),_(3,Ol)],XCe);var ab;let ZCe=(ab=class extends Cn{constructor(e,t,i,n){super(S0.ID,S0.TITLE.value,S0.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?S0.EnabledClass:S0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Uy(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(),r=new Ph(100),o=YNe(i,n,this.extension,e),a=await this.quickInputService.pick(o,{placeHolder:g(7950,"Select File Icon Theme"),onDidFocus:c=>r.trigger(()=>this.workbenchThemeService.setFileIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setFileIconTheme(a?a.id:n.id,"auto")}},S0=ab,ab.ID="workbench.extensions.action.setFileIconTheme",ab.TITLE=Pe(7949,"Set File Icon Theme"),ab.EnabledClass=`${Cn.LABEL_ACTION_CLASS} theme`,ab.DisabledClass=`${ab.EnabledClass} disabled`,ab);ZCe=S0=D([_(0,ps),_(1,mG),_(2,Tn),_(3,Ol)],ZCe);var cb;let eSe=(cb=class extends Cn{constructor(e,t,i,n){super(A0.ID,A0.TITLE.value,A0.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?A0.EnabledClass:A0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qr.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Uy(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(),r=new Ph(100),o=YNe(i,n,this.extension,e),a=await this.quickInputService.pick(o,{placeHolder:g(7952,"Select Product Icon Theme"),onDidFocus:c=>r.trigger(()=>this.workbenchThemeService.setProductIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setProductIconTheme(a?a.id:n.id,"auto")}},A0=cb,cb.ID="workbench.extensions.action.setProductIconTheme",cb.TITLE=Pe(7951,"Set Product Icon Theme"),cb.EnabledClass=`${Cn.LABEL_ACTION_CLASS} theme`,cb.DisabledClass=`${cb.EnabledClass} disabled`,cb);eSe=A0=D([_(0,ps),_(1,mG),_(2,Tn),_(3,Ol)],eSe);var lb;let uVe=(lb=class extends Cn{constructor(e){super(E0.ID,E0.TITLE.value,E0.DisabledClass,!1),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=E0.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&jl===Gce(this.extension.gallery)||(this.enabled=!0,this.class=E0.EnabledClass))}async run(){return this.extension&&this.extensionsWorkbenchService.setLanguage(this.extension)}},E0=lb,lb.ID="workbench.extensions.action.setDisplayLanguage",lb.TITLE=Pe(7953,"Set Display Language"),lb.EnabledClass=`${Cn.LABEL_ACTION_CLASS} language`,lb.DisabledClass=`${lb.EnabledClass} disabled`,lb);uVe=E0=D([_(0,Xr)],uVe);var db;let gVe=(db=class extends Cn{constructor(e,t){super(x0.ID,x0.TITLE.value,x0.DisabledClass,!1),this.extensionsWorkbenchService=e,this.localeService=t,this.update()}update(){this.enabled=!1,this.class=x0.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&jl!==Gce(this.extension.gallery)||(this.enabled=!0,this.class=x0.EnabledClass))}async run(){return this.extension&&this.localeService.clearLocalePreference()}},x0=db,db.ID="workbench.extensions.action.clearLanguage",db.TITLE=Pe(7954,"Clear Display Language"),db.EnabledClass=`${Cn.LABEL_ACTION_CLASS} language`,db.DisabledClass=`${db.EnabledClass} disabled`,db);gVe=x0=D([_(0,Xr),_(1,LZe)],gVe);var mk;let fVe=(mk=class extends an{constructor(e,t,i){super(WQ.ID,WQ.LABEL,void 0,!1),this.paneCompositeService=t,this.extensionWorkbenchService=i,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(ZU,io.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},Ue.None);return i?this.extensionWorkbenchService.open(i):null}},WQ=mk,mk.ID="workbench.extensions.action.showRecommendedExtension",mk.LABEL=g(7955,"Show Recommended Extension"),mk);fVe=WQ=D([_(1,Mm),_(2,Xr)],fVe);var _k;let pVe=(_k=class extends an{constructor(e,t,i,n){super(HQ.ID,HQ.LABEL,void 0,!1),this.paneCompositeService=t,this.instantiationService=i,this.extensionWorkbenchService=n,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(ZU,io.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},Ue.None);if(i){await this.extensionWorkbenchService.open(i);try{await this.extensionWorkbenchService.install(i)}catch(n){this.instantiationService.createInstance(YW,i,i.latestVersion,FA.Install,n).run()}}}},HQ=_k,_k.ID="workbench.extensions.action.installRecommendedExtension",_k.LABEL=g(7956,"Install Recommended Extension"),_k);pVe=HQ=D([_(1,Mm),_(2,we),_(3,Xr)],pVe);var vk;let mVe=(vk=class extends an{constructor(e,t){super(UQ.ID,"Ignore Recommendation"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=UQ.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()}},UQ=vk,vk.ID="extensions.ignore",vk.Class=`${Cn.LABEL_ACTION_CLASS} ignore`,vk);mVe=UQ=D([_(1,pce)],mVe);var bk;let _Ve=(bk=class extends an{constructor(e,t){super(VQ.ID,"Undo"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=VQ.Class,this.tooltip=g(7958,"Undo"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!1),Promise.resolve()}},VQ=bk,bk.ID="extensions.ignore",bk.Class=`${Cn.LABEL_ACTION_CLASS} undo-ignore`,bk);_Ve=VQ=D([_(1,pce)],_Ve);let MZ=class extends an{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(ZU,io.Sidebar,!0))?.getViewPaneContainer();e.search(this.searchValue),e.focus()}};MZ=D([_(1,Mm)],MZ);let NZ=class extends an{constructor(e,t,i,n,r,o,a,c){super(e,t),this.contextService=i,this.fileService=n,this.textFileService=r,this.editorService=o,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=af(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=rRe(e),r=p_e(n,i);if(r&&r.parent&&r.parent.children){const o=r.parent.children[1],a=o.children&&o.children.length?o.children[o.children.length-1]:null,c=a?a.offset+a.length:o.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,J4e).then(()=>({created:!0,extensionsFileResource:e,content:J4e})))}};NZ=D([_(2,Ci),_(3,Xt),_(4,Fr),_(5,ti),_(6,MI),_(7,pn)],NZ);var pR;let vVe=(pR=class extends NZ{constructor(e,t,i,n,r,o,a,c){super(e,t,r,i,n,o,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(DF));case Qi.WORKSPACE:return this.openWorkspaceConfigurationFile(this.contextService.getWorkspace().configuration)}return Promise.resolve()}},pR.ID="workbench.extensions.action.configureWorkspaceRecommendedExtensions",pR.LABEL=g(7961,"Configure Recommended Extensions (Workspace)"),pR);vVe=D([_(2,Xt),_(3,Fr),_(4,Ci),_(5,ti),_(6,MI),_(7,pn)],vVe);var mR;let bVe=(mR=class extends NZ{constructor(e,t,i,n,r,o,a,c,l){super(e,t,r,i,n,o,a,c),this.commandService=l}run(){const t=this.contextService.getWorkspace().folders.length===1?Promise.resolve(this.contextService.getWorkspace().folders[0]):this.commandService.executeCommand(tnt);return Promise.resolve(t).then(i=>i?this.openExtensionsFile(i.toResource(DF)):null)}},mR.ID="workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions",mR.LABEL=g(7962,"Configure Recommended Extensions (Workspace Folder)"),mR);bVe=D([_(2,Xt),_(3,Fr),_(4,Ci),_(5,ti),_(6,MI),_(7,pn),_(8,bi)],bVe);var QS;let wVe=(QS=class extends an{get extension(){return this._extension}set extension(e){this._extension&&e&&Na(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","",RV.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?RV.ENABLED_CLASS:RV.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 o=this.extensionService.extensions.filter(a=>Na({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0];return this.extension.local?o&&this.extension.version===o.version?!0:this.extensionService.canAddExtension(mD(this.extension.local)):!1},r=()=>this.extension.local?this.extensionService.extensions.every(o=>!(Na({id:o.identifier.value,uuid:o.uuid},this.extension.identifier)&&this.extension.server===this.extensionManagementServerService.getExtensionManagementServer(Cce(o))))?!0:this.extensionService.canRemoveExtension(mD(this.extension.local)):!1;if(e!==null){if(e===Qr.Installing&&this.status===Qr.Installed)return n()?this.initialStatus===Qr.Installed&&this.version!==t?g(7963,"Updated"):g(7964,"Installed"):null;if(e===Qr.Uninstalling&&this.status===Qr.Uninstalled)return this.initialStatus=this.status,r()?g(7965,"Uninstalled"):null}if(i!==null){const o=this.extensionEnablementService.isEnabledEnablementState(i),a=this.extensionEnablementService.isEnabledEnablementState(this.enablementState);if(!o&&a)return n()?g(7966,"Enabled"):null;if(o&&!a)return r()?g(7967,"Disabled"):null}return null}run(){return Promise.resolve()}},RV=QS,QS.ENABLED_CLASS=`${Cn.TEXT_ACTION_CLASS} extension-status-label`,QS.DISABLED_CLASS=`${QS.ENABLED_CLASS} hide`,QS);wVe=RV=D([_(0,ps),_(1,gv),_(2,Ol)],wVe);var jS;let yVe=(jS=class extends kZ{constructor(e,t,i,n){super("extensions.sync","",MV.SYNC_CLASS,!1,n),this.configurationService=e,this.extensionsWorkbenchService=t,this.userDataSyncEnablementService=i,this._register(M.filter(this.configurationService.onDidChangeConfiguration,r=>r.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===Qr.Installed,this.extension){const e=this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);this.class=e?MV.IGNORED_SYNC_CLASS:MV.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 an("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})}},MV=jS,jS.IGNORED_SYNC_CLASS=`${Cn.ICON_ACTION_CLASS} extension-sync ${He.asClassName(tzt)}`,jS.SYNC_CLASS=`${jS.ICON_ACTION_CLASS} extension-sync ${He.asClassName(ezt)}`,jS);yVe=MV=D([_(0,Te),_(1,Xr),_(2,BXe),_(3,we)],yVe);var _R;let CVe=(_R=class extends Cn{get status(){return this._status}constructor(e,t,i,n,r,o,a,c,l,d,h,u){super("extensions.status","",`${IE.CLASS} hide`,!1),this.extensionManagementServerService=e,this.labelService=t,this.commandService=i,this.workspaceTrustEnablementService=n,this.workspaceTrustService=r,this.extensionsWorkbenchService=o,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 a6,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:uh,message:new Nt(g(7972,"This extension was reported to be problematic."))},!0);return}if(this.extension.deprecationInfo){if(this.extension.deprecationInfo.extension){const r=`[${this.extension.deprecationInfo.extension.displayName}](${N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.extension.id]))}`)})`;this.updateStatus({icon:uh,message:new Nt(g(7973,"This extension is deprecated. Use the {0} extension instead.",r))},!0)}else if(this.extension.deprecationInfo.settings){const r=`[${g(7974,"settings")}](${N.parse(`command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.settings.map(o=>`@id:${o}`).join(" ")]))}`)})`;this.updateStatus({icon:uh,message:new Nt(g(7975,"This extension is deprecated as this functionality is now built-in to VS Code. Configure these {0} to use this functionality.",r))},!0)}else{const r=new Nt(g(7976,"This extension is deprecated as it is no longer being maintained."));this.extension.deprecationInfo.additionalInfo&&r.appendMarkdown(` ${this.extension.deprecationInfo.additionalInfo}`),this.updateStatus({icon:uh,message:r},!0)}return}if(this.extensionsWorkbenchService.canSetLanguage(this.extension))return;if(this.extension.outdated&&this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension)){const r=await this.extensionsWorkbenchService.shouldRequireConsentToUpdate(this.extension);if(r){const o=new Nt;o.appendMarkdown(`${r} `),o.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,l9.Changelog]))}`).toString():this.extension.repository?this.extension.repository:N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id]))}`).toString())),this.updateStatus({icon:uh,message:o},!0)}}if(this.extension.gallery&&this.extension.state===Qr.Uninstalled&&!await this.extensionsWorkbenchService.canInstall(this.extension)){if(this.extensionManagementServerService.localExtensionManagementServer||this.extensionManagementServerService.remoteExtensionManagementServer){const r=await(this.extensionManagementServerService.localExtensionManagementServer?this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform():this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform()),o=new Nt(`${g(7978,"The '{0}' extension is not available in {1} for {2}.",this.extension.displayName||this.extension.identifier.id,this.productService.nameLong,YRt(r))} [${g(7979,"Learn More")}](https://aka.ms/vscode-platform-specific-extensions)`);this.updateStatus({icon:uh,message:o},!0);return}if(this.extensionManagementServerService.webExtensionManagementServer){const r=g(7874,"{0} for the Web",this.productService.nameLong),o=new Nt(`${g(7980,"The '{0}' extension is not available in {1}.",this.extension.displayName||this.extension.identifier.id,r)} [${g(7981,"Learn Why")}](https://aka.ms/vscode-web-extensions-guide)`);this.updateStatus({icon:uh,message:o},!0);return}}if(!this.extension.local||!this.extension.server||this.extension.state!==Qr.Installed)return;if(this.extension.enablementState===Ko.DisabledByEnvironment){this.updateStatus({message:new Nt(g(7982,"This extension is disabled by the environment."))},!0);return}if(this.extension.enablementState===Ko.EnabledByEnvironment){this.updateStatus({message:new Nt(g(7983,"This extension is enabled because it is required in the current environment."))},!0);return}if(this.extension.enablementState===Ko.DisabledByVirtualWorkspace){const r=CK(this.extension.local.manifest.capabilities?.virtualWorkspaces);this.updateStatus({icon:n_,message:new Nt(r?uV(r):g(7984,"This extension has been disabled because it does not support virtual workspaces."))},!0);return}if(snt(this.contextService.getWorkspace())){const r=this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(this.extension.local.manifest),o=CK(this.extension.local.manifest.capabilities?.virtualWorkspaces);if(r==="limited"||o){this.updateStatus({icon:uh,message:new Nt(o?uV(o):g(7985,"This extension has limited features because the current workspace is virtual."))},!0);return}}if(this.extension.enablementState===Ko.DisabledByTrustRequirement||this.extension.enablementState===Ko.DisabledByExtensionDependency&&this.workbenchExtensionEnablementService.getDependenciesEnablementStates(this.extension.local).every(([,r])=>this.workbenchExtensionEnablementService.isEnabledEnablementState(r)||r===Ko.DisabledByTrustRequirement)){this.enabled=!0;const r=CK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);this.updateStatus({icon:YI,message:new Nt(r?uV(r):g(7986,"This extension has been disabled because the current workspace is not trusted."))},!0);return}if(this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()&&!this.workspaceTrustService.isWorkspaceTrusted()){const r=this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(this.extension.local.manifest),o=CK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);if(r==="limited"||o){this.enabled=!0,this.updateStatus({icon:YI,message:new Nt(o?uV(o):g(7987,"This extension has limited features because the current workspace is not trusted."))},!0);return}}if(this.extension.enablementState===Ko.DisabledByExtensionKind&&!this.extensionsWorkbenchService.installed.some(r=>Na(r.identifier,this.extension.identifier)&&r.server!==this.extension.server)){let r;this.extensionManagementServerService.localExtensionManagementServer===this.extension.server?this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.extensionManagementServerService.remoteExtensionManagementServer&&(r=new Nt(`${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?r=new Nt(`${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)`):Hn&&(r=new Nt(`${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&&(r=new Nt(`${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)`)),r&&this.updateStatus({icon:uh,message:r},!0);return}const e=new An(this.extension.identifier.id),t=je.as(ev.ExtensionFeaturesRegistry).getExtensionFeatures();for(const r of t){const o=this.extensionFeaturesManagementService.getAccessData(e,r.id)?.current?.status,a=`[${g(7992,"Manage Access")}](${N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,l9.Features,!1,r.id]))}`)})`;if(o?.severity===Ze.Error){this.updateStatus({icon:ZC,message:new Nt().appendText(o.message).appendMarkdown(` ${a}`)},!0);return}if(o?.severity===Ze.Warning){this.updateStatus({icon:uh,message:new Nt().appendText(o.message).appendMarkdown(` ${a}`)},!0);return}}if(this.extensionManagementServerService.remoteExtensionManagementServer){if(sMe(this.extension.local.manifest)){if(!this.extensionsWorkbenchService.installed.some(a=>Na(a.identifier,this.extension.identifier)&&a.server!==this.extension.server)){const a=this.extension.server===this.extensionManagementServerService.localExtensionManagementServer?new Nt(g(7993,"Install the language pack extension on '{0}' to enable it there also.",this.extensionManagementServerService.remoteExtensionManagementServer.label)):new Nt(g(7994,"Install the language pack extension locally to enable it there also."));this.updateStatus({icon:n_,message:a},!0)}return}const r=this.extensionService.extensions.filter(a=>Na({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0],o=r?this.extensionManagementServerService.getExtensionManagementServer(Cce(r)):null;if(this.extension.server===this.extensionManagementServerService.localExtensionManagementServer&&o===this.extensionManagementServerService.remoteExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.updateStatus({icon:n_,message:new Nt(`${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&&o===this.extensionManagementServerService.localExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)&&this.updateStatus({icon:n_,message:new Nt(`${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&&o===this.extensionManagementServerService.webExtensionManagementServer){this.extensionManifestPropertiesService.canExecuteOnWeb(this.extension.local.manifest)&&this.updateStatus({icon:n_,message:new Nt(`${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===Ko.DisabledByExtensionDependency){this.updateStatus({icon:uh,message:new Nt(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(r=>Na({id:r.identifier.value,uuid:r.uuid},this.extension.identifier));if(!this.extension.isWorkspaceScoped&&i&&n){if(this.extension.enablementState===Ko.EnabledWorkspace){this.updateStatus({message:new Nt(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 Nt(g(8e3,"Extension is enabled on '{0}'",this.extension.server.label))},!0);return}if(this.extension.enablementState===Ko.EnabledGlobally)return}if(!i&&!n){if(this.extension.enablementState===Ko.DisabledGlobally){this.updateStatus({message:new Nt(g(8001,"This extension is disabled globally by the user."))},!0);return}if(this.extension.enablementState===Ko.DisabledWorkspace){this.updateStatus({message:new Nt(g(8002,"This extension is disabled for this workspace by the user."))},!0);return}}if(i&&!n&&!this.extension.local.isValid){const r=this.extension.local.validations.filter(([o])=>o===Ze.Error).map(([,o])=>o);this.updateStatus({icon:ZC,message:new Nt(r.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===YI?-1:i.icon===YI?1:n.icon===ZC?-1:i.icon===ZC?1:n.icon===uh?-1:i.icon===uh?1:n.icon===n_?-1:i.icon===n_?1:0)),t&&(e?.icon===ZC?this.class=`${IE.CLASS} extension-status-error ${He.asClassName(ZC)}`:e?.icon===uh?this.class=`${IE.CLASS} extension-status-warning ${He.asClassName(uh)}`:e?.icon===n_?this.class=`${IE.CLASS} extension-status-info ${He.asClassName(n_)}`:e?.icon===YI?this.class=`${IE.CLASS} ${He.asClassName(YI)}`:this.class=`${IE.CLASS} hide`),this._onDidChangeStatus.fire()}async run(){if(this._status[0]?.icon===YI)return this.commandService.executeCommand("workbench.trust.manage")}},IE=_R,_R.CLASS=`${Cn.ICON_ACTION_CLASS} extension-status`,_R);CVe=IE=D([_(0,gv),_(1,Os),_(2,bi),_(3,Oae),_(4,mC),_(5,Xr),_(6,ps),_(7,Rm),_(8,Ci),_(9,xo),_(10,Ol),_(11,kZe)],CVe);var wk;let SVe=(wk=class extends an{constructor(e=zQ.ID,t=zQ.LABEL,i,n,r,o,a,c,l){super(e,t),this.extensionsWorkbenchService=i,this.extensionManagementServerService=n,this.quickInputService=r,this.notificationService=o,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(MZ,"@installed ").run().then(()=>this.extensionsWorkbenchService.reinstall(e).then(t=>{const i=!(t.local&&this.extensionService.canAddExtension(mD(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),r=i?[{label:g(8007,"Reload Now"),run:()=>this.hostService.reload()}]:[];this.notificationService.prompt(Ze.Info,n,r,{sticky:!0})},t=>this.notificationService.error(t)))}},zQ=wk,wk.ID="workbench.extensions.action.reinstall",wk.LABEL=g(8003,"Reinstall Extension..."),wk);SVe=zQ=D([_(2,Xr),_(3,gv),_(4,Tn),_(5,wi),_(6,Dc),_(7,we),_(8,ps)],SVe);var yk;let AVe=(yk=class extends an{constructor(e=$Q.ID,t=$Q.LABEL,i,n,r,o){super(e,t),this.extensionsWorkbenchService=i,this.quickInputService=n,this.instantiationService=r,this.extensionEnablementService=o}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(x9,e.extension,!0).run(),await this.instantiationService.createInstance(MZ,e.extension.identifier.id).run())}isEnabled(e){return this.instantiationService.createInstance(x9,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))}},$Q=yk,yk.ID="workbench.extensions.action.install.specificVersion",yk.LABEL=g(8008,"Install Specific Version of Extension..."),yk);AVe=$Q=D([_(2,Xr),_(3,Tn),_(4,we),_(5,Ol)],AVe);let PZ=class extends an{constructor(e,t,i,n,r){super(e),this.extensionsWorkbenchService=t,this.quickInputService=i,this.notificationService=n,this.progressService=r,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,r)=>n.displayName.localeCompare(r.displayName)),e.items=i.map(n=>({extension:n,label:n.displayName,description:n.version}))):(e.hide(),e.dispose(),this.notificationService.notify({severity:Ze.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:fd.Notification,title:g(8012,"Installing Extensions...")},()=>this.installExtensions(t)),this.notificationService.info(g(8013,"Successfully installed extensions.")))}}};PZ=D([_(1,Xr),_(2,Tn),_(3,wi),_(4,hg)],PZ);let EVe=class extends PZ{constructor(e,t,i,n,r,o,a,c,l){super("workbench.extensions.actions.installLocalExtensionsInRemote",e,t,n,i),this.extensionManagementServerService=r,this.extensionGalleryService=o,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(KCe,!0);return i.extension=t,i.enabled})}async installExtensions(e){const t=[],i=[],n=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform();await er.settled(e.map(async r=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...r.identifier,preRelease:!!r.local?.preRelease}],{targetPlatform:n,compatible:!0},Ue.None))[0];if(a){t.push(a);return}}const o=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.zip(r.local);i.push(o)})),await er.settled(t.map(r=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(r)));try{await er.settled(i.map(r=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.install(r)))}finally{try{await Promise.allSettled(i.map(r=>this.fileService.del(r)))}catch(r){this.logService.error(r)}}}};EVe=D([_(0,Xr),_(1,Tn),_(2,hg),_(3,wi),_(4,gv),_(5,LI),_(6,we),_(7,Xt),_(8,Ke)],EVe);let xVe=class extends PZ{constructor(e,t,i,n,r,o,a,c,l){super(e,t,i,r,n),this.extensionManagementServerService=o,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===wo.User&&t.server!==this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionsWorkbenchService.installed.some(i=>i.server===this.extensionManagementServerService.localExtensionManagementServer&&Na(i.identifier,t.identifier)))}async installExtensions(e){const t=[],i=[],n=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform();await er.settled(e.map(async r=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...r.identifier,preRelease:!!r.local?.preRelease}],{targetPlatform:n,compatible:!0},Ue.None))[0];if(a){t.push(a);return}}const o=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.zip(r.local);i.push(o)})),await er.settled(t.map(r=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(r)));try{await er.settled(i.map(r=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.install(r)))}finally{try{await Promise.allSettled(i.map(r=>this.fileService.del(r)))}catch(r){this.logService.error(r)}}}};xVe=D([_(1,Xr),_(2,Tn),_(3,hg),_(4,wi),_(5,gv),_(6,LI),_(7,Xt),_(8,Ke)],xVe);vt.registerCommand("workbench.extensions.action.showExtensionsForLanguage",function(s,e){return s.get(Mm).openPaneComposite(ZU,io.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{i.search(`ext:${e.replace(/^\./,"")}`),i.focus()})});const tSe="workbench.extensions.action.showExtensionsWithIds";vt.registerCommand(tSe,function(s,e){return s.get(Mm).openPaneComposite(ZU,io.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{const n=e.map(r=>`@id:${r}`).join(" ");i.search(n),i.focus()})});W("extensionButton.background",{dark:yy,light:yy,hcDark:null,hcLight:null},g(8018,"Button background color for extension actions."));W("extensionButton.foreground",{dark:EM,light:EM,hcDark:null,hcLight:null},g(8019,"Button foreground color for extension actions."));W("extensionButton.hoverBackground",{dark:X8,light:X8,hcDark:null,hcLight:null},g(8020,"Button background hover color for extension actions."));W("extensionButton.separator",kQe,g(8021,"Button separator color for extension actions"));W("extensionButton.prominentBackground",{dark:yy,light:yy,hcDark:null,hcLight:null},g(8022,"Button background color for extension actions that stand out (e.g. install button)."));W("extensionButton.prominentForeground",{dark:EM,light:EM,hcDark:null,hcLight:null},g(8023,"Button foreground color for extension actions that stand out (e.g. install button)."));W("extensionButton.prominentHoverBackground",{dark:X8,light:X8,hcDark:null,hcLight:null},g(8024,"Button background hover color for extension actions that stand out (e.g. install button)."));Ep((s,e)=>{const t=s.getColor(FN);t&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${He.asCSSSelector(ZC)} { color: ${t}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${He.asCSSSelector(ZC)} { color: ${t}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${He.asCSSSelector(ZC)} { color: ${t}; }`));const i=s.getColor(vm);i&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${He.asCSSSelector(uh)} { color: ${i}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${He.asCSSSelector(uh)} { color: ${i}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${He.asCSSSelector(uh)} { color: ${i}; }`));const n=s.getColor(bm);n&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${He.asCSSSelector(n_)} { color: ${n}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${He.asCSSSelector(n_)} { color: ${n}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${He.asCSSSelector(n_)} { color: ${n}; }`))});let FZ=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=Wt(".chat-agent-hover@root",[Wt(".chat-agent-hover-header",[Wt(".chat-agent-hover-icon@icon"),Wt(".chat-agent-hover-details",[Wt(".chat-agent-hover-name@name"),Wt(".chat-agent-hover-extension",[Wt(".chat-agent-hover-extension-name@extensionName"),Wt(".chat-agent-hover-separator@separator"),Wt(".chat-agent-hover-publisher@publisher")])])]),Wt(".chat-agent-hover-warning@warning"),Wt("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 r=fe("span.extension-verified-publisher",void 0,eC(izt));this.publisherName=fe("span.chat-agent-hover-publisher-name"),oe(n.publisher,r,this.publisherName),n.warning.appendChild(eC(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 r=fe("img.icon");r.src=sf.uriToBrowserUri(t.metadata.icon).toString(!0),this.icon.replaceChildren(fe(".avatar",void 0,r))}else if(t.metadata.themeIcon){const r=fe(He.asCSSSelector(t.metadata.themeIcon));this.icon.replaceChildren(fe(".avatar.codicon-avatar",void 0,r))}this.domNode.classList.toggle("noExtensionName",!!t.isDynamic);const i=this.chatAgentNameService.getAgentNameRestriction(t);this.name.textContent=i?`@${t.name}`:$ce(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 r=this._register(new li);this.extensionService.getExtensions([{id:t.extensionId.value}],r.token).then(o=>{r.dispose(),o[0]?.publisherDomain?.verified&&(this.domNode.classList.toggle("verifiedPublisher",!0),this._onDidChangeContents.fire())})}}};FZ=D([_(0,wf),_(1,Xr),_(2,lce)],FZ);function rnt(s,e){return{actions:[{commandId:tSe,label:g(10557,"View Extension"),run:()=>{const t=s();t&&e.executeCommand(tSe,[t.extensionId.value])}}]}}let iSe=class extends V{constructor(e,t=[],i=fe(".chat-attached-context"),n,r){super(),this.variables=e,this.contentReferences=t,this.domNode=i,this.instantiationService=n,this.openerService=r,this.attachedContextDisposables=this._register(new Z),this._onDidChangeVisibility=this._register(new I),this._contextResourceLabels=this.instantiationService.createInstance(KA,{onDidChangeVisibility:this._onDidChangeVisibility.event}),this.initAttachedContext(i)}initAttachedContext(e){Ns(e),this.attachedContextDisposables.clear(),WTe(!!this.variables.length,this.domNode),this.variables.forEach(t=>{const i=oe(e,fe(".chat-attached-context-attachment.show-file-icons")),n=this._contextResourceLabels.create(i,{supportIcons:!0}),r=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,o=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===GW.Omitted,l=c||a?.options?.status?.kind===GW.Partial;if(r){const h=Kr(r.path),u=xb(r.path),f=`${h} ${u}`;let p;c?p=o?g(10558,"Omitted: {0}, line {1} to line {2}.",f,o.startLineNumber,o.endLineNumber):g(10559,"Omitted: {0}.",f):l?p=o?g(10560,"Partially attached: {0}, line {1} to line {2}.",f,o.startLineNumber,o.endLineNumber):g(10561,"Partially attached: {0}.",f):p=o?g(10562,"Attached: {0}, line {1} to line {2}.",f,o.startLineNumber,o.endLineNumber):g(10563,"Attached: {0}.",f),n.setFile(r,{fileKind:wa.FILE,hidePath:!0,range:o,title:a?.options?.status?.description}),i.ariaLabel=p,i.tabIndex=0,i.style.cursor="pointer",this.attachedContextDisposables.add(ue(i,ke.CLICK,async m=>{tn.stop(m,!0),r&&this.openerService.open(r,{fromUserGesture:!0,editorOptions:{selection:o}})}))}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")}}})}};iSe=D([_(3,we),_(4,Ar)],iSe);let nSe=class extends V{constructor(e,t,i,n){super(),this.editorService=i,this.telemetryService=n;const r=Qit(e.citations),o=Wt(".chat-code-citation-message@root",[Wt("span.chat-code-citation-label@label"),Wt(".chat-code-citation-button-container@button")]);o.label.textContent=r+" - ";const a=this._register(new Zd(o.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()} @@ -824,25 +824,25 @@ ${l.snippet} \`\`\` `).join(` -`);this.editorService.openEditor({resource:void 0,contents:c,languageId:"markdown"}),this.telemetryService.publicLog2("openedChatCodeCitations")})),this.domNode=o.root}hasSameContent(e,t,i){return e.kind==="codeCitations"}};nSe=D([_(2,ti),_(3,Ji)],nSe);const szt=fe;let sSe=class extends V{constructor(e,t,i){super(),this.commandService=i,this.domNode=szt(".chat-command-button");const n=!bs(t.element)||!t.element.isStale,r=n?e.command.tooltip:g(10565,"Button not available in restored chat"),o=this._register(new Zd(this.domNode,{...M6,supportIcons:!0,title:r}));o.label=e.command.title,o.enabled=n,this._register(o.onDidClick(()=>this.commandService.executeCommand(e.command.id,...e.command.arguments??[])))}hasSameContent(e){return e.kind==="command"}};sSe=D([_(2,bi)],sSe);var rzt=".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}";gt(rzt,{});let rSe=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 r=Wt(".chat-confirmation-widget@root",[Wt(".chat-confirmation-widget-title@title"),Wt(".chat-confirmation-widget-message@message"),Wt(".chat-confirmation-buttons-container@buttonsContainer")]);this._domNode=r.root;const o=this._register(this.instantiationService.createInstance(Z_,{})),a=this._register(o.render(new Nt(e)));r.title.appendChild(a.element);const c=this._register(o.render(new Nt(t)));r.message.appendChild(c.element),i.forEach(l=>{const d=new Zd(r.buttonsContainer,{...M6,secondary:l.isSecondary});d.label=l.label,this._register(d.onDidClick(()=>this._onDidClick.fire(l)))})}};rSe=D([_(3,we)],rSe);let oSe=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 r=t.element,o=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(rSe,e.title,e.message,o));a.setShowButtons(!e.isUsed),this._register(a.onDidClick(async c=>{if(bs(r)){const l=`${c.label}: "${e.title}"`,d=c.isSecondary?{rejectedConfirmationData:[c.data]}:{acceptedConfirmationData:[c.data]};d.agentId=r.agent?.id,d.slashCommand=r.slashCommand?.name,await this.chatService.sendRequest(r.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)}};oSe=D([_(2,we),_(3,Lm)],oSe);class Kce 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 hn(255,255,255,.1)),light:new me(new hn(0,0,0,.1)),hcDark:yt,hcLight:yt},g(7156,"The border color of a chat request."));const ozt=W("chat.requestBackground",{dark:rt(Uc,.62),light:rt(Uc,.62),hcDark:kh,hcLight:null},g(7157,"The background color of a chat request.")),DVe=W("chat.slashCommandBackground",{dark:"#34414b8f",light:"#d2ecff99",hcDark:me.white,hcLight:DT},g(7158,"The background color of a chat slash command.")),kVe=W("chat.slashCommandForeground",{dark:"#40A6FF",light:"#306CA2",hcDark:me.black,hcLight:dae},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",$i,g(7161,"The foreground color of a chat avatar."));const Mue="http://_vscodedecoration_",GQ="http://_chatagent_",azt="http://_chatslash_";function czt(s,e,t){const i=t.get(lce),n=t.get(wf),r=i.getAgentNameRestriction(s);let o=`${r?s.name:$ce(s)}`;r&&n.agentHasDupeName(s.id)&&(o+=` (${s.publisherDisplayName})`);const c={agentId:s.id,name:o,isClickable:e};return`[${s.name}](${GQ}?${encodeURIComponent(JSON.stringify(c))})`}let OZ=class{constructor(e,t,i,n,r,o,a,c,l){this.keybindingService=e,this.labelService=t,this.logService=i,this.chatAgentService=n,this.instantiationService=r,this.hoverService=o,this.chatService=a,this.chatWidgetService=c,this.commandService=l}convertParsedRequestToMarkdown(e){let t="";for(const i of e.parts)if(i instanceof ub)t+=i.text;else if(i instanceof qg)t+=this.instantiationService.invokeFunction(n=>czt(i.agent,!1,n));else{const n=i instanceof $W&&i.data instanceof N?i.data:void 0,r=n?encodeURIComponent(this.labelService.getUriLabel(n,{relative:!0})):i instanceof qg?i.agent.id:"",o=i.text;t+=`[${o}](${Mue}?${r})`}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(GQ)){let r;try{r=JSON.parse(decodeURIComponent(n.slice(GQ.length+1)))}catch(o){this.logService.error("Invalid chat widget render data JSON",Po(o))}r&&i.parentElement.replaceChild(this.renderAgentWidget(r,t),i)}else if(n.startsWith(azt)){let r;try{r=JSON.parse(decodeURIComponent(n.slice(GQ.length+1)))}catch(o){this.logService.error("Invalid chat slash command render data JSON",Po(o))}r&&i.parentElement.replaceChild(this.renderSlashCommandWidget(i.textContent,r,t),i)}else if(n.startsWith(Mue)){const r=decodeURIComponent(n.slice(Mue.length+1));i.parentElement.replaceChild(this.renderResourceWidget(i.textContent,r),i)}else n.startsWith(jit)?this.renderFileWidget(n,i):n.startsWith("command:")&&this.injectKeybindingHint(i,n,this.keybindingService)}),t}renderAgentWidget(e,t){const i=`${i4}${e.name}`;let n;if(e.isClickable){n=fe("span.chat-agent-widget");const a=t.add(new Zd(n,{buttonBackground:$e(DVe),buttonForeground:$e(kVe),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 r=this.chatAgentService.getAgent(e.agentId),o=new Ca(()=>t.add(this.instantiationService.createInstance(FZ)));return t.add(this.hoverService.setupManagedHover(Fo("element"),n,()=>(o.value.setAgent(e.agentId),o.value.domNode),r&&rnt(()=>r,this.commandService))),n}renderSlashCommandWidget(e,t,i){const n=fe("span.chat-agent-widget.chat-command-widget"),r=this.chatAgentService.getAgent(t.agentId),o=i.add(new Zd(n,{buttonBackground:$e(DVe),buttonForeground:$e(kVe),buttonHoverBackground:void 0}));return o.label=e,i.add(o.onDidClick(()=>{const a=this.chatWidgetService.lastFocusedWidget;if(!a||!r)return;const c=r.slashCommands.find(l=>l.name===t.command);this.chatService.sendRequest(a.viewModel.sessionId,c?.sampleRequest??"",{location:a.location,agentId:r.id,slashCommand:t.command})})),n}renderFileWidget(e,t){const i=N.parse(e);let n;try{n=Mr(JSON.parse(i.fragment))}catch(a){this.logService.error("Invalid chat widget render data JSON",Po(a));return}if(!n.uri||!N.isUri(n.uri)){this.logService.error(`Invalid chat widget render data: ${i.fragment}`);return}const r=n.range?`${n.range.startLineNumber}-${n.range.endLineNumber}`:"";t.setAttribute("data-href",n.uri.with({fragment:r}).toString());const o=this.labelService.getUriLabel(n.uri,{relative:!0});t.title=n.range?`${o}#${n.range.startLineNumber}-${n.range.endLineNumber}`:o}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 r=i.lookupKeybinding(n);if(r){const o=r.getLabel();o&&(e.textContent=`${e.textContent} (${o})`)}}}};OZ=D([_(0,Vt),_(1,Os),_(2,Ke),_(3,wf),_(4,we),_(5,tc),_(6,Lm),_(7,qN),_(8,bi)],OZ);const IVe=fe;let BZ=class extends V{constructor(e,t,i,n=!1,r=0,o,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(OZ),m=[];let v=r;const b=this._register(o.render(e,{fillInIncompleteTokens:n,codeBlockRendererSync:(w,y)=>{const C=v++;let A,L,k;if(ga(w,z5t))try{const G=$5t(y);L=G.range&&F.lift(G.range),A=this.textModelService.createModelReference(G.uri).then(Y=>Y.object)}catch{return IVe("div")}else{if(!zu(f)&&!bs(f))return console.error("Trying to render code block in welcome",f.id,C),IVe("div");const G=bs(f)||zu(f)?f.sessionId:"",Y=this.codeBlockModelCollection.getOrCreate(G,f,C);k=Y.vulns,A=Y.model}const P=bs(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 r=this.editorPool.get(),o=r.object;return bs(e.element)&&this.codeBlockModelCollection.update(e.element.sessionId,e.element,e.codeBlockIndex,{text:t,languageId:e.languageId}),o.render(e,i,n),r}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)}};BZ=D([_(9,Le),_(10,pn),_(11,we)],BZ);let aSe=class extends V{inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._pool=this._register(new Kce(()=>n.createInstance(ICe,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)}}}};aSe=D([_(3,we)],aSe);class ont extends V{constructor(e,t,i,n,r){super();const o=i.content.slice(i.index+1);if(this.showSpinner=n??TVe(o,i.element),r!==!0&&o.some(h=>h.kind!=="progressMessage")){this.domNode=fe("");return}this.showSpinner&&No(e.content.value);const c=this.showSpinner?He.modify(ve.loading,"spin").id:ve.check.id,l=new Nt(`$(${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=TVe(t,i);return e.kind==="progressMessage"&&this.showSpinner===n}}function TVe(s,e){return bs(e)&&!e.isComplete&&s.length===0}var cSe;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_LIGHT="hcLight",s.HIGH_CONTRAST_DARK="hcDark"})(cSe||(cSe={}));var NV;const lzt="workbench.view.explorer",Vb="workbench.explorer.fileView";new Q("explorerViewletVisible",!0,{type:"boolean",description:g(5364,"True when the EXPLORER viewlet is visible.")});const JNe=new Q("foldersViewVisible",!0,{type:"boolean",description:g(5365,"True when the FOLDERS view (the file tree within the explorer view container) is visible.")}),dzt=new Q("explorerResourceIsFolder",!1,{type:"boolean",description:g(5366,"True when the focused item in the EXPLORER is a folder.")}),ant=new Q("explorerResourceReadonly",!1,{type:"boolean",description:g(5367,"True when the focused item in the EXPLORER is read-only.")}),cnt=ant.toNegated(),hzt=new Q("explorerResourceAvailableEditorIds",""),uzt=new Q("explorerResourceIsRoot",!1,{type:"boolean",description:g(5368,"True when the focused item in the EXPLORER is a root folder.")}),gzt=new Q("explorerResourceCut",!1,{type:"boolean",description:g(5369,"True when an item in the EXPLORER has been cut for cut and paste.")}),fzt=new Q("explorerResourceMoveableToTrash",!1,{type:"boolean",description:g(5370,"True when the focused item in the EXPLORER can be moved to trash.")}),lnt=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 dnt=new Q("explorerViewletFocus",!0,{type:"boolean",description:g(5373,"True when the focus is inside the EXPLORER viewlet.")}),pzt=new Q("explorerViewletCompressedFocus",!0,{type:"boolean",description:g(5374,"True when the focused item in the EXPLORER view is a compact item.")}),mzt=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.")}),_zt=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.")}),vzt=new Q("viewHasSomeCollapsibleItem",!1,{type:"boolean",description:g(5377,"True when a workspace in the EXPLORER view has some collapsible root child.")});he.and(JNe,lnt,he.not(Uae));he.and(JNe,dnt,he.not(Uae));const hnt="workbench.editors.files.textFileEditor",unt="workbench.editors.files.fileEditorInput",bzt="workbench.editors.files.binaryFileEditor";var lSe;(function(s){s.Default="default",s.Mixed="mixed",s.FilesFirst="filesFirst",s.Type="type",s.Modified="modified",s.FoldersNestsFiles="foldersNestsFiles"})(lSe||(lSe={}));var BT;(function(s){s.Verbose="verbose",s.Default="default",s.Light="light"})(BT||(BT={}));var LVe;(function(s){s.Default="default",s.Upper="upper",s.Lower="lower",s.Unicode="unicode"})(LVe||(LVe={}));let RVe=NV=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 yn)}static async open(e,t,i,n,r){await n.openEditor({original:{resource:NV.resourceToTextFile(t,e)},modified:{resource:e},label:i,options:r})}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=NV.textFileToResource(e),i=await this.resolveEditorModel(e);if(!this.fileWatcherDisposable.value){const n=new Z;this.fileWatcherDisposable.value=n,n.add(this.fileService.onDidFilesChange(r=>{r.contains(t,Tr.UPDATED)&&this.resolveEditorModel(e,!1)})),i&&n.add(M.once(i.onWillDispose)(()=>this.fileWatcherDisposable.clear()))}return i}async resolveEditorModel(e,t=!0){const i=NV.textFileToResource(e),n=await this.textFileService.readStream(i);let r=this.modelService.getModel(e);if(r)this.modelService.updateModel(r,n.value);else if(t){const o=this.modelService.getModel(i);let a;o?a=this.languageService.createById(o.getLanguageId()):a=this.languageService.createByFilepathOrFirstLine(i),r=this.modelService.createModel(n.value,a,e)}return r}};RVe=NV=D([_(0,Fr),_(1,Xt),_(2,Di),_(3,fi)],RVe);const Qre=class Qre{constructor(e,t){this._editor=e,this._group=t,this.id=Qre.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 Pa.getOriginalUri(this.editor,{supportSideBySide:Us.PRIMARY})}};Qre.COUNTER=0;let WZ=Qre;var MVe;(function(s){s[s.Confirmation=1]="Confirmation",s[s.Prompt=2]="Prompt",s[s.Input=3]="Input"})(MVe||(MVe={}));var qh;(function(s){s[s.SAVE=0]="SAVE",s[s.DONT_SAVE=1]="DONT_SAVE",s[s.CANCEL=2]="CANCEL"})(qh||(qh={}));const zK=10;function gnt(s){const e=[];return e.push(...s.slice(0,zK).map(t=>typeof t=="string"?t:vi(t))),s.length>zK&&(s.length-zK===1?e.push(g(5690,"...1 additional file not shown")):e.push(g(5691,"...{0} additional files not shown",s.length-zK))),e.push(""),e.join(` -`)}var wzt=".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)}";gt(wzt,{});const HZ=0,NVe=[HZ,[]];function PVe(s,e,t,i){if(!s||!e)return NVe;const n=s.length,r=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=Czt(v,b,i,n,w,R),z&&P+z>=k&&(o||m||n.startsWith(e,w))?(c[C]=R+1,a[C]=P+z):(c[C]=HZ,a[C]=k)}}const l=[];let d=t-1,h=r-1;for(;d>=0&&h>=0;){const u=d*r+h;c[u]===HZ||(l.push(h),d--),h--}return[a[t*r-1],l.reverse()]}function Czt(s,e,t,i,n,r){let o=0;if(!Szt(e,i[n]))return o;if(o+=1,r>0&&(o+=r*5),s===t[n]&&(o+=1),n===0)o+=8;else{const a=Azt(t.charCodeAt(n-1));a?o+=a:E6(t.charCodeAt(n))&&r===0&&(o+=2)}return o}function Szt(s,e){return s===e?!0:s==="/"||s==="\\"?e==="/"||e==="\\":!1}function Azt(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 fnt=[void 0,[]];function Nue(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?Ezt(s,n.values,t,i):pnt(s,e,t,i)}function Ezt(s,e,t,i){let n=0;const r=[];for(const o of e){const[a,c]=pnt(s,o,t,i);if(typeof a!="number")return fnt;n+=a,r.push(...c)}return[n,gSe(r)]}function pnt(s,e,t,i){const n=qk(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],NU(n)]:fnt}const UZ=Object.freeze({score:0}),KQ=1<<18,dSe=1<<17,hSe=65536;function xzt(s,e,t,i){const n=i.values?i.values:[i];return Hc({[i.normalized]:{values:n.map(o=>({value:o.normalized,expectContiguousMatch:o.expectContiguousMatch})),label:s,description:e,allowNonContiguousMatches:t}})}function uSe(s,e,t,i,n){if(!s||!e.normalized)return UZ;const r=i.getItemLabel(s);if(!r)return UZ;const o=i.getItemDescription(s),a=xzt(r,o,t,e),c=n[a];if(c)return c;const l=Dzt(r,o,i.getItemPath(s),e);return n[a]=l,l}function Dzt(s,e,t,i,n){const r=!t||!i.containsPathSeparator;return t&&(mo?i.pathNormalized===t:ga(i.pathNormalized,t))?{score:KQ,labelMatch:[{start:0,end:s.length}],descriptionMatch:e?[{start:0,end:e.length}]:void 0}:i.values&&i.values.length>1?kzt(s,e,t,i.values,r):mnt(s,e,t,i,r)}function kzt(s,e,t,i,n,r){let o=0;const a=[],c=[];for(const l of i){const{score:d,labelMatch:h,descriptionMatch:u}=mnt(s,e,t,l,n);if(d===HZ)return UZ;o+=d,h&&a.push(...h),u&&c.push(...u)}return{score:o,labelMatch:gSe(a),descriptionMatch:gSe(c)}}function mnt(s,e,t,i,n,r){if(n||!e){const[o,a]=PVe(s,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(o){const c=kM(i.normalized,s);let l;if(c){l=dSe;const d=Math.round(i.normalized.length/s.length*100);l+=d}else l=hSe;return{score:l+o,labelMatch:c||FVe(a)}}}if(e){let o=e;t&&(o=`${e}${au}`);const a=o.length,c=`${o}${s}`,[l,d]=PVe(c,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(l){const h=FVe(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 UZ}function FVe(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 gSe(s){const e=s.sort((n,r)=>n.start-r.start),t=[];let i;for(const n of e)!i||!Izt(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 Izt(s,e){return!(s.endhSe||l>hSe){if(c!==l)return c>l?-1:1;if(cl?-1:1;const d=Array.isArray(o.labelMatch)&&o.labelMatch.length>0,h=Array.isArray(a.labelMatch)&&a.labelMatch.length>0;if(d&&!h)return-1;if(h&&!d)return 1;const u=OVe(s,o,n),f=OVe(e,a,n);return u&&f&&u!==f?f>u?-1:1:Rzt(s,e,t,n)}function OVe(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 r=t.getItemDescription(s);r&&(n+=r.length)}}else e.descriptionMatch&&e.descriptionMatch.length&&(n=e.descriptionMatch[e.descriptionMatch.length-1].end);return n-i}function Lzt(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,r=e[0].start,a=e[e.length-1].end-r;return n===a?0:a=0,o=BVe(s);let a;const c=s.split(_nt);if(c.length>1)for(const l of c){const d=BVe(l),{pathNormalized:h,normalized:u,normalizedLowercase:f}=WVe(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:r,expectContiguousMatch:o}}function WVe(s){let e;jn?e=s.replace(/\//g,au):e=s.replace(/\\/g,au);const t=Rct(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function HVe(s){return Array.isArray(s)?D9(s.map(e=>e.original).join(_nt)):D9(s.original)}var fSe,pSe,mSe;let k9=class extends zNe{constructor(e,t,i,n,r){super(e,{canAcceptInBackground:!0,noResultsPick:{label:g(9601,"No matching editors"),groupId:-1}}),this.editorGroupService=t,this.editorService=i,this.modelService=n,this.languageService=r,this.pickState=new class{constructor(){this.scorerCache=Object.create(null),this.isQuickNavigating=void 0}reset(o){o||(this.scorerCache=Object.create(null)),this.isQuickNavigating=o}}}provide(e,t){return this.pickState.reset(!!e.quickNavigate),super.provide(e,t)}_getPicks(e){const t=D9(e),i=this.doGetEditorPickItems().filter(r=>{if(!t.normalized)return!0;const o=uSe(r,t,!0,CWe,this.pickState.scorerCache);return o.score?(r.highlights={label:o.labelMatch,description:o.descriptionMatch},!0):!1});if(t.normalized){const r=this.editorGroupService.getGroups(gu.GRID_APPEARANCE).map(o=>o.id);i.sort((o,a)=>o.groupId!==a.groupId?r.indexOf(o.groupId)-r.indexOf(a.groupId):Tzt(o,a,t,!0,CWe,this.pickState.scorerCache))}const n=[];if(this.editorGroupService.count>1){let r;for(const o of i){if(typeof r!="number"||r!==o.groupId){const a=this.editorGroupService.getGroup(o.groupId);a&&n.push({type:"separator",label:a.label}),r=o.groupId}n.push(o)}}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 r=Pa.getOriginalUri(i,{supportSideBySide:Us.PRIMARY}),o=i.isDirty()&&!i.isSaving(),a=i.getDescription(),c=a?`${i.getName()} ${a}`:i.getName();return{groupId:n,resource:r,label:i.getName(),ariaLabel:t.size>1?o?g(9602,"{0}, unsaved changes, {1}",c,t.get(n)):g(9603,"{0}, {1}",c,t.get(n)):o?g(9604,"{0}, unsaved changes",c):c,description:a,iconClasses:Wx(this.modelService,this.languageService,r,void 0,i.getIcon()).concat(i.getLabelExtraClasses()),italic:!this.editorGroupService.getGroup(n)?.isPinned(i),buttons:[{iconClass:o?"dirty-editor "+He.asClassName(ve.closeDirty):He.asClassName(ve.close),tooltip:g(9605,"Close Editor"),alwaysVisible:o}],trigger:async()=>{const l=this.editorGroupService.getGroup(n);return l&&(await l.closeEditor(i,{preserveFocus:!0}),!l.contains(i))?MS.REMOVE_ITEM:MS.NO_ACTION},accept:(l,d)=>this.editorGroupService.getGroup(n)?.openEditor(i,{preserveFocus:d.inBackground})}})}};k9=D([_(1,Pr),_(2,ti),_(3,fi),_(4,Di)],k9);var vR;let UVe=(vR=class extends k9{constructor(e,t,i,n){super(fSe.PREFIX,e,t,i,n)}doGetEditors(){const e=this.editorGroupService.activeGroup;return e.getEditors(tu.MOST_RECENTLY_ACTIVE).map(t=>({editor:t,groupId:e.id}))}},fSe=vR,vR.PREFIX="edt active ",vR);UVe=fSe=D([_(0,Pr),_(1,ti),_(2,fi),_(3,Di)],UVe);var bR;let VVe=(bR=class extends k9{constructor(e,t,i,n){super(pSe.PREFIX,e,t,i,n)}doGetEditors(){const e=[];for(const t of this.editorGroupService.getGroups(gu.GRID_APPEARANCE))for(const i of t.getEditors(tu.SEQUENTIAL))e.push({editor:i,groupId:t.id});return e}},pSe=bR,bR.PREFIX="edt ",bR);VVe=pSe=D([_(0,Pr),_(1,ti),_(2,fi),_(3,Di)],VVe);var wR;let zVe=(wR=class extends k9{constructor(e,t,i,n){super(mSe.PREFIX,e,t,i,n)}doGetEditors(){const e=[];for(const t of this.editorService.getEditors(tu.MOST_RECENTLY_ACTIVE))e.push(t);return e}},mSe=wR,wR.PREFIX="edt mru ",wR);zVe=mSe=D([_(0,Pr),_(1,ti),_(2,fi),_(3,Di)],zVe);var Mzt=".side-by-side-editor-container{height:100%;width:100%}";gt(Mzt,{});var GP,yR;let cp=(yR=class extends Ub{get typeId(){return GP.ID}get capabilities(){let e=this.primary.capabilities;return e&=~xi.CanSplitInGroup,this.secondary.hasCapability(xi.RequiresTrust)&&(e|=xi.RequiresTrust),this.secondary.hasCapability(xi.Singleton)&&(e|=xi.Singleton),e|=xi.MultipleEditors,e}get resource(){if(this.hasIdenticalSides)return this.primary.resource}constructor(e,t,i,n,r){super(),this.preferredName=e,this.preferredDescription=t,this.secondary=i,this.primary=n,this.editorService=r,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 Ub)return new GP(this.preferredName,this.preferredDescription,e,e,this.editorService);if(!k_(e)&&!W5(e)&&!RS(e)&&!Ab(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(ya(i.editor))return{editor:new GP(this.preferredName,this.preferredDescription,i.editor,i.editor,this.editorService),options:{...i.options,viewState:iB(this,e,this.editorService)}};if(Jv(i.editor))return{editor:{label:this.preferredName,description:this.preferredDescription,primary:i.editor,secondary:i.editor,options:{...i.options,viewState:iB(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&&!k_(t)&&!k_(i)&&!W5(t)&&!W5(i)&&!RS(t)&&!RS(i)&&!Ab(t)&&!Ab(i)){const n={label:this.preferredName,description:this.preferredDescription,primary:t,secondary:i};return typeof e?.preserveViewState=="number"&&(n.options={viewState:iB(this,e.preserveViewState,this.editorService)}),n}}matches(e){return this===e?!0:xXe(e)||k_(e)?!1:e instanceof GP?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):RS(e)?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):!1}},GP=yR,yR.ID="workbench.editorinputs.sidebysideEditorInput",yR);cp=GP=D([_(4,ti)],cp);const Yc=class Yc{constructor(e,t){this.storageService=t,this.id=Yc.COMMON_PREFIX+e}getMemento(e,t){switch(e){case Ie.WORKSPACE:{let i=Yc.workspaceMementos.get(this.id);return i||(i=new Pue(this.id,e,t,this.storageService),Yc.workspaceMementos.set(this.id,i)),i.getMemento()}case Ie.PROFILE:{let i=Yc.profileMementos.get(this.id);return i||(i=new Pue(this.id,e,t,this.storageService),Yc.profileMementos.set(this.id,i)),i.getMemento()}case Ie.APPLICATION:{let i=Yc.applicationMementos.get(this.id);return i||(i=new Pue(this.id,e,t,this.storageService),Yc.applicationMementos.set(this.id,i)),i.getMemento()}}}onDidChangeValue(e,t){return this.storageService.onDidChangeValue(e,this.id,t)}saveMemento(){Yc.workspaceMementos.get(this.id)?.save(),Yc.profileMementos.get(this.id)?.save(),Yc.applicationMementos.get(this.id)?.save()}reloadMemento(e){let t;switch(e){case Ie.APPLICATION:t=Yc.applicationMementos.get(this.id);break;case Ie.PROFILE:t=Yc.profileMementos.get(this.id);break;case Ie.WORKSPACE:t=Yc.workspaceMementos.get(this.id);break}t?.reload()}static clear(e){switch(e){case Ie.WORKSPACE:Yc.workspaceMementos.clear();break;case Ie.PROFILE:Yc.profileMementos.clear();break;case Ie.APPLICATION:Yc.applicationMementos.clear();break}}};Yc.applicationMementos=new Map,Yc.profileMementos=new Map,Yc.workspaceMementos=new Map,Yc.COMMON_PREFIX="memento/";let dI=Yc;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){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(){DA(this.mementoObj)?this.storageService.remove(this.id,this.scope):this.storageService.store(this.id,this.mementoObj,this.scope,this.target)}}class vnt extends CLe{constructor(e,t,i){super(t),this.id=e,this.memento=new dI(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 Nzt extends vnt{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(Ec(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 q_)),this.actionRunner}updateTitleArea(){this._onTitleAreaUpdate.fire()}isVisible(){return this.visible}getControl(){}}const uO=class uO extends Nzt{get minimumWidth(){return Bx.width}get maximumWidth(){return JJ.width}get minimumHeight(){return Bx.height}get maximumHeight(){return JJ.height}get input(){return this._input}get options(){return this._options}get window(){return Zj(this.group.windowId,!0).window}get scopedContextKeyService(){}constructor(e,t,i,n,r){super(e,i,n,r),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 r=`${this.getId()}${i}`;let o=uO.EDITOR_MEMENTOS.get(r);return o||(o=this._register(new _Se(this.getId(),i,this.getMemento(Ie.WORKSPACE,cn.MACHINE),n,e,t)),uO.EDITOR_MEMENTOS.set(r,o)),o}getViewState(){}saveState(){for(const[,e]of uO.EDITOR_MEMENTOS)e.id===this.getId()&&e.saveState();super.saveState()}dispose(){this._input=void 0,this._options=void 0,super.dispose()}};uO.EDITOR_MEMENTOS=new Map;let VZ=uO;const gO=class gO extends V{constructor(e,t,i,n,r,o){super(),this.id=e,this.key=t,this.memento=i,this.limit=n,this.editorGroupService=r,this.configurationService=o,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 r=this.doLoad();let o=r.get(n.toString());o||(o=Object.create(null),r.set(n.toString(),o)),o[e.id]=i,this.shareEditorState&&(o[gO.SHARED_EDITOR_STATE]=i),ya(t)&&this.clearEditorStateOnDispose(n,t)}loadEditorState(e,t){const i=this.doGetResource(t);if(!i||!e)return;const r=this.doLoad().get(i.toString());if(r){const o=r[e.id];if(o)return o;if(this.shareEditorState)return r[gO.SHARED_EDITOR_STATE]}}clearEditorState(e,t){ya(e)&&this.editorDisposables?.delete(e);const i=this.doGetResource(e);if(i){const n=this.doLoad();if(t){const r=n.get(i.toString());r&&(delete r[t.id],DA(r)&&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(),r=[...n.keys()];for(const o of r){const a=N.parse(o);if(!i.isEqualOrParent(a,e))continue;let c;if(Yi(e,a))c=t;else{const d=GKe(a.path,e.path);c=Ft(t,a.path.substr(d+e.path.length+1))}const l=n.get(o,ql.None);l&&(n.delete(o),n.set(c.toString(),l))}}doGetResource(e){return ya(e)?e.resource:e}doLoad(){if(!this.cache){this.cache=new pm(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 r of Object.keys(n)){const o=Number(r);o===gO.SHARED_EDITOR_STATE&&this.shareEditorState||this.editorGroupService.getGroup(o)||(delete n[o],DA(n)&&e.delete(i))}}};gO.SHARED_EDITOR_STATE=-1;let _Se=gO,zZ=class extends VZ{constructor(e,t,i,n,r,o,a,c,l,d){super(e,t,n,c,o),this.instantiationService=r,this.textResourceConfigurationService=a,this.editorService=l,this.editorGroupService=d,this.groupListener=this._register(new yn),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(Pa.getOriginalUri(e,{supportSideBySide:Us.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}};zZ=D([_(3,Ji),_(4,we),_(5,Gi),_(6,xc),_(7,mn),_(8,ti),_(9,Pr)],zZ);var D0;function Pzt(s){const e=s;return typeof e?.primary=="object"&&typeof e.secondary=="object"}var YS;let vSe=(YS=class extends zZ{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,r,o,a,c,l){super(D0.ID,e,D0.VIEW_STATE_PREFERENCE_KEY,t,i,r,a,n,c,l),this.configurationService=o,this.onDidCreateEditors=this._register(new I),this._onDidChangeSizeConstraints=this._register(new vfe),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(D0.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?pi.VERTICAL:pi.HORIZONTAL,this.dimension=new wn(0,0),this.lastFocusedSide=void 0,this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e.affectsConfiguration(D0.SIDE_BY_SIDE_LAYOUT_SETTING)&&(this.orientation=this.configurationService.getValue(D0.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?pi.VERTICAL:pi.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===pi.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 T3(e,{orientation:this.orientation})),this.splitviewDisposables.add(this.splitview.onDidSashReset(()=>this.splitview?.distributeViewSizes())),this.orientation===pi.HORIZONTAL?this.splitview.orthogonalEndSash=this._boundarySashes?.bottom:(this.splitview.orthogonalStartSash=this._boundarySashes?.left,this.splitview.orthogonalEndSash=this._boundarySashes?.right);let i=Xk.Distribute,n=Xk.Distribute;if(t){const a=this.splitview.orientation===pi.HORIZONTAL?this.dimension.width:this.dimension.height;i=Math.round(a*t),n=a-i,this.splitview.layout(this.orientation===pi.HORIZONTAL?this.dimension.width:this.dimension.height)}const r=Qn(this.secondaryEditorContainer);this.splitview.addView({element:r,layout:a=>this.layoutPane(this.secondaryEditorPane,a),minimumSize:this.orientation===pi.HORIZONTAL?Bx.width:Bx.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:M.None},i);const o=Qn(this.primaryEditorContainer);this.splitview.addView({element:o,layout:a=>this.layoutPane(this.primaryEditorPane,a),minimumSize:this.orientation===pi.HORIZONTAL?Bx.width:Bx.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 r=this.input;await super.setInput(e,t,i,n),(!r||!e.matches(r))&&(r&&this.disposeEditors(),this.createEditors(e));const{primary:o,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===pi.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,o,i,n)]),typeof t?.target=="number"&&(this.lastFocusedSide=t.target)}loadViewState(e,t,i){const n=Pzt(t?.viewState)?t?.viewState:this.loadEditorViewState(e,i);let r=Object.create(null),o;return t?.target===Us.SECONDARY?o={...t}:r={...t},r.viewState=n?.primary,n?.secondary&&(o?o.viewState=n?.secondary:o={viewState:n.secondary}),{primary:r,secondary:o,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(Us.PRIMARY))),this.editorDisposables.add(this.secondaryEditorPane.onDidFocus(()=>this.onDidFocusChange(Us.SECONDARY)))}doCreateEditor(e,t){const i=je.as(rC.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()),pHe(n)&&this.editorDisposables.add(n.onDidChangeSelection(r=>this._onDidChangeSelection.fire(r))),this.editorDisposables.add(n),n}onDidFocusChange(e){this.lastFocusedSide=e,this._onDidChangeControl.fire()}getSelection(){const e=this.getLastFocusedEditorPane();if(pHe(e)){const t=e.getSelection();if(t)return new XNe(t,e===this.primaryEditorPane?Us.PRIMARY:Us.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===Us.SECONDARY?this.secondaryEditorPane:this.primaryEditorPane}layout(e){this.dimension=e,Qn(this.splitview).layout(this.orientation===pi.HORIZONTAL?e.width:e.height)}setBoundarySashes(e){this._boundarySashes=e,this.splitview&&(this.splitview.orthogonalEndSash=e.bottom)}layoutPane(e,t){e?.layout(this.orientation===pi.HORIZONTAL?new wn(t,this.dimension.height):new wn(this.dimension.width,t))}getControl(){return this.getLastFocusedEditorPane()?.getControl()}getPrimaryEditorPane(){return this.primaryEditorPane}getSecondaryEditorPane(){return this.secondaryEditorPane}tracksEditorViewState(e){return e instanceof cp}computeEditorViewState(e){if(!this.input||!Yi(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 cp&&(t=e.primary.resource,i=e.secondary.resource),!(!i||!t))return N.from({scheme:"sideBySide",path:`${B8(i.toString())}${B8(t.toString())}`})}updateStyles(){super.updateStyles(),this.primaryEditorContainer&&(this.orientation===pi.HORIZONTAL?(this.primaryEditorContainer.style.borderLeftWidth="1px",this.primaryEditorContainer.style.borderLeftStyle="solid",this.primaryEditorContainer.style.borderLeftColor=this.getColor(LLt)??"",this.primaryEditorContainer.style.borderTopWidth="0"):(this.primaryEditorContainer.style.borderTopWidth="1px",this.primaryEditorContainer.style.borderTopStyle="solid",this.primaryEditorContainer.style.borderTopColor=this.getColor(TLt)??"",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&&Ns(this.secondaryEditorContainer),this.primaryEditorContainer&&Ns(this.primaryEditorContainer)}},D0=YS,YS.ID=dTt,YS.SIDE_BY_SIDE_LAYOUT_SETTING="workbench.editor.splitInGroupLayout",YS.VIEW_STATE_PREFERENCE_KEY="sideBySideEditorViewState",YS);vSe=D0=D([_(1,Ji),_(2,we),_(3,mn),_(4,Gi),_(5,Te),_(6,xc),_(7,ti),_(8,Pr)],vSe);class XNe{constructor(e,t){this.selection=e,this.side=t}compare(e){return!(e instanceof XNe)||this.side!==e.side?Ox.DIFFERENT:this.selection.compare(e.selection)}restore(e){const t={...e,target:this.side};return this.selection.restore(t)}}const Tw=class Tw{static didInstantiateEditorPane(e){return Tw.instantiatedEditorPanes.has(e)}static create(e,t,i){return new Tw(e,t,i)}constructor(e,t,i){this.ctor=e,this.typeId=t,this.name=i}instantiate(e,t){Tw._onWillInstantiateEditorPane.fire({typeId:this.typeId});const i=e.createInstance(this.ctor,t);return Tw.instantiatedEditorPanes.add(this.typeId),i}describes(e){return e.getId()===this.typeId}};Tw.instantiatedEditorPanes=new Set,Tw._onWillInstantiateEditorPane=new I,Tw.onWillInstantiateEditorPane=Tw._onWillInstantiateEditorPane.event;let $Ve=Tw;class Fzt{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 r=this.mapEditorPanesToEditors.get(n)||[];for(const o of r){const a=o.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 ui.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}}je.add(rC.EditorPane,new Fzt);function Ozt(s,e){const t=s.get(ti),i=s.get(Is),n=s.get(Pm);return new Promise(r=>{let o=[...e];const a=t.onDidCloseEditor(async c=>{if(c.context===uA.MOVE)return;let l=Pa.getOriginalUri(c.editor,{supportSideBySide:Us.PRIMARY}),d=Pa.getOriginalUri(c.editor,{supportSideBySide:Us.SECONDARY});if(c.context===uA.REPLACE){const h=Pa.getOriginalUri(t.activeEditor,{supportSideBySide:Us.PRIMARY}),u=Pa.getOriginalUri(t.activeEditor,{supportSideBySide:Us.SECONDARY});i.extUri.isEqual(l,h)&&(l=void 0),i.extUri.isEqual(d,u)&&(d=void 0)}if(o=o.filter(h=>!(i.extUri.isEqual(h,l)||i.extUri.isEqual(h,d)||c.context!==uA.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}))))),o.length===0){const h=e.filter(u=>n.isDirty(u));return h.length>0&&await er.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(),r()}})})}function Bzt(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 bSe,CR;let wSe=(CR=class extends zZ{constructor(e,t,i,n,r,o,a,c,l,d){super(e,t,bSe.VIEW_STATE_PREFERENCE_KEY,i,n,r,o,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 yn),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=In(e.editor)?Ds(e.editor):Object.create(null);return Object.assign(t,this.getConfigurationOverrides(e)),t.ariaLabel=this.computeAriaLabel(),t}computeAriaLabel(){return this.input?Bzt(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:i1.EDIT}))),this._register(e.onDidScrollChange(()=>this._onDidChangeScroll.fire())))}toEditorPaneSelectionChangeReason(e){switch(e.source){case Lb.PROGRAMMATIC:return i1.PROGRAMMATIC;case Lb.NAVIGATION:return i1.NAVIGATION;case Lb.JUMP:return i1.JUMP;default:return i1.USER}}getSelection(){const e=this.getMainControl();if(e){const t=e.getSelection();if(t)return new ySe(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=g8(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()}},bSe=CR,CR.VIEW_STATE_PREFERENCE_KEY="textEditorViewState",CR);wSe=bSe=D([_(2,Ji),_(3,we),_(4,Gi),_(5,xc),_(6,mn),_(7,ti),_(8,Pr),_(9,Xt)],wSe);const s8=class s8{constructor(e){this.textSelection=e}compare(e){if(!(e instanceof s8))return Ox.DIFFERENT;const t=Math.min(this.textSelection.selectionStartLineNumber,this.textSelection.positionLineNumber),i=Math.min(e.textSelection.selectionStartLineNumber,e.textSelection.positionLineNumber);return t===i?Ox.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!==GVe&&(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()??Sa))return;const e=await this.languageDetectionService.detectLanguage(this.textEditorModelHandle),t=this.getLanguageId();if(e&&e!==t&&!this.isDisposed()){this.setLanguageIdInternal(e,GVe);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),r=this.getOrCreateLanguage(t,this.languageService,i,n);return this.doCreateTextEditorModel(e,r,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(lY.FIRST_LINE_DETECTION_LENGTH_LIMIT):e.getLineContent(1).substr(0,lY.FIRST_LINE_DETECTION_LENGTH_LIMIT)}getOrCreateLanguage(e,t,i,n){return!i||i===Sa?t.createByFilepathOrFirstLine(e??null,n):t.createById(i)}updateTextEditorModel(e,t){this.isResolved()&&(e&&this.modelService.updateModel(this.textEditorModel,e),t&&t!==Sa&&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()}},CSe=SR,SR.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY=600,SR);hI=CSe=D([_(0,fi),_(1,Di),_(2,j6),_(3,_o)],hI);class bnt extends BI{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 wnt extends bnt{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 qQ,AR;let Yg=(AR=class extends cp{get typeId(){return qQ.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|=xi.ForceDescription),e}constructor(e,t,i,n,r,o){super(e,t,i,n,o),this.original=i,this.modified=n,this.forceOpenAsBinary=r,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,r;if(this.preferredDescription)i=this.preferredDescription,n=this.preferredDescription,r=this.preferredDescription;else{i=this.computeLabel(this.original.getDescription(Rs.SHORT),this.modified.getDescription(Rs.SHORT)),r=this.computeLabel(this.original.getDescription(Rs.LONG),this.modified.getDescription(Rs.LONG));const d=this.original.getDescription(Rs.MEDIUM),h=this.modified.getDescription(Rs.MEDIUM);if(typeof d=="string"&&typeof h=="string"&&(d||h)){const[u,f]=iPt([d,h]);n=this.computeLabel(u,f)}}let o=this.computeLabel(this.original.getTitle(Rs.SHORT)??this.original.getName(),this.modified.getTitle(Rs.SHORT)??this.modified.getName()," ↔ "),a=this.computeLabel(this.original.getTitle(Rs.MEDIUM)??this.original.getName(),this.modified.getTitle(Rs.MEDIUM)??this.modified.getName()," ↔ "),c=this.computeLabel(this.original.getTitle(Rs.LONG)??this.original.getName(),this.modified.getTitle(Rs.LONG)??this.modified.getName()," ↔ ");const l=this.getPreferredTitle();return l&&(o=`${l} (${o})`,a=`${l} (${a})`,c=`${l} (${c})`),{name:e,shortDescription:i,mediumDescription:n,longDescription:r,forceDescription:t,shortTitle:o,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=Rs.MEDIUM){switch(e){case Rs.SHORT:return this.labels.shortDescription;case Rs.LONG:return this.labels.longDescription;case Rs.MEDIUM:default:return this.labels.mediumDescription}}getTitle(e){switch(e){case Rs.SHORT:return this.labels.shortTitle;case Rs.LONG:return this.labels.longTitle;default:case Rs.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===hTt):e.find(t=>t.typeId===AXe)}async createModel(){const[e,t]=await Promise.all([this.original.resolve(),this.modified.resolve()]);return t instanceof hI&&e instanceof hI?new wnt(e,t):new bnt(yWe(e)?e:void 0,yWe(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 qQ?this.modified.matches(e.modified)&&this.original.matches(e.original)&&e.forceOpenAsBinary===this.forceOpenAsBinary:k_(e)?this.modified.matches(e.modified)&&this.original.matches(e.original):!1}dispose(){this.cachedModel&&(this.cachedModel.dispose(),this.cachedModel=void 0),super.dispose()}},qQ=AR,AR.ID="workbench.editors.diffEditorInput",AR);Yg=qQ=D([_(5,ti)],Yg);var SSe,ER;let KVe=(ER=class extends wSe{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,r,o,a,c,l,d){super(SSe.ID,e,t,i,n,r,a,o,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(yp,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 r=await e.resolve();if(n.isCancellationRequested)return;if(!(r instanceof wnt)){this.openAsBinary(e,t);return}const o=Qn(this.diffEditorControl),a=r,c=a.textDiffEditorModel?o.createViewModel(a.textDiffEditorModel):null;this._previousViewModel=c,await c?.waitForDiff(),o.setModel(c);let l=!1;dMe(t?.viewState)||(l=this.restoreTextDiffEditorViewState(e,t,i,o));let d=!1;t&&(d=$Z(t,o,_t.Immediate)),!d&&!l&&o.revealFirstDiff(),o.updateOptions({...this.getReadonlyConfiguration(a.modifiedModel?.isReadonly()),originalEditable:!a.originalModel?.isReadonly()}),o.handleInitialized(),this.inputLifecycleStopWatch=new Ys(!1)}catch(r){await this.handleSetInputError(r,e,t)}}async handleSetInputError(e,t,i){if(this.isFileBinaryError(e))return this.openAsBinary(t,i);if(e.fileOperationResult===ji.FILE_TOO_LARGE){let n;throw e instanceof Qq?n=g(9538,"At least one file is not displayed in the text compare editor because it is very large ({0}).",Pc.formatSize(e.size)):n=g(9539,"At least one file is not displayed in the text compare editor because it is very large."),mTt(this.group,t,i,n,this.preferencesService)}throw e}restoreTextDiffEditorViewState(e,t,i,n){const r=this.loadEditorViewState(e,i);return r?(t?.selection&&r.modified&&(r.modified.cursorState=[]),n.restoreViewState(r),t?.revealIfVisible&&n.revealFirstDiff(),!0):!1}openAsBinary(e,t){const i=e.original,n=e.modified,r=this.instantiationService.createInstance(Yg,e.getName(),e.getDescription(),i,n,!0),o=je.as(rC.EditorFactory).getFileEditorFactory();o.isFileEditor(i)&&i.setForceOpenAsBinary(),o.isFileEditor(n)&&n.setForceOpenAsBinary(),this.group.replaceEditors([{editor:e,replacement:r,options:{...t,activation:Jk.PRESERVE,pinned:this.group.isPinned(e),sticky:this.group.isSticky(e)}}])}setOptions(e){super.setOptions(e),e&&$Z(e,Qn(this.diffEditorControl),_t.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(In(e.diffEditor)){const n=Ds(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 Yg&&!this.input.original.isReadonly(),lineDecorationsWidth:"2ch"}}updateReadonly(e){e instanceof Yg?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===RW.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 yp&&(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 Yg}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&&Yi(i,e))return this.diffEditorControl.saveViewState()??void 0}toEditorViewStateResource(e){let t,i;if(e instanceof Yg?(t=e.original.resource,i=e.modified.resource):ya(e)||(t=e.original.uri,i=e.modified.uri),!(!t||!i))return N.from({scheme:"diff",path:`${B8(t.toString())}${B8(i.toString())}`})}},SSe=ER,ER.ID=AXe,ER);KVe=SSe=D([_(1,Ji),_(2,we),_(3,Gi),_(4,xc),_(5,ti),_(6,mn),_(7,Pr),_(8,Xt),_(9,Y6)],KVe);function GZ(s,e,t=pA){if(t===pA||t===nv)return t;let i=s.getGroups(gu.GRID_APPEARANCE)[t];if(!i&&t<9){for(let n=0;n<=t;n++){const r=s.getGroups(gu.GRID_APPEARANCE);r[n]||s.addGroup(r[n-1],QW(e))}i=s.getGroups(gu.GRID_APPEARANCE)[t]}return i?.id??nv}function uI(s,e){const t=typeof e=="number"?s.getGroup(e):e;return s.getGroups(gu.GRID_APPEARANCE).indexOf(t??s.activeGroup)}function Hzt(s,e,t,i){const n=Uzt(s,e,t,i),r=n.length&&n[0].preserveFocus||!1,o={groupedEditors:[],preserveFocus:r};for(const a of n){const c=$zt(a,t);if(!c)continue;const{group:l,editor:d}=c;let h;for(const u of o.groupedEditors)if(u.group.id===l.id){h=u;break}h||(h={group:l,editors:[]},o.groupedEditors.push(h)),d&&h.editors.push(d)}return o}function Uzt(s,e,t,i){const n=i.lastFocusedList;let r=n instanceof Za&&n.getHTMLElement()===Wc(),o=zzt(s,r,e,t,i);if(!o){const c=t.activeGroup,l=c.activeEditor;o={groupId:c.id,editorIndex:l?c.getIndexOfEditor(l):void 0},r=!1}const a=ynt(o,r,e,t,i);return Vzt(o,a)}function Vzt(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 zzt(s,e,t,i,n){const r=s.filter(o=>mHe(o)||N.isUri(o));for(const o of r)if(mHe(o))return o;for(const o of r){const a=t.findEditors(o);if(a.length){const c=a[0],l=i.getGroup(c.groupId);return{groupId:c.groupId,editorIndex:l?.getIndexOfEditor(c.editor)}}}if(e){const o=n.lastFocusedList;for(const a of o.getFocusedElements())if(Cnt(a))return ASe(a,void 0,i)}}function ynt(s,e,t,i,n){if(e){const o=n.lastFocusedList.getSelectedElements().filter(Cnt);if(o.length>1)return o.map(a=>ASe(a,s.preserveFocus,i));if(o.length===0)return ynt(s,!1,t,i,n)}else{const r=i.getGroup(s.groupId),o=s.editorIndex!==void 0?r?.getEditorByIndex(s.editorIndex):r?.activeEditor;if(r&&o&&r.isSelected(o))return r.selectedEditors.map(a=>ASe({editor:a,groupId:r.id},s.preserveFocus,i))}return[s]}function ASe(s,e,t){if(KNe(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 Cnt(s){return KNe(s)||Kve(s)}function $zt(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 Gzt="workbench.action.closeEditorsAndGroup";class Kzt{constructor(e){this.root=new KZ;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 KZ;for(const o of e){const a=this.getAttributes(o,t),c=this.root.get(o,a);for(const l of c)i.add(l,o)}const n=(o,a=new Set)=>{if(a.has(o))return[];a.add(o);const c=this.getAttributes(o,t),l=i.get(o,c);return l.length===0?[o]:l.length===1&&l[0]===o?[o]:l.flatMap(d=>n(d,a))},r=new Map;for(const o of e){let a=n(o);a.length===0&&(a=[o]);for(const c of a){let l=r.get(c);l||r.set(c,l=new Set),o!==c&&l.add(o)}}return r}}class KZ{constructor(){this.value=new ZNe,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 r=this.map.get(i);r||this.map.set(i,r=new KZ),r.add(n,t)}}get(e,t){const i=[];i.push(...this.value.get(e,t));const n=e[0],r=e.slice(1),o=this.map.get(n);return o&&i.push(...o.get(r,t)),i}toString(e=""){const t=[];return this.value.hasItems&&t.push(`* => +`);this.editorService.openEditor({resource:void 0,contents:c,languageId:"markdown"}),this.telemetryService.publicLog2("openedChatCodeCitations")})),this.domNode=o.root}hasSameContent(e,t,i){return e.kind==="codeCitations"}};nSe=D([_(2,ti),_(3,Ji)],nSe);const szt=fe;let sSe=class extends V{constructor(e,t,i){super(),this.commandService=i,this.domNode=szt(".chat-command-button");const n=!bs(t.element)||!t.element.isStale,r=n?e.command.tooltip:g(10565,"Button not available in restored chat"),o=this._register(new Zd(this.domNode,{...M6,supportIcons:!0,title:r}));o.label=e.command.title,o.enabled=n,this._register(o.onDidClick(()=>this.commandService.executeCommand(e.command.id,...e.command.arguments??[])))}hasSameContent(e){return e.kind==="command"}};sSe=D([_(2,bi)],sSe);var rzt=".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}";gt(rzt,{});let rSe=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 r=Wt(".chat-confirmation-widget@root",[Wt(".chat-confirmation-widget-title@title"),Wt(".chat-confirmation-widget-message@message"),Wt(".chat-confirmation-buttons-container@buttonsContainer")]);this._domNode=r.root;const o=this._register(this.instantiationService.createInstance(Z_,{})),a=this._register(o.render(new Nt(e)));r.title.appendChild(a.element);const c=this._register(o.render(new Nt(t)));r.message.appendChild(c.element),i.forEach(l=>{const d=new Zd(r.buttonsContainer,{...M6,secondary:l.isSecondary});d.label=l.label,this._register(d.onDidClick(()=>this._onDidClick.fire(l)))})}};rSe=D([_(3,we)],rSe);let oSe=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 r=t.element,o=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(rSe,e.title,e.message,o));a.setShowButtons(!e.isUsed),this._register(a.onDidClick(async c=>{if(bs(r)){const l=`${c.label}: "${e.title}"`,d=c.isSecondary?{rejectedConfirmationData:[c.data]}:{acceptedConfirmationData:[c.data]};d.agentId=r.agent?.id,d.slashCommand=r.slashCommand?.name,await this.chatService.sendRequest(r.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)}};oSe=D([_(2,we),_(3,Lm)],oSe);class Kce 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 hn(255,255,255,.1)),light:new me(new hn(0,0,0,.1)),hcDark:yt,hcLight:yt},g(7156,"The border color of a chat request."));const ozt=W("chat.requestBackground",{dark:rt(Uc,.62),light:rt(Uc,.62),hcDark:kh,hcLight:null},g(7157,"The background color of a chat request.")),DVe=W("chat.slashCommandBackground",{dark:"#34414b8f",light:"#d2ecff99",hcDark:me.white,hcLight:DT},g(7158,"The background color of a chat slash command.")),kVe=W("chat.slashCommandForeground",{dark:"#40A6FF",light:"#306CA2",hcDark:me.black,hcLight:dae},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",$i,g(7161,"The foreground color of a chat avatar."));const Mue="http://_vscodedecoration_",GQ="http://_chatagent_",azt="http://_chatslash_";function czt(s,e,t){const i=t.get(lce),n=t.get(wf),r=i.getAgentNameRestriction(s);let o=`${r?s.name:$ce(s)}`;r&&n.agentHasDupeName(s.id)&&(o+=` (${s.publisherDisplayName})`);const c={agentId:s.id,name:o,isClickable:e};return`[${s.name}](${GQ}?${encodeURIComponent(JSON.stringify(c))})`}let OZ=class{constructor(e,t,i,n,r,o,a,c,l){this.keybindingService=e,this.labelService=t,this.logService=i,this.chatAgentService=n,this.instantiationService=r,this.hoverService=o,this.chatService=a,this.chatWidgetService=c,this.commandService=l}convertParsedRequestToMarkdown(e){let t="";for(const i of e.parts)if(i instanceof ub)t+=i.text;else if(i instanceof qg)t+=this.instantiationService.invokeFunction(n=>czt(i.agent,!1,n));else{const n=i instanceof $W&&i.data instanceof N?i.data:void 0,r=n?encodeURIComponent(this.labelService.getUriLabel(n,{relative:!0})):i instanceof qg?i.agent.id:"",o=i.text;t+=`[${o}](${Mue}?${r})`}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(GQ)){let r;try{r=JSON.parse(decodeURIComponent(n.slice(GQ.length+1)))}catch(o){this.logService.error("Invalid chat widget render data JSON",Po(o))}r&&i.parentElement.replaceChild(this.renderAgentWidget(r,t),i)}else if(n.startsWith(azt)){let r;try{r=JSON.parse(decodeURIComponent(n.slice(GQ.length+1)))}catch(o){this.logService.error("Invalid chat slash command render data JSON",Po(o))}r&&i.parentElement.replaceChild(this.renderSlashCommandWidget(i.textContent,r,t),i)}else if(n.startsWith(Mue)){const r=decodeURIComponent(n.slice(Mue.length+1));i.parentElement.replaceChild(this.renderResourceWidget(i.textContent,r),i)}else n.startsWith(jit)?this.renderFileWidget(n,i):n.startsWith("command:")&&this.injectKeybindingHint(i,n,this.keybindingService)}),t}renderAgentWidget(e,t){const i=`${i4}${e.name}`;let n;if(e.isClickable){n=fe("span.chat-agent-widget");const a=t.add(new Zd(n,{buttonBackground:$e(DVe),buttonForeground:$e(kVe),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 r=this.chatAgentService.getAgent(e.agentId),o=new Ca(()=>t.add(this.instantiationService.createInstance(FZ)));return t.add(this.hoverService.setupManagedHover(Fo("element"),n,()=>(o.value.setAgent(e.agentId),o.value.domNode),r&&rnt(()=>r,this.commandService))),n}renderSlashCommandWidget(e,t,i){const n=fe("span.chat-agent-widget.chat-command-widget"),r=this.chatAgentService.getAgent(t.agentId),o=i.add(new Zd(n,{buttonBackground:$e(DVe),buttonForeground:$e(kVe),buttonHoverBackground:void 0}));return o.label=e,i.add(o.onDidClick(()=>{const a=this.chatWidgetService.lastFocusedWidget;if(!a||!r)return;const c=r.slashCommands.find(l=>l.name===t.command);this.chatService.sendRequest(a.viewModel.sessionId,c?.sampleRequest??"",{location:a.location,agentId:r.id,slashCommand:t.command})})),n}renderFileWidget(e,t){const i=N.parse(e);let n;try{n=Mr(JSON.parse(i.fragment))}catch(a){this.logService.error("Invalid chat widget render data JSON",Po(a));return}if(!n.uri||!N.isUri(n.uri)){this.logService.error(`Invalid chat widget render data: ${i.fragment}`);return}const r=n.range?`${n.range.startLineNumber}-${n.range.endLineNumber}`:"";t.setAttribute("data-href",n.uri.with({fragment:r}).toString());const o=this.labelService.getUriLabel(n.uri,{relative:!0});t.title=n.range?`${o}#${n.range.startLineNumber}-${n.range.endLineNumber}`:o}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 r=i.lookupKeybinding(n);if(r){const o=r.getLabel();o&&(e.textContent=`${e.textContent} (${o})`)}}}};OZ=D([_(0,Vt),_(1,Os),_(2,Ke),_(3,wf),_(4,we),_(5,tc),_(6,Lm),_(7,qN),_(8,bi)],OZ);const IVe=fe;let BZ=class extends V{constructor(e,t,i,n=!1,r=0,o,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(OZ),m=[];let v=r;const b=this._register(o.render(e,{fillInIncompleteTokens:n,codeBlockRendererSync:(w,y)=>{const C=v++;let A,L,k;if(ga(w,z5t))try{const G=$5t(y);L=G.range&&F.lift(G.range),A=this.textModelService.createModelReference(G.uri).then(Y=>Y.object)}catch{return IVe("div")}else{if(!zu(f)&&!bs(f))return console.error("Trying to render code block in welcome",f.id,C),IVe("div");const G=bs(f)||zu(f)?f.sessionId:"",Y=this.codeBlockModelCollection.getOrCreate(G,f,C);k=Y.vulns,A=Y.model}const P=bs(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 r=this.editorPool.get(),o=r.object;return bs(e.element)&&this.codeBlockModelCollection.update(e.element.sessionId,e.element,e.codeBlockIndex,{text:t,languageId:e.languageId}),o.render(e,i,n),r}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)}};BZ=D([_(9,Le),_(10,pn),_(11,we)],BZ);let aSe=class extends V{inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._pool=this._register(new Kce(()=>n.createInstance(ICe,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)}}}};aSe=D([_(3,we)],aSe);class ont extends V{constructor(e,t,i,n,r){super();const o=i.content.slice(i.index+1);if(this.showSpinner=n??TVe(o,i.element),r!==!0&&o.some(h=>h.kind!=="progressMessage")){this.domNode=fe("");return}this.showSpinner&&No(e.content.value);const c=this.showSpinner?He.modify(ve.loading,"spin").id:ve.check.id,l=new Nt(`$(${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=TVe(t,i);return e.kind==="progressMessage"&&this.showSpinner===n}}function TVe(s,e){return bs(e)&&!e.isComplete&&s.length===0}var cSe;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_LIGHT="hcLight",s.HIGH_CONTRAST_DARK="hcDark"})(cSe||(cSe={}));var NV;const lzt="workbench.view.explorer",Vb="workbench.explorer.fileView";new Q("explorerViewletVisible",!0,{type:"boolean",description:g(5364,"True when the EXPLORER viewlet is visible.")});const JNe=new Q("foldersViewVisible",!0,{type:"boolean",description:g(5365,"True when the FOLDERS view (the file tree within the explorer view container) is visible.")}),dzt=new Q("explorerResourceIsFolder",!1,{type:"boolean",description:g(5366,"True when the focused item in the EXPLORER is a folder.")}),ant=new Q("explorerResourceReadonly",!1,{type:"boolean",description:g(5367,"True when the focused item in the EXPLORER is read-only.")}),cnt=ant.toNegated(),hzt=new Q("explorerResourceAvailableEditorIds",""),uzt=new Q("explorerResourceIsRoot",!1,{type:"boolean",description:g(5368,"True when the focused item in the EXPLORER is a root folder.")}),gzt=new Q("explorerResourceCut",!1,{type:"boolean",description:g(5369,"True when an item in the EXPLORER has been cut for cut and paste.")}),fzt=new Q("explorerResourceMoveableToTrash",!1,{type:"boolean",description:g(5370,"True when the focused item in the EXPLORER can be moved to trash.")}),lnt=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 dnt=new Q("explorerViewletFocus",!0,{type:"boolean",description:g(5373,"True when the focus is inside the EXPLORER viewlet.")}),pzt=new Q("explorerViewletCompressedFocus",!0,{type:"boolean",description:g(5374,"True when the focused item in the EXPLORER view is a compact item.")}),mzt=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.")}),_zt=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.")}),vzt=new Q("viewHasSomeCollapsibleItem",!1,{type:"boolean",description:g(5377,"True when a workspace in the EXPLORER view has some collapsible root child.")});he.and(JNe,lnt,he.not(Uae));he.and(JNe,dnt,he.not(Uae));const hnt="workbench.editors.files.textFileEditor",unt="workbench.editors.files.fileEditorInput",bzt="workbench.editors.files.binaryFileEditor";var lSe;(function(s){s.Default="default",s.Mixed="mixed",s.FilesFirst="filesFirst",s.Type="type",s.Modified="modified",s.FoldersNestsFiles="foldersNestsFiles"})(lSe||(lSe={}));var BT;(function(s){s.Verbose="verbose",s.Default="default",s.Light="light"})(BT||(BT={}));var LVe;(function(s){s.Default="default",s.Upper="upper",s.Lower="lower",s.Unicode="unicode"})(LVe||(LVe={}));let RVe=NV=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 yn)}static async open(e,t,i,n,r){await n.openEditor({original:{resource:NV.resourceToTextFile(t,e)},modified:{resource:e},label:i,options:r})}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=NV.textFileToResource(e),i=await this.resolveEditorModel(e);if(!this.fileWatcherDisposable.value){const n=new Z;this.fileWatcherDisposable.value=n,n.add(this.fileService.onDidFilesChange(r=>{r.contains(t,Tr.UPDATED)&&this.resolveEditorModel(e,!1)})),i&&n.add(M.once(i.onWillDispose)(()=>this.fileWatcherDisposable.clear()))}return i}async resolveEditorModel(e,t=!0){const i=NV.textFileToResource(e),n=await this.textFileService.readStream(i);let r=this.modelService.getModel(e);if(r)this.modelService.updateModel(r,n.value);else if(t){const o=this.modelService.getModel(i);let a;o?a=this.languageService.createById(o.getLanguageId()):a=this.languageService.createByFilepathOrFirstLine(i),r=this.modelService.createModel(n.value,a,e)}return r}};RVe=NV=D([_(0,Fr),_(1,Xt),_(2,Di),_(3,fi)],RVe);const Qre=class Qre{constructor(e,t){this._editor=e,this._group=t,this.id=Qre.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 Fa.getOriginalUri(this.editor,{supportSideBySide:Us.PRIMARY})}};Qre.COUNTER=0;let WZ=Qre;var MVe;(function(s){s[s.Confirmation=1]="Confirmation",s[s.Prompt=2]="Prompt",s[s.Input=3]="Input"})(MVe||(MVe={}));var qh;(function(s){s[s.SAVE=0]="SAVE",s[s.DONT_SAVE=1]="DONT_SAVE",s[s.CANCEL=2]="CANCEL"})(qh||(qh={}));const zK=10;function gnt(s){const e=[];return e.push(...s.slice(0,zK).map(t=>typeof t=="string"?t:vi(t))),s.length>zK&&(s.length-zK===1?e.push(g(5690,"...1 additional file not shown")):e.push(g(5691,"...{0} additional files not shown",s.length-zK))),e.push(""),e.join(` +`)}var wzt=".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)}";gt(wzt,{});const HZ=0,NVe=[HZ,[]];function PVe(s,e,t,i){if(!s||!e)return NVe;const n=s.length,r=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=Czt(v,b,i,n,w,R),z&&P+z>=k&&(o||m||n.startsWith(e,w))?(c[C]=R+1,a[C]=P+z):(c[C]=HZ,a[C]=k)}}const l=[];let d=t-1,h=r-1;for(;d>=0&&h>=0;){const u=d*r+h;c[u]===HZ||(l.push(h),d--),h--}return[a[t*r-1],l.reverse()]}function Czt(s,e,t,i,n,r){let o=0;if(!Szt(e,i[n]))return o;if(o+=1,r>0&&(o+=r*5),s===t[n]&&(o+=1),n===0)o+=8;else{const a=Azt(t.charCodeAt(n-1));a?o+=a:E6(t.charCodeAt(n))&&r===0&&(o+=2)}return o}function Szt(s,e){return s===e?!0:s==="/"||s==="\\"?e==="/"||e==="\\":!1}function Azt(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 fnt=[void 0,[]];function Nue(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?Ezt(s,n.values,t,i):pnt(s,e,t,i)}function Ezt(s,e,t,i){let n=0;const r=[];for(const o of e){const[a,c]=pnt(s,o,t,i);if(typeof a!="number")return fnt;n+=a,r.push(...c)}return[n,gSe(r)]}function pnt(s,e,t,i){const n=qk(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],NU(n)]:fnt}const UZ=Object.freeze({score:0}),KQ=1<<18,dSe=1<<17,hSe=65536;function xzt(s,e,t,i){const n=i.values?i.values:[i];return Hc({[i.normalized]:{values:n.map(o=>({value:o.normalized,expectContiguousMatch:o.expectContiguousMatch})),label:s,description:e,allowNonContiguousMatches:t}})}function uSe(s,e,t,i,n){if(!s||!e.normalized)return UZ;const r=i.getItemLabel(s);if(!r)return UZ;const o=i.getItemDescription(s),a=xzt(r,o,t,e),c=n[a];if(c)return c;const l=Dzt(r,o,i.getItemPath(s),e);return n[a]=l,l}function Dzt(s,e,t,i,n){const r=!t||!i.containsPathSeparator;return t&&(mo?i.pathNormalized===t:ga(i.pathNormalized,t))?{score:KQ,labelMatch:[{start:0,end:s.length}],descriptionMatch:e?[{start:0,end:e.length}]:void 0}:i.values&&i.values.length>1?kzt(s,e,t,i.values,r):mnt(s,e,t,i,r)}function kzt(s,e,t,i,n,r){let o=0;const a=[],c=[];for(const l of i){const{score:d,labelMatch:h,descriptionMatch:u}=mnt(s,e,t,l,n);if(d===HZ)return UZ;o+=d,h&&a.push(...h),u&&c.push(...u)}return{score:o,labelMatch:gSe(a),descriptionMatch:gSe(c)}}function mnt(s,e,t,i,n,r){if(n||!e){const[o,a]=PVe(s,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(o){const c=kM(i.normalized,s);let l;if(c){l=dSe;const d=Math.round(i.normalized.length/s.length*100);l+=d}else l=hSe;return{score:l+o,labelMatch:c||FVe(a)}}}if(e){let o=e;t&&(o=`${e}${au}`);const a=o.length,c=`${o}${s}`,[l,d]=PVe(c,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(l){const h=FVe(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 UZ}function FVe(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 gSe(s){const e=s.sort((n,r)=>n.start-r.start),t=[];let i;for(const n of e)!i||!Izt(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 Izt(s,e){return!(s.endhSe||l>hSe){if(c!==l)return c>l?-1:1;if(cl?-1:1;const d=Array.isArray(o.labelMatch)&&o.labelMatch.length>0,h=Array.isArray(a.labelMatch)&&a.labelMatch.length>0;if(d&&!h)return-1;if(h&&!d)return 1;const u=OVe(s,o,n),f=OVe(e,a,n);return u&&f&&u!==f?f>u?-1:1:Rzt(s,e,t,n)}function OVe(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 r=t.getItemDescription(s);r&&(n+=r.length)}}else e.descriptionMatch&&e.descriptionMatch.length&&(n=e.descriptionMatch[e.descriptionMatch.length-1].end);return n-i}function Lzt(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,r=e[0].start,a=e[e.length-1].end-r;return n===a?0:a=0,o=BVe(s);let a;const c=s.split(_nt);if(c.length>1)for(const l of c){const d=BVe(l),{pathNormalized:h,normalized:u,normalizedLowercase:f}=WVe(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:r,expectContiguousMatch:o}}function WVe(s){let e;jn?e=s.replace(/\//g,au):e=s.replace(/\\/g,au);const t=Rct(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function HVe(s){return Array.isArray(s)?D9(s.map(e=>e.original).join(_nt)):D9(s.original)}var fSe,pSe,mSe;let k9=class extends zNe{constructor(e,t,i,n,r){super(e,{canAcceptInBackground:!0,noResultsPick:{label:g(9601,"No matching editors"),groupId:-1}}),this.editorGroupService=t,this.editorService=i,this.modelService=n,this.languageService=r,this.pickState=new class{constructor(){this.scorerCache=Object.create(null),this.isQuickNavigating=void 0}reset(o){o||(this.scorerCache=Object.create(null)),this.isQuickNavigating=o}}}provide(e,t){return this.pickState.reset(!!e.quickNavigate),super.provide(e,t)}_getPicks(e){const t=D9(e),i=this.doGetEditorPickItems().filter(r=>{if(!t.normalized)return!0;const o=uSe(r,t,!0,CWe,this.pickState.scorerCache);return o.score?(r.highlights={label:o.labelMatch,description:o.descriptionMatch},!0):!1});if(t.normalized){const r=this.editorGroupService.getGroups(gu.GRID_APPEARANCE).map(o=>o.id);i.sort((o,a)=>o.groupId!==a.groupId?r.indexOf(o.groupId)-r.indexOf(a.groupId):Tzt(o,a,t,!0,CWe,this.pickState.scorerCache))}const n=[];if(this.editorGroupService.count>1){let r;for(const o of i){if(typeof r!="number"||r!==o.groupId){const a=this.editorGroupService.getGroup(o.groupId);a&&n.push({type:"separator",label:a.label}),r=o.groupId}n.push(o)}}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 r=Fa.getOriginalUri(i,{supportSideBySide:Us.PRIMARY}),o=i.isDirty()&&!i.isSaving(),a=i.getDescription(),c=a?`${i.getName()} ${a}`:i.getName();return{groupId:n,resource:r,label:i.getName(),ariaLabel:t.size>1?o?g(9602,"{0}, unsaved changes, {1}",c,t.get(n)):g(9603,"{0}, {1}",c,t.get(n)):o?g(9604,"{0}, unsaved changes",c):c,description:a,iconClasses:Wx(this.modelService,this.languageService,r,void 0,i.getIcon()).concat(i.getLabelExtraClasses()),italic:!this.editorGroupService.getGroup(n)?.isPinned(i),buttons:[{iconClass:o?"dirty-editor "+He.asClassName(ve.closeDirty):He.asClassName(ve.close),tooltip:g(9605,"Close Editor"),alwaysVisible:o}],trigger:async()=>{const l=this.editorGroupService.getGroup(n);return l&&(await l.closeEditor(i,{preserveFocus:!0}),!l.contains(i))?MS.REMOVE_ITEM:MS.NO_ACTION},accept:(l,d)=>this.editorGroupService.getGroup(n)?.openEditor(i,{preserveFocus:d.inBackground})}})}};k9=D([_(1,Pr),_(2,ti),_(3,fi),_(4,Di)],k9);var vR;let UVe=(vR=class extends k9{constructor(e,t,i,n){super(fSe.PREFIX,e,t,i,n)}doGetEditors(){const e=this.editorGroupService.activeGroup;return e.getEditors(tu.MOST_RECENTLY_ACTIVE).map(t=>({editor:t,groupId:e.id}))}},fSe=vR,vR.PREFIX="edt active ",vR);UVe=fSe=D([_(0,Pr),_(1,ti),_(2,fi),_(3,Di)],UVe);var bR;let VVe=(bR=class extends k9{constructor(e,t,i,n){super(pSe.PREFIX,e,t,i,n)}doGetEditors(){const e=[];for(const t of this.editorGroupService.getGroups(gu.GRID_APPEARANCE))for(const i of t.getEditors(tu.SEQUENTIAL))e.push({editor:i,groupId:t.id});return e}},pSe=bR,bR.PREFIX="edt ",bR);VVe=pSe=D([_(0,Pr),_(1,ti),_(2,fi),_(3,Di)],VVe);var wR;let zVe=(wR=class extends k9{constructor(e,t,i,n){super(mSe.PREFIX,e,t,i,n)}doGetEditors(){const e=[];for(const t of this.editorService.getEditors(tu.MOST_RECENTLY_ACTIVE))e.push(t);return e}},mSe=wR,wR.PREFIX="edt mru ",wR);zVe=mSe=D([_(0,Pr),_(1,ti),_(2,fi),_(3,Di)],zVe);var Mzt=".side-by-side-editor-container{height:100%;width:100%}";gt(Mzt,{});var GP,yR;let cp=(yR=class extends Ub{get typeId(){return GP.ID}get capabilities(){let e=this.primary.capabilities;return e&=~xi.CanSplitInGroup,this.secondary.hasCapability(xi.RequiresTrust)&&(e|=xi.RequiresTrust),this.secondary.hasCapability(xi.Singleton)&&(e|=xi.Singleton),e|=xi.MultipleEditors,e}get resource(){if(this.hasIdenticalSides)return this.primary.resource}constructor(e,t,i,n,r){super(),this.preferredName=e,this.preferredDescription=t,this.secondary=i,this.primary=n,this.editorService=r,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 Ub)return new GP(this.preferredName,this.preferredDescription,e,e,this.editorService);if(!k_(e)&&!W5(e)&&!RS(e)&&!Ab(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(ya(i.editor))return{editor:new GP(this.preferredName,this.preferredDescription,i.editor,i.editor,this.editorService),options:{...i.options,viewState:iB(this,e,this.editorService)}};if(Jv(i.editor))return{editor:{label:this.preferredName,description:this.preferredDescription,primary:i.editor,secondary:i.editor,options:{...i.options,viewState:iB(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&&!k_(t)&&!k_(i)&&!W5(t)&&!W5(i)&&!RS(t)&&!RS(i)&&!Ab(t)&&!Ab(i)){const n={label:this.preferredName,description:this.preferredDescription,primary:t,secondary:i};return typeof e?.preserveViewState=="number"&&(n.options={viewState:iB(this,e.preserveViewState,this.editorService)}),n}}matches(e){return this===e?!0:xXe(e)||k_(e)?!1:e instanceof GP?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):RS(e)?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):!1}},GP=yR,yR.ID="workbench.editorinputs.sidebysideEditorInput",yR);cp=GP=D([_(4,ti)],cp);const Yc=class Yc{constructor(e,t){this.storageService=t,this.id=Yc.COMMON_PREFIX+e}getMemento(e,t){switch(e){case Ie.WORKSPACE:{let i=Yc.workspaceMementos.get(this.id);return i||(i=new Pue(this.id,e,t,this.storageService),Yc.workspaceMementos.set(this.id,i)),i.getMemento()}case Ie.PROFILE:{let i=Yc.profileMementos.get(this.id);return i||(i=new Pue(this.id,e,t,this.storageService),Yc.profileMementos.set(this.id,i)),i.getMemento()}case Ie.APPLICATION:{let i=Yc.applicationMementos.get(this.id);return i||(i=new Pue(this.id,e,t,this.storageService),Yc.applicationMementos.set(this.id,i)),i.getMemento()}}}onDidChangeValue(e,t){return this.storageService.onDidChangeValue(e,this.id,t)}saveMemento(){Yc.workspaceMementos.get(this.id)?.save(),Yc.profileMementos.get(this.id)?.save(),Yc.applicationMementos.get(this.id)?.save()}reloadMemento(e){let t;switch(e){case Ie.APPLICATION:t=Yc.applicationMementos.get(this.id);break;case Ie.PROFILE:t=Yc.profileMementos.get(this.id);break;case Ie.WORKSPACE:t=Yc.workspaceMementos.get(this.id);break}t?.reload()}static clear(e){switch(e){case Ie.WORKSPACE:Yc.workspaceMementos.clear();break;case Ie.PROFILE:Yc.profileMementos.clear();break;case Ie.APPLICATION:Yc.applicationMementos.clear();break}}};Yc.applicationMementos=new Map,Yc.profileMementos=new Map,Yc.workspaceMementos=new Map,Yc.COMMON_PREFIX="memento/";let dI=Yc;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){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(){DA(this.mementoObj)?this.storageService.remove(this.id,this.scope):this.storageService.store(this.id,this.mementoObj,this.scope,this.target)}}class vnt extends CLe{constructor(e,t,i){super(t),this.id=e,this.memento=new dI(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 Nzt extends vnt{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(Ec(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 q_)),this.actionRunner}updateTitleArea(){this._onTitleAreaUpdate.fire()}isVisible(){return this.visible}getControl(){}}const uO=class uO extends Nzt{get minimumWidth(){return Bx.width}get maximumWidth(){return JJ.width}get minimumHeight(){return Bx.height}get maximumHeight(){return JJ.height}get input(){return this._input}get options(){return this._options}get window(){return Zj(this.group.windowId,!0).window}get scopedContextKeyService(){}constructor(e,t,i,n,r){super(e,i,n,r),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 r=`${this.getId()}${i}`;let o=uO.EDITOR_MEMENTOS.get(r);return o||(o=this._register(new _Se(this.getId(),i,this.getMemento(Ie.WORKSPACE,cn.MACHINE),n,e,t)),uO.EDITOR_MEMENTOS.set(r,o)),o}getViewState(){}saveState(){for(const[,e]of uO.EDITOR_MEMENTOS)e.id===this.getId()&&e.saveState();super.saveState()}dispose(){this._input=void 0,this._options=void 0,super.dispose()}};uO.EDITOR_MEMENTOS=new Map;let VZ=uO;const gO=class gO extends V{constructor(e,t,i,n,r,o){super(),this.id=e,this.key=t,this.memento=i,this.limit=n,this.editorGroupService=r,this.configurationService=o,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 r=this.doLoad();let o=r.get(n.toString());o||(o=Object.create(null),r.set(n.toString(),o)),o[e.id]=i,this.shareEditorState&&(o[gO.SHARED_EDITOR_STATE]=i),ya(t)&&this.clearEditorStateOnDispose(n,t)}loadEditorState(e,t){const i=this.doGetResource(t);if(!i||!e)return;const r=this.doLoad().get(i.toString());if(r){const o=r[e.id];if(o)return o;if(this.shareEditorState)return r[gO.SHARED_EDITOR_STATE]}}clearEditorState(e,t){ya(e)&&this.editorDisposables?.delete(e);const i=this.doGetResource(e);if(i){const n=this.doLoad();if(t){const r=n.get(i.toString());r&&(delete r[t.id],DA(r)&&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(),r=[...n.keys()];for(const o of r){const a=N.parse(o);if(!i.isEqualOrParent(a,e))continue;let c;if(Yi(e,a))c=t;else{const d=GKe(a.path,e.path);c=Ft(t,a.path.substr(d+e.path.length+1))}const l=n.get(o,ql.None);l&&(n.delete(o),n.set(c.toString(),l))}}doGetResource(e){return ya(e)?e.resource:e}doLoad(){if(!this.cache){this.cache=new pm(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 r of Object.keys(n)){const o=Number(r);o===gO.SHARED_EDITOR_STATE&&this.shareEditorState||this.editorGroupService.getGroup(o)||(delete n[o],DA(n)&&e.delete(i))}}};gO.SHARED_EDITOR_STATE=-1;let _Se=gO,zZ=class extends VZ{constructor(e,t,i,n,r,o,a,c,l,d){super(e,t,n,c,o),this.instantiationService=r,this.textResourceConfigurationService=a,this.editorService=l,this.editorGroupService=d,this.groupListener=this._register(new yn),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(Fa.getOriginalUri(e,{supportSideBySide:Us.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}};zZ=D([_(3,Ji),_(4,we),_(5,Gi),_(6,xc),_(7,mn),_(8,ti),_(9,Pr)],zZ);var D0;function Pzt(s){const e=s;return typeof e?.primary=="object"&&typeof e.secondary=="object"}var YS;let vSe=(YS=class extends zZ{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,r,o,a,c,l){super(D0.ID,e,D0.VIEW_STATE_PREFERENCE_KEY,t,i,r,a,n,c,l),this.configurationService=o,this.onDidCreateEditors=this._register(new I),this._onDidChangeSizeConstraints=this._register(new vfe),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(D0.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?pi.VERTICAL:pi.HORIZONTAL,this.dimension=new wn(0,0),this.lastFocusedSide=void 0,this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e.affectsConfiguration(D0.SIDE_BY_SIDE_LAYOUT_SETTING)&&(this.orientation=this.configurationService.getValue(D0.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?pi.VERTICAL:pi.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===pi.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 T3(e,{orientation:this.orientation})),this.splitviewDisposables.add(this.splitview.onDidSashReset(()=>this.splitview?.distributeViewSizes())),this.orientation===pi.HORIZONTAL?this.splitview.orthogonalEndSash=this._boundarySashes?.bottom:(this.splitview.orthogonalStartSash=this._boundarySashes?.left,this.splitview.orthogonalEndSash=this._boundarySashes?.right);let i=Xk.Distribute,n=Xk.Distribute;if(t){const a=this.splitview.orientation===pi.HORIZONTAL?this.dimension.width:this.dimension.height;i=Math.round(a*t),n=a-i,this.splitview.layout(this.orientation===pi.HORIZONTAL?this.dimension.width:this.dimension.height)}const r=Qn(this.secondaryEditorContainer);this.splitview.addView({element:r,layout:a=>this.layoutPane(this.secondaryEditorPane,a),minimumSize:this.orientation===pi.HORIZONTAL?Bx.width:Bx.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:M.None},i);const o=Qn(this.primaryEditorContainer);this.splitview.addView({element:o,layout:a=>this.layoutPane(this.primaryEditorPane,a),minimumSize:this.orientation===pi.HORIZONTAL?Bx.width:Bx.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 r=this.input;await super.setInput(e,t,i,n),(!r||!e.matches(r))&&(r&&this.disposeEditors(),this.createEditors(e));const{primary:o,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===pi.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,o,i,n)]),typeof t?.target=="number"&&(this.lastFocusedSide=t.target)}loadViewState(e,t,i){const n=Pzt(t?.viewState)?t?.viewState:this.loadEditorViewState(e,i);let r=Object.create(null),o;return t?.target===Us.SECONDARY?o={...t}:r={...t},r.viewState=n?.primary,n?.secondary&&(o?o.viewState=n?.secondary:o={viewState:n.secondary}),{primary:r,secondary:o,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(Us.PRIMARY))),this.editorDisposables.add(this.secondaryEditorPane.onDidFocus(()=>this.onDidFocusChange(Us.SECONDARY)))}doCreateEditor(e,t){const i=je.as(rC.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()),pHe(n)&&this.editorDisposables.add(n.onDidChangeSelection(r=>this._onDidChangeSelection.fire(r))),this.editorDisposables.add(n),n}onDidFocusChange(e){this.lastFocusedSide=e,this._onDidChangeControl.fire()}getSelection(){const e=this.getLastFocusedEditorPane();if(pHe(e)){const t=e.getSelection();if(t)return new XNe(t,e===this.primaryEditorPane?Us.PRIMARY:Us.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===Us.SECONDARY?this.secondaryEditorPane:this.primaryEditorPane}layout(e){this.dimension=e,Qn(this.splitview).layout(this.orientation===pi.HORIZONTAL?e.width:e.height)}setBoundarySashes(e){this._boundarySashes=e,this.splitview&&(this.splitview.orthogonalEndSash=e.bottom)}layoutPane(e,t){e?.layout(this.orientation===pi.HORIZONTAL?new wn(t,this.dimension.height):new wn(this.dimension.width,t))}getControl(){return this.getLastFocusedEditorPane()?.getControl()}getPrimaryEditorPane(){return this.primaryEditorPane}getSecondaryEditorPane(){return this.secondaryEditorPane}tracksEditorViewState(e){return e instanceof cp}computeEditorViewState(e){if(!this.input||!Yi(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 cp&&(t=e.primary.resource,i=e.secondary.resource),!(!i||!t))return N.from({scheme:"sideBySide",path:`${B8(i.toString())}${B8(t.toString())}`})}updateStyles(){super.updateStyles(),this.primaryEditorContainer&&(this.orientation===pi.HORIZONTAL?(this.primaryEditorContainer.style.borderLeftWidth="1px",this.primaryEditorContainer.style.borderLeftStyle="solid",this.primaryEditorContainer.style.borderLeftColor=this.getColor(LLt)??"",this.primaryEditorContainer.style.borderTopWidth="0"):(this.primaryEditorContainer.style.borderTopWidth="1px",this.primaryEditorContainer.style.borderTopStyle="solid",this.primaryEditorContainer.style.borderTopColor=this.getColor(TLt)??"",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&&Ns(this.secondaryEditorContainer),this.primaryEditorContainer&&Ns(this.primaryEditorContainer)}},D0=YS,YS.ID=dTt,YS.SIDE_BY_SIDE_LAYOUT_SETTING="workbench.editor.splitInGroupLayout",YS.VIEW_STATE_PREFERENCE_KEY="sideBySideEditorViewState",YS);vSe=D0=D([_(1,Ji),_(2,we),_(3,mn),_(4,Gi),_(5,Te),_(6,xc),_(7,ti),_(8,Pr)],vSe);class XNe{constructor(e,t){this.selection=e,this.side=t}compare(e){return!(e instanceof XNe)||this.side!==e.side?Ox.DIFFERENT:this.selection.compare(e.selection)}restore(e){const t={...e,target:this.side};return this.selection.restore(t)}}const Tw=class Tw{static didInstantiateEditorPane(e){return Tw.instantiatedEditorPanes.has(e)}static create(e,t,i){return new Tw(e,t,i)}constructor(e,t,i){this.ctor=e,this.typeId=t,this.name=i}instantiate(e,t){Tw._onWillInstantiateEditorPane.fire({typeId:this.typeId});const i=e.createInstance(this.ctor,t);return Tw.instantiatedEditorPanes.add(this.typeId),i}describes(e){return e.getId()===this.typeId}};Tw.instantiatedEditorPanes=new Set,Tw._onWillInstantiateEditorPane=new I,Tw.onWillInstantiateEditorPane=Tw._onWillInstantiateEditorPane.event;let $Ve=Tw;class Fzt{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 r=this.mapEditorPanesToEditors.get(n)||[];for(const o of r){const a=o.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 ui.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}}je.add(rC.EditorPane,new Fzt);function Ozt(s,e){const t=s.get(ti),i=s.get(Is),n=s.get(Pm);return new Promise(r=>{let o=[...e];const a=t.onDidCloseEditor(async c=>{if(c.context===uA.MOVE)return;let l=Fa.getOriginalUri(c.editor,{supportSideBySide:Us.PRIMARY}),d=Fa.getOriginalUri(c.editor,{supportSideBySide:Us.SECONDARY});if(c.context===uA.REPLACE){const h=Fa.getOriginalUri(t.activeEditor,{supportSideBySide:Us.PRIMARY}),u=Fa.getOriginalUri(t.activeEditor,{supportSideBySide:Us.SECONDARY});i.extUri.isEqual(l,h)&&(l=void 0),i.extUri.isEqual(d,u)&&(d=void 0)}if(o=o.filter(h=>!(i.extUri.isEqual(h,l)||i.extUri.isEqual(h,d)||c.context!==uA.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}))))),o.length===0){const h=e.filter(u=>n.isDirty(u));return h.length>0&&await er.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(),r()}})})}function Bzt(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 bSe,CR;let wSe=(CR=class extends zZ{constructor(e,t,i,n,r,o,a,c,l,d){super(e,t,bSe.VIEW_STATE_PREFERENCE_KEY,i,n,r,o,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 yn),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=In(e.editor)?Ds(e.editor):Object.create(null);return Object.assign(t,this.getConfigurationOverrides(e)),t.ariaLabel=this.computeAriaLabel(),t}computeAriaLabel(){return this.input?Bzt(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:i1.EDIT}))),this._register(e.onDidScrollChange(()=>this._onDidChangeScroll.fire())))}toEditorPaneSelectionChangeReason(e){switch(e.source){case Lb.PROGRAMMATIC:return i1.PROGRAMMATIC;case Lb.NAVIGATION:return i1.NAVIGATION;case Lb.JUMP:return i1.JUMP;default:return i1.USER}}getSelection(){const e=this.getMainControl();if(e){const t=e.getSelection();if(t)return new ySe(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=g8(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()}},bSe=CR,CR.VIEW_STATE_PREFERENCE_KEY="textEditorViewState",CR);wSe=bSe=D([_(2,Ji),_(3,we),_(4,Gi),_(5,xc),_(6,mn),_(7,ti),_(8,Pr),_(9,Xt)],wSe);const s8=class s8{constructor(e){this.textSelection=e}compare(e){if(!(e instanceof s8))return Ox.DIFFERENT;const t=Math.min(this.textSelection.selectionStartLineNumber,this.textSelection.positionLineNumber),i=Math.min(e.textSelection.selectionStartLineNumber,e.textSelection.positionLineNumber);return t===i?Ox.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!==GVe&&(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()??Sa))return;const e=await this.languageDetectionService.detectLanguage(this.textEditorModelHandle),t=this.getLanguageId();if(e&&e!==t&&!this.isDisposed()){this.setLanguageIdInternal(e,GVe);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),r=this.getOrCreateLanguage(t,this.languageService,i,n);return this.doCreateTextEditorModel(e,r,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(lY.FIRST_LINE_DETECTION_LENGTH_LIMIT):e.getLineContent(1).substr(0,lY.FIRST_LINE_DETECTION_LENGTH_LIMIT)}getOrCreateLanguage(e,t,i,n){return!i||i===Sa?t.createByFilepathOrFirstLine(e??null,n):t.createById(i)}updateTextEditorModel(e,t){this.isResolved()&&(e&&this.modelService.updateModel(this.textEditorModel,e),t&&t!==Sa&&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()}},CSe=SR,SR.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY=600,SR);hI=CSe=D([_(0,fi),_(1,Di),_(2,j6),_(3,_o)],hI);class bnt extends BI{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 wnt extends bnt{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 qQ,AR;let Yg=(AR=class extends cp{get typeId(){return qQ.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|=xi.ForceDescription),e}constructor(e,t,i,n,r,o){super(e,t,i,n,o),this.original=i,this.modified=n,this.forceOpenAsBinary=r,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,r;if(this.preferredDescription)i=this.preferredDescription,n=this.preferredDescription,r=this.preferredDescription;else{i=this.computeLabel(this.original.getDescription(Rs.SHORT),this.modified.getDescription(Rs.SHORT)),r=this.computeLabel(this.original.getDescription(Rs.LONG),this.modified.getDescription(Rs.LONG));const d=this.original.getDescription(Rs.MEDIUM),h=this.modified.getDescription(Rs.MEDIUM);if(typeof d=="string"&&typeof h=="string"&&(d||h)){const[u,f]=iPt([d,h]);n=this.computeLabel(u,f)}}let o=this.computeLabel(this.original.getTitle(Rs.SHORT)??this.original.getName(),this.modified.getTitle(Rs.SHORT)??this.modified.getName()," ↔ "),a=this.computeLabel(this.original.getTitle(Rs.MEDIUM)??this.original.getName(),this.modified.getTitle(Rs.MEDIUM)??this.modified.getName()," ↔ "),c=this.computeLabel(this.original.getTitle(Rs.LONG)??this.original.getName(),this.modified.getTitle(Rs.LONG)??this.modified.getName()," ↔ ");const l=this.getPreferredTitle();return l&&(o=`${l} (${o})`,a=`${l} (${a})`,c=`${l} (${c})`),{name:e,shortDescription:i,mediumDescription:n,longDescription:r,forceDescription:t,shortTitle:o,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=Rs.MEDIUM){switch(e){case Rs.SHORT:return this.labels.shortDescription;case Rs.LONG:return this.labels.longDescription;case Rs.MEDIUM:default:return this.labels.mediumDescription}}getTitle(e){switch(e){case Rs.SHORT:return this.labels.shortTitle;case Rs.LONG:return this.labels.longTitle;default:case Rs.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===hTt):e.find(t=>t.typeId===AXe)}async createModel(){const[e,t]=await Promise.all([this.original.resolve(),this.modified.resolve()]);return t instanceof hI&&e instanceof hI?new wnt(e,t):new bnt(yWe(e)?e:void 0,yWe(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 qQ?this.modified.matches(e.modified)&&this.original.matches(e.original)&&e.forceOpenAsBinary===this.forceOpenAsBinary:k_(e)?this.modified.matches(e.modified)&&this.original.matches(e.original):!1}dispose(){this.cachedModel&&(this.cachedModel.dispose(),this.cachedModel=void 0),super.dispose()}},qQ=AR,AR.ID="workbench.editors.diffEditorInput",AR);Yg=qQ=D([_(5,ti)],Yg);var SSe,ER;let KVe=(ER=class extends wSe{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,r,o,a,c,l,d){super(SSe.ID,e,t,i,n,r,a,o,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(yp,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 r=await e.resolve();if(n.isCancellationRequested)return;if(!(r instanceof wnt)){this.openAsBinary(e,t);return}const o=Qn(this.diffEditorControl),a=r,c=a.textDiffEditorModel?o.createViewModel(a.textDiffEditorModel):null;this._previousViewModel=c,await c?.waitForDiff(),o.setModel(c);let l=!1;dMe(t?.viewState)||(l=this.restoreTextDiffEditorViewState(e,t,i,o));let d=!1;t&&(d=$Z(t,o,_t.Immediate)),!d&&!l&&o.revealFirstDiff(),o.updateOptions({...this.getReadonlyConfiguration(a.modifiedModel?.isReadonly()),originalEditable:!a.originalModel?.isReadonly()}),o.handleInitialized(),this.inputLifecycleStopWatch=new Ys(!1)}catch(r){await this.handleSetInputError(r,e,t)}}async handleSetInputError(e,t,i){if(this.isFileBinaryError(e))return this.openAsBinary(t,i);if(e.fileOperationResult===ji.FILE_TOO_LARGE){let n;throw e instanceof Qq?n=g(9538,"At least one file is not displayed in the text compare editor because it is very large ({0}).",Pc.formatSize(e.size)):n=g(9539,"At least one file is not displayed in the text compare editor because it is very large."),mTt(this.group,t,i,n,this.preferencesService)}throw e}restoreTextDiffEditorViewState(e,t,i,n){const r=this.loadEditorViewState(e,i);return r?(t?.selection&&r.modified&&(r.modified.cursorState=[]),n.restoreViewState(r),t?.revealIfVisible&&n.revealFirstDiff(),!0):!1}openAsBinary(e,t){const i=e.original,n=e.modified,r=this.instantiationService.createInstance(Yg,e.getName(),e.getDescription(),i,n,!0),o=je.as(rC.EditorFactory).getFileEditorFactory();o.isFileEditor(i)&&i.setForceOpenAsBinary(),o.isFileEditor(n)&&n.setForceOpenAsBinary(),this.group.replaceEditors([{editor:e,replacement:r,options:{...t,activation:Jk.PRESERVE,pinned:this.group.isPinned(e),sticky:this.group.isSticky(e)}}])}setOptions(e){super.setOptions(e),e&&$Z(e,Qn(this.diffEditorControl),_t.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(In(e.diffEditor)){const n=Ds(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 Yg&&!this.input.original.isReadonly(),lineDecorationsWidth:"2ch"}}updateReadonly(e){e instanceof Yg?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===RW.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 yp&&(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 Yg}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&&Yi(i,e))return this.diffEditorControl.saveViewState()??void 0}toEditorViewStateResource(e){let t,i;if(e instanceof Yg?(t=e.original.resource,i=e.modified.resource):ya(e)||(t=e.original.uri,i=e.modified.uri),!(!t||!i))return N.from({scheme:"diff",path:`${B8(t.toString())}${B8(i.toString())}`})}},SSe=ER,ER.ID=AXe,ER);KVe=SSe=D([_(1,Ji),_(2,we),_(3,Gi),_(4,xc),_(5,ti),_(6,mn),_(7,Pr),_(8,Xt),_(9,Y6)],KVe);function GZ(s,e,t=pA){if(t===pA||t===nv)return t;let i=s.getGroups(gu.GRID_APPEARANCE)[t];if(!i&&t<9){for(let n=0;n<=t;n++){const r=s.getGroups(gu.GRID_APPEARANCE);r[n]||s.addGroup(r[n-1],QW(e))}i=s.getGroups(gu.GRID_APPEARANCE)[t]}return i?.id??nv}function uI(s,e){const t=typeof e=="number"?s.getGroup(e):e;return s.getGroups(gu.GRID_APPEARANCE).indexOf(t??s.activeGroup)}function Hzt(s,e,t,i){const n=Uzt(s,e,t,i),r=n.length&&n[0].preserveFocus||!1,o={groupedEditors:[],preserveFocus:r};for(const a of n){const c=$zt(a,t);if(!c)continue;const{group:l,editor:d}=c;let h;for(const u of o.groupedEditors)if(u.group.id===l.id){h=u;break}h||(h={group:l,editors:[]},o.groupedEditors.push(h)),d&&h.editors.push(d)}return o}function Uzt(s,e,t,i){const n=i.lastFocusedList;let r=n instanceof Za&&n.getHTMLElement()===Wc(),o=zzt(s,r,e,t,i);if(!o){const c=t.activeGroup,l=c.activeEditor;o={groupId:c.id,editorIndex:l?c.getIndexOfEditor(l):void 0},r=!1}const a=ynt(o,r,e,t,i);return Vzt(o,a)}function Vzt(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 zzt(s,e,t,i,n){const r=s.filter(o=>mHe(o)||N.isUri(o));for(const o of r)if(mHe(o))return o;for(const o of r){const a=t.findEditors(o);if(a.length){const c=a[0],l=i.getGroup(c.groupId);return{groupId:c.groupId,editorIndex:l?.getIndexOfEditor(c.editor)}}}if(e){const o=n.lastFocusedList;for(const a of o.getFocusedElements())if(Cnt(a))return ASe(a,void 0,i)}}function ynt(s,e,t,i,n){if(e){const o=n.lastFocusedList.getSelectedElements().filter(Cnt);if(o.length>1)return o.map(a=>ASe(a,s.preserveFocus,i));if(o.length===0)return ynt(s,!1,t,i,n)}else{const r=i.getGroup(s.groupId),o=s.editorIndex!==void 0?r?.getEditorByIndex(s.editorIndex):r?.activeEditor;if(r&&o&&r.isSelected(o))return r.selectedEditors.map(a=>ASe({editor:a,groupId:r.id},s.preserveFocus,i))}return[s]}function ASe(s,e,t){if(KNe(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 Cnt(s){return KNe(s)||Kve(s)}function $zt(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 Gzt="workbench.action.closeEditorsAndGroup";class Kzt{constructor(e){this.root=new KZ;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 KZ;for(const o of e){const a=this.getAttributes(o,t),c=this.root.get(o,a);for(const l of c)i.add(l,o)}const n=(o,a=new Set)=>{if(a.has(o))return[];a.add(o);const c=this.getAttributes(o,t),l=i.get(o,c);return l.length===0?[o]:l.length===1&&l[0]===o?[o]:l.flatMap(d=>n(d,a))},r=new Map;for(const o of e){let a=n(o);a.length===0&&(a=[o]);for(const c of a){let l=r.get(c);l||r.set(c,l=new Set),o!==c&&l.add(o)}}return r}}class KZ{constructor(){this.value=new ZNe,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 r=this.map.get(i);r||this.map.set(i,r=new KZ),r.add(n,t)}}get(e,t){const i=[];i.push(...this.value.get(e,t));const n=e[0],r=e.slice(1),o=this.map.get(n);return o&&i.push(...o.get(r,t)),i}toString(e=""){const t=[];return this.value.hasItems&&t.push(`* => `+this.value.toString(e+" ")),t.map(i=>e+i).join(` `)}}class ZNe{constructor(){this.star=[],this.epsilon=[],this.map=new Map,this.hasItems=!1}add(e,t){if(this.hasItems=!0,e==="*")this.star.push(new QVe(t));else if(e==="")this.epsilon.push(new QVe(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 r=this.map.get(i);r||this.map.set(i,r=new ZNe),r.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],r=e.slice(0,e.length-1),o=this.map.get(n);return o&&i.push(...o.get(r,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 vw;(function(s){s.capture="capture",s.basename="basename",s.dirname="dirname",s.extname="extname"})(vw||(vw={}));const qVe=/\$[({](capture|basename|dirname|extname)[)}]/g;class QVe{constructor(e){this.tokens=[],qVe.lastIndex=0;let t,i=0;for(;t=qVe.exec(e);){const n=e.slice(i,t.index);this.tokens.push(n);const r=t[1];switch(r){case vw.basename:case vw.dirname:case vw.extname:case vw.capture:this.tokens.push({capture:r});break;default:throw Error("unknown substitution type: "+r)}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 vw.basename:return e.basename;case vw.dirname:return e.dirname;case vw.extname:return e.extname;case vw.capture:return t||""}}).join("")}}class qd{constructor(e,t,i,n,r,o,a,c,l,d=TA(e),h,u=!1){this.resource=e,this.fileService=t,this.configService=i,this.filesConfigService=n,this._parent=r,this._isDirectory=o,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,r,o){const a=new qd(n.resource,e,t,i,r,n.isDirectory,n.isSymbolicLink,n.readonly,n.locked,n.name,n.mtime,!n.isFile&&!n.isDirectory);if(a.isDirectory&&(a._isDirectoryResolved=!!n.children||!!o&&o.some(c=>Jy(c,a.resource)),n.children))for(let c=0,l=n.children.length;c{n.set(r.resource,r)}),t.children.clear(),e.children.forEach(r=>{const o=n.get(r.resource);o?(qd.mergeLocalWithDisk(r,o),t.addChild(o),n.delete(r.resource)):t.addChild(r)}),n.forEach(r=>{r instanceof qce&&t.addChild(r)})}}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===lSe.Modified;this.error=void 0;try{const r=await this.fileService.resolve(this.resource,{resolveSingleChildDescendants:!0,resolveMetadata:n}),o=qd.create(this.fileService,this.configService,this.filesConfigService,r,this);qd.mergeLocalWithDisk(o,this)}catch(r){throw this.error=r,r}this._isDirectoryResolved=!0}const i=[];if(t.enabled){const n=[],r=[];for(const a of this.children.entries())a[1].nestedParent=void 0,a[1].isDirectory?r.push(a):n.push(a);const o=this.fileNester.nest(n.map(([a])=>a),this.getPlatformAwareName(this.name));for(const[a,c]of n){const l=o.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 r.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(r=>this.getPlatformAwareName(r.trim().replace(/\u200b/g,"").trim())).filter(r=>r!=="")]);this.root._fileNester=new Kzt(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,zn.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=Ft(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,zn.PathCaseSensitive);return e&&this.resource.scheme===e.scheme&&ga(this.resource.authority,e.authority)&&(t?J7(e.path,this.resource.path):e.path.startsWith(this.resource.path))?this.findByPath(qy(e.path,zi.sep),this.resource.path.length,t):null}findByPath(e,t,i){if(Gdt(qy(this.resource.path,zi.sep),e,i))return this;if(this.isDirectory){for(;tthis.doUpload(e,this.toTransfer(t),r,i.token),()=>i.dispose(!0));return this.progressService.withProgress({location:Vb,delay:500},()=>n),n}toTransfer(e){if(sut(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 r=t.items,o=[];for(const h of r)o.push(h.webkitGetAsEntry());const a=[],c={startTime:Date.now(),progressScheduler:new XKe(h=>{i.report(h[h.length-1])},1e3),filesTotal:o.length,filesUploaded:0,totalBytesUploaded:0},l=new Tpe(QQ.MAX_PARALLEL_UPLOADS);await er.settled(o.map(h=>l.queue(async()=>{if(n.isCancellationRequested)return;if(e&&h.name&&e.getChild(h.name)){const{confirmed:f}=await this.dialogService.confirm(ePe(h.name));if(!f||(await this.explorerService.applyBulkEdit([new hp(Ft(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,r,o){if(o.isCancellationRequested||!e.name||!e.isFile&&!e.isDirectory)return;let a=0;const c=(d,h)=>{a+=h,r.totalBytesUploaded+=h;const u=r.totalBytesUploaded/((Date.now()-r.startTime)/1e3);let f;de.file(h,u));return o.isCancellationRequested?void 0:(typeof d.stream=="function"&&d.size>Pc.MB?await this.doUploadFileBuffered(l,d,c,o):await this.doUploadFileUnbuffered(l,d,c),{isFile:!0,resource:l})}else{if(await this.fileService.createFolder(l),o.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&&!o.isCancellationRequested);r.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 Tpe(QQ.MAX_PARALLEL_UPLOADS);await er.settled(p.map(b=>v.queue(()=>this.doUploadEntry(b,l,f,n,r,o))));for(const b of m)await this.doUploadEntry(b,l,f,n,r,o);return{isFile:!1,resource:l}}}async doUploadFileBuffered(e,t,i,n){const r=Lqe({highWaterMark:10}),o=this.fileService.writeFile(e,r);try{const a=t.stream().getReader();let c=await a.read();for(;!c.done&&!n.isCancellationRequested;){const l=Ge.wrap(c.value);if(await r.write(l),n.isCancellationRequested)break;i(t.size,l.byteLength),c=await a.read()}r.end(void 0)}catch(a){r.error(a),r.end()}n.isCancellationRequested||await o}doUploadFileUnbuffered(e,t,i){return new Promise((n,r)=>{const o=new FileReader;o.onload=async a=>{try{if(a.target?.result instanceof ArrayBuffer){const c=Ge.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){r(c)}},o.readAsArrayBuffer(t)})}},QQ=xR,xR.MAX_PARALLEL_UPLOADS=20,xR);qZ=QQ=D([_(0,hg),_(1,ir),_(2,yf),_(3,ti),_(4,Xt)],qZ);let ESe=class{constructor(e,t,i,n,r,o,a,c,l,d,h){this.fileService=e,this.hostService=t,this.contextService=i,this.configurationService=n,this.dialogService=r,this.workspaceEditingService=o,this.explorerService=a,this.editorService=c,this.progressService=l,this.notificationService=d,this.instantiationService=h}async import(e,t,i){const n=new li,r=this.progressService.withProgress({location:fd.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:Vb,delay:500},()=>r),r}async doImport(e,t,i,n){const r=Oi((await this.instantiationService.invokeFunction(l=>Iet(l,t))).map(l=>l.resource));await Promise.all(r.map(l=>this.fileService.activateProvider(l.scheme)));const o=Oi(r.filter(l=>this.fileService.hasProvider(l))),a=await this.fileService.resolveAll(o.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?",vi(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}'?",vi(c[0].uri));const{result:f}=await this.dialogService.prompt({type:Ze.Info,message:h,buttons:d,cancelButton:!0});if(f===l.Add)return this.workspaceEditingService.addFolders(c);if(f===l.Copy)return this.importResources(e,o,n)}else if(e instanceof qd)return this.importResources(e,o,n)}async importResources(e,t,i){if(t&&t.length>0){const n=await this.fileService.resolve(e.resource);if(i.isCancellationRequested)return;const r=new Set,o=this.fileService.hasCapability(e.resource,zn.PathCaseSensitive);n.children&&n.children.forEach(u=>{r.add(o?u.name:u.name.toLowerCase())});let a=0;const c=Oi(await er.settled(t.map(async u=>{if(!await this.fileService.exists(u)){a++;return}if(!(r.has(o?vi(u):vi(u).toLowerCase())&&!(await this.dialogService.confirm(ePe(vi(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=vi(u),p=Ft(e.resource,f);return new hp(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}",vi(c[0])):g(10036,"Import {0} resources",c.length),progressLabel:c.length===1?g(10037,"Copying {0}",vi(c[0])):g(10038,"Copying {0} resources",c.length),progressLocation:fd.Window,confirmBeforeUndo:d===BT.Verbose||d===BT.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}})}}}};ESe=D([_(0,Xt),_(1,Dc),_(2,Ci),_(3,Te),_(4,ir),_(5,oC),_(6,yf),_(7,ti),_(8,hg),_(9,wi),_(10,we)],ESe);var DR;let xSe=(DR=class{constructor(e,t,i,n,r,o){this.fileService=e,this.explorerService=t,this.progressService=i,this.logService=n,this.fileDialogService=r,this.storageService=o}download(e){const t=new li,i=this.progressService.withProgress({location:fd.Window,delay:800,cancellable:Hn,title:g(10039,"Downloading")},async n=>this.doDownload(e,n,t),()=>t.dispose(!0));return this.progressService.withProgress({location:Vb,delay:500},()=>i),i}async doDownload(e,t,i){for(const n of e){if(i.token.isCancellationRequested)return;Hn?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 r=32*Pc.MB,o=n.isDirectory||n.size>r,a=Ry();if(o&&Zp.supported(a))try{const c=await a.showDirectoryPicker(),l={startTime:Date.now(),progressScheduler:new XKe(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:r}},i.token)).value.buffer}catch{c=sf.uriToBrowserUri(n.resource)}i.token.isCancellationRequested||dut(c,n.name)}}async downloadFileBufferedBrowser(e,t,i,n){const r=await this.fileService.readFileStream(e,void 0,n);if(n.isCancellationRequested){t.close();return}return new Promise((o,a)=>{const c=r.value,l=new Z;l.add(Ee(()=>t.close())),l.add(fm(n.onCancellationRequested)(()=>{l.dispose(),a(Ty())})),NN(c,{onData:d=>{t.write(d.buffer),this.reportProgress(r.name,r.size,d.byteLength,i)},onError:d=>{l.dispose(),a(d)},onEnd:()=>{l.dispose(),o()}},n)})}async downloadFileUnbufferedBrowser(e,t,i,n){const r=await this.fileService.readFile(e,void 0,n);n.isCancellationRequested||(t.write(r.value.buffer),this.reportProgress(r.name,r.size,r.value.byteLength,i)),t.close()}async downloadFileBrowser(e,t,i,n){i.filesDownloaded++,i.fileBytesDownloaded=0,this.reportProgress(t.name,0,0,i);const o=await(await e.getFileHandle(t.name,{create:!0})).createWritable();return t.size>Pc.MB?this.downloadFileBufferedBrowser(t.resource,o,i,n):this.downloadFileUnbufferedBrowser(t.resource,o,i,n)}async downloadFolderBrowser(e,t,i,n){if(e.children){i.filesTotal+=e.children.map(r=>r.isFile).length;for(const r of e.children){if(n.isCancellationRequested)return;if(r.isFile)await this.downloadFileBrowser(t,r,i,n);else{const o=await t.getDirectoryHandle(r.name,{create:!0}),a=await this.fileService.resolve(r.resource,{resolveMetadata:!0});await this.downloadFolderBrowser(a,o,i,n)}}}}reportProgress(e,t,i,n){n.fileBytesDownloaded+=i,n.totalBytesDownloaded+=i;const r=n.totalBytesDownloaded/((Date.now()-n.startTime)/1e3);let o;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:gnt(s)+` -`+g(10047,"This action is irreversible!"),primaryButton:g(10048,"&&Replace"),type:"warning"}:ePe(vi(s[0]))}const tPe="explorer.newFile";Pe(5429,"New File...");const Snt="explorer.newFolder";Pe(5430,"New Folder...");g(5431,"Rename...");g(5432,"Delete");g(5433,"Copy");g(5434,"Paste");const Qzt=new Q("fileCopied",!1),jzt="explorer.download";g(5435,"Download...");const Yzt="explorer.upload";g(5436,"Upload...");function Jzt(s,e){e.message==="string"&&(e=e.message),s.error(Po(e,!1))}async function Xzt(s,e){s&&(s.indexOf("/")>=0||s.indexOf("\\")>=0)&&await e.refresh()}async function Zzt(s,e,t,i,n,r){let o=typeof n.resource=="string"?n.resource:TA(n.resource),a=Ft(i.resource,o);if(!(r==="disabled"&&!await t8t(e,t,a))){for(;!n.allowOverwrite&&s.findClosest(a);)r!=="disabled"&&(o=e8t(o,!!n.isDirectory,r)),a=Ft(i.resource,o);return a}}function e8t(s,e,t){if(t==="simple"){let h=s,u="";e||(u=jy(s),h=Kr(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){Jzt(this.notificationService,t)}}};DSe=D([_(2,bi),_(3,wi),_(4,Pm)],DSe);const Yre=class Yre extends DSe{get class(){return"explorer-action "+He.asClassName(ve.saveAll)}doRun(e){return this.commandService.executeCommand(ytt,{},e)}};Yre.ID="workbench.files.action.saveAllInGroup",Yre.LABEL=g(5477,"Save All in Group");let JVe=Yre;var kR;let XVe=(kR=class extends an{constructor(e,t,i){super(e,t,He.asClassName(ve.closeAll)),this.commandService=i}run(e){return this.commandService.executeCommand(Gzt,{},e)}},kR.ID="workbench.files.action.closeGroup",kR.LABEL=g(5478,"Close Group"),kR);XVe=D([_(2,bi)],XVe);const pO=class pO extends di{constructor(){super({id:pO.ID,title:pO.LABEL,f1:!0,category:la.File,metadata:{description:Pe(5480,"Moves focus to the file explorer view container.")}})}async run(e){await e.get(Mm).openPaneComposite(lzt,io.Sidebar,!0)}};pO.ID="workbench.files.action.focusFilesExplorer",pO.LABEL=Pe(5479,"Focus on Files Explorer");let ZVe=pO;const mO=class mO extends di{constructor(){super({id:mO.ID,title:mO.LABEL,f1:!0,category:la.File,metadata:{description:Pe(5482,"Reveals and selects the active file within the explorer view.")}})}async run(e){const t=e.get(bi),i=e.get(ti),n=Pa.getOriginalUri(i.activeEditor,{supportSideBySide:Us.PRIMARY});n&&t.executeCommand(UOt,n)}};mO.ID="workbench.files.action.showActiveFileInExplorer",mO.LABEL=Pe(5481,"Reveal Active File in Explorer View");let e5e=mO;const _O=class _O extends di{constructor(){super({id:_O.ID,title:_O.LABEL,f1:!0,category:la.File,precondition:kXe,metadata:{description:Pe(5484,"Opens the active file in a new window with no folders open.")}})}async run(e){const t=e.get(ti),i=e.get(Dc),n=e.get(ir),r=e.get(Xt),o=Pa.getOriginalUri(t.activeEditor,{supportSideBySide:Us.PRIMARY});o&&(r.hasProvider(o)?i.openWindow([{fileUri:o}],{forceNewWindow:!0}):n.error(g(5485,"The active editor must contain an openable resource.")))}};_O.ID="workbench.action.files.showOpenedFileInNewWindow",_O.LABEL=Pe(5483,"Open Active File in New Empty Workspace");let t5e=_O;function i8t(s,e,t,i){if(t=s8t(t),!t||t.length===0||/^\s+$/.test(t))return{content:g(5486,"A file or folder name must be provided."),severity:Ze.Error};if(t[0]==="/"||t[0]==="\\")return{content:g(5487,"A file or folder name cannot start with a slash."),severity:Ze.Error};const n=Oi(t.split(/[\\/]/)),r=e.parent;if(t!==e.name){const o=r?.getChild(t);if(o&&o!==e)return{content:g(5488,"A file or folder **{0}** already exists at this location. Please choose a different name.",t),severity:Ze.Error}}if(n.some(o=>!s.hasValidBasename(e.resource,i,o))){const o=t.replace(/\*/g,"\\*");return{content:g(5489,"The name **{0}** is not valid as a file or folder name. Please choose a different name.",n8t(o)),severity:Ze.Error}}return n.some(o=>/^\s|\s$/.test(o))?{content:g(5490,"Leading or trailing whitespace detected in file or folder name."),severity:Ze.Warning}:null}function n8t(s){return s?.length>255?`${s.substr(0,255)}...`:s}function s8t(s){return s&&(s=STe(s," "),s=qy(s,"/"),s=qy(s,"\\"),s)}const vO=class vO extends di{constructor(){super({id:vO.ID,title:vO.LABEL,f1:!0,category:la.File,metadata:{description:Pe(5492,"Opens a new diff editor with two untitled files.")}})}async run(e){await e.get(ti).openEditor({original:{resource:void 0},modified:{resource:void 0},options:{pinned:!0}})}};vO.ID="workbench.files.action.compareNewUntitledTextFiles",vO.LABEL=Pe(5491,"Compare New Untitled Text Files");let i5e=vO;const ex=class ex extends di{constructor(){super({id:ex.ID,title:ex.LABEL,f1:!0,category:la.File,keybinding:{primary:oo(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(ti),i=e.get(we),n=e.get(pn),r=e.get(Xt),o=Pa.getOriginalUri(t.activeEditor,{supportSideBySide:Us.PRIMARY}),a=`clipboardCompare${ex.SCHEME_COUNTER++}`;if(o&&(r.hasProvider(o)||o.scheme===pe.untitled)){if(!this.registrationDisposal){const d=i.createInstance(kSe);this.registrationDisposal=n.registerTextModelContentProvider(a,d)}const c=vi(o),l=g(5495,"Clipboard ↔ {0}",c);await t.openEditor({original:{resource:o.with({scheme:a})},modified:{resource:o},label:l,options:{pinned:!0}}).finally(()=>{wt(this.registrationDisposal),this.registrationDisposal=void 0})}}dispose(){wt(this.registrationDisposal),this.registrationDisposal=void 0}};ex.ID="workbench.files.action.compareWithClipboard",ex.LABEL=Pe(5493,"Compare Active File with Clipboard"),ex.SCHEME_COUNTER=0;let n5e=ex,kSe=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)}};kSe=D([_(0,gg),_(1,Di),_(2,fi)],kSe);function r8t(s,e,t){s.prompt(Ze.Error,Po(e,!1),[{label:g(5496,"Retry"),run:()=>t()}])}async function Ant(s,e){const t=s.get(yf),i=s.get(Xt),n=s.get(Te),r=s.get(bd),o=s.get(ti),a=s.get(Nm),c=s.get(wi),l=s.get(fg),d=s.get(bi),h=s.get(Cf),u=!a.isViewVisible(Vb),f=await a.openView(Vb,!0);if(u&&await Ao(500),!f){if(e)throw new Error("Open a folder or workspace first.");return d.executeCommand(QOt)}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 qce(i,n,r,v,e);v.addChild(b);const w=async C=>{try{const A=Ft(v.resource,C);C.endsWith("/")&&(e=!0),await t.applyBulkEdit([new hp(void 0,A,{folder:e})],{undoLabel:g(5497,"Create {0}",C),progressLabel:g(5498,"Creating {0}",C),confirmBeforeUndo:!0}),await Xzt(C,t),e?await t.select(A,!0):await o.openEditor({resource:A,options:{pinned:!0}})}catch(A){r8t(c,A,()=>w(C))}},y=(await l.getEnvironment())?.os??pr;await t.setEditable(b,{validationMessage:C=>i8t(h,b,C,y),onFinish:async(C,A)=>{v.removeChild(b),await t.setEditable(b,null),A&&w(C)}})}vt.registerCommand({id:tPe,handler:async s=>{await Ant(s,!1)}});vt.registerCommand({id:Snt,handler:async s=>{await Ant(s,!0)}});const o8t=async s=>{const e=s.get(yf),t=s.get(wi),i=s.get(we),n=e.getContext(!0),r=n.length?n:e.roots,o=i.createInstance(xSe);try{await o.download(r)}catch(a){throw t.error(a),a}};vt.registerCommand({id:jzt,handler:o8t});const a8t=async s=>{const e=s.get(yf),t=s.get(wi),i=s.get(we),n=e.getContext(!1),r=n.length?n[0]:e.roots[0];try{const o=await hut();o&&await i.createInstance(qZ).upload(r,o)}catch(o){throw t.error(o),o}};vt.registerCommand({id:Yzt,handler:a8t});class Qce extends di{constructor(e,t,i){super({id:e,title:t,f1:!0,category:la.File,precondition:TTt}),this.newReadonlyState=i}async run(e){const t=e.get(ti),i=e.get(bd),n=Pa.getOriginalUri(t.activeEditor,{supportSideBySide:Us.PRIMARY});n&&await i.updateReadonly(n,this.newReadonlyState)}}const bO=class bO extends Qce{constructor(){super(bO.ID,bO.LABEL,!0)}};bO.ID="workbench.action.files.setActiveEditorReadonlyInSession",bO.LABEL=Pe(5514,"Set Active Editor Read-only in Session");let s5e=bO;const wO=class wO extends Qce{constructor(){super(wO.ID,wO.LABEL,!1)}};wO.ID="workbench.action.files.setActiveEditorWriteableInSession",wO.LABEL=Pe(5515,"Set Active Editor Writeable in Session");let r5e=wO;const yO=class yO extends Qce{constructor(){super(yO.ID,yO.LABEL,"toggle")}};yO.ID="workbench.action.files.toggleActiveEditorReadonlyInSession",yO.LABEL=Pe(5516,"Toggle Active Editor Read-only in Session");let o5e=yO;const CO=class CO extends Qce{constructor(){super(CO.ID,CO.LABEL,"reset")}};CO.ID="workbench.action.files.resetActiveEditorReadonlyInSession",CO.LABEL=Pe(5517,"Reset Active Editor Read-only in Session");let a5e=CO;class iPe extends V{constructor(e){if(super(),this.channelName=e,this._onDidReceiveData=this._register(new I),this.onDidReceiveData=this._onDidReceiveData.event,"BroadcastChannel"in ri)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.",ou(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))};ri.addEventListener("storage",e),this._register(Ee(()=>ri.removeEventListener("storage",e)))}postData(e){this.broadcastChannel?this.broadcastChannel.postMessage(e):(localStorage.removeItem(this.channelName),localStorage.setItem(this.channelName,JSON.stringify(e)))}}let c5e=class{constructor(e,t,i,n,r,o,a,c){this.options=e,this.fileService=t,this.workspacesService=i,this.editorService=n,this.workspaceEditingService=r,this.hostService=o,this.contextService=a,this.instantiationService=c}async handleDrop(e,t,i,n,r){const o=await this.instantiationService.invokeFunction(l=>Iet(l,e));if(!o.length)return;if(await this.hostService.focus(t),this.options.allowWorkspaceOpen){const l=Oi(o.filter(d=>d.allowWorkspaceOpen&&d.resource?.scheme===pe.file).map(d=>d.resource));if(l.length>0&&await this.handleWorkspaceDrop(l))return}const a=Oi(o.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(o.map(l=>({...l,resource:l.resource,options:{...l.options,...r,pinned:!0}})),c,{validateTrust:!0}),n?.(c)}async handleWorkspaceDrop(e){const t=[],i=[];return await Promise.all(e.map(async n=>{if(Fae(n)){t.push({workspaceUri:n});return}try{const r=await this.fileService.stat(n);r.isDirectory&&(t.push({folderUri:r.resource}),i.push({uri:r.resource}))}catch{}})),t.length===0?!1:(t.length>i.length||i.length===1?await this.hostService.openWindow(t):Wy(this.contextService.getWorkspace())?await this.workspaceEditingService.addFolders(i):await this.workspaceEditingService.createAndEnterWorkspace(i),!0)}};c5e=D([_(1,Xt),_(2,RI),_(3,ti),_(4,oC),_(5,Dc),_(6,Ci),_(7,we)],c5e);function Ent(s,e,t,i){if(e.length===0||!t.dataTransfer)return;const n=s.get(Fr),r=s.get(ti),o=s.get(Xt),a=s.get(Os),c=Oi(e.map(f=>N.isUri(f)?{resource:f}:Kve(f)?N.isUri(f.editor.resource)?{resource:f.editor.resource}:void 0:f)),l=c.filter(({resource:f})=>o.hasProvider(f));{const f=jn?`\r +`+g(10047,"This action is irreversible!"),primaryButton:g(10048,"&&Replace"),type:"warning"}:ePe(vi(s[0]))}const tPe="explorer.newFile";Pe(5429,"New File...");const Snt="explorer.newFolder";Pe(5430,"New Folder...");g(5431,"Rename...");g(5432,"Delete");g(5433,"Copy");g(5434,"Paste");const Qzt=new Q("fileCopied",!1),jzt="explorer.download";g(5435,"Download...");const Yzt="explorer.upload";g(5436,"Upload...");function Jzt(s,e){e.message==="string"&&(e=e.message),s.error(Po(e,!1))}async function Xzt(s,e){s&&(s.indexOf("/")>=0||s.indexOf("\\")>=0)&&await e.refresh()}async function Zzt(s,e,t,i,n,r){let o=typeof n.resource=="string"?n.resource:TA(n.resource),a=Ft(i.resource,o);if(!(r==="disabled"&&!await t8t(e,t,a))){for(;!n.allowOverwrite&&s.findClosest(a);)r!=="disabled"&&(o=e8t(o,!!n.isDirectory,r)),a=Ft(i.resource,o);return a}}function e8t(s,e,t){if(t==="simple"){let h=s,u="";e||(u=jy(s),h=Kr(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){Jzt(this.notificationService,t)}}};DSe=D([_(2,bi),_(3,wi),_(4,Pm)],DSe);const Yre=class Yre extends DSe{get class(){return"explorer-action "+He.asClassName(ve.saveAll)}doRun(e){return this.commandService.executeCommand(ytt,{},e)}};Yre.ID="workbench.files.action.saveAllInGroup",Yre.LABEL=g(5477,"Save All in Group");let JVe=Yre;var kR;let XVe=(kR=class extends an{constructor(e,t,i){super(e,t,He.asClassName(ve.closeAll)),this.commandService=i}run(e){return this.commandService.executeCommand(Gzt,{},e)}},kR.ID="workbench.files.action.closeGroup",kR.LABEL=g(5478,"Close Group"),kR);XVe=D([_(2,bi)],XVe);const pO=class pO extends di{constructor(){super({id:pO.ID,title:pO.LABEL,f1:!0,category:la.File,metadata:{description:Pe(5480,"Moves focus to the file explorer view container.")}})}async run(e){await e.get(Mm).openPaneComposite(lzt,io.Sidebar,!0)}};pO.ID="workbench.files.action.focusFilesExplorer",pO.LABEL=Pe(5479,"Focus on Files Explorer");let ZVe=pO;const mO=class mO extends di{constructor(){super({id:mO.ID,title:mO.LABEL,f1:!0,category:la.File,metadata:{description:Pe(5482,"Reveals and selects the active file within the explorer view.")}})}async run(e){const t=e.get(bi),i=e.get(ti),n=Fa.getOriginalUri(i.activeEditor,{supportSideBySide:Us.PRIMARY});n&&t.executeCommand(UOt,n)}};mO.ID="workbench.files.action.showActiveFileInExplorer",mO.LABEL=Pe(5481,"Reveal Active File in Explorer View");let e5e=mO;const _O=class _O extends di{constructor(){super({id:_O.ID,title:_O.LABEL,f1:!0,category:la.File,precondition:kXe,metadata:{description:Pe(5484,"Opens the active file in a new window with no folders open.")}})}async run(e){const t=e.get(ti),i=e.get(Dc),n=e.get(ir),r=e.get(Xt),o=Fa.getOriginalUri(t.activeEditor,{supportSideBySide:Us.PRIMARY});o&&(r.hasProvider(o)?i.openWindow([{fileUri:o}],{forceNewWindow:!0}):n.error(g(5485,"The active editor must contain an openable resource.")))}};_O.ID="workbench.action.files.showOpenedFileInNewWindow",_O.LABEL=Pe(5483,"Open Active File in New Empty Workspace");let t5e=_O;function i8t(s,e,t,i){if(t=s8t(t),!t||t.length===0||/^\s+$/.test(t))return{content:g(5486,"A file or folder name must be provided."),severity:Ze.Error};if(t[0]==="/"||t[0]==="\\")return{content:g(5487,"A file or folder name cannot start with a slash."),severity:Ze.Error};const n=Oi(t.split(/[\\/]/)),r=e.parent;if(t!==e.name){const o=r?.getChild(t);if(o&&o!==e)return{content:g(5488,"A file or folder **{0}** already exists at this location. Please choose a different name.",t),severity:Ze.Error}}if(n.some(o=>!s.hasValidBasename(e.resource,i,o))){const o=t.replace(/\*/g,"\\*");return{content:g(5489,"The name **{0}** is not valid as a file or folder name. Please choose a different name.",n8t(o)),severity:Ze.Error}}return n.some(o=>/^\s|\s$/.test(o))?{content:g(5490,"Leading or trailing whitespace detected in file or folder name."),severity:Ze.Warning}:null}function n8t(s){return s?.length>255?`${s.substr(0,255)}...`:s}function s8t(s){return s&&(s=STe(s," "),s=qy(s,"/"),s=qy(s,"\\"),s)}const vO=class vO extends di{constructor(){super({id:vO.ID,title:vO.LABEL,f1:!0,category:la.File,metadata:{description:Pe(5492,"Opens a new diff editor with two untitled files.")}})}async run(e){await e.get(ti).openEditor({original:{resource:void 0},modified:{resource:void 0},options:{pinned:!0}})}};vO.ID="workbench.files.action.compareNewUntitledTextFiles",vO.LABEL=Pe(5491,"Compare New Untitled Text Files");let i5e=vO;const ex=class ex extends di{constructor(){super({id:ex.ID,title:ex.LABEL,f1:!0,category:la.File,keybinding:{primary:oo(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(ti),i=e.get(we),n=e.get(pn),r=e.get(Xt),o=Fa.getOriginalUri(t.activeEditor,{supportSideBySide:Us.PRIMARY}),a=`clipboardCompare${ex.SCHEME_COUNTER++}`;if(o&&(r.hasProvider(o)||o.scheme===pe.untitled)){if(!this.registrationDisposal){const d=i.createInstance(kSe);this.registrationDisposal=n.registerTextModelContentProvider(a,d)}const c=vi(o),l=g(5495,"Clipboard ↔ {0}",c);await t.openEditor({original:{resource:o.with({scheme:a})},modified:{resource:o},label:l,options:{pinned:!0}}).finally(()=>{wt(this.registrationDisposal),this.registrationDisposal=void 0})}}dispose(){wt(this.registrationDisposal),this.registrationDisposal=void 0}};ex.ID="workbench.files.action.compareWithClipboard",ex.LABEL=Pe(5493,"Compare Active File with Clipboard"),ex.SCHEME_COUNTER=0;let n5e=ex,kSe=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)}};kSe=D([_(0,gg),_(1,Di),_(2,fi)],kSe);function r8t(s,e,t){s.prompt(Ze.Error,Po(e,!1),[{label:g(5496,"Retry"),run:()=>t()}])}async function Ant(s,e){const t=s.get(yf),i=s.get(Xt),n=s.get(Te),r=s.get(bd),o=s.get(ti),a=s.get(Nm),c=s.get(wi),l=s.get(fg),d=s.get(bi),h=s.get(Cf),u=!a.isViewVisible(Vb),f=await a.openView(Vb,!0);if(u&&await Ao(500),!f){if(e)throw new Error("Open a folder or workspace first.");return d.executeCommand(QOt)}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 qce(i,n,r,v,e);v.addChild(b);const w=async C=>{try{const A=Ft(v.resource,C);C.endsWith("/")&&(e=!0),await t.applyBulkEdit([new hp(void 0,A,{folder:e})],{undoLabel:g(5497,"Create {0}",C),progressLabel:g(5498,"Creating {0}",C),confirmBeforeUndo:!0}),await Xzt(C,t),e?await t.select(A,!0):await o.openEditor({resource:A,options:{pinned:!0}})}catch(A){r8t(c,A,()=>w(C))}},y=(await l.getEnvironment())?.os??pr;await t.setEditable(b,{validationMessage:C=>i8t(h,b,C,y),onFinish:async(C,A)=>{v.removeChild(b),await t.setEditable(b,null),A&&w(C)}})}vt.registerCommand({id:tPe,handler:async s=>{await Ant(s,!1)}});vt.registerCommand({id:Snt,handler:async s=>{await Ant(s,!0)}});const o8t=async s=>{const e=s.get(yf),t=s.get(wi),i=s.get(we),n=e.getContext(!0),r=n.length?n:e.roots,o=i.createInstance(xSe);try{await o.download(r)}catch(a){throw t.error(a),a}};vt.registerCommand({id:jzt,handler:o8t});const a8t=async s=>{const e=s.get(yf),t=s.get(wi),i=s.get(we),n=e.getContext(!1),r=n.length?n[0]:e.roots[0];try{const o=await hut();o&&await i.createInstance(qZ).upload(r,o)}catch(o){throw t.error(o),o}};vt.registerCommand({id:Yzt,handler:a8t});class Qce extends di{constructor(e,t,i){super({id:e,title:t,f1:!0,category:la.File,precondition:TTt}),this.newReadonlyState=i}async run(e){const t=e.get(ti),i=e.get(bd),n=Fa.getOriginalUri(t.activeEditor,{supportSideBySide:Us.PRIMARY});n&&await i.updateReadonly(n,this.newReadonlyState)}}const bO=class bO extends Qce{constructor(){super(bO.ID,bO.LABEL,!0)}};bO.ID="workbench.action.files.setActiveEditorReadonlyInSession",bO.LABEL=Pe(5514,"Set Active Editor Read-only in Session");let s5e=bO;const wO=class wO extends Qce{constructor(){super(wO.ID,wO.LABEL,!1)}};wO.ID="workbench.action.files.setActiveEditorWriteableInSession",wO.LABEL=Pe(5515,"Set Active Editor Writeable in Session");let r5e=wO;const yO=class yO extends Qce{constructor(){super(yO.ID,yO.LABEL,"toggle")}};yO.ID="workbench.action.files.toggleActiveEditorReadonlyInSession",yO.LABEL=Pe(5516,"Toggle Active Editor Read-only in Session");let o5e=yO;const CO=class CO extends Qce{constructor(){super(CO.ID,CO.LABEL,"reset")}};CO.ID="workbench.action.files.resetActiveEditorReadonlyInSession",CO.LABEL=Pe(5517,"Reset Active Editor Read-only in Session");let a5e=CO;class iPe extends V{constructor(e){if(super(),this.channelName=e,this._onDidReceiveData=this._register(new I),this.onDidReceiveData=this._onDidReceiveData.event,"BroadcastChannel"in ri)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.",ou(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))};ri.addEventListener("storage",e),this._register(Ee(()=>ri.removeEventListener("storage",e)))}postData(e){this.broadcastChannel?this.broadcastChannel.postMessage(e):(localStorage.removeItem(this.channelName),localStorage.setItem(this.channelName,JSON.stringify(e)))}}let c5e=class{constructor(e,t,i,n,r,o,a,c){this.options=e,this.fileService=t,this.workspacesService=i,this.editorService=n,this.workspaceEditingService=r,this.hostService=o,this.contextService=a,this.instantiationService=c}async handleDrop(e,t,i,n,r){const o=await this.instantiationService.invokeFunction(l=>Iet(l,e));if(!o.length)return;if(await this.hostService.focus(t),this.options.allowWorkspaceOpen){const l=Oi(o.filter(d=>d.allowWorkspaceOpen&&d.resource?.scheme===pe.file).map(d=>d.resource));if(l.length>0&&await this.handleWorkspaceDrop(l))return}const a=Oi(o.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(o.map(l=>({...l,resource:l.resource,options:{...l.options,...r,pinned:!0}})),c,{validateTrust:!0}),n?.(c)}async handleWorkspaceDrop(e){const t=[],i=[];return await Promise.all(e.map(async n=>{if(Fae(n)){t.push({workspaceUri:n});return}try{const r=await this.fileService.stat(n);r.isDirectory&&(t.push({folderUri:r.resource}),i.push({uri:r.resource}))}catch{}})),t.length===0?!1:(t.length>i.length||i.length===1?await this.hostService.openWindow(t):Wy(this.contextService.getWorkspace())?await this.workspaceEditingService.addFolders(i):await this.workspaceEditingService.createAndEnterWorkspace(i),!0)}};c5e=D([_(1,Xt),_(2,RI),_(3,ti),_(4,oC),_(5,Dc),_(6,Ci),_(7,we)],c5e);function Ent(s,e,t,i){if(e.length===0||!t.dataTransfer)return;const n=s.get(Fr),r=s.get(ti),o=s.get(Xt),a=s.get(Os),c=Oi(e.map(f=>N.isUri(f)?{resource:f}:Kve(f)?N.isUri(f.editor.resource)?{resource:f.editor.resource}:void 0:f)),l=c.filter(({resource:f})=>o.hasProvider(f));{const f=jn?`\r `:` -`;t.dataTransfer.setData(ap.TEXT,l.map(({resource:m})=>a.getUriLabel(m,{noPrefix:!0})).join(f));const p=l.find(({isDirectory:m})=>!m);if(p){const m=sf.uriToFileUri(p.resource);m.scheme===pe.file&&t.dataTransfer.setData(ap.DOWNLOAD_URL,[Vs.binary,vi(p.resource),m.toString()].join(":"))}}const d=l.filter(({isDirectory:f})=>!f);d.length&&t.dataTransfer.setData(ap.RESOURCES,JSON.stringify(d.map(({resource:f})=>f.toString())));const h=je.as(JMe.DragAndDropContribution).getAll();for(const f of h)f.setData(c,t);const u=[];for(const f of e){let p;if(Kve(f)){const m=f.editor.toUntyped({preserveViewState:f.groupId});m&&(p={...m,resource:Pa.getCanonicalUri(m)})}else if(N.isUri(f)){const{selection:m,uri:v}=bRe(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 r.visibleEditorPanes)if(Yi(b.input.resource,m)){const w=b.getViewState();if(w)return w}})()})}}u.push(p)}}if(u.length){t.dataTransfer.setData(UM.EDITORS,CYe(u));const f=[];for(const p of u)p.resource?f.push(p.resource):k_(p)?p.modified.resource&&f.push(p.modified.resource):RS(p)?p.primary.resource&&f.push(p.primary.resource):Ab(p)&&f.push(p.result.resource);t.dataTransfer.setData(Vs.uriList,rI.create(f.slice(0,1))),t.dataTransfer.setData(ap.INTERNAL_URI_LIST,rI.create(f))}}class c8t{constructor(e,t){this.type=e,this.id=t}update(e){}getData(){return{type:this.type,id:this.id}}}class R4{constructor(e){this.compositeId=e}get id(){return this.compositeId}}class M4{constructor(e){this.viewId=e}get id(){return this.viewId}}class _S extends V{static get INSTANCE(){return _S.instance||(_S.instance=new _S,L2(_S.instance)),_S.instance}constructor(){super(),this.transferData=DX.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"?M4.prototype:R4.prototype)}))}readDragData(e){if(this.transferData.hasData(e==="view"?M4.prototype:R4.prototype)){const t=this.transferData.getData(e==="view"?M4.prototype:R4.prototype);if(t&&t[0])return new c8t(e,t[0].id)}}writeDragData(e,t){this.transferData.setData([t==="view"?new M4(e):new R4(e)],t==="view"?M4.prototype:R4.prototype)}registerTarget(e,t){const i=new Z;return i.add(new nY(e,{onDragEnter:n=>{if(n.preventDefault(),t.onDragEnter){const r=this.readDragData("composite")||this.readDragData("view");r&&t.onDragEnter({eventData:n,dragAndDropData:r})}},onDragLeave:n=>{const r=this.readDragData("composite")||this.readDragData("view");t.onDragLeave&&r&&t.onDragLeave({eventData:n,dragAndDropData:r})},onDrop:n=>{if(t.onDrop){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;t.onDrop({eventData:n,dragAndDropData:r}),this.onDragEnd.fire({eventData:n,dragAndDropData:r})}},onDragOver:n=>{if(n.preventDefault(),t.onDragOver){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;t.onDragOver({eventData:n,dragAndDropData:r})}}})),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 nY(e,{onDragStart:r=>{const{id:o,type:a}=t();this.writeDragData(o,a),r.dataTransfer?.setDragImage(e,0,0),this.onDragStart.fire({eventData:r,dragAndDropData:this.readDragData(a)})},onDragEnd:r=>{const{type:o}=t(),a=this.readDragData(o);a&&this.onDragEnd.fire({eventData:r,dragAndDropData:a})},onDragEnter:r=>{if(i.onDragEnter){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;o&&i.onDragEnter({eventData:r,dragAndDropData:o})}},onDragLeave:r=>{const o=this.readDragData("composite")||this.readDragData("view");o&&i.onDragLeave?.({eventData:r,dragAndDropData:o})},onDrop:r=>{if(i.onDrop){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;i.onDrop({eventData:r,dragAndDropData:o}),this.onDragEnd.fire({eventData:r,dragAndDropData:o})}},onDragOver:r=>{if(i.onDragOver){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;i.onDragOver({eventData:r,dragAndDropData:o})}}})),i.onDragStart&&this.onDragStart.event(r=>{i.onDragStart(r)},this,n),i.onDragEnd&&this.onDragEnd.event(r=>{i.onDragEnd(r)},this,n),this._register(n)}}function l5e(s,e,t){s&&(s.dropEffect=t?e:"none")}let d5e=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=Oi(e.map(this.toResource));return t.length===1?vi(t[0]):t.length>1?String(t.length):void 0}onDragStart(e,t){const i=[];for(const n of e.elements){const r=this.toResource(n);r&&i.push(r)}i.length&&this.instantiationService.invokeFunction(n=>Ent(n,i,t))}onDragOver(e,t,i,n,r){return!1}drop(e,t,i,n,r){}dispose(){}};d5e=D([_(1,we)],d5e);const Jre=class Jre extends V{constructor(){super(),this.broadcaster=this._register(new iPe(Jre.CHANNEL_NAME)),this.draggedOver=!1,this.registerListeners()}registerListeners(){this._register(M.runAndSubscribe(sm,({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:ri,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))}};Jre.CHANNEL_NAME="monaco-workbench-global-dragged-over";let ISe=Jre;new ISe;class l8t{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(o=>o);let n=!1,r="";for(let o=0;othis.gitignoreLineToGlob(o,t)),r=Object.create(null);for(const o of n)r[o]=!0;return X_(r,{trimForExclusions:i})}parseIgnoreFile(e,t,i){const n=e.split(` -`).map(m=>m.trim()).filter(m=>m&&m[0]!=="#"),r=n.filter(m=>!m.endsWith("/")),o=r.filter(m=>!m.includes("!")),a=this.gitignoreLinesToExpression(o,t,!0),c=r.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 TSe;(function(s){s.FileContributionRegistry="workbench.registry.explorer.fileContributions"})(TSe||(TSe={}));class d8t{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 r=n.create(e,t);return i.add(r),r})}}const LSe=new d8t;je.add(TSe.FileContributionRegistry,LSe);var RSe,Ev;const Xre=class Xre{getHeight(e){return Xre.ITEM_HEIGHT}getTemplateId(e){return YZ.ID}};Xre.ITEM_HEIGHT=22;let QZ=Xre;const MSe=new I;let NSe=class{constructor(e,t,i,n,r,o,a,c,l){this.fileFilter=e,this.progressService=t,this.configService=i,this.notificationService=n,this.layoutService=r,this.fileService=o,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 r=n.then(o=>(e instanceof qd&&e.isRoot&&!e.error&&t&&this.contextService.getWorkbenchState()!==Qi.FOLDER&&MSe.fire(e.resource),o),o=>{if(e instanceof qd&&e.isRoot)if(this.contextService.getWorkbenchState()===Qi.FOLDER){const a=new qd(e.resource,this.fileService,this.configService,this.filesConfigService,void 0,void 0,!1);return a.error=o,[a]}else MSe.fire(e.resource);else this.notificationService.error(o);return[]});return this.progressService.withProgress({location:fd.Explorer,delay:this.layoutService.isRestored()?800:1500},o=>r),r}};NSe=D([_(1,hg),_(2,Te),_(3,wi),_(4,NI),_(5,Xt),_(6,yf),_(7,Ci),_(8,bd)],NSe);const OFe=class OFe{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,r){this.id=e,this.items=t,this.depth=n,this.collapsed=r,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 RSe.ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));t.add(i.onDidRender(()=>{try{r.currentContext&&this.updateWidth(r.currentContext)}catch{}}));const n=LSe.create(this.instantiationService,e,t);t.add(LSe.onDidRegisterDescriptor(o=>{const a=o.create(this.instantiationService,e);n.push(t.add(a)),a.setResource(r.currentContext?.resource)}));const r={templateDisposables:t,elementDisposables:t.add(new Z),label:i,container:e,contribs:n};return r}renderElement(e,t,i){const n=e.element;i.currentContext=n;const r=this.explorerService.getEditableData(n);i.label.element.classList.remove("compressed"),r?(i.label.element.style.display="none",i.contribs.forEach(o=>o.setResource(void 0)),i.elementDisposables.add(this.renderInputBox(i.container,n,r))):(i.label.element.style.display="flex",this.renderStat(n,n.name,void 0,e.filterData,i))}renderCompressedElements(e,t,i,n){const r=e.element.elements[e.element.elements.length-1];i.currentContext=r;const o=e.element.elements.filter(c=>this.explorerService.isEditable(c)),a=o.length===0?void 0:this.explorerService.getEditableData(o[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,o[0],a));else{i.label.element.classList.add("compressed"),i.label.element.style.display="flex";const c=`compressed-explorer_${jZ.ID++}`,l=e.element.elements.map(u=>u.name);this.renderStat(r,l,c,e.filterData,i);const d=new jZ(c,e.element.elements,i,e.depth,e.collapsed);i.elementDisposables.add(d);const h=this.compressedNavigationControllers.get(r)??[];this.compressedNavigationControllers.set(r,[...h,d]),i.elementDisposables.add(this._onDidChangeActiveDescendant.add(d.onDidChange)),i.elementDisposables.add(ue(i.container,"mousedown",u=>{const f=JZ(u.target);f&&d.setIndex(f.index)})),i.elementDisposables.add(Ee(()=>{const u=this.compressedNavigationControllers.get(r)??[],f=u.findIndex(p=>p===d);if(f<0)throw new Error("Disposing unknown navigation controller");u.length===1?this.compressedNavigationControllers.delete(r):u.splice(f,1)}))}}renderStat(e,t,i,n,r){r.label.element.style.display="flex";const o=["explorer-item"];this.explorerService.isCut(e)&&o.push("cut");const a=this.themeService.getFileIconTheme();r.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;r.contribs.forEach(h=>h.setResource(e.resource)),r.label.setResource({resource:e.resource,name:t},{fileKind:e.isRoot?wa.ROOT_FOLDER:e.isDirectory?wa.FOLDER:wa.FILE,extraClasses:d?[...o,"align-nest-icon-with-parent-icon"]:o,fileDecorations:this.config.explorer.decorations,matches:NU(n),separator:this.labelService.getSeparator(e.resource.scheme,e.resource.authority),domId:i})}renderInputBox(e,t,i){const n=this.labels.create(e),r=["explorer-item","explorer-item-edited"],o=t.isRoot?wa.ROOT_FOLDER:t.isDirectory?wa.FOLDER:wa.FILE,a=this.themeService.getFileIconTheme(),c=a.hasFileIcons&&(a.hidesExplorerArrows||!a.hasFolderIcons),l=t.nestedParent&&c,d={hidePath:!0,hideLabel:!0,fileKind:o,extraClasses:l?[...r,"align-nest-icon-with-parent-icon"]:r},h=t.name?Ro(t.resource):t.resource,u=t.name||"";n.setFile(Ft(h,u||" "),d),n.element.firstElementChild.style.display="none";const f=new CJe(n.element,this.contextViewService,{validationOptions:{validation:y=>{const C=i.validationMessage(y);return!C||C.severity!==Ze.Error?null:{content:C.content,formatContent:!0,type:ed.ERROR}}},ariaLabel:g(11261,"Type file name. Press Enter to confirm or Escape to cancel."),inputBoxStyles:LM}),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=fm((y,C)=>{n.element.style.display="none";const A=f.value;wt(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===Ze.Info?ed.INFO:y.severity===Ze.Warning?ed.WARNING:ed.ERROR}):f.hideMessage()}};b();const w=[f,f.onDidChange(y=>{n.setFile(Ft(h,y||" "),d)}),Rr(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)}),Rr(f.inputElement,ke.KEY_UP,y=>{b()}),ue(f.inputElement,ke.BLUR,async()=>{for(;;){await Ao(0);const y=f.inputElement.ownerDocument;if(!y.hasFocus())break;if(dv(f.inputElement))return;if(Jo(y.activeElement)&&kq(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()}},RSe=IR,IR.ID="file",IR);YZ=RSe=D([_(3,bf),_(4,mn),_(5,Te),_(6,yf),_(7,Os),_(8,Ci),_(9,lo),_(10,we)],YZ);let PSe=class{constructor(e,t,i,n,r,o){this.contextService=e,this.configurationService=t,this.explorerService=i,this.editorService=n,this.uriIdentityService=r,this.fileService=o,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,Tr.UPDATED)&&await this.processIgnoreFile(c,d,!0),a.contains(d,Tr.DELETED)&&(this.ignoreTreesPerRoot.get(c)?.delete(Ro(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}),r=n?.files?.exclude||Object.create(null),o=n.explorer.excludeGitIgnore;if(o&&!this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.set(i.uri.toString(),new Mk),this.ignoreTreesPerRoot.set(i.uri.toString(),Ih.forUris(c=>this.uriIdentityService.extUri.ignorePathCasing(c)))),!o&&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||!Js(c.original,r)}const a=Ds(r);this.hiddenExpressionPerRoot.set(i.uri.toString(),{original:a,parsed:X_(a)})}),(e||t)&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())}async processIgnoreFile(e,t,i){const n=Ro(t),r=this.ignoreTreesPerRoot.get(e);if(!r||!i&&r.has(n))return;const o=await this.fileService.readFile(t);if(i)r.get(n)?.updateContents(o.value.toString());else{const a=r.findSubstr(n),c=new l8t(o.value.toString(),n.path,a);r.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(P2(e.root.resource.path,e.resource.path),e.name,c=>!!(e.parent&&e.parent.getChild(c))),o=(n?void 0:this.ignoreTreesPerRoot.get(e.root.resource.toString())?.findSubstr(e.resource))?.isPathIncludedInTraversal(e.resource.path,e.isDirectory);if((o===void 0?!1:!o)||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(){wt(this.toDispose)}};PSe=D([_(0,Ci),_(1,Te),_(2,yf),_(3,ti),_(4,Is),_(5,Xt)],PSe);let FSe=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 r,o;switch(n){case"upper":r=gIt,o=_It;break;case"lower":r=fIt,o=vIt;break;case"unicode":r=pIt,o=bIt;break;default:r=uIt,o=mIt}switch(i){case"type":if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;if(e.isDirectory&&t.isDirectory)return r(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 o(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,r){if(!this.dropEnabled)return!1;if(t){const o=Ev.getCompressedStatFromDragEvent(t,r);if(o){const a=JZ(r.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,r)}handleDragOver(e,t,i,n,r){const o=r&&(r.ctrlKey&&!jt||r.altKey&&jt),a=e instanceof y_e,l={type:a||o?F1.Copy:F1.Move,position:Sy.Over};if(a){if(!Tet(r,ap.FILES,UM.FILES,ap.RESOURCES))return!1}else{if(e instanceof zYe)return!1;{const d=Ev.getStatsFromDragAndDropData(e),h=d.every(u=>u.isRoot);if(!t)return!o&&d.every(u=>!!u.parent&&u.parent.isRoot)?!1:h?{accept:!0,effect:{type:F1.Move,position:Sy.After}}:{accept:!0,bubble:W1.Down,effect:l,autoExpand:!1};if(!Array.isArray(d)||!o&&d.every(u=>u.isReadonly)||d.some(u=>u.isRoot?!1:!!(this.uriIdentityService.extUri.isEqual(u.resource,t.resource)||!o&&this.uriIdentityService.extUri.isEqual(Ro(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 MC.TOP:case MC.CENTER_TOP:u=Sy.Before;break;case MC.CENTER_BOTTOM:case MC.BOTTOM:u=Sy.After;break}return{accept:!0,effect:{type:F1.Move,position:u}}}}}if(t){if(t.isDirectory)return t.isReadonly?!1:{accept:!0,bubble:W1.Down,effect:l,autoExpand:!0};if(this.contextService.getWorkspace().folders.every(d=>d.uri.toString()!==t.resource.toString()))return{accept:!0,bubble:W1.Up,effect:l}}else return{accept:!0,bubble:W1.Down,effect:l};return!1}getDragURI(e){return this.explorerService.isEditable(e)?null:e.resource.toString()}getDragLabel(e,t){return e.length===1?Ev.getCompressedStatFromDragEvent(e[0],t).name:String(e.length)}onDragStart(e,t){const i=Ev.getStatsFromDragAndDropData(e,t);if(i&&i.length&&t.dataTransfer){this.instantiationService.invokeFunction(r=>Ent(r,i,t));const n=i.filter(r=>r.resource.scheme===pe.file).map(r=>r.resource.fsPath);n.length&&t.dataTransfer.setData(UM.FILES,JSON.stringify(n))}}async drop(e,t,i,n,r){if(this.compressedDropTargetDisposable.dispose(),t){const a=Ev.getCompressedStatFromDragEvent(t,r);a&&(t=a)}if(t||(t=this.explorerService.roots[this.explorerService.roots.length-1],n=MC.BOTTOM),!t.isDirectory&&t.parent&&(t=t.parent),t.isReadonly)return;const o=t;if(o)try{e instanceof y_e?!Hn||Wy(this.contextService.getWorkspace())&&Zp.supported(ri)?await this.instantiationService.createInstance(ESe).import(o,r,ri):await this.instantiationService.createInstance(qZ).upload(t,r):await this.handleExplorerDrop(e,o,i,n,r)}catch(a){this.dialogService.error(Po(a))}}async handleExplorerDrop(e,t,i,n,r){const o=Ev.getStatsFromDragAndDropData(e),a=new Map(o.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=Jdt([...a.keys()],u=>u.resource),l=r.ctrlKey&&!jt||r.altKey&&jt;if(!l&&this.configurationService.getValue(Ev.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)?gnt(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(Ev.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 r;const o=[],a=[],c=[];for(let l=0;lh.resource.toString()!==n[l].uri.toString())?a.push(d):c.push(d)}if(r===void 0)r=a.length;else{switch(i){case MC.BOTTOM:case MC.CENTER_BOTTOM:r++;break}for(const l of o)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(o)}async doHandleExplorerDropOnMove(e,t){const i=e.filter(o=>!o.isReadonly).map(o=>new hp(o.resource,Ft(t.resource,o.name))),n=h5e(e),r={confirmBeforeUndo:this.configurationService.getValue().explorer.confirmUndo===BT.Verbose,undoLabel:g(11270,"Move {0}",n),progressLabel:g(11271,"Moving {0}",n)};try{await this.explorerService.applyBulkEdit(i,r)}catch(o){if(o.fileOperationResult===ji.FILE_MOVE_CONFLICT){const a=[];for(const d of i)d.newResource&&await this.fileService.exists(d.newResource)&&a.push(d.newResource);const c=qzt(a),{confirmed:l}=await this.dialogService.confirm(c);l&&await this.explorerService.applyBulkEdit(i.map(d=>new hp(d.oldResource,d.newResource,{overwrite:!0})),r)}else throw o}}static getStatsFromDragAndDropData(e,t){return e.context?e.context:t&&e.elements.length===1?(e.context=[Ev.getCompressedStatFromDragEvent(e.elements[0],t)],e.context):e.elements}static getCompressedStatFromDragEvent(e,t){const i=lt(t).document.elementFromPoint(t.clientX,t.clientY),n=JZ(i);if(n){const{count:r,index:o}=n;let a=r-1;for(;a>o&&e.parent;)e=e.parent,a--;return e}return e}onDragEnd(){this.compressedDropTargetDisposable.dispose()}dispose(){this.compressedDropTargetDisposable.dispose()}},Ev=TR,TR.CONFIRM_DND_SETTING_KEY="explorer.confirmDragAndDrop",TR);OSe=Ev=D([_(1,yf),_(2,ti),_(3,ir),_(4,Ci),_(5,Xt),_(6,Te),_(7,we),_(8,oC),_(9,Is)],OSe);function JZ(s){if(!Jo(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(dc(t)&&dc(i))return{element:e,count:t,index:i}}e=e.parentElement}return null}function h8t(s){return!!JZ(s)}class u8t{isIncompressible(e){return e.isRoot||!e.isDirectory||e instanceof qce||!e.parent||e.parent.isRoot}}function h5e(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 g8t(s){if(s.isRoot&&s.error)return{tooltip:g(11256,"Unable to resolve workspace folder ({0})",Po(s.error)),letter:"!",color:Pmt};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:Hmt}}let BSe=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(MSe.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 g8t(t)}dispose(){this.toDispose.dispose()}};BSe=D([_(0,yf),_(1,Ci)],BSe);var f8t=".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}";gt(f8t,{});var p8t=".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}";gt(p8t,{});const r8=class r8 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?r8.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"?pi.VERTICAL:e.orientation,this._ariaHeaderLabel=g(9986,"{0} Section",e.title),this._minimumBodySize=typeof e.minimumBodySize=="number"?e.minimumBodySize:this._orientation===pi.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"&<(this.element).clearTimeout(this.animationTimer),oe(this.element,this.body)):this.animationTimer=lt(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===pi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===pi.VERTICAL)),this.header&&this.updateHeader())}render(){this.element.classList.toggle("expanded",this.isExpanded()),this.element.classList.toggle("horizontal",this.orientation===pi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===pi.VERTICAL),this.header=fe(".pane-header"),oe(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=Ec(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 ni(this.header,"keydown")),n=M.map(i.event,r=>new xn(r),t);this._register(M.filter(n,r=>r.keyCode===S.Enter||r.keyCode===S.Space,t)(()=>this.setExpanded(!this.isExpanded()),null)),this._register(M.filter(n,r=>r.keyCode===S.LeftArrow,t)(()=>this.setExpanded(!1),null)),this._register(M.filter(n,r=>r.keyCode===S.RightArrow,t)(()=>this.setExpanded(!0),null)),this._register(md.addTarget(this.header)),[ke.CLICK,ur.Tap].forEach(r=>{this._register(ue(this.header,r,o=>{o.defaultPrevented||this.setExpanded(!this.isExpanded())}))}),this.body=oe(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?r8.HEADER_SIZE:0,i=this._orientation===pi.VERTICAL?this.orthogonalSize:e,n=this._orientation===pi.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===pi.VERTICAL?`1px solid ${this.styles.headerBorder}`:"",this.element.style.borderLeft=this.styles.leftBorder&&this.orientation===pi.HORIZONTAL?`1px solid ${this.styles.leftBorder}`:""}};r8.HEADER_SIZE=22;let WSe=r8;const Zre=class Zre 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",lf&&e.dataTransfer?.setData(ap.TEXT,this.pane.draggableElement.textContent||"");const t=oe(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&&(tn.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??Zre.DefaultDragOverBackgroundColor.toString()),this.pane.dropTargetElement.style.backgroundColor=e||""}};Zre.DefaultDragOverBackgroundColor=new me(new hn(128,128,128,.5));let HSe=Zre;class m8t 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??pi.VERTICAL,this.element=oe(e,fe(".monaco-pane-view")),this.splitview=this._register(new T3(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 ni(this.element,"keydown")),r=M.map(M.filter(n.event,o=>Jo(o.target)&&o.target.classList.contains("pane-header"),i),o=>new xn(o),i);this._register(M.filter(r,o=>o.keyCode===S.UpArrow,i)(()=>this.focusPrevious())),this._register(M.filter(r,o=>o.keyCode===S.DownArrow,i)(()=>this.focusNext()))}addPane(e,t,i=this.splitview.length){const n=new Z;e.onDidChangeExpansionState(this.setupAnimation,this,n);const r={pane:e,disposable:n};if(this.paneItems.splice(i,0,r),e.orientation=this.orientation,e.orthogonalSize=this.orthogonalSize,this.splitview.addView(e,t,i),this.dnd){const o=new HSe(e,this.dnd,this.dndContext);n.add(o),n.add(o.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()?Xk.Distribute:void 0),this.paneItems.splice(t,1)[0].disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(o=>o.pane===e),n=this.paneItems.findIndex(o=>o.pane===t);if(i===-1||n===-1)return;const[r]=this.paneItems.splice(i,1);this.paneItems.splice(n,0,r),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===pi.VERTICAL?t:e,this.size=this.orientation===pi.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===pi.VERTICAL?(this.splitview.orthogonalStartSash=e?.left,this.splitview.orthogonalEndSash=e?.right):this.splitview.orthogonalEndSash=e?.bottom}flipOrientation(e,t){this.orientation=this.orientation===pi.VERTICAL?pi.HORIZONTAL:pi.VERTICAL;const i=this.paneItems.map(o=>this.getPaneSize(o.pane));this.splitview.dispose(),Ns(this.element),this.splitview=this._register(new T3(this.element,{orientation:this.orientation})),this.updateSplitviewOrthogonalSashes(this.boundarySashes);const n=this.orientation===pi.VERTICAL?t:e,r=this.orientation===pi.HORIZONTAL?t:e;this.paneItems.forEach((o,a)=>{o.pane.orthogonalSize=n,o.pane.orientation=this.orientation;const c=this.size===0?0:r*i[a]/this.size;this.splitview.addView(o.pane,c,a)}),this.size=r,this.orthogonalSize=n,this.splitview.layout(this.size)}setupAnimation(){typeof this.animationTimer=="number"&<(this.element).clearTimeout(this.animationTimer),this.element.classList.add("animated"),this.animationTimer=lt(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(r,o,a){this.whilePromise=r,this.whileStart=o,this.whileDelay=a,this.type=e.While}}s.While=t;class i{constructor(r,o){this.total=r,this.worked=o,this.type=e.Work}}s.Work=i})(Qc||(Qc={}));class _8t 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 v8t 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 b8t 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=[],vC(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 Ny&&!t[n.item.submenu.id]){const r=t[n.item.submenu.id]=i.add(this.menuService.createMenu(n.item.submenu,this.contextKeyService));i.add(r.onDidChange(()=>this.updateActions())),i.add(this.updateSubmenus(n.actions,t))}return i}}let XZ=class extends V{constructor(e,t,i,n,r){super(),this.menuId=e,this.contextMenuId=t,this.options=i,this.contextKeyService=n,this.menuService=r,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.menuActions=this._register(new b8t(e,this.options,r,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);vC(t,{primary:[],secondary:e})}return e}};XZ=D([_(3,Le),_(4,Ba)],XZ);const xnt=new _e("menu.view.filter"),jce=new _e("submenu.view.filter");Yn.appendMenuItem(xnt,{submenu:jce,title:g(5623,"More Filters..."),group:"navigation",icon:ve.filter});class w8t extends E3{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 USe=class extends _d{get onDidFocus(){return this.focusTracker.onDidFocus}get onDidBlur(){return this.focusTracker.onDidBlur}constructor(e,t,i,n,r){super(),this.options=e,this.instantiationService=t,this.contextViewService=i,this.keybindingService=r,this._onDidChangeFilterText=this._register(new I),this.onDidChangeFilterText=this._onDidChangeFilterText.event,this.isMoreFiltersChecked=!1,this.delayedFilterUpdate=new Ph(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 o=oe(this.element,fe(".viewpane-filter-controls"));this.filterBadge=this.createBadge(o),this.toolbar=this._register(this.createToolBar(o)),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(pX,e,this.contextViewService,{placeholder:this.options.placeholder,ariaLabel:this.options.ariaLabel,history:this.options.history||[],showHistoryHint:()=>iZ(this.keybindingService),inputBoxStyles:LM}));this.options.text&&(t.value=this.options.text),this._register(t.onDidChange(n=>this.delayedFilterUpdate.trigger(()=>this.onDidInputChange(t)))),this._register(Rr(t.inputElement,ke.KEY_DOWN,n=>this.onInputKeyDown(n,t))),this._register(Rr(e,ke.KEY_DOWN,this.handleKeyboardEvent)),this._register(Rr(e,ke.KEY_UP,this.handleKeyboardEvent)),this._register(Rr(t.inputElement,ke.CLICK,n=>{n.stopPropagation(),n.preventDefault()}));const i=this._register(Ec(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=oe(e,fe(".viewpane-filter-badge.hidden"));return t.style.backgroundColor=$e(DT),t.style.color=$e(dae),t.style.border=`1px solid ${$e(yt)}`,t}createToolBar(e){return this.instantiationService.createInstance(Cm,e,xnt,{hiddenItemStrategy:hA.NoHide,actionViewItemProvider:(t,i)=>{if(t instanceof Ny&&t.item.submenu.id===jce.id)return this.moreFiltersActionViewItem=this.instantiationService.createInstance(w8t,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())}};USe=D([_(1,we),_(2,bf),_(3,Le),_(4,Vt)],USe);var VSe,nz;(function(s){s[s.Default=0]="Default",s[s.WhenExpanded=1]="WhenExpanded",s[s.Always=2]="Always"})(nz||(nz={}));const u5e=new an("viewpane.action.filter"),y8t=oi("view-pane-container-expanded",ve.chevronDown,g(5342,"Icon for an expanded view pane container.")),C8t=oi("view-pane-container-collapsed",ve.chevronRight,g(5343,"Icon for a collapsed view pane container.")),g5e=je.as(oI.ViewsRegistry);let zSe=class{get enabled(){return this._enabled}constructor(e,t,i,n,r,o,a){this.container=e,this.delegate=t,this.instantiationService=i,this.openerService=n,this.telemetryService=r,this.contextKeyService=o,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=oe(this.container,fe(".welcome-view"));this.element=fe(".welcome-view-content",{tabIndex:0}),this.scrollableElement=new MU(this.element,{alwaysConsumeMouseWheel:!0,horizontal:Cr.Hidden,vertical:Cr.Visible}),oe(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(g5e.onDidChangeViewWelcomeContent,i=>i.filter(n=>n===this.delegate.id))(this.onDidChangeViewWelcomeContent,this,this.enabledDisposables),this.onDidChangeViewWelcomeContent()}onDidChangeViewWelcomeContent(){const e=g5e.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(` +`;t.dataTransfer.setData(ap.TEXT,l.map(({resource:m})=>a.getUriLabel(m,{noPrefix:!0})).join(f));const p=l.find(({isDirectory:m})=>!m);if(p){const m=sf.uriToFileUri(p.resource);m.scheme===pe.file&&t.dataTransfer.setData(ap.DOWNLOAD_URL,[Vs.binary,vi(p.resource),m.toString()].join(":"))}}const d=l.filter(({isDirectory:f})=>!f);d.length&&t.dataTransfer.setData(ap.RESOURCES,JSON.stringify(d.map(({resource:f})=>f.toString())));const h=je.as(JMe.DragAndDropContribution).getAll();for(const f of h)f.setData(c,t);const u=[];for(const f of e){let p;if(Kve(f)){const m=f.editor.toUntyped({preserveViewState:f.groupId});m&&(p={...m,resource:Fa.getCanonicalUri(m)})}else if(N.isUri(f)){const{selection:m,uri:v}=bRe(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 r.visibleEditorPanes)if(Yi(b.input.resource,m)){const w=b.getViewState();if(w)return w}})()})}}u.push(p)}}if(u.length){t.dataTransfer.setData(UM.EDITORS,CYe(u));const f=[];for(const p of u)p.resource?f.push(p.resource):k_(p)?p.modified.resource&&f.push(p.modified.resource):RS(p)?p.primary.resource&&f.push(p.primary.resource):Ab(p)&&f.push(p.result.resource);t.dataTransfer.setData(Vs.uriList,rI.create(f.slice(0,1))),t.dataTransfer.setData(ap.INTERNAL_URI_LIST,rI.create(f))}}class c8t{constructor(e,t){this.type=e,this.id=t}update(e){}getData(){return{type:this.type,id:this.id}}}class R4{constructor(e){this.compositeId=e}get id(){return this.compositeId}}class M4{constructor(e){this.viewId=e}get id(){return this.viewId}}class _S extends V{static get INSTANCE(){return _S.instance||(_S.instance=new _S,L2(_S.instance)),_S.instance}constructor(){super(),this.transferData=DX.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"?M4.prototype:R4.prototype)}))}readDragData(e){if(this.transferData.hasData(e==="view"?M4.prototype:R4.prototype)){const t=this.transferData.getData(e==="view"?M4.prototype:R4.prototype);if(t&&t[0])return new c8t(e,t[0].id)}}writeDragData(e,t){this.transferData.setData([t==="view"?new M4(e):new R4(e)],t==="view"?M4.prototype:R4.prototype)}registerTarget(e,t){const i=new Z;return i.add(new nY(e,{onDragEnter:n=>{if(n.preventDefault(),t.onDragEnter){const r=this.readDragData("composite")||this.readDragData("view");r&&t.onDragEnter({eventData:n,dragAndDropData:r})}},onDragLeave:n=>{const r=this.readDragData("composite")||this.readDragData("view");t.onDragLeave&&r&&t.onDragLeave({eventData:n,dragAndDropData:r})},onDrop:n=>{if(t.onDrop){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;t.onDrop({eventData:n,dragAndDropData:r}),this.onDragEnd.fire({eventData:n,dragAndDropData:r})}},onDragOver:n=>{if(n.preventDefault(),t.onDragOver){const r=this.readDragData("composite")||this.readDragData("view");if(!r)return;t.onDragOver({eventData:n,dragAndDropData:r})}}})),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 nY(e,{onDragStart:r=>{const{id:o,type:a}=t();this.writeDragData(o,a),r.dataTransfer?.setDragImage(e,0,0),this.onDragStart.fire({eventData:r,dragAndDropData:this.readDragData(a)})},onDragEnd:r=>{const{type:o}=t(),a=this.readDragData(o);a&&this.onDragEnd.fire({eventData:r,dragAndDropData:a})},onDragEnter:r=>{if(i.onDragEnter){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;o&&i.onDragEnter({eventData:r,dragAndDropData:o})}},onDragLeave:r=>{const o=this.readDragData("composite")||this.readDragData("view");o&&i.onDragLeave?.({eventData:r,dragAndDropData:o})},onDrop:r=>{if(i.onDrop){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;i.onDrop({eventData:r,dragAndDropData:o}),this.onDragEnd.fire({eventData:r,dragAndDropData:o})}},onDragOver:r=>{if(i.onDragOver){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;i.onDragOver({eventData:r,dragAndDropData:o})}}})),i.onDragStart&&this.onDragStart.event(r=>{i.onDragStart(r)},this,n),i.onDragEnd&&this.onDragEnd.event(r=>{i.onDragEnd(r)},this,n),this._register(n)}}function l5e(s,e,t){s&&(s.dropEffect=t?e:"none")}let d5e=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=Oi(e.map(this.toResource));return t.length===1?vi(t[0]):t.length>1?String(t.length):void 0}onDragStart(e,t){const i=[];for(const n of e.elements){const r=this.toResource(n);r&&i.push(r)}i.length&&this.instantiationService.invokeFunction(n=>Ent(n,i,t))}onDragOver(e,t,i,n,r){return!1}drop(e,t,i,n,r){}dispose(){}};d5e=D([_(1,we)],d5e);const Jre=class Jre extends V{constructor(){super(),this.broadcaster=this._register(new iPe(Jre.CHANNEL_NAME)),this.draggedOver=!1,this.registerListeners()}registerListeners(){this._register(M.runAndSubscribe(sm,({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:ri,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))}};Jre.CHANNEL_NAME="monaco-workbench-global-dragged-over";let ISe=Jre;new ISe;class l8t{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(o=>o);let n=!1,r="";for(let o=0;othis.gitignoreLineToGlob(o,t)),r=Object.create(null);for(const o of n)r[o]=!0;return X_(r,{trimForExclusions:i})}parseIgnoreFile(e,t,i){const n=e.split(` +`).map(m=>m.trim()).filter(m=>m&&m[0]!=="#"),r=n.filter(m=>!m.endsWith("/")),o=r.filter(m=>!m.includes("!")),a=this.gitignoreLinesToExpression(o,t,!0),c=r.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 TSe;(function(s){s.FileContributionRegistry="workbench.registry.explorer.fileContributions"})(TSe||(TSe={}));class d8t{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 r=n.create(e,t);return i.add(r),r})}}const LSe=new d8t;je.add(TSe.FileContributionRegistry,LSe);var RSe,Ev;const Xre=class Xre{getHeight(e){return Xre.ITEM_HEIGHT}getTemplateId(e){return YZ.ID}};Xre.ITEM_HEIGHT=22;let QZ=Xre;const MSe=new I;let NSe=class{constructor(e,t,i,n,r,o,a,c,l){this.fileFilter=e,this.progressService=t,this.configService=i,this.notificationService=n,this.layoutService=r,this.fileService=o,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 r=n.then(o=>(e instanceof qd&&e.isRoot&&!e.error&&t&&this.contextService.getWorkbenchState()!==Qi.FOLDER&&MSe.fire(e.resource),o),o=>{if(e instanceof qd&&e.isRoot)if(this.contextService.getWorkbenchState()===Qi.FOLDER){const a=new qd(e.resource,this.fileService,this.configService,this.filesConfigService,void 0,void 0,!1);return a.error=o,[a]}else MSe.fire(e.resource);else this.notificationService.error(o);return[]});return this.progressService.withProgress({location:fd.Explorer,delay:this.layoutService.isRestored()?800:1500},o=>r),r}};NSe=D([_(1,hg),_(2,Te),_(3,wi),_(4,NI),_(5,Xt),_(6,yf),_(7,Ci),_(8,bd)],NSe);const OFe=class OFe{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,r){this.id=e,this.items=t,this.depth=n,this.collapsed=r,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 RSe.ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0}));t.add(i.onDidRender(()=>{try{r.currentContext&&this.updateWidth(r.currentContext)}catch{}}));const n=LSe.create(this.instantiationService,e,t);t.add(LSe.onDidRegisterDescriptor(o=>{const a=o.create(this.instantiationService,e);n.push(t.add(a)),a.setResource(r.currentContext?.resource)}));const r={templateDisposables:t,elementDisposables:t.add(new Z),label:i,container:e,contribs:n};return r}renderElement(e,t,i){const n=e.element;i.currentContext=n;const r=this.explorerService.getEditableData(n);i.label.element.classList.remove("compressed"),r?(i.label.element.style.display="none",i.contribs.forEach(o=>o.setResource(void 0)),i.elementDisposables.add(this.renderInputBox(i.container,n,r))):(i.label.element.style.display="flex",this.renderStat(n,n.name,void 0,e.filterData,i))}renderCompressedElements(e,t,i,n){const r=e.element.elements[e.element.elements.length-1];i.currentContext=r;const o=e.element.elements.filter(c=>this.explorerService.isEditable(c)),a=o.length===0?void 0:this.explorerService.getEditableData(o[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,o[0],a));else{i.label.element.classList.add("compressed"),i.label.element.style.display="flex";const c=`compressed-explorer_${jZ.ID++}`,l=e.element.elements.map(u=>u.name);this.renderStat(r,l,c,e.filterData,i);const d=new jZ(c,e.element.elements,i,e.depth,e.collapsed);i.elementDisposables.add(d);const h=this.compressedNavigationControllers.get(r)??[];this.compressedNavigationControllers.set(r,[...h,d]),i.elementDisposables.add(this._onDidChangeActiveDescendant.add(d.onDidChange)),i.elementDisposables.add(ue(i.container,"mousedown",u=>{const f=JZ(u.target);f&&d.setIndex(f.index)})),i.elementDisposables.add(Ee(()=>{const u=this.compressedNavigationControllers.get(r)??[],f=u.findIndex(p=>p===d);if(f<0)throw new Error("Disposing unknown navigation controller");u.length===1?this.compressedNavigationControllers.delete(r):u.splice(f,1)}))}}renderStat(e,t,i,n,r){r.label.element.style.display="flex";const o=["explorer-item"];this.explorerService.isCut(e)&&o.push("cut");const a=this.themeService.getFileIconTheme();r.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;r.contribs.forEach(h=>h.setResource(e.resource)),r.label.setResource({resource:e.resource,name:t},{fileKind:e.isRoot?wa.ROOT_FOLDER:e.isDirectory?wa.FOLDER:wa.FILE,extraClasses:d?[...o,"align-nest-icon-with-parent-icon"]:o,fileDecorations:this.config.explorer.decorations,matches:NU(n),separator:this.labelService.getSeparator(e.resource.scheme,e.resource.authority),domId:i})}renderInputBox(e,t,i){const n=this.labels.create(e),r=["explorer-item","explorer-item-edited"],o=t.isRoot?wa.ROOT_FOLDER:t.isDirectory?wa.FOLDER:wa.FILE,a=this.themeService.getFileIconTheme(),c=a.hasFileIcons&&(a.hidesExplorerArrows||!a.hasFolderIcons),l=t.nestedParent&&c,d={hidePath:!0,hideLabel:!0,fileKind:o,extraClasses:l?[...r,"align-nest-icon-with-parent-icon"]:r},h=t.name?Ro(t.resource):t.resource,u=t.name||"";n.setFile(Ft(h,u||" "),d),n.element.firstElementChild.style.display="none";const f=new CJe(n.element,this.contextViewService,{validationOptions:{validation:y=>{const C=i.validationMessage(y);return!C||C.severity!==Ze.Error?null:{content:C.content,formatContent:!0,type:ed.ERROR}}},ariaLabel:g(11261,"Type file name. Press Enter to confirm or Escape to cancel."),inputBoxStyles:LM}),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=fm((y,C)=>{n.element.style.display="none";const A=f.value;wt(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===Ze.Info?ed.INFO:y.severity===Ze.Warning?ed.WARNING:ed.ERROR}):f.hideMessage()}};b();const w=[f,f.onDidChange(y=>{n.setFile(Ft(h,y||" "),d)}),Rr(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)}),Rr(f.inputElement,ke.KEY_UP,y=>{b()}),ue(f.inputElement,ke.BLUR,async()=>{for(;;){await Ao(0);const y=f.inputElement.ownerDocument;if(!y.hasFocus())break;if(dv(f.inputElement))return;if(Jo(y.activeElement)&&kq(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()}},RSe=IR,IR.ID="file",IR);YZ=RSe=D([_(3,bf),_(4,mn),_(5,Te),_(6,yf),_(7,Os),_(8,Ci),_(9,lo),_(10,we)],YZ);let PSe=class{constructor(e,t,i,n,r,o){this.contextService=e,this.configurationService=t,this.explorerService=i,this.editorService=n,this.uriIdentityService=r,this.fileService=o,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,Tr.UPDATED)&&await this.processIgnoreFile(c,d,!0),a.contains(d,Tr.DELETED)&&(this.ignoreTreesPerRoot.get(c)?.delete(Ro(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}),r=n?.files?.exclude||Object.create(null),o=n.explorer.excludeGitIgnore;if(o&&!this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.set(i.uri.toString(),new Mk),this.ignoreTreesPerRoot.set(i.uri.toString(),Ih.forUris(c=>this.uriIdentityService.extUri.ignorePathCasing(c)))),!o&&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||!Js(c.original,r)}const a=Ds(r);this.hiddenExpressionPerRoot.set(i.uri.toString(),{original:a,parsed:X_(a)})}),(e||t)&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())}async processIgnoreFile(e,t,i){const n=Ro(t),r=this.ignoreTreesPerRoot.get(e);if(!r||!i&&r.has(n))return;const o=await this.fileService.readFile(t);if(i)r.get(n)?.updateContents(o.value.toString());else{const a=r.findSubstr(n),c=new l8t(o.value.toString(),n.path,a);r.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(P2(e.root.resource.path,e.resource.path),e.name,c=>!!(e.parent&&e.parent.getChild(c))),o=(n?void 0:this.ignoreTreesPerRoot.get(e.root.resource.toString())?.findSubstr(e.resource))?.isPathIncludedInTraversal(e.resource.path,e.isDirectory);if((o===void 0?!1:!o)||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(){wt(this.toDispose)}};PSe=D([_(0,Ci),_(1,Te),_(2,yf),_(3,ti),_(4,Is),_(5,Xt)],PSe);let FSe=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 r,o;switch(n){case"upper":r=gIt,o=_It;break;case"lower":r=fIt,o=vIt;break;case"unicode":r=pIt,o=bIt;break;default:r=uIt,o=mIt}switch(i){case"type":if(e.isDirectory&&!t.isDirectory)return-1;if(t.isDirectory&&!e.isDirectory)return 1;if(e.isDirectory&&t.isDirectory)return r(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 o(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,r){if(!this.dropEnabled)return!1;if(t){const o=Ev.getCompressedStatFromDragEvent(t,r);if(o){const a=JZ(r.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,r)}handleDragOver(e,t,i,n,r){const o=r&&(r.ctrlKey&&!jt||r.altKey&&jt),a=e instanceof y_e,l={type:a||o?F1.Copy:F1.Move,position:Sy.Over};if(a){if(!Tet(r,ap.FILES,UM.FILES,ap.RESOURCES))return!1}else{if(e instanceof zYe)return!1;{const d=Ev.getStatsFromDragAndDropData(e),h=d.every(u=>u.isRoot);if(!t)return!o&&d.every(u=>!!u.parent&&u.parent.isRoot)?!1:h?{accept:!0,effect:{type:F1.Move,position:Sy.After}}:{accept:!0,bubble:W1.Down,effect:l,autoExpand:!1};if(!Array.isArray(d)||!o&&d.every(u=>u.isReadonly)||d.some(u=>u.isRoot?!1:!!(this.uriIdentityService.extUri.isEqual(u.resource,t.resource)||!o&&this.uriIdentityService.extUri.isEqual(Ro(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 MC.TOP:case MC.CENTER_TOP:u=Sy.Before;break;case MC.CENTER_BOTTOM:case MC.BOTTOM:u=Sy.After;break}return{accept:!0,effect:{type:F1.Move,position:u}}}}}if(t){if(t.isDirectory)return t.isReadonly?!1:{accept:!0,bubble:W1.Down,effect:l,autoExpand:!0};if(this.contextService.getWorkspace().folders.every(d=>d.uri.toString()!==t.resource.toString()))return{accept:!0,bubble:W1.Up,effect:l}}else return{accept:!0,bubble:W1.Down,effect:l};return!1}getDragURI(e){return this.explorerService.isEditable(e)?null:e.resource.toString()}getDragLabel(e,t){return e.length===1?Ev.getCompressedStatFromDragEvent(e[0],t).name:String(e.length)}onDragStart(e,t){const i=Ev.getStatsFromDragAndDropData(e,t);if(i&&i.length&&t.dataTransfer){this.instantiationService.invokeFunction(r=>Ent(r,i,t));const n=i.filter(r=>r.resource.scheme===pe.file).map(r=>r.resource.fsPath);n.length&&t.dataTransfer.setData(UM.FILES,JSON.stringify(n))}}async drop(e,t,i,n,r){if(this.compressedDropTargetDisposable.dispose(),t){const a=Ev.getCompressedStatFromDragEvent(t,r);a&&(t=a)}if(t||(t=this.explorerService.roots[this.explorerService.roots.length-1],n=MC.BOTTOM),!t.isDirectory&&t.parent&&(t=t.parent),t.isReadonly)return;const o=t;if(o)try{e instanceof y_e?!Hn||Wy(this.contextService.getWorkspace())&&Zp.supported(ri)?await this.instantiationService.createInstance(ESe).import(o,r,ri):await this.instantiationService.createInstance(qZ).upload(t,r):await this.handleExplorerDrop(e,o,i,n,r)}catch(a){this.dialogService.error(Po(a))}}async handleExplorerDrop(e,t,i,n,r){const o=Ev.getStatsFromDragAndDropData(e),a=new Map(o.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=Jdt([...a.keys()],u=>u.resource),l=r.ctrlKey&&!jt||r.altKey&&jt;if(!l&&this.configurationService.getValue(Ev.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)?gnt(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(Ev.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 r;const o=[],a=[],c=[];for(let l=0;lh.resource.toString()!==n[l].uri.toString())?a.push(d):c.push(d)}if(r===void 0)r=a.length;else{switch(i){case MC.BOTTOM:case MC.CENTER_BOTTOM:r++;break}for(const l of o)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(o)}async doHandleExplorerDropOnMove(e,t){const i=e.filter(o=>!o.isReadonly).map(o=>new hp(o.resource,Ft(t.resource,o.name))),n=h5e(e),r={confirmBeforeUndo:this.configurationService.getValue().explorer.confirmUndo===BT.Verbose,undoLabel:g(11270,"Move {0}",n),progressLabel:g(11271,"Moving {0}",n)};try{await this.explorerService.applyBulkEdit(i,r)}catch(o){if(o.fileOperationResult===ji.FILE_MOVE_CONFLICT){const a=[];for(const d of i)d.newResource&&await this.fileService.exists(d.newResource)&&a.push(d.newResource);const c=qzt(a),{confirmed:l}=await this.dialogService.confirm(c);l&&await this.explorerService.applyBulkEdit(i.map(d=>new hp(d.oldResource,d.newResource,{overwrite:!0})),r)}else throw o}}static getStatsFromDragAndDropData(e,t){return e.context?e.context:t&&e.elements.length===1?(e.context=[Ev.getCompressedStatFromDragEvent(e.elements[0],t)],e.context):e.elements}static getCompressedStatFromDragEvent(e,t){const i=lt(t).document.elementFromPoint(t.clientX,t.clientY),n=JZ(i);if(n){const{count:r,index:o}=n;let a=r-1;for(;a>o&&e.parent;)e=e.parent,a--;return e}return e}onDragEnd(){this.compressedDropTargetDisposable.dispose()}dispose(){this.compressedDropTargetDisposable.dispose()}},Ev=TR,TR.CONFIRM_DND_SETTING_KEY="explorer.confirmDragAndDrop",TR);OSe=Ev=D([_(1,yf),_(2,ti),_(3,ir),_(4,Ci),_(5,Xt),_(6,Te),_(7,we),_(8,oC),_(9,Is)],OSe);function JZ(s){if(!Jo(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(dc(t)&&dc(i))return{element:e,count:t,index:i}}e=e.parentElement}return null}function h8t(s){return!!JZ(s)}class u8t{isIncompressible(e){return e.isRoot||!e.isDirectory||e instanceof qce||!e.parent||e.parent.isRoot}}function h5e(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 g8t(s){if(s.isRoot&&s.error)return{tooltip:g(11256,"Unable to resolve workspace folder ({0})",Po(s.error)),letter:"!",color:Pmt};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:Hmt}}let BSe=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(MSe.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 g8t(t)}dispose(){this.toDispose.dispose()}};BSe=D([_(0,yf),_(1,Ci)],BSe);var f8t=".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}";gt(f8t,{});var p8t=".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}";gt(p8t,{});const r8=class r8 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?r8.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"?pi.VERTICAL:e.orientation,this._ariaHeaderLabel=g(9986,"{0} Section",e.title),this._minimumBodySize=typeof e.minimumBodySize=="number"?e.minimumBodySize:this._orientation===pi.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"&<(this.element).clearTimeout(this.animationTimer),oe(this.element,this.body)):this.animationTimer=lt(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===pi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===pi.VERTICAL)),this.header&&this.updateHeader())}render(){this.element.classList.toggle("expanded",this.isExpanded()),this.element.classList.toggle("horizontal",this.orientation===pi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===pi.VERTICAL),this.header=fe(".pane-header"),oe(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=Ec(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 ni(this.header,"keydown")),n=M.map(i.event,r=>new xn(r),t);this._register(M.filter(n,r=>r.keyCode===S.Enter||r.keyCode===S.Space,t)(()=>this.setExpanded(!this.isExpanded()),null)),this._register(M.filter(n,r=>r.keyCode===S.LeftArrow,t)(()=>this.setExpanded(!1),null)),this._register(M.filter(n,r=>r.keyCode===S.RightArrow,t)(()=>this.setExpanded(!0),null)),this._register(md.addTarget(this.header)),[ke.CLICK,ur.Tap].forEach(r=>{this._register(ue(this.header,r,o=>{o.defaultPrevented||this.setExpanded(!this.isExpanded())}))}),this.body=oe(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?r8.HEADER_SIZE:0,i=this._orientation===pi.VERTICAL?this.orthogonalSize:e,n=this._orientation===pi.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===pi.VERTICAL?`1px solid ${this.styles.headerBorder}`:"",this.element.style.borderLeft=this.styles.leftBorder&&this.orientation===pi.HORIZONTAL?`1px solid ${this.styles.leftBorder}`:""}};r8.HEADER_SIZE=22;let WSe=r8;const Zre=class Zre 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",lf&&e.dataTransfer?.setData(ap.TEXT,this.pane.draggableElement.textContent||"");const t=oe(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&&(tn.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??Zre.DefaultDragOverBackgroundColor.toString()),this.pane.dropTargetElement.style.backgroundColor=e||""}};Zre.DefaultDragOverBackgroundColor=new me(new hn(128,128,128,.5));let HSe=Zre;class m8t 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??pi.VERTICAL,this.element=oe(e,fe(".monaco-pane-view")),this.splitview=this._register(new T3(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 ni(this.element,"keydown")),r=M.map(M.filter(n.event,o=>Jo(o.target)&&o.target.classList.contains("pane-header"),i),o=>new xn(o),i);this._register(M.filter(r,o=>o.keyCode===S.UpArrow,i)(()=>this.focusPrevious())),this._register(M.filter(r,o=>o.keyCode===S.DownArrow,i)(()=>this.focusNext()))}addPane(e,t,i=this.splitview.length){const n=new Z;e.onDidChangeExpansionState(this.setupAnimation,this,n);const r={pane:e,disposable:n};if(this.paneItems.splice(i,0,r),e.orientation=this.orientation,e.orthogonalSize=this.orthogonalSize,this.splitview.addView(e,t,i),this.dnd){const o=new HSe(e,this.dnd,this.dndContext);n.add(o),n.add(o.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()?Xk.Distribute:void 0),this.paneItems.splice(t,1)[0].disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(o=>o.pane===e),n=this.paneItems.findIndex(o=>o.pane===t);if(i===-1||n===-1)return;const[r]=this.paneItems.splice(i,1);this.paneItems.splice(n,0,r),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===pi.VERTICAL?t:e,this.size=this.orientation===pi.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===pi.VERTICAL?(this.splitview.orthogonalStartSash=e?.left,this.splitview.orthogonalEndSash=e?.right):this.splitview.orthogonalEndSash=e?.bottom}flipOrientation(e,t){this.orientation=this.orientation===pi.VERTICAL?pi.HORIZONTAL:pi.VERTICAL;const i=this.paneItems.map(o=>this.getPaneSize(o.pane));this.splitview.dispose(),Ns(this.element),this.splitview=this._register(new T3(this.element,{orientation:this.orientation})),this.updateSplitviewOrthogonalSashes(this.boundarySashes);const n=this.orientation===pi.VERTICAL?t:e,r=this.orientation===pi.HORIZONTAL?t:e;this.paneItems.forEach((o,a)=>{o.pane.orthogonalSize=n,o.pane.orientation=this.orientation;const c=this.size===0?0:r*i[a]/this.size;this.splitview.addView(o.pane,c,a)}),this.size=r,this.orthogonalSize=n,this.splitview.layout(this.size)}setupAnimation(){typeof this.animationTimer=="number"&<(this.element).clearTimeout(this.animationTimer),this.element.classList.add("animated"),this.animationTimer=lt(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(r,o,a){this.whilePromise=r,this.whileStart=o,this.whileDelay=a,this.type=e.While}}s.While=t;class i{constructor(r,o){this.total=r,this.worked=o,this.type=e.Work}}s.Work=i})(Qc||(Qc={}));class _8t 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 v8t 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 b8t 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=[],vC(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 Ny&&!t[n.item.submenu.id]){const r=t[n.item.submenu.id]=i.add(this.menuService.createMenu(n.item.submenu,this.contextKeyService));i.add(r.onDidChange(()=>this.updateActions())),i.add(this.updateSubmenus(n.actions,t))}return i}}let XZ=class extends V{constructor(e,t,i,n,r){super(),this.menuId=e,this.contextMenuId=t,this.options=i,this.contextKeyService=n,this.menuService=r,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.menuActions=this._register(new b8t(e,this.options,r,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);vC(t,{primary:[],secondary:e})}return e}};XZ=D([_(3,Le),_(4,Wa)],XZ);const xnt=new _e("menu.view.filter"),jce=new _e("submenu.view.filter");Yn.appendMenuItem(xnt,{submenu:jce,title:g(5623,"More Filters..."),group:"navigation",icon:ve.filter});class w8t extends E3{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 USe=class extends _d{get onDidFocus(){return this.focusTracker.onDidFocus}get onDidBlur(){return this.focusTracker.onDidBlur}constructor(e,t,i,n,r){super(),this.options=e,this.instantiationService=t,this.contextViewService=i,this.keybindingService=r,this._onDidChangeFilterText=this._register(new I),this.onDidChangeFilterText=this._onDidChangeFilterText.event,this.isMoreFiltersChecked=!1,this.delayedFilterUpdate=new Ph(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 o=oe(this.element,fe(".viewpane-filter-controls"));this.filterBadge=this.createBadge(o),this.toolbar=this._register(this.createToolBar(o)),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(pX,e,this.contextViewService,{placeholder:this.options.placeholder,ariaLabel:this.options.ariaLabel,history:this.options.history||[],showHistoryHint:()=>iZ(this.keybindingService),inputBoxStyles:LM}));this.options.text&&(t.value=this.options.text),this._register(t.onDidChange(n=>this.delayedFilterUpdate.trigger(()=>this.onDidInputChange(t)))),this._register(Rr(t.inputElement,ke.KEY_DOWN,n=>this.onInputKeyDown(n,t))),this._register(Rr(e,ke.KEY_DOWN,this.handleKeyboardEvent)),this._register(Rr(e,ke.KEY_UP,this.handleKeyboardEvent)),this._register(Rr(t.inputElement,ke.CLICK,n=>{n.stopPropagation(),n.preventDefault()}));const i=this._register(Ec(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=oe(e,fe(".viewpane-filter-badge.hidden"));return t.style.backgroundColor=$e(DT),t.style.color=$e(dae),t.style.border=`1px solid ${$e(yt)}`,t}createToolBar(e){return this.instantiationService.createInstance(Cm,e,xnt,{hiddenItemStrategy:hA.NoHide,actionViewItemProvider:(t,i)=>{if(t instanceof Ny&&t.item.submenu.id===jce.id)return this.moreFiltersActionViewItem=this.instantiationService.createInstance(w8t,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())}};USe=D([_(1,we),_(2,bf),_(3,Le),_(4,Vt)],USe);var VSe,nz;(function(s){s[s.Default=0]="Default",s[s.WhenExpanded=1]="WhenExpanded",s[s.Always=2]="Always"})(nz||(nz={}));const u5e=new an("viewpane.action.filter"),y8t=oi("view-pane-container-expanded",ve.chevronDown,g(5342,"Icon for an expanded view pane container.")),C8t=oi("view-pane-container-collapsed",ve.chevronRight,g(5343,"Icon for a collapsed view pane container.")),g5e=je.as(oI.ViewsRegistry);let zSe=class{get enabled(){return this._enabled}constructor(e,t,i,n,r,o,a){this.container=e,this.delegate=t,this.instantiationService=i,this.openerService=n,this.telemetryService=r,this.contextKeyService=o,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=oe(this.container,fe(".welcome-view"));this.element=fe(".welcome-view-content",{tabIndex:0}),this.scrollableElement=new MU(this.element,{alwaysConsumeMouseWheel:!0,horizontal:Cr.Hidden,vertical:Cr.Visible}),oe(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(g5e.onDidChangeViewWelcomeContent,i=>i.filter(n=>n===this.delegate.id))(this.onDidChangeViewWelcomeContent,this,this.enabledDisposables),this.onDidChangeViewWelcomeContent()}onDidChangeViewWelcomeContent(){const e=g5e.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 r of n){if(r=r.trim(),!r)continue;const o=pJe(r);if(o.nodes.length===1&&typeof o.nodes[0]!="string"){const a=o.nodes[0],c=oe(this.element,fe(".button-container")),l=new Zd(c,{title:a.title,supportIcons:!0,...M6});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=oe(this.element,fe("p"));for(const c of o.nodes)if(typeof c=="string")oe(a,document.createTextNode(c));else{const l=this.renderDisposables.add(this.instantiationService.createInstance(d9,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()}};zSe=D([_(2,we),_(3,Ar),_(4,Ji),_(5,Le),_(6,rg)],zSe);var LR;let ZZ=(LR=class extends WSe{get title(){return this._title}get titleDescription(){return this._titleDescription}get singleViewPaneContainerTitle(){return this._singleViewPaneContainerTitle}constructor(e,t,i,n,r,o,a,c,l,d,h,u){super({...e,orientation:o.getViewLocationById(e.id)===io.Panel?pi.HORIZONTAL:pi.VERTICAL}),this.keybindingService=t,this.contextMenuService=i,this.configurationService=n,this.contextKeyService=r,this.viewDescriptorService=o,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??nz.Default,this.scopedContextKeyService=this._register(r.createScoped(this.element)),this.scopedContextKeyService.createKey("view",this.id);const f=this.scopedContextKeyService.createKey("viewLocation",QX(o.getViewLocationById(this.id)));this._register(M.filter(o.onDidChangeLocation,m=>m.views.some(v=>v.id===this.id))(()=>f.set(QX(o.getViewLocationById(this.id)))));const p=this._register(this.instantiationService.createChild(new Vc([Le,this.scopedContextKeyService])));this.menuActions=this._register(p.createInstance(XZ,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=Ec(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=oe(e,fe(`.twisty-container${He.asCSSSelector(this.getTwistyIcon(this.isExpanded()))}`)),this.renderHeaderTitle(e,this.title);const t=oe(e,fe(".actions"));t.classList.toggle("show-always",this.showActions===nz.Always),t.classList.toggle("show-expanded",this.showActions===nz.WhenExpanded),this.toolbar=this.instantiationService.createInstance(mW,t,{orientation:W_.HORIZONTAL,actionViewItemProvider:(r,o)=>this.getActionViewItem(r,o),ariaLabel:g(5344,"{0} actions",this.title),getKeyBinding:r=>this.keybindingService.lookupKeybinding(r.id),renderDropdownAsChildElement:!0,actionRunner:this.getActionRunner(),resetMenu:this.menuActions.menuId}),this._register(this.toolbar),this.setActions(),this._register(ue(t,ke.CLICK,r=>r.preventDefault()));const i=this.viewDescriptorService.getViewContainerByViewId(this.id);i?this._register(this.viewDescriptorService.getViewContainerModel(i).onDidChangeContainerInfo(({title:r})=>this.updateTitle(this.title))):console.error(`View container model not found for view ${this.id}`);const n=M.filter(this.configurationService.onDidChangeConfiguration,r=>r.affectsConfiguration(VSe.AlwaysShowActionsConfig));this._register(n(this.updateActionsVisibility,this)),this.updateActionsVisibility()}updateHeader(){super.updateHeader(),this.updateTwistyIcon()}updateTwistyIcon(){this.twistiesContainer&&(this.twistiesContainer.classList.remove(...He.asClassNameArray(this.getTwistyIcon(!this._expanded))),this.twistiesContainer.classList.add(...He.asClassNameArray(this.getTwistyIcon(this._expanded))))}getTwistyIcon(e){return e?y8t:C8t}style(e){super.style(e);const t=this.getIcon();if(this.iconContainer){const i=My(e.headerForeground,$e($i));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||ABt}renderHeaderTitle(e,t){this.iconContainer=oe(e,fe(".icon",void 0));const i=this.getIcon();let n;if(N.isUri(i)){n=`view-${this.id.replace(/[\.\:]/g,"-")}`;const o=`.pane-header .icon.${n}`;$f(o,` mask: ${ig(i)} no-repeat 50% 50%; mask-size: 24px; -webkit-mask: ${ig(i)} no-repeat 50% 50%; -webkit-mask-size: 16px; - `)}else He.isThemeIcon(i)&&(n=He.asClassName(i));n&&this.iconContainer.classList.add(...n.split(" "));const r=this.calculateTitle(t);this.titleContainer=oe(e,fe("h3.title",{},r)),this.titleContainerHover=this._register(this.hoverService.setupManagedHover(Fo("mouse"),this.titleContainer,r)),this._titleDescription&&this.setTitleDescription(this._titleDescription),this.iconContainerHover=this._register(this.hoverService.setupManagedHover(Fo("mouse"),this.iconContainer,r)),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(r))}_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=mqe(this.titleContainer,fe("span.description",{},e)),this.titleDescriptionContainerHover=this._register(this.hoverService.setupManagedHover(Fo("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(zSe,e,this))}layoutBody(e,t){this.viewWelcomeController.layout(e,t)}onDidScrollRoot(){}getProgressIndicator(){if(this.progressBar===void 0&&(this.progressBar=this._register(new mJ(this.element,cJe)),this.progressBar.hide()),this.progressIndicator===void 0){const e=this;this.progressIndicator=this._register(new _8t(Qn(this.progressBar),new class extends v8t{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 S8t(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(u5e),this.toolbar.setActions(vWe(e),vWe(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===u5e.id){const i=this;return new class extends Kf{constructor(){super(null,e)}setFocusable(){}get trapsArrowNavigation(){return!0}render(n){n.classList.add("viewpane-filter-container");const r=i.getFilterWidget();oe(n,r.element),r.relayout()}}}return GN(this.instantiationService,e,{...t,menuAsChild:e instanceof Ny})}getActionsContext(){}getActionRunner(){}getOptimalWidth(){return 0}saveState(){}shouldShowWelcome(){return!1}getFilterWidget(){}shouldShowFilterInHeader(){return!1}},VSe=LR,LR.AlwaysShowActionsConfig="workbench.view.alwaysShowHeaderActions",LR);ZZ=VSe=D([_(1,Vt),_(2,lo),_(3,Te),_(4,Le),_(5,Im),_(6,we),_(7,Ar),_(8,mn),_(9,Ji),_(10,tc)],ZZ);let $Se=class extends ZZ{constructor(e,t,i,n,r,o,a,c,l,d,h,u){super(e,t,i,n,r,o,a,c,l,d,h,u);const f=this._register(a.createChild(new Vc([Le,this.scopedContextKeyService])));this.filterWidget=this._register(f.createInstance(USe,e.filterOptions))}getFilterWidget(){return this.filterWidget}renderBody(e){super.renderBody(e),this.filterContainer=oe(e,fe(".viewpane-filter-container"))}layoutBody(e,t){super.layoutBody(e,t),this.dimension=new wn(t,e);const i=!this.filterContainer?.hasChildNodes(),n=this.shouldShowFilterInHeader();i!==n&&(n&&ca(this.filterContainer),this.updateActions(),n||oe(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)}};$Se=D([_(1,Vt),_(2,lo),_(3,Te),_(4,Le),_(5,Im),_(6,we),_(7,Ar),_(8,mn),_(9,Ji),_(10,tc)],$Se);function S8t(s){let e,t,i,n;switch(s){case io.Panel:e=UXe,t=FLt,i=OLt,n=BLt;break;case io.Sidebar:case io.AuxiliaryBar:default:e=wMe,t=GLt,i=KLt,n=qLt}return{background:e,listOverrideStyles:{listBackground:e,treeStickyScrollBackground:t,treeStickyScrollBorder:i,treeStickyScrollShadow:n}}}class _G extends di{constructor(e){super(e),this.desc=e}run(e,...t){const i=e.get(Nm).getActiveViewWithId(this.desc.viewId);if(i)return this.runInView(e,i,...t)}}var YQ;function A8t(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 E8t(s,e){for(const t of e)if(s.hasNode(t)&&!s.isCollapsed(t))return!0;return!1}const x8t={getId:s=>s instanceof qce?`new:${s.getId()}`:s.getId()};function D8t(s,e,t,i){let n;n=s.length?s[0]:void 0,t&&e.length>1&&(n=void 0);const r=n&&i.getCompressedNavigationController(n),o=r&&r.length?r[0]:void 0;n=o?o.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===o){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 RR;let XW=(RR=class extends ZZ{constructor(e,t,i,n,r,o,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=r,this.progressService=o,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(U3),this._register(this.resourceContext),this.folderContext=dzt.bindTo(h),this.readonlyContext=ant.bindTo(h),this.availableEditorIdsContext=hzt.bindTo(h),this.rootContext=uzt.bindTo(h),this.resourceMoveableToTrash=fzt.bindTo(h),this.compressedFocusContext=pzt.bindTo(h),this.compressedFocusFirstContext=mzt.bindTo(h),this.compressedFocusLastContext=_zt.bindTo(h),this.viewHasSomeCollapsibleRootItem=vzt.bindTo(h),this.viewVisibleContextKey=JNe.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 Qzt.bindTo(this.contextKeyService)}get resourceCutContextKey(){return gzt.bindTo(this.contextKeyService)}renderHeader(e){super.renderHeader(e),this.dragHandler=new FEt(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=oe(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(lt(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()===uW.Tree){const e=this.tree.getFocus();e.length===1&&this._autoReveal&&this.tree.reveal(e[0],.5)}}hasFocus(){return FTe(this.container)}getFocus(){return this.tree.getFocus()}focusNext(){this.tree.focusNext()}focusLast(){this.tree.focusLast()}getContext(e){const t=this.tree.getFocusedPart()===uW.StickyScroll?this.tree.getStickyScrollFocus():this.tree.getFocus();return D8t(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=Pa.getCanonicalUri(this.editorService.activeEditor,{supportSideBySide:Us.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(KA,{onDidChangeVisibility:this.onDidChangeBodyVisibility});this._register(t);const i=a=>this.tree.updateWidth(a);this.renderer=this.instantiationService.createInstance(YZ,e,t,i),this._register(this.renderer),this._register(nPe(e,this.themeService));const n=()=>this.configurationService.getValue("explorer.compactFolders"),r=a=>this.configurationService.getValue({resource:a?.root.resource}).explorer.fileNesting;this.tree=this.instantiationService.createInstance(AJ,"FileExplorer",e,new QZ,new u8t,[this.renderer],this.instantiationService.createInstance(NSe,this.filter),{compressionEnabled:n(),accessibilityProvider:this.renderer,identityProvider:x8t,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(FSe),dnd:this.instantiationService.createInstance(OSe,a=>this.isItemCollapsed(a)),collapseByDefault:a=>!(a instanceof qd&&a.hasNests&&r(a).expand),autoExpandSingleChildren:!0,expandOnlyOnTwistieClick:a=>{if(a instanceof qd){if(a.hasNests)return!0;if(this.configurationService.getValue("workbench.tree.expandMode")==="doubleClick")return!0}return!1},paddingBottom:QZ.ITEM_HEIGHT,overrideStyles:this.getLocationBasedColors().listOverrideStyles}),this._register(this.tree),this._register(this.themeService.onDidColorThemeChange(()=>this.tree.rerender()));const o=M.filter(this.configurationService.onDidChangeConfiguration,a=>a.affectsConfiguration("explorer.compactFolders"));this._register(o(a=>this.tree.updateOptions({compressionEnabled:n()}))),lnt.bindTo(this.tree.contextKeyService),dnt.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(!(g_(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:x3.USER}},a.sideBySide?nv:pA)}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(tPe)})),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(YQ.TREE_VIEW_STATE_STORAGE_KEY,JSON.stringify(this.tree.getViewState()),Ie.WORKSPACE,cn.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(r=>r.id):[];this.availableEditorIdsContext.set(n.join(","))}else this.availableEditorIdsContext.reset()}async onContextMenu(e){if(aA(e.browserEvent.target))return;const t=e.element;let i=e.anchor;if(Jo(i)&&t){const a=this.renderer.getCompressedNavigationController(t);a&&a.length>0&&(g_(e.browserEvent)||h8t(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(),r=this.explorerService.roots;let o;if(t instanceof qd){const a=this.renderer.getCompressedNavigationController(t);o=a&&a.length?a[0].current.resource:t.resource}else o=r.length===1?r[0].resource:{};this.contextMenuService.showContextMenu({menuId:_e.ExplorerContext,menuActionOptions:{arg:o,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 qd?[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,r=this.fileService.hasCapability(t.resource,zn.Trash);this.resourceMoveableToTrash.set(n&&r)}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 Ght(e,t)}async setTreeInput(){if(!this.isBodyVisible())return Promise.resolve(void 0);this.setTreeInputPromise&&await this.setTreeInputPromise;const e=!this.tree.getInput();e&&ls("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(YQ.TREE_VIEW_STATE_STORAGE_KEY,Ie.WORKSPACE);a&&(n=JSON.parse(a))}const r=this.tree.getInput(),o=this.setTreeInputPromise=this.tree.setInput(i,n).then(async()=>{if(Array.isArray(i)){if(!n||r instanceof qd)for(let a=0;a{}),Array.isArray(r)){const a=new gi;r.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&&ls("code/didResolveExplorer")});this.progressService.withProgress({location:fd.Explorer,delay:this.layoutService.isRestored()?800:1500},a=>o),await o,this.decorationsProvider||(this.decorationsProvider=new BSe(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 r of n.children.values()){if(this.uriIdentityService.extUri.isEqualOrParent(e,r.resource)){n=r;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)&&A8t(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(E8t(this.tree,t)),this.storeTreeViewState()}dispose(){this.dragHandler?.dispose(),super.dispose()}},YQ=RR,RR.TREE_VIEW_STATE_STORAGE_KEY="workbench.explorer.treeViewState",RR);XW.__decorator=D([ei],XW.prototype,"fileCopiedContextKey",null);XW.__decorator=D([ei],XW.prototype,"resourceCutContextKey",null);XW=YQ=D([_(1,lo),_(2,Im),_(3,we),_(4,Ci),_(5,hg),_(6,ti),_(7,KU),_(8,NI),_(9,Vt),_(10,Le),_(11,Te),_(12,aE),_(13,Os),_(14,mn),_(15,Ji),_(16,tc),_(17,yf),_(18,Gi),_(19,gg),_(20,Xt),_(21,Is),_(22,bi),_(23,Ar)],XW);function nPe(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)}Et(class extends di{constructor(){super({id:"workbench.files.action.createFileFromExplorer",title:g(10058,"New File..."),f1:!1,icon:ve.newFile,precondition:cnt,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Vb),order:10}})}run(s){s.get(bi).executeCommand(tPe)}});Et(class extends di{constructor(){super({id:"workbench.files.action.createFolderFromExplorer",title:g(10059,"New Folder..."),f1:!1,icon:ve.newFolder,precondition:cnt,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Vb),order:20}})}run(s){s.get(bi).executeCommand(Snt)}});Et(class extends di{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",Vb),order:30},metadata:{description:Pe(10061,"Forces a refresh of the Explorer.")}})}async run(s){const e=s.get(Nm),t=s.get(yf);await e.openView(Vb),await t.refresh()}});Et(class extends di{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",Vb),order:40},metadata:{description:Pe(10063,"Folds all folders in the Explorer.")}})}run(s){const t=s.get(Nm).getViewWithId(Vb);t!==null&&t.collapseAll()}});var f5e;(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"})(f5e||(f5e={}));var p5e;(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"})(p5e||(p5e={}));const k8t="editor.contrib.defineKeybinding",I8t="settings";var GSe;const JQ=fe;let eee=class extends V{constructor(e,t,i,n,r){super(),this.data=e,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const o=t??(e.length>1?g(10569,"Used {0} references",e.length):g(10570,"Used {0} reference",1)),a=JQ(".chat-used-context-icon"),c=v=>v.usedReferencesExpanded?ve.chevronDown:ve.chevronRight;a.classList.add(...He.asClassNameArray(c(i)));const l=JQ(".chat-used-context-label",void 0),d=this._register(new Zd(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=JQ(".chat-used-context",void 0,l),d.label=o,d.element.prepend(a),this.updateAriaLabel(d.element,o,i.usedReferencesExpanded),this.domNode.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this._register(d.onDidClick(()=>{a.classList.remove(...He.asClassNameArray(c(i))),i.usedReferencesExpanded=!i.usedReferencesExpanded,a.classList.add(...He.asClassNameArray(c(i))),this.domNode.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this._onDidChangeHeight.fire(),this.updateAriaLabel(d.element,o,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&&r.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)}};eee=D([_(4,Ar)],eee);let KSe=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 Kce(()=>this.listFactory()))}listFactory(){const e=this._register(this.instantiationService.createInstance(KA,{onDidChangeVisibility:this._onDidChangeVisibility})),t=JQ(".chat-used-context-list");return this._register(nPe(t,this.themeService)),this.instantiationService.createInstance(Z_e,"ChatListRenderer",t,new T8t,[this.instantiationService.createInstance(tee,e)],{alwaysConsumeMouseWheel:!1,accessibilityProvider:{getAriaLabel:n=>{if(n.kind==="warning")return n.content.value;const r=n.reference;return"variableName"in r?r.variableName:N.isUri(r)?Kr(r.path):Kr(r.uri.path)},getWidgetAriaLabel:()=>g(10573,"Collapsible Chat List")},dnd:{getDragURI:n=>{if(n.kind==="warning")return null;const{reference:r}=n;return"variableName"in r?null:N.isUri(r)?r.toString():r.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)}}}};KSe=D([_(1,we),_(2,mn)],KSe);class T8t{getHeight(e){return 22}getTemplateId(e){return tee.TEMPLATE_ID}}var MR;let tee=(MR=class{constructor(e,t,i,n){this.labels=e,this.themeService=t,this.chatVariablesService=i,this.productService=n,this.templateId=GSe.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 He.isThemeIcon(e.iconPath)?e.iconPath:this.themeService.getColorTheme().type===cSe.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 r=e.reference,o=this.getReferenceIcon(e);if(i.label.element.style.display="flex","variableName"in r)if(r.value){const a=N.isUri(r.value)?r.value:r.value.uri;i.label.setResource({resource:a,name:TA(a),description:`#${r.variableName}`,range:"range"in r.value?r.value.range:void 0},{icon:o,title:e.options?.status?.description??e.title})}else{const a=this.chatVariablesService.getVariable(r.variableName),c=a?.icon?`$(${a.icon.id}) `:"",l=`#${r.variableName}`,d=`${c}${a?.fullName??l}`;i.label.setLabel(d,l,{title:e.options?.status?.description??a?.description})}else{const a="uri"in r?r.uri:r;if(a.scheme==="https"&&W2(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&&W2(a.authority,I8t)){const c=a.path.substring(1);i.label.setResource({resource:a,name:c},{icon:ve.settingsGear,title:g(10574,"Open setting '{0}'",c)})}else R8(a,pe.mailto,pe.http,pe.https)?i.label.setResource({resource:a,name:a.toString()},{icon:o??ve.globe,title:e.options?.status?.description??e.title??a.toString()}):i.label.setFile(a,{fileKind:wa.FILE,fileDecorations:{badges:!1,colors:!1},range:"range"in r?r.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===GW.Omitted||e.options?.status?.kind===GW.Partial?c.classList.add("warning"):c.classList.remove("warning"))}}disposeTemplate(e){e.templateDisposables.dispose()}},GSe=MR,MR.TEMPLATE_ID="chatCollapsibleListRenderer",MR);tee=GSe=D([_(1,mn),_(2,z6),_(3,xo)],tee);let qSe=class extends V{constructor(e,t,i,n,r){if(super(),this.task=e,e.progress.length){const o=this._register(r.createInstance(eee,e.progress,e.content.value,n.element,t));this.domNode=fe(".chat-progress-task"),this.domNode.appendChild(o.domNode),this.onDidChangeHeight=o.onDidChangeHeight}else{const o=e.isSettled?.()??!0,a=this._register(r.createInstance(ont,e,i,n,!o,!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)}};qSe=D([_(4,we)],qSe);const m5e=fe;let QSe=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this.textModelService=o,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))bs(l)&&l.response.value.every(d=>d.kind==="textEditGroup")?this.domNode=m5e(".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=m5e("div");else{const d=new li;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 oW;y.canComputeSHA1(p)&&(m=y.computeSHA1(p),e.state={sha1:m,applied:0})}const v=this.modelService.createModel(A6(p.createSnapshot()),{languageId:p.getLanguageId(),onDidChange:M.None},N.from({scheme:pe.vscodeChatCodeBlock,path:p.uri.path,query:ao()}),!1),b=await this.textModelService.createModelReference(v.uri);this._register(b);const w=[];if(bs(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||!Yi(A.uri,e.uri)))for(const L of A.edits){const k=L.map(TTe.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,r,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)}};QSe=D([_(5,pn),_(6,fi),_(7,Lm)],QSe);let jSe=class extends V{inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._pool=this._register(new Kce(()=>n.createInstance(LCe,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)}}}};jSe=D([_(3,we)],jSe);const L8t=fe;let iee=class extends V{constructor(e,t,i,n,r){super(),this.openerService=r,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const o=this._register(i.get());this.tree=o.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(()=>{o.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)}};iee=D([_(4,Ar)],iee);let YSe=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 Kce(()=>this.treeFactory()))}treeFactory(){const e=this._register(this.instantiationService.createInstance(KA,{onDidChangeVisibility:this._onDidChangeVisibility})),t=L8t(".interactive-response-progress-tree");return this._register(nPe(t,this.themeService)),this.instantiationService.createInstance(AJ,"ChatListRenderer",t,new JSe,new R8t,[new M8t(e,this.configService.getValue("explorer.decorations"))],new N8t,{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)}}}};YSe=D([_(1,we),_(2,Te),_(3,mn)],YSe);const eoe=class eoe{getHeight(e){return eoe.ITEM_HEIGHT}getTemplateId(e){return"chatListTreeTemplate"}};eoe.ITEM_HEIGHT=22;let JSe=eoe;class R8t{isIncompressible(e){return!e.children}}class M8t{constructor(e,t){this.labels=e,this.decorations=t,this.templateId="chatListTreeTemplate"}renderCompressedElements(e,t,i,n){i.label.element.style.display="flex";const r=e.element.elements.map(o=>o.label);i.label.setResource({resource:e.element.elements[0].uri,name:r},{title:e.element.elements[0].label,fileKind:e.children?wa.FOLDER:wa.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!==rn.Directory?i.label.setFile(e.element.uri,{fileKind:wa.FILE,hidePath:!0,fileDecorations:this.decorations}):i.label.setResource({resource:e.element.uri,name:e.element.label},{title:e.element.label,fileKind:wa.FOLDER,fileDecorations:this.decorations})}disposeTemplate(e){e.templateDisposables.dispose()}}class N8t{hasChildren(e){return!!e.children}async getChildren(e){return e.children??[]}}const _5e=fe;class v5e extends V{constructor(e,t,i){super(),this.domNode=_5e(".chat-notification-widget");let n,r;switch(e){case"warning":n=ve.warning,r=".chat-warning-codicon";break;case"error":n=ve.error,r=".chat-error-codicon";break;case"info":n=ve.info,r=".chat-info-codicon";break}this.domNode.appendChild(_5e(r,void 0,eC(n)));const o=i.render(t);this.domNode.appendChild(o.element)}hasSameContent(e){return e.kind==="warning"}}const P8t=["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 XSe=class extends Z_{constructor(e,t,i,n){super(e??{},t,i),this.trustedDomainService=n}render(e,t,i){t={...t,remoteImageIsAllowed:r=>this.trustedDomainService.isValid(r),sanitizerOptions:{replaceWithPlaintext:!0,allowedTags:P8t}};const n=e&&e.supportHtml?{...e,value:` + `)}else He.isThemeIcon(i)&&(n=He.asClassName(i));n&&this.iconContainer.classList.add(...n.split(" "));const r=this.calculateTitle(t);this.titleContainer=oe(e,fe("h3.title",{},r)),this.titleContainerHover=this._register(this.hoverService.setupManagedHover(Fo("mouse"),this.titleContainer,r)),this._titleDescription&&this.setTitleDescription(this._titleDescription),this.iconContainerHover=this._register(this.hoverService.setupManagedHover(Fo("mouse"),this.iconContainer,r)),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(r))}_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=mqe(this.titleContainer,fe("span.description",{},e)),this.titleDescriptionContainerHover=this._register(this.hoverService.setupManagedHover(Fo("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(zSe,e,this))}layoutBody(e,t){this.viewWelcomeController.layout(e,t)}onDidScrollRoot(){}getProgressIndicator(){if(this.progressBar===void 0&&(this.progressBar=this._register(new mJ(this.element,cJe)),this.progressBar.hide()),this.progressIndicator===void 0){const e=this;this.progressIndicator=this._register(new _8t(Qn(this.progressBar),new class extends v8t{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 S8t(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(u5e),this.toolbar.setActions(vWe(e),vWe(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===u5e.id){const i=this;return new class extends Kf{constructor(){super(null,e)}setFocusable(){}get trapsArrowNavigation(){return!0}render(n){n.classList.add("viewpane-filter-container");const r=i.getFilterWidget();oe(n,r.element),r.relayout()}}}return GN(this.instantiationService,e,{...t,menuAsChild:e instanceof Ny})}getActionsContext(){}getActionRunner(){}getOptimalWidth(){return 0}saveState(){}shouldShowWelcome(){return!1}getFilterWidget(){}shouldShowFilterInHeader(){return!1}},VSe=LR,LR.AlwaysShowActionsConfig="workbench.view.alwaysShowHeaderActions",LR);ZZ=VSe=D([_(1,Vt),_(2,lo),_(3,Te),_(4,Le),_(5,Im),_(6,we),_(7,Ar),_(8,mn),_(9,Ji),_(10,tc)],ZZ);let $Se=class extends ZZ{constructor(e,t,i,n,r,o,a,c,l,d,h,u){super(e,t,i,n,r,o,a,c,l,d,h,u);const f=this._register(a.createChild(new Vc([Le,this.scopedContextKeyService])));this.filterWidget=this._register(f.createInstance(USe,e.filterOptions))}getFilterWidget(){return this.filterWidget}renderBody(e){super.renderBody(e),this.filterContainer=oe(e,fe(".viewpane-filter-container"))}layoutBody(e,t){super.layoutBody(e,t),this.dimension=new wn(t,e);const i=!this.filterContainer?.hasChildNodes(),n=this.shouldShowFilterInHeader();i!==n&&(n&&ca(this.filterContainer),this.updateActions(),n||oe(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)}};$Se=D([_(1,Vt),_(2,lo),_(3,Te),_(4,Le),_(5,Im),_(6,we),_(7,Ar),_(8,mn),_(9,Ji),_(10,tc)],$Se);function S8t(s){let e,t,i,n;switch(s){case io.Panel:e=UXe,t=FLt,i=OLt,n=BLt;break;case io.Sidebar:case io.AuxiliaryBar:default:e=wMe,t=GLt,i=KLt,n=qLt}return{background:e,listOverrideStyles:{listBackground:e,treeStickyScrollBackground:t,treeStickyScrollBorder:i,treeStickyScrollShadow:n}}}class _G extends di{constructor(e){super(e),this.desc=e}run(e,...t){const i=e.get(Nm).getActiveViewWithId(this.desc.viewId);if(i)return this.runInView(e,i,...t)}}var YQ;function A8t(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 E8t(s,e){for(const t of e)if(s.hasNode(t)&&!s.isCollapsed(t))return!0;return!1}const x8t={getId:s=>s instanceof qce?`new:${s.getId()}`:s.getId()};function D8t(s,e,t,i){let n;n=s.length?s[0]:void 0,t&&e.length>1&&(n=void 0);const r=n&&i.getCompressedNavigationController(n),o=r&&r.length?r[0]:void 0;n=o?o.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===o){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 RR;let XW=(RR=class extends ZZ{constructor(e,t,i,n,r,o,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=r,this.progressService=o,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(U3),this._register(this.resourceContext),this.folderContext=dzt.bindTo(h),this.readonlyContext=ant.bindTo(h),this.availableEditorIdsContext=hzt.bindTo(h),this.rootContext=uzt.bindTo(h),this.resourceMoveableToTrash=fzt.bindTo(h),this.compressedFocusContext=pzt.bindTo(h),this.compressedFocusFirstContext=mzt.bindTo(h),this.compressedFocusLastContext=_zt.bindTo(h),this.viewHasSomeCollapsibleRootItem=vzt.bindTo(h),this.viewVisibleContextKey=JNe.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 Qzt.bindTo(this.contextKeyService)}get resourceCutContextKey(){return gzt.bindTo(this.contextKeyService)}renderHeader(e){super.renderHeader(e),this.dragHandler=new FEt(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=oe(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(lt(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()===uW.Tree){const e=this.tree.getFocus();e.length===1&&this._autoReveal&&this.tree.reveal(e[0],.5)}}hasFocus(){return FTe(this.container)}getFocus(){return this.tree.getFocus()}focusNext(){this.tree.focusNext()}focusLast(){this.tree.focusLast()}getContext(e){const t=this.tree.getFocusedPart()===uW.StickyScroll?this.tree.getStickyScrollFocus():this.tree.getFocus();return D8t(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=Fa.getCanonicalUri(this.editorService.activeEditor,{supportSideBySide:Us.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(KA,{onDidChangeVisibility:this.onDidChangeBodyVisibility});this._register(t);const i=a=>this.tree.updateWidth(a);this.renderer=this.instantiationService.createInstance(YZ,e,t,i),this._register(this.renderer),this._register(nPe(e,this.themeService));const n=()=>this.configurationService.getValue("explorer.compactFolders"),r=a=>this.configurationService.getValue({resource:a?.root.resource}).explorer.fileNesting;this.tree=this.instantiationService.createInstance(AJ,"FileExplorer",e,new QZ,new u8t,[this.renderer],this.instantiationService.createInstance(NSe,this.filter),{compressionEnabled:n(),accessibilityProvider:this.renderer,identityProvider:x8t,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(FSe),dnd:this.instantiationService.createInstance(OSe,a=>this.isItemCollapsed(a)),collapseByDefault:a=>!(a instanceof qd&&a.hasNests&&r(a).expand),autoExpandSingleChildren:!0,expandOnlyOnTwistieClick:a=>{if(a instanceof qd){if(a.hasNests)return!0;if(this.configurationService.getValue("workbench.tree.expandMode")==="doubleClick")return!0}return!1},paddingBottom:QZ.ITEM_HEIGHT,overrideStyles:this.getLocationBasedColors().listOverrideStyles}),this._register(this.tree),this._register(this.themeService.onDidColorThemeChange(()=>this.tree.rerender()));const o=M.filter(this.configurationService.onDidChangeConfiguration,a=>a.affectsConfiguration("explorer.compactFolders"));this._register(o(a=>this.tree.updateOptions({compressionEnabled:n()}))),lnt.bindTo(this.tree.contextKeyService),dnt.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(!(g_(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:x3.USER}},a.sideBySide?nv:pA)}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(tPe)})),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(YQ.TREE_VIEW_STATE_STORAGE_KEY,JSON.stringify(this.tree.getViewState()),Ie.WORKSPACE,cn.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(r=>r.id):[];this.availableEditorIdsContext.set(n.join(","))}else this.availableEditorIdsContext.reset()}async onContextMenu(e){if(aA(e.browserEvent.target))return;const t=e.element;let i=e.anchor;if(Jo(i)&&t){const a=this.renderer.getCompressedNavigationController(t);a&&a.length>0&&(g_(e.browserEvent)||h8t(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(),r=this.explorerService.roots;let o;if(t instanceof qd){const a=this.renderer.getCompressedNavigationController(t);o=a&&a.length?a[0].current.resource:t.resource}else o=r.length===1?r[0].resource:{};this.contextMenuService.showContextMenu({menuId:_e.ExplorerContext,menuActionOptions:{arg:o,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 qd?[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,r=this.fileService.hasCapability(t.resource,zn.Trash);this.resourceMoveableToTrash.set(n&&r)}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 Ght(e,t)}async setTreeInput(){if(!this.isBodyVisible())return Promise.resolve(void 0);this.setTreeInputPromise&&await this.setTreeInputPromise;const e=!this.tree.getInput();e&&ls("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(YQ.TREE_VIEW_STATE_STORAGE_KEY,Ie.WORKSPACE);a&&(n=JSON.parse(a))}const r=this.tree.getInput(),o=this.setTreeInputPromise=this.tree.setInput(i,n).then(async()=>{if(Array.isArray(i)){if(!n||r instanceof qd)for(let a=0;a{}),Array.isArray(r)){const a=new gi;r.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&&ls("code/didResolveExplorer")});this.progressService.withProgress({location:fd.Explorer,delay:this.layoutService.isRestored()?800:1500},a=>o),await o,this.decorationsProvider||(this.decorationsProvider=new BSe(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 r of n.children.values()){if(this.uriIdentityService.extUri.isEqualOrParent(e,r.resource)){n=r;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)&&A8t(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(E8t(this.tree,t)),this.storeTreeViewState()}dispose(){this.dragHandler?.dispose(),super.dispose()}},YQ=RR,RR.TREE_VIEW_STATE_STORAGE_KEY="workbench.explorer.treeViewState",RR);XW.__decorator=D([ei],XW.prototype,"fileCopiedContextKey",null);XW.__decorator=D([ei],XW.prototype,"resourceCutContextKey",null);XW=YQ=D([_(1,lo),_(2,Im),_(3,we),_(4,Ci),_(5,hg),_(6,ti),_(7,KU),_(8,NI),_(9,Vt),_(10,Le),_(11,Te),_(12,aE),_(13,Os),_(14,mn),_(15,Ji),_(16,tc),_(17,yf),_(18,Gi),_(19,gg),_(20,Xt),_(21,Is),_(22,bi),_(23,Ar)],XW);function nPe(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)}Et(class extends di{constructor(){super({id:"workbench.files.action.createFileFromExplorer",title:g(10058,"New File..."),f1:!1,icon:ve.newFile,precondition:cnt,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Vb),order:10}})}run(s){s.get(bi).executeCommand(tPe)}});Et(class extends di{constructor(){super({id:"workbench.files.action.createFolderFromExplorer",title:g(10059,"New Folder..."),f1:!1,icon:ve.newFolder,precondition:cnt,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Vb),order:20}})}run(s){s.get(bi).executeCommand(Snt)}});Et(class extends di{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",Vb),order:30},metadata:{description:Pe(10061,"Forces a refresh of the Explorer.")}})}async run(s){const e=s.get(Nm),t=s.get(yf);await e.openView(Vb),await t.refresh()}});Et(class extends di{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",Vb),order:40},metadata:{description:Pe(10063,"Folds all folders in the Explorer.")}})}run(s){const t=s.get(Nm).getViewWithId(Vb);t!==null&&t.collapseAll()}});var f5e;(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"})(f5e||(f5e={}));var p5e;(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"})(p5e||(p5e={}));const k8t="editor.contrib.defineKeybinding",I8t="settings";var GSe;const JQ=fe;let eee=class extends V{constructor(e,t,i,n,r){super(),this.data=e,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const o=t??(e.length>1?g(10569,"Used {0} references",e.length):g(10570,"Used {0} reference",1)),a=JQ(".chat-used-context-icon"),c=v=>v.usedReferencesExpanded?ve.chevronDown:ve.chevronRight;a.classList.add(...He.asClassNameArray(c(i)));const l=JQ(".chat-used-context-label",void 0),d=this._register(new Zd(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=JQ(".chat-used-context",void 0,l),d.label=o,d.element.prepend(a),this.updateAriaLabel(d.element,o,i.usedReferencesExpanded),this.domNode.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this._register(d.onDidClick(()=>{a.classList.remove(...He.asClassNameArray(c(i))),i.usedReferencesExpanded=!i.usedReferencesExpanded,a.classList.add(...He.asClassNameArray(c(i))),this.domNode.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this._onDidChangeHeight.fire(),this.updateAriaLabel(d.element,o,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&&r.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)}};eee=D([_(4,Ar)],eee);let KSe=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 Kce(()=>this.listFactory()))}listFactory(){const e=this._register(this.instantiationService.createInstance(KA,{onDidChangeVisibility:this._onDidChangeVisibility})),t=JQ(".chat-used-context-list");return this._register(nPe(t,this.themeService)),this.instantiationService.createInstance(Z_e,"ChatListRenderer",t,new T8t,[this.instantiationService.createInstance(tee,e)],{alwaysConsumeMouseWheel:!1,accessibilityProvider:{getAriaLabel:n=>{if(n.kind==="warning")return n.content.value;const r=n.reference;return"variableName"in r?r.variableName:N.isUri(r)?Kr(r.path):Kr(r.uri.path)},getWidgetAriaLabel:()=>g(10573,"Collapsible Chat List")},dnd:{getDragURI:n=>{if(n.kind==="warning")return null;const{reference:r}=n;return"variableName"in r?null:N.isUri(r)?r.toString():r.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)}}}};KSe=D([_(1,we),_(2,mn)],KSe);class T8t{getHeight(e){return 22}getTemplateId(e){return tee.TEMPLATE_ID}}var MR;let tee=(MR=class{constructor(e,t,i,n){this.labels=e,this.themeService=t,this.chatVariablesService=i,this.productService=n,this.templateId=GSe.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 He.isThemeIcon(e.iconPath)?e.iconPath:this.themeService.getColorTheme().type===cSe.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 r=e.reference,o=this.getReferenceIcon(e);if(i.label.element.style.display="flex","variableName"in r)if(r.value){const a=N.isUri(r.value)?r.value:r.value.uri;i.label.setResource({resource:a,name:TA(a),description:`#${r.variableName}`,range:"range"in r.value?r.value.range:void 0},{icon:o,title:e.options?.status?.description??e.title})}else{const a=this.chatVariablesService.getVariable(r.variableName),c=a?.icon?`$(${a.icon.id}) `:"",l=`#${r.variableName}`,d=`${c}${a?.fullName??l}`;i.label.setLabel(d,l,{title:e.options?.status?.description??a?.description})}else{const a="uri"in r?r.uri:r;if(a.scheme==="https"&&W2(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&&W2(a.authority,I8t)){const c=a.path.substring(1);i.label.setResource({resource:a,name:c},{icon:ve.settingsGear,title:g(10574,"Open setting '{0}'",c)})}else R8(a,pe.mailto,pe.http,pe.https)?i.label.setResource({resource:a,name:a.toString()},{icon:o??ve.globe,title:e.options?.status?.description??e.title??a.toString()}):i.label.setFile(a,{fileKind:wa.FILE,fileDecorations:{badges:!1,colors:!1},range:"range"in r?r.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===GW.Omitted||e.options?.status?.kind===GW.Partial?c.classList.add("warning"):c.classList.remove("warning"))}}disposeTemplate(e){e.templateDisposables.dispose()}},GSe=MR,MR.TEMPLATE_ID="chatCollapsibleListRenderer",MR);tee=GSe=D([_(1,mn),_(2,z6),_(3,xo)],tee);let qSe=class extends V{constructor(e,t,i,n,r){if(super(),this.task=e,e.progress.length){const o=this._register(r.createInstance(eee,e.progress,e.content.value,n.element,t));this.domNode=fe(".chat-progress-task"),this.domNode.appendChild(o.domNode),this.onDidChangeHeight=o.onDidChangeHeight}else{const o=e.isSettled?.()??!0,a=this._register(r.createInstance(ont,e,i,n,!o,!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)}};qSe=D([_(4,we)],qSe);const m5e=fe;let QSe=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this.textModelService=o,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))bs(l)&&l.response.value.every(d=>d.kind==="textEditGroup")?this.domNode=m5e(".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=m5e("div");else{const d=new li;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 oW;y.canComputeSHA1(p)&&(m=y.computeSHA1(p),e.state={sha1:m,applied:0})}const v=this.modelService.createModel(A6(p.createSnapshot()),{languageId:p.getLanguageId(),onDidChange:M.None},N.from({scheme:pe.vscodeChatCodeBlock,path:p.uri.path,query:ao()}),!1),b=await this.textModelService.createModelReference(v.uri);this._register(b);const w=[];if(bs(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||!Yi(A.uri,e.uri)))for(const L of A.edits){const k=L.map(TTe.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,r,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)}};QSe=D([_(5,pn),_(6,fi),_(7,Lm)],QSe);let jSe=class extends V{inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._pool=this._register(new Kce(()=>n.createInstance(LCe,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)}}}};jSe=D([_(3,we)],jSe);const L8t=fe;let iee=class extends V{constructor(e,t,i,n,r){super(),this.openerService=r,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const o=this._register(i.get());this.tree=o.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(()=>{o.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)}};iee=D([_(4,Ar)],iee);let YSe=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 Kce(()=>this.treeFactory()))}treeFactory(){const e=this._register(this.instantiationService.createInstance(KA,{onDidChangeVisibility:this._onDidChangeVisibility})),t=L8t(".interactive-response-progress-tree");return this._register(nPe(t,this.themeService)),this.instantiationService.createInstance(AJ,"ChatListRenderer",t,new JSe,new R8t,[new M8t(e,this.configService.getValue("explorer.decorations"))],new N8t,{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)}}}};YSe=D([_(1,we),_(2,Te),_(3,mn)],YSe);const eoe=class eoe{getHeight(e){return eoe.ITEM_HEIGHT}getTemplateId(e){return"chatListTreeTemplate"}};eoe.ITEM_HEIGHT=22;let JSe=eoe;class R8t{isIncompressible(e){return!e.children}}class M8t{constructor(e,t){this.labels=e,this.decorations=t,this.templateId="chatListTreeTemplate"}renderCompressedElements(e,t,i,n){i.label.element.style.display="flex";const r=e.element.elements.map(o=>o.label);i.label.setResource({resource:e.element.elements[0].uri,name:r},{title:e.element.elements[0].label,fileKind:e.children?wa.FOLDER:wa.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!==rn.Directory?i.label.setFile(e.element.uri,{fileKind:wa.FILE,hidePath:!0,fileDecorations:this.decorations}):i.label.setResource({resource:e.element.uri,name:e.element.label},{title:e.element.label,fileKind:wa.FOLDER,fileDecorations:this.decorations})}disposeTemplate(e){e.templateDisposables.dispose()}}class N8t{hasChildren(e){return!!e.children}async getChildren(e){return e.children??[]}}const _5e=fe;class v5e extends V{constructor(e,t,i){super(),this.domNode=_5e(".chat-notification-widget");let n,r;switch(e){case"warning":n=ve.warning,r=".chat-warning-codicon";break;case"error":n=ve.error,r=".chat-error-codicon";break;case"info":n=ve.info,r=".chat-info-codicon";break}this.domNode.appendChild(_5e(r,void 0,eC(n)));const o=i.render(t);this.domNode.appendChild(o.element)}hasSameContent(e){return e.kind==="warning"}}const P8t=["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 XSe=class extends Z_{constructor(e,t,i,n){super(e??{},t,i),this.trustedDomainService=n}render(e,t,i){t={...t,remoteImageIsAllowed:r=>this.trustedDomainService.isValid(r),sanitizerOptions:{replaceWithPlaintext:!0,allowedTags:P8t}};const n=e&&e.supportHtml?{...e,value:` -${e.value}`}:e;return super.render(n,t,i)}};XSe=D([_(1,Di),_(2,Ar),_(3,Sce)],XSe);var ZSe;const Bm=fe;var NR;let nee=(NR=class extends V{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(),this.location=t,this.rendererOptions=i,this.delegate=n,this.codeBlockModelCollection=r,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 gi,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(XSe,void 0)),this.markdownDecorationsRenderer=this.instantiationService.createInstance(OZ),this._editorPool=this._register(this.instantiationService.createInstance(aSe,e,n,o)),this._diffEditorPool=this._register(this.instantiationService.createInstance(jSe,e,n,o)),this._treePool=this._register(this.instantiationService.createInstance(YSe,this._onDidChangeVisibility.event)),this._contentReferencesListPool=this._register(this.instantiationService.createInstance(KSe,this._onDidChangeVisibility.event)),this._register(this.instantiationService.createInstance(TCe))}get templateId(){return ZSe.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 qa(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 Ac&&(k.item.id==="workbench.action.chat.voteDown"||k.item.id==="workbench.action.chat.voteUp")?b.createInstance(F8t,k,P):GN(b,k,P)}));const y=t.add(this.instantiationService.createInstance(FZ)),C=()=>{if(bs(L.currentElement)&&L.currentElement.agent&&!L.currentElement.agent.isDefault)return y.setAgent(L.currentElement.agent.id),y.domNode},A=rnt(()=>bs(L.currentElement)?L.currentElement.agent:void 0,this.commandService);t.add(this.hoverService.setupManagedHover(Fo("element"),l,C,A)),t.add(ue(l,ke.KEY_DOWN,k=>{const P=new xn(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=zu(e)?"request":bs(e)?"response":"welcome";this.traceLayout("renderElement",`${n}, index=${t}`),VPt.bindTo(i.contextKeyService).set(bs(e)),zPt.bindTo(i.contextKeyService).set(zu(e)),HPt.bindTo(i.contextKeyService).set(bs(e)&&e.agentOrSlashCommandDetected),bs(e)?(UPt.bindTo(i.contextKeyService).set(!!e.agent?.metadata.supportIssueReporting),IUe.bindTo(i.contextKeyService).set(e.vote===KW.Up?"up":e.vote===KW.Down?"down":"")):IUe.bindTo(i.contextKeyService).set(""),i.titleToolbar&&(i.titleToolbar.context=e);const r=!!(bs(e)&&e.errorDetails?.responseIsFiltered);if(vet.bindTo(i.contextKeyService).set(r),i.rowContainer.classList.toggle("interactive-request",zu(e)),i.rowContainer.classList.toggle("interactive-response",bs(e)),i.rowContainer.classList.toggle("interactive-welcome",aB(e)),i.rowContainer.classList.toggle("filtered-response",r),i.rowContainer.classList.toggle("show-detail-progress",bs(e)&&!e.isComplete&&!e.progressMessages.length),i.username.textContent=e.username,this.rendererOptions.noHeader||this.renderAvatar(e,i),Ns(i.detail),bs(e)&&this.renderDetail(e,i),bs(e)&&t===this.delegate.getListLength()-1&&(!e.isComplete||e.renderData)&&e.response.value.length){this.traceLayout("renderElement",`start progressive render ${n}, index=${t}`);const o=i.elementDisposables.add(new d6),a=c=>{try{this.doNextProgressiveRender(e,t,i,!!c)&&o.cancel()}catch(l){o.cancel(),this.logService.error(l)}};o.cancelAndSet(a,50,lt(i.rowContainer)),a(!0)}else bs(e)?this.basicRenderElement(e,t,i):zu(e)?this.basicRenderElement(e,t,i):this.renderWelcomeMessage(e,i)}renderDetail(e,t){t.elementDisposables.add(ci(i=>{this._renderDetail(e,t)}))}_renderDetail(e,t){if(Ns(t.detail),e.agentOrSlashCommandDetected){const i=e.slashCommand?g(7022,"used {0} [[(rerun without)]]",`${lI}${e.slashCommand.name}`):g(7023,"[[(rerun without)]]");ca(t.detail,JLe(i,{className:"agentOrSlashCommandDetected",inline:!0,actionHandler:{disposables:t.elementDisposables,callback:n=>{this._onDidClickRerunWithAgentOrCommandDetection.fire(e)}}}))}else e.isComplete||(t.detail.textContent=i5t)}renderAvatar(e,t){const i=bs(e)?this.getAgentIcon(e.agent?.metadata):e.avatarIcon??ve.account;if(i instanceof N){const n=fe("img.icon");n.src=sf.uriToBrowserUri(i).toString(!0),t.avatarContainer.replaceChildren(fe(".avatar",void 0,n))}else{const n=fe(He.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===ef.DARK?e.iconDark:e?.icon?e.icon:ve.copilot}basicRenderElement(e,t,i){let n=[];if(zu(e)){const c="message"in e.message?e.message.message:this.markdownDecorationsRenderer.convertParsedRequestToMarkdown(e.message);n=[{content:new Nt(c),kind:"markdownContent"}]}else bs(e)&&(e.contentReferences.length&&n.push({kind:"references",references:e.contentReferences}),n.push(...H4e(e.response.value)),e.codeCitations.length&&n.push({kind:"codeCitations",citations:e.codeCitations}));Ns(i.value),bs(e)&&this.renderDetail(e,i);const r=[];if(n.forEach((c,l)=>{const d={element:e,index:l,content:n,preceedingContentParts:r},h=this.renderChatContentPart(c,i,d);h&&(i.value.appendChild(h.domNode),r.push(h))}),i.renderedParts&&wt(i.renderedParts),i.renderedParts=r,zu(e)&&e.variables.length){const c=this.renderAttachments(e.variables,e.contentReferences,i);c&&(i.value.appendChild(c.domNode),i.elementDisposables.add(c))}if(bs(e)&&e.errorDetails?.message){const c=this.instantiationService.createInstance(v5e,e.errorDetails.responseIsFiltered?"info":"error",new Nt(e.errorDetails.message),this.renderer);i.elementDisposables.add(c),i.value.appendChild(c.domNode)}const o=i.rowContainer.offsetHeight,a=!e.currentRenderedHeight||e.currentRenderedHeight!==o;if(e.currentRenderedHeight=o,a){const c=i.elementDisposables.add(Ml(lt(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){Ns(t.value),e.content.forEach((r,o)=>{if(Array.isArray(r)){const a=t.elementDisposables.add(this.instantiationService.createChild(new Vc([Le,t.contextKeyService])));t.elementDisposables.add(a.createInstance(xZ,t.value,r,this.location,void 0,c=>this._onDidClickFollowup.fire(c)))}else{const a={element:e,index:o,content:[],preceedingContentParts:[]},c=this.renderMarkdown(r,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 r=t.elementDisposables.add(Ml(lt(t.value),()=>{e.currentRenderedHeight=t.rowContainer.offsetHeight,r.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 r=!1;this.traceLayout("doNextProgressiveRender",`START progressive render, index=${t}, renderData=${JSON.stringify(e.renderData)}`);const o=this.getNextProgressiveRenderContent(e),a=this.diff(i.renderedParts??[],o,e);if(r=a.every(l=>l===null),r)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,o,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 r=n.renderedParts??[];n.renderedParts=r,e.forEach((o,a)=>{if(!o)return;const c=n.renderedParts?.[a];c&&c.dispose();const l=r.slice(0,a),d={element:i,content:t,preceedingContentParts:l,index:a},h=this.renderChatContentPart(o,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);r[a]=h}else c&&c.domNode.remove()})}getNextProgressiveRenderContent(e){const t=this.getDataForProgressiveRender(e),i=H4e(e.response.value);this.traceLayout("getNextProgressiveRenderContent",`Want to render ${t.numWordsToRender} at ${t.rate} words/s, counting...`);let n=t.numWordsToRender;const r=[];e.contentReferences.length&&r.push({kind:"references",references:e.contentReferences});for(let l=0;l0&&a!==e.renderData?.renderedWordCount&&(e.renderData={lastRenderTime:Date.now(),renderedWordCount:a,renderedParts:r}),r}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 r=0;ra instanceof iee).length,o=this.instantiationService.createInstance(iee,n,i.element,this._treePool,r);if(o.addDisposable(o.onDidChangeHeight(()=>{this.updateItemHeight(t)})),bs(i.element)){const a={treeDataId:n.uri.toString(),treeIndex:r,focus(){o.domFocus()}};o.addDisposable(o.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,Ya(c,l=>l.treeDataId)),o.addDisposable(Ee(()=>this.fileTreesByResponseId.set(i.element.id,c.filter(l=>l.treeDataId!==n.uri.toString()))))}return o}renderContentReferencesListData(e,t,i,n){const r=this.instantiationService.createInstance(eee,e.references,t,i.element,this._contentReferencesListPool);return r.addDisposable(r.onDidChangeHeight(()=>{this.updateItemHeight(n)})),r}renderCodeCitationsListData(e,t,i){return this.instantiationService.createInstance(nSe,e,t)}renderProgressTask(e,t,i){if(!bs(i.element))return;const n=this.instantiationService.createInstance(qSe,e,this._contentReferencesListPool,this.renderer,i);return n.addDisposable(n.onDidChangeHeight(()=>{this.updateItemHeight(t)})),n}renderConfirmation(e,t,i){const n=this.instantiationService.createInstance(oSe,t,e);return n.addDisposable(n.onDidChangeHeight(()=>this.updateItemHeight(i))),n}renderAttachments(e,t,i){return this.instantiationService.createInstance(iSe,e,t,void 0)}renderTextEdit(e,t,i){const n=this.instantiationService.createInstance(QSe,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,r=bs(n)&&(!n.isComplete||n.isCanceled||n.errorDetails?.responseIsFiltered||n.errorDetails?.responseIsIncomplete||!!n.renderData),o=i.preceedingContentParts.reduce((l,d)=>l+(d instanceof BZ?d.codeblocks.length:0),0),a=this.instantiationService.createInstance(BZ,e,i,this._editorPool,r,o,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[o+h])})),a.codeblocks.forEach((l,d)=>{if(c[o+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{wt(Oi(i.renderedParts)),i.renderedParts=void 0,Ns(i.value)}catch(n){throw n}i.currentElement=void 0,i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}},ZSe=NR,NR.ID="item",NR);nee=ZSe=D([_(6,we),_(7,Te),_(8,Ke),_(9,Le),_(10,mn),_(11,bi),_(12,tc)],nee);let eAe=class{constructor(e,t){this.defaultElementHeight=e,this.logService=t}_traceLayout(e,t){this.logService.trace(`ChatListDelegate#${e}: ${t}`)}getHeight(e){const t=zu(e)?"request":"response",i=("currentRenderedHeight"in e?e.currentRenderedHeight:void 0)??this.defaultElementHeight;return this._traceLayout("getHeight",`${t}, height=${i}`),i}getTemplateId(e){return nee.ID}hasDynamicHeight(e){return!0}};eAe=D([_(1,Ke)],eAe);class F8t extends Pb{render(e){super.render(e),e.classList.toggle("checked",this.action.checked)}}var XQ,Ck;let tAe=(Ck=class extends V{get configuration(){return this._config}constructor(e,t,i,n,r,o,a){super(),this.foreground=t,this.inputEditorBackgroundColor=i,this.resultEditorBackgroundColor=n,this.configurationService=r,this.themeService=o,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=>{XQ.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:XQ.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()}},XQ=Ck,Ck.lineHeightEm=1.4,Ck.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"],Ck);tAe=XQ=D([_(4,Te),_(5,mn),_(6,Im)],tAe);const O8t=/^@([\w_\-\.]+)(?=(\s|$|\b))/i,B8t=/^#([\w_\-]+)(:\d+)?(?=(\s|$|\b))/i,W8t=/\/([\w_\-]+)(?=(\s|$|\b))/i;let see=class{constructor(e,t,i){this.agentService=e,this.variableService=t,this.slashCommandService=i}parseChatRequest(e,t,i=To.Panel,n){const r=[],o=this.variableService.getDynamicVariables(e);let a=1,c=1;for(let h=0;h`}:e;return super.render(n,t,i)}};XSe=D([_(1,Di),_(2,Ar),_(3,Sce)],XSe);var ZSe;const Bm=fe;var NR;let nee=(NR=class extends V{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(),this.location=t,this.rendererOptions=i,this.delegate=n,this.codeBlockModelCollection=r,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 gi,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(XSe,void 0)),this.markdownDecorationsRenderer=this.instantiationService.createInstance(OZ),this._editorPool=this._register(this.instantiationService.createInstance(aSe,e,n,o)),this._diffEditorPool=this._register(this.instantiationService.createInstance(jSe,e,n,o)),this._treePool=this._register(this.instantiationService.createInstance(YSe,this._onDidChangeVisibility.event)),this._contentReferencesListPool=this._register(this.instantiationService.createInstance(KSe,this._onDidChangeVisibility.event)),this._register(this.instantiationService.createInstance(TCe))}get templateId(){return ZSe.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 Qa(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 Ac&&(k.item.id==="workbench.action.chat.voteDown"||k.item.id==="workbench.action.chat.voteUp")?b.createInstance(F8t,k,P):GN(b,k,P)}));const y=t.add(this.instantiationService.createInstance(FZ)),C=()=>{if(bs(L.currentElement)&&L.currentElement.agent&&!L.currentElement.agent.isDefault)return y.setAgent(L.currentElement.agent.id),y.domNode},A=rnt(()=>bs(L.currentElement)?L.currentElement.agent:void 0,this.commandService);t.add(this.hoverService.setupManagedHover(Fo("element"),l,C,A)),t.add(ue(l,ke.KEY_DOWN,k=>{const P=new xn(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=zu(e)?"request":bs(e)?"response":"welcome";this.traceLayout("renderElement",`${n}, index=${t}`),VPt.bindTo(i.contextKeyService).set(bs(e)),zPt.bindTo(i.contextKeyService).set(zu(e)),HPt.bindTo(i.contextKeyService).set(bs(e)&&e.agentOrSlashCommandDetected),bs(e)?(UPt.bindTo(i.contextKeyService).set(!!e.agent?.metadata.supportIssueReporting),IUe.bindTo(i.contextKeyService).set(e.vote===KW.Up?"up":e.vote===KW.Down?"down":"")):IUe.bindTo(i.contextKeyService).set(""),i.titleToolbar&&(i.titleToolbar.context=e);const r=!!(bs(e)&&e.errorDetails?.responseIsFiltered);if(vet.bindTo(i.contextKeyService).set(r),i.rowContainer.classList.toggle("interactive-request",zu(e)),i.rowContainer.classList.toggle("interactive-response",bs(e)),i.rowContainer.classList.toggle("interactive-welcome",aB(e)),i.rowContainer.classList.toggle("filtered-response",r),i.rowContainer.classList.toggle("show-detail-progress",bs(e)&&!e.isComplete&&!e.progressMessages.length),i.username.textContent=e.username,this.rendererOptions.noHeader||this.renderAvatar(e,i),Ns(i.detail),bs(e)&&this.renderDetail(e,i),bs(e)&&t===this.delegate.getListLength()-1&&(!e.isComplete||e.renderData)&&e.response.value.length){this.traceLayout("renderElement",`start progressive render ${n}, index=${t}`);const o=i.elementDisposables.add(new d6),a=c=>{try{this.doNextProgressiveRender(e,t,i,!!c)&&o.cancel()}catch(l){o.cancel(),this.logService.error(l)}};o.cancelAndSet(a,50,lt(i.rowContainer)),a(!0)}else bs(e)?this.basicRenderElement(e,t,i):zu(e)?this.basicRenderElement(e,t,i):this.renderWelcomeMessage(e,i)}renderDetail(e,t){t.elementDisposables.add(ci(i=>{this._renderDetail(e,t)}))}_renderDetail(e,t){if(Ns(t.detail),e.agentOrSlashCommandDetected){const i=e.slashCommand?g(7022,"used {0} [[(rerun without)]]",`${lI}${e.slashCommand.name}`):g(7023,"[[(rerun without)]]");ca(t.detail,JLe(i,{className:"agentOrSlashCommandDetected",inline:!0,actionHandler:{disposables:t.elementDisposables,callback:n=>{this._onDidClickRerunWithAgentOrCommandDetection.fire(e)}}}))}else e.isComplete||(t.detail.textContent=i5t)}renderAvatar(e,t){const i=bs(e)?this.getAgentIcon(e.agent?.metadata):e.avatarIcon??ve.account;if(i instanceof N){const n=fe("img.icon");n.src=sf.uriToBrowserUri(i).toString(!0),t.avatarContainer.replaceChildren(fe(".avatar",void 0,n))}else{const n=fe(He.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===ef.DARK?e.iconDark:e?.icon?e.icon:ve.copilot}basicRenderElement(e,t,i){let n=[];if(zu(e)){const c="message"in e.message?e.message.message:this.markdownDecorationsRenderer.convertParsedRequestToMarkdown(e.message);n=[{content:new Nt(c),kind:"markdownContent"}]}else bs(e)&&(e.contentReferences.length&&n.push({kind:"references",references:e.contentReferences}),n.push(...H4e(e.response.value)),e.codeCitations.length&&n.push({kind:"codeCitations",citations:e.codeCitations}));Ns(i.value),bs(e)&&this.renderDetail(e,i);const r=[];if(n.forEach((c,l)=>{const d={element:e,index:l,content:n,preceedingContentParts:r},h=this.renderChatContentPart(c,i,d);h&&(i.value.appendChild(h.domNode),r.push(h))}),i.renderedParts&&wt(i.renderedParts),i.renderedParts=r,zu(e)&&e.variables.length){const c=this.renderAttachments(e.variables,e.contentReferences,i);c&&(i.value.appendChild(c.domNode),i.elementDisposables.add(c))}if(bs(e)&&e.errorDetails?.message){const c=this.instantiationService.createInstance(v5e,e.errorDetails.responseIsFiltered?"info":"error",new Nt(e.errorDetails.message),this.renderer);i.elementDisposables.add(c),i.value.appendChild(c.domNode)}const o=i.rowContainer.offsetHeight,a=!e.currentRenderedHeight||e.currentRenderedHeight!==o;if(e.currentRenderedHeight=o,a){const c=i.elementDisposables.add(Nl(lt(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){Ns(t.value),e.content.forEach((r,o)=>{if(Array.isArray(r)){const a=t.elementDisposables.add(this.instantiationService.createChild(new Vc([Le,t.contextKeyService])));t.elementDisposables.add(a.createInstance(xZ,t.value,r,this.location,void 0,c=>this._onDidClickFollowup.fire(c)))}else{const a={element:e,index:o,content:[],preceedingContentParts:[]},c=this.renderMarkdown(r,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 r=t.elementDisposables.add(Nl(lt(t.value),()=>{e.currentRenderedHeight=t.rowContainer.offsetHeight,r.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 r=!1;this.traceLayout("doNextProgressiveRender",`START progressive render, index=${t}, renderData=${JSON.stringify(e.renderData)}`);const o=this.getNextProgressiveRenderContent(e),a=this.diff(i.renderedParts??[],o,e);if(r=a.every(l=>l===null),r)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,o,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 r=n.renderedParts??[];n.renderedParts=r,e.forEach((o,a)=>{if(!o)return;const c=n.renderedParts?.[a];c&&c.dispose();const l=r.slice(0,a),d={element:i,content:t,preceedingContentParts:l,index:a},h=this.renderChatContentPart(o,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);r[a]=h}else c&&c.domNode.remove()})}getNextProgressiveRenderContent(e){const t=this.getDataForProgressiveRender(e),i=H4e(e.response.value);this.traceLayout("getNextProgressiveRenderContent",`Want to render ${t.numWordsToRender} at ${t.rate} words/s, counting...`);let n=t.numWordsToRender;const r=[];e.contentReferences.length&&r.push({kind:"references",references:e.contentReferences});for(let l=0;l0&&a!==e.renderData?.renderedWordCount&&(e.renderData={lastRenderTime:Date.now(),renderedWordCount:a,renderedParts:r}),r}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 r=0;ra instanceof iee).length,o=this.instantiationService.createInstance(iee,n,i.element,this._treePool,r);if(o.addDisposable(o.onDidChangeHeight(()=>{this.updateItemHeight(t)})),bs(i.element)){const a={treeDataId:n.uri.toString(),treeIndex:r,focus(){o.domFocus()}};o.addDisposable(o.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,Ya(c,l=>l.treeDataId)),o.addDisposable(Ee(()=>this.fileTreesByResponseId.set(i.element.id,c.filter(l=>l.treeDataId!==n.uri.toString()))))}return o}renderContentReferencesListData(e,t,i,n){const r=this.instantiationService.createInstance(eee,e.references,t,i.element,this._contentReferencesListPool);return r.addDisposable(r.onDidChangeHeight(()=>{this.updateItemHeight(n)})),r}renderCodeCitationsListData(e,t,i){return this.instantiationService.createInstance(nSe,e,t)}renderProgressTask(e,t,i){if(!bs(i.element))return;const n=this.instantiationService.createInstance(qSe,e,this._contentReferencesListPool,this.renderer,i);return n.addDisposable(n.onDidChangeHeight(()=>{this.updateItemHeight(t)})),n}renderConfirmation(e,t,i){const n=this.instantiationService.createInstance(oSe,t,e);return n.addDisposable(n.onDidChangeHeight(()=>this.updateItemHeight(i))),n}renderAttachments(e,t,i){return this.instantiationService.createInstance(iSe,e,t,void 0)}renderTextEdit(e,t,i){const n=this.instantiationService.createInstance(QSe,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,r=bs(n)&&(!n.isComplete||n.isCanceled||n.errorDetails?.responseIsFiltered||n.errorDetails?.responseIsIncomplete||!!n.renderData),o=i.preceedingContentParts.reduce((l,d)=>l+(d instanceof BZ?d.codeblocks.length:0),0),a=this.instantiationService.createInstance(BZ,e,i,this._editorPool,r,o,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[o+h])})),a.codeblocks.forEach((l,d)=>{if(c[o+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{wt(Oi(i.renderedParts)),i.renderedParts=void 0,Ns(i.value)}catch(n){throw n}i.currentElement=void 0,i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}},ZSe=NR,NR.ID="item",NR);nee=ZSe=D([_(6,we),_(7,Te),_(8,Ke),_(9,Le),_(10,mn),_(11,bi),_(12,tc)],nee);let eAe=class{constructor(e,t){this.defaultElementHeight=e,this.logService=t}_traceLayout(e,t){this.logService.trace(`ChatListDelegate#${e}: ${t}`)}getHeight(e){const t=zu(e)?"request":"response",i=("currentRenderedHeight"in e?e.currentRenderedHeight:void 0)??this.defaultElementHeight;return this._traceLayout("getHeight",`${t}, height=${i}`),i}getTemplateId(e){return nee.ID}hasDynamicHeight(e){return!0}};eAe=D([_(1,Ke)],eAe);class F8t extends Pb{render(e){super.render(e),e.classList.toggle("checked",this.action.checked)}}var XQ,Ck;let tAe=(Ck=class extends V{get configuration(){return this._config}constructor(e,t,i,n,r,o,a){super(),this.foreground=t,this.inputEditorBackgroundColor=i,this.resultEditorBackgroundColor=n,this.configurationService=r,this.themeService=o,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=>{XQ.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:XQ.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()}},XQ=Ck,Ck.lineHeightEm=1.4,Ck.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"],Ck);tAe=XQ=D([_(4,Te),_(5,mn),_(6,Im)],tAe);const O8t=/^@([\w_\-\.]+)(?=(\s|$|\b))/i,B8t=/^#([\w_\-]+)(:\d+)?(?=(\s|$|\b))/i,W8t=/\/([\w_\-]+)(?=(\s|$|\b))/i;let see=class{constructor(e,t,i){this.agentService=e,this.variableService=t,this.slashCommandService=i}parseChatRequest(e,t,i=To.Panel,n){const r=[],o=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(o)||r.some(w=>w instanceof qg)||r.some(w=>w instanceof ub&&w.text.trim()!==""||!(w instanceof qg)))return;const v=r.at(-1)?.range.endExclusive??0;if(t.slice(v,i).trim()==="")return new qg(h,u,p)}tryToParseVariable(e,t,i,n){const r=e.match(B8t);if(!r)return;const[o,a]=r,c=r[2]??"",l=new _i(t,t+o.length),d=new F(i.lineNumber,i.column,i.lineNumber,i.column+o.length),h=n.find(p=>p instanceof qg),u=!h||h.agent.metadata.supportsSlowVariables,f=this.variableService.getVariable(a);if(f&&(!f.isSlow||u))return new A9(l,d,a,c,f.id)}tryToParseSlashCommand(e,t,i,n,r,o){const a=e.match(W8t);if(!a||r.some(f=>f instanceof zW))return;const[c,l]=a,d=new _i(i,i+c.length),h=new F(n.lineNumber,n.column,n.lineNumber,n.column+c.length),u=r.find(f=>f instanceof qg);if(u){if(r.some(b=>b instanceof ub&&b.text.trim()!==""||!(b instanceof qg)&&!(b instanceof ub)))return;const p=r.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 nN(d,h,v)}else{const p=this.slashCommandService.getCommands(o).find(m=>m.command===l);if(p)return new zW(d,h,p);{const v=this.agentService.getDefaultAgent(o)?.slashCommands.find(b=>b.name===l);if(v)return new nN(d,h,v)}}}tryToParseDynamicVariable(e,t,i,n){const r=n.find(o=>o.range.startLineNumber===i.lineNumber&&o.range.startColumn===i.column);if(r){const o=r.range.endColumn-r.range.startColumn,a=e.substring(0,o),c=new _i(t,t+o);return new $W(c,r.range,a,r.id,r.modelDescription,r.data)}}};see=D([_(0,wf),_(1,z6),_(2,SMe)],see);let iAe=class extends V{constructor(e,t){super(),this.languageService=e,this.textModelService=t,this._models=new gi,this.maxModelCount=100}dispose(){super.dispose(),this.clear()}get(e,t,i){const n=this.getUri(e,t,i),r=this._models.get(n);if(r)return{model:r.model.then(o=>o.object),vulns:r.vulns}}getOrCreate(e,t,i){const n=this.get(e,t,i);if(n)return n;const r=this.getUri(e,t,i),o=this.textModelService.createModelReference(r);for(this._models.set(r,{model:o,vulns:[]});this._models.size>this.maxModelCount;){const a=Array.from(this._models.keys()).at(0);if(!a)break;this.delete(a)}return{model:o.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 r=this.getOrCreate(e,t,i),o=h5t(n.text),a=H8t(o.newText,n.languageId);this.setVulns(e,t,i,o.vulnerabilities);const c=(await r.model).textEditorModel;if(n.languageId){const d=this.languageService.getLanguageIdByLanguageName(n.languageId);d&&d!==c.getLanguageId()&&c.setLanguage(d)}const l=c.getValue(gr.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 r=this.getUri(e,t,i),o=this._models.get(r);o&&(o.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(bs(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}})}}};iAe=D([_(0,Di),_(1,pn)],iAe);function H8t(s,e){return e==="php"&&!s.trim().startsWith("<")?`e instanceof qg))),this.parsedChatRequest}get scopedContextKeyService(){return this.contextKeyService}get location(){return this._location.location}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m){super(),this.viewContext=t,this.viewOptions=i,this.styles=n,this.contextKeyService=o,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},KPt.bindTo(o).set(!0),QPt.bindTo(o).set(this._location.location),jPt.bindTo(o).set("resource"in t),this.agentInInput=wet.bindTo(o),this.requestInProgress=e9.bindTo(o),this._register(d.register(this)),this._codeBlockModelCollection=this._register(a.createInstance(iAe)),this._register(r.registerCodeEditorOpenHandler(async(v,b,w)=>{let y=v.resource;if(IA(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 Ao(0);for(const L of this.renderer.editorsInUse()??[])if(Dn.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(tAe,t,this.styles.listForeground,this.styles.inputEditorBackground,this.styles.resultEditorBackground));const i=this.viewOptions.renderInputOnTop??!1,n=this.viewOptions.renderFollowups??!i,r=this.viewOptions.renderStyle;this.container=oe(e,Fue(".interactive-session")),i?(this.createInput(this.container,{renderFollowups:n,renderStyle:r}),this.listContainer=oe(this.container,Fue(".interactive-list"))):(this.listContainer=oe(this.container,Fue(".interactive-list")),this.createInput(this.container,{renderFollowups:n,renderStyle:r})),this.createList(this.listContainer,{...this.viewOptions.rendererOptions,renderStyle:r}),this._register(this.editorOptions.onDidChange(()=>this.onDidStyleChange())),this.onDidStyleChange(),this.viewModel&&(this.onDidChangeItems(),SP(this.tree)),this.contribs=nAe.CONTRIBS.map(o=>{try{return this._register(this.instantiationService.createInstance(o,this))}catch(a){this.logService.error("Failed to instantiate chat widget contrib",Po(a));return}}).filter(Oc),this.contribs.forEach(o=>{o.onDidChangeInputState&&this._register(o.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(!bs(e))return;const i=this.viewModel?.getItems();if(!i)return;const n=i.filter(a=>bs(a)),r=n.indexOf(e);if(r===void 0)return;const o=t==="next"?r+1:r-1;if(!(o<0||o>n.length-1))return n[o]}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=>(bs(n)||zu(n)?n.dataId:n.id)+(aB(n)&&this.viewModel?`_${Ng[this.viewModel.initState]}`:"")+`${zu(n)||aB(n)}${bs(n)&&n.renderData?`_${this.visibleChangeCount}`:""}`+(bs(n)?`_${n.contentReferences.length}`:"")+(zu(n)&&n.contentReferences?`_${n.contentReferences?.length}`:"")}}),!e&&this._dynamicMessageLayoutData&&this.layoutDynamicChatTreeItemMode();const i=t[t.length-1]?.element;i&&bs(i)&&i.isComplete?this.renderFollowups(i.replyFollowups,i):i&&aB(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(Zy(()=>{this._visible&&this.onDidChangeItems(!0)},0)):t&&this._onDidHide.fire()}createList(e,t){const i=this._register(this._register(this.instantiationService.createChild(new Vc([Le,this.contextKeyService])))),n=i.createInstance(eAe,this.viewOptions.defaultElementHeight??200),r={getListLength:()=>this.tree.getNode(null).visibleChildrenCount,onDidScroll:this.onDidScroll},o=document.createElement("div");o.classList.add("chat-overflow-widget-container","monaco-editor"),e.append(o),this.renderer=this._register(i.createInstance(nee,this.editorOptions,this.location,t,r,this._codeBlockModelCollection,o)),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(N3,"Chat",e,n,[this.renderer],{identityProvider:{getId:a=>a.id},horizontalScrolling:!1,alwaysConsumeMouseWheel:!1,supportDynamicHeights:!0,hideTwistiesOfChildlessElements:!0,accessibilityProvider:this.instantiationService.createInstance(BCe),keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>zu(a)?a.message:bs(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([[vet.key,bs(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&&Ml(lt(this.listContainer),()=>{SP(this.tree)},0),this.previousTreeScrollHeight=this.tree.scrollHeight,this._onDidChangeContentHeight.fire()}createInput(e,t){this.inputPart=this._register(this.instantiationService.createInstance(DZ,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 r=(typeof i=="object"&&i?.[n.id])??{};n.setInputState(r)}})})),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 r=this.chatAgentService.getAgent(i.followup.agentId);if(!r)return;this.lastSelectedAgent=r,n=`${i4}${r.name} `,i.followup.subCommand&&(n+=`${lI}${i.followup.subCommand} `)}else!i.followup.agentId&&i.followup.subCommand&&this.chatSlashCommandService.hasCommand(i.followup.subCommand)&&(n=`${lI}${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(wCe,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&&(SP(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(),SP(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,r=!e||"prefix"in e,o=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(o)return this.inputPart.acceptInput(r),this._onDidSubmitAgent.fire({agent:o.agent,slashCommand:o.slashCommand}),this.inputPart.updateState(this.collectInputState()),this.inputPart.clearContext(),o.responseCompletePromise.then(()=>{const a=this.viewModel?.getItems().filter(bs),c=a?.[a.length-1];this.chatAccessibilityService.acceptResponse(c,i)}),o.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 wn(t,e),this.inputPart.layout(e,t);const i=this.inputPart.inputPartHeight,n=this.tree.scrollTop+this.tree.renderHeight>=this.tree.scrollHeight,r=e-i;this.tree.layout(r,t),this.tree.getHTMLElement().style.height=`${r}px`,this.renderer.layout(t),n&&SP(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 yn);this._register(this.tree.onDidScroll(n=>{this._dynamicMessageLayoutData?.enabled&&(i.value=Ml(lt(this.listContainer),()=>{if(!n.scrollTopChanged||n.heightChanged||n.scrollHeightChanged)return;const r=n.height,o=n.scrollHeight-r-n.scrollTop;if(o===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(r+o,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,r=this.bodyDimension.width;ta.currentRenderedHeight===void 0),o=r?this._dynamicMessageLayoutData.maxHeight:n.reduce((a,c)=>a+c.currentRenderedHeight,0);this.layout(Math.min(t+o+(i.length>2?18:0),this._dynamicMessageLayoutData.maxHeight),e),(r||!o)&&SP(this.tree)}saveState(){this.inputPart.saveState()}getViewState(){return this.inputPart.saveState(),{inputValue:this.getInput(),inputState:this.collectInputState()}}},nAe=PR,PR.CONTRIBS=[],PR);I9=nAe=D([_(4,qt),_(5,Le),_(6,we),_(7,Lm),_(8,wf),_(9,qN),_(10,lo),_(11,jXe),_(12,Ke),_(13,mn),_(14,SMe)],I9);var ZQ;let sAe=class{constructor(e,t,i,n,r,o,a,c,l,d,h){this._instantiationService=i,this._contextKeyService=n,this._keybindingService=r,this._accessibilityService=o,this._configurationService=a,this._accessibleViewService=c,this._textModelResolverService=l,this._chatService=d,this._hoverService=h,this._elements=Wt("div.inline-chat@root",[Wt("div.chat-widget@chatWidget"),Wt("div.accessibleViewer@accessibleViewer"),Wt("div.status@status",[Wt("div.label.info.hidden@infoLabel"),Wt("div.actions.text-style.hidden@toolbar1"),Wt("div.actions.button-style.hidden@toolbar2"),Wt("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 Vc([Le,this.scopedContextKeyService]),this._store);this._chatWidget=u.createInstance(I9,e,{resource:!0},{defaultElementHeight:32,renderStyle:"minimal",renderInputOnTop:!1,renderFollowups:!0,supportsFileReferences:a.getValue(`chat.experimental.variables.${e.location}`)===!0,filter:C=>!aB(C),...t.chatWidgetViewOptions},{listForeground:L5t,listBackground:CCe,inputEditorBackground:Y2,resultEditorBackground:Uc}),this._chatWidget.render(this._elements.chatWidget),this._elements.chatWidget.style.setProperty(cae(ozt),$e(CCe)),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=_5t.bindTo(this._contextKeyService);const p=this._store.add(Ec(this.domNode));this._store.add(p.onDidBlur(()=>this._ctxResponseFocused.set(!1))),this._store.add(p.onDidFocus(()=>this._ctxResponseFocused.set(!0))),this._ctxInputEditorFocused=m5t.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(Cm,this._elements.toolbar1,m,{hiddenItemStrategy:hA.NoHide,telemetrySource:t.chatWidgetViewOptions?.menus?.telemetrySource,actionViewItemProvider:C=>C instanceof Ac?this._instantiationService.createInstance(N6,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(OCe,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(Kh.ExpTextButtons));this._store.add(this._configurationService.onDidChangeConfiguration(C=>C.affectsConfiguration(Kh.ExpTextButtons)&&y())),y(),this._store.add(this._configurationService.onDidChangeConfiguration(C=>{C.affectsConfiguration(bo.InlineChat)&&this._updateAriaLabel()})),this._elements.root.tabIndex=0,this._elements.statusLabel.tabIndex=0,this._updateAriaLabel(),this._store.add(this._hoverService.setupManagedHover(Fo("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(AZ,void 0,To.Editor)),this._defaultChatModel.startInitialize(),this._defaultChatModel.initialize(void 0),this.setChatModel(this._defaultChatModel)}_updateAriaLabel(){if(this._elements.root.ariaLabel=this._accessibleViewService.getOpenAriaHint(bo.InlineChat),this._accessibilityService.isScreenReaderOptimized()){let e=U8t;if(this._configurationService.getValue(bo.InlineChat)){const t=this._keybindingService.lookupKeybinding(eh.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=vb(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:vb(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(bs(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 ht(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(r=>bs(r));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(tr(e))return Eg(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 o of n.getRequests())n.removeRequest(o.id);return}const r=n.addRequest({parts:[],text:""},{variables:[]},0);if(n.acceptResponseProgress(r,{kind:"markdownContent",content:e.message}),!t){n.completeResponse(r);return}return{cancel:()=>n.cancelRequest(r),complete:()=>n.completeResponse(r),appendContent:o=>{n.acceptResponseProgress(r,{kind:"markdownContent",content:new Nt(o)})}}}updateInfo(e){this._elements.infoLabel.classList.toggle("hidden",!e);const t=Ib(e);ca(this._elements.infoLabel,...t),this._onDidChangeHeight.fire()}updateStatus(e,t={}){const i=typeof t.resetAfter=="number";if(i&&!this._elements.statusLabel.dataset.state){const r=this._elements.statusLabel.innerText,o=this._elements.statusLabel.dataset.title,a=Array.from(this._elements.statusLabel.classList.values());setTimeout(()=>{this.updateStatus(r,{classes:a,keepMessage:!0,title:o})},t.resetAfter)}const n=Ib(e);ca(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),ca(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(Wc())}};sAe=D([_(2,we),_(3,Le),_(4,Vt),_(5,_o),_(6,Te),_(7,Tm),_(8,pn),_(9,Lm),_(10,tc)],sAe);const U8t=g(11377,"Inline Chat Input");let rAe=class extends sAe{constructor(e,t,i,n,r,o,a,c,l,d,h,u){super(e,{...i,chatWidgetViewOptions:{...i.chatWidgetViewOptions,editorOverflowWidgetsDomNode:t.getOverflowWidgetsDomNode()}},o,n,r,a,c,l,d,h,u),this._parentEditor=t,this._accessibleViewer=this._store.add(new yn)}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(oAe,this._elements.accessibleViewer,e,t,new V8t(this._parentEditor,e,t)),this._onDidChangeHeight.fire()}};rAe=D([_(3,Le),_(4,Vt),_(5,we),_(6,_o),_(7,Te),_(8,Tm),_(9,pn),_(10,Lm),_(11,tc)],rAe);let oAe=ZQ=class extends Px{set width(e){this._width2.set(e,void 0)}constructor(e,t,i,n,r){const o=Yt("width",0),a=Yt("diff",ZQ._asMapping(i)),c=et(h=>[a.read(h)]),l=Math.min(10,8+a.get().changedLineCount),d=n.getModifiedOptions().get(x.lineHeight)*l;super(e,rd(!0),()=>{},rd(!1),o,rd(d),c,n,r),this.height=d,this._width2=o,this._store.add(t.textModelN.onDidChangeContent(()=>{a.set(ZQ._asMapping(i),void 0)}))}static _asMapping(e){const t=e.getRanges0(),i=e.getRangesN(),n=mi.fromRangeInclusive(t[0]),r=mi.fromRangeInclusive(i[0]),o=[];for(let a=1;a{this._ctxCursorPosition.reset()})),this.widget=this._instaService.createInstance(rAe,e,this.editor,{statusMenuId:{menu:T5t,options:{buttonConfigProvider:l=>new Set([D5t,k5t]).has(l.id)?{isSecondary:!0,showIcon:!0,showLabel:!1}:l.id===x5t?{isSecondary:!1}:{isSecondary:!0}}},chatWidgetViewOptions:{menus:{executeToolbar:Zit,telemetrySource:"interactiveEditorWidget-toolbar"},rendererOptions:{renderTextEditsAsSummary:l=>Yi(l,t.getModel()?.uri)&&o.getValue(Kh.Mode)===Hy.Live}}}),this._disposables.add(this.widget);let a;this._disposables.add(this.widget.chatWidget.onWillMaybeChangeHeight(()=>{this.position&&(a=ax.capture(this.editor))})),this._disposables.add(this.widget.onDidChangeHeight(()=>{if(this.position){a??=ax.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 wn(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){Lt(this.container);const t=ax.capture(this.editor),i=this.editor.getLayoutInfo(),n=i.glyphMarginWidth+i.decorationsWidth+i.lineNumbersWidth;this.container.style.marginLeft=`${n}px`;const r=this._computeHeight();super.show(e,r.linesValue),this.widget.chatWidget.setVisible(!0),this.widget.focus(),t.restore(this.editor),this._revealTopOfZoneWidget(e,r)}updatePositionAndHeight(e){const t=ax.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(),r=this.editor.getTopForLineNumber(i),o=r-t.pixelsValue,a=this.editor.getLayoutInfo().height,c=this.editor.getBottomForLineNumber(i);let l=o,d=!1;c>=n+a&&(l=c-a,d=!0),(l!1},{listForeground:Nl,listBackground:CCe,inputEditorBackground:Y2,resultEditorBackground:Uc}),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"),r.getValue(Kh.ExpTextButtons)&&(this._toolbarContainer.style.display="inherit",this._domNode.style.paddingBottom="4px"),this._domNode.appendChild(this._toolbarContainer);const c=this._store.add(a.createInstance(Cm,this._toolbarContainer,I5t,{actionViewItemProvider:h=>h instanceof Ac?i.createInstance(N6,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=Ec(this._domNode);this._store.add(d.onDidBlur(()=>{this._visible&&!l&&!o.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:[ts.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),lqe(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),_t.Immediate);const t=this._editor.getModel()?.getWordAtPosition(e);this._position=t?new re(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??"")}};cAe=D([_(2,we),_(3,Le),_(4,Te),_(5,Tn)],cAe);let ree=class extends Ub{get capabilities(){let e=xi.CanSplitInGroup;return this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=xi.Readonly):e|=xi.Untitled,e&xi.Readonly||(e|=xi.CanDropIntoEditor),e}get preferredResource(){return this._preferredResource}constructor(e,t,i,n,r,o,a){super(),this.resource=e,this.labelService=i,this.fileService=n,this.filesConfigurationService=r,this.textResourceConfigurationService=o,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){Yi(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=Rs.MEDIUM){switch(e){case Rs.SHORT:return this.shortDescription;case Rs.LONG:return this.longDescription;case Rs.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(Ro(this._preferredResource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(Ro(this._preferredResource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(Ro(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 Rs.SHORT:return this.shortTitle;case Rs.LONG:return this.longTitle;default:case Rs.MEDIUM:return this.mediumTitle}}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource)}ensureLimits(e){if(e?.limits)return e.limits;const t=bEt(this.resource);let i;const n=this.textResourceConfigurationService.inspect(this.resource,null,"workbench.editorLargeFileConfirmation");return Egt(n)&&(i=n.value*Pc.MB),{size:i??t}}};ree=D([_(2,Os),_(3,Xt),_(4,bd),_(5,xc),_(6,cE)],ree);let T9=class extends hI{constructor(e,t,i,n,r){super(i,t,n,r,e)}dispose(){this.textEditorModelHandle&&this.modelService.destroyModel(this.textEditorModelHandle),super.dispose()}};T9=D([_(1,Di),_(2,fi),_(3,j6),_(4,_o)],T9);var ej;let gb=class extends ree{constructor(e,t,i,n,r,o,a,c,l){super(e,t,r,o,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)}};gb=D([_(2,ti),_(3,Fr),_(4,Os),_(5,Xt),_(6,bd),_(7,xc),_(8,cE)],gb);var FR;let WT=(FR=class extends gb{get typeId(){return ej.ID}get editorId(){return lm.id}constructor(e,t,i,n,r,o,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=r,this.textModelService=o,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 T9))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"?Eae(e):void 0,t),n}matches(e){return this===e?!0:e instanceof ej?Yi(e.resource,this.resource):Jv(e)?super.matches(e):!1}dispose(){this.modelReference&&(this.modelReference.then(e=>e.dispose()),this.modelReference=void 0),this.cachedModel=void 0,super.dispose()}},ej=FR,FR.ID="workbench.editors.resourceEditorInput",FR);WT=ej=D([_(5,pn),_(6,Fr),_(7,ti),_(8,Xt),_(9,Os),_(10,bd),_(11,xc),_(12,cE)],WT);const Xo=ec;var tj,OR;let L9=(OR=class extends gb{get typeId(){return tj.ID}get editorId(){return lm.id}constructor(e,t,i,n,r,o,a,c,l,d,h){super(e.resource,void 0,n,t,i,r,c,d,h),this.model=e,this.environmentService=o,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){Yi(e.resource,this.model.resource)&&e!==this.model&&(this.model=e,this.registerModelListeners(e))}getName(){return this.model.name}getDescription(e=Rs.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?N8(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=iB(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 tj?Yi(e.resource,this.resource):uTt(e)?super.matches(e):!1}dispose(){this.modelResolve=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){wt(this.cachedUntitledTextEditorModelReference),this.cachedUntitledTextEditorModelReference=void 0}},tj=OR,OR.ID="workbench.editors.untitledEditorInput",OR);L9=tj=D([_(1,Fr),_(2,Os),_(3,ti),_(4,Xt),_(5,Xo),_(6,Cf),_(7,bd),_(8,pn),_(9,xc),_(10,cE)],L9);const toe=class toe extends Error{constructor(e){super(e),this.name=toe.code}};toe.code="InlineChatError";let oee=toe,b5e=class{constructor(e,t,i,n,r,o,a,c,l){this._telemetryService=e,this._modelService=t,this._textModelService=i,this._editorWorkerService=n,this._logService=r,this._instaService=o,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(To.Editor);if(!n){this._logService.trace("[IE] NO agent found");return}this._onWillStartSession.fire(e);const r=e.getModel(),o=e.getSelection(),a=new Z;this._logService.trace(`[IE] creating NEW session for ${e.getId()}, ${n.extensionId}`);const c=this._chatService.startSession(To.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 yn);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 ACe(new Na):w.result?.errorDetails?y=new ACe(new Error(w.result.errorDetails.message)):w.response.value.length===0?y=new ent:y=this._instaService.createInstance(jW,m.textModelN.uri,b.request,w),m.addExchange(new F5t(m.lastInput,y)),y instanceof jW&&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=ao(),h=r.uri;a.add(await this._textModelService.createModelReference(r.uri));const u=r,f=a.add(this._modelService.createModel(A6(r.createSnapshot()),{languageId:r.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:L9.ID,editorId:lm.id})||this._releaseSession(m,!0)}));let p=t.wholeRange;if(p||(p=new F(o.selectionStartLineNumber,o.selectionStartColumn,o.positionLineNumber,o.positionColumn)),i.isCancellationRequested){a.dispose();return}const m=new N5t(t.editMode,h,f,u,n,a.add(new SCe(u,p)),a.add(new xCe(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 r=!1;for(const[o,a]of this._sessions)if(a.session===e){r=!0,this._sessions.delete(o),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(!r)throw new Error("Cannot move session because it is not stored")}releaseSession(e){this._releaseSession(e,!1)}_releaseSession(e,t){let i;for(const o of this._sessions)if(o[1].session===e){i=o;break}if(!i)return;this._keepRecording(e),this._telemetryService.publicLog2("interactiveEditor/session",e.asTelemetryData());const[n,r]=i;this._sessions.delete(n),this._logService.trace(`[IE] did RELEASED session for ${r.editor.getId()}, ${e.agent.extensionId}`),this._onDidEndSession.fire({editor:r.editor,session:e,endedByExternalCause:t}),r.store.dispose()}stashSession(e,t,i){this._keepRecording(e);const n=this._instaService.createInstance(ECe,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}};b5e=D([_(0,Ji),_(1,fi),_(2,pn),_(3,Pl),_(4,Ke),_(5,we),_(6,ti),_(7,Lm),_(8,wf)],b5e);var JB;let w5e=(JB=class{constructor(e,t){this._store=new Z,this._ctxHasProvider=f5t.bindTo(e),this._store.add(t.onDidChangeAgents(()=>{const i=!!t.getDefaultAgent(To.Editor);this._ctxHasProvider.set(i)}))}dispose(){this._ctxHasProvider.reset(),this._store.dispose()}},JB.Id="inlineChat.enabler",JB);w5e=D([_(0,Le),_(1,wf)],w5e);var ko;(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"})(ko||(ko={}));var zl;(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"})(zl||(zl={}));let y5e=class{static get(e){return e.getContribution(K4e)}get chatWidget(){return this._ui.value.content.isVisible?this._ui.value.content.chatWidget:this._ui.value.zone.widget.chatWidget}constructor(e,t,i,n,r,o,a,c,l,d,h){this._editor=e,this._instaService=t,this._inlineChatSessionService=i,this._inlineChatSavingService=n,this._editorWorkerService=r,this._logService=o,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 yn),this._forcedPlaceholder=void 0,this._ctxVisible=p5t.bindTo(l),this._ctxUserDidEdit=w5t.bindTo(l),this._ctxResponseType=E5t.bindTo(l),this._ctxRequestInProgress=A5t.bindTo(l),this._ui=new Ca(()=>{const u={location:To.Editor,resolveData:()=>(Lt(this._editor.hasModel()),Lt(this._session),{type:To.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=To.Notebook;break}const f=this._store.add(t.createInstance(cAe,u,this._editor)),p=this._store.add(t.createInstance(aAe,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?zl.PAUSE_SESSION:zl.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 K4e}_getMode(){return this._configurationService.getValue(Kh.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(ko.CREATE_SESSION,e),await this._currentRun}catch(t){bt(t),this._session&&this._inlineChatSessionService.releaseSession(this._session),this[ko.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[ko.CREATE_SESSION](e){Lt(this._session===void 0),Lt(this._editor.hasModel());let t=e.existingSession,i;e.position&&(i=re.lift(e.position).delta(-1),delete e.position);const n=this._showWidget(!0,i);let r=g(7081,"Failed to start editor chat");if(!t){const o=new li,a=M.once(this._messages.event)(c=>{this._log("state=_createSession) message received",c),c===zl.ACCEPT_INPUT?(e.autoSend=!0,this._ui.value.zone.widget.updateInfo(g(7082,"Getting ready..."))):o.cancel()});try{t=await this._inlineChatSessionService.createSession(this._editor,{editMode:this._getMode(),wholeRange:e.initialRange},o.token)}catch(c){(c instanceof oee||c?.name===oee.code)&&(r=c.message)}if(o.dispose(),a.dispose(),o.token.isCancellationRequested)return t&&this._inlineChatSessionService.releaseSession(t),ko.CANCEL}if(delete e.initialRange,delete e.existingSession,!t)return Mh.get(this._editor)?.showMessage(r,n),this._log("Failed to start editor chat"),ko.CANCEL;switch(await t.chatModel.waitForInitialization(),t.editMode){case Hy.Preview:this._strategy=this._instaService.createInstance(NCe,t,this._editor,this._ui.value.zone);break;case Hy.Live:default:this._strategy=this._instaService.createInstance(PCe,t,this._editor,this._ui.value.zone);break}return this._session=t,ko.INIT_UI}async[ko.INIT_UI](e){Lt(this._session),Lt(this._strategy),mu.get(this._editor)?.hide(),this._sessionStore.clear();const t=this._editor.createDecorationsCollection(),i=()=>{const r=this._strategy?.getWholeRangeDecoration()??[];t.set(r)};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(r=>{const o=this._session?.chatModel.hasRequests?zl.PAUSE_SESSION:zl.CANCEL_SESSION;this._log("model changed, pause or cancel session",o,r),this._messages.fire(o)}));const n=this._editor.getModel()?.getAlternativeVersionId();return this._sessionStore.add(this._editor.onDidChangeModelContent(r=>{if(this._session?.hunkData.ignoreTextModelNChanges||this._ctxUserDidEdit.set(n!==this._editor.getModel()?.getAlternativeVersionId()),this._session?.hunkData.ignoreTextModelNChanges||this._strategy?.hasFocus())return;const o=this._session.wholeRange;let a=!1;if(this._configurationService.getValue(Kh.FinishOnType))for(const{range:c}of r.changes)a=!F.areIntersectingOrTouching(c,o.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 r=>{r.kind==="removeRequest"&&await this._session.undoChangesUntil(r.requestId)})),this._session.chatModel.hasRequests?(e.isUnstashed&&delete e.isUnstashed,ko.SHOW_RESPONSE):ko.WAIT_FOR_INPUT}async[ko.WAIT_FOR_INPUT](e){Lt(this._session),Lt(this._strategy),this._updatePlaceholder(),e.message&&(this.updateInput(e.message),No(e.message),delete e.message,this._showWidget(!1));let t=zl.NONE,i;const n=new jd,r=new Z;return r.add(this._session.chatModel.onDidChange(o=>{o.kind==="addRequest"&&(i=o.request,t=zl.ACCEPT_INPUT,n.open())})),r.add(this._strategy.onDidAccept(()=>this.acceptSession())),r.add(this._strategy.onDidDiscard(()=>this.cancelSession())),r.add(M.once(this._messages.event)(o=>{this._log("state=_waitForInput) message received",o),t=o,n.open()})),e.autoSend&&(delete e.autoSend,this._showWidget(!1),this._ui.value.zone.widget.chatWidget.acceptInput()),await n.wait(),r.dispose(),t&(zl.CANCEL_INPUT|zl.CANCEL_SESSION)?ko.CANCEL:t&zl.PAUSE_SESSION?ko.PAUSE:t&zl.ACCEPT_SESSION?(this._ui.value.zone.widget.selectAll(!1),ko.ACCEPT):i?.message.text?(this._session.addInput(new P5t(i,this._editor.getModel().getAlternativeVersionId())),ko.SHOW_REQUEST):ko.WAIT_FOR_INPUT}async[ko.SHOW_REQUEST](){Lt(this._session),Lt(this._session.chatModel.requestInProgress),this._ctxRequestInProgress.set(!0);const{chatModel:e}=this._session,t=e.getRequests().at(-1);Lt(t),Lt(t.response),this._showWidget(!1),this._ui.value.zone.widget.selectAll(!1),this._ui.value.zone.widget.updateInfo("");const{response:i}=t,n=new hc,r=new Z,o=r.add(new li),a=new NTe,c=Ys.create(),l=new EI;let d=ko.SHOW_RESPONSE;r.add(M.once(this._messages.event)(y=>{this._log("state=_makeRequest) message received",y),this._chatService.cancelCurrentRequestForSession(e.sessionId),y&zl.CANCEL_SESSION?d=ko.CANCEL:y&zl.PAUSE_SESSION?d=ko.PAUSE:y&zl.ACCEPT_SESSION&&(d=ko.ACCEPT)})),r.add(e.onDidChange(y=>{y.kind==="removeRequest"&&y.requestId===t.id&&(o.cancel(),n.complete(),y.reason===E9.Resend?d=ko.SHOW_REQUEST:d=ko.CANCEL)})),r.add(this._ui.value.zone.widget.chatWidget.inputEditor.onDidChangeModelContent(()=>{this._chatService.cancelCurrentRequestForSession(e.sessionId)}));let h=0,u=!0;const f=new oW,m={sha1:f.canComputeSHA1(this._session.textModel0)?f.computeSHA1(this._session.textModel0):ao(),applied:0};let v;const b=()=>{if(this._updateCtxResponseType(),v||(v=i.response.value.find(y=>y.kind==="textEditGroup"&&Yi(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:o.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?(o.cancel(),n.complete()):i.isComplete&&n.complete()};r.add(i.onDidChange(b)),b(),await n.p,await l.whenIdle(),i.isCanceled&&await this._session.undoChangesUntil(i.requestId),r.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[ko.SHOW_RESPONSE](){Lt(this._session),Lt(this._strategy);const{response:e}=this._session.lastExchange;let t;if(e instanceof ent){const i=g(7083,"No results, please refine your input and try again");return this._ui.value.zone.widget.updateStatus(i,{classes:["warn"]}),ko.WAIT_FOR_INPUT}else if(e instanceof ACe)e.isCancellation||(this._ui.value.zone.widget.updateStatus(e.message,{classes:["error"]}),this._strategy?.cancel());else if(e instanceof jW){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),ko.WAIT_FOR_INPUT}async[ko.PAUSE](){this._resetWidget(),this._strategy?.dispose?.(),this._session=void 0}async[ko.ACCEPT](){Lt(this._session),Lt(this._strategy),this._sessionStore.clear();try{await this._strategy.apply()}catch(e){this._dialogService.error(g(7084,"Failed to apply changes.",Po(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[ko.CANCEL](){if(this._session){Lt(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.",Po(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){Lt(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(z1.None);return}const e=i=>i.value.some(n=>n.kind==="textEditGroup"&&Yi(n.uri,this._session?.textModelN.uri));let t=z1.None;for(const i of this._session.chatModel.getRequests())if(i.response&&(t=z1.Messages,e(i.response.response))){t=z1.MessagesAndEdits;break}this._ctxResponseType.set(t)}async _makeChanges(e,t,i){Lt(this._session),Lt(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 o=(!t&&n?n:e).map(TTe.asEditOperation),a={start:()=>this._session.hunkData.ignoreTextModelNChanges=!0,stop:()=>this._session.hunkData.ignoreTextModelNChanges=!1};this._inlineChatSavingService.markChanged(this._session),t?await this._strategy.makeProgressiveChanges(o,a,t,i):await this._strategy.makeChanges(o,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 ht(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(zl.CANCEL_INPUT|zl.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 o of n)if(o.response)for(const a of o.response.response.value)a.kind==="textEditGroup"&&Yi(a.uri,i)&&(e=e||!!a.state?.applied,t=a);const r=this._strategy.cancel();e&&(Lt(t),t.edits=[r]),await this._instaService.invokeFunction($8t,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(zl.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(zl.CANCEL_SESSION)}finishExistingSession(){this._session&&(this._session.editMode===Hy.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}};y5e=D([_(1,we),_(2,xMe),_(3,eZe),_(4,Pl),_(5,Ke),_(6,Te),_(7,ir),_(8,Le),_(9,Lm),_(10,$6)],y5e);async function $8t(s,e){const t=s.get(Nm),i=s.get(Lm),n=await t5t(t);if(n&&n.viewModel&&e){for(const r of e.getRequests().slice())await i.adoptRequest(n.viewModel.model.sessionId,r);n.focusLastMessage()}}const G8t="workbench.action.quickchat.toggle";var lAe;(function(s){s[s.SymbolInformation=1]="SymbolInformation",s[s.CommandInformation=2]="CommandInformation",s[s.SearchInformation=3]="SearchInformation",s[s.SettingInformation=4]="SettingInformation"})(lAe||(lAe={}));function Dnt(s){const e=[],t=new Map,i=(n,r)=>{if(!t.has(n)&&(t.set(n,!0),!(n[0]==="_"||n.indexOf("vscode.")===0)&&s.get(n)!==!0)){if(!r){const o=vt.getCommand(n);if(o&&typeof o.metadata=="object"&&tr(o.metadata.args))return}e.push(n)}};for(const n of Yn.getMenuItems(_e.CommandPalette))ET(n)&&i(n.command.id,!0);for(const n of dp.getEditorActions())i(n.id,!0);for(const n of vt.getCommands().keys())i(n,!1);return e}var Um;const Oue="keybinding.entry.template",C5e=g(4636,"System"),S5e=g(4637,"Extension"),A5e=g(4638,"User");function K8t(s,e){const t=e?` +when:${e}`:"";return`@command:${s}${t}`}const q8t=eW(kM,PE,Iae),Q8t=/@command:\s*([^\+]+)/i,j8t=/\+when:\s*(.+)/i,E5e=/@source:\s*(user|default|system|extension)/i,x5e=/@ext:\s*((".+")|([^\s]+))/i,Y8t=/@keybinding:\s*((\".+\")|(\S+))/i;let D5e=Um=class extends BI{constructor(e,t,i){super(),this.keybindingsService=t,this.extensionService=i,this._keybindingItems=[],this._keybindingItemsSortedByPrecedence=[],this.modifierLabels={ui:D6.modifierLabels[e],aria:MYe.modifierLabels[e],user:lRe.modifierLabels[e]}}fetch(e,t=!1){let i=t?this._keybindingItemsSortedByPrecedence:this._keybindingItems;const n=Q8t.exec(e);if(n&&n[1]){const r=n[1].trim();let o=i.filter(a=>a.command===r);if(o.length){const a=j8t.exec(e);if(a&&a[1]){const c=a[1].trim();o=this.filterByWhen(o,r,c)}}return o.map(a=>({id:Um.getId(a),keybindingItem:a,templateId:Oue}))}if(E5e.test(e))i=this.filterBySource(i,e),e=e.replace(E5e,"");else{const r=x5e.exec(e);if(r&&(r[2]||r[3])){const o=r[2]?r[2].substring(1,r[2].length-1):r[3];i=this.filterByExtension(i,o),e=e.replace(x5e,"")}else{const o=Y8t.exec(e);o&&(o[2]||o[3])&&(e=o[2]||`"${o[3]}"`)}}return e=e.trim(),e?this.filterByText(i,e):i.map(r=>({id:Um.getId(r),keybindingItem:r,templateId:Oue}))}filterBySource(e,t){return/@source:\s*default/i.test(t)||/@source:\s*system/i.test(t)?e.filter(i=>i.source===C5e):/@source:\s*user/i.test(t)?e.filter(i=>i.source===A5e):/@source:\s*extension/i.test(t)?e.filter(i=>!Rt(i.source)||i.source===S5e):e}filterByExtension(e,t){return t=t.toLowerCase().trim(),e.filter(i=>!Rt(i.source)&&(An.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)==='"',r=i&&n;i&&(t=t.substring(1)),n&&(t=t.substring(0,t.length-1)),t=t.trim();const o=[],a=t.split(" "),c=this.splitKeybindingWords(a);for(const l of e){const d=new J8t(this.modifierLabels,l,t,a,c,r);(d.commandIdMatches||d.commandLabelMatches||d.commandDefaultLabelMatches||d.sourceMatches||d.whenMatches||d.keybindingMatches||d.extensionIdMatches||d.extensionLabelMatches)&&o.push({id:Um.getId(l),templateId:Oue,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 o}filterByWhen(e,t,i){if(e.length===0)return[];const n=e.filter(c=>c.when===i);if(n.length)return n;const r=e[0].commandLabel,o=new Mx(void 0,t,null,he.deserialize(i),!1,null,!1),a=new Map([[t,r]]);return[Um.toKeybindingEntry(t,o,a,this.getExtensionsMapping())]}splitKeybindingWords(e){const t=[];for(const i of e)t.push(...Oi(i.split("+")));return t}async resolve(e=new Map){const t=this.getExtensionsMapping();this._keybindingItemsSortedByPrecedence=[];const i=new Map;for(const r of this.keybindingsService.getKeybindings())r.command&&(this._keybindingItemsSortedByPrecedence.push(Um.toKeybindingEntry(r.command,r,e,t)),i.set(r.command,!0));const n=this.keybindingsService.getDefaultKeybindings().map(r=>r.command);for(const r of Dnt(i)){const o=new Mx(void 0,r,null,void 0,n.indexOf(r)===-1,null,!1);this._keybindingItemsSortedByPrecedence.push(Um.toKeybindingEntry(r,o,e,t))}return this._keybindingItemsSortedByPrecedence=Ya(this._keybindingItemsSortedByPrecedence,r=>Um.getId(r)),this._keybindingItems=this._keybindingItemsSortedByPrecedence.slice(0).sort((r,o)=>Um.compareKeybindingData(r,o)),super.resolve()}static getId(e){return e.command+(e?.keybinding?.getAriaLabel()??"")+e.when+(Rt(e.source)?e.source:e.source.identifier.value)}getExtensionsMapping(){const e=new ba;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 r=Yn.getCommand(e),o=i.get(e);let a=A5e;if(t.isDefault){const c=t.extensionId??(t.resolvedKeybinding?void 0:r?.source?.id);a=c?n.get(c)??S5e:C5e}return{keybinding:t.resolvedKeybinding,keybindingItem:t,command:e,commandLabel:Um.getCommandLabel(r,o),commandDefaultLabel:Um.getCommandDefaultLabel(r),when:t.when?t.when.serialize():"",source:a}}static getCommandDefaultLabel(e){if(!Rk.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||""}};D5e=Um=D([_(1,Vt),_(2,ps)],D5e);class J8t{constructor(e,t,i,n,r,o){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,o||(this.commandIdMatches=this.matches(i,t.command,eW(PE,jY),n),this.commandLabelMatches=t.commandLabel?this.matches(i,t.commandLabel,(a,c)=>PE(a,t.commandLabel,!0),n):null,this.commandDefaultLabelMatches=t.commandDefaultLabel?this.matches(i,t.commandDefaultLabel,(a,c)=>PE(a,t.commandDefaultLabel,!0),n):null,this.whenMatches=t.when?this.matches(null,t.when,eW(PE,jY),n):null,Rt(t.source)?this.sourceMatches=this.matches(i,t.source,(a,c)=>PE(a,t.source,!0),n):this.extensionLabelMatches=t.source.displayName?this.matches(i,t.source.displayName,(a,c)=>PE(a,t.commandLabel,!0),n):null),this.keybindingMatches=t.keybinding?this.matchesKeybinding(t.keybinding,i,r,o):null}matches(e,t,i,n){let r=e?q8t(e,t):null;return r||(r=this.matchesWords(n,t,i)),r&&(r=this.filterAndSort(r)),r}matchesWords(e,t,i){let n=[];for(const r of e){const o=i(r,t);if(o)n=[...n||[],...o];else{n=null;break}}return n}filterAndSort(e){return Ya(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[r,o]=e.getChords(),a=e.getUserSettingsLabel(),c=e.getAriaLabel(),l=e.getLabel();if(a&&AS(t,a)===0||c&&AS(t,c)===0||l&&AS(t,l)===0)return{firstPart:this.createCompleteMatch(r),chordPart:this.createCompleteMatch(o)};const d={};let h={};const u=[],f=[];let p=[],m=!0;for(let v=0;v({label:g(871,"No matching commands"),commandId:""})},n,r,o,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=JKe(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:He.asClassName(ve.gear),tooltip:g(872,"Configure Keybinding")}],trigger:()=>(this.preferencesService.openGlobalKeybindingSettings(!1,{query:K8t(t.commandId,t.commandWhen)}),MS.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 r;try{await Ao(PV.AI_RELATED_INFORMATION_DEBOUNCE,n),r=await this.getRelatedInformationPicks(e,t,i,n)}catch{return[]}(t.length||r.length)&&r.push({type:"separator"});const o=this.chatAgentService.getDefaultAgent(To.Panel);return o&&r.push({label:g(873,"Ask {0}: {1}",o.fullName,i),commandId:this.configuration.experimental.askChatLocation==="quickChat"?G8t:g5t,args:[i]}),r}async getRelatedInformationPicks(e,t,i,n){const r=await this.aiRelatedInformationService.getRelatedInformation(i,[lAe.CommandInformation],n);r.sort((c,l)=>l.weight-c.weight);const o=new Set(t.map(c=>c.commandId)),a=new Array;for(const c of r){if(c.weightd.commandId===c.command&&!o.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((r,[,o])=>[...r,...o],[]).filter(r=>r instanceof Ac&&r.enabled);for(const r of n){let o=(typeof r.item.title=="string"?r.item.title:r.item.title.value)||r.item.id;const a=typeof r.item.category=="string"?r.item.category:r.item.category?.value;a&&(o=g(874,"{0}: {1}",a,o));const c=typeof r.item.title!="string"?r.item.title.original:void 0,l=a&&r.item.category&&typeof r.item.category!="string"?r.item.category.original:void 0,d=c&&a?l?`${l}: ${c}`:`${a}: ${c}`:c,h=r.item.metadata?.description,u=h===void 0||vRe(h)?h:{value:h,original:h};e.push({commandId:r.item.id,commandWhen:r.item.precondition?.serialize(),commandAlias:d,label:Tae(o),commandDescription:u})}return e}},PV=JS,JS.AI_RELATED_INFORMATION_MAX_PICKS=5,JS.AI_RELATED_INFORMATION_THRESHOLD=.8,JS.AI_RELATED_INFORMATION_DEBOUNCE=200,JS);sN=PV=D([_(0,ti),_(1,Ba),_(2,ps),_(3,we),_(4,Vt),_(5,bi),_(6,Ji),_(7,ir),_(8,Te),_(9,Pr),_(10,Y6),_(11,xo),_(12,TMe),_(13,wf)],sN);const ioe=class ioe extends di{constructor(){super({id:ioe.ID,title:Pe(875,"Show All Commands"),keybinding:{weight:Ae.WorkbenchContrib,when:void 0,primary:lf?void 0:U.CtrlCmd|U.Shift|S.KeyP,secondary:[S.F1]},f1:!0})}async run(e){e.get(Tn).quickAccess.show(sN.PREFIX)}};ioe.ID="workbench.action.showCommands";let gI=ioe;class X8t extends di{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(Gi),n=e.get(ir);if(S9.getConfiguredCommandHistoryLength(t)>0){const{confirmed:o}=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(!o)return;S9.clearHistory(t,i)}}}class knt{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 r=n.add(new yn);return r.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{r.value=void 0,r.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new Z,r=this.activeTextEditorControl;if(r&&this.canProvideWithTextEditor(r)){const o={editor:r},a=m6(r);if(a){let c=r.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{c=r.saveViewState()??void 0})),o.restoreViewState=()=>{c&&r===this.activeTextEditorControl&&r.restoreViewState(c)},n.add(fm(t.onCancellationRequested)(()=>o.restoreViewState?.()))}n.add(Ee(()=>this.clearDecorations(r))),n.add(this.provideWithTextEditor(o,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,Lb.JUMP),e.revealRangeInCenter(t.range,_t.Smooth),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&xh(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return rm(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 r=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:$r(JQe),position:Il.Full}}}],[o,a]=i.deltaDecorations(n,r);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const noe=class noe extends knt{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,r=new Z;r.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 o=()=>{const c=this.parsePosition(n,t.value.trim().substr(noe.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,_t.Smooth),this.addDecorations(n,d)};o(),r.add(t.onDidChangeValue(()=>o()));const a=m6(n);return a&&a.getOptions().get(x.lineNumbers).renderType===yo.Relative&&(a.updateOptions({lineNumbers:"on"}),r.add(Ee(()=>a.updateOptions({lineNumbers:"relative"})))),r}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(r=>parseInt(r,10)).filter(r=>!isNaN(r)),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},r=this.lineCount(e);return r>1?g(4645,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,r):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 r={lineNumber:t,column:i};return n.validatePosition(r).equals(r)}lineCount(e){return this.getModel(e)?.getLineCount()??0}};noe.PREFIX=":";let aee=noe,cee=class extends aee{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)}};cee=D([_(0,ti),_(1,Pr),_(2,Te)],cee);const soe=class soe extends di{constructor(){super({id:soe.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(Tn).quickAccess.show(cee.PREFIX)}};soe.ID="workbench.action.gotoLine";let lee=soe;Et(lee);je.as(HU.Quickaccess).registerQuickAccessProvider({ctor:cee,prefix:aee.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:lee.ID}]});var ij,hb;let HT=(hb=class extends knt{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 r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i,n):this.doProvideWithoutEditorSymbols(e,o,t,i):V.None}doProvideWithoutEditorSymbols(e,t,i,n){const r=new Z;return this.provideLabelPick(i,g(4648,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,r)||n.isCancellationRequested||r.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),r}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:mt.String}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new hc,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,r){const o=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}),r?.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 li(n),i.busy=!0;try{const u=D9(i.value.substr(ij.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=Tk(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(o.getSelection()?.getPosition()),a.add(i.onDidChangeActive(()=>{const[h]=i.activeItems;h&&h.range&&(o.revealRangeInCenter(h.range.selection,_t.Smooth),this.addDecorations(o,h.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,r){const o=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(ij.SCOPE_PREFIX)===0,c=a?1:0;let l,d;t.values&&t.values.length>1?(l=HVe(t.values[0]),d=HVe(t.values.slice(1))):l=t;let h;const u=this.options?.openSideBySideDirection?.();u&&(h=[{iconClass:u==="right"?He.asClassName(ve.splitHorizontal):He.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]=Nue(y,{...t,values:void 0},c,C),typeof L=="number"&&(G=!0)),typeof L!="number"&&([L,k]=Nue(y,l,c,C),typeof L!="number"))continue;if(!G&&d){if(A&&d.original.length>0&&([P,R]=Nue(A,d)),typeof P!="number")continue;typeof L=="number"&&(L+=P)}}const z=b.tags&&b.tags.indexOf(I8.Deprecated)>=0;f.push({index:v,kind:b.kind,score:L,label:y,ariaLabel:ydt(b.name,b.kind),description:A,highlights:z?void 0:{label:k,description:R},range:{selection:F.collapseToStart(b.selectionRange),decoration:b.range},uri:r.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=qp(Wue[v]||Bue,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=Wue[e.kind]||Bue,n=Wue[t.kind]||Bue,r=i.localeCompare(n);return r===0?this.compareByScore(e,t):r}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},ij=hb,hb.PREFIX="@",hb.SCOPE_PREFIX=":",hb.PREFIX_BY_CATEGORY=`${hb.PREFIX}${hb.SCOPE_PREFIX}`,hb);HT=ij=D([_(0,nt),_(1,fG)],HT);const Bue=g(4654,"properties ({0})"),Wue={[mt.Method]:g(4655,"methods ({0})"),[mt.Function]:g(4656,"functions ({0})"),[mt.Constructor]:g(4657,"constructors ({0})"),[mt.Variable]:g(4658,"variables ({0})"),[mt.Class]:g(4659,"classes ({0})"),[mt.Struct]:g(4660,"structs ({0})"),[mt.Event]:g(4661,"events ({0})"),[mt.Operator]:g(4662,"operators ({0})"),[mt.Interface]:g(4663,"interfaces ({0})"),[mt.Namespace]:g(4664,"namespaces ({0})"),[mt.Package]:g(4665,"packages ({0})"),[mt.TypeParameter]:g(4666,"type parameters ({0})"),[mt.Module]:g(4667,"modules ({0})"),[mt.Property]:g(4654,"properties ({0})"),[mt.Enum]:g(4668,"enumerations ({0})"),[mt.EnumMember]:g(4669,"enumeration members ({0})"),[mt.String]:g(4670,"strings ({0})"),[mt.File]:g(4671,"files ({0})"),[mt.Array]:g(4672,"arrays ({0})"),[mt.Number]:g(4673,"numbers ({0})"),[mt.Boolean]:g(4674,"booleans ({0})"),[mt.Object]:g(4675,"objects ({0})"),[mt.Key]:g(4676,"keys ({0})"),[mt.Field]:g(4677,"fields ({0})"),[mt.Constant]:g(4678,"constants ({0})")};var dAe;(function(s){s[s.OutlinePane=1]="OutlinePane",s[s.Breadcrumbs=2]="Breadcrumbs",s[s.QuickPick=4]="QuickPick"})(dAe||(dAe={}));var k5e;(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"})(k5e||(k5e={}));var I5e;(function(s){s.Collapsed="alwaysCollapse",s.Expanded="alwaysExpand"})(I5e||(I5e={}));var hAe,BR;let dee=(BR=class extends HT{constructor(e,t,i,n,r,o){super(n,o,{openSideBySideDirection:()=>this.configuration.openSideBySideDirection}),this.editorService=e,this.editorGroupService=t,this.configurationService=i,this.outlineService=r,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(!K2(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,r){return!await Promise.race([this.waitForLanguageSymbolRegistry(e,n),Ao(hAe.SYMBOL_PICKS_TIMEOUT)])||r.isCancellationRequested?[]:this.doGetSymbolPicks(this.getDocumentSymbols(e,r),D9(t),i,r,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 li,n=new Z;return n.add(Ee(()=>i.dispose(!0))),e.busy=!0,this.outlineService.createOutline(t,dAe.QuickPick,i.token).then(r=>{if(!r)return;if(i.token.isCancellationRequested){r.dispose();return}n.add(r);const o=r.captureViewState();n.add(Ee(()=>{e.selectedItems.length===0&&o.dispose()}));const a=r.config.quickPickDataSource.getQuickPickElements(),c=a.map((h,u)=>({kind:mt.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]&&r.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(HT.PREFIX.length).trim(),p=pF(u.label),m=qk(f,f.toLowerCase(),0,p.text,p.text.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return m?(u.score=m[1],u.highlights={label:Kq(f,p)??void 0},!0):!1});if(h.length===0){const u=g(883,"No matching entries");e.items=[{label:u,index:-1,kind:mt.String}],e.ariaLabel=u}else e.items=h};l(),n.add(e.onDidChangeValue(l));const d=new yn;n.add(d),n.add(e.onDidChangeActive(()=>{const[h]=e.activeItems;h&&a[h.index]?d.value=r.preview(a[h.index].element):d.clear()}))}).catch(r=>{bt(r),e.hide()}).finally(()=>{e.busy=!1}),n}},hAe=BR,BR.SYMBOL_PICKS_TIMEOUT=8e3,BR);dee=hAe=D([_(0,ti),_(1,Pr),_(2,Te),_(3,nt),_(4,MZe),_(5,fG)],dee);const roe=class roe extends di{constructor(){super({id:roe.ID,title:{...Pe(884,"Go to Symbol in Editor..."),mnemonicTitle:g(885,"Go to &&Symbol in Editor...")},f1:!0,keybinding:{when:he.and(Cp.negate(),WA.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(Tn).quickAccess.show(dee.PREFIX,{itemActivation:zf.NONE})}};roe.ID="workbench.action.gotoSymbol";let hee=roe;Et(hee);je.as(HU.Quickaccess).registerQuickAccessProvider({ctor:dee,prefix:HT.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:HT.PREFIX,commandId:hee.ID,commandCenterOrder:40},{description:g(888,"Go to Symbol in Editor by Category"),prefix:HT.PREFIX_BY_CATEGORY}]});const mA={primary:U.CtrlCmd|S.KeyP,secondary:[U.CtrlCmd|S.KeyE],mac:{primary:U.CtrlCmd|S.KeyP,secondary:void 0}};Sr.registerCommandAndKeybindingRule({id:"workbench.action.closeQuickOpen",weight:Ae.WorkbenchContrib,when:yC,primary:S.Escape,secondary:[U.Shift|S.Escape],handler:s=>s.get(Tn).cancel()});Sr.registerCommandAndKeybindingRule({id:"workbench.action.acceptSelectedQuickOpenItem",weight:Ae.WorkbenchContrib,when:yC,primary:0,handler:s=>s.get(Tn).accept()});Sr.registerCommandAndKeybindingRule({id:"workbench.action.alternativeAcceptSelectedQuickOpenItem",weight:Ae.WorkbenchContrib,when:yC,primary:0,handler:s=>s.get(Tn).accept({ctrlCmd:!0,alt:!1})});Sr.registerCommandAndKeybindingRule({id:"workbench.action.focusQuickOpen",weight:Ae.WorkbenchContrib,when:yC,primary:0,handler:s=>{s.get(Tn).focus()}});const T5e="workbench.action.quickOpenNavigateNextInFilePicker";Sr.registerCommandAndKeybindingRule({id:T5e,weight:Ae.WorkbenchContrib+50,handler:zce(T5e,!0),when:zit,primary:mA.primary,secondary:mA.secondary,mac:mA.mac});const L5e="workbench.action.quickOpenNavigatePreviousInFilePicker";Sr.registerCommandAndKeybindingRule({id:L5e,weight:Ae.WorkbenchContrib+50,handler:zce(L5e,!1),when:zit,primary:mA.primary|U.Shift,secondary:[mA.secondary[0]|U.Shift],mac:{primary:mA.mac.primary|U.Shift,secondary:void 0}});Sr.registerCommandAndKeybindingRule({id:"workbench.action.quickPickManyToggle",weight:Ae.WorkbenchContrib,when:yC,primary:0,handler:s=>{s.get(Tn).toggle()}});Sr.registerCommandAndKeybindingRule({id:"workbench.action.quickInputBack",weight:Ae.WorkbenchContrib+50,when:yC,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(Tn).back()}});Et(class extends di{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:mA.primary,secondary:mA.secondary,mac:mA.mac},f1:!0})}run(e,t){e.get(Tn).quickAccess.show(typeof t=="string"?t:void 0,{preserveValue:typeof t=="string"})}});Et(class extends di{constructor(){super({id:"workbench.action.quickOpenWithModes",title:g(890,"Quick Open"),icon:ve.search,menu:{id:_e.CommandCenterCenter,order:100}})}run(e){e.get(Tn).quickAccess.show(void 0,{preserveValue:!0,providerOptions:{includeHelp:!0,from:"commandCenter"}})}});vt.registerCommand("workbench.action.quickOpenPreviousEditor",async s=>{s.get(Tn).quickAccess.show("",{itemActivation:zf.SECOND})});class Yce extends di{constructor(e,t,i,n,r){super({id:e,title:t,f1:!0,keybinding:r}),this.id=e,this.next=i,this.quickNavigate=n}async run(e){const t=e.get(Vt),i=e.get(Tn),n=t.lookupKeybindings(this.id),r=this.quickNavigate?{keybindings:n}:void 0;i.navigate(this.next,r)}}class Z8t extends Yce{constructor(){super("workbench.action.quickOpenNavigateNext",Pe(891,"Navigate Next in Quick Open"),!0,!0)}}class e3t extends Yce{constructor(){super("workbench.action.quickOpenNavigatePrevious",Pe(892,"Navigate Previous in Quick Open"),!1,!0)}}class t3t extends Yce{constructor(){super("workbench.action.quickOpenSelectNext",Pe(893,"Select Next in Quick Open"),!0,!1,{weight:Ae.WorkbenchContrib+50,when:yC,primary:0,mac:{primary:U.WinCtrl|S.KeyN}})}}class i3t extends Yce{constructor(){super("workbench.action.quickOpenSelectPrevious",Pe(894,"Select Previous in Quick Open"),!1,!1,{weight:Ae.WorkbenchContrib+50,when:yC,primary:0,mac:{primary:U.WinCtrl|S.KeyP}})}}Et(t3t);Et(i3t);Et(Z8t);Et(e3t);var FV,WR;let sz=(WR=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=je.as(HU.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(FV.PREFIX.length));n&&n.prefix&&n.prefix!==FV.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==FV.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}})}},FV=WR,WR.PREFIX="?",WR);sz=FV=D([_(0,Tn),_(1,Vt)],sz);const R5e="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 n3t="debugUx";new Q(n3t,"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 M5e;(function(s){s[s.Inactive=0]="Inactive",s[s.Initializing=1]="Initializing",s[s.Stopped=2]="Stopped",s[s.Running=3]="Running"})(M5e||(M5e={}));var N5e;(function(s){s[s.Valid=0]="Valid",s[s.Unreadable=1]="Unreadable",s[s.Error=2]="Error"})(N5e||(N5e={}));var uee;(function(s){s[s.Variable=0]="Variable",s[s.Address=1]="Address"})(uee||(uee={}));var R9;(function(s){s[s.Initial=1]="Initial",s[s.Dynamic=2]="Dynamic"})(R9||(R9={}));var P5e;(function(s){s.UnverifiedBreakpoints="unverifiedBreakpoints"})(P5e||(P5e={}));var F5e;(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"})(F5e||(F5e={}));var gee;(function(s){s[s.Command=0]="Command",s[s.Tree=1]="Tree"})(gee||(gee={}));var uAe;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(uAe||(uAe={}));var gAe;(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})(gAe||(gAe={}));var fAe,HR;let ZW=(HR=class extends zNe{constructor(e,t,i,n,r,o,a,c){super(fAe.PREFIX,{noResultsPick:{label:g(4807,"No matching views"),containerLabel:""}}),this.viewDescriptorService=e,this.viewsService=t,this.outputService=i,this.terminalService=n,this.terminalGroupService=r,this.debugService=o,this.paneCompositeService=a,this.contextKeyService=c}_getPicks(e){const t=this.doGetViewPickItems().filter(o=>e?(o.highlights={label:YY(e,o.label,!0)??void 0},o.highlights.label||Wct(o.containerLabel,e)):!0),i=new Map;for(const o of t)i.has(o.label)||i.set(o.label,o.containerLabel);const n=[];let r;for(const o of t){if(r!==o.containerLabel){r=o.containerLabel;let a;i.has(r)?a=`${i.get(r)} / ${r}`:a=r,n.push({type:"separator",label:a})}n.push(o)}return n}doGetViewPickItems(){const e=[],t=(o,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=(o,a)=>{const c=this.paneCompositeService.getPaneComposites(o),l=this.paneCompositeService.getVisiblePaneCompositeIds(o);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,o,!0)})}};i(io.Sidebar,g(4808,"Side Bar")),i(io.Panel,g(4809,"Panel")),i(io.AuxiliaryBar,g(4810,"Secondary Side Bar"));const n=o=>{const a=this.paneCompositeService.getPaneComposites(o);for(const c of a){const l=this.viewDescriptorService.getViewContainerById(c.id);l&&e.push(...t(c,l))}};n(io.Sidebar),n(io.Panel),n(io.AuxiliaryBar),this.terminalGroupService.groups.forEach((o,a)=>{o.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(o=>o.hasSeparateRepl()).forEach((o,a)=>{const c=o.name;e.push({label:c,containerLabel:g(4813,"Debug Console"),accept:async()=>{await this.debugService.focusStackFrame(void 0,void 0,o,{explicit:!0}),this.viewsService.isViewVisible(R5e)||await this.viewsService.openView(R5e,!0)}})});const r=this.outputService.getChannelDescriptors();for(const o of r)e.push({label:o.label,containerLabel:g(4814,"Output"),accept:()=>this.outputService.showChannel(o.id)});return e}includeViewContainer(e){const t=this.viewDescriptorService.getViewContainerById(e.id);return t?.hideIfEmpty?this.viewDescriptorService.getViewContainerModel(t).activeViewDescriptors.length>0:!0}},fAe=HR,HR.PREFIX="view ",HR);ZW=fAe=D([_(0,Im),_(1,Nm),_(2,_ce),_(3,GU),_(4,IMe),_(5,EMe),_(6,Mm),_(7,Le)],ZW);const ooe=class ooe extends di{constructor(){super({id:ooe.ID,title:Pe(4815,"Open View"),category:la.View,f1:!0})}async run(e){e.get(Tn).quickAccess.show(ZW.PREFIX)}};ooe.ID="workbench.action.openView";let M9=ooe;const E1=class E1 extends di{constructor(){super({id:E1.ID,title:Pe(4816,"Quick Open View"),category:la.View,f1:!1,keybinding:{weight:Ae.WorkbenchContrib,when:void 0,...E1.KEYBINDING}})}async run(e){const t=e.get(Vt),i=e.get(Tn),n=t.lookupKeybindings(E1.ID);i.quickAccess.show(ZW.PREFIX,{quickNavigateConfiguration:{keybindings:n},itemActivation:zf.FIRST})}};E1.ID="workbench.action.quickOpenView",E1.KEYBINDING={primary:U.CtrlCmd|S.KeyQ,mac:{primary:U.WinCtrl|S.KeyQ},linux:{primary:0}};let fee=E1;const sPe=je.as(HU.Quickaccess);sPe.registerQuickAccessProvider({ctor:sz,prefix:sz.PREFIX,placeholder:g(895,"Type '{0}' to get help on the actions you can take from here.",sz.PREFIX),helpEntries:[{description:g(896,"Show all Quick Access Providers"),commandCenterOrder:70,commandCenterLabel:g(897,"More")}]});sPe.registerQuickAccessProvider({ctor:ZW,prefix:ZW.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:M9.ID}]});sPe.registerQuickAccessProvider({ctor:sN,prefix:sN.PREFIX,contextKey:"inCommandsPicker",placeholder:g(900,"Type the name of a command to run."),helpEntries:[{description:g(901,"Show and Run Commands"),commandId:gI.ID,commandCenterOrder:20}]});Yn.appendMenuItem(_e.MenubarViewMenu,{group:"1_open",command:{id:gI.ID,title:g(902,"&&Command Palette...")},order:1});Yn.appendMenuItem(_e.MenubarHelpMenu,{group:"1_welcome",command:{id:gI.ID,title:g(903,"Show All Commands")},order:2});Yn.appendMenuItem(_e.MenubarViewMenu,{group:"1_open",command:{id:M9.ID,title:g(904,"&&Open View...")},order:2});Yn.appendMenuItem(_e.MenubarGoMenu,{group:"5_infile_nav",command:{id:"workbench.action.gotoLine",title:g(905,"Go to &&Line/Column...")},order:1});Yn.appendMenuItem(_e.GlobalActivity,{group:"1_command",command:{id:gI.ID,title:g(906,"Command Palette...")},order:1});Yn.appendMenuItem(_e.EditorContext,{group:"z_commands",when:J.editorSimpleInput.toNegated(),command:{id:gI.ID,title:g(906,"Command Palette...")},order:1});Et(X8t);Et(gI);Et(M9);Et(fee);const s3t="inViewsPicker",Int=he.and(yC,he.has(s3t)),cB=fee.KEYBINDING,O5e="workbench.action.quickOpenNavigateNextInViewPicker";Sr.registerCommandAndKeybindingRule({id:O5e,weight:Ae.WorkbenchContrib+50,handler:zce(O5e,!0),when:Int,primary:cB.primary,linux:cB.linux,mac:cB.mac});const B5e="workbench.action.quickOpenNavigatePreviousInViewPicker";Sr.registerCommandAndKeybindingRule({id:B5e,weight:Ae.WorkbenchContrib+50,handler:zce(B5e,!1),when:Int,primary:cB.primary|U.Shift,linux:cB.linux,mac:{primary:cB.mac.primary|U.Shift}});const fv=ec;var XB;let pee=(XB=class extends V{constructor(e,t){super(),t.options?.resolveExternalUri&&this._register(e.registerExternalUriResolver({resolveExternalUri:async i=>({resolved:await t.options.resolveExternalUri(i),dispose:()=>{}})}))}},XB.ID="workbench.contrib.externalUriResolver",XB);pee=D([_(0,Ar),_(1,fv)],pee);const Tnt=N.parse("trustedDomains:/Trusted Domains"),Jce="http.linkProtectionTrustedDomains",pAe="http.linkProtectionTrustedDomainsContent",mAe={id:"workbench.action.manageTrustedDomain",description:{description:Pe(4604,"Manage Trusted Domains"),args:[]},handler:async s=>{s.get(ti).openEditor({resource:Tnt,languageId:"jsonc",options:{pinned:!0}})}};async function r3t(s,e,t,i,n,r,o){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 r.openEditor({resource:Tnt.with({fragment:t.toString()}),languageId:"jsonc",options:{pinned:!0}}),s;case"trust":{const p=f.toTrust;if(s.indexOf(p)===-1)return n.remove(pAe,Ie.APPLICATION),n.store(Jce,JSON.stringify([...s,p]),Ie.APPLICATION,cn.USER),[...s,p]}}return[]}async function o3t(s){const{defaultTrustedDomains:e,trustedDomains:t}=mee(s);return{defaultTrustedDomains:e,trustedDomains:t}}function mee(s){const e=s.get(Gi),t=s.get(xo),i=s.get(fv),n=[...t.linkProtectionTrustedDomains??[],...i.options?.additionalTrustedDomains??[]];let r=[];try{const o=e.get(Jce,Ie.APPLICATION);o&&(r=JSON.parse(o))}catch{}return{defaultTrustedDomains:n,trustedDomains:r}}const a3t="trustedDomains",c3t={type:rn.File,ctime:Date.now(),mtime:Date.now(),size:0},Lnt=`// Links matching one or more entries in the list below can be opened without link protection. +${s}`:s}var nAe;const Fue=fe;function SP(s){s.scrollTop=s.scrollHeight-s.renderHeight}var PR;let I9=(PR=class extends V{get visible(){return this._visible}set viewModel(e){this._viewModel!==e&&(this.viewModelDisposables.clear(),this._viewModel=e,e&&this.viewModelDisposables.add(e),this._onDidChangeViewModel.fire())}get viewModel(){return this._viewModel}get parsedInput(){return this.parsedChatRequest===void 0&&(this.parsedChatRequest=this.instantiationService.createInstance(see).parseChatRequest(this.viewModel.sessionId,this.getInput(),this.location,{selectedAgent:this._lastSelectedAgent}),this.agentInInput.set(!!this.parsedChatRequest.parts.find(e=>e instanceof qg))),this.parsedChatRequest}get scopedContextKeyService(){return this.contextKeyService}get location(){return this._location.location}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m){super(),this.viewContext=t,this.viewOptions=i,this.styles=n,this.contextKeyService=o,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},KPt.bindTo(o).set(!0),QPt.bindTo(o).set(this._location.location),jPt.bindTo(o).set("resource"in t),this.agentInInput=wet.bindTo(o),this.requestInProgress=e9.bindTo(o),this._register(d.register(this)),this._codeBlockModelCollection=this._register(a.createInstance(iAe)),this._register(r.registerCodeEditorOpenHandler(async(v,b,w)=>{let y=v.resource;if(IA(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 Ao(0);for(const L of this.renderer.editorsInUse()??[])if(Dn.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(tAe,t,this.styles.listForeground,this.styles.inputEditorBackground,this.styles.resultEditorBackground));const i=this.viewOptions.renderInputOnTop??!1,n=this.viewOptions.renderFollowups??!i,r=this.viewOptions.renderStyle;this.container=oe(e,Fue(".interactive-session")),i?(this.createInput(this.container,{renderFollowups:n,renderStyle:r}),this.listContainer=oe(this.container,Fue(".interactive-list"))):(this.listContainer=oe(this.container,Fue(".interactive-list")),this.createInput(this.container,{renderFollowups:n,renderStyle:r})),this.createList(this.listContainer,{...this.viewOptions.rendererOptions,renderStyle:r}),this._register(this.editorOptions.onDidChange(()=>this.onDidStyleChange())),this.onDidStyleChange(),this.viewModel&&(this.onDidChangeItems(),SP(this.tree)),this.contribs=nAe.CONTRIBS.map(o=>{try{return this._register(this.instantiationService.createInstance(o,this))}catch(a){this.logService.error("Failed to instantiate chat widget contrib",Po(a));return}}).filter(Oc),this.contribs.forEach(o=>{o.onDidChangeInputState&&this._register(o.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(!bs(e))return;const i=this.viewModel?.getItems();if(!i)return;const n=i.filter(a=>bs(a)),r=n.indexOf(e);if(r===void 0)return;const o=t==="next"?r+1:r-1;if(!(o<0||o>n.length-1))return n[o]}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=>(bs(n)||zu(n)?n.dataId:n.id)+(aB(n)&&this.viewModel?`_${Ng[this.viewModel.initState]}`:"")+`${zu(n)||aB(n)}${bs(n)&&n.renderData?`_${this.visibleChangeCount}`:""}`+(bs(n)?`_${n.contentReferences.length}`:"")+(zu(n)&&n.contentReferences?`_${n.contentReferences?.length}`:"")}}),!e&&this._dynamicMessageLayoutData&&this.layoutDynamicChatTreeItemMode();const i=t[t.length-1]?.element;i&&bs(i)&&i.isComplete?this.renderFollowups(i.replyFollowups,i):i&&aB(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(Zy(()=>{this._visible&&this.onDidChangeItems(!0)},0)):t&&this._onDidHide.fire()}createList(e,t){const i=this._register(this._register(this.instantiationService.createChild(new Vc([Le,this.contextKeyService])))),n=i.createInstance(eAe,this.viewOptions.defaultElementHeight??200),r={getListLength:()=>this.tree.getNode(null).visibleChildrenCount,onDidScroll:this.onDidScroll},o=document.createElement("div");o.classList.add("chat-overflow-widget-container","monaco-editor"),e.append(o),this.renderer=this._register(i.createInstance(nee,this.editorOptions,this.location,t,r,this._codeBlockModelCollection,o)),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(N3,"Chat",e,n,[this.renderer],{identityProvider:{getId:a=>a.id},horizontalScrolling:!1,alwaysConsumeMouseWheel:!1,supportDynamicHeights:!0,hideTwistiesOfChildlessElements:!0,accessibilityProvider:this.instantiationService.createInstance(BCe),keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>zu(a)?a.message:bs(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([[vet.key,bs(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&&Nl(lt(this.listContainer),()=>{SP(this.tree)},0),this.previousTreeScrollHeight=this.tree.scrollHeight,this._onDidChangeContentHeight.fire()}createInput(e,t){this.inputPart=this._register(this.instantiationService.createInstance(DZ,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 r=(typeof i=="object"&&i?.[n.id])??{};n.setInputState(r)}})})),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 r=this.chatAgentService.getAgent(i.followup.agentId);if(!r)return;this.lastSelectedAgent=r,n=`${i4}${r.name} `,i.followup.subCommand&&(n+=`${lI}${i.followup.subCommand} `)}else!i.followup.agentId&&i.followup.subCommand&&this.chatSlashCommandService.hasCommand(i.followup.subCommand)&&(n=`${lI}${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(wCe,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&&(SP(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(),SP(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,r=!e||"prefix"in e,o=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(o)return this.inputPart.acceptInput(r),this._onDidSubmitAgent.fire({agent:o.agent,slashCommand:o.slashCommand}),this.inputPart.updateState(this.collectInputState()),this.inputPart.clearContext(),o.responseCompletePromise.then(()=>{const a=this.viewModel?.getItems().filter(bs),c=a?.[a.length-1];this.chatAccessibilityService.acceptResponse(c,i)}),o.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 wn(t,e),this.inputPart.layout(e,t);const i=this.inputPart.inputPartHeight,n=this.tree.scrollTop+this.tree.renderHeight>=this.tree.scrollHeight,r=e-i;this.tree.layout(r,t),this.tree.getHTMLElement().style.height=`${r}px`,this.renderer.layout(t),n&&SP(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 yn);this._register(this.tree.onDidScroll(n=>{this._dynamicMessageLayoutData?.enabled&&(i.value=Nl(lt(this.listContainer),()=>{if(!n.scrollTopChanged||n.heightChanged||n.scrollHeightChanged)return;const r=n.height,o=n.scrollHeight-r-n.scrollTop;if(o===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(r+o,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,r=this.bodyDimension.width;ta.currentRenderedHeight===void 0),o=r?this._dynamicMessageLayoutData.maxHeight:n.reduce((a,c)=>a+c.currentRenderedHeight,0);this.layout(Math.min(t+o+(i.length>2?18:0),this._dynamicMessageLayoutData.maxHeight),e),(r||!o)&&SP(this.tree)}saveState(){this.inputPart.saveState()}getViewState(){return this.inputPart.saveState(),{inputValue:this.getInput(),inputState:this.collectInputState()}}},nAe=PR,PR.CONTRIBS=[],PR);I9=nAe=D([_(4,qt),_(5,Le),_(6,we),_(7,Lm),_(8,wf),_(9,qN),_(10,lo),_(11,jXe),_(12,Ke),_(13,mn),_(14,SMe)],I9);var ZQ;let sAe=class{constructor(e,t,i,n,r,o,a,c,l,d,h){this._instantiationService=i,this._contextKeyService=n,this._keybindingService=r,this._accessibilityService=o,this._configurationService=a,this._accessibleViewService=c,this._textModelResolverService=l,this._chatService=d,this._hoverService=h,this._elements=Wt("div.inline-chat@root",[Wt("div.chat-widget@chatWidget"),Wt("div.accessibleViewer@accessibleViewer"),Wt("div.status@status",[Wt("div.label.info.hidden@infoLabel"),Wt("div.actions.text-style.hidden@toolbar1"),Wt("div.actions.button-style.hidden@toolbar2"),Wt("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 Vc([Le,this.scopedContextKeyService]),this._store);this._chatWidget=u.createInstance(I9,e,{resource:!0},{defaultElementHeight:32,renderStyle:"minimal",renderInputOnTop:!1,renderFollowups:!0,supportsFileReferences:a.getValue(`chat.experimental.variables.${e.location}`)===!0,filter:C=>!aB(C),...t.chatWidgetViewOptions},{listForeground:L5t,listBackground:CCe,inputEditorBackground:Y2,resultEditorBackground:Uc}),this._chatWidget.render(this._elements.chatWidget),this._elements.chatWidget.style.setProperty(cae(ozt),$e(CCe)),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=_5t.bindTo(this._contextKeyService);const p=this._store.add(Ec(this.domNode));this._store.add(p.onDidBlur(()=>this._ctxResponseFocused.set(!1))),this._store.add(p.onDidFocus(()=>this._ctxResponseFocused.set(!0))),this._ctxInputEditorFocused=m5t.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(Cm,this._elements.toolbar1,m,{hiddenItemStrategy:hA.NoHide,telemetrySource:t.chatWidgetViewOptions?.menus?.telemetrySource,actionViewItemProvider:C=>C instanceof Ac?this._instantiationService.createInstance(N6,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(OCe,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(Kh.ExpTextButtons));this._store.add(this._configurationService.onDidChangeConfiguration(C=>C.affectsConfiguration(Kh.ExpTextButtons)&&y())),y(),this._store.add(this._configurationService.onDidChangeConfiguration(C=>{C.affectsConfiguration(bo.InlineChat)&&this._updateAriaLabel()})),this._elements.root.tabIndex=0,this._elements.statusLabel.tabIndex=0,this._updateAriaLabel(),this._store.add(this._hoverService.setupManagedHover(Fo("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(AZ,void 0,To.Editor)),this._defaultChatModel.startInitialize(),this._defaultChatModel.initialize(void 0),this.setChatModel(this._defaultChatModel)}_updateAriaLabel(){if(this._elements.root.ariaLabel=this._accessibleViewService.getOpenAriaHint(bo.InlineChat),this._accessibilityService.isScreenReaderOptimized()){let e=U8t;if(this._configurationService.getValue(bo.InlineChat)){const t=this._keybindingService.lookupKeybinding(eh.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=vb(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:vb(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(bs(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 ht(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(r=>bs(r));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(tr(e))return Eg(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 o of n.getRequests())n.removeRequest(o.id);return}const r=n.addRequest({parts:[],text:""},{variables:[]},0);if(n.acceptResponseProgress(r,{kind:"markdownContent",content:e.message}),!t){n.completeResponse(r);return}return{cancel:()=>n.cancelRequest(r),complete:()=>n.completeResponse(r),appendContent:o=>{n.acceptResponseProgress(r,{kind:"markdownContent",content:new Nt(o)})}}}updateInfo(e){this._elements.infoLabel.classList.toggle("hidden",!e);const t=Ib(e);ca(this._elements.infoLabel,...t),this._onDidChangeHeight.fire()}updateStatus(e,t={}){const i=typeof t.resetAfter=="number";if(i&&!this._elements.statusLabel.dataset.state){const r=this._elements.statusLabel.innerText,o=this._elements.statusLabel.dataset.title,a=Array.from(this._elements.statusLabel.classList.values());setTimeout(()=>{this.updateStatus(r,{classes:a,keepMessage:!0,title:o})},t.resetAfter)}const n=Ib(e);ca(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),ca(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(Wc())}};sAe=D([_(2,we),_(3,Le),_(4,Vt),_(5,_o),_(6,Te),_(7,Tm),_(8,pn),_(9,Lm),_(10,tc)],sAe);const U8t=g(11377,"Inline Chat Input");let rAe=class extends sAe{constructor(e,t,i,n,r,o,a,c,l,d,h,u){super(e,{...i,chatWidgetViewOptions:{...i.chatWidgetViewOptions,editorOverflowWidgetsDomNode:t.getOverflowWidgetsDomNode()}},o,n,r,a,c,l,d,h,u),this._parentEditor=t,this._accessibleViewer=this._store.add(new yn)}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(oAe,this._elements.accessibleViewer,e,t,new V8t(this._parentEditor,e,t)),this._onDidChangeHeight.fire()}};rAe=D([_(3,Le),_(4,Vt),_(5,we),_(6,_o),_(7,Te),_(8,Tm),_(9,pn),_(10,Lm),_(11,tc)],rAe);let oAe=ZQ=class extends Px{set width(e){this._width2.set(e,void 0)}constructor(e,t,i,n,r){const o=Yt("width",0),a=Yt("diff",ZQ._asMapping(i)),c=et(h=>[a.read(h)]),l=Math.min(10,8+a.get().changedLineCount),d=n.getModifiedOptions().get(x.lineHeight)*l;super(e,rd(!0),()=>{},rd(!1),o,rd(d),c,n,r),this.height=d,this._width2=o,this._store.add(t.textModelN.onDidChangeContent(()=>{a.set(ZQ._asMapping(i),void 0)}))}static _asMapping(e){const t=e.getRanges0(),i=e.getRangesN(),n=mi.fromRangeInclusive(t[0]),r=mi.fromRangeInclusive(i[0]),o=[];for(let a=1;a{this._ctxCursorPosition.reset()})),this.widget=this._instaService.createInstance(rAe,e,this.editor,{statusMenuId:{menu:T5t,options:{buttonConfigProvider:l=>new Set([D5t,k5t]).has(l.id)?{isSecondary:!0,showIcon:!0,showLabel:!1}:l.id===x5t?{isSecondary:!1}:{isSecondary:!0}}},chatWidgetViewOptions:{menus:{executeToolbar:Zit,telemetrySource:"interactiveEditorWidget-toolbar"},rendererOptions:{renderTextEditsAsSummary:l=>Yi(l,t.getModel()?.uri)&&o.getValue(Kh.Mode)===Hy.Live}}}),this._disposables.add(this.widget);let a;this._disposables.add(this.widget.chatWidget.onWillMaybeChangeHeight(()=>{this.position&&(a=ax.capture(this.editor))})),this._disposables.add(this.widget.onDidChangeHeight(()=>{if(this.position){a??=ax.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 wn(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){Lt(this.container);const t=ax.capture(this.editor),i=this.editor.getLayoutInfo(),n=i.glyphMarginWidth+i.decorationsWidth+i.lineNumbersWidth;this.container.style.marginLeft=`${n}px`;const r=this._computeHeight();super.show(e,r.linesValue),this.widget.chatWidget.setVisible(!0),this.widget.focus(),t.restore(this.editor),this._revealTopOfZoneWidget(e,r)}updatePositionAndHeight(e){const t=ax.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(),r=this.editor.getTopForLineNumber(i),o=r-t.pixelsValue,a=this.editor.getLayoutInfo().height,c=this.editor.getBottomForLineNumber(i);let l=o,d=!1;c>=n+a&&(l=c-a,d=!0),(l!1},{listForeground:Pl,listBackground:CCe,inputEditorBackground:Y2,resultEditorBackground:Uc}),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"),r.getValue(Kh.ExpTextButtons)&&(this._toolbarContainer.style.display="inherit",this._domNode.style.paddingBottom="4px"),this._domNode.appendChild(this._toolbarContainer);const c=this._store.add(a.createInstance(Cm,this._toolbarContainer,I5t,{actionViewItemProvider:h=>h instanceof Ac?i.createInstance(N6,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=Ec(this._domNode);this._store.add(d.onDidBlur(()=>{this._visible&&!l&&!o.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:[ts.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),lqe(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),_t.Immediate);const t=this._editor.getModel()?.getWordAtPosition(e);this._position=t?new re(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??"")}};cAe=D([_(2,we),_(3,Le),_(4,Te),_(5,Tn)],cAe);let ree=class extends Ub{get capabilities(){let e=xi.CanSplitInGroup;return this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=xi.Readonly):e|=xi.Untitled,e&xi.Readonly||(e|=xi.CanDropIntoEditor),e}get preferredResource(){return this._preferredResource}constructor(e,t,i,n,r,o,a){super(),this.resource=e,this.labelService=i,this.fileService=n,this.filesConfigurationService=r,this.textResourceConfigurationService=o,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){Yi(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=Rs.MEDIUM){switch(e){case Rs.SHORT:return this.shortDescription;case Rs.LONG:return this.longDescription;case Rs.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(Ro(this._preferredResource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(Ro(this._preferredResource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(Ro(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 Rs.SHORT:return this.shortTitle;case Rs.LONG:return this.longTitle;default:case Rs.MEDIUM:return this.mediumTitle}}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource)}ensureLimits(e){if(e?.limits)return e.limits;const t=bEt(this.resource);let i;const n=this.textResourceConfigurationService.inspect(this.resource,null,"workbench.editorLargeFileConfirmation");return Egt(n)&&(i=n.value*Pc.MB),{size:i??t}}};ree=D([_(2,Os),_(3,Xt),_(4,bd),_(5,xc),_(6,cE)],ree);let T9=class extends hI{constructor(e,t,i,n,r){super(i,t,n,r,e)}dispose(){this.textEditorModelHandle&&this.modelService.destroyModel(this.textEditorModelHandle),super.dispose()}};T9=D([_(1,Di),_(2,fi),_(3,j6),_(4,_o)],T9);var ej;let gb=class extends ree{constructor(e,t,i,n,r,o,a,c,l){super(e,t,r,o,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)}};gb=D([_(2,ti),_(3,Fr),_(4,Os),_(5,Xt),_(6,bd),_(7,xc),_(8,cE)],gb);var FR;let WT=(FR=class extends gb{get typeId(){return ej.ID}get editorId(){return lm.id}constructor(e,t,i,n,r,o,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=r,this.textModelService=o,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 T9))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"?Eae(e):void 0,t),n}matches(e){return this===e?!0:e instanceof ej?Yi(e.resource,this.resource):Jv(e)?super.matches(e):!1}dispose(){this.modelReference&&(this.modelReference.then(e=>e.dispose()),this.modelReference=void 0),this.cachedModel=void 0,super.dispose()}},ej=FR,FR.ID="workbench.editors.resourceEditorInput",FR);WT=ej=D([_(5,pn),_(6,Fr),_(7,ti),_(8,Xt),_(9,Os),_(10,bd),_(11,xc),_(12,cE)],WT);const Xo=ec;var tj,OR;let L9=(OR=class extends gb{get typeId(){return tj.ID}get editorId(){return lm.id}constructor(e,t,i,n,r,o,a,c,l,d,h){super(e.resource,void 0,n,t,i,r,c,d,h),this.model=e,this.environmentService=o,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){Yi(e.resource,this.model.resource)&&e!==this.model&&(this.model=e,this.registerModelListeners(e))}getName(){return this.model.name}getDescription(e=Rs.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?N8(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=iB(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 tj?Yi(e.resource,this.resource):uTt(e)?super.matches(e):!1}dispose(){this.modelResolve=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){wt(this.cachedUntitledTextEditorModelReference),this.cachedUntitledTextEditorModelReference=void 0}},tj=OR,OR.ID="workbench.editors.untitledEditorInput",OR);L9=tj=D([_(1,Fr),_(2,Os),_(3,ti),_(4,Xt),_(5,Xo),_(6,Cf),_(7,bd),_(8,pn),_(9,xc),_(10,cE)],L9);const toe=class toe extends Error{constructor(e){super(e),this.name=toe.code}};toe.code="InlineChatError";let oee=toe,b5e=class{constructor(e,t,i,n,r,o,a,c,l){this._telemetryService=e,this._modelService=t,this._textModelService=i,this._editorWorkerService=n,this._logService=r,this._instaService=o,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(To.Editor);if(!n){this._logService.trace("[IE] NO agent found");return}this._onWillStartSession.fire(e);const r=e.getModel(),o=e.getSelection(),a=new Z;this._logService.trace(`[IE] creating NEW session for ${e.getId()}, ${n.extensionId}`);const c=this._chatService.startSession(To.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 yn);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 ACe(new Pa):w.result?.errorDetails?y=new ACe(new Error(w.result.errorDetails.message)):w.response.value.length===0?y=new ent:y=this._instaService.createInstance(jW,m.textModelN.uri,b.request,w),m.addExchange(new F5t(m.lastInput,y)),y instanceof jW&&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=ao(),h=r.uri;a.add(await this._textModelService.createModelReference(r.uri));const u=r,f=a.add(this._modelService.createModel(A6(r.createSnapshot()),{languageId:r.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:L9.ID,editorId:lm.id})||this._releaseSession(m,!0)}));let p=t.wholeRange;if(p||(p=new F(o.selectionStartLineNumber,o.selectionStartColumn,o.positionLineNumber,o.positionColumn)),i.isCancellationRequested){a.dispose();return}const m=new N5t(t.editMode,h,f,u,n,a.add(new SCe(u,p)),a.add(new xCe(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 r=!1;for(const[o,a]of this._sessions)if(a.session===e){r=!0,this._sessions.delete(o),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(!r)throw new Error("Cannot move session because it is not stored")}releaseSession(e){this._releaseSession(e,!1)}_releaseSession(e,t){let i;for(const o of this._sessions)if(o[1].session===e){i=o;break}if(!i)return;this._keepRecording(e),this._telemetryService.publicLog2("interactiveEditor/session",e.asTelemetryData());const[n,r]=i;this._sessions.delete(n),this._logService.trace(`[IE] did RELEASED session for ${r.editor.getId()}, ${e.agent.extensionId}`),this._onDidEndSession.fire({editor:r.editor,session:e,endedByExternalCause:t}),r.store.dispose()}stashSession(e,t,i){this._keepRecording(e);const n=this._instaService.createInstance(ECe,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}};b5e=D([_(0,Ji),_(1,fi),_(2,pn),_(3,Fl),_(4,Ke),_(5,we),_(6,ti),_(7,Lm),_(8,wf)],b5e);var JB;let w5e=(JB=class{constructor(e,t){this._store=new Z,this._ctxHasProvider=f5t.bindTo(e),this._store.add(t.onDidChangeAgents(()=>{const i=!!t.getDefaultAgent(To.Editor);this._ctxHasProvider.set(i)}))}dispose(){this._ctxHasProvider.reset(),this._store.dispose()}},JB.Id="inlineChat.enabler",JB);w5e=D([_(0,Le),_(1,wf)],w5e);var ko;(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"})(ko||(ko={}));var $l;(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"})($l||($l={}));let y5e=class{static get(e){return e.getContribution(K4e)}get chatWidget(){return this._ui.value.content.isVisible?this._ui.value.content.chatWidget:this._ui.value.zone.widget.chatWidget}constructor(e,t,i,n,r,o,a,c,l,d,h){this._editor=e,this._instaService=t,this._inlineChatSessionService=i,this._inlineChatSavingService=n,this._editorWorkerService=r,this._logService=o,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 yn),this._forcedPlaceholder=void 0,this._ctxVisible=p5t.bindTo(l),this._ctxUserDidEdit=w5t.bindTo(l),this._ctxResponseType=E5t.bindTo(l),this._ctxRequestInProgress=A5t.bindTo(l),this._ui=new Ca(()=>{const u={location:To.Editor,resolveData:()=>(Lt(this._editor.hasModel()),Lt(this._session),{type:To.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=To.Notebook;break}const f=this._store.add(t.createInstance(cAe,u,this._editor)),p=this._store.add(t.createInstance(aAe,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?$l.PAUSE_SESSION:$l.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 K4e}_getMode(){return this._configurationService.getValue(Kh.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(ko.CREATE_SESSION,e),await this._currentRun}catch(t){bt(t),this._session&&this._inlineChatSessionService.releaseSession(this._session),this[ko.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[ko.CREATE_SESSION](e){Lt(this._session===void 0),Lt(this._editor.hasModel());let t=e.existingSession,i;e.position&&(i=re.lift(e.position).delta(-1),delete e.position);const n=this._showWidget(!0,i);let r=g(7081,"Failed to start editor chat");if(!t){const o=new li,a=M.once(this._messages.event)(c=>{this._log("state=_createSession) message received",c),c===$l.ACCEPT_INPUT?(e.autoSend=!0,this._ui.value.zone.widget.updateInfo(g(7082,"Getting ready..."))):o.cancel()});try{t=await this._inlineChatSessionService.createSession(this._editor,{editMode:this._getMode(),wholeRange:e.initialRange},o.token)}catch(c){(c instanceof oee||c?.name===oee.code)&&(r=c.message)}if(o.dispose(),a.dispose(),o.token.isCancellationRequested)return t&&this._inlineChatSessionService.releaseSession(t),ko.CANCEL}if(delete e.initialRange,delete e.existingSession,!t)return Mh.get(this._editor)?.showMessage(r,n),this._log("Failed to start editor chat"),ko.CANCEL;switch(await t.chatModel.waitForInitialization(),t.editMode){case Hy.Preview:this._strategy=this._instaService.createInstance(NCe,t,this._editor,this._ui.value.zone);break;case Hy.Live:default:this._strategy=this._instaService.createInstance(PCe,t,this._editor,this._ui.value.zone);break}return this._session=t,ko.INIT_UI}async[ko.INIT_UI](e){Lt(this._session),Lt(this._strategy),mu.get(this._editor)?.hide(),this._sessionStore.clear();const t=this._editor.createDecorationsCollection(),i=()=>{const r=this._strategy?.getWholeRangeDecoration()??[];t.set(r)};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(r=>{const o=this._session?.chatModel.hasRequests?$l.PAUSE_SESSION:$l.CANCEL_SESSION;this._log("model changed, pause or cancel session",o,r),this._messages.fire(o)}));const n=this._editor.getModel()?.getAlternativeVersionId();return this._sessionStore.add(this._editor.onDidChangeModelContent(r=>{if(this._session?.hunkData.ignoreTextModelNChanges||this._ctxUserDidEdit.set(n!==this._editor.getModel()?.getAlternativeVersionId()),this._session?.hunkData.ignoreTextModelNChanges||this._strategy?.hasFocus())return;const o=this._session.wholeRange;let a=!1;if(this._configurationService.getValue(Kh.FinishOnType))for(const{range:c}of r.changes)a=!F.areIntersectingOrTouching(c,o.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 r=>{r.kind==="removeRequest"&&await this._session.undoChangesUntil(r.requestId)})),this._session.chatModel.hasRequests?(e.isUnstashed&&delete e.isUnstashed,ko.SHOW_RESPONSE):ko.WAIT_FOR_INPUT}async[ko.WAIT_FOR_INPUT](e){Lt(this._session),Lt(this._strategy),this._updatePlaceholder(),e.message&&(this.updateInput(e.message),No(e.message),delete e.message,this._showWidget(!1));let t=$l.NONE,i;const n=new jd,r=new Z;return r.add(this._session.chatModel.onDidChange(o=>{o.kind==="addRequest"&&(i=o.request,t=$l.ACCEPT_INPUT,n.open())})),r.add(this._strategy.onDidAccept(()=>this.acceptSession())),r.add(this._strategy.onDidDiscard(()=>this.cancelSession())),r.add(M.once(this._messages.event)(o=>{this._log("state=_waitForInput) message received",o),t=o,n.open()})),e.autoSend&&(delete e.autoSend,this._showWidget(!1),this._ui.value.zone.widget.chatWidget.acceptInput()),await n.wait(),r.dispose(),t&($l.CANCEL_INPUT|$l.CANCEL_SESSION)?ko.CANCEL:t&$l.PAUSE_SESSION?ko.PAUSE:t&$l.ACCEPT_SESSION?(this._ui.value.zone.widget.selectAll(!1),ko.ACCEPT):i?.message.text?(this._session.addInput(new P5t(i,this._editor.getModel().getAlternativeVersionId())),ko.SHOW_REQUEST):ko.WAIT_FOR_INPUT}async[ko.SHOW_REQUEST](){Lt(this._session),Lt(this._session.chatModel.requestInProgress),this._ctxRequestInProgress.set(!0);const{chatModel:e}=this._session,t=e.getRequests().at(-1);Lt(t),Lt(t.response),this._showWidget(!1),this._ui.value.zone.widget.selectAll(!1),this._ui.value.zone.widget.updateInfo("");const{response:i}=t,n=new hc,r=new Z,o=r.add(new li),a=new NTe,c=Ys.create(),l=new EI;let d=ko.SHOW_RESPONSE;r.add(M.once(this._messages.event)(y=>{this._log("state=_makeRequest) message received",y),this._chatService.cancelCurrentRequestForSession(e.sessionId),y&$l.CANCEL_SESSION?d=ko.CANCEL:y&$l.PAUSE_SESSION?d=ko.PAUSE:y&$l.ACCEPT_SESSION&&(d=ko.ACCEPT)})),r.add(e.onDidChange(y=>{y.kind==="removeRequest"&&y.requestId===t.id&&(o.cancel(),n.complete(),y.reason===E9.Resend?d=ko.SHOW_REQUEST:d=ko.CANCEL)})),r.add(this._ui.value.zone.widget.chatWidget.inputEditor.onDidChangeModelContent(()=>{this._chatService.cancelCurrentRequestForSession(e.sessionId)}));let h=0,u=!0;const f=new oW,m={sha1:f.canComputeSHA1(this._session.textModel0)?f.computeSHA1(this._session.textModel0):ao(),applied:0};let v;const b=()=>{if(this._updateCtxResponseType(),v||(v=i.response.value.find(y=>y.kind==="textEditGroup"&&Yi(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:o.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?(o.cancel(),n.complete()):i.isComplete&&n.complete()};r.add(i.onDidChange(b)),b(),await n.p,await l.whenIdle(),i.isCanceled&&await this._session.undoChangesUntil(i.requestId),r.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[ko.SHOW_RESPONSE](){Lt(this._session),Lt(this._strategy);const{response:e}=this._session.lastExchange;let t;if(e instanceof ent){const i=g(7083,"No results, please refine your input and try again");return this._ui.value.zone.widget.updateStatus(i,{classes:["warn"]}),ko.WAIT_FOR_INPUT}else if(e instanceof ACe)e.isCancellation||(this._ui.value.zone.widget.updateStatus(e.message,{classes:["error"]}),this._strategy?.cancel());else if(e instanceof jW){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),ko.WAIT_FOR_INPUT}async[ko.PAUSE](){this._resetWidget(),this._strategy?.dispose?.(),this._session=void 0}async[ko.ACCEPT](){Lt(this._session),Lt(this._strategy),this._sessionStore.clear();try{await this._strategy.apply()}catch(e){this._dialogService.error(g(7084,"Failed to apply changes.",Po(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[ko.CANCEL](){if(this._session){Lt(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.",Po(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){Lt(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(z1.None);return}const e=i=>i.value.some(n=>n.kind==="textEditGroup"&&Yi(n.uri,this._session?.textModelN.uri));let t=z1.None;for(const i of this._session.chatModel.getRequests())if(i.response&&(t=z1.Messages,e(i.response.response))){t=z1.MessagesAndEdits;break}this._ctxResponseType.set(t)}async _makeChanges(e,t,i){Lt(this._session),Lt(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 o=(!t&&n?n:e).map(TTe.asEditOperation),a={start:()=>this._session.hunkData.ignoreTextModelNChanges=!0,stop:()=>this._session.hunkData.ignoreTextModelNChanges=!1};this._inlineChatSavingService.markChanged(this._session),t?await this._strategy.makeProgressiveChanges(o,a,t,i):await this._strategy.makeChanges(o,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 ht(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($l.CANCEL_INPUT|$l.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 o of n)if(o.response)for(const a of o.response.response.value)a.kind==="textEditGroup"&&Yi(a.uri,i)&&(e=e||!!a.state?.applied,t=a);const r=this._strategy.cancel();e&&(Lt(t),t.edits=[r]),await this._instaService.invokeFunction($8t,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($l.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($l.CANCEL_SESSION)}finishExistingSession(){this._session&&(this._session.editMode===Hy.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}};y5e=D([_(1,we),_(2,xMe),_(3,eZe),_(4,Fl),_(5,Ke),_(6,Te),_(7,ir),_(8,Le),_(9,Lm),_(10,$6)],y5e);async function $8t(s,e){const t=s.get(Nm),i=s.get(Lm),n=await t5t(t);if(n&&n.viewModel&&e){for(const r of e.getRequests().slice())await i.adoptRequest(n.viewModel.model.sessionId,r);n.focusLastMessage()}}const G8t="workbench.action.quickchat.toggle";var lAe;(function(s){s[s.SymbolInformation=1]="SymbolInformation",s[s.CommandInformation=2]="CommandInformation",s[s.SearchInformation=3]="SearchInformation",s[s.SettingInformation=4]="SettingInformation"})(lAe||(lAe={}));function Dnt(s){const e=[],t=new Map,i=(n,r)=>{if(!t.has(n)&&(t.set(n,!0),!(n[0]==="_"||n.indexOf("vscode.")===0)&&s.get(n)!==!0)){if(!r){const o=vt.getCommand(n);if(o&&typeof o.metadata=="object"&&tr(o.metadata.args))return}e.push(n)}};for(const n of Yn.getMenuItems(_e.CommandPalette))ET(n)&&i(n.command.id,!0);for(const n of dp.getEditorActions())i(n.id,!0);for(const n of vt.getCommands().keys())i(n,!1);return e}var Um;const Oue="keybinding.entry.template",C5e=g(4636,"System"),S5e=g(4637,"Extension"),A5e=g(4638,"User");function K8t(s,e){const t=e?` +when:${e}`:"";return`@command:${s}${t}`}const q8t=eW(kM,PE,Iae),Q8t=/@command:\s*([^\+]+)/i,j8t=/\+when:\s*(.+)/i,E5e=/@source:\s*(user|default|system|extension)/i,x5e=/@ext:\s*((".+")|([^\s]+))/i,Y8t=/@keybinding:\s*((\".+\")|(\S+))/i;let D5e=Um=class extends BI{constructor(e,t,i){super(),this.keybindingsService=t,this.extensionService=i,this._keybindingItems=[],this._keybindingItemsSortedByPrecedence=[],this.modifierLabels={ui:D6.modifierLabels[e],aria:MYe.modifierLabels[e],user:lRe.modifierLabels[e]}}fetch(e,t=!1){let i=t?this._keybindingItemsSortedByPrecedence:this._keybindingItems;const n=Q8t.exec(e);if(n&&n[1]){const r=n[1].trim();let o=i.filter(a=>a.command===r);if(o.length){const a=j8t.exec(e);if(a&&a[1]){const c=a[1].trim();o=this.filterByWhen(o,r,c)}}return o.map(a=>({id:Um.getId(a),keybindingItem:a,templateId:Oue}))}if(E5e.test(e))i=this.filterBySource(i,e),e=e.replace(E5e,"");else{const r=x5e.exec(e);if(r&&(r[2]||r[3])){const o=r[2]?r[2].substring(1,r[2].length-1):r[3];i=this.filterByExtension(i,o),e=e.replace(x5e,"")}else{const o=Y8t.exec(e);o&&(o[2]||o[3])&&(e=o[2]||`"${o[3]}"`)}}return e=e.trim(),e?this.filterByText(i,e):i.map(r=>({id:Um.getId(r),keybindingItem:r,templateId:Oue}))}filterBySource(e,t){return/@source:\s*default/i.test(t)||/@source:\s*system/i.test(t)?e.filter(i=>i.source===C5e):/@source:\s*user/i.test(t)?e.filter(i=>i.source===A5e):/@source:\s*extension/i.test(t)?e.filter(i=>!Rt(i.source)||i.source===S5e):e}filterByExtension(e,t){return t=t.toLowerCase().trim(),e.filter(i=>!Rt(i.source)&&(An.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)==='"',r=i&&n;i&&(t=t.substring(1)),n&&(t=t.substring(0,t.length-1)),t=t.trim();const o=[],a=t.split(" "),c=this.splitKeybindingWords(a);for(const l of e){const d=new J8t(this.modifierLabels,l,t,a,c,r);(d.commandIdMatches||d.commandLabelMatches||d.commandDefaultLabelMatches||d.sourceMatches||d.whenMatches||d.keybindingMatches||d.extensionIdMatches||d.extensionLabelMatches)&&o.push({id:Um.getId(l),templateId:Oue,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 o}filterByWhen(e,t,i){if(e.length===0)return[];const n=e.filter(c=>c.when===i);if(n.length)return n;const r=e[0].commandLabel,o=new Mx(void 0,t,null,he.deserialize(i),!1,null,!1),a=new Map([[t,r]]);return[Um.toKeybindingEntry(t,o,a,this.getExtensionsMapping())]}splitKeybindingWords(e){const t=[];for(const i of e)t.push(...Oi(i.split("+")));return t}async resolve(e=new Map){const t=this.getExtensionsMapping();this._keybindingItemsSortedByPrecedence=[];const i=new Map;for(const r of this.keybindingsService.getKeybindings())r.command&&(this._keybindingItemsSortedByPrecedence.push(Um.toKeybindingEntry(r.command,r,e,t)),i.set(r.command,!0));const n=this.keybindingsService.getDefaultKeybindings().map(r=>r.command);for(const r of Dnt(i)){const o=new Mx(void 0,r,null,void 0,n.indexOf(r)===-1,null,!1);this._keybindingItemsSortedByPrecedence.push(Um.toKeybindingEntry(r,o,e,t))}return this._keybindingItemsSortedByPrecedence=Ya(this._keybindingItemsSortedByPrecedence,r=>Um.getId(r)),this._keybindingItems=this._keybindingItemsSortedByPrecedence.slice(0).sort((r,o)=>Um.compareKeybindingData(r,o)),super.resolve()}static getId(e){return e.command+(e?.keybinding?.getAriaLabel()??"")+e.when+(Rt(e.source)?e.source:e.source.identifier.value)}getExtensionsMapping(){const e=new ba;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 r=Yn.getCommand(e),o=i.get(e);let a=A5e;if(t.isDefault){const c=t.extensionId??(t.resolvedKeybinding?void 0:r?.source?.id);a=c?n.get(c)??S5e:C5e}return{keybinding:t.resolvedKeybinding,keybindingItem:t,command:e,commandLabel:Um.getCommandLabel(r,o),commandDefaultLabel:Um.getCommandDefaultLabel(r),when:t.when?t.when.serialize():"",source:a}}static getCommandDefaultLabel(e){if(!Rk.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||""}};D5e=Um=D([_(1,Vt),_(2,ps)],D5e);class J8t{constructor(e,t,i,n,r,o){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,o||(this.commandIdMatches=this.matches(i,t.command,eW(PE,jY),n),this.commandLabelMatches=t.commandLabel?this.matches(i,t.commandLabel,(a,c)=>PE(a,t.commandLabel,!0),n):null,this.commandDefaultLabelMatches=t.commandDefaultLabel?this.matches(i,t.commandDefaultLabel,(a,c)=>PE(a,t.commandDefaultLabel,!0),n):null,this.whenMatches=t.when?this.matches(null,t.when,eW(PE,jY),n):null,Rt(t.source)?this.sourceMatches=this.matches(i,t.source,(a,c)=>PE(a,t.source,!0),n):this.extensionLabelMatches=t.source.displayName?this.matches(i,t.source.displayName,(a,c)=>PE(a,t.commandLabel,!0),n):null),this.keybindingMatches=t.keybinding?this.matchesKeybinding(t.keybinding,i,r,o):null}matches(e,t,i,n){let r=e?q8t(e,t):null;return r||(r=this.matchesWords(n,t,i)),r&&(r=this.filterAndSort(r)),r}matchesWords(e,t,i){let n=[];for(const r of e){const o=i(r,t);if(o)n=[...n||[],...o];else{n=null;break}}return n}filterAndSort(e){return Ya(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[r,o]=e.getChords(),a=e.getUserSettingsLabel(),c=e.getAriaLabel(),l=e.getLabel();if(a&&AS(t,a)===0||c&&AS(t,c)===0||l&&AS(t,l)===0)return{firstPart:this.createCompleteMatch(r),chordPart:this.createCompleteMatch(o)};const d={};let h={};const u=[],f=[];let p=[],m=!0;for(let v=0;v({label:g(871,"No matching commands"),commandId:""})},n,r,o,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=JKe(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:He.asClassName(ve.gear),tooltip:g(872,"Configure Keybinding")}],trigger:()=>(this.preferencesService.openGlobalKeybindingSettings(!1,{query:K8t(t.commandId,t.commandWhen)}),MS.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 r;try{await Ao(PV.AI_RELATED_INFORMATION_DEBOUNCE,n),r=await this.getRelatedInformationPicks(e,t,i,n)}catch{return[]}(t.length||r.length)&&r.push({type:"separator"});const o=this.chatAgentService.getDefaultAgent(To.Panel);return o&&r.push({label:g(873,"Ask {0}: {1}",o.fullName,i),commandId:this.configuration.experimental.askChatLocation==="quickChat"?G8t:g5t,args:[i]}),r}async getRelatedInformationPicks(e,t,i,n){const r=await this.aiRelatedInformationService.getRelatedInformation(i,[lAe.CommandInformation],n);r.sort((c,l)=>l.weight-c.weight);const o=new Set(t.map(c=>c.commandId)),a=new Array;for(const c of r){if(c.weightd.commandId===c.command&&!o.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((r,[,o])=>[...r,...o],[]).filter(r=>r instanceof Ac&&r.enabled);for(const r of n){let o=(typeof r.item.title=="string"?r.item.title:r.item.title.value)||r.item.id;const a=typeof r.item.category=="string"?r.item.category:r.item.category?.value;a&&(o=g(874,"{0}: {1}",a,o));const c=typeof r.item.title!="string"?r.item.title.original:void 0,l=a&&r.item.category&&typeof r.item.category!="string"?r.item.category.original:void 0,d=c&&a?l?`${l}: ${c}`:`${a}: ${c}`:c,h=r.item.metadata?.description,u=h===void 0||vRe(h)?h:{value:h,original:h};e.push({commandId:r.item.id,commandWhen:r.item.precondition?.serialize(),commandAlias:d,label:Tae(o),commandDescription:u})}return e}},PV=JS,JS.AI_RELATED_INFORMATION_MAX_PICKS=5,JS.AI_RELATED_INFORMATION_THRESHOLD=.8,JS.AI_RELATED_INFORMATION_DEBOUNCE=200,JS);sN=PV=D([_(0,ti),_(1,Wa),_(2,ps),_(3,we),_(4,Vt),_(5,bi),_(6,Ji),_(7,ir),_(8,Te),_(9,Pr),_(10,Y6),_(11,xo),_(12,TMe),_(13,wf)],sN);const ioe=class ioe extends di{constructor(){super({id:ioe.ID,title:Pe(875,"Show All Commands"),keybinding:{weight:Ae.WorkbenchContrib,when:void 0,primary:lf?void 0:U.CtrlCmd|U.Shift|S.KeyP,secondary:[S.F1]},f1:!0})}async run(e){e.get(Tn).quickAccess.show(sN.PREFIX)}};ioe.ID="workbench.action.showCommands";let gI=ioe;class X8t extends di{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(Gi),n=e.get(ir);if(S9.getConfiguredCommandHistoryLength(t)>0){const{confirmed:o}=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(!o)return;S9.clearHistory(t,i)}}}class knt{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 r=n.add(new yn);return r.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{r.value=void 0,r.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new Z,r=this.activeTextEditorControl;if(r&&this.canProvideWithTextEditor(r)){const o={editor:r},a=m6(r);if(a){let c=r.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{c=r.saveViewState()??void 0})),o.restoreViewState=()=>{c&&r===this.activeTextEditorControl&&r.restoreViewState(c)},n.add(fm(t.onCancellationRequested)(()=>o.restoreViewState?.()))}n.add(Ee(()=>this.clearDecorations(r))),n.add(this.provideWithTextEditor(o,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,Lb.JUMP),e.revealRangeInCenter(t.range,_t.Smooth),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&xh(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return rm(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 r=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:$r(JQe),position:Tl.Full}}}],[o,a]=i.deltaDecorations(n,r);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const noe=class noe extends knt{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,r=new Z;r.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 o=()=>{const c=this.parsePosition(n,t.value.trim().substr(noe.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,_t.Smooth),this.addDecorations(n,d)};o(),r.add(t.onDidChangeValue(()=>o()));const a=m6(n);return a&&a.getOptions().get(x.lineNumbers).renderType===yo.Relative&&(a.updateOptions({lineNumbers:"on"}),r.add(Ee(()=>a.updateOptions({lineNumbers:"relative"})))),r}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(r=>parseInt(r,10)).filter(r=>!isNaN(r)),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},r=this.lineCount(e);return r>1?g(4645,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,r):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 r={lineNumber:t,column:i};return n.validatePosition(r).equals(r)}lineCount(e){return this.getModel(e)?.getLineCount()??0}};noe.PREFIX=":";let aee=noe,cee=class extends aee{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)}};cee=D([_(0,ti),_(1,Pr),_(2,Te)],cee);const soe=class soe extends di{constructor(){super({id:soe.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(Tn).quickAccess.show(cee.PREFIX)}};soe.ID="workbench.action.gotoLine";let lee=soe;Et(lee);je.as(HU.Quickaccess).registerQuickAccessProvider({ctor:cee,prefix:aee.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:lee.ID}]});var ij,hb;let HT=(hb=class extends knt{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 r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i,n):this.doProvideWithoutEditorSymbols(e,o,t,i):V.None}doProvideWithoutEditorSymbols(e,t,i,n){const r=new Z;return this.provideLabelPick(i,g(4648,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,r)||n.isCancellationRequested||r.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),r}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:mt.String}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new hc,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,r){const o=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}),r?.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 li(n),i.busy=!0;try{const u=D9(i.value.substr(ij.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=Tk(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(o.getSelection()?.getPosition()),a.add(i.onDidChangeActive(()=>{const[h]=i.activeItems;h&&h.range&&(o.revealRangeInCenter(h.range.selection,_t.Smooth),this.addDecorations(o,h.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,r){const o=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(ij.SCOPE_PREFIX)===0,c=a?1:0;let l,d;t.values&&t.values.length>1?(l=HVe(t.values[0]),d=HVe(t.values.slice(1))):l=t;let h;const u=this.options?.openSideBySideDirection?.();u&&(h=[{iconClass:u==="right"?He.asClassName(ve.splitHorizontal):He.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]=Nue(y,{...t,values:void 0},c,C),typeof L=="number"&&(G=!0)),typeof L!="number"&&([L,k]=Nue(y,l,c,C),typeof L!="number"))continue;if(!G&&d){if(A&&d.original.length>0&&([P,R]=Nue(A,d)),typeof P!="number")continue;typeof L=="number"&&(L+=P)}}const z=b.tags&&b.tags.indexOf(I8.Deprecated)>=0;f.push({index:v,kind:b.kind,score:L,label:y,ariaLabel:ydt(b.name,b.kind),description:A,highlights:z?void 0:{label:k,description:R},range:{selection:F.collapseToStart(b.selectionRange),decoration:b.range},uri:r.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=qp(Wue[v]||Bue,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=Wue[e.kind]||Bue,n=Wue[t.kind]||Bue,r=i.localeCompare(n);return r===0?this.compareByScore(e,t):r}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},ij=hb,hb.PREFIX="@",hb.SCOPE_PREFIX=":",hb.PREFIX_BY_CATEGORY=`${hb.PREFIX}${hb.SCOPE_PREFIX}`,hb);HT=ij=D([_(0,nt),_(1,fG)],HT);const Bue=g(4654,"properties ({0})"),Wue={[mt.Method]:g(4655,"methods ({0})"),[mt.Function]:g(4656,"functions ({0})"),[mt.Constructor]:g(4657,"constructors ({0})"),[mt.Variable]:g(4658,"variables ({0})"),[mt.Class]:g(4659,"classes ({0})"),[mt.Struct]:g(4660,"structs ({0})"),[mt.Event]:g(4661,"events ({0})"),[mt.Operator]:g(4662,"operators ({0})"),[mt.Interface]:g(4663,"interfaces ({0})"),[mt.Namespace]:g(4664,"namespaces ({0})"),[mt.Package]:g(4665,"packages ({0})"),[mt.TypeParameter]:g(4666,"type parameters ({0})"),[mt.Module]:g(4667,"modules ({0})"),[mt.Property]:g(4654,"properties ({0})"),[mt.Enum]:g(4668,"enumerations ({0})"),[mt.EnumMember]:g(4669,"enumeration members ({0})"),[mt.String]:g(4670,"strings ({0})"),[mt.File]:g(4671,"files ({0})"),[mt.Array]:g(4672,"arrays ({0})"),[mt.Number]:g(4673,"numbers ({0})"),[mt.Boolean]:g(4674,"booleans ({0})"),[mt.Object]:g(4675,"objects ({0})"),[mt.Key]:g(4676,"keys ({0})"),[mt.Field]:g(4677,"fields ({0})"),[mt.Constant]:g(4678,"constants ({0})")};var dAe;(function(s){s[s.OutlinePane=1]="OutlinePane",s[s.Breadcrumbs=2]="Breadcrumbs",s[s.QuickPick=4]="QuickPick"})(dAe||(dAe={}));var k5e;(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"})(k5e||(k5e={}));var I5e;(function(s){s.Collapsed="alwaysCollapse",s.Expanded="alwaysExpand"})(I5e||(I5e={}));var hAe,BR;let dee=(BR=class extends HT{constructor(e,t,i,n,r,o){super(n,o,{openSideBySideDirection:()=>this.configuration.openSideBySideDirection}),this.editorService=e,this.editorGroupService=t,this.configurationService=i,this.outlineService=r,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(!K2(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,r){return!await Promise.race([this.waitForLanguageSymbolRegistry(e,n),Ao(hAe.SYMBOL_PICKS_TIMEOUT)])||r.isCancellationRequested?[]:this.doGetSymbolPicks(this.getDocumentSymbols(e,r),D9(t),i,r,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 li,n=new Z;return n.add(Ee(()=>i.dispose(!0))),e.busy=!0,this.outlineService.createOutline(t,dAe.QuickPick,i.token).then(r=>{if(!r)return;if(i.token.isCancellationRequested){r.dispose();return}n.add(r);const o=r.captureViewState();n.add(Ee(()=>{e.selectedItems.length===0&&o.dispose()}));const a=r.config.quickPickDataSource.getQuickPickElements(),c=a.map((h,u)=>({kind:mt.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]&&r.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(HT.PREFIX.length).trim(),p=pF(u.label),m=qk(f,f.toLowerCase(),0,p.text,p.text.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return m?(u.score=m[1],u.highlights={label:Kq(f,p)??void 0},!0):!1});if(h.length===0){const u=g(883,"No matching entries");e.items=[{label:u,index:-1,kind:mt.String}],e.ariaLabel=u}else e.items=h};l(),n.add(e.onDidChangeValue(l));const d=new yn;n.add(d),n.add(e.onDidChangeActive(()=>{const[h]=e.activeItems;h&&a[h.index]?d.value=r.preview(a[h.index].element):d.clear()}))}).catch(r=>{bt(r),e.hide()}).finally(()=>{e.busy=!1}),n}},hAe=BR,BR.SYMBOL_PICKS_TIMEOUT=8e3,BR);dee=hAe=D([_(0,ti),_(1,Pr),_(2,Te),_(3,nt),_(4,MZe),_(5,fG)],dee);const roe=class roe extends di{constructor(){super({id:roe.ID,title:{...Pe(884,"Go to Symbol in Editor..."),mnemonicTitle:g(885,"Go to &&Symbol in Editor...")},f1:!0,keybinding:{when:he.and(Cp.negate(),WA.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(Tn).quickAccess.show(dee.PREFIX,{itemActivation:zf.NONE})}};roe.ID="workbench.action.gotoSymbol";let hee=roe;Et(hee);je.as(HU.Quickaccess).registerQuickAccessProvider({ctor:dee,prefix:HT.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:HT.PREFIX,commandId:hee.ID,commandCenterOrder:40},{description:g(888,"Go to Symbol in Editor by Category"),prefix:HT.PREFIX_BY_CATEGORY}]});const mA={primary:U.CtrlCmd|S.KeyP,secondary:[U.CtrlCmd|S.KeyE],mac:{primary:U.CtrlCmd|S.KeyP,secondary:void 0}};Sr.registerCommandAndKeybindingRule({id:"workbench.action.closeQuickOpen",weight:Ae.WorkbenchContrib,when:yC,primary:S.Escape,secondary:[U.Shift|S.Escape],handler:s=>s.get(Tn).cancel()});Sr.registerCommandAndKeybindingRule({id:"workbench.action.acceptSelectedQuickOpenItem",weight:Ae.WorkbenchContrib,when:yC,primary:0,handler:s=>s.get(Tn).accept()});Sr.registerCommandAndKeybindingRule({id:"workbench.action.alternativeAcceptSelectedQuickOpenItem",weight:Ae.WorkbenchContrib,when:yC,primary:0,handler:s=>s.get(Tn).accept({ctrlCmd:!0,alt:!1})});Sr.registerCommandAndKeybindingRule({id:"workbench.action.focusQuickOpen",weight:Ae.WorkbenchContrib,when:yC,primary:0,handler:s=>{s.get(Tn).focus()}});const T5e="workbench.action.quickOpenNavigateNextInFilePicker";Sr.registerCommandAndKeybindingRule({id:T5e,weight:Ae.WorkbenchContrib+50,handler:zce(T5e,!0),when:zit,primary:mA.primary,secondary:mA.secondary,mac:mA.mac});const L5e="workbench.action.quickOpenNavigatePreviousInFilePicker";Sr.registerCommandAndKeybindingRule({id:L5e,weight:Ae.WorkbenchContrib+50,handler:zce(L5e,!1),when:zit,primary:mA.primary|U.Shift,secondary:[mA.secondary[0]|U.Shift],mac:{primary:mA.mac.primary|U.Shift,secondary:void 0}});Sr.registerCommandAndKeybindingRule({id:"workbench.action.quickPickManyToggle",weight:Ae.WorkbenchContrib,when:yC,primary:0,handler:s=>{s.get(Tn).toggle()}});Sr.registerCommandAndKeybindingRule({id:"workbench.action.quickInputBack",weight:Ae.WorkbenchContrib+50,when:yC,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(Tn).back()}});Et(class extends di{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:mA.primary,secondary:mA.secondary,mac:mA.mac},f1:!0})}run(e,t){e.get(Tn).quickAccess.show(typeof t=="string"?t:void 0,{preserveValue:typeof t=="string"})}});Et(class extends di{constructor(){super({id:"workbench.action.quickOpenWithModes",title:g(890,"Quick Open"),icon:ve.search,menu:{id:_e.CommandCenterCenter,order:100}})}run(e){e.get(Tn).quickAccess.show(void 0,{preserveValue:!0,providerOptions:{includeHelp:!0,from:"commandCenter"}})}});vt.registerCommand("workbench.action.quickOpenPreviousEditor",async s=>{s.get(Tn).quickAccess.show("",{itemActivation:zf.SECOND})});class Yce extends di{constructor(e,t,i,n,r){super({id:e,title:t,f1:!0,keybinding:r}),this.id=e,this.next=i,this.quickNavigate=n}async run(e){const t=e.get(Vt),i=e.get(Tn),n=t.lookupKeybindings(this.id),r=this.quickNavigate?{keybindings:n}:void 0;i.navigate(this.next,r)}}class Z8t extends Yce{constructor(){super("workbench.action.quickOpenNavigateNext",Pe(891,"Navigate Next in Quick Open"),!0,!0)}}class e3t extends Yce{constructor(){super("workbench.action.quickOpenNavigatePrevious",Pe(892,"Navigate Previous in Quick Open"),!1,!0)}}class t3t extends Yce{constructor(){super("workbench.action.quickOpenSelectNext",Pe(893,"Select Next in Quick Open"),!0,!1,{weight:Ae.WorkbenchContrib+50,when:yC,primary:0,mac:{primary:U.WinCtrl|S.KeyN}})}}class i3t extends Yce{constructor(){super("workbench.action.quickOpenSelectPrevious",Pe(894,"Select Previous in Quick Open"),!1,!1,{weight:Ae.WorkbenchContrib+50,when:yC,primary:0,mac:{primary:U.WinCtrl|S.KeyP}})}}Et(t3t);Et(i3t);Et(Z8t);Et(e3t);var FV,WR;let sz=(WR=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=je.as(HU.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(FV.PREFIX.length));n&&n.prefix&&n.prefix!==FV.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==FV.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}})}},FV=WR,WR.PREFIX="?",WR);sz=FV=D([_(0,Tn),_(1,Vt)],sz);const R5e="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 n3t="debugUx";new Q(n3t,"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 M5e;(function(s){s[s.Inactive=0]="Inactive",s[s.Initializing=1]="Initializing",s[s.Stopped=2]="Stopped",s[s.Running=3]="Running"})(M5e||(M5e={}));var N5e;(function(s){s[s.Valid=0]="Valid",s[s.Unreadable=1]="Unreadable",s[s.Error=2]="Error"})(N5e||(N5e={}));var uee;(function(s){s[s.Variable=0]="Variable",s[s.Address=1]="Address"})(uee||(uee={}));var R9;(function(s){s[s.Initial=1]="Initial",s[s.Dynamic=2]="Dynamic"})(R9||(R9={}));var P5e;(function(s){s.UnverifiedBreakpoints="unverifiedBreakpoints"})(P5e||(P5e={}));var F5e;(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"})(F5e||(F5e={}));var gee;(function(s){s[s.Command=0]="Command",s[s.Tree=1]="Tree"})(gee||(gee={}));var uAe;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(uAe||(uAe={}));var gAe;(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})(gAe||(gAe={}));var fAe,HR;let ZW=(HR=class extends zNe{constructor(e,t,i,n,r,o,a,c){super(fAe.PREFIX,{noResultsPick:{label:g(4807,"No matching views"),containerLabel:""}}),this.viewDescriptorService=e,this.viewsService=t,this.outputService=i,this.terminalService=n,this.terminalGroupService=r,this.debugService=o,this.paneCompositeService=a,this.contextKeyService=c}_getPicks(e){const t=this.doGetViewPickItems().filter(o=>e?(o.highlights={label:YY(e,o.label,!0)??void 0},o.highlights.label||Wct(o.containerLabel,e)):!0),i=new Map;for(const o of t)i.has(o.label)||i.set(o.label,o.containerLabel);const n=[];let r;for(const o of t){if(r!==o.containerLabel){r=o.containerLabel;let a;i.has(r)?a=`${i.get(r)} / ${r}`:a=r,n.push({type:"separator",label:a})}n.push(o)}return n}doGetViewPickItems(){const e=[],t=(o,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=(o,a)=>{const c=this.paneCompositeService.getPaneComposites(o),l=this.paneCompositeService.getVisiblePaneCompositeIds(o);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,o,!0)})}};i(io.Sidebar,g(4808,"Side Bar")),i(io.Panel,g(4809,"Panel")),i(io.AuxiliaryBar,g(4810,"Secondary Side Bar"));const n=o=>{const a=this.paneCompositeService.getPaneComposites(o);for(const c of a){const l=this.viewDescriptorService.getViewContainerById(c.id);l&&e.push(...t(c,l))}};n(io.Sidebar),n(io.Panel),n(io.AuxiliaryBar),this.terminalGroupService.groups.forEach((o,a)=>{o.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(o=>o.hasSeparateRepl()).forEach((o,a)=>{const c=o.name;e.push({label:c,containerLabel:g(4813,"Debug Console"),accept:async()=>{await this.debugService.focusStackFrame(void 0,void 0,o,{explicit:!0}),this.viewsService.isViewVisible(R5e)||await this.viewsService.openView(R5e,!0)}})});const r=this.outputService.getChannelDescriptors();for(const o of r)e.push({label:o.label,containerLabel:g(4814,"Output"),accept:()=>this.outputService.showChannel(o.id)});return e}includeViewContainer(e){const t=this.viewDescriptorService.getViewContainerById(e.id);return t?.hideIfEmpty?this.viewDescriptorService.getViewContainerModel(t).activeViewDescriptors.length>0:!0}},fAe=HR,HR.PREFIX="view ",HR);ZW=fAe=D([_(0,Im),_(1,Nm),_(2,_ce),_(3,GU),_(4,IMe),_(5,EMe),_(6,Mm),_(7,Le)],ZW);const ooe=class ooe extends di{constructor(){super({id:ooe.ID,title:Pe(4815,"Open View"),category:la.View,f1:!0})}async run(e){e.get(Tn).quickAccess.show(ZW.PREFIX)}};ooe.ID="workbench.action.openView";let M9=ooe;const E1=class E1 extends di{constructor(){super({id:E1.ID,title:Pe(4816,"Quick Open View"),category:la.View,f1:!1,keybinding:{weight:Ae.WorkbenchContrib,when:void 0,...E1.KEYBINDING}})}async run(e){const t=e.get(Vt),i=e.get(Tn),n=t.lookupKeybindings(E1.ID);i.quickAccess.show(ZW.PREFIX,{quickNavigateConfiguration:{keybindings:n},itemActivation:zf.FIRST})}};E1.ID="workbench.action.quickOpenView",E1.KEYBINDING={primary:U.CtrlCmd|S.KeyQ,mac:{primary:U.WinCtrl|S.KeyQ},linux:{primary:0}};let fee=E1;const sPe=je.as(HU.Quickaccess);sPe.registerQuickAccessProvider({ctor:sz,prefix:sz.PREFIX,placeholder:g(895,"Type '{0}' to get help on the actions you can take from here.",sz.PREFIX),helpEntries:[{description:g(896,"Show all Quick Access Providers"),commandCenterOrder:70,commandCenterLabel:g(897,"More")}]});sPe.registerQuickAccessProvider({ctor:ZW,prefix:ZW.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:M9.ID}]});sPe.registerQuickAccessProvider({ctor:sN,prefix:sN.PREFIX,contextKey:"inCommandsPicker",placeholder:g(900,"Type the name of a command to run."),helpEntries:[{description:g(901,"Show and Run Commands"),commandId:gI.ID,commandCenterOrder:20}]});Yn.appendMenuItem(_e.MenubarViewMenu,{group:"1_open",command:{id:gI.ID,title:g(902,"&&Command Palette...")},order:1});Yn.appendMenuItem(_e.MenubarHelpMenu,{group:"1_welcome",command:{id:gI.ID,title:g(903,"Show All Commands")},order:2});Yn.appendMenuItem(_e.MenubarViewMenu,{group:"1_open",command:{id:M9.ID,title:g(904,"&&Open View...")},order:2});Yn.appendMenuItem(_e.MenubarGoMenu,{group:"5_infile_nav",command:{id:"workbench.action.gotoLine",title:g(905,"Go to &&Line/Column...")},order:1});Yn.appendMenuItem(_e.GlobalActivity,{group:"1_command",command:{id:gI.ID,title:g(906,"Command Palette...")},order:1});Yn.appendMenuItem(_e.EditorContext,{group:"z_commands",when:J.editorSimpleInput.toNegated(),command:{id:gI.ID,title:g(906,"Command Palette...")},order:1});Et(X8t);Et(gI);Et(M9);Et(fee);const s3t="inViewsPicker",Int=he.and(yC,he.has(s3t)),cB=fee.KEYBINDING,O5e="workbench.action.quickOpenNavigateNextInViewPicker";Sr.registerCommandAndKeybindingRule({id:O5e,weight:Ae.WorkbenchContrib+50,handler:zce(O5e,!0),when:Int,primary:cB.primary,linux:cB.linux,mac:cB.mac});const B5e="workbench.action.quickOpenNavigatePreviousInViewPicker";Sr.registerCommandAndKeybindingRule({id:B5e,weight:Ae.WorkbenchContrib+50,handler:zce(B5e,!1),when:Int,primary:cB.primary|U.Shift,linux:cB.linux,mac:{primary:cB.mac.primary|U.Shift}});const fv=ec;var XB;let pee=(XB=class extends V{constructor(e,t){super(),t.options?.resolveExternalUri&&this._register(e.registerExternalUriResolver({resolveExternalUri:async i=>({resolved:await t.options.resolveExternalUri(i),dispose:()=>{}})}))}},XB.ID="workbench.contrib.externalUriResolver",XB);pee=D([_(0,Ar),_(1,fv)],pee);const Tnt=N.parse("trustedDomains:/Trusted Domains"),Jce="http.linkProtectionTrustedDomains",pAe="http.linkProtectionTrustedDomainsContent",mAe={id:"workbench.action.manageTrustedDomain",description:{description:Pe(4604,"Manage Trusted Domains"),args:[]},handler:async s=>{s.get(ti).openEditor({resource:Tnt,languageId:"jsonc",options:{pinned:!0}})}};async function r3t(s,e,t,i,n,r,o){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 r.openEditor({resource:Tnt.with({fragment:t.toString()}),languageId:"jsonc",options:{pinned:!0}}),s;case"trust":{const p=f.toTrust;if(s.indexOf(p)===-1)return n.remove(pAe,Ie.APPLICATION),n.store(Jce,JSON.stringify([...s,p]),Ie.APPLICATION,cn.USER),[...s,p]}}return[]}async function o3t(s){const{defaultTrustedDomains:e,trustedDomains:t}=mee(s);return{defaultTrustedDomains:e,trustedDomains:t}}function mee(s){const e=s.get(Gi),t=s.get(xo),i=s.get(fv),n=[...t.linkProtectionTrustedDomains??[],...i.options?.additionalTrustedDomains??[]];let r=[];try{const o=e.get(Jce,Ie.APPLICATION);o&&(r=JSON.parse(o))}catch{}return{defaultTrustedDomains:n,trustedDomains:r}}const a3t="trustedDomains",c3t={type:rn.File,ctime:Date.now(),mtime:Date.now(),size:0},Lnt=`// 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 @@ -866,15 +866,15 @@ ${s}`:s}var nAe;const Fue=fe;function SP(s){s.scrollTop=s.scrollHeight-s.renderH `})):i+=`// By default, VS Code trusts "localhost". `,i+=Rnt,i+=t?` // Currently configuring trust for ${t} -`:"",e.length===0?i+=l3t:i+=JSON.stringify(e,null,2),i}var ZB;let _ee=(ZB=class{constructor(e,t,i){this.fileService=e,this.storageService=t,this.instantiationService=i,this.capabilities=zn.FileReadWrite,this.onDidChangeCapabilities=M.None,this.onDidChangeFile=M.None,this.fileService.registerProvider(a3t,this)}stat(e){return Promise.resolve(c3t)}async readFile(e){let t=this.storageService.get(pAe,Ie.APPLICATION);const i=e.fragment,{defaultTrustedDomains:n,trustedDomains:r}=await this.instantiationService.invokeFunction(o3t);return(!t||t.indexOf(Lnt)===-1||t.indexOf(Rnt)===-1||t.indexOf(i??"")===-1||[...n,...r].some(a=>!Qn(t).includes(a)))&&(t=d3t(n,r,i)),Ge.fromString(t).buffer}writeFile(e,t,i){try{const n=Ge.wrap(t).toString(),r=af(n);this.storageService.store(pAe,n,Ie.APPLICATION,cn.USER),this.storageService.store(Jce,JSON.stringify(r)||"",Ie.APPLICATION,cn.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)}},ZB.ID="workbench.contrib.trustedDomainsFileSystemProvider",ZB);_ee=D([_(0,Xt),_(1,Gi),_(2,we)],_ee);const h3t=(s,e)=>{let t=s.with({query:null,fragment:null}).toString(!0);const i=o=>o.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 bw(n,t,e,0,0);const r=/^(https?):\/\//.exec(t)?.[1];return r?bw(n,t,`${r}://${e}`,0,0):!1},bw=(s,e,t,i,n)=>{if(s[i]?.[n]!==void 0)return s[i][n];const r=[];if(i===e.length)return n===t.length;if(n===t.length)return e.slice(i)[0]==="/";if(e[i]===t[n]&&r.push(bw(s,e,t,i+1,n+1)),t[n]+t[n+1]==="*."&&(["/",":"].includes(e[i])||r.push(bw(s,e,t,i+1,n)),r.push(bw(s,e,t,i,n+2))),t[n]==="*"&&(i+1===e.length?r.push(bw(s,e,t,i+1,n+1)):r.push(bw(s,e,t,i+1,n)),r.push(bw(s,e,t,i,n+1))),t[n]+t[n+1]===":*")if(e[i]===":"){let o=i+1;do o++;while(/[0-9]/.test(e[o]));r.push(bw(s,e,t,o,n+2))}else r.push(bw(s,e,t,i,n+2));return s[i][n]=r.some(o=>o===!0)};let _Ae=class extends V{constructor(e,t){super(),this._instantiationService=e,this._storageService=t;const i=()=>new o5(ri,()=>{const{defaultTrustedDomains:n,trustedDomains:r}=this._instantiationService.invokeFunction(mee);return[...n,...r]});this._staticTrustedDomainsResult=i(),this._register(this._storageService.onDidChangeValue(Ie.APPLICATION,Jce,this._register(new Z))(()=>{this._staticTrustedDomainsResult?.dispose(),this._staticTrustedDomainsResult=i()}))}isValid(e){const{defaultTrustedDomains:t,trustedDomains:i}=this._instantiationService.invokeFunction(mee),n=[...t,...i];return Mnt(e,n)}};_Ae=D([_(0,we),_(1,Gi)],_Ae);const u3t=/^localhost(:\d+)?$/i,g3t=/^127.0.0.1(:\d+)?$/;function f3t(s){return u3t.test(s)||g3t.test(s)}function W5e(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 Mnt(s,e){if(s=N.parse(W5e(s)),e=e.map(W5e),f3t(s.authority))return!0;for(let t=0;tthis.validateLink(f,p)})}async validateLink(e,t){if(!IA(e,pe.http)&&!IA(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:r,authority:o,path:a,query:c,fragment:l}=n;let d=`${r}://${o}${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:Ze.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(mee),v=`${r}://${o}`,b=await r3t(m,v,n,this._quickInputService,this._storageService,this._editorService);return!!(b.indexOf("*")!==-1||Mnt(n,b))}}],cancelButton:{run:()=>!1}});return p}}};vAe=D([_(0,Ar),_(1,Gi),_(2,ir),_(3,xo),_(4,Tn),_(5,ti),_(6,gg),_(7,Ji),_(8,we),_(9,Te),_(10,mC),_(11,Sce)],vAe);class p3t extends di{constructor(){super({id:"workbench.action.url.openUrl",title:Pe(907,"Open URL"),category:la.Developer,f1:!0})}async run(e){const t=e.get(Tn),i=e.get(ace);return t.input({prompt:g(908,"URL to open")}).then(n=>{if(n){const r=N.parse(n);i.open(r,{originalUrl:n})}})}}Et(p3t);vt.registerCommand(mAe);Yn.appendMenuItem(_e.CommandPalette,{command:{id:mAe.id,title:mAe.description.description}});je.as(hf.Workbench).registerWorkbenchContribution(vAe,Ms.Restored);Ju(_ee.ID,_ee,Cc.BlockRestore);Ju(pee.ID,pee,Cc.BlockRestore);const m3t=je.as(Pn.Configuration);m3t.registerConfiguration({...eG,properties:{"workbench.trustedDomains.promptInTrustedWorkspace":{scope:ct.APPLICATION,type:"boolean",default:!1,description:g(909,"When enabled, trusted domain prompts will appear when opening links in trusted workspaces.")}}});var qv;(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"})(qv||(qv={}));var H5e;(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"})(H5e||(H5e={}));var em;(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"})(em||(em={}));var vee;(function(s){s.DEFAULT="default",s.TOP="top",s.BOTTOM="bottom",s.HIDDEN="hidden"})(vee||(vee={}));var UT;(function(s){s.MULTIPLE="multiple",s.SINGLE="single",s.NONE="none"})(UT||(UT={}));var rz;(function(s){s.DEFAULT="default",s.TITLEBAR="titleBar",s.HIDDEN="hidden"})(rz||(rz={}));var Nu;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT",s[s.BOTTOM=2]="BOTTOM",s[s.TOP=3]="TOP"})(Nu||(Nu={}));function _3t(s){return s===Nu.BOTTOM||s===Nu.TOP}var Xv;(function(s){s[s.ALWAYS=0]="ALWAYS",s[s.NEVER=1]="NEVER",s[s.REMEMBER_LAST=2]="REMEMBER_LAST"})(Xv||(Xv={}));function $1(s){switch(s){case Nu.LEFT:return"left";case Nu.RIGHT:return"right";case Nu.BOTTOM:return"bottom";case Nu.TOP:return"top";default:return"bottom"}}const v3t={[$1(Nu.LEFT)]:Nu.LEFT,[$1(Nu.RIGHT)]:Nu.RIGHT,[$1(Nu.BOTTOM)]:Nu.BOTTOM,[$1(Nu.TOP)]:Nu.TOP};function $K(s){return v3t[s]}function Hue(s){switch(s){case Xv.ALWAYS:return"always";case Xv.NEVER:return"never";case Xv.REMEMBER_LAST:return"preserve";default:return"preserve"}}Hue(Xv.ALWAYS)+"",Xv.ALWAYS,Hue(Xv.NEVER)+"",Xv.NEVER,Hue(Xv.REMEMBER_LAST)+"",Xv.REMEMBER_LAST;var Hp;(function(s){s[s.SHORT=0]="SHORT",s[s.MEDIUM=1]="MEDIUM",s[s.LONG=2]="LONG"})(Hp||(Hp={}));var TE,ww;(function(s){s.titleSeparator="window.titleSeparator",s.title="window.title"})(ww||(ww={}));const Nnt=(()=>{if(jt&&ld)return"${activeEditorShort}${separator}${rootName}${separator}${profileName}";const s="${dirty}${activeEditorShort}${separator}${rootName}${separator}${profileName}${separator}${appName}";return Hn?s+"${separator}${remoteName}":s})(),Pnt=jt?" — ":" - ";var XS;let U5e=(XS=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(Rs.SHORT);return`${e?.isDirty()&&!e.isSaving()?TE.TITLE_DIRTY:""}${t}`}constructor(e,t,i,n,r,o,a,c,l,d,h){super(),this.configurationService=i,this.contextKeyService=n,this.environmentService=o,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 ln(()=>this.doUpdateTitle(),0)),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.titleIncludesFocusedView=!1,this.editorService=r.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(ww.title)&&this.updateTitleIncludesFocusedView(),(e.affectsConfiguration(ww.title)||e.affectsConfiguration(ww.titleSeparator))&&this.titleUpdater.schedule()}updateTitleIncludesFocusedView(){const e=this.configurationService.getValue(ww.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=[];jo(t)?i.push(t):rm(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;STe(t)||(t=this.productService.nameLong);const i=Zj(this.windowId,!0).window;!i.document.title&&jt&&t===this.productService.nameLong&&(i.document.title=`${this.productService.nameLong} ${TE.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?`${TE.NLS_EXTENSION_HOST} - ${e}`:TE.NLS_EXTENSION_HOST),this.properties.isAdmin&&(t=TE.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=Pa.getOriginalUri(e,{supportSideBySide:Us.PRIMARY});let r=n?Ro(n):void 0;r?.path==="."&&(r=void 0);let o;this.contextService.getWorkbenchState()===Qi.FOLDER?o=t.folders[0]:n&&(o=this.contextService.getWorkspaceFolder(n)??void 0);let a;if(this.environmentService.remoteAuthority&&!Hn)a=this.labelService.getHostLabel(pe.vscodeRemote,this.environmentService.remoteAuthority);else{const z=QNe(t);z&&(a=this.labelService.getHostLabel(z.scheme,z.authority))}const c=e?e.getTitle(Rs.SHORT):"",l=e?e.getTitle(Rs.MEDIUM):c,d=e?e.getTitle(Rs.LONG):l,h=r?vi(r):"",u=r?this.labelService.getUriLabel(r,{relative:!0}):"",f=r?this.labelService.getUriLabel(r):"",p=this.labelService.getWorkspaceLabel(t),m=this.labelService.getWorkspaceLabel(t,{verbose:Hp.SHORT}),v=i?this.labelService.getUriLabel(i):"",b=o?o.name:"",w=o?this.labelService.getUriLabel(o.uri):"",y=e?.isDirty()&&!e.isSaving()?TE.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(ww.title);typeof P!="string"&&(P=Nnt);let R=this.configurationService.getValue(ww.titleSeparator);return typeof R!="string"&&(R=Pnt),nPt(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(ww.title),t=this.configurationService.inspect(ww.titleSeparator);return e.value!==e.defaultValue||t.value!==t.defaultValue}},TE=XS,XS.NLS_USER_IS_ADMIN=jn?g(4821,"[Administrator]"):g(4822,"[Superuser]"),XS.NLS_EXTENSION_HOST=g(4823,"[Extension Development Host]"),XS.TITLE_DIRTY="● ",XS);U5e=TE=D([_(2,Te),_(3,Le),_(4,ti),_(5,fv),_(6,Ci),_(7,Os),_(8,pg),_(9,xo),_(10,Nm)],U5e);var KP,Sk;let bee=(Sk=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 ict(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(KP.SETTING_ID_ENABLED)){const t=this.enabled;this.storeEnablementState(),t!==this.enabled&&this.patterns.length>0&&this._onDidChange.fire()}else e.affectsConfiguration(KP.SETTING_ID_PATTERNS)&&(this.cache.clear(),this.storeCustomPatterns(),this._onDidChange.fire())}))}storeEnablementState(){this.enabled=this.configurationService.getValue(KP.SETTING_ID_ENABLED)}storeCustomPatterns(){this.patterns=[];const e=this.configurationService.getValue(KP.SETTING_ID_PATTERNS);for(const t in e){const i=e[t];if(!this._templateRegexValidation.test(i))continue;const n=yM(t),r=X_(t);this.patterns.push({pattern:t,template:i,isAbsolutePath:n,parsedPattern:r})}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 r;if(t&&!n.isAbsolutePath?(i||(i=MN(Ro(t.uri),e)??e.path),r=i):r=e.path,n.parsedPattern(r))return this.applyTemplate(n.template,e,r)}}applyTemplate(e,t,i){let n;return e.replace(this._parsedTemplateExpression,(r,o,...a)=>{n=n??adt(t.path);const{dirnameN:c="0",extnameN:l="0"}=a.pop();if(o==="filename"){const{filename:d}=this._filenameCaptureExpression.exec(n.base)?.groups??{};if(d)return d}else if(o==="extname"){const d=this.getExtnames(n.base);if(d)return d}else if(o.startsWith("extname")){const d=parseInt(l),h=this.getNthExtname(n.base,d);if(h)return h}else if(o.startsWith("dirname")){const d=parseInt(c),h=this.getNthDirname(xb(i),d);if(h)return h}return r})}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 r=e[n];if(!(r===void 0||r===""))return r}},KP=Sk,Sk.SETTING_ID_PATTERNS="workbench.editor.customLabels.patterns",Sk.SETTING_ID_ENABLED="workbench.editor.customLabels.enabled",Sk);bee=KP=D([_(0,Te),_(1,Ci)],bee);const GK=je.as(Pn.Configuration);(function(){Ju(cX.ID,cX,Cc.Eventually),Ju(lX.ID,lX,Cc.AfterRestored),GK.registerConfiguration({...eG,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:ld,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"},[em.EDITOR_TABS_MODE]:{type:"string",enum:[UT.MULTIPLE,UT.SINGLE,UT.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"},[em.EDITOR_ACTIONS_LOCATION]:{type:"string",enum:[rz.DEFAULT,rz.TITLEBAR,rz.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},[bee.SETTING_ID_ENABLED]:{type:"boolean",markdownDescription:g(928,"Controls whether the custom workbench editor labels should be applied."),default:!0},[bee.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+=` +`:"",e.length===0?i+=l3t:i+=JSON.stringify(e,null,2),i}var ZB;let _ee=(ZB=class{constructor(e,t,i){this.fileService=e,this.storageService=t,this.instantiationService=i,this.capabilities=zn.FileReadWrite,this.onDidChangeCapabilities=M.None,this.onDidChangeFile=M.None,this.fileService.registerProvider(a3t,this)}stat(e){return Promise.resolve(c3t)}async readFile(e){let t=this.storageService.get(pAe,Ie.APPLICATION);const i=e.fragment,{defaultTrustedDomains:n,trustedDomains:r}=await this.instantiationService.invokeFunction(o3t);return(!t||t.indexOf(Lnt)===-1||t.indexOf(Rnt)===-1||t.indexOf(i??"")===-1||[...n,...r].some(a=>!Qn(t).includes(a)))&&(t=d3t(n,r,i)),Ge.fromString(t).buffer}writeFile(e,t,i){try{const n=Ge.wrap(t).toString(),r=af(n);this.storageService.store(pAe,n,Ie.APPLICATION,cn.USER),this.storageService.store(Jce,JSON.stringify(r)||"",Ie.APPLICATION,cn.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)}},ZB.ID="workbench.contrib.trustedDomainsFileSystemProvider",ZB);_ee=D([_(0,Xt),_(1,Gi),_(2,we)],_ee);const h3t=(s,e)=>{let t=s.with({query:null,fragment:null}).toString(!0);const i=o=>o.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 bw(n,t,e,0,0);const r=/^(https?):\/\//.exec(t)?.[1];return r?bw(n,t,`${r}://${e}`,0,0):!1},bw=(s,e,t,i,n)=>{if(s[i]?.[n]!==void 0)return s[i][n];const r=[];if(i===e.length)return n===t.length;if(n===t.length)return e.slice(i)[0]==="/";if(e[i]===t[n]&&r.push(bw(s,e,t,i+1,n+1)),t[n]+t[n+1]==="*."&&(["/",":"].includes(e[i])||r.push(bw(s,e,t,i+1,n)),r.push(bw(s,e,t,i,n+2))),t[n]==="*"&&(i+1===e.length?r.push(bw(s,e,t,i+1,n+1)):r.push(bw(s,e,t,i+1,n)),r.push(bw(s,e,t,i,n+1))),t[n]+t[n+1]===":*")if(e[i]===":"){let o=i+1;do o++;while(/[0-9]/.test(e[o]));r.push(bw(s,e,t,o,n+2))}else r.push(bw(s,e,t,i,n+2));return s[i][n]=r.some(o=>o===!0)};let _Ae=class extends V{constructor(e,t){super(),this._instantiationService=e,this._storageService=t;const i=()=>new o5(ri,()=>{const{defaultTrustedDomains:n,trustedDomains:r}=this._instantiationService.invokeFunction(mee);return[...n,...r]});this._staticTrustedDomainsResult=i(),this._register(this._storageService.onDidChangeValue(Ie.APPLICATION,Jce,this._register(new Z))(()=>{this._staticTrustedDomainsResult?.dispose(),this._staticTrustedDomainsResult=i()}))}isValid(e){const{defaultTrustedDomains:t,trustedDomains:i}=this._instantiationService.invokeFunction(mee),n=[...t,...i];return Mnt(e,n)}};_Ae=D([_(0,we),_(1,Gi)],_Ae);const u3t=/^localhost(:\d+)?$/i,g3t=/^127.0.0.1(:\d+)?$/;function f3t(s){return u3t.test(s)||g3t.test(s)}function W5e(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 Mnt(s,e){if(s=N.parse(W5e(s)),e=e.map(W5e),f3t(s.authority))return!0;for(let t=0;tthis.validateLink(f,p)})}async validateLink(e,t){if(!IA(e,pe.http)&&!IA(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:r,authority:o,path:a,query:c,fragment:l}=n;let d=`${r}://${o}${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:Ze.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(mee),v=`${r}://${o}`,b=await r3t(m,v,n,this._quickInputService,this._storageService,this._editorService);return!!(b.indexOf("*")!==-1||Mnt(n,b))}}],cancelButton:{run:()=>!1}});return p}}};vAe=D([_(0,Ar),_(1,Gi),_(2,ir),_(3,xo),_(4,Tn),_(5,ti),_(6,gg),_(7,Ji),_(8,we),_(9,Te),_(10,mC),_(11,Sce)],vAe);class p3t extends di{constructor(){super({id:"workbench.action.url.openUrl",title:Pe(907,"Open URL"),category:la.Developer,f1:!0})}async run(e){const t=e.get(Tn),i=e.get(ace);return t.input({prompt:g(908,"URL to open")}).then(n=>{if(n){const r=N.parse(n);i.open(r,{originalUrl:n})}})}}Et(p3t);vt.registerCommand(mAe);Yn.appendMenuItem(_e.CommandPalette,{command:{id:mAe.id,title:mAe.description.description}});je.as(hf.Workbench).registerWorkbenchContribution(vAe,Ms.Restored);Ju(_ee.ID,_ee,Cc.BlockRestore);Ju(pee.ID,pee,Cc.BlockRestore);const m3t=je.as(Pn.Configuration);m3t.registerConfiguration({...eG,properties:{"workbench.trustedDomains.promptInTrustedWorkspace":{scope:ct.APPLICATION,type:"boolean",default:!1,description:g(909,"When enabled, trusted domain prompts will appear when opening links in trusted workspaces.")}}});var qv;(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"})(qv||(qv={}));var H5e;(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"})(H5e||(H5e={}));var em;(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"})(em||(em={}));var vee;(function(s){s.DEFAULT="default",s.TOP="top",s.BOTTOM="bottom",s.HIDDEN="hidden"})(vee||(vee={}));var UT;(function(s){s.MULTIPLE="multiple",s.SINGLE="single",s.NONE="none"})(UT||(UT={}));var rz;(function(s){s.DEFAULT="default",s.TITLEBAR="titleBar",s.HIDDEN="hidden"})(rz||(rz={}));var Nu;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT",s[s.BOTTOM=2]="BOTTOM",s[s.TOP=3]="TOP"})(Nu||(Nu={}));function _3t(s){return s===Nu.BOTTOM||s===Nu.TOP}var Xv;(function(s){s[s.ALWAYS=0]="ALWAYS",s[s.NEVER=1]="NEVER",s[s.REMEMBER_LAST=2]="REMEMBER_LAST"})(Xv||(Xv={}));function $1(s){switch(s){case Nu.LEFT:return"left";case Nu.RIGHT:return"right";case Nu.BOTTOM:return"bottom";case Nu.TOP:return"top";default:return"bottom"}}const v3t={[$1(Nu.LEFT)]:Nu.LEFT,[$1(Nu.RIGHT)]:Nu.RIGHT,[$1(Nu.BOTTOM)]:Nu.BOTTOM,[$1(Nu.TOP)]:Nu.TOP};function $K(s){return v3t[s]}function Hue(s){switch(s){case Xv.ALWAYS:return"always";case Xv.NEVER:return"never";case Xv.REMEMBER_LAST:return"preserve";default:return"preserve"}}Hue(Xv.ALWAYS)+"",Xv.ALWAYS,Hue(Xv.NEVER)+"",Xv.NEVER,Hue(Xv.REMEMBER_LAST)+"",Xv.REMEMBER_LAST;var Hp;(function(s){s[s.SHORT=0]="SHORT",s[s.MEDIUM=1]="MEDIUM",s[s.LONG=2]="LONG"})(Hp||(Hp={}));var TE,ww;(function(s){s.titleSeparator="window.titleSeparator",s.title="window.title"})(ww||(ww={}));const Nnt=(()=>{if(jt&&ld)return"${activeEditorShort}${separator}${rootName}${separator}${profileName}";const s="${dirty}${activeEditorShort}${separator}${rootName}${separator}${profileName}${separator}${appName}";return Hn?s+"${separator}${remoteName}":s})(),Pnt=jt?" — ":" - ";var XS;let U5e=(XS=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(Rs.SHORT);return`${e?.isDirty()&&!e.isSaving()?TE.TITLE_DIRTY:""}${t}`}constructor(e,t,i,n,r,o,a,c,l,d,h){super(),this.configurationService=i,this.contextKeyService=n,this.environmentService=o,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 ln(()=>this.doUpdateTitle(),0)),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.titleIncludesFocusedView=!1,this.editorService=r.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(ww.title)&&this.updateTitleIncludesFocusedView(),(e.affectsConfiguration(ww.title)||e.affectsConfiguration(ww.titleSeparator))&&this.titleUpdater.schedule()}updateTitleIncludesFocusedView(){const e=this.configurationService.getValue(ww.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=[];jo(t)?i.push(t):rm(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;STe(t)||(t=this.productService.nameLong);const i=Zj(this.windowId,!0).window;!i.document.title&&jt&&t===this.productService.nameLong&&(i.document.title=`${this.productService.nameLong} ${TE.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?`${TE.NLS_EXTENSION_HOST} - ${e}`:TE.NLS_EXTENSION_HOST),this.properties.isAdmin&&(t=TE.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=Fa.getOriginalUri(e,{supportSideBySide:Us.PRIMARY});let r=n?Ro(n):void 0;r?.path==="."&&(r=void 0);let o;this.contextService.getWorkbenchState()===Qi.FOLDER?o=t.folders[0]:n&&(o=this.contextService.getWorkspaceFolder(n)??void 0);let a;if(this.environmentService.remoteAuthority&&!Hn)a=this.labelService.getHostLabel(pe.vscodeRemote,this.environmentService.remoteAuthority);else{const z=QNe(t);z&&(a=this.labelService.getHostLabel(z.scheme,z.authority))}const c=e?e.getTitle(Rs.SHORT):"",l=e?e.getTitle(Rs.MEDIUM):c,d=e?e.getTitle(Rs.LONG):l,h=r?vi(r):"",u=r?this.labelService.getUriLabel(r,{relative:!0}):"",f=r?this.labelService.getUriLabel(r):"",p=this.labelService.getWorkspaceLabel(t),m=this.labelService.getWorkspaceLabel(t,{verbose:Hp.SHORT}),v=i?this.labelService.getUriLabel(i):"",b=o?o.name:"",w=o?this.labelService.getUriLabel(o.uri):"",y=e?.isDirty()&&!e.isSaving()?TE.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(ww.title);typeof P!="string"&&(P=Nnt);let R=this.configurationService.getValue(ww.titleSeparator);return typeof R!="string"&&(R=Pnt),nPt(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(ww.title),t=this.configurationService.inspect(ww.titleSeparator);return e.value!==e.defaultValue||t.value!==t.defaultValue}},TE=XS,XS.NLS_USER_IS_ADMIN=jn?g(4821,"[Administrator]"):g(4822,"[Superuser]"),XS.NLS_EXTENSION_HOST=g(4823,"[Extension Development Host]"),XS.TITLE_DIRTY="● ",XS);U5e=TE=D([_(2,Te),_(3,Le),_(4,ti),_(5,fv),_(6,Ci),_(7,Os),_(8,pg),_(9,xo),_(10,Nm)],U5e);var KP,Sk;let bee=(Sk=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 ict(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(KP.SETTING_ID_ENABLED)){const t=this.enabled;this.storeEnablementState(),t!==this.enabled&&this.patterns.length>0&&this._onDidChange.fire()}else e.affectsConfiguration(KP.SETTING_ID_PATTERNS)&&(this.cache.clear(),this.storeCustomPatterns(),this._onDidChange.fire())}))}storeEnablementState(){this.enabled=this.configurationService.getValue(KP.SETTING_ID_ENABLED)}storeCustomPatterns(){this.patterns=[];const e=this.configurationService.getValue(KP.SETTING_ID_PATTERNS);for(const t in e){const i=e[t];if(!this._templateRegexValidation.test(i))continue;const n=yM(t),r=X_(t);this.patterns.push({pattern:t,template:i,isAbsolutePath:n,parsedPattern:r})}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 r;if(t&&!n.isAbsolutePath?(i||(i=MN(Ro(t.uri),e)??e.path),r=i):r=e.path,n.parsedPattern(r))return this.applyTemplate(n.template,e,r)}}applyTemplate(e,t,i){let n;return e.replace(this._parsedTemplateExpression,(r,o,...a)=>{n=n??adt(t.path);const{dirnameN:c="0",extnameN:l="0"}=a.pop();if(o==="filename"){const{filename:d}=this._filenameCaptureExpression.exec(n.base)?.groups??{};if(d)return d}else if(o==="extname"){const d=this.getExtnames(n.base);if(d)return d}else if(o.startsWith("extname")){const d=parseInt(l),h=this.getNthExtname(n.base,d);if(h)return h}else if(o.startsWith("dirname")){const d=parseInt(c),h=this.getNthDirname(xb(i),d);if(h)return h}return r})}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 r=e[n];if(!(r===void 0||r===""))return r}},KP=Sk,Sk.SETTING_ID_PATTERNS="workbench.editor.customLabels.patterns",Sk.SETTING_ID_ENABLED="workbench.editor.customLabels.enabled",Sk);bee=KP=D([_(0,Te),_(1,Ci)],bee);const GK=je.as(Pn.Configuration);(function(){Ju(cX.ID,cX,Cc.Eventually),Ju(lX.ID,lX,Cc.AfterRestored),GK.registerConfiguration({...eG,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:ld,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"},[em.EDITOR_TABS_MODE]:{type:"string",enum:[UT.MULTIPLE,UT.SINGLE,UT.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"},[em.EDITOR_ACTIONS_LOCATION]:{type:"string",enum:[rz.DEFAULT,rz.TITLEBAR,rz.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},[bee.SETTING_ID_ENABLED]:{type:"boolean",markdownDescription:g(928,"Controls whether the custom workbench editor labels should be applied."),default:!0},[bee.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(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:ct.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:ct.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:ct.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:ct.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:ct.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:ct.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:ct.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.")},[em.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:jt},"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:ct.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:jt?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"]},[em.LAYOUT_ACTIONS]:{type:"boolean",default:!0,markdownDescription:Hn?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(` -- `),GK.registerConfiguration({...jZe,properties:{"window.title":{type:"string",default:Nnt,markdownDescription:e},"window.titleSeparator":{type:"string",default:Pnt,markdownDescription:g(1081,"Separator used by {0}.","`#window.title#`")},[em.COMMAND_CENTER]:{type:"boolean",default:!0,markdownDescription:Hn?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."),jt?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."),Hn?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:Hn?"compact":"classic",scope:ct.APPLICATION,markdownDescription:jt?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:jn||mo||Hn},"window.enableMenuBarMnemonics":{type:"boolean",default:!0,scope:ct.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:jn||mo},"window.customMenuBarAltFocus":{type:"boolean",default:!0,scope:ct.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:jn||mo},"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."),jt?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:ct.APPLICATION,markdownDescription:g(jt?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:ct.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:[Hn?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."),Hn?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."),Hn?g(1109,"Never explicitly ask for confirmation unless data loss is imminent."):g(1110,"Never explicitly ask for confirmation.")],default:Hn&&!VKe()?"keyboardOnly":"never",markdownDescription:Hn?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:ct.APPLICATION}}}),Ju(dX.ID,dX,Cc.Eventually),GK.registerConfiguration({...sNt,properties:{"problems.visibility":{type:"boolean",default:!0,description:g(1113,"Controls whether the problems are visible throughout the editor and workbench.")}}}),GK.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.")}}})})();je.as(Fm.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([em.ACTIVITY_BAR_LOCATION,{value:vee.HIDDEN}]),e}}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:em.ACTIVITY_BAR_LOCATION,migrateFn:s=>{const e=[];return s==="side"&&e.push([em.ACTIVITY_BAR_LOCATION,{value:vee.DEFAULT}]),e}}]);je.as(Fm.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:em.EDITOR_TABS_MODE,migrateFn:s=>{const e=[];return typeof s=="boolean"&&(s=s?UT.MULTIPLE:UT.SINGLE,e.push([em.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 Fnt=()=>!1,Ont=(s,e)=>!1;const b3t=sN.prototype.getCommandPicks;sN.prototype.getCommandPicks=async function(s){let e=await b3t.call(this,s);return Fnt()||(e=e.map(t=>({...t,buttons:void 0}))),e};let bAe=class{constructor(e){this.instantiationService=e,this.workbenchQuickInputService=e.createInstance(fCe)}get activeService(){const e=kt.get(qt).getFocusedCodeEditor();return e==null||Ont(e,e instanceof iI)?this.workbenchQuickInputService:(this.standaloneQuickInputService??(this.standaloneQuickInputService=this.instantiationService.createInstance(F3)),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=Ue.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()}};bAe=D([_(0,we)],bAe);function w3t({isKeybindingConfigurationVisible:s,shouldUseGlobalPicker:e}={}){return s!=null&&(Fnt=s),e!=null&&(Ont=e),{[Tn.toString()]:new yi(bAe,[],!0)}}async function y3t(s,e,t,i,n,r){let o;try{await C3t(s,e,t,i,n,r)}catch(a){o=a}finally{o&&n.errorTransformer&&(o=n.errorTransformer(o)),typeof o<"u"&&t.error(o),t.end()}}async function C3t(s,e,t,i,n,r){Uue(r);const o=await s.open(e,{create:!1});try{Uue(r);let a=0,c=0,l=n&&typeof n.length=="number"?n.length:void 0,d=Ge.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(o,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=Ge.alloc(Math.min(n.bufferSize,typeof l=="number"?l:n.bufferSize)),u=0);while(c>0&&(typeof l!="number"||l>0)&&Uue(r)&&S3t(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 d0(a)}finally{await s.close(o)}}function Uue(s){if(s.isCancellationRequested)throw Ty();return!0}function S3t(s,e){if(typeof e?.limits?.size=="number"&&s>e.limits.size)throw gs(g(4398,"File is too large to open"),ot.FileTooLarge);return!0}var wAe;function Bnt(s){return s.scheme===pe.file?s.fsPath:s.toString(!0)}async function Wnt(s,e,t){const i=[];for(;!s.isEqual(t,s.dirname(t));)try{if(!((await e.stat(t)).type&rn.Directory))throw new Error(g(581,"Unable to create folder '{0}' that already exists but is not a directory",Bnt(t)));break}catch(n){if(Qk(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(r){if(Qk(r)!==ot.FileExists)throw r}}}var UR;let yAe=(UR=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 LTe)}registerProvider(e,t){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);ls(`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 r=new iJ(n,!this.isPathCaseSensitive(t));this.internalOnDidFilesChange.fire(r),r.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(r)})),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),wt(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 er.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 ui.map(this.provider,([e,t])=>({scheme:e,capabilities:t.capabilities}))}async withProvider(e){if(!jKe(e))throw new Rd(g(582,"Unable to resolve filesystem provider with relative file path '{0}'",this.resourceForError(e)),ji.FILE_INVALID_PATH);await this.activateProvider(e.scheme);const t=this.provider.get(e.scheme);if(!t){const i=new Ra;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(mE(t)||Km(t)||qq(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(mE(t)||Km(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 Qk(i)===ot.FileNotFound?new Rd(g(584,"Unable to resolve nonexistent file '{0}'",this.resourceForError(e)),ji.FILE_NOT_FOUND):d0(i)}}async doResolveFile(e,t){const i=await this.withProvider(e),n=this.isPathCaseSensitive(i),r=t?.resolveTo,o=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=Ih.forUris(()=>!n),l.set(e,!0),r&&l.fill(!0,r)),l.get(d.resource)||l.findSuperstr(d.resource.with({query:null,fragment:null}))?!0:d.isDirectory&&o?h===1:!1))}async toFileStat(e,t,i,n,r,o){const{providerExtUri:a}=this.getExtUri(e),c={resource:t,name:a.basename(t),isFile:(i.type&rn.File)!==0,isDirectory:(i.type&rn.Directory)!==0,isSymbolicLink:(i.type&rn.SymbolicLink)!==0,mtime:i.mtime,ctime:i.ctime,size:i.size,readonly:!!((i.permissions??0)&up.Readonly)||!!(e.capabilities&zn.Readonly),locked:!!((i.permissions??0)&up.Locked),etag:nJ({mtime:i.mtime,size:i.size}),children:void 0};if(c.isDirectory&&o(c,n)){try{const l=await e.readdir(t),d=await er.settled(l.map(async([h,u])=>{try{const f=a.joinPath(t,h),p=r?await e.stat(f):{type:u};return await this.toFileStat(e,f,p,l.length,r,o)}catch(f){return this.logService.trace(f),null}}));c.children=Oi(d)}catch(l){this.logService.trace(l),c.children=[]}return c}return c}async resolveAll(e){return er.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 Rd(g(585,"Unable to create file '{0}' that already exists when overwrite flag is not set",this.resourceForError(e)),ji.FILE_MODIFIED_SINCE,t)}async createFile(e,t=Ge.fromString(""),i){await this.doValidateCreateFile(e,i);const n=await this.writeFile(e,t);return this._onDidRunOperation.fire(new vP(e,Ei.CREATE,n)),n}async writeFile(e,t,i){const n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:r}=this.getExtUri(n);let o=i;if(eWe(n)&&!o?.atomic){const a=n.enforceAtomicWriteFile?.(e);a&&(o={...i,atomic:a})}try{await this.validateWriteFile(n,e,o)||await this.mkdirp(n,r.dirname(e));let c;if(Km(n)&&!(t instanceof Ge))if(Rq(t)){const l=await Yut(t,3);l.ended?c=Ge.concat(l.buffer):c=l}else c=jut(t,l=>Ge.concat(l),3);else c=t;!mE(n)||Km(n)&&c instanceof Ge||Km(n)&&eWe(n)&&o?.atomic?await this.doWriteUnbuffered(n,e,o,c):await this.doWriteBuffered(n,e,o,c instanceof Ge?Tqe(c):c),this._onDidRunOperation.fire(new vP(e,Ei.WRITE))}catch(a){throw new Rd(g(586,"Unable to write file '{0}' ({1})",this.resourceForError(e),d0(a).toString()),Qw(a),o)}return this.resolve(e,{resolveMetadata:!0})}async validateWriteFile(e,t,i){const n=!!i?.unlock;if(n&&!(e.capabilities&zn.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&zn.FileAtomicWrite))throw new Error(g(588,"Unable to atomically write file '{0}' because provider does not support it.",this.resourceForError(t)));if(!(e.capabilities&zn.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 o;try{o=await e.stat(t)}catch{return}if(o.type&rn.Directory)throw new Rd(g(591,"Unable to write file '{0}' that is actually a directory",this.resourceForError(t)),ji.FILE_IS_DIRECTORY,i);if(this.throwIfFileIsReadonly(t,o),typeof i?.mtime=="number"&&typeof i.etag=="string"&&i.etag!==x_&&typeof o.mtime=="number"&&typeof o.size=="number"&&i.mtime{this.writeQueue.queueFor(t,async()=>{try{const a=await this.doReadFile(e,t,i,n);r(a)}catch(a){o(a)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,t,i,n){const r=await this.doReadFileStream(e,t,{...i,preferUnbuffered:!0},n);return{...r,value:await oD(r.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 r=new li(n);let o=i;Uhe(e)&&e.enforceAtomicReadFile?.(t)&&(o={...i,atomic:!0});const a=this.validateReadFile(t,o).then(l=>l,l=>{throw r.dispose(!0),l});let c;try{return typeof o?.etag=="string"&&o.etag!==x_&&await a,o?.atomic&&Uhe(e)||!(mE(e)||qq(e))||Km(e)&&o?.preferUnbuffered?c=this.readFileUnbuffered(e,t,o):qq(e)?c=this.readFileStreamed(e,t,r.token,o):c=this.readFileBuffered(e,t,r.token,o),c.on("end",()=>r.dispose()),c.on("error",()=>r.dispose()),{...await a,value:c}}catch(l){throw c&&await VTe(c),this.restoreReadError(l,t,o)}}restoreReadError(e,t,i){const n=g(593,"Unable to read file '{0}' ({1})",this.resourceForError(t),d0(e).toString());return e instanceof T5?new T5(n,e.stat,i):e instanceof Qq?new Qq(n,e.fileOperationResult,e.size,e.options):new Rd(n,Qw(e),i)}readFileStreamed(e,t,i,n=Object.create(null)){const r=e.readFileStream(t,n,i);return Zut(r,{data:o=>o instanceof Ge?o:Ge.wrap(o),error:o=>this.restoreReadError(o,t,n)},o=>Ge.concat(o))}readFileBuffered(e,t,i,n=Object.create(null)){const r=Lqe();return y3t(e,t,r,o=>o,{...n,bufferSize:this.BUFFER_SIZE,errorTransformer:o=>this.restoreReadError(o,t,n)},i),r}readFileUnbuffered(e,t,i){const n=eE(r=>Ge.concat(r));return(async()=>{try{let r;i?.atomic&&Uhe(e)?r=await e.readFile(t,{atomic:!0}):r=await e.readFile(t),typeof i?.position=="number"&&(r=r.slice(i.position)),typeof i?.length=="number"&&(r=r.slice(0,i.length)),this.validateReadFileLimits(t,r.byteLength,i),n.end(Ge.wrap(r))}catch(r){n.error(r),n.end()}})(),n}async validateReadFile(e,t){const i=await this.resolve(e,{resolveMetadata:!0});if(i.isDirectory)throw new Rd(g(594,"Unable to read file '{0}' that is actually a directory",this.resourceForError(e)),ji.FILE_IS_DIRECTORY,t);if(typeof t?.etag=="string"&&t.etag!==x_&&t.etag===i.etag)throw new T5(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 Qq(g(596,"Unable to read file '{0}' that is too large to open",this.resourceForError(e)),ji.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 r=i==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e):await this.withReadProvider(e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);await this.doValidateMoveCopy(r,e,o,t,i,n)}catch(r){return r}return!0}async move(e,t,i){const n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),o=await this.doMoveCopy(n,e,r,t,"move",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new vP(e,o==="move"?Ei.MOVE:Ei.COPY,a)),a}async copy(e,t,i){const n=await this.withReadProvider(e),r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),o=await this.doMoveCopy(n,e,r,t,"copy",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new vP(e,o==="copy"?Ei.COPY:Ei.MOVE,a)),a}async doMoveCopy(e,t,i,n,r,o){if(t.toString()===n.toString())return r;const{exists:a,isSameResourceWithDifferentPathCase:c}=await this.doValidateMoveCopy(e,t,i,n,r,o);if(a&&!c&&o&&await this.del(n,{recursive:!0}),await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(n)),r==="copy"){if(e===i&&Z2e(e))await e.copy(t,n,{overwrite:o});else{const l=await this.resolve(t);l.isDirectory?await this.doCopyFolder(e,l,i,n):await this.doCopyFile(e,t,i,n)}return r}else return e===i?(await e.rename(t,n,{overwrite:o}),r):(await this.doMoveCopy(e,t,i,n,"copy",o),await this.del(t,{recursive:!0}),"copy")}async doCopyFile(e,t,i,n){if(mE(e)&&mE(i))return this.doPipeBuffered(e,t,i,n);if(mE(e)&&Km(i))return this.doPipeBufferedToUnbuffered(e,t,i,n);if(Km(e)&&mE(i))return this.doPipeUnbufferedToBuffered(e,t,i,n);if(Km(e)&&Km(i))return this.doPipeUnbuffered(e,t,i,n)}async doCopyFolder(e,t,i,n){await i.mkdir(n),Array.isArray(t.children)&&await er.settled(t.children.map(async r=>{const o=this.getExtUri(i).providerExtUri.joinPath(n,r.name);return r.isDirectory?this.doCopyFolder(e,await this.resolve(r.resource),i,o):this.doCopyFile(e,r.resource,i,o)}))}async doValidateMoveCopy(e,t,i,n,r,o){let a=!1;if(e===i){const{providerExtUri:l,isPathCaseSensitive:d}=this.getExtUri(e);if(d||(a=l.isEqual(t,n)),a&&r==="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(!o)throw new Rd(g(599,"Unable to move/copy '{0}' because target '{1}' already exists at destination.",this.resourceForError(t),this.resourceForError(n)),ji.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?Dn:Xoe,isPathCaseSensitive:t}}isPathCaseSensitive(e){return!!(e.capabilities&zn.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 vP(e,Ei.CREATE,i)),i}async mkdirp(e,t){const{providerExtUri:i}=this.getExtUri(e);return Wnt(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&zn.Trash))throw new Error(g(601,"Unable to delete file '{0}' via trash because provider does not support it.",this.resourceForError(e)));const r=t?.atomic;if(r&&!(i.capabilities&zn.FileAtomicDelete))throw new Error(g(602,"Unable to delete file '{0}' atomically because provider does not support it.",this.resourceForError(e)));if(n&&r)throw new Error(g(603,"Unable to atomically delete file '{0}' because using trash is enabled.",this.resourceForError(e)));let o;try{o=await i.stat(e)}catch{}if(o)this.throwIfFileIsReadonly(e,o);else throw new Rd(g(604,"Unable to delete nonexistent file '{0}'",this.resourceForError(e)),ji.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(pEt(i)&&!n?.atomic){const c=i.enforceAtomicDelete?.(e);c&&(n={...t,atomic:c})}const r=!!n?.useTrash,o=!!n?.recursive,a=n?.atomic??!1;await i.delete(e,{recursive:o,useTrash:r,atomic:a}),this._onDidRunOperation.fire(new vP(e,Ei.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&&fEt(i)?i.cloneFile(e,t):(await this.mkdirp(n,this.getExtUri(n).providerExtUri.dirname(t)),i===n&&Z2e(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:wAe.WATCHER_CORRELATION_IDS++})}watch(e,t={recursive:!1,excludes:[]}){const i=new Z;let n=!1,r=()=>{n=!0};i.add(Ee(()=>r())),(async()=>{try{const a=await this.doWatch(e,t);n?wt(a):r=()=>wt(a)}catch(a){this.logService.error(a)}})();const o=t.correlationId;if(typeof o=="number"){const a=i.add(new I);return i.add(this.internalOnDidFilesChange.event(l=>{l.correlates(o)&&a.fire(l)})),{onDidChange:a.event,dispose:()=>i.dispose()}}return i}async doWatch(e,t){const i=await this.withProvider(e),n=Hc([this.getExtUri(i).providerExtUri.getComparisonKey(e),t]);let r=this.activeWatchers.get(n);return r||(r={count:0,disposable:i.watch(e,t)},this.activeWatchers.set(n,r)),r.count+=1,Ee(()=>{r&&(r.count--,r.count===0&&(wt(r.disposable),this.activeWatchers.delete(n)))})}dispose(){super.dispose();for(const[,e]of this.activeWatchers)wt(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,t,i,n){return this.writeQueue.queueFor(t,async()=>{const r=await e.open(t,{create:!0,unlock:i?.unlock??!1});try{Rq(n)||jde(n)?await this.doWriteStreamBufferedQueued(e,r,n):await this.doWriteReadableBufferedQueued(e,r,n)}catch(o){throw d0(o)}finally{await e.close(r)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,t,i){let n=0,r;if(jde(i)){if(i.buffer.length>0){const o=Ge.concat(i.buffer);await this.doWriteBuffer(e,t,o,o.byteLength,n,0),n+=o.byteLength}if(i.ended)return;r=i.stream}else r=i;return new Promise((o,a)=>{NN(r,{onData:async c=>{r.pause();try{await this.doWriteBuffer(e,t,c,c.byteLength,n,0)}catch(l){return a(l)}n+=c.byteLength,setTimeout(()=>r.resume())},onError:c=>a(c),onEnd:()=>o()})})}async doWriteReadableBufferedQueued(e,t,i){let n=0,r;for(;(r=i.read())!==null;)await this.doWriteBuffer(e,t,r,r.byteLength,n,0),n+=r.byteLength}async doWriteBuffer(e,t,i,n,r,o){let a=0;for(;athis.doWriteUnbufferedQueued(e,t,i,n),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,t,i,n){let r;n instanceof Ge?r=n:Rq(n)?r=await oD(n):jde(n)?r=await agt(n):r=ogt(n),await e.writeFile(t,r.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 r,o;try{r=await e.open(t,{create:!1}),o=await i.open(n,{create:!0,unlock:!1});const a=Ge.alloc(this.BUFFER_SIZE);let c=0,l=0,d=0;do d=await e.read(r,c,a.buffer,l,a.byteLength-l),await this.doWriteBuffer(i,o,a,d,c,l),c+=d,l+=d,l===a.byteLength&&(l=0);while(d>0)}catch(a){throw d0(a)}finally{await er.settled([typeof r=="number"?e.close(r):Promise.resolve(),typeof o=="number"?i.close(o):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 r=await i.open(n,{create:!0,unlock:!1});try{const o=await e.readFile(t);await this.doWriteBuffer(i,r,Ge.wrap(o),o.byteLength,0,0)}catch(o){throw d0(o)}finally{await i.close(r)}}async doPipeBufferedToUnbuffered(e,t,i,n){const r=await oD(this.readFileBuffered(e,t,Ue.None));await this.doWriteUnbuffered(i,n,void 0,r)}throwIfFileSystemIsReadonly(e,t){if(e.capabilities&zn.Readonly)throw new Rd(g(606,"Unable to modify read-only file '{0}'",this.resourceForError(t)),ji.FILE_PERMISSION_DENIED);return e}throwIfFileIsReadonly(e,t){if((t.permissions??0)&up.Readonly)throw new Rd(g(606,"Unable to modify read-only file '{0}'",this.resourceForError(e)),ji.FILE_PERMISSION_DENIED)}resourceForError(e){return Bnt(e)}},wAe=UR,UR.WATCHER_CORRELATION_IDS=0,UR);yAe=wAe=D([_(0,Ke)],yAe);class V5e{constructor(e){this.type=rn.File,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e}}class N4{constructor(e){this.type=rn.Directory,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e,this.entries=new Map}}class wee 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=zn.FileReadWrite|zn.PathCaseSensitive,this.root=new N4(""),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[]}get capabilities(){return this._capabilities}setReadOnly(e){const t=!!(this._capabilities&zn.Readonly);e!==t&&(this._capabilities=e?zn.Readonly|zn.PathCaseSensitive|zn.FileReadWrite:zn.FileReadWrite|zn.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,r)=>i.push([r,n.type])),i}async readFile(e){const t=this._lookupAsFile(e,!1).data;if(t)return t;throw gs("file not found",ot.FileNotFound)}readFileStream(e){const t=this._lookupAsFile(e,!1).data,i=eE(n=>Ge.concat(n.map(r=>Ge.wrap(r))).buffer);return i.end(t),i}async writeFile(e,t,i){const n=vi(e),r=this._lookupParentDirectory(e);let o=r.entries.get(n);if(o instanceof N4)throw gs("file is directory",ot.FileIsADirectory);if(!o&&!i.create)throw gs("file not found",ot.FileNotFound);if(o&&i.create&&!i.overwrite)throw gs("file exists already",ot.FileExists);o||(o=new V5e(n),r.entries.set(n,o),this._fireSoon({type:Tr.ADDED,resource:e})),o.mtime=Date.now(),o.size=t.byteLength,o.data=t,this._fireSoon({type:Tr.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 gs("file not found",ot.FileNotFound)}close(e){return this.fdMemory.delete(e),Promise.resolve()}read(e,t,i,n,r){const o=this.fdMemory.get(e);if(!o)throw gs("No file with that descriptor open",ot.Unavailable);const a=Ge.wrap(o).slice(t,t+r);return i.set(a.buffer,n),Promise.resolve(a.byteLength)}write(e,t,i,n,r){const o=this.fdMemory.get(e);if(!o)throw gs("No file with that descriptor open",ot.Unavailable);const a=Ge.wrap(i).slice(n,n+r);return o.set(a.buffer,t),Promise.resolve(a.byteLength)}async rename(e,t,i){if(!i.overwrite&&this._lookup(t,!0))throw gs("file exists already",ot.FileExists);const n=this._lookup(e,!1),r=this._lookupParentDirectory(e),o=this._lookupParentDirectory(t),a=vi(t);r.entries.delete(n.name),n.name=a,o.entries.set(a,n),this._fireSoon({type:Tr.DELETED,resource:e},{type:Tr.ADDED,resource:t})}async delete(e,t){const i=Ro(e),n=vi(e),r=this._lookupAsDirectory(i,!1);r.entries.has(n)&&(r.entries.delete(n),r.mtime=Date.now(),r.size-=1,this._fireSoon({type:Tr.UPDATED,resource:i},{resource:e,type:Tr.DELETED}))}async mkdir(e){if(this._lookup(e,!0))throw gs("file exists already",ot.FileExists);const t=vi(e),i=Ro(e),n=this._lookupAsDirectory(i,!1),r=new N4(t);n.entries.set(r.name,r),n.mtime=Date.now(),n.size+=1,this._fireSoon({type:Tr.UPDATED,resource:i},{type:Tr.ADDED,resource:e})}_lookup(e,t){const i=e.path.split("/");let n=this.root;for(const r of i){if(!r)continue;let o;if(n instanceof N4&&(o=n.entries.get(r)),!o){if(t)return;throw gs("file not found",ot.FileNotFound)}n=o}return n}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof N4)return i;throw gs("file not a directory",ot.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i instanceof V5e)return i;throw gs("file is a directory",ot.FileIsADirectory)}_lookupParentDirectory(e){const t=Ro(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 z5e extends Error{constructor(e){super("Missing stores"),this.db=e}}class CAe extends Error{constructor(e){super(`IndexedDB database '${e}' is closed.`),this.code="DBClosed"}}class r1{static async create(e,t,i){const n=await r1.openDatabase(e,t,i);return new r1(n,e)}static async openDatabase(e,t,i){ls(`code/willOpenDatabase/${e}`);try{return await r1.doOpenDatabase(e,t,i)}catch(n){if(n instanceof z5e){console.info("Attempting to recreate the IndexedDB once.",e);try{await r1.deleteDatabase(n.db)}catch(r){throw console.error("Error while deleting the IndexedDB",ou(r)),r}return await r1.doOpenDatabase(e,t,i)}throw n}finally{ls(`code/didOpenDatabase/${e}`)}}static doOpenDatabase(e,t,i){return new Promise((n,r)=>{const o=indexedDB.open(e,t);o.onerror=()=>r(o.error),o.onsuccess=()=>{const a=o.result;for(const c of i)if(!a.objectStoreNames.contains(c)){console.error(`Error while opening IndexedDB. Could not find '${c}'' object store`),r(new z5e(a));return}n(a)},o.onupgradeneeded=()=>{const a=o.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=r=>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 CAe(this.name);const n=this.database.transaction(e,t);return this.pendingTransactions.push(n),new Promise((r,o)=>{n.oncomplete=()=>{Array.isArray(a)?r(a.map(c=>c.result)):r(a.result)},n.onerror=()=>o(n.error?Ra.fromError(n.error):new Ra("unknown error")),n.onabort=()=>o(n.error?Ra.fromError(n.error):new Ra("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 CAe(this.name);const i=this.database.transaction(e,"readonly");return this.pendingTransactions.push(i),new Promise(n=>{const r=new Map,a=i.objectStore(e).openCursor();if(!a)return n(r);a.onsuccess=()=>{a.result?(t(a.result.value)&&r.set(a.result.key.toString(),a.result.value),a.result.continue()):n(r)};const c=l=>{console.error(`IndexedDB getKeyValues(): ${Po(l,!0)}`),n(r)};a.onerror=()=>c(a.error),i.onerror=()=>c(i.error)}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(i),1))}}const Vue=gs(g(609,"File does not exist"),ot.FileNotFound),A3t=gs(g(610,"File is Directory"),ot.FileIsADirectory),$5e=gs(g(611,"File is not a directory"),ot.FileNotADirectory),E3t=gs(g(612,"Directory is not empty"),ot.Unknown),x3t=gs(g(613,"File exceeds available storage quota"),ot.FileExceedsStorageQuota),xv=s=>gs(g(614,"Internal error occurred in IndexedDB File System Provider. ({0})",s),ot.Unknown);class oz{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!==rn.Directory)throw xv("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!==rn.Directory)throw xv("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 xv(`Internal error deleting from IndexedDBFSNode -- got no deletion path parts (encountered while deleting ${t})`);if(this.entry.type!==rn.Directory)throw xv("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 xv("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 xv(`Internal error creating IndexedDBFSNode -- adding empty path (encountered while adding ${i})`);if(this.entry.type!==rn.Directory)throw xv(`Internal error creating IndexedDBFSNode -- parent is not a directory (encountered while adding ${i})`);if(e.length===1){const n=e[0],r=this.entry.children.get(n);if(t.type==="dir"){if(r?.entry.type===rn.File)throw xv(`Internal error creating IndexedDBFSNode -- overwriting file with directory: ${this.entry.path}/${n} (encountered while adding ${i})`);this.entry.children.set(n,r??new oz({type:rn.Directory,path:this.entry.path+"/"+n,children:new Map}))}else{if(r?.entry.type===rn.Directory)throw xv(`Internal error creating IndexedDBFSNode -- overwriting directory with file: ${this.entry.path}/${n} (encountered while adding ${i})`);this.entry.children.set(n,new oz({type:rn.File,path:this.entry.path+"/"+n,size:t.size}))}}else if(e.length>1){const n=e[0];let r=this.entry.children.get(n);if(!r)r=new oz({children:new Map,path:this.entry.path+"/"+n,type:rn.Directory}),this.entry.children.set(n,r);else if(r.type===rn.File)throw xv(`Internal error creating IndexedDBFSNode -- overwriting file entry with directory: ${this.entry.path}/${n} (encountered while adding ${i})`);r.doAdd(e.slice(1),t,i)}}print(e=""){console.log(e+this.entry.path),this.entry.type===rn.Directory&&this.entry.children.forEach(t=>t.print(e+" "))}}class D3t extends V{constructor(e,t,i,n){super(),this.scheme=e,this.indexedDB=t,this.store=i,this.capabilities=zn.FileReadWrite|zn.PathCaseSensitive,this.onDidChangeCapabilities=M.None,this.extUri=new RN(()=>!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 a6,n&&(this.changesBroadcastChannel=this._register(new iPe(`vscode.indexedDB.${e}.changes`)),this._register(this.changesBroadcastChannel.onDidReceiveData(r=>{this._onDidChangeFile.fire(r.map(o=>({type:o.type,resource:N.revive(o.resource)})))})))}watch(e,t){return V.None}async mkdir(e){try{if((await this.stat(e)).type===rn.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===rn.File)return{type:rn.File,ctime:0,mtime:this.mtimes.get(e.toString())||0,size:t.size??(await this.readFile(e)).byteLength};if(t?.type===rn.Directory)return{type:rn.Directory,ctime:0,mtime:0,size:0};throw Vue}async readdir(e){try{const t=(await this.getFiletree()).read(e.path);if(!t)return[];if(t.type!==rn.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",r=>r.get(e.path));if(t===void 0)throw Vue;const i=t instanceof Uint8Array?t:Rt(t)?Ge.fromString(t).buffer:void 0;if(i===void 0)throw xv(`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===rn.Directory)throw A3t;await this.bulkWrite([[e,t]])}catch(n){throw this.reportError("writeFile",n),n}}async rename(e,t,i){const n=await this.getFiletree(),r=n.read(e.path);if(!r)throw Vue;const o=n.read(t.path);if(o){if(!i.overwrite)throw gs("file exists already",ot.FileExists);if(o.type!==r.type)throw gs("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]===rn.File?l.push(d):d[1]===rn.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;uo);else{if(i.type===rn.Directory&&(await this.readdir(e)).length)throw E3t;n=[e.path]}await this.deleteKeys(n),(await this.getFiletree()).delete(e.path),n.forEach(r=>this.mtimes.delete(r)),this.triggerChanges(n.map(r=>({resource:e.with({path:r}),type:Tr.DELETED})))}async tree(e){const t=await this.stat(e),i=[[e.path,t.type]];if(t.type===rn.Directory){const n=await this.readdir(e);for(const[r,o]of n){const a=this.extUri.joinPath(e,r);if(i.push([a.path,o]),o===rn.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 oz({children:new Map,path:"",type:rn.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:Tr.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"?x3t: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 LA||t instanceof CAe?t.code:"unknown"})}}class k3t extends xae{constructor(e=KLe){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)$Y(e,t,i);this.buffer=[]}log(e,t){this._logger?$Y(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 hC;(function(s){s[s.None=0]="None",s[s.Untitled=2]="Untitled",s[s.Scratchpad=4]="Scratchpad"})(hC||(hC={}));const rPe="",I3t="modulepreload",T3t=function(s,e){return new URL(s,e).href},G5e={},VT=function(e,t,i){let n=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");n=Promise.allSettled(t.map(l=>{if(l=T3t(l,i),l in G5e)return;G5e[l]=!0;const d=l.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!i)for(let p=o.length-1;p>=0;p--){const m=o[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":I3t,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 r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return n.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})},Ud="utf8",vS="utf8bom",rN="utf16be",oN="utf16le",nj=[254,255],SAe=[255,254],OV=[239,187,191],L3t=512,R3t=512,M3t=512*8,N3t=512*128;var yee;(function(s){s[s.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(yee||(yee={}));class P3t extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class oPe{static async create(e){let t;if(e!==Ud)t=(await VT(()=>import("./iconv-lite-umd-DwMy-JHR.js").then(n=>n.i),[],import.meta.url).then(n=>n.default??n)).getDecoder(aPe(e));else{const i=new TextDecoder;t={write(n){return i.decode(n,{stream:!0})},end(){return i.decode()}}}return new oPe(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function F3t(s,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?M3t:R3t;return new Promise((i,n)=>{const r=eE(h=>h.join("")),o=[];let a=0,c;const l=new li,d=async()=>{try{const h=await K3t({buffer:Ge.concat(o),bytesRead:a},e.guessEncoding,e.candidateGuessEncodings);if(h.seemsBinary&&e.acceptTextOnly)throw new P3t("Stream is binary but only text is accepted for decoding",yee.STREAM_IS_BINARY);h.encoding=await e.overwriteEncoding(h.encoding),c=await oPe.create(h.encoding);const u=c.write(Ge.concat(o).buffer);r.write(u),o.length=0,a=0,i({stream:r,detected:h})}catch(h){l.cancel(),r.destroy(),n(h)}};NN(s,{onData:async h=>{c?r.write(c.write(h.buffer)):(o.push(h),a+=h.byteLength,a>=t&&(s.pause(),await d(),setTimeout(()=>s.resume())))},onError:h=>r.error(h),onEnd:async()=>{c||await d(),r.end(c?.end())}},l.token)})}async function O3t(s,e,t){const n=(await VT(()=>import("./iconv-lite-umd-DwMy-JHR.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a)).getEncoder(aPe(e),t);let r=!1,o=!1;return{read(){if(o)return null;const a=s.read();if(typeof a!="string"){if(o=!0,!r&&t?.addBOM)switch(e){case Ud:case vS:return Ge.wrap(Uint8Array.from(OV));case rN:return Ge.wrap(Uint8Array.from(nj));case oN:return Ge.wrap(Uint8Array.from(SAe))}const c=n.end();return c&&c.length>0?(r=!0,Ge.wrap(c)):null}return r=!0,Ge.wrap(n.write(a))}}}async function B3t(s){return(await VT(()=>import("./iconv-lite-umd-DwMy-JHR.js").then(t=>t.i),[],import.meta.url).then(t=>t.default??t)).encodingExists(aPe(s))}function aPe(s){return s===vS||s===null?Ud:s}function W3t(s,e){if(!s||eimport("./index-Dqn9_HOx.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a),i=s.slice(0,N3t),n=G3t(i.buffer);e&&(e=Oi(e.map(a=>$3t(a))),e.length===0&&(e=void 0));const r=t.detect(n,e?{detectEncodings:e}:void 0);if(!r||!r.encoding)return null;const o=r.encoding.toLowerCase();return 0<=H3t.indexOf(o)?null:z3t(r.encoding)}const V3t={ibm866:"cp866",big5:"cp950"};function Hnt(s){return s.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function z3t(s){const e=Hnt(s);return V3t[e]||e}function $3t(s){const e=Hnt(s);return sj[e].guessableName}function G3t(s){let e="";for(let t=0;t({seemsBinary:!1,encoding:o})):{seemsBinary:r,encoding:n}}const dx={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}},sj=(()=>{const s={};for(const e in dx)dx[e].guessableName&&(s[e]=dx[e]);return s})();var qP,gy;let Cee=(gy=class extends hI{get name(){return this.configuredLabelFormat==="content"&&!this.hasAssociatedFilePath&&this.cachedModelFirstLineWords?this.cachedModelFirstLineWords:this.labelService.getUriBasenameLabel(this.resource)}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m){super(a,o,p,m),this.resource=e,this.hasAssociatedFilePath=t,this.initialValue=i,this.preferredLanguageId=n,this.preferredEncoding=r,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=rPe,this.capabilities=hC.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===qP.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(Eae(""))}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:Ud}):typeof this.initialValue=="string"&&(t=Tqe(Ge.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 r=await this.workingCopyBackupService.resolve(this);r?(n=r.value,t=!0):n=g6(Ge.fromString(this.initialValue||""));const o=await OLe(await this.textFileService.getDecodedStream(this.resource,n,{encoding:Ud}));this.createTextEditorModel(o,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<=qP.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:qP.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH+1}).trim().replace(/\s+/g," ").replace(/\u202E/g,"");i=i.substr(0,mKe(i,qP.FIRST_LINE_NAME_MAX_LENGTH)[0]),i&&j7().exec(i)&&(t=i),t!==this.cachedModelFirstLineWords&&(this.cachedModelFirstLineWords=t,this._onDidChangeName.fire())}isReadonly(){return!1}},qP=gy,gy.FIRST_LINE_NAME_MAX_LENGTH=40,gy.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH=gy.FIRST_LINE_NAME_MAX_LENGTH*10,gy.ACTIVE_EDITOR_LANGUAGE_ID="${activeEditorLanguage}",gy);Cee=qP=D([_(5,Di),_(6,fi),_(7,X6),_(8,xc),_(9,Pm),_(10,Fr),_(11,Os),_(12,ti),_(13,j6),_(14,_o)],Cee);var BV,Ak;let See=(Ak=class extends hI{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b){super(r,n,f,p),this.resource=e,this.preferredEncoding=t,this.preferredLanguageId=i,this.fileService=o,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=rPe,this.capabilities=hC.None,this.name=Kr(this.labelService.getUriLabel(this.resource)),this.resourceHasExtension=!!Dn.extname(this.resource),this.versionId=0,this.ignoreDirtyOnModelContentChange=!1,this.ignoreSaveFromSaveParticipants=!1,this.lastModelContentChangeFromUndoRedo=void 0,this.saveSequentializer=new eqe,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,Tr.ADDED)&&(i=!1,t=!0):e.contains(this.resource,Tr.DELETED)&&(i=!0,t=!0),t&&this.inOrphanMode!==i){let n=!1;i&&(await Ao(100,Ue.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:Ud});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(r){if(r.fileOperationResult!==ji.FILE_NOT_FOUND)throw i(),r}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}async resolve(e){if(this.trace("resolve() - enter"),ls("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),ls("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,r,o;try{const c=await this.fileService.stat(this.resource);i=c.mtime,n=c.ctime,r=c.size,o=c.etag,this.setOrphaned(!1)}catch(c){i=Date.now(),n=Date.now(),r=0,o=x_,this.setOrphaned(c.fileOperationResult===ji.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:r,etag:o,value:e,encoding:a.encoding,readonly:!1,locked:!1},!0,t)}async resolveFromBackup(e){const t=await this.workingCopyBackupService.resolve(this);let i=Ud;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:x_,value:await OLe(await this.textFileService.getDecodedStream(this.resource,e.value,{encoding:Ud})),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=x_:this.lastResolvedFileStat&&(n=this.lastResolvedFileStat.etag);const r=this.versionId;try{const o=await this.textFileService.readStream(this.resource,{acceptTextOnly:!i,etag:n,encoding:this.preferredEncoding,limits:e?.limits});if(this.setOrphaned(!1),r!==this.versionId){this.trace("resolveFromFile() - exit - without resolving because model content changed");return}return this.resolveFromContent(o,!1,e)}catch(o){const a=o.fileOperationResult;if(this.setOrphaned(a===ji.FILE_NOT_FOUND),this.isResolved()&&a===ji.FILE_NOT_MODIFIED_SINCE){o instanceof T5&&this.updateLastResolvedFileStat(o.stat);return}if(this.isResolved()&&a===ji.FILE_NOT_FOUND&&!t)return;throw o}}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??o9.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===Sa)&&!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,r=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=r}}async save(e=Object.create(null)){return this.isResolved()?this.isReadonly()?(this.trace("save() - ignoring request for readonly resource"),!1):(this.hasState(ph.CONFLICT)||this.hasState(ph.ERROR))&&(e.reason===Sn.AUTO||e.reason===Sn.FOCUS_CHANGE||e.reason===Sn.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(ph.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Sn.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 li;return this.progressService.withProgress({title:g(5736,"Saving '{0}'",this.name),location:fd.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===Sn.AUTO&&typeof this.lastModelContentChangeFromUndoRedo=="number"){const a=Date.now()-this.lastModelContentChangeFromUndoRedo;a{try{const a=await this.textFileService.write(r.resource,o.createSnapshot(),{mtime:r.mtime,encoding:this.getEncoding(),etag:t.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(r.resource,o.getLanguageId())?x_:r.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===ji.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 ph.CONFLICT:return this.inConflictMode;case ph.DIRTY:return this.dirty;case ph.ERROR:return this.inErrorMode;case ph.ORPHAN:return this.inOrphanMode;case ph.PENDING_SAVE:return this.saveSequentializer.isRunning();case ph.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===vS||this.contentEncoding===rN||this.contentEncoding===oN){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,a9.Decode)}setEncoding(e,t){return this.hasEncodingSetExplicitly=!0,this.setEncodingInternal(e,t)}async setEncodingInternal(e,t){if(t===a9.Encode)this.updatePreferredEncoding(e),this.isDirty()||(this.versionId++,this.setDirty(!0)),this.inConflictMode||await this.save({source:BV.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()}},BV=Ak,Ak.TEXTFILE_SAVE_ENCODING_SOURCE=QJ.registerSource("textFileEncoding.source",g(5735,"File Encoding Changed")),Ak.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,Ak);See=BV=D([_(3,Di),_(4,fi),_(5,Xt),_(6,Fr),_(7,X6),_(8,Ke),_(9,Pm),_(10,bd),_(11,Os),_(12,j6),_(13,_o),_(14,Cf),_(15,ps),_(16,hg)],See);let AAe=class extends V{constructor(e){super(),this.logService=e,this.saveParticipants=[]}addSaveParticipant(e){const t=hTe(this.saveParticipants,e);return Ee(()=>t())}async participate(e,t,i,n){e.textEditorModel?.pushStackElement();for(const r of this.saveParticipants){if(n.isCancellationRequested||!e.textEditorModel)break;try{const o=r.participate(e,t,i,n);await $_(o,n)}catch(o){this.logService.error(o)}}e.textEditorModel?.pushStackElement()}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};AAe=D([_(0,Ke)],AAe);let EAe=class extends V{get models(){return[...this.mapResourceToModel.values()]}constructor(e,t,i,n,r){super(),this.instantiationService=e,this.fileService=t,this.notificationService=i,this.workingCopyFileService=n,this.uriIdentityService=r,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 gi,this.mapResourceToModelListeners=new gi,this.mapResourceToDisposeListener=new gi,this.mapResourceToPendingModelResolvers=new gi,this.modelResolveQueue=this._register(new LTe),this.saveErrorHandler=(()=>{const o=this.notificationService;return{onSaveError(a,c){o.error(g(9794,"Failed to save '{0}': {1}",c.name,Po(a,!1)))}}})(),this.mapCorrelationIdToModelsToRestore=new Map,this.saveParticipants=this._register(this.instantiationService.createInstance(AAe)),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,Tr.UPDATED,Tr.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===Ei.MOVE||e.operation===Ei.COPY){const t=[];for(const{source:i,target:n}of e.files)if(i){if(this.uriIdentityService.extUri.isEqual(i,n))continue;const r=[];for(const o of this.models)this.uriIdentityService.extUri.isEqualOrParent(o.resource,i)&&r.push(o);for(const o of r){const a=o.resource;let c;this.uriIdentityService.extUri.isEqual(a,i)?c=n:c=Ft(n,a.path.substr(i.path.length+1)),t.push({source:a,target:c,languageId:o.getLanguageId(),encoding:o.getEncoding(),snapshot:o.isDirty()?o.createSnapshot():void 0})}}this.mapCorrelationIdToModelsToRestore.set(e.correlationId,t)}}onDidFailWorkingCopyFileOperation(e){if(e.operation===Ei.MOVE||e.operation===Ei.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 Ei.CREATE:e.waitUntil((async()=>{for(const{target:t}of e.files){const i=this.get(t);i&&!i.isDisposed()&&await i.revert()}})());break;case Ei.MOVE:case Ei.COPY:e.waitUntil((async()=>{const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),await er.settled(t.map(async i=>{const n=this.uriIdentityService.asCanonicalUri(i.target),r=await this.resolve(n,{reload:{async:!1},contents:i.snapshot?A6(i.snapshot):void 0,encoding:i.encoding});i.languageId&&i.languageId!==Sa&&r.getLanguageId()===Sa&&xU(n)!==qqe&&r.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 r,o=!1;if(i)t?.contents?r=i.resolve(t):t?.reload?t.reload.async?(r=Promise.resolve(),(async()=>{try{await i.resolve(t)}catch(a){bt(a)}})()):r=i.resolve(t):r=Promise.resolve();else{o=!0;const a=i=this.instantiationService.createInstance(See,n,t?t.encoding:void 0,t?t.languageId:void 0);r=i.resolve(t),this.registerModel(a)}this.mapResourceToPendingModelResolvers.set(n,r),this.add(n,i),o&&(this._onDidCreate.fire(i),i.isDirty()&&this._onDidChangeDirty.fire(i));try{await r}catch(a){throw o&&i.dispose(),a}finally{this.mapResourceToPendingModelResolvers.delete(n)}return t?.languageId&&i.setLanguageId(t.languageId),o&&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&&(wt(i),this.mapResourceToDisposeListener.delete(e));const n=this.mapResourceToModelListeners.get(e);n&&(wt(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(),wt(this.mapResourceToDisposeListener.values()),this.mapResourceToDisposeListener.clear(),wt(this.mapResourceToModelListeners.values()),this.mapResourceToModelListeners.clear()}};EAe=D([_(0,we),_(1,Xt),_(2,wi),_(3,qb),_(4,Is)],EAe);var rj,Ek;let xAe=(Ek=class extends V{constructor(e,t,i,n,r,o,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=r,this.environmentService=o,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(EAe)),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(ph.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(),r=i.hasState(ph.ORPHAN);if(n&&r)return{color:CBe,letter:ve.lockSmall,strikethrough:!0,tooltip:g(4402,"Deleted, Read-only")};if(n)return{letter:ve.lockSmall,tooltip:g(4403,"Read-only")};if(r)return{color:CBe,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(DAe))),this._encoding}async read(e,t){const[i,n]=await this.doRead(e,{...t,preferUnbuffered:!0});return{...i,encoding:n.detected.encoding||Ud,value:await VTe(n.stream,r=>r.join(""))}}async readStream(e,t){const[i,n]=await this.doRead(e,t);return{...i,encoding:n.detected.encoding||Ud,value:await OLe(n.stream)}}async doRead(e,t){const i=new li;let n;if(t?.preferUnbuffered){const r=await this.fileService.readFile(e,t,i.token);n={...r,value:g6(r.value)}}else n=await this.fileService.readFileStream(e,t,i.token);try{const r=await this.doGetDecodedStream(e,n.value,t);return[n,r]}catch(r){throw i.dispose(!0),r.decodeStreamErrorKind===yee.STREAM_IS_BINARY?new ZOt(g(4405,"File seems to be binary and cannot be opened as text"),RW.FILE_IS_BINARY,t):r}}async create(e,t){const i=await Promise.all(e.map(async n=>{const r=await this.getEncodedReadable(n.resource,n.value);return{resource:n.resource,contents:r,overwrite:n.options?.overwrite}}));return this.workingCopyFileService.create(i,Ue.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:r}=await this.encoding.getWriteEncoding(e,i);if(n===Ud&&!r)return typeof t>"u"?void 0:iBt(t);t=t||"";const o=typeof t=="string"?tBt(t):t;return O3t(o,n,{addBOM:r})}async getDecodedStream(e,t,i){return(await this.doGetDecodedStream(e,t,i)).stream}doGetDecodedStream(e,t,i){return F3t(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:r}=await this.encoding.getPreferredReadEncoding(e,i,n??void 0);return r}})}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 Yi(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}}],Ue.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 r=this.files.get(e);if(r?.isResolved())n=await this.doSaveAsTextFile(r,e,t,i);else if(this.fileService.hasProvider(e))await this.fileService.copy(e,t,!0),n=!0;else{const o=this.modelService.getModel(e);o&&(n=await this.doSaveAsTextFile(o,e,t,i))}if(n){try{await this.revert(e)}catch(o){this.logService.error(o)}return t}}async doSaveAsTextFile(e,t,i,n){let r;const o=e;typeof o.getEncoding=="function"&&(r=o.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:r})}catch(u){if(a&&(u.textFileOperationResult===RW.FILE_IS_BINARY||u.fileOperationResult===ji.FILE_TOO_LARGE))return await this.fileService.del(i),this.doSaveAsTextFile(e,t,i,n);throw u}}let l;if(e instanceof Cee&&e.hasAssociatedFilePath&&a&&this.uriIdentityService.extUri.isEqual(i,N8(e.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme))?l=await this.confirmOverwrite(i):l=!0,!l)return!1;let d;e instanceof hI?e.isResolved()&&(d=e.textEditorModel??void 0):d=e;let h;if(c.isResolved()&&(h=c.textEditorModel),d&&h){c.updatePreferredEncoding(r),this.modelService.updateModel(h,A6(d.createSnapshot()));const u=d.getLanguageId(),f=h.getLanguageId();u!==Sa&&f===Sa&&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?rj.TEXTFILE_SAVE_REPLACE_SOURCE:rj.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?",vi(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.",vi(e),vi(Ro(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?",vi(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 r=this.untitled.get(e);if(r){if(r.hasAssociatedFilePath)return N8(e,t,this.pathService.defaultUriScheme);let o;await this.pathService.hasValidBasename(Ft(i,r.name),r.name)?o=r.name:o=vi(e);const a=r.getLanguageId();a&&a!==Sa?n=this.suggestFilename(a,o):n=o}}return n||(n=vi(e)),Ft(i,n)}suggestFilename(e,t){if(!this.languageService.getLanguageName(e))return t;const n=jy(t),r=this.languageService.getExtensions(e);if(r.includes(n))return t;const o=um(r);if(o)return n?`${t.substring(0,t.indexOf(n))}${o}`:`${t}${o}`;const a=this.languageService.getFilenames(e);return a.includes(t)?t:um(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}},rj=Ek,Ek.TEXTFILE_SAVE_CREATE_SOURCE=QJ.registerSource("textFileCreate.source",g(4399,"File Created")),Ek.TEXTFILE_SAVE_REPLACE_SOURCE=QJ.registerSource("textFileOverwrite.source",g(4400,"File Replaced")),Ek);xAe=rj=D([_(0,Xt),_(1,J6),_(2,rg),_(3,we),_(4,fi),_(5,Xo),_(6,ir),_(7,dg),_(8,xc),_(9,bd),_(10,qt),_(11,Cf),_(12,qb),_(13,Is),_(14,Di),_(15,Ke),_(16,Q6),_(17,aE)],xAe);let DAe=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:Ud}),e.push({extension:Tb,encoding:Ud}),e.push({parent:this.environmentService.untitledWorkspacesHome,encoding:Ud}),this.contextService.getWorkspace().folders.forEach(t=>{e.push({parent:Ft(t.uri,".vscode"),encoding:Ud})}),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===rN||i===oN||i===vS}}async getPreferredReadEncoding(e,t,i){let n;t?.encoding?i===vS&&t.encoding===Ud?n=vS:n=t.encoding:typeof i=="string"?n=i:this.textResourceConfigurationService.getValue(e,"files.encoding")===vS&&(n=Ud);const r=await this.getEncodingForResource(e,n);return{encoding:r,hasBOM:r===rN||r===oN||r===vS}}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!==Ud&&(!i||!await B3t(i))&&(i=Ud),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&&xU(e)===`.${t.extension}`)return t.encoding}}};DAe=D([_(0,xc),_(1,Xo),_(2,Ci),_(3,Is)],DAe);let kAe=class extends xAe{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b,w){super(e,t,i,n,r,o,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(ph.PENDING_SAVE))}};kAe=D([_(0,Xt),_(1,J6),_(2,rg),_(3,we),_(4,fi),_(5,Xo),_(6,ir),_(7,dg),_(8,xc),_(9,bd),_(10,qt),_(11,Cf),_(12,qb),_(13,Is),_(14,Di),_(15,Q6),_(16,Ke),_(17,aE)],kAe);var ow,VR;let IAe=(VR=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 o of this.contextService.getWorkspace().folders){const a=o.uri.toString(),c=this.doGetExpression(o.uri),l=this.mapFolderToConfiguredExpression.get(a);c?(!l||!Js(l.expression,c.expression))&&(t=!0,this.mapFolderToParsedExpression.set(a,X_(c.expression)),this.mapFolderToConfiguredExpression.set(a,c)):l&&(t=!0,this.mapFolderToParsedExpression.delete(a),this.mapFolderToConfiguredExpression.delete(a))}const i=new Mk(this.contextService.getWorkspace().folders.map(o=>o.uri));for(const[o]of this.mapFolderToConfiguredExpression)o!==ow.NO_FOLDER&&(i.has(N.parse(o))||(this.mapFolderToParsedExpression.delete(o),this.mapFolderToConfiguredExpression.delete(o),t=!0));const n=this.doGetExpression(void 0),r=this.mapFolderToConfiguredExpression.get(ow.NO_FOLDER);n?(!r||!Js(r.expression,n.expression))&&(t=!0,this.mapFolderToParsedExpression.set(ow.NO_FOLDER,X_(n.expression)),this.mapFolderToConfiguredExpression.set(ow.NO_FOLDER,n)):r&&(t=!0,this.mapFolderToParsedExpression.delete(ow.NO_FOLDER),this.mapFolderToConfiguredExpression.delete(ow.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 r=Object.create(null);for(const o of i){n||(n=yM(o));let a=o;const c=Kdt(a,!0);if(c){const l=c.toLowerCase();c!==c.toLowerCase()&&(a=`${l}${a.substring(1)}`)}r[a]=t[o]}return{expression:r,hasAbsolutePath:n}}matches(e,t){if(this.mapFolderToParsedExpression.size===0)return!1;const i=this.contextService.getWorkspaceFolder(e);let n,r;if(i&&this.mapFolderToParsedExpression.has(i.uri.toString())?(n=this.mapFolderToParsedExpression.get(i.uri.toString()),r=this.mapFolderToConfiguredExpression.get(i.uri.toString())):(n=this.mapFolderToParsedExpression.get(ow.NO_FOLDER),r=this.mapFolderToConfiguredExpression.get(ow.NO_FOLDER)),!n)return!1;let o;return i?o=MN(i.uri,e):o=this.uriToPath(e),typeof o=="string"&&n(o,void 0,t)?!0:o!==this.uriToPath(e)&&r?.hasAbsolutePath?!!n(this.uriToPath(e),void 0,t):!1}uriToPath(e){return e.scheme===pe.file?e.fsPath:e.path}},ow=VR,VR.NO_FOLDER=null,VR);IAe=ow=D([_(2,Ci),_(3,Te)],IAe);var Dv;const q3t=new Q("autoSaveAfterShortDelayContext",!1,!0);var ac;(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"})(ac||(ac={}));var Ug;(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"})(Ug||(Ug={}));var ZS;let TAe=(ZS=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this.contextKeyService=e,this.configurationService=t,this.contextService=i,this.environmentService=n,this.uriIdentityService=r,this.fileService=o,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 pm(1e3),this.autoSaveDisabledOverrides=new gi,this.autoSaveAfterShortDelayContext=q3t.bindTo(this.contextKeyService),this.readonlyIncludeMatcher=this._register(new Lpe(()=>this.createReadonlyMatcher(DYe))),this.readonlyExcludeMatcher=this._register(new Lpe(()=>this.createReadonlyMatcher(kYe))),this.sessionReadonlyOverrides=new gi(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||Du.ON_EXIT,this.onFilesConfigurationChange(l,!1),this.registerListeners()}createReadonlyMatcher(e){const t=this._register(new IAe(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&&mEt(i))return i.readOnlyMessage??Dv.READONLY_MESSAGES.providerReadonly;const n=this.sessionReadonlyOverrides.get(e);return typeof n=="boolean"?n===!0?Dv.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:Dv.READONLY_MESSAGES.configuredReadonly:this.configuredReadonlyFromPermissions&&t?.locked?Dv.READONLY_MESSAGES.fileLocked:t?.readonly?Dv.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===ac.AFTER_SHORT_DELAY),t&&this._onDidChangeAutoSaveConfiguration.fire();const i=e?.files?.associations;Js(this.currentFilesAssociationConfiguration,i)||(this.currentFilesAssociationConfiguration=i,t&&this._onDidChangeFilesAssociation.fire());const n=e?.files?.hotExit;n===Du.OFF||n===Du.ON_EXIT_AND_WINDOW_CLOSE?this.currentHotExitConfiguration=n:this.currentHotExitConfiguration=Du.ON_EXIT;const r=!!e?.files?.readonlyFromPermissions;r!==!!this.configuredReadonlyFromPermissions&&(this.configuredReadonlyFromPermissions=r,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,r,o,a,c;switch(t?.autoSave??Dv.DEFAULT_AUTO_SAVE_MODE){case il.AFTER_DELAY:{i="afterDelay",n=typeof t?.autoSaveDelay=="number"&&t.autoSaveDelay>=0?t.autoSaveDelay:Dv.DEFAULT_AUTO_SAVE_DELAY,c=n<=Dv.DEFAULT_AUTO_SAVE_DELAY;break}case il.ON_FOCUS_CHANGE:i="onFocusChange";break;case il.ON_WINDOW_CHANGE:i="onWindowChange";break}return t?.autoSaveWorkspaceFilesOnly===!0&&(r=!0,e&&!this.contextService.isInsideWorkspace(e)&&(a=!0,c=void 0)),t?.autoSaveWhenNoErrors===!0&&(o=!0,c=void 0),{autoSave:i,autoSaveDelay:n,autoSaveWorkspaceFilesOnly:r,autoSaveWhenNoErrors:o,isOutOfWorkspace:a,isShortAutoSaveDelay:c}}toResource(e){return e instanceof Ub?Pa.getOriginalUri(e,{supportSideBySide:Us.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:ac.OFF,reason:Ug.DISABLED};const n=this.getAutoSaveConfiguration(i);if(typeof n.autoSave>"u")return{mode:ac.OFF,reason:Ug.SETTINGS};if(typeof t=="number"&&(n.autoSave==="afterDelay"&&t!==Sn.AUTO||n.autoSave==="onFocusChange"&&t!==Sn.FOCUS_CHANGE&&t!==Sn.WINDOW_CHANGE||n.autoSave==="onWindowChange"&&t!==Sn.WINDOW_CHANGE))return{mode:ac.OFF,reason:Ug.SETTINGS};if(i){if(n.autoSaveWorkspaceFilesOnly&&n.isOutOfWorkspace)return{mode:ac.OFF,reason:Ug.OUT_OF_WORKSPACE};if(n.autoSaveWhenNoErrors&&this.markerService.read({resource:i,take:1,severities:Hs.Error}).length>0)return{mode:ac.OFF,reason:Ug.ERRORS}}switch(n.autoSave){case"afterDelay":return typeof n.autoSaveDelay=="number"&&n.autoSaveDelay<=Dv.DEFAULT_AUTO_SAVE_DELAY?{mode:n.autoSaveWhenNoErrors?ac.AFTER_LONG_DELAY:ac.AFTER_SHORT_DELAY}:{mode:ac.AFTER_LONG_DELAY};case"onFocusChange":return{mode:ac.ON_FOCUS_CHANGE};case"onWindowChange":return{mode:ac.ON_WINDOW_CHANGE}}}async toggleAutoSave(){const e=this.configurationService.getValue("files.autoSave");let t;return[il.AFTER_DELAY,il.ON_FOCUS_CHANGE,il.ON_WINDOW_CHANGE].some(i=>i===e)?t=il.OFF:t=il.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!==Du.OFF}get hotExitConfiguration(){return this.currentHotExitConfiguration}preventSaveConflicts(e,t){return this.configurationService.getValue("files.saveConflictResolution",{resource:e,overrideIdentifier:t})!=="overwriteFileOnDisk"}},Dv=ZS,ZS.DEFAULT_AUTO_SAVE_MODE=Hn?il.AFTER_DELAY:il.OFF,ZS.DEFAULT_AUTO_SAVE_DELAY=1e3,ZS.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}},ZS);TAe=Dv=D([_(0,Le),_(1,Te),_(2,Ci),_(3,ec),_(4,Is),_(5,Xt),_(6,Dm),_(7,xc)],TAe);class Q3t{isSupported(e){return!1}async writeFileElevated(e,t,i){throw new Error("Unsupported")}}const cPe=je.as(Pn.Configuration),j3t=ld?{type:"string",scope:ct.APPLICATION,enum:[Du.OFF,Du.ON_EXIT,Du.ON_EXIT_AND_WINDOW_CLOSE],default:Du.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.",Du.ON_EXIT,Du.ON_EXIT_AND_WINDOW_CLOSE)}:{type:"string",scope:ct.APPLICATION,enum:[Du.OFF,Du.ON_EXIT_AND_WINDOW_CLOSE],default:Du.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.",Du.ON_EXIT,Du.ON_EXIT_AND_WINDOW_CLOSE)};cPe.registerConfiguration({id:"files",order:9,title:g(625,"Files"),type:"object",properties:{[_Et]:{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,...Hn?{"**/*.crswap":!0}:void 0},scope:ct.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.")}}}]}},[aRe]:{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(dx),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:ct.LANGUAGE_OVERRIDABLE,enumDescriptions:Object.keys(dx).map(s=>dx[s].labelLong),enumItemLabels:Object.keys(dx).map(s=>dx[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:ct.LANGUAGE_OVERRIDABLE},"files.candidateGuessEncodings":{type:"array",items:{type:"string",enum:Object.keys(sj),enumDescriptions:Object.keys(sj).map(s=>sj[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:ct.LANGUAGE_OVERRIDABLE},"files.eol":{type:"string",enum:[` +- `),GK.registerConfiguration({...jZe,properties:{"window.title":{type:"string",default:Nnt,markdownDescription:e},"window.titleSeparator":{type:"string",default:Pnt,markdownDescription:g(1081,"Separator used by {0}.","`#window.title#`")},[em.COMMAND_CENTER]:{type:"boolean",default:!0,markdownDescription:Hn?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."),jt?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."),Hn?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:Hn?"compact":"classic",scope:ct.APPLICATION,markdownDescription:jt?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:jn||mo||Hn},"window.enableMenuBarMnemonics":{type:"boolean",default:!0,scope:ct.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:jn||mo},"window.customMenuBarAltFocus":{type:"boolean",default:!0,scope:ct.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:jn||mo},"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."),jt?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:ct.APPLICATION,markdownDescription:g(jt?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:ct.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:[Hn?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."),Hn?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."),Hn?g(1109,"Never explicitly ask for confirmation unless data loss is imminent."):g(1110,"Never explicitly ask for confirmation.")],default:Hn&&!VKe()?"keyboardOnly":"never",markdownDescription:Hn?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:ct.APPLICATION}}}),Ju(dX.ID,dX,Cc.Eventually),GK.registerConfiguration({...sNt,properties:{"problems.visibility":{type:"boolean",default:!0,description:g(1113,"Controls whether the problems are visible throughout the editor and workbench.")}}}),GK.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.")}}})})();je.as(Fm.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([em.ACTIVITY_BAR_LOCATION,{value:vee.HIDDEN}]),e}}]);je.as(Fm.ConfigurationMigration).registerConfigurationMigrations([{key:em.ACTIVITY_BAR_LOCATION,migrateFn:s=>{const e=[];return s==="side"&&e.push([em.ACTIVITY_BAR_LOCATION,{value:vee.DEFAULT}]),e}}]);je.as(Fm.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:em.EDITOR_TABS_MODE,migrateFn:s=>{const e=[];return typeof s=="boolean"&&(s=s?UT.MULTIPLE:UT.SINGLE,e.push([em.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 Fnt=()=>!1,Ont=(s,e)=>!1;const b3t=sN.prototype.getCommandPicks;sN.prototype.getCommandPicks=async function(s){let e=await b3t.call(this,s);return Fnt()||(e=e.map(t=>({...t,buttons:void 0}))),e};let bAe=class{constructor(e){this.instantiationService=e,this.workbenchQuickInputService=e.createInstance(fCe)}get activeService(){const e=kt.get(qt).getFocusedCodeEditor();return e==null||Ont(e,e instanceof iI)?this.workbenchQuickInputService:(this.standaloneQuickInputService??(this.standaloneQuickInputService=this.instantiationService.createInstance(F3)),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=Ue.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()}};bAe=D([_(0,we)],bAe);function w3t({isKeybindingConfigurationVisible:s,shouldUseGlobalPicker:e}={}){return s!=null&&(Fnt=s),e!=null&&(Ont=e),{[Tn.toString()]:new yi(bAe,[],!0)}}async function y3t(s,e,t,i,n,r){let o;try{await C3t(s,e,t,i,n,r)}catch(a){o=a}finally{o&&n.errorTransformer&&(o=n.errorTransformer(o)),typeof o<"u"&&t.error(o),t.end()}}async function C3t(s,e,t,i,n,r){Uue(r);const o=await s.open(e,{create:!1});try{Uue(r);let a=0,c=0,l=n&&typeof n.length=="number"?n.length:void 0,d=Ge.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(o,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=Ge.alloc(Math.min(n.bufferSize,typeof l=="number"?l:n.bufferSize)),u=0);while(c>0&&(typeof l!="number"||l>0)&&Uue(r)&&S3t(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 d0(a)}finally{await s.close(o)}}function Uue(s){if(s.isCancellationRequested)throw Ty();return!0}function S3t(s,e){if(typeof e?.limits?.size=="number"&&s>e.limits.size)throw gs(g(4398,"File is too large to open"),ot.FileTooLarge);return!0}var wAe;function Bnt(s){return s.scheme===pe.file?s.fsPath:s.toString(!0)}async function Wnt(s,e,t){const i=[];for(;!s.isEqual(t,s.dirname(t));)try{if(!((await e.stat(t)).type&rn.Directory))throw new Error(g(581,"Unable to create folder '{0}' that already exists but is not a directory",Bnt(t)));break}catch(n){if(Qk(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(r){if(Qk(r)!==ot.FileExists)throw r}}}var UR;let yAe=(UR=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 LTe)}registerProvider(e,t){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);ls(`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 r=new iJ(n,!this.isPathCaseSensitive(t));this.internalOnDidFilesChange.fire(r),r.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(r)})),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),wt(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 er.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 ui.map(this.provider,([e,t])=>({scheme:e,capabilities:t.capabilities}))}async withProvider(e){if(!jKe(e))throw new Rd(g(582,"Unable to resolve filesystem provider with relative file path '{0}'",this.resourceForError(e)),ji.FILE_INVALID_PATH);await this.activateProvider(e.scheme);const t=this.provider.get(e.scheme);if(!t){const i=new Ma;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(mE(t)||Km(t)||qq(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(mE(t)||Km(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 Qk(i)===ot.FileNotFound?new Rd(g(584,"Unable to resolve nonexistent file '{0}'",this.resourceForError(e)),ji.FILE_NOT_FOUND):d0(i)}}async doResolveFile(e,t){const i=await this.withProvider(e),n=this.isPathCaseSensitive(i),r=t?.resolveTo,o=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=Ih.forUris(()=>!n),l.set(e,!0),r&&l.fill(!0,r)),l.get(d.resource)||l.findSuperstr(d.resource.with({query:null,fragment:null}))?!0:d.isDirectory&&o?h===1:!1))}async toFileStat(e,t,i,n,r,o){const{providerExtUri:a}=this.getExtUri(e),c={resource:t,name:a.basename(t),isFile:(i.type&rn.File)!==0,isDirectory:(i.type&rn.Directory)!==0,isSymbolicLink:(i.type&rn.SymbolicLink)!==0,mtime:i.mtime,ctime:i.ctime,size:i.size,readonly:!!((i.permissions??0)&up.Readonly)||!!(e.capabilities&zn.Readonly),locked:!!((i.permissions??0)&up.Locked),etag:nJ({mtime:i.mtime,size:i.size}),children:void 0};if(c.isDirectory&&o(c,n)){try{const l=await e.readdir(t),d=await er.settled(l.map(async([h,u])=>{try{const f=a.joinPath(t,h),p=r?await e.stat(f):{type:u};return await this.toFileStat(e,f,p,l.length,r,o)}catch(f){return this.logService.trace(f),null}}));c.children=Oi(d)}catch(l){this.logService.trace(l),c.children=[]}return c}return c}async resolveAll(e){return er.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 Rd(g(585,"Unable to create file '{0}' that already exists when overwrite flag is not set",this.resourceForError(e)),ji.FILE_MODIFIED_SINCE,t)}async createFile(e,t=Ge.fromString(""),i){await this.doValidateCreateFile(e,i);const n=await this.writeFile(e,t);return this._onDidRunOperation.fire(new vP(e,Ei.CREATE,n)),n}async writeFile(e,t,i){const n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:r}=this.getExtUri(n);let o=i;if(eWe(n)&&!o?.atomic){const a=n.enforceAtomicWriteFile?.(e);a&&(o={...i,atomic:a})}try{await this.validateWriteFile(n,e,o)||await this.mkdirp(n,r.dirname(e));let c;if(Km(n)&&!(t instanceof Ge))if(Rq(t)){const l=await Yut(t,3);l.ended?c=Ge.concat(l.buffer):c=l}else c=jut(t,l=>Ge.concat(l),3);else c=t;!mE(n)||Km(n)&&c instanceof Ge||Km(n)&&eWe(n)&&o?.atomic?await this.doWriteUnbuffered(n,e,o,c):await this.doWriteBuffered(n,e,o,c instanceof Ge?Tqe(c):c),this._onDidRunOperation.fire(new vP(e,Ei.WRITE))}catch(a){throw new Rd(g(586,"Unable to write file '{0}' ({1})",this.resourceForError(e),d0(a).toString()),Qw(a),o)}return this.resolve(e,{resolveMetadata:!0})}async validateWriteFile(e,t,i){const n=!!i?.unlock;if(n&&!(e.capabilities&zn.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&zn.FileAtomicWrite))throw new Error(g(588,"Unable to atomically write file '{0}' because provider does not support it.",this.resourceForError(t)));if(!(e.capabilities&zn.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 o;try{o=await e.stat(t)}catch{return}if(o.type&rn.Directory)throw new Rd(g(591,"Unable to write file '{0}' that is actually a directory",this.resourceForError(t)),ji.FILE_IS_DIRECTORY,i);if(this.throwIfFileIsReadonly(t,o),typeof i?.mtime=="number"&&typeof i.etag=="string"&&i.etag!==x_&&typeof o.mtime=="number"&&typeof o.size=="number"&&i.mtime{this.writeQueue.queueFor(t,async()=>{try{const a=await this.doReadFile(e,t,i,n);r(a)}catch(a){o(a)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,t,i,n){const r=await this.doReadFileStream(e,t,{...i,preferUnbuffered:!0},n);return{...r,value:await oD(r.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 r=new li(n);let o=i;Uhe(e)&&e.enforceAtomicReadFile?.(t)&&(o={...i,atomic:!0});const a=this.validateReadFile(t,o).then(l=>l,l=>{throw r.dispose(!0),l});let c;try{return typeof o?.etag=="string"&&o.etag!==x_&&await a,o?.atomic&&Uhe(e)||!(mE(e)||qq(e))||Km(e)&&o?.preferUnbuffered?c=this.readFileUnbuffered(e,t,o):qq(e)?c=this.readFileStreamed(e,t,r.token,o):c=this.readFileBuffered(e,t,r.token,o),c.on("end",()=>r.dispose()),c.on("error",()=>r.dispose()),{...await a,value:c}}catch(l){throw c&&await VTe(c),this.restoreReadError(l,t,o)}}restoreReadError(e,t,i){const n=g(593,"Unable to read file '{0}' ({1})",this.resourceForError(t),d0(e).toString());return e instanceof T5?new T5(n,e.stat,i):e instanceof Qq?new Qq(n,e.fileOperationResult,e.size,e.options):new Rd(n,Qw(e),i)}readFileStreamed(e,t,i,n=Object.create(null)){const r=e.readFileStream(t,n,i);return Zut(r,{data:o=>o instanceof Ge?o:Ge.wrap(o),error:o=>this.restoreReadError(o,t,n)},o=>Ge.concat(o))}readFileBuffered(e,t,i,n=Object.create(null)){const r=Lqe();return y3t(e,t,r,o=>o,{...n,bufferSize:this.BUFFER_SIZE,errorTransformer:o=>this.restoreReadError(o,t,n)},i),r}readFileUnbuffered(e,t,i){const n=eE(r=>Ge.concat(r));return(async()=>{try{let r;i?.atomic&&Uhe(e)?r=await e.readFile(t,{atomic:!0}):r=await e.readFile(t),typeof i?.position=="number"&&(r=r.slice(i.position)),typeof i?.length=="number"&&(r=r.slice(0,i.length)),this.validateReadFileLimits(t,r.byteLength,i),n.end(Ge.wrap(r))}catch(r){n.error(r),n.end()}})(),n}async validateReadFile(e,t){const i=await this.resolve(e,{resolveMetadata:!0});if(i.isDirectory)throw new Rd(g(594,"Unable to read file '{0}' that is actually a directory",this.resourceForError(e)),ji.FILE_IS_DIRECTORY,t);if(typeof t?.etag=="string"&&t.etag!==x_&&t.etag===i.etag)throw new T5(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 Qq(g(596,"Unable to read file '{0}' that is too large to open",this.resourceForError(e)),ji.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 r=i==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e):await this.withReadProvider(e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);await this.doValidateMoveCopy(r,e,o,t,i,n)}catch(r){return r}return!0}async move(e,t,i){const n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),o=await this.doMoveCopy(n,e,r,t,"move",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new vP(e,o==="move"?Ei.MOVE:Ei.COPY,a)),a}async copy(e,t,i){const n=await this.withReadProvider(e),r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),o=await this.doMoveCopy(n,e,r,t,"copy",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new vP(e,o==="copy"?Ei.COPY:Ei.MOVE,a)),a}async doMoveCopy(e,t,i,n,r,o){if(t.toString()===n.toString())return r;const{exists:a,isSameResourceWithDifferentPathCase:c}=await this.doValidateMoveCopy(e,t,i,n,r,o);if(a&&!c&&o&&await this.del(n,{recursive:!0}),await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(n)),r==="copy"){if(e===i&&Z2e(e))await e.copy(t,n,{overwrite:o});else{const l=await this.resolve(t);l.isDirectory?await this.doCopyFolder(e,l,i,n):await this.doCopyFile(e,t,i,n)}return r}else return e===i?(await e.rename(t,n,{overwrite:o}),r):(await this.doMoveCopy(e,t,i,n,"copy",o),await this.del(t,{recursive:!0}),"copy")}async doCopyFile(e,t,i,n){if(mE(e)&&mE(i))return this.doPipeBuffered(e,t,i,n);if(mE(e)&&Km(i))return this.doPipeBufferedToUnbuffered(e,t,i,n);if(Km(e)&&mE(i))return this.doPipeUnbufferedToBuffered(e,t,i,n);if(Km(e)&&Km(i))return this.doPipeUnbuffered(e,t,i,n)}async doCopyFolder(e,t,i,n){await i.mkdir(n),Array.isArray(t.children)&&await er.settled(t.children.map(async r=>{const o=this.getExtUri(i).providerExtUri.joinPath(n,r.name);return r.isDirectory?this.doCopyFolder(e,await this.resolve(r.resource),i,o):this.doCopyFile(e,r.resource,i,o)}))}async doValidateMoveCopy(e,t,i,n,r,o){let a=!1;if(e===i){const{providerExtUri:l,isPathCaseSensitive:d}=this.getExtUri(e);if(d||(a=l.isEqual(t,n)),a&&r==="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(!o)throw new Rd(g(599,"Unable to move/copy '{0}' because target '{1}' already exists at destination.",this.resourceForError(t),this.resourceForError(n)),ji.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?Dn:Xoe,isPathCaseSensitive:t}}isPathCaseSensitive(e){return!!(e.capabilities&zn.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 vP(e,Ei.CREATE,i)),i}async mkdirp(e,t){const{providerExtUri:i}=this.getExtUri(e);return Wnt(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&zn.Trash))throw new Error(g(601,"Unable to delete file '{0}' via trash because provider does not support it.",this.resourceForError(e)));const r=t?.atomic;if(r&&!(i.capabilities&zn.FileAtomicDelete))throw new Error(g(602,"Unable to delete file '{0}' atomically because provider does not support it.",this.resourceForError(e)));if(n&&r)throw new Error(g(603,"Unable to atomically delete file '{0}' because using trash is enabled.",this.resourceForError(e)));let o;try{o=await i.stat(e)}catch{}if(o)this.throwIfFileIsReadonly(e,o);else throw new Rd(g(604,"Unable to delete nonexistent file '{0}'",this.resourceForError(e)),ji.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(pEt(i)&&!n?.atomic){const c=i.enforceAtomicDelete?.(e);c&&(n={...t,atomic:c})}const r=!!n?.useTrash,o=!!n?.recursive,a=n?.atomic??!1;await i.delete(e,{recursive:o,useTrash:r,atomic:a}),this._onDidRunOperation.fire(new vP(e,Ei.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&&fEt(i)?i.cloneFile(e,t):(await this.mkdirp(n,this.getExtUri(n).providerExtUri.dirname(t)),i===n&&Z2e(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:wAe.WATCHER_CORRELATION_IDS++})}watch(e,t={recursive:!1,excludes:[]}){const i=new Z;let n=!1,r=()=>{n=!0};i.add(Ee(()=>r())),(async()=>{try{const a=await this.doWatch(e,t);n?wt(a):r=()=>wt(a)}catch(a){this.logService.error(a)}})();const o=t.correlationId;if(typeof o=="number"){const a=i.add(new I);return i.add(this.internalOnDidFilesChange.event(l=>{l.correlates(o)&&a.fire(l)})),{onDidChange:a.event,dispose:()=>i.dispose()}}return i}async doWatch(e,t){const i=await this.withProvider(e),n=Hc([this.getExtUri(i).providerExtUri.getComparisonKey(e),t]);let r=this.activeWatchers.get(n);return r||(r={count:0,disposable:i.watch(e,t)},this.activeWatchers.set(n,r)),r.count+=1,Ee(()=>{r&&(r.count--,r.count===0&&(wt(r.disposable),this.activeWatchers.delete(n)))})}dispose(){super.dispose();for(const[,e]of this.activeWatchers)wt(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,t,i,n){return this.writeQueue.queueFor(t,async()=>{const r=await e.open(t,{create:!0,unlock:i?.unlock??!1});try{Rq(n)||jde(n)?await this.doWriteStreamBufferedQueued(e,r,n):await this.doWriteReadableBufferedQueued(e,r,n)}catch(o){throw d0(o)}finally{await e.close(r)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,t,i){let n=0,r;if(jde(i)){if(i.buffer.length>0){const o=Ge.concat(i.buffer);await this.doWriteBuffer(e,t,o,o.byteLength,n,0),n+=o.byteLength}if(i.ended)return;r=i.stream}else r=i;return new Promise((o,a)=>{NN(r,{onData:async c=>{r.pause();try{await this.doWriteBuffer(e,t,c,c.byteLength,n,0)}catch(l){return a(l)}n+=c.byteLength,setTimeout(()=>r.resume())},onError:c=>a(c),onEnd:()=>o()})})}async doWriteReadableBufferedQueued(e,t,i){let n=0,r;for(;(r=i.read())!==null;)await this.doWriteBuffer(e,t,r,r.byteLength,n,0),n+=r.byteLength}async doWriteBuffer(e,t,i,n,r,o){let a=0;for(;athis.doWriteUnbufferedQueued(e,t,i,n),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,t,i,n){let r;n instanceof Ge?r=n:Rq(n)?r=await oD(n):jde(n)?r=await agt(n):r=ogt(n),await e.writeFile(t,r.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 r,o;try{r=await e.open(t,{create:!1}),o=await i.open(n,{create:!0,unlock:!1});const a=Ge.alloc(this.BUFFER_SIZE);let c=0,l=0,d=0;do d=await e.read(r,c,a.buffer,l,a.byteLength-l),await this.doWriteBuffer(i,o,a,d,c,l),c+=d,l+=d,l===a.byteLength&&(l=0);while(d>0)}catch(a){throw d0(a)}finally{await er.settled([typeof r=="number"?e.close(r):Promise.resolve(),typeof o=="number"?i.close(o):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 r=await i.open(n,{create:!0,unlock:!1});try{const o=await e.readFile(t);await this.doWriteBuffer(i,r,Ge.wrap(o),o.byteLength,0,0)}catch(o){throw d0(o)}finally{await i.close(r)}}async doPipeBufferedToUnbuffered(e,t,i,n){const r=await oD(this.readFileBuffered(e,t,Ue.None));await this.doWriteUnbuffered(i,n,void 0,r)}throwIfFileSystemIsReadonly(e,t){if(e.capabilities&zn.Readonly)throw new Rd(g(606,"Unable to modify read-only file '{0}'",this.resourceForError(t)),ji.FILE_PERMISSION_DENIED);return e}throwIfFileIsReadonly(e,t){if((t.permissions??0)&up.Readonly)throw new Rd(g(606,"Unable to modify read-only file '{0}'",this.resourceForError(e)),ji.FILE_PERMISSION_DENIED)}resourceForError(e){return Bnt(e)}},wAe=UR,UR.WATCHER_CORRELATION_IDS=0,UR);yAe=wAe=D([_(0,Ke)],yAe);class V5e{constructor(e){this.type=rn.File,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e}}class N4{constructor(e){this.type=rn.Directory,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e,this.entries=new Map}}class wee 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=zn.FileReadWrite|zn.PathCaseSensitive,this.root=new N4(""),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[]}get capabilities(){return this._capabilities}setReadOnly(e){const t=!!(this._capabilities&zn.Readonly);e!==t&&(this._capabilities=e?zn.Readonly|zn.PathCaseSensitive|zn.FileReadWrite:zn.FileReadWrite|zn.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,r)=>i.push([r,n.type])),i}async readFile(e){const t=this._lookupAsFile(e,!1).data;if(t)return t;throw gs("file not found",ot.FileNotFound)}readFileStream(e){const t=this._lookupAsFile(e,!1).data,i=eE(n=>Ge.concat(n.map(r=>Ge.wrap(r))).buffer);return i.end(t),i}async writeFile(e,t,i){const n=vi(e),r=this._lookupParentDirectory(e);let o=r.entries.get(n);if(o instanceof N4)throw gs("file is directory",ot.FileIsADirectory);if(!o&&!i.create)throw gs("file not found",ot.FileNotFound);if(o&&i.create&&!i.overwrite)throw gs("file exists already",ot.FileExists);o||(o=new V5e(n),r.entries.set(n,o),this._fireSoon({type:Tr.ADDED,resource:e})),o.mtime=Date.now(),o.size=t.byteLength,o.data=t,this._fireSoon({type:Tr.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 gs("file not found",ot.FileNotFound)}close(e){return this.fdMemory.delete(e),Promise.resolve()}read(e,t,i,n,r){const o=this.fdMemory.get(e);if(!o)throw gs("No file with that descriptor open",ot.Unavailable);const a=Ge.wrap(o).slice(t,t+r);return i.set(a.buffer,n),Promise.resolve(a.byteLength)}write(e,t,i,n,r){const o=this.fdMemory.get(e);if(!o)throw gs("No file with that descriptor open",ot.Unavailable);const a=Ge.wrap(i).slice(n,n+r);return o.set(a.buffer,t),Promise.resolve(a.byteLength)}async rename(e,t,i){if(!i.overwrite&&this._lookup(t,!0))throw gs("file exists already",ot.FileExists);const n=this._lookup(e,!1),r=this._lookupParentDirectory(e),o=this._lookupParentDirectory(t),a=vi(t);r.entries.delete(n.name),n.name=a,o.entries.set(a,n),this._fireSoon({type:Tr.DELETED,resource:e},{type:Tr.ADDED,resource:t})}async delete(e,t){const i=Ro(e),n=vi(e),r=this._lookupAsDirectory(i,!1);r.entries.has(n)&&(r.entries.delete(n),r.mtime=Date.now(),r.size-=1,this._fireSoon({type:Tr.UPDATED,resource:i},{resource:e,type:Tr.DELETED}))}async mkdir(e){if(this._lookup(e,!0))throw gs("file exists already",ot.FileExists);const t=vi(e),i=Ro(e),n=this._lookupAsDirectory(i,!1),r=new N4(t);n.entries.set(r.name,r),n.mtime=Date.now(),n.size+=1,this._fireSoon({type:Tr.UPDATED,resource:i},{type:Tr.ADDED,resource:e})}_lookup(e,t){const i=e.path.split("/");let n=this.root;for(const r of i){if(!r)continue;let o;if(n instanceof N4&&(o=n.entries.get(r)),!o){if(t)return;throw gs("file not found",ot.FileNotFound)}n=o}return n}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof N4)return i;throw gs("file not a directory",ot.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i instanceof V5e)return i;throw gs("file is a directory",ot.FileIsADirectory)}_lookupParentDirectory(e){const t=Ro(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 z5e extends Error{constructor(e){super("Missing stores"),this.db=e}}class CAe extends Error{constructor(e){super(`IndexedDB database '${e}' is closed.`),this.code="DBClosed"}}class r1{static async create(e,t,i){const n=await r1.openDatabase(e,t,i);return new r1(n,e)}static async openDatabase(e,t,i){ls(`code/willOpenDatabase/${e}`);try{return await r1.doOpenDatabase(e,t,i)}catch(n){if(n instanceof z5e){console.info("Attempting to recreate the IndexedDB once.",e);try{await r1.deleteDatabase(n.db)}catch(r){throw console.error("Error while deleting the IndexedDB",ou(r)),r}return await r1.doOpenDatabase(e,t,i)}throw n}finally{ls(`code/didOpenDatabase/${e}`)}}static doOpenDatabase(e,t,i){return new Promise((n,r)=>{const o=indexedDB.open(e,t);o.onerror=()=>r(o.error),o.onsuccess=()=>{const a=o.result;for(const c of i)if(!a.objectStoreNames.contains(c)){console.error(`Error while opening IndexedDB. Could not find '${c}'' object store`),r(new z5e(a));return}n(a)},o.onupgradeneeded=()=>{const a=o.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=r=>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 CAe(this.name);const n=this.database.transaction(e,t);return this.pendingTransactions.push(n),new Promise((r,o)=>{n.oncomplete=()=>{Array.isArray(a)?r(a.map(c=>c.result)):r(a.result)},n.onerror=()=>o(n.error?Ma.fromError(n.error):new Ma("unknown error")),n.onabort=()=>o(n.error?Ma.fromError(n.error):new Ma("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 CAe(this.name);const i=this.database.transaction(e,"readonly");return this.pendingTransactions.push(i),new Promise(n=>{const r=new Map,a=i.objectStore(e).openCursor();if(!a)return n(r);a.onsuccess=()=>{a.result?(t(a.result.value)&&r.set(a.result.key.toString(),a.result.value),a.result.continue()):n(r)};const c=l=>{console.error(`IndexedDB getKeyValues(): ${Po(l,!0)}`),n(r)};a.onerror=()=>c(a.error),i.onerror=()=>c(i.error)}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(i),1))}}const Vue=gs(g(609,"File does not exist"),ot.FileNotFound),A3t=gs(g(610,"File is Directory"),ot.FileIsADirectory),$5e=gs(g(611,"File is not a directory"),ot.FileNotADirectory),E3t=gs(g(612,"Directory is not empty"),ot.Unknown),x3t=gs(g(613,"File exceeds available storage quota"),ot.FileExceedsStorageQuota),xv=s=>gs(g(614,"Internal error occurred in IndexedDB File System Provider. ({0})",s),ot.Unknown);class oz{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!==rn.Directory)throw xv("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!==rn.Directory)throw xv("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 xv(`Internal error deleting from IndexedDBFSNode -- got no deletion path parts (encountered while deleting ${t})`);if(this.entry.type!==rn.Directory)throw xv("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 xv("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 xv(`Internal error creating IndexedDBFSNode -- adding empty path (encountered while adding ${i})`);if(this.entry.type!==rn.Directory)throw xv(`Internal error creating IndexedDBFSNode -- parent is not a directory (encountered while adding ${i})`);if(e.length===1){const n=e[0],r=this.entry.children.get(n);if(t.type==="dir"){if(r?.entry.type===rn.File)throw xv(`Internal error creating IndexedDBFSNode -- overwriting file with directory: ${this.entry.path}/${n} (encountered while adding ${i})`);this.entry.children.set(n,r??new oz({type:rn.Directory,path:this.entry.path+"/"+n,children:new Map}))}else{if(r?.entry.type===rn.Directory)throw xv(`Internal error creating IndexedDBFSNode -- overwriting directory with file: ${this.entry.path}/${n} (encountered while adding ${i})`);this.entry.children.set(n,new oz({type:rn.File,path:this.entry.path+"/"+n,size:t.size}))}}else if(e.length>1){const n=e[0];let r=this.entry.children.get(n);if(!r)r=new oz({children:new Map,path:this.entry.path+"/"+n,type:rn.Directory}),this.entry.children.set(n,r);else if(r.type===rn.File)throw xv(`Internal error creating IndexedDBFSNode -- overwriting file entry with directory: ${this.entry.path}/${n} (encountered while adding ${i})`);r.doAdd(e.slice(1),t,i)}}print(e=""){console.log(e+this.entry.path),this.entry.type===rn.Directory&&this.entry.children.forEach(t=>t.print(e+" "))}}class D3t extends V{constructor(e,t,i,n){super(),this.scheme=e,this.indexedDB=t,this.store=i,this.capabilities=zn.FileReadWrite|zn.PathCaseSensitive,this.onDidChangeCapabilities=M.None,this.extUri=new RN(()=>!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 a6,n&&(this.changesBroadcastChannel=this._register(new iPe(`vscode.indexedDB.${e}.changes`)),this._register(this.changesBroadcastChannel.onDidReceiveData(r=>{this._onDidChangeFile.fire(r.map(o=>({type:o.type,resource:N.revive(o.resource)})))})))}watch(e,t){return V.None}async mkdir(e){try{if((await this.stat(e)).type===rn.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===rn.File)return{type:rn.File,ctime:0,mtime:this.mtimes.get(e.toString())||0,size:t.size??(await this.readFile(e)).byteLength};if(t?.type===rn.Directory)return{type:rn.Directory,ctime:0,mtime:0,size:0};throw Vue}async readdir(e){try{const t=(await this.getFiletree()).read(e.path);if(!t)return[];if(t.type!==rn.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",r=>r.get(e.path));if(t===void 0)throw Vue;const i=t instanceof Uint8Array?t:Rt(t)?Ge.fromString(t).buffer:void 0;if(i===void 0)throw xv(`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===rn.Directory)throw A3t;await this.bulkWrite([[e,t]])}catch(n){throw this.reportError("writeFile",n),n}}async rename(e,t,i){const n=await this.getFiletree(),r=n.read(e.path);if(!r)throw Vue;const o=n.read(t.path);if(o){if(!i.overwrite)throw gs("file exists already",ot.FileExists);if(o.type!==r.type)throw gs("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]===rn.File?l.push(d):d[1]===rn.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;uo);else{if(i.type===rn.Directory&&(await this.readdir(e)).length)throw E3t;n=[e.path]}await this.deleteKeys(n),(await this.getFiletree()).delete(e.path),n.forEach(r=>this.mtimes.delete(r)),this.triggerChanges(n.map(r=>({resource:e.with({path:r}),type:Tr.DELETED})))}async tree(e){const t=await this.stat(e),i=[[e.path,t.type]];if(t.type===rn.Directory){const n=await this.readdir(e);for(const[r,o]of n){const a=this.extUri.joinPath(e,r);if(i.push([a.path,o]),o===rn.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 oz({children:new Map,path:"",type:rn.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:Tr.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"?x3t: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 LA||t instanceof CAe?t.code:"unknown"})}}class k3t extends xae{constructor(e=KLe){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)$Y(e,t,i);this.buffer=[]}log(e,t){this._logger?$Y(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 hC;(function(s){s[s.None=0]="None",s[s.Untitled=2]="Untitled",s[s.Scratchpad=4]="Scratchpad"})(hC||(hC={}));const rPe="",I3t="modulepreload",T3t=function(s,e){return new URL(s,e).href},G5e={},VT=function(e,t,i){let n=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");n=Promise.allSettled(t.map(l=>{if(l=T3t(l,i),l in G5e)return;G5e[l]=!0;const d=l.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!i)for(let p=o.length-1;p>=0;p--){const m=o[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":I3t,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 r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return n.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})},Ud="utf8",vS="utf8bom",rN="utf16be",oN="utf16le",nj=[254,255],SAe=[255,254],OV=[239,187,191],L3t=512,R3t=512,M3t=512*8,N3t=512*128;var yee;(function(s){s[s.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(yee||(yee={}));class P3t extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class oPe{static async create(e){let t;if(e!==Ud)t=(await VT(()=>import("./iconv-lite-umd-BmYqgFqP.js").then(n=>n.i),[],import.meta.url).then(n=>n.default??n)).getDecoder(aPe(e));else{const i=new TextDecoder;t={write(n){return i.decode(n,{stream:!0})},end(){return i.decode()}}}return new oPe(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function F3t(s,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?M3t:R3t;return new Promise((i,n)=>{const r=eE(h=>h.join("")),o=[];let a=0,c;const l=new li,d=async()=>{try{const h=await K3t({buffer:Ge.concat(o),bytesRead:a},e.guessEncoding,e.candidateGuessEncodings);if(h.seemsBinary&&e.acceptTextOnly)throw new P3t("Stream is binary but only text is accepted for decoding",yee.STREAM_IS_BINARY);h.encoding=await e.overwriteEncoding(h.encoding),c=await oPe.create(h.encoding);const u=c.write(Ge.concat(o).buffer);r.write(u),o.length=0,a=0,i({stream:r,detected:h})}catch(h){l.cancel(),r.destroy(),n(h)}};NN(s,{onData:async h=>{c?r.write(c.write(h.buffer)):(o.push(h),a+=h.byteLength,a>=t&&(s.pause(),await d(),setTimeout(()=>s.resume())))},onError:h=>r.error(h),onEnd:async()=>{c||await d(),r.end(c?.end())}},l.token)})}async function O3t(s,e,t){const n=(await VT(()=>import("./iconv-lite-umd-BmYqgFqP.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a)).getEncoder(aPe(e),t);let r=!1,o=!1;return{read(){if(o)return null;const a=s.read();if(typeof a!="string"){if(o=!0,!r&&t?.addBOM)switch(e){case Ud:case vS:return Ge.wrap(Uint8Array.from(OV));case rN:return Ge.wrap(Uint8Array.from(nj));case oN:return Ge.wrap(Uint8Array.from(SAe))}const c=n.end();return c&&c.length>0?(r=!0,Ge.wrap(c)):null}return r=!0,Ge.wrap(n.write(a))}}}async function B3t(s){return(await VT(()=>import("./iconv-lite-umd-BmYqgFqP.js").then(t=>t.i),[],import.meta.url).then(t=>t.default??t)).encodingExists(aPe(s))}function aPe(s){return s===vS||s===null?Ud:s}function W3t(s,e){if(!s||eimport("./index-Cmm7IsMZ.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a),i=s.slice(0,N3t),n=G3t(i.buffer);e&&(e=Oi(e.map(a=>$3t(a))),e.length===0&&(e=void 0));const r=t.detect(n,e?{detectEncodings:e}:void 0);if(!r||!r.encoding)return null;const o=r.encoding.toLowerCase();return 0<=H3t.indexOf(o)?null:z3t(r.encoding)}const V3t={ibm866:"cp866",big5:"cp950"};function Hnt(s){return s.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function z3t(s){const e=Hnt(s);return V3t[e]||e}function $3t(s){const e=Hnt(s);return sj[e].guessableName}function G3t(s){let e="";for(let t=0;t({seemsBinary:!1,encoding:o})):{seemsBinary:r,encoding:n}}const dx={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}},sj=(()=>{const s={};for(const e in dx)dx[e].guessableName&&(s[e]=dx[e]);return s})();var qP,gy;let Cee=(gy=class extends hI{get name(){return this.configuredLabelFormat==="content"&&!this.hasAssociatedFilePath&&this.cachedModelFirstLineWords?this.cachedModelFirstLineWords:this.labelService.getUriBasenameLabel(this.resource)}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m){super(a,o,p,m),this.resource=e,this.hasAssociatedFilePath=t,this.initialValue=i,this.preferredLanguageId=n,this.preferredEncoding=r,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=rPe,this.capabilities=hC.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===qP.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(Eae(""))}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:Ud}):typeof this.initialValue=="string"&&(t=Tqe(Ge.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 r=await this.workingCopyBackupService.resolve(this);r?(n=r.value,t=!0):n=g6(Ge.fromString(this.initialValue||""));const o=await OLe(await this.textFileService.getDecodedStream(this.resource,n,{encoding:Ud}));this.createTextEditorModel(o,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<=qP.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:qP.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH+1}).trim().replace(/\s+/g," ").replace(/\u202E/g,"");i=i.substr(0,mKe(i,qP.FIRST_LINE_NAME_MAX_LENGTH)[0]),i&&j7().exec(i)&&(t=i),t!==this.cachedModelFirstLineWords&&(this.cachedModelFirstLineWords=t,this._onDidChangeName.fire())}isReadonly(){return!1}},qP=gy,gy.FIRST_LINE_NAME_MAX_LENGTH=40,gy.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH=gy.FIRST_LINE_NAME_MAX_LENGTH*10,gy.ACTIVE_EDITOR_LANGUAGE_ID="${activeEditorLanguage}",gy);Cee=qP=D([_(5,Di),_(6,fi),_(7,X6),_(8,xc),_(9,Pm),_(10,Fr),_(11,Os),_(12,ti),_(13,j6),_(14,_o)],Cee);var BV,Ak;let See=(Ak=class extends hI{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b){super(r,n,f,p),this.resource=e,this.preferredEncoding=t,this.preferredLanguageId=i,this.fileService=o,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=rPe,this.capabilities=hC.None,this.name=Kr(this.labelService.getUriLabel(this.resource)),this.resourceHasExtension=!!Dn.extname(this.resource),this.versionId=0,this.ignoreDirtyOnModelContentChange=!1,this.ignoreSaveFromSaveParticipants=!1,this.lastModelContentChangeFromUndoRedo=void 0,this.saveSequentializer=new eqe,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,Tr.ADDED)&&(i=!1,t=!0):e.contains(this.resource,Tr.DELETED)&&(i=!0,t=!0),t&&this.inOrphanMode!==i){let n=!1;i&&(await Ao(100,Ue.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:Ud});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(r){if(r.fileOperationResult!==ji.FILE_NOT_FOUND)throw i(),r}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}async resolve(e){if(this.trace("resolve() - enter"),ls("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),ls("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,r,o;try{const c=await this.fileService.stat(this.resource);i=c.mtime,n=c.ctime,r=c.size,o=c.etag,this.setOrphaned(!1)}catch(c){i=Date.now(),n=Date.now(),r=0,o=x_,this.setOrphaned(c.fileOperationResult===ji.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:r,etag:o,value:e,encoding:a.encoding,readonly:!1,locked:!1},!0,t)}async resolveFromBackup(e){const t=await this.workingCopyBackupService.resolve(this);let i=Ud;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:x_,value:await OLe(await this.textFileService.getDecodedStream(this.resource,e.value,{encoding:Ud})),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=x_:this.lastResolvedFileStat&&(n=this.lastResolvedFileStat.etag);const r=this.versionId;try{const o=await this.textFileService.readStream(this.resource,{acceptTextOnly:!i,etag:n,encoding:this.preferredEncoding,limits:e?.limits});if(this.setOrphaned(!1),r!==this.versionId){this.trace("resolveFromFile() - exit - without resolving because model content changed");return}return this.resolveFromContent(o,!1,e)}catch(o){const a=o.fileOperationResult;if(this.setOrphaned(a===ji.FILE_NOT_FOUND),this.isResolved()&&a===ji.FILE_NOT_MODIFIED_SINCE){o instanceof T5&&this.updateLastResolvedFileStat(o.stat);return}if(this.isResolved()&&a===ji.FILE_NOT_FOUND&&!t)return;throw o}}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??o9.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===Sa)&&!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,r=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=r}}async save(e=Object.create(null)){return this.isResolved()?this.isReadonly()?(this.trace("save() - ignoring request for readonly resource"),!1):(this.hasState(ph.CONFLICT)||this.hasState(ph.ERROR))&&(e.reason===Sn.AUTO||e.reason===Sn.FOCUS_CHANGE||e.reason===Sn.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(ph.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Sn.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 li;return this.progressService.withProgress({title:g(5736,"Saving '{0}'",this.name),location:fd.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===Sn.AUTO&&typeof this.lastModelContentChangeFromUndoRedo=="number"){const a=Date.now()-this.lastModelContentChangeFromUndoRedo;a{try{const a=await this.textFileService.write(r.resource,o.createSnapshot(),{mtime:r.mtime,encoding:this.getEncoding(),etag:t.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(r.resource,o.getLanguageId())?x_:r.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===ji.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 ph.CONFLICT:return this.inConflictMode;case ph.DIRTY:return this.dirty;case ph.ERROR:return this.inErrorMode;case ph.ORPHAN:return this.inOrphanMode;case ph.PENDING_SAVE:return this.saveSequentializer.isRunning();case ph.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===vS||this.contentEncoding===rN||this.contentEncoding===oN){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,a9.Decode)}setEncoding(e,t){return this.hasEncodingSetExplicitly=!0,this.setEncodingInternal(e,t)}async setEncodingInternal(e,t){if(t===a9.Encode)this.updatePreferredEncoding(e),this.isDirty()||(this.versionId++,this.setDirty(!0)),this.inConflictMode||await this.save({source:BV.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()}},BV=Ak,Ak.TEXTFILE_SAVE_ENCODING_SOURCE=QJ.registerSource("textFileEncoding.source",g(5735,"File Encoding Changed")),Ak.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,Ak);See=BV=D([_(3,Di),_(4,fi),_(5,Xt),_(6,Fr),_(7,X6),_(8,Ke),_(9,Pm),_(10,bd),_(11,Os),_(12,j6),_(13,_o),_(14,Cf),_(15,ps),_(16,hg)],See);let AAe=class extends V{constructor(e){super(),this.logService=e,this.saveParticipants=[]}addSaveParticipant(e){const t=hTe(this.saveParticipants,e);return Ee(()=>t())}async participate(e,t,i,n){e.textEditorModel?.pushStackElement();for(const r of this.saveParticipants){if(n.isCancellationRequested||!e.textEditorModel)break;try{const o=r.participate(e,t,i,n);await $_(o,n)}catch(o){this.logService.error(o)}}e.textEditorModel?.pushStackElement()}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};AAe=D([_(0,Ke)],AAe);let EAe=class extends V{get models(){return[...this.mapResourceToModel.values()]}constructor(e,t,i,n,r){super(),this.instantiationService=e,this.fileService=t,this.notificationService=i,this.workingCopyFileService=n,this.uriIdentityService=r,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 gi,this.mapResourceToModelListeners=new gi,this.mapResourceToDisposeListener=new gi,this.mapResourceToPendingModelResolvers=new gi,this.modelResolveQueue=this._register(new LTe),this.saveErrorHandler=(()=>{const o=this.notificationService;return{onSaveError(a,c){o.error(g(9794,"Failed to save '{0}': {1}",c.name,Po(a,!1)))}}})(),this.mapCorrelationIdToModelsToRestore=new Map,this.saveParticipants=this._register(this.instantiationService.createInstance(AAe)),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,Tr.UPDATED,Tr.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===Ei.MOVE||e.operation===Ei.COPY){const t=[];for(const{source:i,target:n}of e.files)if(i){if(this.uriIdentityService.extUri.isEqual(i,n))continue;const r=[];for(const o of this.models)this.uriIdentityService.extUri.isEqualOrParent(o.resource,i)&&r.push(o);for(const o of r){const a=o.resource;let c;this.uriIdentityService.extUri.isEqual(a,i)?c=n:c=Ft(n,a.path.substr(i.path.length+1)),t.push({source:a,target:c,languageId:o.getLanguageId(),encoding:o.getEncoding(),snapshot:o.isDirty()?o.createSnapshot():void 0})}}this.mapCorrelationIdToModelsToRestore.set(e.correlationId,t)}}onDidFailWorkingCopyFileOperation(e){if(e.operation===Ei.MOVE||e.operation===Ei.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 Ei.CREATE:e.waitUntil((async()=>{for(const{target:t}of e.files){const i=this.get(t);i&&!i.isDisposed()&&await i.revert()}})());break;case Ei.MOVE:case Ei.COPY:e.waitUntil((async()=>{const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),await er.settled(t.map(async i=>{const n=this.uriIdentityService.asCanonicalUri(i.target),r=await this.resolve(n,{reload:{async:!1},contents:i.snapshot?A6(i.snapshot):void 0,encoding:i.encoding});i.languageId&&i.languageId!==Sa&&r.getLanguageId()===Sa&&xU(n)!==qqe&&r.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 r,o=!1;if(i)t?.contents?r=i.resolve(t):t?.reload?t.reload.async?(r=Promise.resolve(),(async()=>{try{await i.resolve(t)}catch(a){bt(a)}})()):r=i.resolve(t):r=Promise.resolve();else{o=!0;const a=i=this.instantiationService.createInstance(See,n,t?t.encoding:void 0,t?t.languageId:void 0);r=i.resolve(t),this.registerModel(a)}this.mapResourceToPendingModelResolvers.set(n,r),this.add(n,i),o&&(this._onDidCreate.fire(i),i.isDirty()&&this._onDidChangeDirty.fire(i));try{await r}catch(a){throw o&&i.dispose(),a}finally{this.mapResourceToPendingModelResolvers.delete(n)}return t?.languageId&&i.setLanguageId(t.languageId),o&&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&&(wt(i),this.mapResourceToDisposeListener.delete(e));const n=this.mapResourceToModelListeners.get(e);n&&(wt(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(),wt(this.mapResourceToDisposeListener.values()),this.mapResourceToDisposeListener.clear(),wt(this.mapResourceToModelListeners.values()),this.mapResourceToModelListeners.clear()}};EAe=D([_(0,we),_(1,Xt),_(2,wi),_(3,qb),_(4,Is)],EAe);var rj,Ek;let xAe=(Ek=class extends V{constructor(e,t,i,n,r,o,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=r,this.environmentService=o,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(EAe)),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(ph.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(),r=i.hasState(ph.ORPHAN);if(n&&r)return{color:CBe,letter:ve.lockSmall,strikethrough:!0,tooltip:g(4402,"Deleted, Read-only")};if(n)return{letter:ve.lockSmall,tooltip:g(4403,"Read-only")};if(r)return{color:CBe,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(DAe))),this._encoding}async read(e,t){const[i,n]=await this.doRead(e,{...t,preferUnbuffered:!0});return{...i,encoding:n.detected.encoding||Ud,value:await VTe(n.stream,r=>r.join(""))}}async readStream(e,t){const[i,n]=await this.doRead(e,t);return{...i,encoding:n.detected.encoding||Ud,value:await OLe(n.stream)}}async doRead(e,t){const i=new li;let n;if(t?.preferUnbuffered){const r=await this.fileService.readFile(e,t,i.token);n={...r,value:g6(r.value)}}else n=await this.fileService.readFileStream(e,t,i.token);try{const r=await this.doGetDecodedStream(e,n.value,t);return[n,r]}catch(r){throw i.dispose(!0),r.decodeStreamErrorKind===yee.STREAM_IS_BINARY?new ZOt(g(4405,"File seems to be binary and cannot be opened as text"),RW.FILE_IS_BINARY,t):r}}async create(e,t){const i=await Promise.all(e.map(async n=>{const r=await this.getEncodedReadable(n.resource,n.value);return{resource:n.resource,contents:r,overwrite:n.options?.overwrite}}));return this.workingCopyFileService.create(i,Ue.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:r}=await this.encoding.getWriteEncoding(e,i);if(n===Ud&&!r)return typeof t>"u"?void 0:iBt(t);t=t||"";const o=typeof t=="string"?tBt(t):t;return O3t(o,n,{addBOM:r})}async getDecodedStream(e,t,i){return(await this.doGetDecodedStream(e,t,i)).stream}doGetDecodedStream(e,t,i){return F3t(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:r}=await this.encoding.getPreferredReadEncoding(e,i,n??void 0);return r}})}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 Yi(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}}],Ue.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 r=this.files.get(e);if(r?.isResolved())n=await this.doSaveAsTextFile(r,e,t,i);else if(this.fileService.hasProvider(e))await this.fileService.copy(e,t,!0),n=!0;else{const o=this.modelService.getModel(e);o&&(n=await this.doSaveAsTextFile(o,e,t,i))}if(n){try{await this.revert(e)}catch(o){this.logService.error(o)}return t}}async doSaveAsTextFile(e,t,i,n){let r;const o=e;typeof o.getEncoding=="function"&&(r=o.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:r})}catch(u){if(a&&(u.textFileOperationResult===RW.FILE_IS_BINARY||u.fileOperationResult===ji.FILE_TOO_LARGE))return await this.fileService.del(i),this.doSaveAsTextFile(e,t,i,n);throw u}}let l;if(e instanceof Cee&&e.hasAssociatedFilePath&&a&&this.uriIdentityService.extUri.isEqual(i,N8(e.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme))?l=await this.confirmOverwrite(i):l=!0,!l)return!1;let d;e instanceof hI?e.isResolved()&&(d=e.textEditorModel??void 0):d=e;let h;if(c.isResolved()&&(h=c.textEditorModel),d&&h){c.updatePreferredEncoding(r),this.modelService.updateModel(h,A6(d.createSnapshot()));const u=d.getLanguageId(),f=h.getLanguageId();u!==Sa&&f===Sa&&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?rj.TEXTFILE_SAVE_REPLACE_SOURCE:rj.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?",vi(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.",vi(e),vi(Ro(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?",vi(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 r=this.untitled.get(e);if(r){if(r.hasAssociatedFilePath)return N8(e,t,this.pathService.defaultUriScheme);let o;await this.pathService.hasValidBasename(Ft(i,r.name),r.name)?o=r.name:o=vi(e);const a=r.getLanguageId();a&&a!==Sa?n=this.suggestFilename(a,o):n=o}}return n||(n=vi(e)),Ft(i,n)}suggestFilename(e,t){if(!this.languageService.getLanguageName(e))return t;const n=jy(t),r=this.languageService.getExtensions(e);if(r.includes(n))return t;const o=um(r);if(o)return n?`${t.substring(0,t.indexOf(n))}${o}`:`${t}${o}`;const a=this.languageService.getFilenames(e);return a.includes(t)?t:um(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}},rj=Ek,Ek.TEXTFILE_SAVE_CREATE_SOURCE=QJ.registerSource("textFileCreate.source",g(4399,"File Created")),Ek.TEXTFILE_SAVE_REPLACE_SOURCE=QJ.registerSource("textFileOverwrite.source",g(4400,"File Replaced")),Ek);xAe=rj=D([_(0,Xt),_(1,J6),_(2,rg),_(3,we),_(4,fi),_(5,Xo),_(6,ir),_(7,dg),_(8,xc),_(9,bd),_(10,qt),_(11,Cf),_(12,qb),_(13,Is),_(14,Di),_(15,Ke),_(16,Q6),_(17,aE)],xAe);let DAe=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:Ud}),e.push({extension:Tb,encoding:Ud}),e.push({parent:this.environmentService.untitledWorkspacesHome,encoding:Ud}),this.contextService.getWorkspace().folders.forEach(t=>{e.push({parent:Ft(t.uri,".vscode"),encoding:Ud})}),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===rN||i===oN||i===vS}}async getPreferredReadEncoding(e,t,i){let n;t?.encoding?i===vS&&t.encoding===Ud?n=vS:n=t.encoding:typeof i=="string"?n=i:this.textResourceConfigurationService.getValue(e,"files.encoding")===vS&&(n=Ud);const r=await this.getEncodingForResource(e,n);return{encoding:r,hasBOM:r===rN||r===oN||r===vS}}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!==Ud&&(!i||!await B3t(i))&&(i=Ud),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&&xU(e)===`.${t.extension}`)return t.encoding}}};DAe=D([_(0,xc),_(1,Xo),_(2,Ci),_(3,Is)],DAe);let kAe=class extends xAe{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b,w){super(e,t,i,n,r,o,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(ph.PENDING_SAVE))}};kAe=D([_(0,Xt),_(1,J6),_(2,rg),_(3,we),_(4,fi),_(5,Xo),_(6,ir),_(7,dg),_(8,xc),_(9,bd),_(10,qt),_(11,Cf),_(12,qb),_(13,Is),_(14,Di),_(15,Q6),_(16,Ke),_(17,aE)],kAe);var ow,VR;let IAe=(VR=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 o of this.contextService.getWorkspace().folders){const a=o.uri.toString(),c=this.doGetExpression(o.uri),l=this.mapFolderToConfiguredExpression.get(a);c?(!l||!Js(l.expression,c.expression))&&(t=!0,this.mapFolderToParsedExpression.set(a,X_(c.expression)),this.mapFolderToConfiguredExpression.set(a,c)):l&&(t=!0,this.mapFolderToParsedExpression.delete(a),this.mapFolderToConfiguredExpression.delete(a))}const i=new Mk(this.contextService.getWorkspace().folders.map(o=>o.uri));for(const[o]of this.mapFolderToConfiguredExpression)o!==ow.NO_FOLDER&&(i.has(N.parse(o))||(this.mapFolderToParsedExpression.delete(o),this.mapFolderToConfiguredExpression.delete(o),t=!0));const n=this.doGetExpression(void 0),r=this.mapFolderToConfiguredExpression.get(ow.NO_FOLDER);n?(!r||!Js(r.expression,n.expression))&&(t=!0,this.mapFolderToParsedExpression.set(ow.NO_FOLDER,X_(n.expression)),this.mapFolderToConfiguredExpression.set(ow.NO_FOLDER,n)):r&&(t=!0,this.mapFolderToParsedExpression.delete(ow.NO_FOLDER),this.mapFolderToConfiguredExpression.delete(ow.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 r=Object.create(null);for(const o of i){n||(n=yM(o));let a=o;const c=Kdt(a,!0);if(c){const l=c.toLowerCase();c!==c.toLowerCase()&&(a=`${l}${a.substring(1)}`)}r[a]=t[o]}return{expression:r,hasAbsolutePath:n}}matches(e,t){if(this.mapFolderToParsedExpression.size===0)return!1;const i=this.contextService.getWorkspaceFolder(e);let n,r;if(i&&this.mapFolderToParsedExpression.has(i.uri.toString())?(n=this.mapFolderToParsedExpression.get(i.uri.toString()),r=this.mapFolderToConfiguredExpression.get(i.uri.toString())):(n=this.mapFolderToParsedExpression.get(ow.NO_FOLDER),r=this.mapFolderToConfiguredExpression.get(ow.NO_FOLDER)),!n)return!1;let o;return i?o=MN(i.uri,e):o=this.uriToPath(e),typeof o=="string"&&n(o,void 0,t)?!0:o!==this.uriToPath(e)&&r?.hasAbsolutePath?!!n(this.uriToPath(e),void 0,t):!1}uriToPath(e){return e.scheme===pe.file?e.fsPath:e.path}},ow=VR,VR.NO_FOLDER=null,VR);IAe=ow=D([_(2,Ci),_(3,Te)],IAe);var Dv;const q3t=new Q("autoSaveAfterShortDelayContext",!1,!0);var ac;(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"})(ac||(ac={}));var Ug;(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"})(Ug||(Ug={}));var ZS;let TAe=(ZS=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this.contextKeyService=e,this.configurationService=t,this.contextService=i,this.environmentService=n,this.uriIdentityService=r,this.fileService=o,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 pm(1e3),this.autoSaveDisabledOverrides=new gi,this.autoSaveAfterShortDelayContext=q3t.bindTo(this.contextKeyService),this.readonlyIncludeMatcher=this._register(new Lpe(()=>this.createReadonlyMatcher(DYe))),this.readonlyExcludeMatcher=this._register(new Lpe(()=>this.createReadonlyMatcher(kYe))),this.sessionReadonlyOverrides=new gi(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||Du.ON_EXIT,this.onFilesConfigurationChange(l,!1),this.registerListeners()}createReadonlyMatcher(e){const t=this._register(new IAe(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&&mEt(i))return i.readOnlyMessage??Dv.READONLY_MESSAGES.providerReadonly;const n=this.sessionReadonlyOverrides.get(e);return typeof n=="boolean"?n===!0?Dv.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:Dv.READONLY_MESSAGES.configuredReadonly:this.configuredReadonlyFromPermissions&&t?.locked?Dv.READONLY_MESSAGES.fileLocked:t?.readonly?Dv.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===ac.AFTER_SHORT_DELAY),t&&this._onDidChangeAutoSaveConfiguration.fire();const i=e?.files?.associations;Js(this.currentFilesAssociationConfiguration,i)||(this.currentFilesAssociationConfiguration=i,t&&this._onDidChangeFilesAssociation.fire());const n=e?.files?.hotExit;n===Du.OFF||n===Du.ON_EXIT_AND_WINDOW_CLOSE?this.currentHotExitConfiguration=n:this.currentHotExitConfiguration=Du.ON_EXIT;const r=!!e?.files?.readonlyFromPermissions;r!==!!this.configuredReadonlyFromPermissions&&(this.configuredReadonlyFromPermissions=r,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,r,o,a,c;switch(t?.autoSave??Dv.DEFAULT_AUTO_SAVE_MODE){case il.AFTER_DELAY:{i="afterDelay",n=typeof t?.autoSaveDelay=="number"&&t.autoSaveDelay>=0?t.autoSaveDelay:Dv.DEFAULT_AUTO_SAVE_DELAY,c=n<=Dv.DEFAULT_AUTO_SAVE_DELAY;break}case il.ON_FOCUS_CHANGE:i="onFocusChange";break;case il.ON_WINDOW_CHANGE:i="onWindowChange";break}return t?.autoSaveWorkspaceFilesOnly===!0&&(r=!0,e&&!this.contextService.isInsideWorkspace(e)&&(a=!0,c=void 0)),t?.autoSaveWhenNoErrors===!0&&(o=!0,c=void 0),{autoSave:i,autoSaveDelay:n,autoSaveWorkspaceFilesOnly:r,autoSaveWhenNoErrors:o,isOutOfWorkspace:a,isShortAutoSaveDelay:c}}toResource(e){return e instanceof Ub?Fa.getOriginalUri(e,{supportSideBySide:Us.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:ac.OFF,reason:Ug.DISABLED};const n=this.getAutoSaveConfiguration(i);if(typeof n.autoSave>"u")return{mode:ac.OFF,reason:Ug.SETTINGS};if(typeof t=="number"&&(n.autoSave==="afterDelay"&&t!==Sn.AUTO||n.autoSave==="onFocusChange"&&t!==Sn.FOCUS_CHANGE&&t!==Sn.WINDOW_CHANGE||n.autoSave==="onWindowChange"&&t!==Sn.WINDOW_CHANGE))return{mode:ac.OFF,reason:Ug.SETTINGS};if(i){if(n.autoSaveWorkspaceFilesOnly&&n.isOutOfWorkspace)return{mode:ac.OFF,reason:Ug.OUT_OF_WORKSPACE};if(n.autoSaveWhenNoErrors&&this.markerService.read({resource:i,take:1,severities:Hs.Error}).length>0)return{mode:ac.OFF,reason:Ug.ERRORS}}switch(n.autoSave){case"afterDelay":return typeof n.autoSaveDelay=="number"&&n.autoSaveDelay<=Dv.DEFAULT_AUTO_SAVE_DELAY?{mode:n.autoSaveWhenNoErrors?ac.AFTER_LONG_DELAY:ac.AFTER_SHORT_DELAY}:{mode:ac.AFTER_LONG_DELAY};case"onFocusChange":return{mode:ac.ON_FOCUS_CHANGE};case"onWindowChange":return{mode:ac.ON_WINDOW_CHANGE}}}async toggleAutoSave(){const e=this.configurationService.getValue("files.autoSave");let t;return[il.AFTER_DELAY,il.ON_FOCUS_CHANGE,il.ON_WINDOW_CHANGE].some(i=>i===e)?t=il.OFF:t=il.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!==Du.OFF}get hotExitConfiguration(){return this.currentHotExitConfiguration}preventSaveConflicts(e,t){return this.configurationService.getValue("files.saveConflictResolution",{resource:e,overrideIdentifier:t})!=="overwriteFileOnDisk"}},Dv=ZS,ZS.DEFAULT_AUTO_SAVE_MODE=Hn?il.AFTER_DELAY:il.OFF,ZS.DEFAULT_AUTO_SAVE_DELAY=1e3,ZS.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}},ZS);TAe=Dv=D([_(0,Le),_(1,Te),_(2,Ci),_(3,ec),_(4,Is),_(5,Xt),_(6,Dm),_(7,xc)],TAe);class Q3t{isSupported(e){return!1}async writeFileElevated(e,t,i){throw new Error("Unsupported")}}const cPe=je.as(Pn.Configuration),j3t=ld?{type:"string",scope:ct.APPLICATION,enum:[Du.OFF,Du.ON_EXIT,Du.ON_EXIT_AND_WINDOW_CLOSE],default:Du.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.",Du.ON_EXIT,Du.ON_EXIT_AND_WINDOW_CLOSE)}:{type:"string",scope:ct.APPLICATION,enum:[Du.OFF,Du.ON_EXIT_AND_WINDOW_CLOSE],default:Du.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.",Du.ON_EXIT,Du.ON_EXIT_AND_WINDOW_CLOSE)};cPe.registerConfiguration({id:"files",order:9,title:g(625,"Files"),type:"object",properties:{[_Et]:{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,...Hn?{"**/*.crswap":!0}:void 0},scope:ct.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.")}}}]}},[aRe]:{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(dx),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:ct.LANGUAGE_OVERRIDABLE,enumDescriptions:Object.keys(dx).map(s=>dx[s].labelLong),enumItemLabels:Object.keys(dx).map(s=>dx[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:ct.LANGUAGE_OVERRIDABLE},"files.candidateGuessEncodings":{type:"array",items:{type:"string",enum:Object.keys(sj),enumDescriptions:Object.keys(sj).map(s=>sj[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:ct.LANGUAGE_OVERRIDABLE},"files.eol":{type:"string",enum:[` `,`\r -`,"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:ct.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:ct.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:ct.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:ct.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:ct.LANGUAGE_OVERRIDABLE},"files.autoSave":{type:"string",enum:[il.OFF,il.AFTER_DELAY,il.ON_FOCUS_CHANGE,il.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:Hn?il.AFTER_DELAY:il.OFF,markdownDescription:g(648,"Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.",il.OFF,il.AFTER_DELAY,il.ON_FOCUS_CHANGE,il.ON_WINDOW_CHANGE,il.AFTER_DELAY),scope:ct.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}`.",il.AFTER_DELAY),scope:ct.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:ct.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:ct.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:ct.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:ct.RESOURCE},"files.hotExit":j3t,"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.")},[DYe]:{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:ct.RESOURCE},[kYe]:{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:ct.RESOURCE},[vEt]:{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:ct.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:ct.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.")}}});cPe.registerConfiguration({...Kb,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:ct.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:ct.LANGUAGE_OVERRIDABLE}}});cPe.registerConfiguration({...Kb,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:ct.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:ct.LANGUAGE_OVERRIDABLE}}});class P4{constructor(){this.type=rn.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=rn.Directory,this.entries=new Map}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:0,type:rn.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 Unt{constructor(e,t){this.uri=e,this.readonly=t,this.type=rn.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:rn.File,permissions:this.readonly?up.Readonly:void 0}}async delete(){if(this.readonly)throw gs("Not allowed",ot.FileWriteLocked);this._onDidDelete.fire()}}const Y3t=new TextEncoder;function J3t(s){return s instanceof Uint8Array?s:Y3t.encode(s)}class X3t extends Unt{constructor(e,t){super(e,!1),this.content=J3t(t)}async getSize(){return this.content.length}async read(){return this.content}async write(e){this.content=e,this._onDidChange.fire()}}class Vnt 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,r){const o=this.fdMemory.get(e);if(o==null)throw gs("No file with that descriptor open",ot.Unavailable);const a=Ge.wrap(o).slice(t,t+r);return i.set(a.buffer,n),a.byteLength}write(e,t,i,n,r){const o=this.fdMemory.get(e);if(o==null)throw gs("No file with that descriptor open",ot.Unavailable);const a=Ge.wrap(i).slice(n,n+r);return o.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 P4,this.rootByAuthority.set(t,i)),i}_lookup(e,t){const i=e.path.split("/");let r=this._lookupRoot(e.authority);for(const o of i){if(o.length===0)continue;let a;if(r instanceof P4&&(a=r.getChildren(o)),a==null){if(t)return;throw gs("file not found",ot.FileNotFound)}r=a}return r}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof P4)return i;throw gs("file not a directory",ot.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i!=null&&i.type===rn.File)return i;throw gs("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=Dn.joinPath(n,a);let c=i.getChildren(a);if(c==null&&(c=this.mkdirSync(n)),!(c instanceof P4))throw new Error(`file '${n.toString()}' is not a directory`);i=c}const r=t[t.length-1];if(i.getChildren(r)!=null)throw new Error(`file '${Dn.joinPath(n,r).toString()}/' already exists`);const o=new Z;return o.add(Ee(()=>{this._fireSoon({resource:e.uri,type:2})})),o.add(e.onDidDelete(()=>{o.dispose()})),o.add(e.onDidChange(()=>{this._fireSoon({resource:e.uri,type:0})})),o.add(i.addChild(r,e)),this._fireSoon({resource:e.uri,type:1}),o}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),r=eE(o=>Ge.concat(o.map(a=>Ge.wrap(a))).buffer,{highWaterMark:10});return(async()=>{try{if(n.readStream==null||typeof t.length=="number"||typeof t.position=="number"){let o=await n.read();(typeof t.position=="number"||typeof t.length=="number")&&(o=o.slice(t.position??0,t.length)),r.end(o)}else{const o=(await n.readStream()).getReader();let a=await o.read();for(;!a.done&&!(i.isCancellationRequested||(await r.write(a.value),i.isCancellationRequested));)a=await o.read();r.end(void 0)}}catch(o){r.error(gs(o,ot.Unknown)),r.end()}})(),r}watch(){return V.None}async writeFile(e,t,i){const n=this._lookup(e,!0);if(n!=null&&!(n instanceof Unt))throw gs("file is directory",ot.FileIsADirectory);if(n==null)throw gs("file not found",ot.FileNotFound);if(!i.overwrite)throw gs("file exists already",ot.FileExists);await n.write(t)}async rename(){throw gs("Not allowed",ot.NoPermissions)}mkdirSync(e){if(this._lookup(e,!0)!=null)throw gs("file exists already",ot.FileExists);const t=vi(e),i=Ro(e),n=this._lookupAsDirectory(i,!1),r=new P4,o=new Z;return o.add(r.onDidDelete(()=>{o.dispose(),this._fireSoon({resource:e,type:2})})),o.add(r.onDidChange(()=>{this._fireSoon({resource:e,type:0})})),n.addChild(t,r),this._fireSoon({type:1,resource:e}),r}async mkdir(){throw gs("Can' create a directory",ot.NoPermissions)}deleteSync(e){const t=this._lookup(e,!0);if(t==null)throw gs("Not found",ot.FileNotFound);if(t.type===rn.Directory)throw gs("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 K5e(s){return s.status==="fulfilled"}class znt{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((r,o)=>o.priority-r.priority);const n=new Z;return n.add(t.onDidChangeFile(r=>{this._onDidChangeFile.fire(r)})),n.add({dispose:()=>{const r=this.providers.indexOf(i);r>=0&&(this.providers.splice(r,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 gs("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(r){if(i??(i=r),r instanceof LA&&[ot.NoPermissions,ot.FileNotFound,ot.Unavailable].includes(r.code))continue;throw r}}throw i}async writeToDelegates(e){if(this.delegates.length===0)throw gs("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 LA&&[ot.NoPermissions,ot.FileNotFound,ot.Unavailable].includes(i.code))continue;throw i}throw gs("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?up.Readonly:void 0)}})}async readFile(e){return this.readFromDelegates(t=>t.readFile(e))}readFileStream(e,t,i){const n=eE(r=>Ge.concat(r.map(o=>Ge.wrap(o))).buffer);return this.readFromDelegates(async r=>{if(qq(r)){const o=r.readFileStream(e,t,i);await new Promise((a,c)=>{let l=!1;NN(o,{onData(d){l=!0,n.write(d)},onEnd(){n.end(),a()},onError(d){l?n.error(d):c(d)}},i)})}else{let o=await this.readFile(e);return(typeof t.position=="number"||typeof t.length=="number")&&(o=o.slice(t.position??0,t.length)),n.end(o)}},i).catch(r=>{n.error(r)}),n}async readdir(e){const t=await Promise.allSettled(this.delegates.map(async i=>i.readdir(e)));if(!t.some(K5e))throw t[0].reason;return Object.entries(Object.fromEntries(t.filter(K5e).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 r;try{r=await n.stat(e)}catch{}if(r!=null&&((r.permissions??0)&up.Readonly)>0)throw gs("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 Z3t extends wee{async writeFile(e,t,i){return await Wnt(Dn,this,Dn.dirname(e)),super.writeFile(e,t,i)}}const $nt=new znt;$nt.register(0,new Z3t);const e9t=new Vnt(!0),Gnt=new wee;Gnt.mkdir(N.from({scheme:pe.vscodeUserData,path:"/User/"}));var Aee;(function(s){s.extensionFile="extension-file"})(Aee||(Aee={}));const Knt={[Aee.extensionFile]:e9t,[Lit.scheme]:new wee,[pe.vscodeUserData]:Gnt,[pe.tmp]:new wee,[pe.file]:$nt};let LAe=class extends yAe{constructor(e,t){super(e);for(const[i,n]of Object.entries(Knt)){let r=this.registerProvider(i,n);n instanceof znt&&n.onDidChangeOverlays(()=>{r.dispose(),r=this.registerProvider(i,n)}),n instanceof D3t&&this._register(n.onReportError(o=>t.publicLog2("indexedDBFileSystemProviderError",o)))}}};LAe=D([_(1,Ji)],LAe);const qnt=new k3t;VNe(async s=>{qnt.logger=s.get(Ke)});function Xce(){return{[Xt.toString()]:new yi(LAe,[qnt],!0),[Fr.toString()]:new yi(kAe,[],!0),[bd.toString()]:new yi(TAe,[],!0),[Q6.toString()]:new yi(Q3t,[],!0)}}function t9t(s,e){Uit(),Knt[s]=e}function i9t(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);Xy(n)&&t.push(n.then(r=>{r&&(i=!0)},r=>{e(r),i=!0}))}return er.settled(t).then(()=>i)}var eH;(function(s){s[s.WebSocket=0]="WebSocket",s[s.Managed=1]="Managed"})(eH||(eH={}));class Qnt{constructor(e){this.id=e,this.type=eH.Managed}toString(){return`Managed(${this.id})`}}class jnt{constructor(e,t){this.host=e,this.port=t,this.type=eH.WebSocket}toString(){return`WebSocket(${this.host}:${this.port})`}}var id;(function(s){s.Unknown="Unknown",s.NotAvailable="NotAvailable",s.TemporarilyNotAvailable="TemporarilyNotAvailable",s.NoResolverFound="NoResolverFound",s.InvalidAuthority="InvalidAuthority"})(id||(id={}));let wD=class k0 extends Ra{static isNotAvailable(e){return e instanceof k0&&e._code===id.NotAvailable}static isTemporarilyNotAvailable(e){return e instanceof k0&&e._code===id.TemporarilyNotAvailable}static isNoResolverFound(e){return e instanceof k0&&e._code===id.NoResolverFound}static isInvalidAuthority(e){return e instanceof k0&&e._code===id.InvalidAuthority}static isHandled(e){return e instanceof k0&&e.isHandled}constructor(e,t=id.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,this.isHandled=t===id.NotAvailable&&i===!0,Object.setPrototypeOf(this,k0.prototype)}};function Eee(s){const e=s.indexOf("+");return e===-1?s:s.substring(0,e)}class n9t{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}}class yD{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(l9t),this._extensionsMap=new ba,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=q5e(this._extensionDescriptions,t),this._extensionDescriptions=this._extensionDescriptions.concat(e);const i=yD._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=q5e(this._extensionDescriptions,i.map(n=>n.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new n9t(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 r=t.getNodes().filter(a=>!n.has(a));let o;do{o=!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 s9t(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 s9t{constructor(e,t){this.versionId=e,this.extensions=t}}class r9t{constructor(e){this._lock=new c9t,this._actual=new yD(e,[])}async acquireLock(e){const t=await this._lock.acquire(e);return new o9t(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 o9t extends V{constructor(e,t){super(),this._registry=e,this._isDisposed=!1,this._register(t)}isAcquiredFor(e){return!this._isDisposed&&this._registry===e}}class a9t{constructor(e){this.name=e;const t=H2();this.promise=t.promise,this._resolve=t.resolve}resolve(e){this._resolve(e)}}class c9t{constructor(){this._pendingCustomers=[],this._isLocked=!1}async acquire(e){const t=new a9t(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 UE;(function(s){s[s.Builtin=0]="Builtin",s[s.User=1]="User",s[s.Dev=2]="Dev"})(UE||(UE={}));function l9t(s,e){const t=s.isBuiltin?UE.Builtin:s.isUnderDevelopment?UE.Dev:UE.User,i=e.isBuiltin?UE.Builtin:e.isUnderDevelopment?UE.Dev:UE.User;if(t!==i)return t-i;const n=zi.basename(s.extensionLocation.path),r=zi.basename(e.extensionLocation.path);return nr?1:0}function q5e(s,e){const t=new D_(e);return s.filter(i=>!t.has(i.identifier))}function lPe(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",r=t&&!!s.debugExtensionHost.break,o=e&&!!s.extensionTestsLocationURI&&!s.debugExtensionHost.debugId;return{isExtensionDevHost:e,isExtensionDevDebug:n,isExtensionDevDebugBrk:r,isExtensionDevTestFromCli:o}}var dr;(function(s){s[s.LocalProcess=1]="LocalProcess",s[s.LocalWebWorker=2]="LocalWebWorker",s[s.Remote=3]="Remote"})(dr||(dr={}));function bS(s){if(s===null)return"None";switch(s){case dr.LocalProcess:return"LocalProcess";case dr.LocalWebWorker:return"LocalWebWorker";case dr.Remote:return"Remote"}}var Jg;(function(s){s[s.None=0]="None",s[s.Local=1]="Local",s[s.Remote=2]="Remote"})(Jg||(Jg={}));function d9t(s){switch(s){case Jg.None:return"None";case Jg.Local:return"Local";case Jg.Remote:return"Remote"}}function h9t(s,e,t,i){const n=Q5e(s,t),r=Q5e(e,t),o=new Map,a=l=>{if(o.has(l.key))return;const d=n.get(l.key)||null,h=r.get(l.key)||null,u=new g9t(d,h);o.set(u.key,u)};n.forEach(l=>a(l)),r.forEach(l=>a(l));const c=new Map;return o.forEach(l=>{const d=!!l.local,h=!!l.remote,u=!!(l.local&&l.local.isUnderDevelopment),f=!!(l.remote&&l.remote.isUnderDevelopment);let p=Jg.None;u&&!f?p=Jg.Local:f&&!u&&(p=Jg.Remote),c.set(l.key,i(l.identifier,l.kind,d,h,p))}),c}function Q5e(s,e){const t=new Map;return s.forEach(i=>{const n=new u9t(i,e(i));t.set(n.key,n)}),t}class u9t{constructor(e,t){this.desc=e,this.kind=t}get key(){return An.toKey(this.desc.identifier)}get isUnderDevelopment(){return this.desc.isUnderDevelopment}}class g9t{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 Ki(s){return function(e){tH.INSTANCE.registerNamedCustomer(s,e)}}function eP(s){tH.INSTANCE.registerCustomer(s)}var xee;(function(s){function e(){return tH.INSTANCE.getNamedCustomers()}s.getNamedCustomers=e;function t(){return tH.INSTANCE.getCustomers()}s.getCustomers=t})(xee||(xee={}));const aoe=class aoe{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}};aoe.INSTANCE=new aoe;let tH=aoe;function Ynt(s,e,t,i){if(!s||i>200)return null;if(typeof s=="object"){if(s.$mid===ys.Uri)return t?N.revive(e.transformIncoming(s)):e.transformIncoming(s);if(s instanceof Ge)return null;for(const n in s)if(Object.hasOwnProperty.call(s,n)){const r=Ynt(s[n],e,t,i+1);r!==null&&(s[n]=r)}}return null}function F4(s,e){const t=Ynt(s,e,!1,0);return t===null?s:t}class Jnt{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 f9t extends Jnt{constructor(){super(),this._hasErr=!0,this._err=new Na}}const coe=class coe{constructor(e){this._proxyIdentifierBrand=void 0,this.sid=e,this.nid=++coe.count}};coe.count=0;let Dee=coe;const Xnt=[];function Ye(s){const e=new Dee(s);return Xnt[e.nid]=e,e}function KK(s){return Xnt[s].sid}class Jd{constructor(e){this.value=e}}var j5e;function RAe(s,e){try{return JSON.stringify(s,e)}catch{return"null"}}const dPe="$$ref$$",p9t={[dPe]:-1};function Y5e(s,e=null,t=!1){const i=[];return{jsonString:(t?RAe:JSON.stringify)(s,(r,o)=>{if(typeof o>"u")return p9t;if(typeof o=="object"){if(o instanceof Ge){const a=i.push(o)-1;return{[dPe]:a}}if(e)return e(r,o)}return o}),referencedBuffers:i}}function Znt(s,e,t){return JSON.parse(s,(i,n)=>{if(n){const r=n[dPe];if(typeof r=="number")return e[r];if(t&&n.$mid===ys.Uri)return t.transformIncoming(n)}return n})}function J5e(s,e){return JSON.stringify(s,e)}function m9t(s){return s?(e,t)=>t&&t.$mid===ys.Uri?s.transformOutgoing(t):t:null}var Pg;(function(s){s[s.LocalSide=0]="LocalSide",s[s.OtherSide=1]="OtherSide"})(Pg||(Pg={}));var zT;(function(s){s[s.Responsive=0]="Responsive",s[s.Unresponsive=1]="Unresponsive"})(zT||(zT={}));const _9t=()=>{},v9t=Symbol.for("rpcProtocol"),b9t=Symbol.for("rpcProxy"),o8=class o8 extends V{constructor(e,t=null,i=null){super(),this[j5e]=!0,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._protocol=e,this._logger=t,this._uriTransformer=i,this._uriReplacer=m9t(this._uriTransformer),this._isDisposed=!1,this._locals=[],this._proxies=[];for(let n=0,r=Dee.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(Ty())}),super.dispose()}drain(){return typeof this._protocol.drain=="function"?this._protocol.drain():Promise.resolve()}_onWillSendRequest(e){this._unacknowledgedCount===0&&(this._unresponsiveTime=Date.now()+o8.UNRESPONSIVE_TIME),this._unacknowledgedCount++,this._asyncCheckUresponsive.isScheduled()||this._asyncCheckUresponsive.schedule()}_onDidReceiveAcknowledge(e){this._unresponsiveTime=Date.now()+o8.UNRESPONSIVE_TIME,this._unacknowledgedCount--,this._unacknowledgedCount===0&&this._asyncCheckUresponsive.cancel(),this._setResponsiveState(zT.Responsive)}_checkUnresponsive(){this._unacknowledgedCount!==0&&(Date.now()>this._unresponsiveTime?this._setResponsiveState(zT.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?F4(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,r)=>(typeof r=="string"&&!n[r]&&r.charCodeAt(0)===B.DollarSign&&(n[r]=(...o)=>this._remoteCall(e,r,o)),r===b9t?t:n[r])};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,r),l=_9t;this._cancelInvokedHandlers[a]=l;const d=kp.serializeAcknowledged(t);this._logger?.logOutgoing(d.byteLength,t,Pg.OtherSide,"ack"),this._protocol.send(d),c.then(h=>{delete this._cancelInvokedHandlers[a];const u=kp.serializeReplyOK(t,h,this._uriReplacer);this._logger?.logOutgoing(u.byteLength,t,Pg.OtherSide,"reply:",h),this._protocol.send(u)},h=>{delete this._cancelInvokedHandlers[a];const u=kp.serializeReplyErr(t,h);this._logger?.logOutgoing(u.byteLength,t,Pg.OtherSide,"replyErr:",h),this._protocol.send(u)})}_receiveCancel(e,t){this._logger?.logIncoming(e,t,Pg.OtherSide,"receiveCancel");const i=String(t);this._cancelInvokedHandlers[i]?.()}_receiveReply(e,t,i){this._logger?.logIncoming(e,t,Pg.LocalSide,"receiveReply:",i);const n=String(t);if(!this._pendingRPCReplies.hasOwnProperty(n))return;const r=this._pendingRPCReplies[n];delete this._pendingRPCReplies[n],r.resolveOk(i)}_receiveReplyErr(e,t,i){this._logger?.logIncoming(e,t,Pg.LocalSide,"receiveReplyErr:",i);const n=String(t);if(!this._pendingRPCReplies.hasOwnProperty(n))return;const r=this._pendingRPCReplies[n];delete this._pendingRPCReplies[n];let o;i&&(i.$isError?(o=new Error,o.name=i.name,o.message=i.message,o.stack=i.stack):o=i),r.resolveErr(o)}_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 "+KK(e));const r=n[t];if(typeof r!="function")throw new Error("Unknown method "+t+" on actor "+KK(e));return r.apply(n,i)}_remoteCall(e,t,i){if(this._isDisposed)return new f9t;let n=null;if(i.length>0&&Ue.isCancellationToken(i[i.length-1])&&(n=i.pop()),n&&n.isCancellationRequested)return Promise.reject(Ty());const r=kp.serializeRequestArguments(i,this._uriReplacer),o=++this._lastMessageId,a=String(o),c=new Jnt,l=new Z;n&&l.add(n.onCancellationRequested(()=>{const h=kp.serializeCancel(o);this._logger?.logOutgoing(h.byteLength,o,Pg.LocalSide,"cancel"),this._protocol.send(kp.serializeCancel(o))})),this._pendingRPCReplies[a]=new w9t(c,l),this._onWillSendRequest(o);const d=kp.serializeRequest(o,e,t,r,!!n);return this._logger?.logOutgoing(d.byteLength,o,Pg.LocalSide,`request: ${KK(e)}.${t}(`,i),this._protocol.send(d),c}};j5e=v9t,o8.UNRESPONSIVE_TIME=3*1e3;let kee=o8;class w9t{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 xk;let Lc=(xk=class{static alloc(e,t,i){const n=new xk(Ge.alloc(i+1+4),0);return n.writeUInt8(e),n.writeUInt32(t),n}static read(e,t){return new xk(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,r=e.length;n"u")i[n]={type:yl.Undefined};else if(o instanceof Jd){const{jsonString:a,referencedBuffers:c}=Y5e(o.value,t);i[n]={type:yl.SerializedObjectWithBuffers,value:Ge.fromString(a),buffers:c}}else i[n]={type:yl.String,value:Ge.fromString(J5e(o,t))}}return{type:kF.Mixed,args:i}}return{type:kF.Simple,args:J5e(e,t)}}static serializeRequest(e,t,i,n,r){switch(n.type){case kF.Simple:return this._requestJSONArgs(e,t,i,n.args,r);case kF.Mixed:return this._requestMixedArgs(e,t,i,n.args,r)}}static _requestJSONArgs(e,t,i,n,r){const o=Ge.fromString(i),a=Ge.fromString(n);let c=0;c+=Lc.sizeUInt8(),c+=Lc.sizeShortString(o),c+=Lc.sizeLongString(a);const l=Lc.alloc(r?fa.RequestJSONArgsWithCancellation:fa.RequestJSONArgs,e,c);return l.writeUInt8(t),l.writeShortString(o),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,r){const o=Ge.fromString(i);let a=0;a+=Lc.sizeUInt8(),a+=Lc.sizeShortString(o),a+=Lc.sizeMixedArray(n);const c=Lc.alloc(r?fa.RequestMixedArgsWithCancellation:fa.RequestMixedArgs,e,a);return c.writeUInt8(t),c.writeShortString(o),c.writeMixedArray(n),c.buffer}static deserializeRequestMixedArgs(e){const t=e.readUInt8(),i=e.readShortString(),n=e.readMixedArray(),r=new Array(n.length);for(let o=0,a=n.length;o"u")return this._serializeReplyOKEmpty(e);if(t instanceof Ge)return this._serializeReplyOKVSBuffer(e,t);if(t instanceof Jd){const{jsonString:n,referencedBuffers:r}=Y5e(t.value,i,!0);return this._serializeReplyOKJSONWithBuffers(e,n,r)}else return this._serializeReplyOKJSON(e,RAe(t,i))}static _serializeReplyOKEmpty(e){return Lc.alloc(fa.ReplyOKEmpty,e,0).buffer}static _serializeReplyOKVSBuffer(e,t){let i=0;i+=Lc.sizeVSBuffer(t);const n=Lc.alloc(fa.ReplyOKVSBuffer,e,i);return n.writeVSBuffer(t),n.buffer}static deserializeReplyOKVSBuffer(e){return e.readVSBuffer()}static _serializeReplyOKJSON(e,t){const i=Ge.fromString(t);let n=0;n+=Lc.sizeLongString(i);const r=Lc.alloc(fa.ReplyOKJSON,e,n);return r.writeLongString(i),r.buffer}static _serializeReplyOKJSONWithBuffers(e,t,i){const n=Ge.fromString(t);let r=0;r+=Lc.sizeUInt32,r+=Lc.sizeLongString(n);for(const a of i)r+=Lc.sizeVSBuffer(a);const o=Lc.alloc(fa.ReplyOKJSONWithBuffers,e,r);o.writeUInt32(i.length),o.writeLongString(n);for(const a of i)o.writeBuffer(a);return o.buffer}static deserializeReplyOKJSON(e){const t=e.readLongString();return JSON.parse(t)}static deserializeReplyOKJSONWithBuffers(e,t){const i=e.readUInt32(),n=e.readLongString(),r=[];for(let o=0;o{this._hasStarted=!0;const d={time:Date.now(),action:"success",kind:bS(this.kind)};return this._telemetryService.publicLog2("extensionHostStartup",d),this._createExtensionHostCustomers(this.kind,l)},l=>{this._logService.error(`Error received from starting extension host (kind: ${bS(this.kind)})`),this._logService.error(l);const d={time:Date.now(),action:"error",kind:bS(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,Bb.Normal)),this._register(A9t({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,r=[];const o={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=>{r=l}},a=xee.getNamedCustomers();for(let l=0,d=a.length;l`[${bS(this._extensionHost.runningLocation.kind)}${this._extensionHost.runningLocation.affinity}][resolveAuthority(${Eee(e)},${t})][${i.elapsed()}ms] `,r=l=>this._logService.info(`${n()}${l}`),o=(l,d=void 0)=>this._logService.error(`${n()}${l}`,d);r("obtaining proxy...");const a=await this._proxy;if(!a)return o("no proxy"),{type:"error",error:{message:"Cannot resolve authority",code:id.Unknown,detail:void 0}};r("invoking...");const c=new l6;try{c.cancelAndSet(()=>r("waiting..."),1e3);const l=await a.resolveAuthority(e,t);return c.dispose(),l.type==="ok"?r(`returned ${l.value.authority.connectTo}`):o("returned an error",l.error),l}catch(l){return c.dispose(),o("returned an error",l),{type:"error",error:{message:l.message,code:id.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 r=this._extensionHost.extensions.set(e,t,i);return n.startExtensionHost(r)}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)}};Iee=oj=D([_(3,we),_(4,Xo),_(5,Ji),_(6,Ke)],Iee);function est(s,e){return e?`${bS(s)} pid: ${e}`:`${bS(s)}`}const y9t=[["#2977B1","#FC802D","#34A13A","#D3282F","#9366BA"],["#8B564C","#E177C0","#7F7F7F","#BBBE3D","#2EBECD"]];function X5e(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 C9t(s){return Array.isArray(s)?s.map(X5e):X5e(s)}class S9t{constructor(e){this._kind=e,this._totalIncoming=0,this._totalOutgoing=0}_log(e,t,i,n,r,o,a){a=C9t(a);const c=y9t[r],l=c[n%c.length];let d=[`%c[${bS(this._kind)}][${e}]%c[${String(t).padStart(7)}]%c[len: ${String(i).padStart(5)}]%c${String(n).padStart(5)} - ${o}`,"color: darkgreen","color: grey","color: grey",`color: ${l}`];/\($/.test(o)?(d=d.concat(a),d.push(")")):d.push(a),console.log.apply(console,d)}logIncoming(e,t,i,n,r){this._totalIncoming+=e,this._log("Ext → Win",this._totalIncoming,e,t,i,n,r)}logOutgoing(e,t,i,n,r){this._totalOutgoing+=e,this._log("Win → Ext",this._totalOutgoing,e,t,i,n,r)}}let Tee=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===Pg.LocalSide&&/^receiveReply(Err)?:/.test(n)){const r=this._pendingRequests.get(t)??"unknown_reply";this._pendingRequests.delete(t),this._telemetryService.publicLog2("extensionhost.incoming",{type:`${n} ${r}`,length:e})}i===Pg.OtherSide&&/^receiveRequest /.test(n)&&this._telemetryService.publicLog2("extensionhost.incoming",{type:`${n}`,length:e})}logOutgoing(e,t,i,n){i===Pg.LocalSide&&n.startsWith("request: ")&&(this._pendingRequests.set(t,n),this._telemetryService.publicLog2("extensionhost.outgoing",{type:n,length:e}))}};Tee=D([_(0,Ji)],Tee);const WV=[];function A9t(s){return WV.push(s),{dispose:()=>{for(let e=0;en.measure()));t.openEditor({resource:void 0,contents:i.map(aj._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:ct.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:ct.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:ct.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:ct.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:ct.LANGUAGE_OVERRIDABLE},"files.autoSave":{type:"string",enum:[il.OFF,il.AFTER_DELAY,il.ON_FOCUS_CHANGE,il.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:Hn?il.AFTER_DELAY:il.OFF,markdownDescription:g(648,"Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.",il.OFF,il.AFTER_DELAY,il.ON_FOCUS_CHANGE,il.ON_WINDOW_CHANGE,il.AFTER_DELAY),scope:ct.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}`.",il.AFTER_DELAY),scope:ct.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:ct.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:ct.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:ct.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:ct.RESOURCE},"files.hotExit":j3t,"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.")},[DYe]:{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:ct.RESOURCE},[kYe]:{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:ct.RESOURCE},[vEt]:{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:ct.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:ct.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.")}}});cPe.registerConfiguration({...Kb,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:ct.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:ct.LANGUAGE_OVERRIDABLE}}});cPe.registerConfiguration({...Kb,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:ct.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:ct.LANGUAGE_OVERRIDABLE}}});class P4{constructor(){this.type=rn.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=rn.Directory,this.entries=new Map}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:0,type:rn.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 Unt{constructor(e,t){this.uri=e,this.readonly=t,this.type=rn.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:rn.File,permissions:this.readonly?up.Readonly:void 0}}async delete(){if(this.readonly)throw gs("Not allowed",ot.FileWriteLocked);this._onDidDelete.fire()}}const Y3t=new TextEncoder;function J3t(s){return s instanceof Uint8Array?s:Y3t.encode(s)}class X3t extends Unt{constructor(e,t){super(e,!1),this.content=J3t(t)}async getSize(){return this.content.length}async read(){return this.content}async write(e){this.content=e,this._onDidChange.fire()}}class Vnt 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,r){const o=this.fdMemory.get(e);if(o==null)throw gs("No file with that descriptor open",ot.Unavailable);const a=Ge.wrap(o).slice(t,t+r);return i.set(a.buffer,n),a.byteLength}write(e,t,i,n,r){const o=this.fdMemory.get(e);if(o==null)throw gs("No file with that descriptor open",ot.Unavailable);const a=Ge.wrap(i).slice(n,n+r);return o.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 P4,this.rootByAuthority.set(t,i)),i}_lookup(e,t){const i=e.path.split("/");let r=this._lookupRoot(e.authority);for(const o of i){if(o.length===0)continue;let a;if(r instanceof P4&&(a=r.getChildren(o)),a==null){if(t)return;throw gs("file not found",ot.FileNotFound)}r=a}return r}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof P4)return i;throw gs("file not a directory",ot.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i!=null&&i.type===rn.File)return i;throw gs("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=Dn.joinPath(n,a);let c=i.getChildren(a);if(c==null&&(c=this.mkdirSync(n)),!(c instanceof P4))throw new Error(`file '${n.toString()}' is not a directory`);i=c}const r=t[t.length-1];if(i.getChildren(r)!=null)throw new Error(`file '${Dn.joinPath(n,r).toString()}/' already exists`);const o=new Z;return o.add(Ee(()=>{this._fireSoon({resource:e.uri,type:2})})),o.add(e.onDidDelete(()=>{o.dispose()})),o.add(e.onDidChange(()=>{this._fireSoon({resource:e.uri,type:0})})),o.add(i.addChild(r,e)),this._fireSoon({resource:e.uri,type:1}),o}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),r=eE(o=>Ge.concat(o.map(a=>Ge.wrap(a))).buffer,{highWaterMark:10});return(async()=>{try{if(n.readStream==null||typeof t.length=="number"||typeof t.position=="number"){let o=await n.read();(typeof t.position=="number"||typeof t.length=="number")&&(o=o.slice(t.position??0,t.length)),r.end(o)}else{const o=(await n.readStream()).getReader();let a=await o.read();for(;!a.done&&!(i.isCancellationRequested||(await r.write(a.value),i.isCancellationRequested));)a=await o.read();r.end(void 0)}}catch(o){r.error(gs(o,ot.Unknown)),r.end()}})(),r}watch(){return V.None}async writeFile(e,t,i){const n=this._lookup(e,!0);if(n!=null&&!(n instanceof Unt))throw gs("file is directory",ot.FileIsADirectory);if(n==null)throw gs("file not found",ot.FileNotFound);if(!i.overwrite)throw gs("file exists already",ot.FileExists);await n.write(t)}async rename(){throw gs("Not allowed",ot.NoPermissions)}mkdirSync(e){if(this._lookup(e,!0)!=null)throw gs("file exists already",ot.FileExists);const t=vi(e),i=Ro(e),n=this._lookupAsDirectory(i,!1),r=new P4,o=new Z;return o.add(r.onDidDelete(()=>{o.dispose(),this._fireSoon({resource:e,type:2})})),o.add(r.onDidChange(()=>{this._fireSoon({resource:e,type:0})})),n.addChild(t,r),this._fireSoon({type:1,resource:e}),r}async mkdir(){throw gs("Can' create a directory",ot.NoPermissions)}deleteSync(e){const t=this._lookup(e,!0);if(t==null)throw gs("Not found",ot.FileNotFound);if(t.type===rn.Directory)throw gs("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 K5e(s){return s.status==="fulfilled"}class znt{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((r,o)=>o.priority-r.priority);const n=new Z;return n.add(t.onDidChangeFile(r=>{this._onDidChangeFile.fire(r)})),n.add({dispose:()=>{const r=this.providers.indexOf(i);r>=0&&(this.providers.splice(r,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 gs("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(r){if(i??(i=r),r instanceof LA&&[ot.NoPermissions,ot.FileNotFound,ot.Unavailable].includes(r.code))continue;throw r}}throw i}async writeToDelegates(e){if(this.delegates.length===0)throw gs("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 LA&&[ot.NoPermissions,ot.FileNotFound,ot.Unavailable].includes(i.code))continue;throw i}throw gs("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?up.Readonly:void 0)}})}async readFile(e){return this.readFromDelegates(t=>t.readFile(e))}readFileStream(e,t,i){const n=eE(r=>Ge.concat(r.map(o=>Ge.wrap(o))).buffer);return this.readFromDelegates(async r=>{if(qq(r)){const o=r.readFileStream(e,t,i);await new Promise((a,c)=>{let l=!1;NN(o,{onData(d){l=!0,n.write(d)},onEnd(){n.end(),a()},onError(d){l?n.error(d):c(d)}},i)})}else{let o=await this.readFile(e);return(typeof t.position=="number"||typeof t.length=="number")&&(o=o.slice(t.position??0,t.length)),n.end(o)}},i).catch(r=>{n.error(r)}),n}async readdir(e){const t=await Promise.allSettled(this.delegates.map(async i=>i.readdir(e)));if(!t.some(K5e))throw t[0].reason;return Object.entries(Object.fromEntries(t.filter(K5e).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 r;try{r=await n.stat(e)}catch{}if(r!=null&&((r.permissions??0)&up.Readonly)>0)throw gs("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 Z3t extends wee{async writeFile(e,t,i){return await Wnt(Dn,this,Dn.dirname(e)),super.writeFile(e,t,i)}}const $nt=new znt;$nt.register(0,new Z3t);const e9t=new Vnt(!0),Gnt=new wee;Gnt.mkdir(N.from({scheme:pe.vscodeUserData,path:"/User/"}));var Aee;(function(s){s.extensionFile="extension-file"})(Aee||(Aee={}));const Knt={[Aee.extensionFile]:e9t,[Lit.scheme]:new wee,[pe.vscodeUserData]:Gnt,[pe.tmp]:new wee,[pe.file]:$nt};let LAe=class extends yAe{constructor(e,t){super(e);for(const[i,n]of Object.entries(Knt)){let r=this.registerProvider(i,n);n instanceof znt&&n.onDidChangeOverlays(()=>{r.dispose(),r=this.registerProvider(i,n)}),n instanceof D3t&&this._register(n.onReportError(o=>t.publicLog2("indexedDBFileSystemProviderError",o)))}}};LAe=D([_(1,Ji)],LAe);const qnt=new k3t;VNe(async s=>{qnt.logger=s.get(Ke)});function Xce(){return{[Xt.toString()]:new yi(LAe,[qnt],!0),[Fr.toString()]:new yi(kAe,[],!0),[bd.toString()]:new yi(TAe,[],!0),[Q6.toString()]:new yi(Q3t,[],!0)}}function t9t(s,e){Uit(),Knt[s]=e}function i9t(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);Xy(n)&&t.push(n.then(r=>{r&&(i=!0)},r=>{e(r),i=!0}))}return er.settled(t).then(()=>i)}var eH;(function(s){s[s.WebSocket=0]="WebSocket",s[s.Managed=1]="Managed"})(eH||(eH={}));class Qnt{constructor(e){this.id=e,this.type=eH.Managed}toString(){return`Managed(${this.id})`}}class jnt{constructor(e,t){this.host=e,this.port=t,this.type=eH.WebSocket}toString(){return`WebSocket(${this.host}:${this.port})`}}var id;(function(s){s.Unknown="Unknown",s.NotAvailable="NotAvailable",s.TemporarilyNotAvailable="TemporarilyNotAvailable",s.NoResolverFound="NoResolverFound",s.InvalidAuthority="InvalidAuthority"})(id||(id={}));let wD=class k0 extends Ma{static isNotAvailable(e){return e instanceof k0&&e._code===id.NotAvailable}static isTemporarilyNotAvailable(e){return e instanceof k0&&e._code===id.TemporarilyNotAvailable}static isNoResolverFound(e){return e instanceof k0&&e._code===id.NoResolverFound}static isInvalidAuthority(e){return e instanceof k0&&e._code===id.InvalidAuthority}static isHandled(e){return e instanceof k0&&e.isHandled}constructor(e,t=id.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,this.isHandled=t===id.NotAvailable&&i===!0,Object.setPrototypeOf(this,k0.prototype)}};function Eee(s){const e=s.indexOf("+");return e===-1?s:s.substring(0,e)}class n9t{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}}class yD{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(l9t),this._extensionsMap=new ba,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=q5e(this._extensionDescriptions,t),this._extensionDescriptions=this._extensionDescriptions.concat(e);const i=yD._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=q5e(this._extensionDescriptions,i.map(n=>n.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new n9t(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 r=t.getNodes().filter(a=>!n.has(a));let o;do{o=!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 s9t(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 s9t{constructor(e,t){this.versionId=e,this.extensions=t}}class r9t{constructor(e){this._lock=new c9t,this._actual=new yD(e,[])}async acquireLock(e){const t=await this._lock.acquire(e);return new o9t(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 o9t extends V{constructor(e,t){super(),this._registry=e,this._isDisposed=!1,this._register(t)}isAcquiredFor(e){return!this._isDisposed&&this._registry===e}}class a9t{constructor(e){this.name=e;const t=H2();this.promise=t.promise,this._resolve=t.resolve}resolve(e){this._resolve(e)}}class c9t{constructor(){this._pendingCustomers=[],this._isLocked=!1}async acquire(e){const t=new a9t(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 UE;(function(s){s[s.Builtin=0]="Builtin",s[s.User=1]="User",s[s.Dev=2]="Dev"})(UE||(UE={}));function l9t(s,e){const t=s.isBuiltin?UE.Builtin:s.isUnderDevelopment?UE.Dev:UE.User,i=e.isBuiltin?UE.Builtin:e.isUnderDevelopment?UE.Dev:UE.User;if(t!==i)return t-i;const n=zi.basename(s.extensionLocation.path),r=zi.basename(e.extensionLocation.path);return nr?1:0}function q5e(s,e){const t=new D_(e);return s.filter(i=>!t.has(i.identifier))}function lPe(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",r=t&&!!s.debugExtensionHost.break,o=e&&!!s.extensionTestsLocationURI&&!s.debugExtensionHost.debugId;return{isExtensionDevHost:e,isExtensionDevDebug:n,isExtensionDevDebugBrk:r,isExtensionDevTestFromCli:o}}var dr;(function(s){s[s.LocalProcess=1]="LocalProcess",s[s.LocalWebWorker=2]="LocalWebWorker",s[s.Remote=3]="Remote"})(dr||(dr={}));function bS(s){if(s===null)return"None";switch(s){case dr.LocalProcess:return"LocalProcess";case dr.LocalWebWorker:return"LocalWebWorker";case dr.Remote:return"Remote"}}var Jg;(function(s){s[s.None=0]="None",s[s.Local=1]="Local",s[s.Remote=2]="Remote"})(Jg||(Jg={}));function d9t(s){switch(s){case Jg.None:return"None";case Jg.Local:return"Local";case Jg.Remote:return"Remote"}}function h9t(s,e,t,i){const n=Q5e(s,t),r=Q5e(e,t),o=new Map,a=l=>{if(o.has(l.key))return;const d=n.get(l.key)||null,h=r.get(l.key)||null,u=new g9t(d,h);o.set(u.key,u)};n.forEach(l=>a(l)),r.forEach(l=>a(l));const c=new Map;return o.forEach(l=>{const d=!!l.local,h=!!l.remote,u=!!(l.local&&l.local.isUnderDevelopment),f=!!(l.remote&&l.remote.isUnderDevelopment);let p=Jg.None;u&&!f?p=Jg.Local:f&&!u&&(p=Jg.Remote),c.set(l.key,i(l.identifier,l.kind,d,h,p))}),c}function Q5e(s,e){const t=new Map;return s.forEach(i=>{const n=new u9t(i,e(i));t.set(n.key,n)}),t}class u9t{constructor(e,t){this.desc=e,this.kind=t}get key(){return An.toKey(this.desc.identifier)}get isUnderDevelopment(){return this.desc.isUnderDevelopment}}class g9t{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 Ki(s){return function(e){tH.INSTANCE.registerNamedCustomer(s,e)}}function eP(s){tH.INSTANCE.registerCustomer(s)}var xee;(function(s){function e(){return tH.INSTANCE.getNamedCustomers()}s.getNamedCustomers=e;function t(){return tH.INSTANCE.getCustomers()}s.getCustomers=t})(xee||(xee={}));const aoe=class aoe{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}};aoe.INSTANCE=new aoe;let tH=aoe;function Ynt(s,e,t,i){if(!s||i>200)return null;if(typeof s=="object"){if(s.$mid===ys.Uri)return t?N.revive(e.transformIncoming(s)):e.transformIncoming(s);if(s instanceof Ge)return null;for(const n in s)if(Object.hasOwnProperty.call(s,n)){const r=Ynt(s[n],e,t,i+1);r!==null&&(s[n]=r)}}return null}function F4(s,e){const t=Ynt(s,e,!1,0);return t===null?s:t}class Jnt{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 f9t extends Jnt{constructor(){super(),this._hasErr=!0,this._err=new Pa}}const coe=class coe{constructor(e){this._proxyIdentifierBrand=void 0,this.sid=e,this.nid=++coe.count}};coe.count=0;let Dee=coe;const Xnt=[];function Ye(s){const e=new Dee(s);return Xnt[e.nid]=e,e}function KK(s){return Xnt[s].sid}class Jd{constructor(e){this.value=e}}var j5e;function RAe(s,e){try{return JSON.stringify(s,e)}catch{return"null"}}const dPe="$$ref$$",p9t={[dPe]:-1};function Y5e(s,e=null,t=!1){const i=[];return{jsonString:(t?RAe:JSON.stringify)(s,(r,o)=>{if(typeof o>"u")return p9t;if(typeof o=="object"){if(o instanceof Ge){const a=i.push(o)-1;return{[dPe]:a}}if(e)return e(r,o)}return o}),referencedBuffers:i}}function Znt(s,e,t){return JSON.parse(s,(i,n)=>{if(n){const r=n[dPe];if(typeof r=="number")return e[r];if(t&&n.$mid===ys.Uri)return t.transformIncoming(n)}return n})}function J5e(s,e){return JSON.stringify(s,e)}function m9t(s){return s?(e,t)=>t&&t.$mid===ys.Uri?s.transformOutgoing(t):t:null}var Pg;(function(s){s[s.LocalSide=0]="LocalSide",s[s.OtherSide=1]="OtherSide"})(Pg||(Pg={}));var zT;(function(s){s[s.Responsive=0]="Responsive",s[s.Unresponsive=1]="Unresponsive"})(zT||(zT={}));const _9t=()=>{},v9t=Symbol.for("rpcProtocol"),b9t=Symbol.for("rpcProxy"),o8=class o8 extends V{constructor(e,t=null,i=null){super(),this[j5e]=!0,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._protocol=e,this._logger=t,this._uriTransformer=i,this._uriReplacer=m9t(this._uriTransformer),this._isDisposed=!1,this._locals=[],this._proxies=[];for(let n=0,r=Dee.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(Ty())}),super.dispose()}drain(){return typeof this._protocol.drain=="function"?this._protocol.drain():Promise.resolve()}_onWillSendRequest(e){this._unacknowledgedCount===0&&(this._unresponsiveTime=Date.now()+o8.UNRESPONSIVE_TIME),this._unacknowledgedCount++,this._asyncCheckUresponsive.isScheduled()||this._asyncCheckUresponsive.schedule()}_onDidReceiveAcknowledge(e){this._unresponsiveTime=Date.now()+o8.UNRESPONSIVE_TIME,this._unacknowledgedCount--,this._unacknowledgedCount===0&&this._asyncCheckUresponsive.cancel(),this._setResponsiveState(zT.Responsive)}_checkUnresponsive(){this._unacknowledgedCount!==0&&(Date.now()>this._unresponsiveTime?this._setResponsiveState(zT.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?F4(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,r)=>(typeof r=="string"&&!n[r]&&r.charCodeAt(0)===B.DollarSign&&(n[r]=(...o)=>this._remoteCall(e,r,o)),r===b9t?t:n[r])};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,r),l=_9t;this._cancelInvokedHandlers[a]=l;const d=kp.serializeAcknowledged(t);this._logger?.logOutgoing(d.byteLength,t,Pg.OtherSide,"ack"),this._protocol.send(d),c.then(h=>{delete this._cancelInvokedHandlers[a];const u=kp.serializeReplyOK(t,h,this._uriReplacer);this._logger?.logOutgoing(u.byteLength,t,Pg.OtherSide,"reply:",h),this._protocol.send(u)},h=>{delete this._cancelInvokedHandlers[a];const u=kp.serializeReplyErr(t,h);this._logger?.logOutgoing(u.byteLength,t,Pg.OtherSide,"replyErr:",h),this._protocol.send(u)})}_receiveCancel(e,t){this._logger?.logIncoming(e,t,Pg.OtherSide,"receiveCancel");const i=String(t);this._cancelInvokedHandlers[i]?.()}_receiveReply(e,t,i){this._logger?.logIncoming(e,t,Pg.LocalSide,"receiveReply:",i);const n=String(t);if(!this._pendingRPCReplies.hasOwnProperty(n))return;const r=this._pendingRPCReplies[n];delete this._pendingRPCReplies[n],r.resolveOk(i)}_receiveReplyErr(e,t,i){this._logger?.logIncoming(e,t,Pg.LocalSide,"receiveReplyErr:",i);const n=String(t);if(!this._pendingRPCReplies.hasOwnProperty(n))return;const r=this._pendingRPCReplies[n];delete this._pendingRPCReplies[n];let o;i&&(i.$isError?(o=new Error,o.name=i.name,o.message=i.message,o.stack=i.stack):o=i),r.resolveErr(o)}_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 "+KK(e));const r=n[t];if(typeof r!="function")throw new Error("Unknown method "+t+" on actor "+KK(e));return r.apply(n,i)}_remoteCall(e,t,i){if(this._isDisposed)return new f9t;let n=null;if(i.length>0&&Ue.isCancellationToken(i[i.length-1])&&(n=i.pop()),n&&n.isCancellationRequested)return Promise.reject(Ty());const r=kp.serializeRequestArguments(i,this._uriReplacer),o=++this._lastMessageId,a=String(o),c=new Jnt,l=new Z;n&&l.add(n.onCancellationRequested(()=>{const h=kp.serializeCancel(o);this._logger?.logOutgoing(h.byteLength,o,Pg.LocalSide,"cancel"),this._protocol.send(kp.serializeCancel(o))})),this._pendingRPCReplies[a]=new w9t(c,l),this._onWillSendRequest(o);const d=kp.serializeRequest(o,e,t,r,!!n);return this._logger?.logOutgoing(d.byteLength,o,Pg.LocalSide,`request: ${KK(e)}.${t}(`,i),this._protocol.send(d),c}};j5e=v9t,o8.UNRESPONSIVE_TIME=3*1e3;let kee=o8;class w9t{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 xk;let Lc=(xk=class{static alloc(e,t,i){const n=new xk(Ge.alloc(i+1+4),0);return n.writeUInt8(e),n.writeUInt32(t),n}static read(e,t){return new xk(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,r=e.length;n"u")i[n]={type:Cl.Undefined};else if(o instanceof Jd){const{jsonString:a,referencedBuffers:c}=Y5e(o.value,t);i[n]={type:Cl.SerializedObjectWithBuffers,value:Ge.fromString(a),buffers:c}}else i[n]={type:Cl.String,value:Ge.fromString(J5e(o,t))}}return{type:kF.Mixed,args:i}}return{type:kF.Simple,args:J5e(e,t)}}static serializeRequest(e,t,i,n,r){switch(n.type){case kF.Simple:return this._requestJSONArgs(e,t,i,n.args,r);case kF.Mixed:return this._requestMixedArgs(e,t,i,n.args,r)}}static _requestJSONArgs(e,t,i,n,r){const o=Ge.fromString(i),a=Ge.fromString(n);let c=0;c+=Lc.sizeUInt8(),c+=Lc.sizeShortString(o),c+=Lc.sizeLongString(a);const l=Lc.alloc(r?fa.RequestJSONArgsWithCancellation:fa.RequestJSONArgs,e,c);return l.writeUInt8(t),l.writeShortString(o),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,r){const o=Ge.fromString(i);let a=0;a+=Lc.sizeUInt8(),a+=Lc.sizeShortString(o),a+=Lc.sizeMixedArray(n);const c=Lc.alloc(r?fa.RequestMixedArgsWithCancellation:fa.RequestMixedArgs,e,a);return c.writeUInt8(t),c.writeShortString(o),c.writeMixedArray(n),c.buffer}static deserializeRequestMixedArgs(e){const t=e.readUInt8(),i=e.readShortString(),n=e.readMixedArray(),r=new Array(n.length);for(let o=0,a=n.length;o"u")return this._serializeReplyOKEmpty(e);if(t instanceof Ge)return this._serializeReplyOKVSBuffer(e,t);if(t instanceof Jd){const{jsonString:n,referencedBuffers:r}=Y5e(t.value,i,!0);return this._serializeReplyOKJSONWithBuffers(e,n,r)}else return this._serializeReplyOKJSON(e,RAe(t,i))}static _serializeReplyOKEmpty(e){return Lc.alloc(fa.ReplyOKEmpty,e,0).buffer}static _serializeReplyOKVSBuffer(e,t){let i=0;i+=Lc.sizeVSBuffer(t);const n=Lc.alloc(fa.ReplyOKVSBuffer,e,i);return n.writeVSBuffer(t),n.buffer}static deserializeReplyOKVSBuffer(e){return e.readVSBuffer()}static _serializeReplyOKJSON(e,t){const i=Ge.fromString(t);let n=0;n+=Lc.sizeLongString(i);const r=Lc.alloc(fa.ReplyOKJSON,e,n);return r.writeLongString(i),r.buffer}static _serializeReplyOKJSONWithBuffers(e,t,i){const n=Ge.fromString(t);let r=0;r+=Lc.sizeUInt32,r+=Lc.sizeLongString(n);for(const a of i)r+=Lc.sizeVSBuffer(a);const o=Lc.alloc(fa.ReplyOKJSONWithBuffers,e,r);o.writeUInt32(i.length),o.writeLongString(n);for(const a of i)o.writeBuffer(a);return o.buffer}static deserializeReplyOKJSON(e){const t=e.readLongString();return JSON.parse(t)}static deserializeReplyOKJSONWithBuffers(e,t){const i=e.readUInt32(),n=e.readLongString(),r=[];for(let o=0;o{this._hasStarted=!0;const d={time:Date.now(),action:"success",kind:bS(this.kind)};return this._telemetryService.publicLog2("extensionHostStartup",d),this._createExtensionHostCustomers(this.kind,l)},l=>{this._logService.error(`Error received from starting extension host (kind: ${bS(this.kind)})`),this._logService.error(l);const d={time:Date.now(),action:"error",kind:bS(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,Bb.Normal)),this._register(A9t({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,r=[];const o={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=>{r=l}},a=xee.getNamedCustomers();for(let l=0,d=a.length;l`[${bS(this._extensionHost.runningLocation.kind)}${this._extensionHost.runningLocation.affinity}][resolveAuthority(${Eee(e)},${t})][${i.elapsed()}ms] `,r=l=>this._logService.info(`${n()}${l}`),o=(l,d=void 0)=>this._logService.error(`${n()}${l}`,d);r("obtaining proxy...");const a=await this._proxy;if(!a)return o("no proxy"),{type:"error",error:{message:"Cannot resolve authority",code:id.Unknown,detail:void 0}};r("invoking...");const c=new l6;try{c.cancelAndSet(()=>r("waiting..."),1e3);const l=await a.resolveAuthority(e,t);return c.dispose(),l.type==="ok"?r(`returned ${l.value.authority.connectTo}`):o("returned an error",l.error),l}catch(l){return c.dispose(),o("returned an error",l),{type:"error",error:{message:l.message,code:id.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 r=this._extensionHost.extensions.set(e,t,i);return n.startExtensionHost(r)}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)}};Iee=oj=D([_(3,we),_(4,Xo),_(5,Ji),_(6,Ke)],Iee);function est(s,e){return e?`${bS(s)} pid: ${e}`:`${bS(s)}`}const y9t=[["#2977B1","#FC802D","#34A13A","#D3282F","#9366BA"],["#8B564C","#E177C0","#7F7F7F","#BBBE3D","#2EBECD"]];function X5e(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 C9t(s){return Array.isArray(s)?s.map(X5e):X5e(s)}class S9t{constructor(e){this._kind=e,this._totalIncoming=0,this._totalOutgoing=0}_log(e,t,i,n,r,o,a){a=C9t(a);const c=y9t[r],l=c[n%c.length];let d=[`%c[${bS(this._kind)}][${e}]%c[${String(t).padStart(7)}]%c[len: ${String(i).padStart(5)}]%c${String(n).padStart(5)} - ${o}`,"color: darkgreen","color: grey","color: grey",`color: ${l}`];/\($/.test(o)?(d=d.concat(a),d.push(")")):d.push(a),console.log.apply(console,d)}logIncoming(e,t,i,n,r){this._totalIncoming+=e,this._log("Ext → Win",this._totalIncoming,e,t,i,n,r)}logOutgoing(e,t,i,n,r){this._totalOutgoing+=e,this._log("Win → Ext",this._totalOutgoing,e,t,i,n,r)}}let Tee=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===Pg.LocalSide&&/^receiveReply(Err)?:/.test(n)){const r=this._pendingRequests.get(t)??"unknown_reply";this._pendingRequests.delete(t),this._telemetryService.publicLog2("extensionhost.incoming",{type:`${n} ${r}`,length:e})}i===Pg.OtherSide&&/^receiveRequest /.test(n)&&this._telemetryService.publicLog2("extensionhost.incoming",{type:`${n}`,length:e})}logOutgoing(e,t,i,n){i===Pg.LocalSide&&n.startsWith("request: ")&&(this._pendingRequests.set(t,n),this._telemetryService.publicLog2("extensionhost.outgoing",{type:n,length:e}))}};Tee=D([_(0,Ji)],Tee);const WV=[];function A9t(s){return WV.push(s),{dispose:()=>{for(let e=0;en.measure()));t.openEditor({resource:void 0,contents:i.map(aj._print).join(` `),options:{pinned:!0}})}static _print(e){return e?`${e.remoteAuthority?`Authority: ${e.remoteAuthority} `:""}Roundtrip latency: ${e.latency.toFixed(3)}ms @@ -883,13 +883,13 @@ Down: ${aj._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 Lee{constructor(e){this.affinity=e,this.kind=dr.LocalProcess}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalProcess":`LocalProcess${this.affinity}`}}class MAe{constructor(e){this.affinity=e,this.kind=dr.LocalWebWorker}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalWebWorker":`LocalWebWorker${this.affinity}`}}class Ree{constructor(){this.kind=dr.Remote,this.affinity=0}equals(e){return this.kind===e.kind}asString(){return"Remote"}}let NAe=class{get maxLocalProcessAffinity(){return this._maxLocalProcessAffinity}get maxLocalWebWorkerAffinity(){return this._maxLocalWebWorkerAffinity}constructor(e,t,i,n,r,o){this._registry=e,this._extensionHostKindPicker=t,this._environmentService=i,this._configurationService=n,this._logService=r,this._extensionManifestPropertiesService=o,this._runningLocation=new ba,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 cj(e,this._runningLocation,i=>t.equals(i))}filterByExtensionHostKind(e,t){return cj(e,this._runningLocation,i=>i.kind===t)}filterByExtensionHostManager(e,t){return cj(e,this._runningLocation,i=>t.representsRunningLocation(i))}_computeAffinity(e,t,i){const n=new ba;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 r=new ba;let o=0;for(const[h,u]of n)r.set(u.identifier,++o);const a=(h,u)=>{for(const[f,p]of r)p===h&&r.set(f,u)};for(const[h,u]of n){if(!u.extensionDependencies)continue;const f=r.get(u.identifier);for(const p of u.extensionDependencies){const m=r.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=r.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=r.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 ba;for(const h of e){const u=r.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 r=h9t(t,i,p=>this.readExtensionKinds(p),(p,m,v,b,w)=>this._extensionHostKindPicker.pickExtensionHostKind(p,m,v,b,w)),o=new ba;for(const p of t)o.set(p.identifier,p);for(const p of i)o.set(p.identifier,p);const a=new ba,c=[],l=[];for(const[p,m]of r){let v=null;if(m===dr.LocalProcess){const b=o.get(p);b&&c.push(b)}else if(m===dr.LocalWebWorker){const b=o.get(p);b&&l.push(b)}else m===dr.Remote&&(v=new Ree);a.set(p,v)}const{affinities:d,maxAffinity:h}=this._computeAffinity(c,dr.LocalProcess,n);for(const p of c){const m=d.get(p.identifier)||0;a.set(p.identifier,new Lee(m))}const{affinities:u,maxAffinity:f}=this._computeAffinity(l,dr.LocalWebWorker,n);for(const p of l){const m=u.get(p.identifier)||0;a.set(p.identifier,new MAe(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:r}=this._doComputeRunningLocation(this._runningLocation,e,t,!0);this._runningLocation=i,this._maxLocalProcessAffinity=n,this._maxLocalWebWorkerAffinity=r}deltaExtensions(e,t){const i=new ba;for(const n of t){const r=n;i.set(r,this._runningLocation.get(r)||null),this._runningLocation.delete(r)}return this._updateRunningLocationForAddedExtensions(e),i}_updateRunningLocationForAddedExtensions(e){const t=[],i=[];for(const o of e){const a=this.readExtensionKinds(o),c=o.extensionLocation.scheme===pe.vscodeRemote,l=this._extensionHostKindPicker.pickExtensionHostKind(o.identifier,a,!c,c,Jg.None);let d=null;l===dr.LocalProcess?t.push(o):l===dr.LocalWebWorker?i.push(o):l===dr.Remote&&(d=new Ree),this._runningLocation.set(o.identifier,d)}const{affinities:n}=this._computeAffinity(t,dr.LocalProcess,!1);for(const o of t){const a=n.get(o.identifier)||0;this._runningLocation.set(o.identifier,new Lee(a))}const{affinities:r}=this._computeAffinity(i,dr.LocalWebWorker,!1);for(const o of i){const a=r.get(o.identifier)||0;this._runningLocation.set(o.identifier,new MAe(a))}}};NAe=D([_(2,Xo),_(3,Te),_(4,Ke),_(5,Rm)],NAe);function cj(s,e,t){return s.filter(i=>{const n=e.get(i.identifier);return n&&t(n)})}function x9t(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 est(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 jd,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(Iee,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===Bb.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:id.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 r=this._createActual(`contains ${i.length} extension(s): ${i.map(o=>o.value)}.`).start(e,t,i);return this._startCalled.open(),r}this._lazyStartExtensions=new dQ(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,Ke)],PAe);var Mee;(function(s){s[s.Information=1]="Information",s[s.Warning=2]="Warning"})(Mee||(Mee={}));let hPe=class{constructor(e,t,i){this.uri=e,this.ranges=t,this.previewText=i}},uPe=class{constructor(e,t,i){this.uri=e,this.text=t,this.lineNumber=i}};var Fw;(function(s){s[s.none=1]="none",s[s.filesExclude=2]="filesExclude",s[s.searchAndFilesExclude=3]="searchAndFilesExclude"})(Fw||(Fw={}));var Nee;(function(s){s[s.Information=1]="Information",s[s.Warning=2]="Warning"})(Nee||(Nee={}));function D9t(s){return"uri"in s&&"ranges"in s&&"preview"in s}function k9t(s){if(D9t(s)){const e=z_(s.ranges).map(t=>({sourceRange:t,previewRange:t}));return new hPe(s.uri,e,s.preview.text)}else return new uPe(s.uri,s.text,s.lineNumber)}const I9t=2e4,tst="⟪ ",ist=" characters skipped ⟫",T9t=(tst.length+ist.length+5)*2;var az;(function(s){s[s.file=0]="file",s[s.text=1]="text",s[s.aiText=2]="aiText"})(az||(az={}));var fI;(function(s){s[s.File=1]="File",s[s.Text=2]="Text",s[s.aiText=3]="aiText"})(fI||(fI={}));function L9t(s){return!!s.preview}var Z5e;(function(s){s[s.Normal=0]="Normal",s[s.NewSearchStarted=1]="NewSearchStarted"})(Z5e||(Z5e={}));class R9t{constructor(e,t,i,n){this.ranges=t,this.webviewIndex=n;const r=Array.isArray(t)?t:[t];if(i&&i.matchLines===1&&M9t(r)){e=Hct(e,i.matchLines);let o="",a=0,c=0;const l=Math.floor(i.charsPerLine/5),d=[];for(const h of r){const u=Math.max(h.startColumn-l,0),f=h.startColumn+i.charsPerLine;if(u>c+l+T9t){const p=tst+(u-c)+ist;o+=p+e.slice(u,f),a+=u-(c+p.length)}else o+=e.slice(c,f);d.push(new N9t(0,h.startColumn-a,h.endColumn-a)),c=f}this.preview={text:o,matches:Array.isArray(this.ranges)?d:d[0]}}else{const o=Array.isArray(t)?t[0].startLineNumber:t.startLineNumber;this.preview={text:e,matches:h8(t,a=>new nst(a.startLineNumber-o,a.startColumn,a.endLineNumber-o,a.endColumn))}}}}function M9t(s){const e=s[0].startLineNumber;for(const t of s)if(t.startLineNumber!==e||t.endLineNumber!==e)return!1;return!0}class nst{constructor(e,t,i,n){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n}}class N9t extends nst{constructor(e,t,i){super(e,t,e,i)}}var eze;(function(s){s.List="list",s.Tree="tree"})(eze||(eze={}));var tze;(function(s){s.Default="default",s.FileNames="fileNames",s.Type="type",s.Modified="modified",s.CountDescending="countDescending",s.CountAscending="countAscending"})(tze||(tze={}));function P9t(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=mp(n,Ds(t)),n=mp(n,Ds(i),!0),n}function ize(s,e){return s.excludePattern&&jO(s.excludePattern,e)?!1:s.includePattern||s.usingSearchPaths?s.includePattern&&jO(s.includePattern,e)?!0:s.usingSearchPaths?!!s.folderQueries&&s.folderQueries.some(t=>{const i=t.folder.fsPath;if(Xj(e,i)){const n=P2(i,e);return!t.includePattern||!!jO(t.includePattern,n)}else return!1}):!1:!0}var nze;(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"})(nze||(nze={}));function Pee(s,e){const t={...s||{},...e||{}};return Object.keys(t).filter(i=>{const n=t[i];return typeof n=="boolean"&&n})}class sst{constructor(e,t){this._parsedIncludeExpression=null,this._excludeExpression={...e.excludePattern||{},...t.excludePattern||{}},this._parsedExcludeExpression=X_(this._excludeExpression);let i=e.includePattern;t.includePattern&&(i?i={...i,...t.includePattern}:i=t.includePattern),i&&(this._parsedIncludeExpression=X_(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),r=()=>this._parsedIncludeExpression?!!this._parsedIncludeExpression(e,t,i):!0;return Xy(n)?n.then(o=>o?!1:r()):r()}hasSiblingExcludeClauses(){return F9t(this._excludeExpression)}}function F9t(s){for(const e in s)if(typeof s[e]!="boolean")return!0;return!1}function O9t(s){if(!s)return;let e;return t=>(e||(e=(s()||Promise.resolve([])).then(i=>i?rst(i):{})),e.then(i=>!!i[t]))}function B9t(s){if(!s)return;let e;return t=>{if(!e){const i=s();e=i?rst(i):{}}return!!e[t]}}function rst(s){const e={};for(const t of s)e[t]=!0;return e}let Fee=class{constructor(e,t,i,n,r){this.configurationService=e,this.workspaceContextService=t,this.editorGroupsService=i,this.logService=n,this.pathService=r}text(e,t,i={}){e=this.getContentPattern(e,i);const n=this.configurationService.getValue(),r=t&&t.some(a=>!this.configurationService.getValue({resource:a}).search.useRipgrep);return{...this.commonQuery(t?.map(rJ),i),type:fI.Text,contentPattern:e,previewOptions:i.previewOptions,maxFileSize:i.maxFileSize,usePCRE2:n.search.usePCRE2||r||!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:fI.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(lj):lj(e),t?this.parseSearchPaths(e):{pattern:zue(...Array.isArray(e)?e:[e])}):{}}commonQuery(e=[],t={}){const i=this.handleIncludeExclude(t.includePattern,t.expandPatterns),n=this.handleIncludeExclude(t.excludePattern,t.expandPatterns),r=e.length>1,o=(i.searchPaths&&i.searchPaths.length?i.searchPaths.map(l=>this.getFolderQueryForSearchPath(l,t,n)):e.map(l=>this.getFolderQueryForRoot(l,t,n,r))).filter(l=>!!l),a={_reason:t._reason,folderQueries:o,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=Oi(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=>ize(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=>ize(a,l.fsPath));return a.extraFileResources=c&&c.length?c:void 0,a}commonQueryFromFileList(e){const t=[],i=new gi,n={};let r=!1;return e.forEach(o=>{if(o.scheme===pe.walkThrough)return;if(jKe(o)){const c=this.workspaceContextService.getWorkspaceFolder(o)?.uri??o.with({path:xb(o.fsPath)});let l=i.get(c);l||(r=!0,l={folder:c,includePattern:{}},t.push(l),i.set(c,l));const d=P2(c.fsPath,o.fsPath);Qn(l.includePattern)[d.replace(/\\/g,"/")]=!0}else o.fsPath&&(r=!0,n[o.fsPath]=!0)}),{folderQueries:t,includePattern:n,usingSearchPaths:!0,excludePattern:r?void 0:{"**/*":!0}}}isCaseSensitive(e,t){if(t.isSmartCase){if(e.isRegExp){if(yfe(e.pattern,!0))return!0}else if(yfe(e.pattern))return!0}return!!e.isCaseSensitive}isMultiline(e){return e.isMultiline||e.isRegExp&&eQe(e.pattern)||e.pattern.indexOf(` `)>=0?!0:!!e.isMultiline}parseSearchPaths(e){const t=h=>yM(h)||/^\.\.?([\/\\]|$)/.test(h),n=(Array.isArray(e)?e:H9t(e)).map(h=>{const u=this.pathService.resolvedUserHome;return u?tPt(h,u.scheme===pe.file?u.fsPath:u.path):h}),r=nKe(n,h=>t(h)?"searchPaths":"exprSegments"),o=(r.exprSegments||[]).map(h=>qy(h,"/")).map(h=>qy(h,"\\")).map(h=>(h[0]==="."&&(h="*"+h),U9t(h))),a={},c=this.expandSearchPathPatterns(r.searchPaths||[]);c&&c.length&&(a.searchPaths=c);const l=o.flat(),d=zue(...l);return d&&(a.pattern=d),a}getExcludesForFolder(e,t){return t.disregardExcludeSettings?void 0:P9t(e,!t.disregardSearchExcludeSettings)}expandSearchPathPatterns(e){if(!e||!e.length)return[];const t=e.flatMap(n=>{let{pathPortion:r,globPortion:o}=W9t(n);return o&&(o=$ue(o)),this.expandOneSearchPath(r).flatMap(c=>this.resolveOneSearchPathPattern(c,o))}),i=new Map;return t.forEach(n=>{const r=n.searchPath.toString(),o=i.get(r);o?n.pattern&&(o.pattern=o.pattern||{},o.pattern[n.pattern]=!0):i.set(r,{searchPath:n.searchPath,pattern:n.pattern?zue(n.pattern):void 0})}),Array.from(i.values())}expandOneSearchPath(e){if(yM(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(Bk(e))}]}if(this.workspaceContextService.getWorkbenchState()===Qi.FOLDER){const t=this.workspaceContextService.getWorkspace().folders[0].uri;if(e=lj(e),e.startsWith("../")||e===".."){const n=zi.resolve(t.path,e);return[{searchPath:t.with({path:n})}]}const i=$ue(e);return[{searchPath:t,pattern:i}]}else{if(e==="./"||e===".\\")return[];{const t=e.replace(/^\.[\/\\]/,""),n=this.workspaceContextService.getWorkspace().folders.map(r=>{const o=t.match(new RegExp(`^${Nh(r.name)}(?:/(.*)|$)`));return o?{match:o,folder:r}:null}).filter(Oc);if(n.length)return n.map(r=>{const o=r.match[1];return{searchPath:r.folder.uri,pattern:o&&$ue(o)}});{const r=e.match(/\.[\/\\](.+)[\/\\]?/),o=r?r[1]:e,a=g(4397,"Workspace folder does not exist: {0}",o);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(rJ(e.searchPath),t,i,!1);return n?{...n,includePattern:e.pattern}:null}getFolderQueryForRoot(e,t,i,n){let r;const o=N.isUri(e)?e:e.uri;if(i.searchPaths){const h=i.searchPaths.filter(u=>Yi(u.searchPath,o))[0];if(h&&!h.pattern)return null;h&&(r=h.pattern)}const a=this.configurationService.getValue({resource:o}),l={...this.getExcludesForFolder(a,t)||{},...r||{}},d=N.isUri(e)?vi(e):e.name;return{folder:o,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}}};Fee=D([_(0,Te),_(1,Ci),_(2,Pr),_(3,Ke),_(4,Cf)],Fee);function W9t(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 zue(...s){return s.length?s.reduce((e,t)=>(e[t]=!0,e),Object.create(null)):void 0}function H9t(s){return t_e(s,",").map(e=>e.trim()).filter(e=>!!e.length)}function U9t(s){return[`**/${s}/**`,`**/${s}`].map(t=>t.replace(/\*\*\/\*\*/g,"**"))}function lj(s){return s.replace(/\\/g,"/")}function $ue(s){return lj(s).replace(/^\.\//,"").replace(/\/+$/g,"")}const V9t=7e3;function ost(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:r,resolve:o}=H2(),a=d=>o({activationEvent:d}),c=Promise.all(i.map(d=>z9t(s,d,a))).then(()=>{}),l=$9t(s,e.identifier,n,a);return Promise.all([c,l]).then(()=>{o(void 0)}),r}async function z9t(s,e,t){for(const i of s.folders)if(await s.exists(Ft(N.revive(i),e))){t(`workspaceContains:${e}`);return}}async function $9t(s,e,t,i){if(t.length===0)return Promise.resolve(void 0);const n=new li,r=s.checkExists(s.folders,t,n.token),o=setTimeout(async()=>{n.cancel(),s.logService.info(`Not activating extension '${e.value}': Timed out while searching for 'workspaceContains' pattern ${t.join(",")}`)},V9t);let a=!1;try{a=await r}catch(c){Oo(c)||bt(c)}n.dispose(),clearTimeout(o),a&&i(`workspaceContains:${t.join(",")}`)}function ast(s,e,t,i){const n=s.get(we),r=s.get(bce),a=n.createInstance(Fee).file(e.map(c=>rJ(N.revive(c))),{_reason:"checkExists",includePattern:t,exists:!0});return r.fileSearch(a,i).then(c=>!!c.limitHit,c=>Oo(c)?!1:Promise.reject(c))}var FAe;const Gue=Object.hasOwnProperty,G9t=Promise.resolve(void 0);let OAe=FAe=class extends V{constructor(e,t,i,n,r,o,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=r,this._environmentService=o,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 X9t,this._registry=new r9t(this._activationEventReader),this._installedExtensionsReady=new jd,this._extensionStatus=new ba,this._allRequestedActivateEvents=new Set,this._remoteCrashTracker=new WAe,this._deltaExtensionsQueue=[],this._inHandleDeltaExtensions=!1,this._extensionHostManagers=this._register(new K9t),this._resolveAuthorityAttempt=0,this._register(this._fileService.onWillActivateFileSystemProvider(A=>{A.scheme!==pe.vscodeRemote&&A.join(this.activateByEvent(`onFileSystem:${A.scheme}`))})),this._runningLocations=new NAe(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);Uh&&this._logService.info(`AbstractExtensionService.onEnablementChanged fired for ${A.map(P=>P.identifier.id).join(", ")}`),this._handleDeltaExtensions(new I0(L,k))})),this._register(this._extensionManagementService.onDidChangeProfile(({added:A,removed:L})=>{(A.length||L.length)&&(Uh&&this._logService.info("AbstractExtensionService.onDidChangeProfile fired"),this._handleDeltaExtensions(new I0(A,L)))})),this._register(this._extensionManagementService.onDidEnableExtensions(A=>{A.length&&(Uh&&this._logService.info("AbstractExtensionService.onDidEnableExtensions fired"),this._handleDeltaExtensions(new I0(A,[])))})),this._register(this._extensionManagementService.onDidInstallExtensions(A=>{const L=[];for(const{local:k,operation:P}of A)k&&k.isValid&&P!==FA.Migrate&&this._safeInvokeIsEnabled(k)&&L.push(k);L.length&&(Uh&&this._logService.info(`AbstractExtensionService.onDidInstallExtensions fired for ${L.map(k=>k.identifier.id).join(", ")}`),this._handleDeltaExtensions(new I0(L,[])))})),this._register(this._extensionManagementService.onDidUninstallExtension(A=>{A.error||(Uh&&this._logService.info(`AbstractExtensionService.onDidUninstallExtension fired for ${A.identifier.id}`),this._handleDeltaExtensions(new I0([],[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:Zve.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){Uh&&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:r,removed:n}),n=n.concat(o.removedDueToLooping),o.removedDueToLooping.length>0&&this._notificationService.notify({severity:Ze.Error,message:g(1127,"The following extensions contain dependency loops and have been disabled: {0}",o.removedDueToLooping.map(a=>`'${a.identifier.value}'`).join(", "))}),this._extensionsProposedApi.updateEnabledApiProposals(r),this._doHandleExtensionPoints([].concat(r).concat(n)),await this._updateExtensionsOnExtHosts(o.versionId,r,n.map(a=>a.identifier));for(let a=0;athis._updateExtensionsOnExtHost(o,e,t,i,n));await Promise.all(r)}async _updateExtensionsOnExtHost(e,t,i,n,r){const o=this._runningLocations.filterByExtensionHostManager(i,e),a=x9t(n,r,l=>e.representsRunningLocation(l)),c=nB.createActivationEventsMap(i);if(Uh){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(o)}],`)}await e.deltaExtensions({versionId:t,toRemove:n,toAdd:i,addActivationEvents:c,myToRemove:a,myToAdd:o.map(l=>l.identifier)})}canAddExtension(e){return this._canAddExtension(e,[])}_canAddExtension(e,t){if(this._registry.getExtensionDescriptionByIdOrUUID(e.identifier,e.id)&&!t.some(c=>An.equals(e.identifier,c.identifier)))return!1;const n=this._runningLocations.readExtensionKinds(e),r=e.extensionLocation.scheme===pe.vscodeRemote;return this._extensionHostKindPicker.pickExtensionHostKind(e.identifier,n,!r,r,Jg.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 r=this._activationEventReader.readActivationEvents(e);for(const o of r){if(this._allRequestedActivateEvents.has(o)){t=!0,i=o;break}if(o==="*"){t=!0,i=o;break}if(/^workspaceContains/.test(o)&&(n=!0),o==="onStartupFinished"){t=!0,i=o;break}}if(t)await Promise.all(this._extensionHostManagers.map(o=>o.activate(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:i}))).then(()=>{});else if(n){const o=await this._contextService.getCompleteWorkspace(),a=!!this._environmentService.remoteAuthority,c={logService:this._logService,folders:o.folders.map(d=>d.uri),forceUsingSearch:a,exists:d=>this._fileService.exists(d),checkExists:(d,h,u)=>this._instantiationService.invokeFunction(f=>ast(f,d,h,u))},l=await ost(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(){ls("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!==OA.EagerAutoStart){const r=this._runningLocations.filterByExtensionHostManager(i.extensions,n);n.start(i.versionId,i.extensions,r.map(o=>o.identifier))}}finally{e.dispose()}this._releaseBarrier(),ls("code/didLoadExtensions"),await this._handleExtensionTests()}_processExtensions(e,t){const{allowRemoteExtensionsInLocalWebWorker:i,hasLocalProcess:n}=t,r=BAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.local,!1);let o=BAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.remote,!1);this._runningLocations.initializeRunningLocation(r,o),this._startExtensionHostsIfNecessary(!0,[]);const a=i?this._runningLocations.filterByExtensionHostKind(o,dr.LocalWebWorker):[],c=n?this._runningLocations.filterByExtensionHostKind(r,dr.LocalProcess):[],l=this._runningLocations.filterByExtensionHostKind(r,dr.LocalWebWorker);o=this._runningLocations.filterByExtensionHostKind(o,dr.Remote);for(const u of a)Y9t(l,u.identifier)||l.push(u);const d=o.concat(c).concat(l),h=this._registry.deltaExtensions(e,d,[]);h.removedDueToLooping.length>0&&this._notificationService.notify({severity:Ze.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(),Uh&&this._logService.info(`Extension host test runner exit code: ${t}`)}catch(i){Uh&&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(Jy(e,i.extensionLocation)){t=this._runningLocations.getRunningLocation(i.identifier);break}return t===null&&(e.scheme===pe.vscodeRemote?t=new Ree:t=new Lee(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(wD.isNoResolverFound(n)||wD.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=Eee(e),i=Ys.create(!1);this._logService.info(`Invoking resolveAuthority(${t})...`);try{ls(`code/willResolveAuthority/${t}`);const n=await this._resolveAuthority(e);return ls(`code/didResolveAuthorityOK/${t}`),this._logService.info(`resolveAuthority(${t}) returned '${n.authority.connectTo}' after ${i.elapsed()} ms`),n}catch(n){throw ls(`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(o=>o.resolveAuthority(t,this._resolveAuthorityAttempt)));let r=null;for(const o of n){if(o.type==="ok")return o.value;if(!r){r=o;continue}const a=r.error.code===id.Unknown,c=o.error.code===id.Unknown;a&&!c&&(r=o)}throw new wD(r.error.message,r.error.code,r.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(o,a){i.push(o),typeof o=="boolean"?o===!0&&n.add(a):o.then(c=>{c&&n.add(a)}).catch(c=>{n.add(g(1129,"{0} (Error: {1})",a,Po(c)))})}});const r=await i9t(i,o=>this._logService.error(o));if(!r)this._doStopExtensionHosts();else if(!t){const o=Array.from(n);this._logService.warn(`Extension host was not stopped because of veto (stop reason: ${e}, veto reason: ${o.join(", ")})`),await this._dialogService.warn(g(1130,"The following operation was blocked: {0}",e),o.length===1?g(1131,"The reason for blocking the operation: {0}",o[0]):g(1132,`The reasons for blocking the operation: - {0}`,o.join(` - -`)))}return!r}_startExtensionHostsIfNecessary(e,t){const i=[];for(let n=0;n<=this._runningLocations.maxLocalProcessAffinity;n++)i.push(new Lee(n));for(let n=0;n<=this._runningLocations.maxLocalWebWorkerAffinity;n++)i.push(new MAe(n));i.push(new Ree);for(const n of i){if(this._extensionHostManagers.getByRunningLocation(n))continue;const r=this._createExtensionHostManager(n,e,t);if(r){const[o,a]=r;this._extensionHostManagers.add(o,a)}}}_createExtensionHostManager(e,t,i){const n=this._extensionHostFactory.createExtensionHost(this._runningLocations,e,t);if(!n)return null;const r=this._doCreateExtensionHostManager(n,i),o=new Z;return o.add(r.onDidExit(([a,c])=>this._onExtensionHostCrashOrExit(r,a,c))),o.add(r.onDidChangeResponsiveState(a=>{this._logService.info(`Extension host (${r.friendyName}) is ${a===zT.Responsive?"responsive":"unresponsive"}.`),this._onDidChangeResponsiveChange.fire({extensionHostKind:r.kind,isResponsive:a===zT.Responsive,getInspectListener:c=>r.getInspectPort(c)})})),[r,o]}_doCreateExtensionHostManager(e,t){const i=this._acquireInternalAPI(e);return e.startup===OA.Lazy&&t.length===0?this._instantiationService.createInstance(PAe,e,i):this._instantiationService.createInstance(Iee,e,t,i)}_onExtensionHostCrashOrExit(e,t,i){if(!lPe(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===dr.LocalProcess?this._doStopExtensionHosts():e.kind===dr.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(r=>{clearTimeout(n),t(r)},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(Ze.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 I0(e.toAdd,e.toRemove));const t=await this._registry.acquireLock("startExtensionHosts");try{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()));const i=this._getExtensionHostManagers(dr.LocalProcess);await Promise.all(i.map(n=>n.ready()))}finally{t.dispose()}}activateByEvent(e,t=Bb.Normal){return this._installedExtensionsReady.isOpen()?(this._allRequestedActivateEvents.add(e),this._registry.containsActivationEvent(e)?this._activateByEvent(e,t):G9t):(this._allRequestedActivateEvents.add(e),t===Bb.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&&Gue.call(n.contributes,e.name)&&i.push(new rMt(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(Oc)}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 o of e)if(o.contributes)for(const a in o.contributes)Gue.call(o.contributes,a)&&(t[a]=!0);const i=o=>this._handleExtensionPointMessage(o),n=this._registry.getAllExtensionDescriptions(),r=ih.getExtensionPoints();ls("code/willHandleExtensionPoints");for(const o of r)t[o.name]&&(ls(`code/willHandleExtensionPoint/${o.name}`),FAe._handleExtensionPoint(o,n,i),ls(`code/didHandleExtensionPoint/${o.name}`));ls("code/didHandleExtensionPoints")}_getOrCreateExtensionStatus(e){return this._extensionStatus.has(e)||this._extensionStatus.set(e,new J9t(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===Ze.Error?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:Ze.Error,message:n}),this._logService.error(n)):e.type===Ze.Warning?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:Ze.Warning,message:n}),this._logService.warn(n)):this._logService.info(n),e.extensionId&&this._environmentService.isBuilt&&!this._environmentService.isExtensionDevelopment){const{type:r,extensionId:o,extensionPointId:a,message:c}=e;this._telemetryService.publicLog2("extensionsMessage",{type:r,extensionId:o.value,extensionPointId:a,message:c})}}static _handleExtensionPoint(e,t,i){const n=[];for(const r of t)r.contributes&&Gue.call(r.contributes,e.name)&&n.push({description:r,value:r.contributes[e.name],collector:new AMt(i,r,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,r,o)=>this._onDidActivateExtension(t,i,n,r,o),_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(r=>r.activate(e,t)))).some(r=>r))throw new Error(`Unknown extension ${e.value}`)}_onWillActivateExtension(e,t){this._runningLocations.set(e,t),this._getOrCreateExtensionStatus(e).onWillActivate()}_onDidActivateExtension(e,t,i,n,r){this._getOrCreateExtensionStatus(e).setActivationTimes(new sMt(t,i,n,r)),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])}};OAe=FAe=D([_(3,we),_(4,wi),_(5,Xo),_(6,Ji),_(7,Fl),_(8,Xt),_(9,xo),_(10,q6),_(11,Ci),_(12,Te),_(13,Rm),_(14,Ke),_(15,fg),_(16,sce),_(17,rg),_(18,bC),_(19,ir)],OAe);class K9t extends V{constructor(){super(...arguments),this._extensionHostManagers=[]}dispose(){this.disposeAllInReverse(),super.dispose()}add(e,t){this._extensionHostManagers.push(new q9t(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 q9t{constructor(e,t){this.extensionHost=e,this.disposableStore=t}dispose(){this.disposableStore.dispose(),this.extensionHost.dispose()}}class Q9t{constructor(e,t,i,n){this.local=e,this.remote=t,this.hasLocalProcess=i,this.allowRemoteExtensionsInLocalWebWorker=n}}class I0{constructor(e,t){this.toAdd=e,this.toRemove=t}}function BAe(s,e,t,i,n){return t.updateEnabledApiProposals(i),j9t(s,e,i,n)}function j9t(s,e,t,i){const n=[],r=[],o=[];for(const c of t)c.isUnderDevelopment?n.push(c):(r.push(c),o.push(Cce(c)));const a=e.getEnablementStates(o,i?{trusted:!0}:void 0);for(let c=0;c0&&this._recentCrashes[0].timestampthis._onExtensionHostCrashOrExit(r,a,c))),o.add(r.onDidChangeResponsiveState(a=>{this._logService.info(`Extension host (${r.friendyName}) is ${a===zT.Responsive?"responsive":"unresponsive"}.`),this._onDidChangeResponsiveChange.fire({extensionHostKind:r.kind,isResponsive:a===zT.Responsive,getInspectListener:c=>r.getInspectPort(c)})})),[r,o]}_doCreateExtensionHostManager(e,t){const i=this._acquireInternalAPI(e);return e.startup===OA.Lazy&&t.length===0?this._instantiationService.createInstance(PAe,e,i):this._instantiationService.createInstance(Iee,e,t,i)}_onExtensionHostCrashOrExit(e,t,i){if(!lPe(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===dr.LocalProcess?this._doStopExtensionHosts():e.kind===dr.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(r=>{clearTimeout(n),t(r)},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(Ze.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 I0(e.toAdd,e.toRemove));const t=await this._registry.acquireLock("startExtensionHosts");try{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()));const i=this._getExtensionHostManagers(dr.LocalProcess);await Promise.all(i.map(n=>n.ready()))}finally{t.dispose()}}activateByEvent(e,t=Bb.Normal){return this._installedExtensionsReady.isOpen()?(this._allRequestedActivateEvents.add(e),this._registry.containsActivationEvent(e)?this._activateByEvent(e,t):G9t):(this._allRequestedActivateEvents.add(e),t===Bb.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&&Gue.call(n.contributes,e.name)&&i.push(new rMt(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(Oc)}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 o of e)if(o.contributes)for(const a in o.contributes)Gue.call(o.contributes,a)&&(t[a]=!0);const i=o=>this._handleExtensionPointMessage(o),n=this._registry.getAllExtensionDescriptions(),r=ih.getExtensionPoints();ls("code/willHandleExtensionPoints");for(const o of r)t[o.name]&&(ls(`code/willHandleExtensionPoint/${o.name}`),FAe._handleExtensionPoint(o,n,i),ls(`code/didHandleExtensionPoint/${o.name}`));ls("code/didHandleExtensionPoints")}_getOrCreateExtensionStatus(e){return this._extensionStatus.has(e)||this._extensionStatus.set(e,new J9t(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===Ze.Error?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:Ze.Error,message:n}),this._logService.error(n)):e.type===Ze.Warning?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:Ze.Warning,message:n}),this._logService.warn(n)):this._logService.info(n),e.extensionId&&this._environmentService.isBuilt&&!this._environmentService.isExtensionDevelopment){const{type:r,extensionId:o,extensionPointId:a,message:c}=e;this._telemetryService.publicLog2("extensionsMessage",{type:r,extensionId:o.value,extensionPointId:a,message:c})}}static _handleExtensionPoint(e,t,i){const n=[];for(const r of t)r.contributes&&Gue.call(r.contributes,e.name)&&n.push({description:r,value:r.contributes[e.name],collector:new AMt(i,r,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,r,o)=>this._onDidActivateExtension(t,i,n,r,o),_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(r=>r.activate(e,t)))).some(r=>r))throw new Error(`Unknown extension ${e.value}`)}_onWillActivateExtension(e,t){this._runningLocations.set(e,t),this._getOrCreateExtensionStatus(e).onWillActivate()}_onDidActivateExtension(e,t,i,n,r){this._getOrCreateExtensionStatus(e).setActivationTimes(new sMt(t,i,n,r)),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])}};OAe=FAe=D([_(3,we),_(4,wi),_(5,Xo),_(6,Ji),_(7,Ol),_(8,Xt),_(9,xo),_(10,q6),_(11,Ci),_(12,Te),_(13,Rm),_(14,Ke),_(15,fg),_(16,sce),_(17,rg),_(18,bC),_(19,ir)],OAe);class K9t extends V{constructor(){super(...arguments),this._extensionHostManagers=[]}dispose(){this.disposeAllInReverse(),super.dispose()}add(e,t){this._extensionHostManagers.push(new q9t(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 q9t{constructor(e,t){this.extensionHost=e,this.disposableStore=t}dispose(){this.disposableStore.dispose(),this.extensionHost.dispose()}}class Q9t{constructor(e,t,i,n){this.local=e,this.remote=t,this.hasLocalProcess=i,this.allowRemoteExtensionsInLocalWebWorker=n}}class I0{constructor(e,t){this.toAdd=e,this.toRemove=t}}function BAe(s,e,t,i,n){return t.updateEnabledApiProposals(i),j9t(s,e,i,n)}function j9t(s,e,t,i){const n=[],r=[],o=[];for(const c of t)c.isUnderDevelopment?n.push(c):(r.push(c),o.push(Cce(c)));const a=e.getEnablementStates(o,i?{trusted:!0}:void 0);for(let c=0;c0&&this._recentCrashes[0].timestamp{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"activationEvents",label:g(1136,"Activation Events"),access:{canToggle:!1},renderer:new yi(Z9t)});var Up;(function(s){s[s.Open=1]="Open",s[s.OpenInNewWindow=2]="OpenInNewWindow",s[s.Cancel=3]="Cancel"})(Up||(Up={}));const e$t="security.workspace.trust.enabled",sze="security.workspace.trust.untrustedFiles",t$t="security.workspace.trust.emptyWindow",i$t="extensions.supportUntrustedWorkspaces",n$t="content.trust.model.key";class s$t{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 rze=class extends V{constructor(e,t){super(),this.configurationService=e,this.environmentService=t}isWorkspaceTrustEnabled(){return this.environmentService.disableWorkspaceTrust?!1:!!this.configurationService.getValue(e$t)}};rze=D([_(0,Te),_(1,Xo)],rze);let oze=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this.configurationService=e,this.remoteAuthorityResolverService=t,this.storageService=i,this.uriIdentityService=n,this.environmentService=r,this.workspaceService=o,this.workspaceTrustEnablementService=a,this.fileService=c,this.storageKey=n$t,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}=H2(),{promise:this._workspaceTrustInitializedPromise,resolve:this._workspaceTrustInitializedPromiseResolve}=H2(),this._storedTrustState=new o$t(Hn&&this.isEmptyWorkspace()?void 0:this.storageService),this._trustTransitionManager=this._register(new r$t),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 r=e.filter(a=>!!a.fileUri).map(a=>a.fileUri),o=await Promise.all(r.map(a=>this.getCanonicalUri(a)));this._canonicalStartupFiles.push(...o.filter(a=>this._canonicalStartupFiles.every(c=>!this.uriIdentityService.extUri.isEqual(a,c))))}const t=this.workspaceService.getWorkspace().folders.map(r=>r.uri),i=await Promise.all(t.map(r=>this.getCanonicalUri(r)));let n=this.workspaceService.getWorkspace().configuration;n&&__e(n,this.environmentService)&&(n=await this.getCanonicalUri(n)),this._canonicalWorkspace=new s$t(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,cn.MACHINE),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust()}getWorkspaceUris(){const e=this._canonicalWorkspace.folders.map(i=>i.uri),t=this._canonicalWorkspace.configuration;return t&&__e(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(t$t):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 r of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqualOrParent(e,r.uri)){const o=r.uri.fsPath;o.length>i&&(i=o.length,t=r.trusted,n=r.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(o=>this.uriIdentityService.extUri.isEqual(o.uri,n))||(this._trustStateInfo.uriTrustInfo.push({uri:n,trusted:!0}),i=!0)}else{const r=this._trustStateInfo.uriTrustInfo.length;this._trustStateInfo.uriTrustInfo=this._trustStateInfo.uriTrustInfo.filter(o=>!this.uriIdentityService.extUri.isEqual(o.uri,n)),r!==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?Wy(this.workspaceService.getWorkspace())&&e.folders.length===0:!1}isTrustedVirtualResource(e){return GCe(e)&&e.scheme!=="vscode-vfs"}isTrustedByRemote(e){return!this.environmentService.remoteAuthority||!this._remoteAuthority?!1:W2(fXe(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=JO(this._canonicalWorkspace);if(!B_(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=JO(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=JO(this._canonicalWorkspace);if(!B_(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 r=!1;for(const o of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqual(o.uri,n)){r=!0;break}r||this._trustStateInfo.uriTrustInfo.push({trusted:!0,uri:n})}await this.saveTrustInfo()}addWorkspaceTrustTransitionParticipant(e){return this._trustTransitionManager.addWorkspaceTrustTransitionParticipant(e)}};oze=D([_(0,Te),_(1,bC),_(2,Gi),_(3,Is),_(4,Xo),_(5,Ci),_(6,Oae),_(7,Xt)],oze);let aze=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(sze)}set untrustedFilesSetting(e){this.configurationService.updateValue(sze,e)}async completeOpenFilesTrustRequest(e,t){this._openFilesTrustRequestResolver&&(e===Up.Open&&(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles=!0),t&&(e===Up.Open&&(this.untrustedFilesSetting="open"),e===Up.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 Up.Open;if(this.untrustedFilesSetting!=="prompt"){if(this.untrustedFilesSetting==="newWindow")return Up.OpenInNewWindow;if(this.untrustedFilesSetting==="open")return Up.Open}if(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles)return Up.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()}};aze=D([_(0,Te),_(1,mC)],aze);class r$t extends V{constructor(){super(...arguments),this.participants=new ul}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 o$t{constructor(e){this._acceptsOutOfWorkspaceFilesKey="acceptsOutOfWorkspaceFiles",this._isEmptyWorkspaceTrustedKey="isEmptyWorkspaceTrusted",e?(this._memento=new dI("workspaceTrust",e),this._mementoObject=this._memento.getMemento(Ie.WORKSPACE,cn.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 HAe=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 ba;const r=t.inspect(i$t).userValue||{};for(const o of Object.keys(r))this._configuredExtensionWorkspaceTrustRequestMap.set(o,r[o]);if(this._productExtensionWorkspaceTrustRequestMap=new Map,e.extensionUntrustedWorkspaceSupport)for(const o of Object.keys(e.extensionUntrustedWorkspaceSupport))this._productExtensionWorkspaceTrustRequestMap.set(o,e.extensionUntrustedWorkspaceSupport[o])}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 r of i)r!=="-web"&&n.push(r);return i.includes("-web")&&!n.length&&(n.push("ui"),n.push("workspace")),Hn&&!i.includes("-web")&&!i.includes("web")&&t.includes("web")&&n.push("web"),n}return t}getUserConfiguredExtensionKind(e){if(this._configuredExtensionKindsMap===null){const i=new ba,n=this.configurationService.getValue("remote.extensionKind")||{};for(const r of Object.keys(n))i.set(r,n[r]);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(u8(n))return n;if(n){const r=n.supported;if(u8(r)||r==="limited")return r}return i?.default!==void 0?i.default:!0}deduceExtensionKind(e){if(e.main)return e.browser?Hn?["workspace","web"]:["workspace"]:["workspace"];if(e.browser)return["web"];let t=[..._1t];if((tr(e.extensionPack)||tr(e.extensionDependencies))&&(t=Hn?["workspace","web"]:["workspace"]),e.contributes)for(const i of Object.keys(e.contributes)){const n=this.getSupportedExtensionKindsForExtensionPoint(i);n.length&&(t=t.filter(r=>n.includes(r)))}return t.length||this.logService.warn("Cannot deduce extensionKind for extension",Mw(e.publisher,e.name)),t}getSupportedExtensionKindsForExtensionPoint(e){if(this._extensionPointExtensionKindsMap===null){const i=new Map;ih.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:Hn?["workspace","web"]:["workspace"]}getConfiguredExtensionKind(e){const t={id:Mw(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 ba;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=Mw(e.publisher,e.name);return this._productExtensionKindsMap.get(t)}getProductVirtualWorkspaceSupport(e){if(this._productVirtualWorkspaceSupportMap===null){const i=new ba;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=Mw(e.publisher,e.name);return this._productVirtualWorkspaceSupportMap.get(t)}getConfiguredVirtualWorkspaceSupport(e){if(this._configuredVirtualWorkspaceSupportMap===null){const i=new ba,n=this.configurationService.getValue("extensions.supportVirtualWorkspaces")||{};for(const r of Object.keys(n))n[r]!==void 0&&i.set(r,n[r]);this._configuredVirtualWorkspaceSupportMap=i}const t=Mw(e.publisher,e.name);return this._configuredVirtualWorkspaceSupportMap.get(t)}getConfiguredExtensionWorkspaceTrustRequest(e){const t=Mw(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=Mw(e.publisher,e.name);return this._productExtensionWorkspaceTrustRequestMap.get(t)}toArray(e){return Array.isArray(e)?e:e==="ui"?["ui","workspace"]:[e]}};HAe=D([_(0,xo),_(1,Te),_(2,Oae),_(3,Ke)],HAe);let UAe=class{constructor(e,t,i){if(this._logService=e,this._environmentService=t,this._envEnabledExtensions=new Set((t.extensionEnabledProposedApi??[]).map(n=>An.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,r]of Object.entries(i.extensionEnabledApiProposals)){const o=An.toKey(n),a=r.filter(c=>BM[c]?!0:(e.warn(`Via 'product.json#extensionEnabledApiProposals' extension '${o}' 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(o,a)}}updateEnabledApiProposals(e){for(const t of e)this.doUpdateEnabledApiProposals(t)}doUpdateEnabledApiProposals(e){const t=An.toKey(e.identifier);if(tr(e.enabledApiProposals)&&(e.enabledApiProposals=e.enabledApiProposals.filter(i=>{const n=!!BM[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),r=new Set(e.enabledApiProposals),o=new Set([...r].filter(a=>!n.has(a)));o.size>0&&(this._logService.error(`Extension '${t}' appears in product.json but enables LESS API proposals than the extension wants. package.json (LOSES): ${[...r].join(", ")} product.json (WINS): ${[...n].join(", ")}`),this._environmentService.isExtensionDevelopment&&(this._logService.error(`Proceeding with EXTRA proposals (${[...o].join(", ")}) because extension is in development mode. Still, this EXTENSION WILL BE BROKEN unless product.json is updated.`),i.push(...o))),e.enabledApiProposals=i;return}this._envEnablesProposedApiForAll||this._envEnabledExtensions.has(t)||!e.isBuiltin&&tr(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=[])}};UAe=D([_(0,Ke),_(1,Xo),_(2,xo)],UAe);class a$t 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 Nt;if(t.length)for(const n of t)i.appendMarkdown(`- \`${n}\` -`);return{data:i,dispose:()=>{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"enabledApiProposals",label:g(1137,"API Proposals"),access:{canToggle:!1},renderer:new yi(a$t)});async function c$t(s,e){const t=[];return await cst(s,t,e.logsHome,e.logsHome),t}async function cst(s,e,t,i){const n=await s.resolve(t);for(const{resource:r,isDirectory:o}of n.children||[])if(o)await cst(s,e,r,i);else{const a=(await s.readFile(r)).value.toString();if(a){const c=MN(i,r);c&&e.push({relativePath:c,contents:a})}}}var Wf;(function(s){s[s.Promise=100]="Promise",s[s.PromiseCancel=101]="PromiseCancel",s[s.EventListen=102]="EventListen",s[s.EventDispose=103]="EventDispose"})(Wf||(Wf={}));function cze(s){switch(s){case Wf.Promise:return"req";case Wf.PromiseCancel:return"cancel";case Wf.EventListen:return"subscribe";case Wf.EventDispose:return"unsubscribe"}}var Iu;(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"})(Iu||(Iu={}));function lze(s){switch(s){case Iu.Initialize:return"init";case Iu.PromiseSuccess:return"reply:";case Iu.PromiseError:case Iu.PromiseErrorObj:return"replyErr:";case Iu.EventFire:return"event:"}}var IF;(function(s){s[s.Uninitialized=0]="Uninitialized",s[s.Idle=1]="Idle"})(IF||(IF={}));function AP(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=Ge.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 d$t{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 h$t{constructor(){this.buffers=[]}get buffer(){return Ge.concat(this.buffers)}write(e){this.buffers.push(e)}}var Bu;(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"})(Bu||(Bu={}));function LE(s){const e=Ge.alloc(1);return e.writeUInt8(s,0),e}const JI={Undefined:LE(Bu.Undefined),String:LE(Bu.String),Buffer:LE(Bu.Buffer),VSBuffer:LE(Bu.VSBuffer),Array:LE(Bu.Array),Object:LE(Bu.Object),Uint:LE(Bu.Int)},u$t=typeof Buffer<"u";function VAe(s,e){if(typeof e>"u")s.write(JI.Undefined);else if(typeof e=="string"){const t=Ge.fromString(e);s.write(JI.String),EP(s,t.byteLength),s.write(t)}else if(u$t&&Buffer.isBuffer(e)){const t=Ge.wrap(e);s.write(JI.Buffer),EP(s,t.byteLength),s.write(t)}else if(e instanceof Ge)s.write(JI.VSBuffer),EP(s,e.byteLength),s.write(e);else if(Array.isArray(e)){s.write(JI.Array),EP(s,e.length);for(const t of e)VAe(s,t)}else if(typeof e=="number"&&(e|0)===e)s.write(JI.Uint),EP(s,e);else{const t=Ge.fromString(JSON.stringify(e));s.write(JI.Object),EP(s,t.byteLength),s.write(t)}}function zAe(s){switch(s.read(1).readUInt8(0)){case Bu.Undefined:return;case Bu.String:return s.read(AP(s)).toString();case Bu.Buffer:return s.read(AP(s)).buffer;case Bu.VSBuffer:return s.read(AP(s));case Bu.Array:{const t=AP(s),i=[];for(let n=0;nthis.onBuffer(i)),this.logger=t}getChannel(e){const t=this;return{call(i,n,r){return t.isDisposed?Promise.reject(new Na):t.requestPromise(e,i,n,r)},listen(i,n){return t.isDisposed?M.None:t.requestEvent(e,i,n)}}}requestPromise(e,t,i,n=Ue.None){const r=this.lastRequestId++,o=Wf.Promise,a={id:r,type:o,channelName:e,name:t,arg:i};if(n.isCancellationRequested)return Promise.reject(new Na);let c;return new Promise((d,h)=>{if(n.isCancellationRequested)return h(new Na);const u=()=>{const v=b=>{switch(b.type){case Iu.PromiseSuccess:this.handlers.delete(r),d(b.data);break;case Iu.PromiseError:{this.handlers.delete(r);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 Iu.PromiseErrorObj:this.handlers.delete(r),h(b.data);break}};this.handlers.set(r,v),this.sendRequest(a)};let f=null;this.state===IF.Idle?u():(f=Mo(v=>this.whenInitialized()),f.then(()=>{f=null,u()}));const p=()=>{f?(f.cancel(),f=null):this.sendRequest({id:r,type:Wf.PromiseCancel}),h(new Na)},m=n.onCancellationRequested(p);c=Yo(Ee(p),m),this.activeRequests.add(c)}).finally(()=>{c.dispose(),this.activeRequests.delete(c)})}requestEvent(e,t,i){const n=this.lastRequestId++,r=Wf.EventListen,o={id:n,type:r,channelName:e,name:t,arg:i};let a=null;const c=new I({onWillAddFirstListener:()=>{a=Mo(d=>this.whenInitialized()),a.then(()=>{a=null,this.activeRequests.add(c),this.sendRequest(o)})},onDidRemoveLastListener:()=>{a?(a.cancel(),a=null):(this.activeRequests.delete(c),this.sendRequest({id:n,type:Wf.EventDispose}))}}),l=d=>c.fire(d.data);return this.handlers.set(n,l),c.event}sendRequest(e){switch(e.type){case Wf.Promise:case Wf.EventListen:{const t=this.send([e.type,e.id,e.channelName,e.name],e.arg);this.logger?.logOutgoing(t,e.id,TF.LocalSide,`${cze(e.type)}: ${e.channelName}.${e.name}`,e.arg);return}case Wf.PromiseCancel:case Wf.EventDispose:{const t=this.send([e.type,e.id]);this.logger?.logOutgoing(t,e.id,TF.LocalSide,cze(e.type));return}}}send(e,t=void 0){const i=new h$t;return VAe(i,e),VAe(i,t),this.sendBuffer(i.buffer)}sendBuffer(e){try{return this.protocol.send(e),e.byteLength}catch{return 0}}onBuffer(e){const t=new d$t(e),i=zAe(t),n=zAe(t),r=i[0];switch(r){case Iu.Initialize:return this.logger?.logIncoming(e.byteLength,0,TF.LocalSide,lze(r)),this.onResponse({type:i[0]});case Iu.PromiseSuccess:case Iu.PromiseError:case Iu.EventFire:case Iu.PromiseErrorObj:return this.logger?.logIncoming(e.byteLength,i[1],TF.LocalSide,lze(r),n),this.onResponse({type:i[0],id:i[1],data:n})}}onResponse(e){if(e.type===Iu.Initialize){this.state=IF.Idle,this._onDidInitialize.fire();return}this.handlers.get(e.id)?.(e)}get onDidInitializePromise(){return M.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===IF.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),wt(this.activeRequests.values()),this.activeRequests.clear()}}dze.__decorator=D([ei],dze.prototype,"onDidInitializePromise",null);var $T;(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"})($T||($T={}));var $Ae;(function(s){s.enableDiagnostics=!1,s.records=[];const e=new WeakMap;let t=0;function i(r,o){if(!e.has(r)){const a=String(++t);e.set(r,a)}return e.get(r)}function n(r,o,a,c){if(!s.enableDiagnostics)return;const l=i(r);if(c instanceof Ge||c instanceof Uint8Array||c instanceof ArrayBuffer||ArrayBuffer.isView(c)){const d=Ge.alloc(c.byteLength);d.set(c),s.records.push({timestamp:Date.now(),id:l,label:o,type:a,buff:d})}else s.records.push({timestamp:Date.now(),id:l,label:o,type:a,data:c})}s.traceSocketEvent=n})($Ae||($Ae={}));var Oee;(function(s){s[s.NodeSocketCloseEvent=0]="NodeSocketCloseEvent",s[s.WebSocketCloseEvent=1]="WebSocketCloseEvent"})(Oee||(Oee={}));let Kue=null;function RE(){return Kue||(Kue=Ge.alloc(0)),Kue}class g$t{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 RE();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const o=this._chunks[0];return t&&(this._chunks.shift(),this._totalLength-=e),o}if(this._chunks[0].byteLength>e){const o=this._chunks[0].slice(0,e);return t&&(this._chunks[0]=this._chunks[0].slice(e),this._totalLength-=e),o}const i=Ge.alloc(e);let n=0,r=0;for(;e>0;){const o=this._chunks[r];if(o.byteLength>e){const a=o.slice(0,e);i.set(a,n),n+=e,t&&(this._chunks[r]=o.slice(e),this._totalLength-=e),e-=e}else i.set(o,n),n+=o.byteLength,t?(this._chunks.shift(),this._totalLength-=o.byteLength):r++,e-=o.byteLength}return i}}var zo;(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"})(zo||(zo={}));function lst(s){switch(s){case zo.None:return"None";case zo.Regular:return"Regular";case zo.Control:return"Control";case zo.Ack:return"Ack";case zo.Disconnect:return"Disconnect";case zo.ReplayRequest:return"ReplayRequest";case zo.Pause:return"PauseWriting";case zo.Resume:return"ResumeWriting";case zo.KeepAlive:return"KeepAlive"}}var Pf;(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"})(Pf||(Pf={}));class aw{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 hze extends V{constructor(e){super(),this._onMessage=this._register(new I),this.onMessage=this._onMessage.event,this._state={readHead:!0,readLen:Pf.HeaderLength,messageType:zo.None,id:0,ack:0},this._socket=e,this._isDisposed=!1,this._incomingData=new g$t,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($T.ProtocolHeaderRead,{messageType:lst(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,r=this._state.ack;if(this._state.readHead=!0,this._state.readLen=Pf.HeaderLength,this._state.messageType=zo.None,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent($T.ProtocolMessageRead,t),this._onMessage.fire(new aw(i,n,r,t)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}}class uze{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=Ge.alloc(Pf.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($T.ProtocolHeaderWrite,{messageType:lst(e.type),id:e.id,ack:e.ack,messageSize:e.data.byteLength}),this._socket.traceSocketEvent($T.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=Ge.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($T.ProtocolWrite,{byteLength:e.byteLength}),this._socket.write(e)}}class o1{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 f$t{constructor(e){this.data=e,this.next=null}}class p$t{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 f$t(e);if(!this._first){this._first=t,this._last=t;return}this._last.next=t,this._last=t}}const Np=class Np{static getInstance(){return Np._INSTANCE||(Np._INSTANCE=new Np),Np._INSTANCE}constructor(){this.lastRuns=[];const e=Date.now();for(let t=0;t{for(let t=Np._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+Np._HISTORY_LENGTH)*1e3;let i=0;for(let n=0;n=.5}};Np._HISTORY_LENGTH=10,Np._INSTANCE=null;let GAe=Np;class m$t{get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}constructor(e){this._onControlMessage=new o1,this.onControlMessage=this._onControlMessage.event,this._onMessage=new o1,this.onMessage=this._onMessage.event,this._onDidDispose=new o1,this.onDidDispose=this._onDidDispose.event,this._onSocketClose=new o1,this.onSocketClose=this._onSocketClose.event,this._onSocketTimeout=new o1,this.onSocketTimeout=this._onSocketTimeout.event,this._loadEstimator=e.loadEstimator??GAe.getInstance(),this._shouldSendKeepAlive=e.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new p$t,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 uze(this._socket)),this._socketReader=this._socketDisposables.add(new hze(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()},Pf.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 aw(zo.Disconnect,0,0,RE());this._socketWriter.write(e),this._socketWriter.flush()}}sendPause(){const e=new aw(zo.Pause,0,0,RE());this._socketWriter.write(e)}sendResume(){const e=new aw(zo.Resume,0,0,RE());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 uze(this._socket)),this._socketReader=this._socketDisposables.add(new hze(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 aw(zo.Ack,0,this._incomingAckId,RE());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 zo.None:break;case zo.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 aw(zo.ReplayRequest,0,0,RE())))}else this._incomingMsgId=e.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(e.data);break}case zo.Control:{this._onControlMessage.fire(e.data);break}case zo.Ack:break;case zo.Disconnect:{this._onDidDispose.fire();break}case zo.ReplayRequest:{const t=this._outgoingUnackMsg.toArray();for(let i=0,n=t.length;i=Pf.AcknowledgeTime){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},Pf.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>=Pf.TimeoutTime&&i>=Pf.TimeoutTime&&n>=Pf.TimeoutTime&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:t,timeSinceLastReceivedSomeData:i});return}const r=Math.max(Pf.TimeoutTime-t,Pf.TimeoutTime-i,Pf.TimeoutTime-n,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},r)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;const e=new aw(zo.Ack,0,this._incomingAckId,RE());this._socketWriter.write(e)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;const e=new aw(zo.KeepAlive,0,this._incomingAckId,RE());this._socketWriter.write(e)}}const _$t=30*1e3;var GT;(function(s){s[s.Management=1]="Management",s[s.ExtensionHost=2]="ExtensionHost",s[s.Tunnel=3]="Tunnel"})(GT||(GT={}));function KAe(s){switch(s){case GT.Management:return"Management";case GT.ExtensionHost:return"ExtensionHost";case GT.Tunnel:return"Tunnel"}}function dst(s){const e=new li;return setTimeout(()=>e.cancel(),s),e.token}function v$t(s,e){if(s.isCancellationRequested||e.isCancellationRequested)return Ue.Cancelled;const t=new li;return s.onCancellationRequested(()=>t.cancel()),e.onCancellationRequested(()=>t.cancel()),t.token}class Zce{get didTimeout(){return this._state==="timedout"}constructor(e){this._state="pending",this._disposables=new Z,{promise:this.promise,resolve:this._resolvePromise,reject:this._rejectPromise}=H2(),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 b$t(s,e){const t=new Zce(e);return t.registerDisposable(s.onControlMessage(i=>{const n=JSON.parse(i.toString()),r=gst(n);r?t.reject(r):t.resolve(n)})),t.promise}function w$t(s,e,t,i,n,r,o,a){const c=new Zce(a),l=Ys.create(!1);return s.info(`Creating a socket (${o})...`),ls(`code/willCreateSocket/${r}`),e.connect(t,i,n,o).then(d=>{c.didTimeout?(ls(`code/didCreateSocketError/${r}`),s.info(`Creating a socket (${o}) finished after ${l.elapsed()} ms, but this is too late and has timed out already.`),d?.dispose()):(ls(`code/didCreateSocketOK/${r}`),s.info(`Creating a socket (${o}) was successful after ${l.elapsed()} ms.`),c.resolve(d))},d=>{ls(`code/didCreateSocketError/${r}`),s.info(`Creating a socket (${o}) returned an error after ${l.elapsed()} ms.`),s.error(d),c.reject(d)}),c.promise}function que(s,e){const t=new Zce(e);return s.then(i=>{t.didTimeout||t.resolve(i)},i=>{t.didTimeout||t.reject(i)}),t.promise}async function y$t(s,e,t,i){const n=fst(s,e);s.logService.trace(`${n} 1/6. invoking socketFactory.connect().`);let r;try{r=await w$t(s.logService,s.remoteSocketFactoryService,s.connectTo,M8.getServerRootPath(),`reconnectionToken=${s.reconnectionToken}&reconnection=${s.reconnectionProtocol?"true":"false"}`,KAe(e),`renderer-${KAe(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 o,a;s.reconnectionProtocol?(s.reconnectionProtocol.beginAcceptReconnection(r,null),o=s.reconnectionProtocol,a=!1):(o=new m$t({socket:r}),a=!0),s.logService.trace(`${n} 3/6. sending AuthRequest control message.`);const c=await que(s.signService.createNewMessage(ao()),i),l={type:"auth",auth:s.connectionToken||"00000000000000000000",data:c.data};o.sendControl(Ge.fromString(JSON.stringify(l)));try{const d=await b$t(o,v$t(i,dst(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 que(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 que(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.`),o.sendControl(Ge.fromString(JSON.stringify(f))),{protocol:o,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&&gPe(o),d}}async function C$t(s,e,t,i){const n=Date.now(),r=fst(s,e),{protocol:o,ownsProtocol:a}=await y$t(s,e,t,i),c=new Zce(i);return c.registerDisposable(o.onControlMessage(l=>{const d=JSON.parse(l.toString()),h=gst(d);h?(s.logService.error(`${r} received error control message when negotiating connection. Error:`),s.logService.error(h),a&&gPe(o),c.reject(h)):(s.reconnectionProtocol?.endAcceptReconnection(),s.logService.trace(`${r} 6/6. handshake finished, connection is up and running after ${M$t(n)}!`),c.resolve({protocol:o,firstMessage:d}))})),c.promise}async function hst(s,e,t){const{protocol:i,firstMessage:n}=await C$t(s,GT.ExtensionHost,e,t),r=n&&n.debugPort;return{protocol:i,debugPort:r}}async function ust(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 S$t(s,e){return A$t(s,async t=>{const{protocol:i,debugPort:n}=await hst(t,e,Ue.None);return new T$t(s,e,t.reconnectionToken,i,n)})}async function A$t(s,e){for(let i=1;;i++)try{const n=ao(),r=await ust(s,n,null);return await e(r)}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),Bee.triggerPermanentFailure(0,0,wD.isHandled(n)),n}}function E$t(s){return Mo(e=>new Promise((t,i)=>{const n=setTimeout(t,s*1e3);e.onCancellationRequested(()=>{clearTimeout(n),t()})}))}var pI;(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"})(pI||(pI={}));class x$t{constructor(e,t){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.type=pI.ConnectionLost}}class D$t{constructor(e,t,i,n){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.durationSeconds=i,this.cancellableTimer=n,this.type=pI.ReconnectionWait}skipWait(){this.cancellableTimer.cancel()}}class k$t{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=pI.ReconnectionRunning}}class gze{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=pI.ConnectionGain}}class I$t{constructor(e,t,i,n){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.handled=n,this.type=pI.ReconnectionPermanentFailure}}const kg=class kg 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||kg._permanentFailure}constructor(e,t,i,n,r){super(),this._connectionType=e,this._options=t,this.reconnectionToken=i,this.protocol=n,this._reconnectionFailureIsFatal=r,this._onDidStateChange=this._register(new I),this.onDidStateChange=this._onDidStateChange.event,this._permanentFailure=!1,this._isReconnecting=!1,this._isDisposed=!1,this._onDidStateChange.fire(new gze(this.reconnectionToken,0,0)),this._register(n.onSocketClose(o=>{const a=dj(this._connectionType,this.reconnectionToken,!0);o?o.type===Oee.NodeSocketCloseEvent?(this._options.logService.info(`${a} received socket close event (hadError: ${o.hadError}).`),o.error&&this._options.logService.error(o.error)):(this._options.logService.info(`${a} received socket close event (wasClean: ${o.wasClean}, code: ${o.code}, reason: ${o.reason}).`),o.event&&this._options.logService.error(o.event)):this._options.logService.info(`${a} received socket close event.`),this._beginReconnecting()})),this._register(n.onSocketTimeout(o=>{const a=dj(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${a} received socket timeout event (unacknowledgedMsgCount: ${o.unacknowledgedMsgCount}, timeSinceOldestUnacknowledgedMsg: ${o.timeSinceOldestUnacknowledgedMsg}, timeSinceLastReceivedSomeData: ${o.timeSinceLastReceivedSomeData}).`),this._beginReconnecting()})),kg._instances.push(this),this._register(Ee(()=>{const o=kg._instances.indexOf(this);o>=0&&kg._instances.splice(o,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(kg._permanentFailureMillisSinceLastIncomingData,kg._permanentFailureAttempt,kg._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=dj(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 x$t(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 o=E$t(n);this._onDidStateChange.fire(new D$t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),n,o)),this._options.logService.info(`${e} waiting for ${n} seconds before reconnecting...`);try{await o}catch{}}if(this._isPermanentFailure){this._options.logService.error(`${e} permanent failure occurred while running the reconnecting loop.`);break}this._onDidStateChange.fire(new k$t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1)),this._options.logService.info(`${e} resolving connection...`);const r=await ust(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${r.connectTo}...`),await this._reconnect(r,dst(_$t)),this._options.logService.info(`${e} reconnected!`),this._onDidStateChange.fire(new gze(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1));break}catch(r){if(r.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(r),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(r),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}if(wD.isTemporarilyNotAvailable(r)){this._options.logService.info(`${e} A temporarily not available error occurred while trying to reconnect, will try again...`),this._options.logService.trace(r);continue}if((r.code==="ETIMEDOUT"||r.code==="ENETUNREACH"||r.code==="ECONNREFUSED"||r.code==="ECONNRESET")&&r.syscall==="connect"){this._options.logService.info(`${e} A network error occurred while trying to reconnect, will try again...`),this._options.logService.trace(r);continue}if(Oo(r)){this._options.logService.info(`${e} A promise cancelation error occurred while trying to reconnect, will try again...`),this._options.logService.trace(r);continue}if(r instanceof wD){this._options.logService.error(`${e} A RemoteAuthorityResolverError occurred while trying to reconnect. Will give up now! Error:`),this._options.logService.error(r),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,wD.isHandled(r));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(r),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}}while(!this._isPermanentFailure&&!this._isDisposed)}_onReconnectionPermanentFailure(e,t,i){this._reconnectionFailureIsFatal?kg.triggerPermanentFailure(e,t,i):this._gotoPermanentFailure(e,t,i)}_gotoPermanentFailure(e,t,i){this._onDidStateChange.fire(new I$t(this.reconnectionToken,e,t,i)),gPe(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}};kg._permanentFailure=!1,kg._permanentFailureMillisSinceLastIncomingData=0,kg._permanentFailureAttempt=0,kg._permanentFailureHandled=!1,kg._instances=[];let Bee=kg;class T$t extends Bee{constructor(e,t,i,n,r){super(GT.ExtensionHost,e,i,n,!1),this._startArguments=t,this.debugPort=r}async _reconnect(e,t){await hst(e,this._startArguments,t)}}function gPe(s){try{s.acceptDisconnect();const e=s.getSocket();s.dispose(),e.dispose()}catch(e){bt(e)}}function gst(s){if(s&&s.type==="error"){const e=new Error(`Connection error: ${s.reason}`);return e.code="VSCODE_CONNECTION_ERROR",e}return null}function L$t(s,e){for(;s.length"u"&&(l=ao(),this._storageService.store(c,l,Ie.WORKSPACE,cn.MACHINE));const d=await Odt(ri.origin,l),h=r.replace("{{uuid}}",`v--${d}`).replace("{{commit}}",o).replace("{{quality}}",a),u=new URL(`${h}/out/${i}${t}`);return u.searchParams.set("parentOrigin",ri.origin),u.searchParams.set("salt",l),u.toString()}}return`${sf.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=ao();i.setAttribute("src",`${e}&vscodeWebWorkerExtHostId=${n}`);const r=new jd;let o,a=null,c=!1,l=null;const d=(p,m)=>{a=m,c=!0,bt(a),clearTimeout(l),this._onDidExit.fire([cz.UnexpectedError,a.message]),r.open()},h=p=>{o=p,clearTimeout(l),r.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(ri,"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(cz.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(r.isOpen()||!(m instanceof MessagePort)){console.warn("UNEXPECTED message",p);const v=new Error("UNEXPECTED message");return d(cz.UnexpectedError,v)}h(m)})),this._layoutService.mainContainer.appendChild(i),this._register(Ee(()=>i.remove())),await r.wait(),c)throw a;const u=this._environmentService.options?.messagePorts??new Map;i.contentWindow.postMessage({type:"vscode.init",data:u},"*",[...u.values()]),o.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(Ge.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);o.postMessage(m,[m])}};return this._performHandshake(f)}async _performHandshake(e){if(await M.toPromise(M.filter(e.onMessage,t=>Wee(t,pp.Ready))),this._isTerminating||(e.send(Ge.fromString(JSON.stringify(await this._createExtHostInitData()))),this._isTerminating)||(await M.toPromise(M.filter(e.onMessage,t=>Wee(t,pp.Initialized))),this._isTerminating))throw Ty();return e}dispose(){this._isTerminating||(this._isTerminating=!0,this._protocol?.send(pst(pp.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&&!Rk.isDefaultVariant()&&(n=N.joinPath(N.parse(i),this._productService.commit,this._productService.version,Rk.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??(Hn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:jl,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:pMe(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===OA.EagerAutoStart,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Hn?sv.Web:sv.Desktop}}};Hee=D([_(3,Ji),_(4,Ci),_(5,Os),_(6,Ke),_(7,pf),_(8,fv),_(9,km),_(10,xo),_(11,_u),_(12,Gi)],Hee);class N$t{constructor(){this.capabilities=zn.Readonly+zn.FileReadWrite+zn.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 gs(t.statusText,ot.Unknown)}catch(t){throw gs(t,ot.Unknown)}}async stat(e){return{type:rn.File,size:0,mtime:0,ctime:0}}watch(){return V.None}writeFile(e,t,i){throw new dS}readdir(e){throw new dS}mkdir(e){throw new dS}delete(e,t){throw new dS}rename(e,t,i){throw new dS}}var qAe={exports:{}},Que={};(function(s,e){e=s.exports=On;var t;typeof process=="object"&&Que&&Que.NODE_DEBUG&&/\bsemver\b/i.test(Que.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,r=16,o=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,"+r+"})(?:\\.(\\d{1,"+r+"}))?(?:\\.(\\d{1,"+r+"}))?(?:$|[^\\d])";var De=c++;a[De]="(?:~>?)";var Be=c++;a[Be]="(\\s*)"+a[De]+"\\s+",o[Be]=new RegExp(a[Be],"g");var Ct="$1~",Ne=c++;a[Ne]="^"+a[De]+a[G]+"$";var dt=c++;a[dt]="^"+a[De]+a[Y]+"$";var Dt=c++;a[Dt]="(?:\\^)";var Xi=c++;a[Xi]="(\\s*)"+a[Dt]+"\\s+",o[Xi]=new RegExp(a[Xi],"g");var Ti="$1^",ss=c++;a[ss]="^"+a[Dt]+a[G]+"$";var $s=c++;a[$s]="^"+a[Dt]+a[Y]+"$";var Fn=c++;a[Fn]="^"+a[P]+"\\s*("+L+")$|^$";var Zo=c++;a[Zo]="^"+a[P]+"\\s*("+A+")$|^$";var hs=c++;a[hs]="(\\s*)"+a[P]+"\\s*("+L+"|"+a[G]+")",o[hs]=new RegExp(a[hs],"g");var Zr="$1$2$3",ea=c++;a[ea]="^\\s*("+a[G]+")\\s+-\\s+("+a[G]+")\\s*$";var ki=c++;a[ki]="^\\s*("+a[Y]+")\\s+-\\s+("+a[Y]+")\\s*$";var rs=c++;a[rs]="(<|>)?=?\\s*\\*";for(var Or=0;Ori)return null;var T=de?o[k]:o[C];if(!T.test(K))return null;try{return new On(K,de)}catch{return null}}e.valid=Wa;function Wa(K,de){var T=Ln(K,de);return T?T.version:null}e.clean=wd;function wd(K,de){var T=Ln(K.trim().replace(/^[=v]+/,""),de);return T?T.version:null}e.SemVer=On;function On(K,de){if(K instanceof On){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 On))return new On(K,de);t("SemVer",K,de),this.loose=de;var T=K.trim().match(de?o[k]:o[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=nh;function nh(K,de,T,ie){typeof T=="string"&&(ie=T,T=void 0);try{return new On(K,T).inc(de,ie).version}catch{return null}}e.diff=mc;function mc(K,de){if(_l(K,de))return null;var T=Ln(K),ie=Ln(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=Gs;var $c=/^[0-9]+$/;function Gs(K,de){var T=$c.test(K),ie=$c.test(de);return T&&ie&&(K=+K,de=+de),T&&!ie?-1:ie&&!T?1:Kde?1:0}e.rcompareIdentifiers=ic;function ic(K,de){return Gs(de,K)}e.major=pl;function pl(K,de){return new On(K,de).major}e.minor=sh;function sh(K,de){return new On(K,de).minor}e.patch=mg;function mg(K,de){return new On(K,de).patch}e.compare=_c;function _c(K,de,T){return new On(K,T).compare(new On(de,T))}e.compareLoose=Gc;function Gc(K,de){return _c(K,de,!0)}e.rcompare=rh;function rh(K,de,T){return _c(de,K,T)}e.sort=kc;function kc(K,de){return K.sort(function(T,ie){return e.compare(T,ie,de)})}e.rsort=ml;function ml(K,de){return K.sort(function(T,ie){return e.rcompare(T,ie,de)})}e.gt=nc;function nc(K,de,T){return _c(K,de,T)>0}e.lt=Bo;function Bo(K,de,T){return _c(K,de,T)<0}e.eq=_l;function _l(K,de,T){return _c(K,de,T)===0}e.neq=oh;function oh(K,de,T){return _c(K,de,T)!==0}e.gte=ah;function ah(K,de,T){return _c(K,de,T)>=0}e.lte=Kc;function Kc(K,de,T){return _c(K,de,T)<=0}e.cmp=qc;function qc(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=_l(K,T,ie);break;case"!=":ye=oh(K,T,ie);break;case">":ye=nc(K,T,ie);break;case">=":ye=ah(K,T,ie);break;case"<":ye=Bo(K,T,ie);break;case"<=":ye=Kc(K,T,ie);break;default:throw new TypeError("Invalid operator: "+de)}return ye}e.Comparator=Ha;function Ha(K,de){if(K instanceof Ha){if(K.loose===de)return K;K=K.value}if(!(this instanceof Ha))return new Ha(K,de);t("comparator",K,de),this.loose=de,this.parse(K),this.semver===Br?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}var Br={};Ha.prototype.parse=function(K){var de=this.loose?o[Fn]:o[Zo],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 On(T[2],this.loose):this.semver=Br},Ha.prototype.toString=function(){return this.value},Ha.prototype.test=function(K){return t("Comparator.test",K,this.loose),this.semver===Br?!0:(typeof K=="string"&&(K=new On(K,this.loose)),qc(K,this.operator,this.semver,this.loose))},Ha.prototype.intersects=function(K,de){if(!(K instanceof Ha))throw new TypeError("a Comparator is required");var T;if(this.operator==="")return T=new Ts(K.value,de),Oh(this.value,T,de);if(K.operator==="")return T=new Ts(this.value,de),Oh(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=qc(this.semver,"<",K.semver,de)&&(this.operator===">="||this.operator===">")&&(K.operator==="<="||K.operator==="<"),qe=qc(this.semver,">",K.semver,de)&&(this.operator==="<="||this.operator==="<")&&(K.operator===">="||K.operator===">");return ie||ye||O&&$||se||qe},e.Range=Ts;function Ts(K,de){if(K instanceof Ts)return K.loose===de?K:new Ts(K.raw,de);if(K instanceof Ha)return new Ts(K.value,de);if(!(this instanceof Ts))return new Ts(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()}Ts.prototype.format=function(){return this.range=this.set.map(function(K){return K.join(" ").trim()}).join("||").trim(),this.range},Ts.prototype.toString=function(){return this.range},Ts.prototype.parseRange=function(K){var de=this.loose;K=K.trim(),t("range",K,de);var T=de?o[ki]:o[ea];K=K.replace(T,Ua),t("hyphen replace",K),K=K.replace(o[hs],Zr),t("comparator trim",K,o[hs]),K=K.replace(o[Be],Ct),K=K.replace(o[Xi],Ti),K=K.split(/\s+/).join(" ");var ie=de?o[Fn]:o[Zo],ye=K.split(" ").map(function(O){return Fh(O,de)}).join(" ").split(/\s+/);return this.loose&&(ye=ye.filter(function(O){return!!O.match(ie)})),ye=ye.map(function(O){return new Ha(O,de)}),ye},Ts.prototype.intersects=function(K,de){if(!(K instanceof Ts))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=Ic;function Ic(K,de){return new Ts(K,de).set.map(function(T){return T.map(function(ie){return ie.value}).join(" ").trim().split(" ")})}function Fh(K,de){return t("comp",K),K=xe(K,de),t("caret",K),K=Ea(K,de),t("tildes",K),K=$n(K,de),t("xrange",K),K=Wr(K,de),t("stars",K),K}function be(K){return!K||K.toLowerCase()==="x"||K==="*"}function Ea(K,de){return K.trim().split(/\s+/).map(function(T){return ee(T,de)}).join(" ")}function ee(K,de){var T=de?o[dt]:o[Ne];return K.replace(T,function(ie,ye,O,$,se){t("tilde",K,ie,ye,O,$,se);var qe;return be(ye)?qe="":be(O)?qe=">="+ye+".0.0 <"+(+ye+1)+".0.0":be($)?qe=">="+ye+"."+O+".0 <"+ye+"."+(+O+1)+".0":se?(t("replaceTilde pr",se),se.charAt(0)!=="-"&&(se="-"+se),qe=">="+ye+"."+O+"."+$+se+" <"+ye+"."+(+O+1)+".0"):qe=">="+ye+"."+O+"."+$+" <"+ye+"."+(+O+1)+".0",t("tilde return",qe),qe})}function xe(K,de){return K.trim().split(/\s+/).map(function(T){return ft(T,de)}).join(" ")}function ft(K,de){t("caret",K,de);var T=de?o[$s]:o[ss];return K.replace(T,function(ie,ye,O,$,se){t("caret",K,ie,ye,O,$,se);var qe;return be(ye)?qe="":be(O)?qe=">="+ye+".0.0 <"+(+ye+1)+".0.0":be($)?ye==="0"?qe=">="+ye+"."+O+".0 <"+ye+"."+(+O+1)+".0":qe=">="+ye+"."+O+".0 <"+(+ye+1)+".0.0":se?(t("replaceCaret pr",se),se.charAt(0)!=="-"&&(se="-"+se),ye==="0"?O==="0"?qe=">="+ye+"."+O+"."+$+se+" <"+ye+"."+O+"."+(+$+1):qe=">="+ye+"."+O+"."+$+se+" <"+ye+"."+(+O+1)+".0":qe=">="+ye+"."+O+"."+$+se+" <"+(+ye+1)+".0.0"):(t("no pr"),ye==="0"?O==="0"?qe=">="+ye+"."+O+"."+$+" <"+ye+"."+O+"."+(+$+1):qe=">="+ye+"."+O+"."+$+" <"+ye+"."+(+O+1)+".0":qe=">="+ye+"."+O+"."+$+" <"+(+ye+1)+".0.0"),t("caret return",qe),qe})}function $n(K,de){return t("replaceXRanges",K,de),K.split(/\s+/).map(function(T){return Ss(T,de)}).join(" ")}function Ss(K,de){K=K.trim();var T=de?o[ne]:o[j];return K.replace(T,function(ie,ye,O,$,se,qe){t("xRange",K,ie,ye,O,$,se,qe);var Wi=be(O),Hi=Wi||be($),ia=Hi||be(se),Ol=ia;return ye==="="&&Ol&&(ye=""),Wi?ye===">"||ye==="<"?ie="<0.0.0":ie="*":ye&&Ol?(Hi&&($=0),ia&&(se=0),ye===">"?(ye=">=",Hi?(O=+O+1,$=0,se=0):ia&&($=+$+1,se=0)):ye==="<="&&(ye="<",Hi?O=+O+1:$=+$+1),ie=ye+O+"."+$+"."+se):Hi?ie=">="+O+".0.0 <"+(+O+1)+".0.0":ia&&(ie=">="+O+"."+$+".0 <"+O+"."+(+$+1)+".0"),t("xRange return",ie),ie})}function Wr(K,de){return t("replaceStars",K,de),K.trim().replace(o[rs],"")}function Ua(K,de,T,ie,ye,O,$,se,qe,Wi,Hi,ia,Ol){return be(T)?de="":be(ie)?de=">="+T+".0.0":be(ye)?de=">="+T+"."+ie+".0":de=">="+de,be(qe)?se="":be(Wi)?se="<"+(+qe+1)+".0.0":be(Hi)?se="<"+qe+"."+(+Wi+1)+".0":ia?se="<="+qe+"."+Wi+"."+Hi+"-"+ia:se="<="+se,(de+" "+se).trim()}Ts.prototype.test=function(K){if(!K)return!1;typeof K=="string"&&(K=new On(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=Oh;function Oh(K,de,T){try{de=new Ts(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 Ts(de,T)}catch{return null}return K.forEach(function($){O.test($)&&(!ie||ye.compare($)===-1)&&(ie=$,ye=new On(ie,T))}),ie}e.minSatisfying=ho;function ho(K,de,T){var ie=null,ye=null;try{var O=new Ts(de,T)}catch{return null}return K.forEach(function($){O.test($)&&(!ie||ye.compare($)===1)&&(ie=$,ye=new On(ie,T))}),ie}e.validRange=nr;function nr(K,de){try{return new Ts(K,de).range||"*"}catch{return null}}e.ltr=gn;function gn(K,de,T){return at(K,de,"<",T)}e.gtr=Se;function Se(K,de,T){return at(K,de,">",T)}e.outside=at;function at(K,de,T,ie){K=new On(K,ie),de=new Ts(de,ie);var ye,O,$,se,qe;switch(T){case">":ye=nc,O=Kc,$=Bo,se=">",qe=">=";break;case"<":ye=Bo,O=ah,$=nc,se="<",qe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Oh(K,de,ie))return!1;for(var Wi=0;Wi=0.0.0")),ia=ia||_g,Ol=Ol||_g,ye(_g.semver,ia.semver,ie)?ia=_g:$(_g.semver,Ol.semver,ie)&&(Ol=_g)}),ia.operator===se||ia.operator===qe||(!Ol.operator||Ol.operator===se)&&O(K,Ol.semver))return!1;if(Ol.operator===qe&&$(K,Ol.semver))return!1}return!0}e.prerelease=Ot;function Ot(K,de){var T=Ln(K,de);return T&&T.prerelease.length?T.prerelease:null}e.intersects=Si;function Si(K,de,T){return K=new Ts(K,T),de=new Ts(de,T),K.intersects(de)}e.coerce=Bt;function Bt(K){if(K instanceof On)return K;if(typeof K!="string")return null;var de=K.match(o[ge]);return de==null?null:Ln((de[1]||"0")+"."+(de[2]||"0")+"."+(de[3]||"0"))}})(qAe,qAe.exports);var iH=qAe.exports;function P$t(s,e,t,i,n){const r=new ba;return s.forEach(o=>{const a=r.get(o.identifier);a&&n.warn(g(4825,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,o.extensionLocation.fsPath)),r.set(o.identifier,o)}),e.forEach(o=>{const a=r.get(o.identifier);if(a)if(a.isBuiltin){if(iH.gte(a.version,o.version)){n.warn(`Skipping extension ${o.extensionLocation.path} in favour of the builtin extension ${a.extensionLocation.path}.`);return}o.isBuiltin=!0}else n.warn(g(4825,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,o.extensionLocation.fsPath));else if(o.isBuiltin){n.warn(`Skipping obsolete builtin extension ${o.extensionLocation.path}`);return}r.set(o.identifier,o)}),t.forEach(o=>{const a=r.get(o.identifier);a&&n.warn(g(4826,"Overwriting {0} with Workspace Extension {1}.",a.extensionLocation.fsPath,o.extensionLocation.fsPath)),r.set(o.identifier,o)}),i.forEach(o=>{n.info(g(4827,"Loading development extension at {0}",o.extensionLocation.fsPath));const a=r.get(o.identifier);a&&a.isBuiltin&&(o.isBuiltin=!0),r.set(o.identifier,o)}),Array.from(r.values())}let QAe=class extends V{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(),this.runningLocation=e,this._initDataProvider=t,this.remoteSocketFactoryService=i,this._contextService=n,this._environmentService=r,this._telemetryService=o,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=OA.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=lPe(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:jl,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 r=!0;return n&&n.length>0&&n[0].scheme===pe.file&&(r=!1),r||(i.break=!1),S$t(e,i).then(o=>{this._register(o);const{protocol:a,debugPort:c,reconnectionToken:l}=o,d=typeof c=="number";return r&&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(Wee(m,pp.Ready)){this._createExtHostInitData(d).then(v=>{a.send(Ge.fromString(JSON.stringify(v)))});return}if(Wee(m,pp.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:pMe(this._productService,this._environmentService),appLanguage:jl,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===OA.EagerAutoStart,uiKind:Hn?sv.Web:sv.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){if(super.dispose(),this._terminating=!0,this._protocol){const e=this._protocol.getSocket();this._protocol.send(pst(pp.Terminate)),this._protocol.sendDisconnect(),this._protocol.dispose(),e.end(),this._protocol=null}}};QAe=D([_(2,fMe),_(3,Ci),_(4,Xo),_(5,Ji),_(6,Ke),_(7,pf),_(8,Os),_(9,bC),_(10,LXe),_(11,xo),_(12,FXe)],QAe);var jAe;let YAe=class extends OAe{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k,P,R){super(e,t,i,n,r,o,a,c,l,d,h,u,f,p,v,b,w,y,C,R),this._browserEnvironmentService=o,this._webExtensionsScannerService=m,this._userDataInitializationService=A,this._userDataProfileService=L,this._workspaceTrustManagementService=k,this._remoteExplorerService=P,y.when(Ms.Ready).then(async()=>{await this._userDataInitializationService.initializeInstalledExtensions(this._instantiationService),this._initialize()}),this._initFetchFileSystem()}_initFetchFileSystem(){const e=new N$t;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(r=>mD(r)))),this._webExtensionsScannerService.scanUserExtensions(this._userDataProfileService.currentProfile.extensionsResource,{skipInvalidExtensions:!0}).then(n=>t.push(...n.map(r=>mD(r)))),this._webExtensionsScannerService.scanExtensionsUnderDevelopment().then(n=>i.push(...n.map(r=>mD(r,!0))))])}catch(n){this._logService.error(n)}return P$t(e,t,[],i,this._logService)}async _resolveExtensionsDefault(){const[e,t]=await Promise.all([this._scanWebExtensions(),this._remoteExtensionsScannerService.scanExtensions()]);return new Q9t(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 wD.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===pI.ConnectionLost&&this._remoteAuthorityResolverService._clearResolvedAuthority(e)}),i.onReconnecting(()=>this._resolveAuthorityAgain())),this._resolveExtensionsDefault()}async _onExtensionHostExit(e){this._doStopExtensionHosts();const t=ri;typeof t.codeAutomationExit=="function"&&t.codeAutomationExit(e,await c$t(this._fileService,this._environmentService))}async _resolveAuthority(e){return this._resolveAuthorityOnExtensionHosts(dr.LocalWebWorker,e)}};YAe=D([_(3,we),_(4,wi),_(5,fv),_(6,Ji),_(7,Fl),_(8,Xt),_(9,xo),_(10,q6),_(11,Ci),_(12,Te),_(13,Rm),_(14,MMe),_(15,Ke),_(16,fg),_(17,sce),_(18,rg),_(19,bC),_(20,yce),_(21,pg),_(22,mC),_(23,vce),_(24,ir)],YAe);let JAe=class{constructor(e,t,i,n,r,o,a,c){this._extensionsProposedApi=e,this._scanWebExtensions=t,this._getExtensionRegistrySnapshotWhenReady=i,this._instantiationService=n,this._remoteAgentService=r,this._remoteAuthorityResolverService=o,this._extensionEnablementService=a,this._logService=c}createExtensionHost(e,t,i){switch(t.kind){case dr.LocalProcess:return null;case dr.LocalWebWorker:{const n=i?OA.EagerManualStart:OA.EagerAutoStart;return this._instantiationService.createInstance(Hee,t,n,this._createLocalExtensionHostDataProvider(e,t,i))}case dr.Remote:{const n=this._remoteAgentService.getConnection();return n?this._instantiationService.createInstance(QAe,t,this._createRemoteExtensionHostDataProvider(e,n.remoteAuthority)):null}}}_createLocalExtensionHostDataProvider(e,t,i){return{getInitData:async()=>{if(i){const n=BAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,await this._scanWebExtensions(),!0),r=e.computeRunningLocation(n,[],!1),o=cj(n,r,c=>t.equals(c));return{extensions:new dQ(0,n,o.map(c=>c.identifier))}}else{const n=await this._getExtensionRegistrySnapshotWhenReady(),r=e.filterByRunningLocation(n.extensions,t);return{extensions:new dQ(n.versionId,n.extensions,r.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 r=e.filterByExtensionHostKind(i.extensions,dr.Remote),o=new dQ(i.versionId,i.extensions,r.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:o}}}}};JAe=D([_(3,we),_(4,fg),_(5,bC),_(6,Fl),_(7,Ke)],JAe);let XAe=jAe=class{constructor(e){this._logService=e}pickExtensionHostKind(e,t,i,n,r){const o=jAe.pickRunningLocation(t,i,n,r);return this._logService.trace(`pickRunningLocation for ${e.value}, extension kinds: [${t.join(", ")}], isInstalledLocally: ${i}, isInstalledRemotely: ${n}, preference: ${d9t(r)} => ${bS(o)}`),o}static pickRunningLocation(e,t,i,n){const r=[];let o=!1;for(const a of e){if(a==="ui"&&i){if(n===Jg.Remote)return dr.Remote;o=!0}if(a==="workspace"&&i){if(n===Jg.None||n===Jg.Remote)return dr.Remote;r.push(dr.Remote)}if(a==="web"&&(t||i)){if(n===Jg.None||n===Jg.Local)return dr.LocalWebWorker;r.push(dr.LocalWebWorker)}}return o&&r.push(dr.Remote),r.length>0?r[0]:null}};XAe=jAe=D([_(0,Ke)],XAe);async function F$t(s,e,t){let i=t&&t.get("storage.serviceMachineId",Ie.APPLICATION)||null;if(i)return i;try{const r=(await e.readFile(s.serviceMachineIdResource)).value.toString();i=$xt(r)?r:null}catch{i=null}if(!i){i=ao();try{await e.writeFile(s.serviceMachineIdResource,Ge.fromString(i))}catch{}}return t?.store("storage.serviceMachineId",i,Ie.APPLICATION,cn.MACHINE),i}const O$t="/web-extension-resource/";class B$t{constructor(e,t,i,n,r){this._fileService=e,this._storageService=t,this._productService=i,this._environmentService=n,this._configurationService=r,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},r){if(this._extensionGalleryResourceUrlTemplate){const o=N.parse(wfe(this._extensionGalleryResourceUrlTemplate,{publisher:e,name:t,version:n!==void 0&&n!==xs.UNDEFINED&&n!==xs.UNKNOWN&&n!==xs.UNIVERSAL?`${i}+${n}`:i,path:"extension"}));return this._isWebExtensionResourceEndPoint(o)?o.with({scheme:M8.getPreferredWebSchema()}):o}}isExtensionGalleryResource(e){return!!this._extensionGalleryAuthority&&this._extensionGalleryAuthority===this._getExtensionGalleryAuthority(e)}async getExtensionGalleryRequestHeaders(){const e={"X-Client-Name":`${this._productService.applicationName}${Hn?"-web":""}`,"X-Client-Version":this._productService.version};return lQ(this._productService,this._environmentService)&&cLt(this._configurationService)===jg.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=F$t(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=M8.getServerRootPath();return t.startsWith(i)&&t.startsWith(O$t,i.length)}}let ZAe=class extends B$t{constructor(e,t,i,n,r,o){super(e,t,i,n,r),this._logService=o}async readExtensionResource(e){if(e=sf.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()}};ZAe=D([_(0,Xt),_(1,Gi),_(2,xo),_(3,ec),_(4,Te),_(5,Ke)],ZAe);var QP,eEe;class lz{static fromJSON(e){if(e)try{const t=JSON.parse(e);return new lz(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 zR;let tEe=(zR=class{constructor(e,t,i){this._storageService=t,this._envService=i,this._disabled=new Map;const n=t.get(QP._storageKey,Ie.APPLICATION);if(this._state=lz.fromJSON(n),this._state){const{mid:r,high:o}=this._state;for(let a=0;a=r&&aMa({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 lz(t,0,t.length,0);this._storageService.store(QP._storageKey,JSON.stringify(i),Ie.APPLICATION,cn.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 lz(this._state.extensions,e?this._state.low:this._state.mid,e?this._state.mid:this._state.high);this._storageService.store(QP._storageKey,JSON.stringify(t),Ie.APPLICATION,cn.MACHINE),await this._storageService.flush()}async reset(){this._storageService.remove(QP._storageKey,Ie.APPLICATION),await this._storageService.flush()}},QP=zR,zR._storageKey="extensionBisectState",zR);tEe=QP=D([_(0,Ke),_(1,Gi),_(2,Xo)],tEe);var $R;let nH=($R=class{constructor(e,t,i,n){this._extensionBisectService=t,this._notificationService=i,this._commandService=n,t.isActive&&(eEe.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(Ze.Info,n,[e,t,i],{sticky:!0,priority:Z2.URGENT})}},eEe=$R,$R.ctxIsBisectActive=new Q("isExtensionBisectActive",!1),$R);nH=eEe=D([_(0,Le),_(1,qU),_(2,wi),_(3,bi)],nH);je.as(hf.Workbench).registerWorkbenchContribution(nH,Ms.Restored);Et(class extends di{constructor(){super({id:"extension.bisect.start",title:Pe(1142,"Start Extension Bisect"),category:la.Help,f1:!0,precondition:nH.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(ir),t=s.get(Dc),i=s.get(H6),n=s.get(Fl),r=s.get(qU),o=(await i.getInstalled(wo.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(o.length)|0),primaryButton:g(1145,"&&Start Extension Bisect")})).confirmed&&(await r.start(o),t.reload())}});Et(class extends di{constructor(){super({id:"extension.bisect.next",title:Pe(1146,"Continue Extension Bisect"),category:la.Help,f1:!0,precondition:nH.ctxIsBisectActive})}async run(s,e){const t=s.get(ir),i=s.get(Dc),n=s.get(qU),r=s.get(xo),o=s.get(RXe),a=s.get(bi);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}.",r.nameShort));else{const l=await t.confirm({type:Ze.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 o.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:Ze.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}});Et(class extends di{constructor(){super({id:"extension.bisect.stop",title:Pe(1159,"Stop Extension Bisect"),category:la.Help,f1:!0,precondition:nH.ctxIsBisectActive})}async run(s){const e=s.get(qU),t=s.get(Dc);await e.reset(),t.reload()}});function W$t(s,e){return s}function H$t(s){for(const[e,t]of Object.entries(s))sf.registerAppResourcePathUrl(e,t)}function Uee(s){switch(s){case Hr.InvalidSymbol:return g(1162,"Invalid symbol");case Hr.InvalidNumberFormat:return g(1163,"Invalid number format");case Hr.PropertyNameExpected:return g(1164,"Property name expected");case Hr.ValueExpected:return g(1165,"Value expected");case Hr.ColonExpected:return g(1166,"Colon expected");case Hr.CommaExpected:return g(1167,"Comma expected");case Hr.CloseBraceExpected:return g(1168,"Closing brace expected");case Hr.CloseBracketExpected:return g(1169,"Closing bracket expected");case Hr.EndOfFileExpected:return g(1170,"End of file expected");default:return""}}const mst=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,U$t=/^-(\d{4})(\d{2})(\d{2})$/;function V$t(s){return s=s.trim(),s==="*"||mst.test(s)}function N9(s){if(!V$t(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(mst);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 P9(s){if(!s)return null;const e=s.majorBase,t=s.majorMustEqual,i=s.minorBase;let n=s.minorMustEqual;const r=s.patchBase;let o=s.patchMustEqual;s.hasCaret&&(e===0||(n=!1),o=!1);let a=0;if(s.preRelease){const c=U$t.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:r,patchMustEqual:o,isMinimum:s.hasGreaterEquals,notBefore:a}}function z$t(s,e,t){let i;typeof s=="string"?i=P9(N9(s)):i=s;let n;e instanceof Date?n=e.getTime():typeof e=="string"&&(n=new Date(e).getTime());let r;if(typeof t=="string"?r=P9(N9(t)):r=t,!i||!r)return!1;const o=i.majorBase,a=i.minorBase,c=i.patchBase;let l=r.majorBase,d=r.minorBase,h=r.patchBase;const u=r.notBefore;let f=r.majorMustEqual,p=r.minorMustEqual,m=r.patchMustEqual;return r.isMinimum?o>l?!0:od?!0:a=h:(o===1&&l===0&&(!f||!p||!m)&&(l=1,d=0,h=0,f=!0,p=!1,m=!1),ol?!f:ad?!p:ch?!m:!(n&&n"u"&&typeof i.browser>"u")return o.push([Ze.Error,g(1178,"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([Ze.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 o.push([Ze.Error,g(1180,"property `{0}` can be omitted or must be of type `string`","main")]),o;{const l=Ft(t,i.main);Jy(l,t)||o.push([Ze.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 o.push([Ze.Error,g(1182,"property `{0}` can be omitted or must be of type `string`","browser")]),o;{const l=Ft(t,i.browser);Jy(l,t)||o.push([Ze.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(!iH.valid(i.version))return o.push([Ze.Error,g(1184,"Extension version is not semver compatible.")]),o;const a=[];if(!G$t(s,e,i,n,a))for(const l of a)o.push([Ze.Error,l]);if(r&&i.enabledApiProposals?.length){const l=[];if(!K$t([...i.enabledApiProposals],l))for(const d of l)o.push([Ze.Error,d])}return o}function G$t(s,e,t,i,n){return i||typeof t.main>"u"&&typeof t.browser>"u"?!0:q$t(s,e,t.engines.vscode,n)}function K$t(s,e){if(s.length===0)return!0;const t=Array.isArray(e)?e:void 0,i=(t?void 0:e)??BM,n=[],r=w1t(s);for(const{proposalName:o,version:a}of r){const c=i[o];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.",o))}return t?.push(...n),n.length===0}function q$t(s,e,t,i=[]){const n=P9(N9(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 z$t(s,e,n)?!0:(i.push(g(1189,"Extension is not compatible with Code {0}. Extension requires: {1}.",s,t)),!1)}function fze(s){if(!Array.isArray(s))return!1;for(let e=0,t=s.length;e{const a=[];if(i)a.push(...o);else for(const c of o)e.some(([l])=>Ma(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=>Ma(u.identifier,c.identifier)&&u.version===c.manifest.version),h={identifier:c.identifier,version:c.manifest.version,location:c.location,metadata:l};d===-1?(r.push(h),a.push(h)):a.splice(d,1,h)}return r.length&&this._onAddExtensions.fire({extensions:r,profileLocation:t}),n.length&&this._onRemoveExtensions.fire({extensions:n,profileLocation:t}),a}),r.length&&this._onDidAddExtensions.fire({extensions:r,profileLocation:t}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,profileLocation:t}),r}catch(o){throw r.length&&this._onDidAddExtensions.fire({extensions:r,error:o,profileLocation:t}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,error:o,profileLocation:t}),o}}async updateMetadata(e,t){const i=[];return await this.withProfileExtensions(t,n=>{const r=[];for(const o of n){const a=e.find(([c])=>Ma(c.identifier,o.identifier)&&c.manifest.version===o.version);a&&(o.metadata={...o.metadata,...a[1]},i.push(o)),r.push(o)}return r}),i}async removeExtensionFromProfile(e,t){const i=[];try{await this.withProfileExtensions(t,n=>{const r=[];for(const o of n)Ma(o.identifier,e.identifier)?i.push(o):r.push(o);return i.length&&this._onRemoveExtensions.fire({extensions:i,profileLocation:t}),r}),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=[],r;try{const o=await this.fileService.readFile(e);r=JSON.parse(o.value.toString().trim()||"[]")}catch(o){if(Qw(o)!==ji.FILE_NOT_FOUND)throw o;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(r=await this.migrateFromOldDefaultProfileExtensionsLocation()),!r&&i?.bailOutWhenFileNotFound)throw new Vee(ou(o),sH.ERROR_PROFILE_NOT_FOUND)}if(r){Array.isArray(r)||this.reportAndThrowInvalidConentError(e);let o=!1;for(const a of r){mze(a)||this.reportAndThrowInvalidConentError(e);let c;if(Rt(a.relativeLocation)&&a.relativeLocation)c=this.resolveExtensionLocation(a.relativeLocation);else if(Rt(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&&(o=!0,a.relativeLocation=l)}Ja(a.metadata?.hasPreReleaseVersion)&&a.metadata?.preRelease&&(o=!0,a.metadata.hasPreReleaseVersion=!0),n.push({identifier:a.identifier,location:c,version:a.version,metadata:a.metadata})}o&&await this.fileService.writeFile(e,Ge.fromString(JSON.stringify(r)))}if(t){n=t(n);const o=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,Ge.fromString(JSON.stringify(o)))}return n})}reportAndThrowInvalidConentError(e){const t=new Vee(`Invalid extensions content in ${e.toString()}`,sH.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(r){if(Qw(r)===ji.FILE_NOT_FOUND)return;throw r}this.logService.info("Migrating extensions from old default profile location",e.toString());let n;try{const r=JSON.parse(i);Array.isArray(r)&&r.every(o=>mze(o))?n=r:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",r)}catch(r){this.logService.error(r)}if(n)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,Ge.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(r){if(Qw(r)===ji.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 r}try{await this.fileService.del(e)}catch(r){Qw(r)!==ji.FILE_NOT_FOUND&&this.logService.error(r)}try{await this.fileService.del(t)}catch(r){Qw(r)!==ji.FILE_NOT_FOUND&&this.logService.error(r)}return n})()),this._migrationPromise}getResourceAccessQueue(e){let t=this.resourcesAccessQueueMap.get(e);return t||(t=new EI,this.resourcesAccessQueueMap.set(e,t)),t}};pze=D([_(1,Xt),_(2,km),_(3,Is),_(4,Ji),_(5,Ke)],pze);function mze(s){return In(s)&&XRt(s.identifier)&&(Q$t(s.location)||Rt(s.location)&&s.location)&&(Ja(s.relativeLocation)||Rt(s.relativeLocation))&&s.version&&Rt(s.version)}function Q$t(s){return s?Rt(s.path)&&Rt(s.scheme):!1}function j$t(s,e,t,i){try{Y$t(s,e,t,i)}catch(n){s.error(n?.message??n)}return e}function Y$t(s,e,t,i){const n=(r,o,a)=>{const c=r[o];if(Rt(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&&(o==="title"||o==="category")&&m&&m!==f){const v={value:f,original:m};r[o]=v}else r[o]=f}}else if(In(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(wo.System))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(wo.User)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=iMt(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,t,i){const[n,r]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(t)]),o=i?await this.scanExtensionsUnderDevelopment(e,[...n,...r]):[];return this.dedupExtensions(n,r,o,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],wo.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,wo.User,!e.includeUninstalled,e.language,!0,i,e.productVersion??this.getProductVersion()),r=e.useCache&&!n.devMode&&n.excludeObsolete?this.userExtensionsCachedScanner:this.extensionsScanner;let o;try{o=await r.scanExtensions(n)}catch(a){if(a instanceof Vee&&a.code===sH.ERROR_PROFILE_NOT_FOUND)await this.doInitializeDefaultProfileExtensions(),o=await r.scanExtensions(n);else throw a}return o=await this.applyScanOptions(o,wo.User,e,!0),this.logService.trace("Scanned user extensions:",o.length),o}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 r=await this.createExtensionScannerInput(n,!1,wo.User,!0,e.language,!1,void 0,e.productVersion??this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(r)).map(a=>(a.type=t.find(c=>Ma(c.identifier,a.identifier))?.type??a.type,this.extensionsScanner.validate(a,r)))}))).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()),r=await this.extensionsScanner.scanExtension(n);return!r||!i.includeInvalid&&!r.isValid?null:r}async scanOneOrMultipleExtensions(e,t,i){const n=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),r=await this.extensionsScanner.scanOneOrMultipleExtensions(n);return this.applyScanOptions(r,t,i,!0)}async scanMultipleExtensions(e,t,i){const n=[];return await Promise.all(e.map(async r=>{const o=await this.scanOneOrMultipleExtensions(r,t,i);n.push(...o)})),this.applyScanOptions(n,t,i,!0)}async scanMetadata(e){const t=Ft(e,"package.json"),i=(await this.fileService.readFile(t)).value.toString();return JSON.parse(i).__metadata}async updateMetadata(e,t){const i=Ft(e,"package.json"),n=(await this.fileService.readFile(i)).value.toString(),r=JSON.parse(n);t.isMachineScoped===!1&&delete t.isMachineScoped,t.isBuiltin===!1&&delete t.isBuiltin,r.__metadata={...r.__metadata,...t},await this.fileService.writeFile(Ft(e,"package.json"),Ge.fromString(JSON.stringify(r,null," ")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Vee&&e.code===sH.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,Ge.fromString(JSON.stringify([])))}catch(t){Qw(t)!==ji.FILE_NOT_FOUND&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),ou(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===wo.System?e:void 0,t===wo.User?e:void 0,t==="development"?e:void 0,await this.getTargetPlatform(),n)),i.includeInvalid||(e=e.filter(r=>r.isValid)),e.sort((r,o)=>{const a=Kr(r.location.fsPath),c=Kr(o.location.fsPath);return ac?1:0})}dedupExtensions(e,t,i,n,r){const o=(c,l,d)=>{if(c.isValid&&!l.isValid)return!1;if(c.isValid===l.isValid){if(r&&iH.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(iH.eq(c.manifest.version,l.manifest.version)){if(c.type===wo.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 ba;return e?.forEach(c=>{const l=a.get(c.identifier.id);(!l||o(l,c,!1))&&a.set(c.identifier.id,c)}),t?.forEach(c=>{const l=a.get(c.identifier.id);if(!l&&e&&c.type===wo.System){this.logService.debug(`Skipping obsolete system extension ${c.location.path}.`);return}(!l||o(l,c,!1))&&a.set(c.identifier.id,c)}),i?.forEach(c=>{const l=a.get(c.identifier.id);(!l||o(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,wo.System,!0,t,!0,void 0,this.getProductVersion()),r=await(e&&!i.devMode?this.systemExtensionsCachedScanner:this.extensionsScanner).scanExtensions(i);return this.logService.trace("Scanned system extensions:",r.length),r}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():{},r=[],o=N.file(Bk(kfe(sf.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const c of i){const l=n[c.name]||"marketplace";switch(l){case"disabled":break;case"marketplace":r.push(Ft(o,c.name));break;default:r.push(N.file(l));break}}const a=await Promise.all(r.map(async c=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(c,!1,wo.System,!0,e,!0,void 0,this.getProductVersion()))));return this.logService.trace("Scanned dev system extensions:",a.length),Oi(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,r,o,a,c){const l=await this.getTranslations(r??jl),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 dz(e,d,h,u,t,a,i,n,o,c.version,c.date,this.productService.commit,!this.environmentService.isBuilt,r,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}}};_ze=D([_(4,km),_(5,tce),_(6,Xt),_(7,Ke),_(8,ec),_(9,xo),_(10,Is),_(11,we)],_ze);class dz{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m){this.location=e,this.mtime=t,this.applicationExtensionslocation=i,this.applicationExtensionslocationMtime=n,this.profile=r,this.profileScanOptions=o,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 Yi(e.location,t.location)&&e.mtime===t.mtime&&Yi(e.applicationExtensionslocation,t.applicationExtensionslocation)&&e.applicationExtensionslocationMtime===t.applicationExtensionslocationMtime&&e.profile===t.profile&&Js(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&&iEe.equals(e.translations,t.translations)}}let nEe=class extends V{constructor(e,t){super(),this.fileService=e,this.logService=t}async getLocalizedMessages(e,t,i){const n=Ft(e,"package.nls.json"),r=(l,d)=>{d.forEach(h=>{this.logService.error(this.formatMessage(e,g(444,"Failed to parse {0}: {1}.",l?.path,Uee(h.error))))})},o=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=af(d,h);return h.length>0?(r(l,h),{values:void 0,default:n}):dD(u)!=="object"?(o(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=af(h,u);return u.length>0?(r(d.localized,u),{values:void 0,default:d.original}):dD(f)!=="object"?(o(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 r=[],o=await this.resolveOriginalMessageBundle(n.default,r);if(r.length>0)return r.forEach(c=>{this.logService.error(this.formatMessage(e,g(444,"Failed to parse {0}: {1}.",n.default?.path,Uee(c.error))))}),t;if(dD(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 j$t(this.logService,t,a,o)}catch{}return t}async resolveOriginalMessageBundle(e,t){if(e)try{const i=(await this.fileService.readFile(e)).value.toString();return af(i,t)}catch{}}findMessageBundles(e,t){return new Promise((i,n)=>{const r=o=>{const a=Ft(e,`package.nls.${o}.json`);this.fileService.exists(a).then(c=>{c&&i({localized:a,original:Ft(e,"package.nls.json")});const l=o.lastIndexOf("-");l===-1?i({localized:Ft(e,"package.nls.json"),original:null}):(o=o.substring(0,l),r(o))})};if(t.devMode||t.pseudo||!t.language)return i({localized:Ft(e,"package.nls.json"),original:null});r(t.language)})}formatMessage(e,t){return`[${e.path}]: ${t}`}};nEe=D([_(0,Xt),_(1,Ke)],nEe);let zee=class extends nEe{constructor(e,t,i,n,r,o,a){super(n,a),this.obsoleteFile=e,this.extensionsProfileScannerService=t,this.uriIdentityService=i,this.environmentService=o,this.extensionsEnabledWithApiProposalVersion=r.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===wo.User)try{const n=(await this.fileService.readFile(this.obsoleteFile)).value.toString();i=JSON.parse(n)}catch{}return DA(i)?t:t.filter(n=>!i[V5.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===wo.User&&vi(n.resource).indexOf(".")===0)return null;const r=new dz(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(r)}));return Oi(i).sort((n,r)=>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 r=await Promise.all(n.map(async o=>{if(t(o)){const a=new dz(o.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,o.metadata)}return null}));return Oi(r)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(Ft(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}:`,ou(t)),[]}}async scanExtension(e,t){try{let i=await this.scanExtensionManifest(e.location);if(i){i.publisher||(i.publisher=pXe),t=t??i.__metadata,delete i.__metadata;const n=Mw(i.publisher,i.name),r=t?.id?{id:n,uuid:t.id}:{id:n},o=t?.isSystem?wo.System:e.type,a=o===wo.System||!!t?.isBuiltin;i=await this.translateManifest(e.location,i,dz.createNlsConfiguration(e));let c={type:o,identifier:r,manifest:i,location:e.location,isBuiltin:a,targetPlatform:t?.targetPlatform??xs.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=y1t([...i.enabledApiProposals])),c}}catch(i){e.type!==wo.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()),r=$$t(t.productVersion,t.productDate,t.location,e.manifest,e.isBuiltin,n);for(const[o,a]of r)o===Ze.Error&&(i=!1,this.logService.error(this.formatMessage(t.location,a)));return e.isValid=i,e.validations=r,e}async scanExtensionManifest(e){const t=Ft(e,"package.json");let i;try{i=(await this.fileService.readFile(t)).value.toString()}catch(r){return Qw(r)!==ji.FILE_NOT_FOUND&&this.logService.error(this.formatMessage(e,g(446,"Cannot read file {0}: {1}.",t.path,r.message))),null}let n;try{n=JSON.parse(i)}catch{const o=[];af(i,o);for(const a of o)this.logService.error(this.formatMessage(e,g(447,"Failed to parse {0}: [{1}, {2}] {3}.",t.path,a.offset,a.length,Uee(a.error))));return null}return dD(n)!=="object"?(this.logService.error(this.formatMessage(e,g(448,"Invalid manifest file {0}: Not a JSON object.",t.path))),null):n}};zee=D([_(1,tce),_(2,Is),_(3,Xt),_(4,xo),_(5,ec),_(6,Ke)],zee);let $ee=class extends zee{constructor(e,t,i,n,r,o,a,c,l){super(t,n,r,o,a,c,l),this.currentProfile=e,this.userDataProfilesService=i,this.cacheValidatorThrottler=this._register(new c6(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&&dz.equals(i.input,this.input))return this.logService.debug("Using cached extensions scan result",e.type===wo.System?"system":"user",e.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),i.result.map(r=>(r.location=N.revive(r.location),r));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:Mr(i.input)}}catch(t){this.logService.debug("Error while reading the extension cache file:",e.path,ou(t))}return null}async writeExtensionCache(e,t){try{await this.fileService.writeFile(e,Ge.fromString(JSON.stringify(t)))}catch(i){this.logService.debug("Error while writing the extension cache file:",e.path,ou(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(!Js(n,i))try{this.logService.info("Invalidating Cache",i,n),await this.fileService.del(e),this._onDidChangeCache.fire()}catch(r){this.logService.error(r)}}getCacheFile(e){const t=this.getProfile(e);return this.uriIdentityService.extUri.joinPath(t.cacheHome,e.type===wo.System?m1t:p1t)}getProfile(e){return e.type===wo.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}};$ee=D([_(2,km),_(3,tce),_(4,Is),_(5,Xt),_(6,xo),_(7,ec),_(8,Ke)],$ee);const sEe=["W","X","Y","Z","a","b","c","d","e","f"],J$t=new RegExp(`^[${sEe.join("")}]+`),_st=7;function X$t(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(J$t,""),_st),i=Rqe(s.fragment.substring(e+1)).toString();if(!isNaN(t))return{handle:t,notebook:s.with({scheme:i,fragment:null})}}function Z$t(s,e){const t=e.toString(_st),n=`${t.lengthGe.wrap(o))),r=d7t(n);return i=i||r.byteLength!==n.byteLength,{data:r,didCompression:i}}const hj="\x1B[A",jue=hj.split("").map(s=>s.charCodeAt(0)),s7t=10;function r7t(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 c7t=8,l7t=13;function d7t(s){return!s.buffer.includes(c7t)&&!s.buffer.includes(l7t)?s:Ge.fromString(a7t(o7t(i7t.decode(s.buffer))))}var aEe,T0,kC,cEe,L0,ME,R0,lEe,dEe,uj,HV,hEe,cw,lw,uEe,Ag,gEe;function Ii(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 qee;(function(s){s[s.Top=0]="Top",s[s.Bottom=1]="Bottom"})(qee||(qee={}));var X1,FGe;let js=aEe=(FGe=class{constructor(e){Ht(this,X1);St(this,X1,e)}static from(...e){let t=e;return new aEe(function(){if(t){for(const i of t)i&&typeof i.dispose=="function"&&i.dispose();t=void 0}})}dispose(){typeof Ce(this,X1)=="function"&&(Ce(this,X1).call(this),St(this,X1,void 0))}},X1=new WeakMap,FGe);js=aEe=D([Ii],js);let ws=T0=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 Fi();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 T0(this.line+i,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw Fi();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 T0(i,t)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};ws=T0=D([Ii],ws);let Xn=kC=class{static isRange(e){return e instanceof kC?!0:e?ws.isPosition(e.start)&&ws.isPosition(e.end):!1}static of(e){if(e instanceof kC)return e;if(this.isRange(e))return new kC(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 r,o;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof n=="number"?(r=new ws(e,t),o=new ws(i,n)):ws.isPosition(e)&&ws.isPosition(t)&&(r=ws.of(e),o=ws.of(t)),!r||!o)throw new Error("Invalid arguments");r.isBefore(o)?(this._start=r,this._end=o):(this._start=o,this._end=r)}contains(e){return kC.isRange(e)?this.contains(e.start)&&this.contains(e.end):ws.isPosition(e)?!(ws.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=ws.Max(e.start,this._start),i=ws.Min(e.end,this._end);if(!t.isAfter(i))return new kC(t,i)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;const t=ws.Min(e.start,this._start),i=ws.Max(e.end,this.end);return new kC(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 Fi();let i;return e?ws.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 kC(i,t)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return bst(this)}};Xn=kC=D([Ii],Xn);let uC=cEe=class extends Xn{static isSelection(e){return e instanceof cEe?!0:e?Xn.isRange(e)&&ws.isPosition(e.anchor)&&ws.isPosition(e.active)&&typeof e.isReversed=="boolean":!1}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,i,n){let r,o;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof n=="number"?(r=new ws(e,t),o=new ws(i,n)):ws.isPosition(e)&&ws.isPosition(t)&&(r=ws.of(e),o=ws.of(t)),!r||!o)throw new Error("Invalid arguments");super(r,o),this._anchor=r,this._active=o}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 h7t(this)}};uC=cEe=D([Ii],uC);function bst(s){return s.isEmpty?`[${s.start.line}:${s.start.character})`:`[${s.start.line}:${s.start.character} -> ${s.end.line}:${s.end.character})`}function h7t(s){let e=bst(s);return s.isEmpty||(s.active.isEqual(s.start)?e=`|${e}`:e=`${e}|`),e}const wst=s=>{if(typeof s!="string"||s.length===0||!/^[0-9A-Za-z_\-]+$/.test(s))throw Fi("connectionToken")};let yst=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 Fi("host");if(typeof t!="number"||t===0||Math.round(t)!==t)throw Fi("port");typeof i<"u"&&wst(i),this.host=e,this.port=Math.round(t),this.connectionToken=i}},uz=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"&&wst(t)}},a1=class gj extends Error{static NotAvailable(e,t){return new gj(e,id.NotAvailable,t)}static TemporarilyNotAvailable(e){return new gj(e,id.TemporarilyNotAvailable)}constructor(e,t=id.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,Object.setPrototypeOf(this,gj.prototype)}};var T_;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(T_||(T_={}));var KT;(function(s){s[s.Replace=1]="Replace",s[s.Append=2]="Append",s[s.Prepend=3]="Prepend"})(KT||(KT={}));let qA=L0=class{static isTextEdit(e){return e instanceof L0?!0:e?Xn.isRange(e)&&typeof e.newText=="string":!1}static replace(e,t){return new L0(e,t)}static insert(e,t){return L0.replace(new Xn(e,e),t)}static delete(e){return L0.replace(e,"")}static setEndOfLine(e){const t=new L0(new Xn(new ws(0,0),new ws(0,0)),"");return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!Xn.isRange(e))throw Fi("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw Fi("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw Fi("newEol");this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};qA=L0=D([Ii],qA);let F9=ME=class{static isNotebookCellEdit(e){return e instanceof ME?!0:e?Dy.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new ME(e,t)}static insertCells(e,t){return new ME(new Dy(e,e),t)}static deleteCells(e){return new ME(e,[])}static updateCellMetadata(e,t){const i=new ME(new Dy(e,e),[]);return i.newCellMetadata=t,i}static updateNotebookMetadata(e){const t=new ME(new Dy(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};F9=ME=D([Ii],F9);let ele=class fj{static isSnippetTextEdit(e){return e instanceof fj?!0:e?Xn.isRange(e.range)&&vI.isSnippetString(e.snippet):!1}static replace(e,t){return new fj(e,t)}static insert(e,t){return fj.replace(new Xn(e,e),t)}constructor(e,t){this.range=e,this.snippet=t}};var bc;(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"})(bc||(bc={}));let _I=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,i,n){this._edits.push({_type:bc.File,from:e,to:t,options:i,metadata:n})}createFile(e,t,i){this._edits.push({_type:bc.File,from:void 0,to:e,options:t,metadata:i})}deleteFile(e,t,i){this._edits.push({_type:bc.File,from:e,to:void 0,options:t,metadata:i})}replaceNotebookMetadata(e,t,i){this._edits.push({_type:bc.Cell,metadata:i,uri:e,edit:{editType:mI.DocumentMetadata,metadata:t},notebookMetadata:t})}replaceNotebookCells(e,t,i,n){const r=t.start,o=t.end;(r!==o||i.length>0)&&this._edits.push({_type:bc.CellReplace,uri:e,index:r,count:o-r,cells:i,metadata:n})}replaceNotebookCellMetadata(e,t,i,n){this._edits.push({_type:bc.Cell,metadata:n,uri:e,edit:{editType:mI.Metadata,index:t,metadata:i}})}replace(e,t,i,n){this._edits.push({_type:bc.Text,uri:e,edit:new qA(t,i),metadata:n})}insert(e,t,i,n){this.replace(e,new Xn(t,t),i,n)}delete(e,t,i){this.replace(e,t,"",i)}has(e){return this._edits.some(t=>t._type===bc.Text&&t.uri.toString()===e.toString())}set(e,t){if(t)for(const i of t){if(!i)continue;let n,r;Array.isArray(i)?(n=i[0],r=i[1]):n=i,F9.isNotebookCellEdit(n)?n.newCellMetadata?this.replaceNotebookCellMetadata(e,n.range.start,n.newCellMetadata,r):n.newNotebookMetadata?this.replaceNotebookMetadata(e,n.newNotebookMetadata,r):this.replaceNotebookCells(e,n.range,n.newCells,r):ele.isSnippetTextEdit(n)?this._edits.push({_type:bc.Snippet,uri:e,range:n.range,edit:n.snippet,metadata:r}):this._edits.push({_type:bc.Text,uri:e,edit:n,metadata:r})}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 R0;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}};vI=R0=D([Ii],vI);var $x;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})($x||($x={}));var Hd;(function(s){s[s.Hint=3]="Hint",s[s.Information=2]="Information",s[s.Warning=1]="Warning",s[s.Error=0]="Error"})(Hd||(Hd={}));let Ap=lEe=class{static isLocation(e){return e instanceof lEe?!0:e?Xn.isRange(e.range)&&N.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(Xn.isRange(t))this.range=Xn.of(t);else if(ws.isPosition(t))this.range=new Xn(t,t);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};Ap=lEe=D([Ii],Ap);let rH=class{static is(e){return e?typeof e.message=="string"&&e.location&&Xn.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()}};rH=D([Ii],rH);let O9=class{constructor(e,t,i=Hd.Error){if(!Xn.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:Hd[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)&&ns(e.tags,t.tags)&&ns(e.relatedInformation,t.relatedInformation,rH.isEqual)}};O9=D([Ii],O9);let B9=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}};B9=D([Ii],B9);let W9=class extends B9{constructor(e,t,i,n){super(e,t),this.canIncreaseVerbosity=i,this.canDecreaseVerbosity=n}};W9=D([Ii],W9);var Qee;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(Qee||(Qee={}));var oH;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(oH||(oH={}));let H9=class{constructor(e,t=oH.Text){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:oH[this.kind]}}};H9=D([Ii],H9);let U9=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};U9=D([Ii],U9);var vo;(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"})(vo||(vo={}));var aH;(function(s){s[s.Deprecated=1]="Deprecated"})(aH||(aH={}));let cH=dEe=class{static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,t,i,n,r){this.name=e,this.kind=t,this.containerName=r,typeof i=="string"&&(this.containerName=i),n instanceof Ap?this.location=n:i instanceof Xn&&(this.location=new Ap(n,i)),dEe.validate(this)}toJSON(){return{name:this.name,kind:vo[this.kind],location:this.location,containerName:this.containerName}}};cH=dEe=D([Ii],cH);let lH=uj=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(uj.validate)}constructor(e,t,i,n,r){this.name=e,this.detail=t,this.kind=i,this.range=n,this.selectionRange=r,this.children=[],uj.validate(this)}};lH=uj=D([Ii],lH);var dH;(function(s){s[s.Invoke=1]="Invoke",s[s.Automatic=2]="Automatic"})(dH||(dH={}));let V9=class{constructor(e,t){this.title=e,this.kind=t}};V9=D([Ii],V9);var GR;let Aa=(GR=class{constructor(e){this.value=e}append(e){return new HV(this.value?this.value+HV.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+HV.sep)}},HV=GR,GR.sep=".",GR);Aa=HV=D([Ii],Aa);Aa.Empty=new Aa("");Aa.QuickFix=Aa.Empty.append("quickfix");Aa.Refactor=Aa.Empty.append("refactor");Aa.RefactorExtract=Aa.Refactor.append("extract");Aa.RefactorInline=Aa.Refactor.append("inline");Aa.RefactorMove=Aa.Refactor.append("move");Aa.RefactorRewrite=Aa.Refactor.append("rewrite");Aa.Source=Aa.Empty.append("source");Aa.SourceOrganizeImports=Aa.Source.append("organizeImports");Aa.SourceFixAll=Aa.Source.append("fixAll");Aa.Notebook=Aa.Empty.append("notebook");let hH=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")}};hH=D([Ii],hH);let tle=class{constructor(e,t,i,n,r,o){this.kind=e,this.name=t,this.detail=i,this.uri=n,this.range=r,this.selectionRange=o}},fPe=class{constructor(e,t){this.fromRanges=t,this.from=e}},pPe=class{constructor(e,t){this.fromRanges=t,this.to=e}};var qT;(function(s){s[s.Information=0]="Information",s[s.Warning=1]="Warning",s[s.Error=2]="Error"})(qT||(qT={}));let z9=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};z9=D([Ii],z9);var Hh,OGe;let gf=hEe=(OGe=class{constructor(e,t=!1){Ht(this,Hh);St(this,Hh,new Nt(e,{supportThemeIcons:t}))}static isMarkdownString(e){return e instanceof hEe?!0:e&&e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}get value(){return Ce(this,Hh).value}set value(e){Ce(this,Hh).value=e}get isTrusted(){return Ce(this,Hh).isTrusted}set isTrusted(e){Ce(this,Hh).isTrusted=e}get supportThemeIcons(){return Ce(this,Hh).supportThemeIcons}set supportThemeIcons(e){Ce(this,Hh).supportThemeIcons=e}get supportHtml(){return Ce(this,Hh).supportHtml}set supportHtml(e){Ce(this,Hh).supportHtml=e}get baseUri(){return Ce(this,Hh).baseUri}set baseUri(e){Ce(this,Hh).baseUri=e}appendText(e){return Ce(this,Hh).appendText(e),this}appendMarkdown(e){return Ce(this,Hh).appendMarkdown(e),this}appendCodeblock(e,t){return Ce(this,Hh).appendCodeblock(t??"",e),this}},Hh=new WeakMap,OGe);gf=hEe=D([Ii],gf);let jee=class{constructor(e,t){this.label=e,this.documentation=t}};jee=D([Ii],jee);let Yee=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};Yee=D([Ii],Yee);let Jee=class{constructor(){this.activeSignature=0,this.activeParameter=0,this.signatures=[]}};Jee=D([Ii],Jee);var Xee;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(Xee||(Xee={}));var Zee;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Zee||(Zee={}));let $9=class{constructor(e){this.value=e}};$9=D([Ii],$9);let G9=class{constructor(e,t,i){this.position=e,this.label=t,this.kind=i}};G9=D([Ii],G9);var QT;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(QT||(QT={}));var en;(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"})(en||(en={}));var uH;(function(s){s[s.Deprecated=1]="Deprecated"})(uH||(uH={}));let K9=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&en[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};K9=D([Ii],K9);let aN=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};aN=D([Ii],aN);let ete=class{constructor(e,t,i){this.insertText=e,this.range=t,this.command=i}};ete=D([Ii],ete);let tte=class{constructor(e){this.commands=void 0,this.suppressSuggestions=void 0,this.items=e}};tte=D([Ii],tte);var Gx;(function(s){s[s.Unknown=0]="Unknown",s[s.Word=1]="Word",s[s.Line=2]="Line",s[s.Suggest=3]="Suggest"})(Gx||(Gx={}));var gH;(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"})(gH||(gH={}));var NS;(function(s){s[s.Left=1]="Left",s[s.Right=2]="Right"})(NS||(NS={}));function u7t(s,e){return`${An.toKey(s)}.${e}`}var c_;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval"})(c_||(c_={}));var jT;(function(s){s[s.Manual=1]="Manual",s[s.AfterDelay=2]="AfterDelay",s[s.FocusOut=3]="FocusOut"})(jT||(jT={}));var q9;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(q9||(q9={}));var cN;(function(s){s[s.Keyboard=1]="Keyboard",s[s.Mouse=2]="Mouse",s[s.Command=3]="Command"})(cN||(cN={}));var fH;(function(s){s[s.Undo=1]="Undo",s[s.Redo=2]="Redo"})(fH||(fH={}));var Kx;(function(s){s[s.OpenOpen=0]="OpenOpen",s[s.ClosedClosed=1]="ClosedClosed",s[s.OpenClosed=2]="OpenClosed",s[s.ClosedOpen=3]="ClosedOpen"})(Kx||(Kx={}));(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})(cN||(cN={}));var lN;(function(s){s[s.Other=0]="Other",s[s.Comment=1]="Comment",s[s.String=2]="String",s[s.RegEx=3]="RegEx"})(lN||(lN={}));(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})(lN||(lN={}));let Q9=class{constructor(e,t){if(t&&!N.isUri(t))throw Fi("target");if(!Xn.isRange(e)||e.isEmpty)throw Fi("range");this.range=e,this.target=t}};Q9=D([Ii],Q9);let dN=class{constructor(e,t,i,n){this.red=e,this.green=t,this.blue=i,this.alpha=n}};dN=D([Ii],dN);let j9=class{constructor(e,t){if(t&&!(t instanceof dN))throw Fi("color");if(!Xn.isRange(e)||e.isEmpty)throw Fi("range");this.range=e,this.color=t}};j9=D([Ii],j9);let Y9=class{constructor(e){if(!e||typeof e!="string")throw Fi("label");this.label=e}};Y9=D([Ii],Y9);var ite;(function(s){s[s.Error=0]="Error",s[s.Warning=1]="Warning",s[s.Information=2]="Information"})(ite||(ite={}));var nte;(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"})(nte||(nte={}));var CD;(function(s){s[s.Low=0]="Low",s[s.Medium=1]="Medium",s[s.High=2]="High"})(CD||(CD={}));let Cst=class{constructor(e,t,i){if(this.startIndex=e,this.length=t,this.tooltip=i,typeof e!="number"||e<0)throw Fi("startIndex");if(typeof t!="number"||t<1)throw Fi("length");if(i!==void 0&&typeof i!="string")throw Fi("tooltip")}},Sst=class{constructor(e){this.uri=e}};class Ast{constructor(e){this.terminalCommand=e}}var ste;(function(s){s[s.Panel=1]="Panel",s[s.Editor=2]="Editor"})(ste||(ste={}));let Est=class{constructor(e){if(this.options=e,typeof e!="object")throw Fi("options")}};var rte;(function(s){s[s.Always=1]="Always",s[s.Silent=2]="Silent",s[s.Never=3]="Never"})(rte||(rte={}));var ote;(function(s){s[s.Shared=1]="Shared",s[s.Dedicated=2]="Dedicated",s[s.New=3]="New"})(ote||(ote={}));var fy;let pH=(fy=class{static from(e){switch(e){case"clean":return cw.Clean;case"build":return cw.Build;case"rebuild":return cw.Rebuild;case"test":return cw.Test;default:return}}constructor(e,t){if(this.label=t,typeof e!="string"||typeof t!="string")throw Fi("name");this._id=e}get id(){return this._id}},cw=fy,fy.Clean=new cw("clean","Clean"),fy.Build=new cw("build","Build"),fy.Rebuild=new cw("rebuild","Rebuild"),fy.Test=new cw("test","Test"),fy);pH=cw=D([Ii],pH);function xst(s){let e="";for(let t=0;t0)for(const t of this._args)e.push(t);return xst(e)}};hN=D([Ii],hN);let bI=class{constructor(e,t,i){if(this._args=[],Array.isArray(t)){if(!e)throw Fi("command can't be undefined or null");if(typeof e!="string"&&typeof e.value!="string")throw Fi("command");this._command=e,this._args=t,this._options=i}else{if(typeof e!="string")throw Fi("commandLine");this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!="string")throw Fi("commandLine");this._commandLine=e}get command(){return this._command?this._command:""}set command(e){if(typeof e!="string"&&typeof e.value!="string")throw Fi("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 xst(e)}};bI=D([Ii],bI);var ate;(function(s){s[s.Escape=1]="Escape",s[s.Strong=2]="Strong",s[s.Weak=3]="Weak"})(ate||(ate={}));var wI;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace"})(wI||(wI={}));let ile=class{constructor(e){this._callback=e}computeId(){return"customExecution"+ao()}set callback(e){this._callback=e}get callback(){return this._callback}};var py;let J9=(py=class{constructor(e,t,i,n,r,o){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=r,this.__deprecated=!0):t===wI.Global||t===wI.Workspace?(this.target=t,this._name=this.name=i,this._source=this.source=n,this.execution=r,a=o):(this.target=t,this._name=this.name=i,this._source=this.source=n,this.execution=r,a=o),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 hN?this._definition={type:lw.ProcessType,id:this._execution.computeId()}:this._execution instanceof bI?this._definition={type:lw.ShellType,id:this._execution.computeId()}:this._execution instanceof ile?this._definition={type:lw.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:lw.EmptyType,id:ao()}}get definition(){return this._definition}set definition(e){if(e==null)throw Fi("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 Fi("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;(lw.EmptyType===t||lw.ProcessType===t||lw.ShellType===t||lw.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 Fi("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}},lw=py,py.ExtensionCallbackType="customExecution",py.ProcessType="process",py.ShellType="shell",py.EmptyType="$empty",py);J9=lw=D([Ii],J9);var SD;(function(s){s[s.SourceControl=1]="SourceControl",s[s.Window=10]="Window",s[s.Notification=15]="Notification"})(SD||(SD={}));var fEe;(function(s){function e(t){const i=t;return dc(i.value)?i.tooltip&&!Rt(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})(fEe||(fEe={}));let X9=uEe=class{static isTreeItem(e,t){const i=e;if(i.checkboxState!==void 0){const n=dc(i.checkboxState)?i.checkboxState:In(i.checkboxState)&&dc(i.checkboxState.state)?i.checkboxState.state:void 0,r=!dc(i.checkboxState)&&In(i.checkboxState)?i.checkboxState.tooltip:void 0;if(n===void 0||n!==fb.Checked&&n!==fb.Unchecked||r!==void 0&&!Rt(r))return console.log("INVALID tree item, invalid checkboxState",i.checkboxState),!1}if(e instanceof uEe)return!0;if(i.label!==void 0&&!Rt(i.label)&&!i.label?.label)return console.log("INVALID tree item, invalid label",i.label),!1;if(i.id!==void 0&&!Rt(i.id))return console.log("INVALID tree item, invalid id",i.id),!1;if(i.iconPath!==void 0&&!Rt(i.iconPath)&&!N.isUri(i.iconPath)&&(!i.iconPath||!Rt(i.iconPath.id))){const n=i.iconPath;if(!n||!Rt(n.light)&&!N.isUri(n.light)&&!Rt(n.dark)&&!N.isUri(n.dark))return console.log("INVALID tree item, invalid iconPath",i.iconPath),!1}return i.description!==void 0&&!Rt(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&&!Rt(i.tooltip)&&!(i.tooltip instanceof gf)?(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.collapsibleStateAD.Expanded?(console.log("INVALID tree item, invalid collapsibleState",i.collapsibleState),!1):i.contextValue!==void 0&&!Rt(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=AD.None){this.collapsibleState=t,N.isUri(e)?this.resourceUri=e:this.label=e}};X9=uEe=D([Ii],X9);var AD;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(AD||(AD={}));var fb;(function(s){s[s.Unchecked=0]="Unchecked",s[s.Checked=1]="Checked"})(fb||(fb={}));let Z9=class{async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}constructor(e){this.value=e}};Z9=D([Ii],Z9);class cte extends Z9{}var x7;class g7t extends cte{constructor(t){super("");Ht(this,x7);St(this,x7,t)}asFile(){return Ce(this,x7)}}x7=new WeakMap;class f7t{constructor(e,t,i,n){this.name=e,this.uri=t,this._itemId=i,this._getData=n}data(){return this._getData()}}var nS,Z1,UV,BGe;let mH=(BGe=class{constructor(e){Ht(this,Z1);Ht(this,nS,new Map);for(const[t,i]of e??[]){const n=Ce(this,nS).get(a4(this,Z1,UV).call(this,t));n?n.push(i):Ce(this,nS).set(a4(this,Z1,UV).call(this,t),[i])}}get(e){return Ce(this,nS).get(a4(this,Z1,UV).call(this,e))?.[0]}set(e,t){Ce(this,nS).set(a4(this,Z1,UV).call(this,e),[t])}forEach(e,t){for(const[i,n]of Ce(this,nS))for(const r of n)e.call(t,r,i,this)}*[Symbol.iterator](){for(const[e,t]of Ce(this,nS))for(const i of t)yield[e,i]}},nS=new WeakMap,Z1=new WeakSet,UV=function(e){return e.toLowerCase()},BGe);mH=D([Ii],mH);let lte=class{constructor(e,t,i){this.insertText=e,this.title=t,this.kind=i}};lte=D([Ii],lte);var dte;(function(s){s[s.Automatic=0]="Automatic",s[s.PasteAs=1]="PasteAs"})(dte||(dte={}));var eA;let e$=(eA=class{constructor(e){this.value=e}append(...e){return new eA((this.value?[this.value,...e]:e).join(eA.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+eA.sep)}},eA.sep=".",eA);e$.Empty=new e$("");let Dst=class{constructor(e,t,i){this.title=t,this.insertText=e,this.kind=i}},fu=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}};fu=D([Ii],fu);fu.File=new fu("file");fu.Folder=new fu("folder");let _H=class{constructor(e){this.id=e}};_H=D([Ii],_H);var YT;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace",s[s.WorkspaceFolder=3]="WorkspaceFolder"})(YT||(YT={}));let JT=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 Fi("base");if(typeof t!="string")throw Fi("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()}}};JT=D([Ii],JT);const kst=new WeakMap;function p7t(s,e){kst.set(s,e)}let uN=class{constructor(e,t,i,n,r){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 r=="string"&&(this.mode=r)}get id(){return this._id||(this._id=kst.get(this)??ao()),this._id}};uN=D([Ii],uN);let qx=class extends uN{constructor(e,t,i,n,r,o){if(super(t,i,n,r,o),e===null)throw Fi("location");this.location=e}};qx=D([Ii],qx);let Qx=class extends uN{constructor(e,t,i,n,r,o){super(t,i,n,r,o),this.functionName=e}};Qx=D([Ii],Qx);let hte=class extends uN{constructor(e,t,i,n,r,o,a,c){if(super(n,r,o,a,c),!t)throw Fi("dataId");this.label=e,this.dataId=t,this.canPersist=i}};hte=D([Ii],hte);let t$=class{constructor(e,t,i){this.command=e,this.args=t||[],this.options=i}};t$=D([Ii],t$);let vH=class{constructor(e,t){this.port=e,this.host=t}};vH=D([Ii],vH);let i$=class{constructor(e){this.path=e}};i$=D([Ii],i$);let n$=class{constructor(e){this.implementation=e}};n$=D([Ii],n$);let mPe=class{constructor(e,t,i){this.session=e,this.threadId=t,this.frameId=i}},_Pe=class{constructor(e,t){this.session=e,this.threadId=t}},s$=class{constructor(e,t){this.range=e,this.expression=t}};s$=D([Ii],s$);var bH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(bH||(bH={}));let r$=class{constructor(e,t){this.range=e,this.text=t}};r$=D([Ii],r$);let o$=class{constructor(e,t,i=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=i}};o$=D([Ii],o$);let a$=class{constructor(e,t){this.range=e,this.expression=t}};a$=D([Ii],a$);let pEe=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};pEe=D([Ii],pEe);var ute;(function(s){s[s.AIGenerated=1]="AIGenerated"})(ute||(ute={}));var wH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(wH||(wH={}));let Ist=class{constructor(e,t){this.newSymbolName=e,this.tags=t}};var XT;(function(s){s[s.Changed=1]="Changed",s[s.Created=2]="Created",s[s.Deleted=3]="Deleted"})(XT||(XT={}));let Xc=Ag=class extends Error{static FileExists(e){return new Ag(e,ot.FileExists,Ag.FileExists)}static FileNotFound(e){return new Ag(e,ot.FileNotFound,Ag.FileNotFound)}static FileNotADirectory(e){return new Ag(e,ot.FileNotADirectory,Ag.FileNotADirectory)}static FileIsADirectory(e){return new Ag(e,ot.FileIsADirectory,Ag.FileIsADirectory)}static NoPermissions(e){return new Ag(e,ot.NoPermissions,Ag.NoPermissions)}static Unavailable(e){return new Ag(e,ot.Unavailable,Ag.Unavailable)}constructor(e,t=ot.Unknown,i){super(N.isUri(e)?e.toString(!0):e),this.code=i?.name??"Unknown",xYe(this,t),Object.setPrototypeOf(this,Ag.prototype),typeof Error.captureStackTrace=="function"&&typeof i=="function"&&Error.captureStackTrace(this,i)}};Xc=Ag=D([Ii],Xc);let gte=class{constructor(e,t,i){this.start=e,this.end=t,this.kind=i}};gte=D([Ii],gte);var Gw;(function(s){s[s.Comment=1]="Comment",s[s.Imports=2]="Imports",s[s.Region=3]="Region"})(Gw||(Gw={}));var yH;(function(s){s[s.Collapsed=0]="Collapsed",s[s.Expanded=1]="Expanded"})(yH||(yH={}));var fte;(function(s){s[s.Editing=0]="Editing",s[s.Preview=1]="Preview"})(fte||(fte={}));var pte;(function(s){s[s.Published=0]="Published",s[s.Draft=1]="Draft"})(pte||(pte={}));var CH;(function(s){s[s.Unresolved=0]="Unresolved",s[s.Resolved=1]="Resolved"})(CH||(CH={}));var SH;(function(s){s[s.Current=0]="Current",s[s.Outdated=1]="Outdated"})(SH||(SH={}));var AH;(function(s){s[s.Reply=1]="Reply",s[s.Comment=2]="Comment"})(AH||(AH={}));let mte=class{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}};function m7t(s){return typeof s>"u"||KGe(s)}let Tst=class Lst{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 r>"u"&&(r=0),this._pushEncoded(e,t,i,n,r);if(Xn.isRange(e)&&typeof t=="string"&&m7t(i))return this._push(e,t,i);throw Fi()}_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,r=e.start.character,o=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,r,o,a,c)}_pushEncoded(e,t,i,n,r){if(this._dataIsSortedAndDeltaEncoded&&(e0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,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 r=0,o=0;for(let a=0;at)throw new Error("The 'badge'-property must be undefined or a short character")}else if(e.badge&&!fu.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}},vte=class{constructor(e){this.kind=e}};vte=D([Ii],vte);var wS;(function(s){s[s.Light=1]="Light",s[s.Dark=2]="Dark",s[s.HighContrast=3]="HighContrast",s[s.HighContrastLight=4]="HighContrastLight"})(wS||(wS={}));let Dy=class mEe{static isNotebookRange(e){return e instanceof mEe?!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 Fi("start must be positive");if(t<0)throw Fi("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 mEe(t,i)}},vG=class _Ee{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=>_Ee.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(e,t,i,n,r,o,a){this.kind=e,this.value=t,this.languageId=i,this.mime=n,this.outputs=r??[],this.metadata=o,this.executionSummary=a,_Ee.validate(this)}},bPe=class{constructor(e){this.cells=e}};var Uf,loe;let wPe=(Uf=class{static isNotebookCellOutputItem(e){return e instanceof Uf?!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 Uf.json(t,"application/vnd.code.notebook.error")}static stdout(e){return Uf.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return Uf.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,t="application/octet-stream"){return new Uf(e,t)}static text(e,t=Vs.text){const i=Ce(Uf,loe).encode(String(e));return new Uf(i,t)}static json(e,t="text/x-json"){const i=JSON.stringify(e,void 0," ");return Uf.text(i,t)}constructor(e,t){this.data=e,this.mime=t;const i=Bqe(t,!0);if(!i)throw new Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=i}},loe=new WeakMap,Ht(Uf,loe,new TextEncoder),Uf),d$=class vEe{static isNotebookCellOutput(e){return e instanceof vEe?!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 r=0;r!n.has(o))}constructor(e,t,i){this.items=vEe.ensureUniqueMimeTypes(e,!0),typeof t=="string"?(this.id=t,this.metadata=i):(this.id=ao(),this.metadata=t??i)}};var jx;(function(s){s[s.Markup=1]="Markup",s[s.Code=2]="Code"})(jx||(jx={}));var fN;(function(s){s[s.Idle=1]="Idle",s[s.Pending=2]="Pending",s[s.Executing=3]="Executing"})(fN||(fN={}));var h$;(function(s){s[s.Left=1]="Left",s[s.Right=2]="Right"})(h$||(h$={}));var u$;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(u$||(u$={}));let Mst=class{constructor(e,t){this.text=e,this.alignment=t}};var bte;(function(s){s[s.Default=1]="Default",s[s.Preferred=2]="Preferred"})(bte||(bte={}));var g$;(function(s){s[s.Default=1]="Default",s[s.Preferred=2]="Preferred",s[s.Hidden=-1]="Hidden"})(g$||(g$={}));let yPe=class{constructor(e,t=[]){this.uri=e,this.provides=z_(t)}},Nst=class{constructor(e){this.label=e}};var DH;(function(s){s[s.Named=1]="Named",s[s.Indexed=2]="Indexed"})(DH||(DH={}));let wte=class{constructor(e,t){this.label=e,this.timestamp=t}};wte=D([Ii],wte);var eL;(function(s){s[s.Production=1]="Production",s[s.Development=2]="Development",s[s.Test=3]="Test"})(eL||(eL={}));var f$;(function(s){s[s.Node=1]="Node",s[s.Webworker=2]="Webworker"})(f$||(f$={}));var PS;(function(s){s[s.Other=0]="Other",s[s.Comment=1]="Comment",s[s.String=2]="String",s[s.RegEx=3]="RegEx"})(PS||(PS={}));let Pst=class{constructor(e,t){this.ranges=e,this.wordPattern=t}},Fst=class{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}};var yte;(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"})(yte||(yte={}));var tL;(function(s){s[s.Run=1]="Run",s[s.Debug=2]="Debug",s[s.Coverage=3]="Coverage"})(tL||(tL={}));let p$=class{constructor(e=void 0,t=void 0,i=void 0,n=!1,r=!0){this.include=e,this.exclude=t,this.profile=i,this.continuous=n,this.preserveFocus=r}};p$=D([Ii],p$);let pN=gEe=class{static diff(e,t,i){const n=new gEe(e);return n.expectedOutput=t,n.actualOutput=i,n}constructor(e){this.message=e}};pN=gEe=D([Ii],pN);let kH=class{constructor(e){this.id=e}};kH=D([Ii],kH);let Ost=class{constructor(e,t,i){this.label=e,this.file=t,this.position=i}},fz=class{constructor(e,t){this.covered=e,this.total=t,pj(this)}};function pj(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 mN=class Bst{static fromDetails(e,t){const i=new fz(0,0),n=new fz(0,0),r=new fz(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 r.total+=1,r.covered+=a.executed?1:0;const o=new Bst(e,i,n.total>0?n:void 0,r.total>0?r:void 0);return o.detailedCoverage=t,o}constructor(e,t,i,n,r=[]){this.uri=e,this.statementCoverage=t,this.branchCoverage=i,this.declarationCoverage=n,this.fromTests=r}},Wst=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}},Hst=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}},Ust=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 Cte;(function(s){s[s.None=0]="None",s[s.Option=1]="Option",s[s.Default=2]="Default",s[s.Preferred=3]="Preferred"})(Cte||(Cte={}));var bEe;(function(s){s[s.Untrusted=0]="Untrusted",s[s.Trusted=1]="Trusted",s[s.Unspecified=2]="Unspecified"})(bEe||(bEe={}));var Ste;(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"})(Ste||(Ste={}));let nle=class{constructor(e,t,i,n,r,o){this.kind=e,this.name=t,this.detail=i,this.uri=n,this.range=r,this.selectionRange=o}};class sle{constructor(e){this.uri=e}}class m${constructor(e,t){this.original=e,this.modified=t}}class CPe{constructor(e,t,i,n){this.base=e,this.input1=t,this.input2=i,this.result=n}}class rle{constructor(e,t){this.uri=e,this.viewType=t}}class SPe{constructor(e){this.viewType=e}}class ole{constructor(e,t){this.uri=e,this.notebookType=t}}class ale{constructor(e,t,i){this.original=e,this.modified=t,this.notebookType=i}}class APe{constructor(){}}class EPe{constructor(e,t){this.uri=e,this.inputBoxUri=t}}class xPe{constructor(){}}class DPe{constructor(e){this.textDiffs=e}}var wEe;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(wEe||(wEe={}));var Ate;(function(s){s[s.Action=1]="Action",s[s.Toolbar=2]="Toolbar"})(Ate||(Ate={}));var Ete;(function(s){s[s.Short=1]="Short",s[s.Medium=2]="Medium",s[s.Full=3]="Full"})(Ete||(Ete={}));let Vst=class{constructor(e,t,i){this.id=e,this.label=t,this.values=i}};var yEe;(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"})(yEe||(yEe={}));var IH;(function(s){s[s.Unhelpful=0]="Unhelpful",s[s.Helpful=1]="Helpful"})(IH||(IH={}));let bG=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 gf(e):e}},TH=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 gf(e):e,this.vulnerabilities=t}},LH=class{constructor(e,t){this.participant=e,this.command=t}},_$=class{constructor(e,t,i,n){this.title=e,this.message=t,this.data=i,this.buttons=n}},wG=class{constructor(e,t){this.value=e,this.baseUri=t}},yG=class{constructor(e,t){this.value=e,this.title=t}},RH=class{constructor(e){this.value=e}},kPe=class{constructor(e,t){this.value=e,this.task=t}},MH=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 gf(e):e}},CG=class{constructor(e){this.value=e}},Rb=class{constructor(e,t,i){this.value=e,this.iconPath=t,this.options=i}},v$=class{constructor(e,t,i){this.value=e,this.license=t,this.snippet=i}},NH=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}},TPe=class{constructor(e,t,i,n){this.response=e,this.result=t,this.participant=i,this.command=n}};var l_;(function(s){s[s.Panel=1]="Panel",s[s.Terminal=2]="Terminal",s[s.Notebook=3]="Notebook",s[s.Editor=4]="Editor"})(l_||(l_={}));var xte;(function(s){s[s.Complete=1]="Complete",s[s.Partial=2]="Partial",s[s.Omitted=3]="Omitted"})(xte||(xte={}));let LPe=class{constructor(e,t,i){this.document=e,this.selection=t,this.wholeRange=i}},RPe=class{constructor(e){this.cell=e}};var jp;(function(s){s[s.User=1]="User",s[s.Assistant=2]="Assistant",s[s.System=3]="System"})(jp||(jp={}));class b${constructor(e,t,i){this.name=e,this.content=t,this.isError=i??!1}}let MPe=class CEe{static User(e,t){const i=new CEe(jp.User,typeof e=="string"?e:"",t);return i.content2=e,i}static Assistant(e,t){return new CEe(jp.Assistant,e,t)}constructor(e,t,i){this.role=e,this.content=t,this.content2=t,this.name=i}};class cle{constructor(e,t){this.name=e,this.parameters=t}}class PH{constructor(e){this.value=e}}let Ow=class M0 extends Error{static NotFound(e){return new M0(e,M0.NotFound.name)}static NoPermissions(e){return new M0(e,M0.NoPermissions.name)}static Blocked(e){return new M0(e,M0.Blocked.name)}constructor(e,t,i){super(e,{cause:i}),this.name="LanguageModelError",this.code=t??""}};var Dte;(function(s){s[s.SymbolInformation=1]="SymbolInformation",s[s.CommandInformation=2]="CommandInformation",s[s.SearchInformation=3]="SearchInformation",s[s.SettingInformation=4]="SettingInformation"})(Dte||(Dte={}));var kte;(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"})(kte||(kte={}));var Ite;(function(s){s[s.Started=1]="Started",s[s.Stopped=2]="Stopped",s[s.Error=3]="Error"})(Ite||(Ite={}));var Tte;(function(s){s[s.Recognized=1]="Recognized",s[s.Stopped=2]="Stopped"})(Tte||(Tte={}));let zst=class{constructor(e,t){this.text=e,this.range=t}};var FH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(FH||(FH={}));var RF;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(RF||(RF={}));var ua;(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"})(ua||(ua={}));var mh;(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"})(mh||(mh={}));var wc;(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"})(wc||(wc={}));var MF;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(MF||(MF={}));var iL;(function(s){s[s.None=0]="None",s[s.Process=1]="Process",s[s.Output=2]="Output",s[s.Hybrid=3]="Hybrid"})(iL||(iL={}));var Ri;(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"})(Ri||(Ri={}));var ky;(function(s){s.defaultRanges="a",s.completions="b",s.isIncomplete="c",s.duration="d"})(ky||(ky={}));const We={MainThreadAuthentication:Ye("MainThreadAuthentication"),MainThreadBulkEdits:Ye("MainThreadBulkEdits"),MainThreadLanguageModels:Ye("MainThreadLanguageModels"),MainThreadEmbeddings:Ye("MainThreadEmbeddings"),MainThreadChatAgents2:Ye("MainThreadChatAgents2"),MainThreadChatVariables:Ye("MainThreadChatVariables"),MainThreadLanguageModelTools:Ye("MainThreadChatSkills"),MainThreadClipboard:Ye("MainThreadClipboard"),MainThreadCommands:Ye("MainThreadCommands"),MainThreadComments:Ye("MainThreadComments"),MainThreadConfiguration:Ye("MainThreadConfiguration"),MainThreadConsole:Ye("MainThreadConsole"),MainThreadDebugService:Ye("MainThreadDebugService"),MainThreadDecorations:Ye("MainThreadDecorations"),MainThreadDiagnostics:Ye("MainThreadDiagnostics"),MainThreadDialogs:Ye("MainThreadDiaglogs"),MainThreadDocuments:Ye("MainThreadDocuments"),MainThreadDocumentContentProviders:Ye("MainThreadDocumentContentProviders"),MainThreadTextEditors:Ye("MainThreadTextEditors"),MainThreadEditorInsets:Ye("MainThreadEditorInsets"),MainThreadEditorTabs:Ye("MainThreadEditorTabs"),MainThreadErrors:Ye("MainThreadErrors"),MainThreadTreeViews:Ye("MainThreadTreeViews"),MainThreadDownloadService:Ye("MainThreadDownloadService"),MainThreadLanguageFeatures:Ye("MainThreadLanguageFeatures"),MainThreadLanguages:Ye("MainThreadLanguages"),MainThreadLogger:Ye("MainThreadLogger"),MainThreadMessageService:Ye("MainThreadMessageService"),MainThreadOutputService:Ye("MainThreadOutputService"),MainThreadProgress:Ye("MainThreadProgress"),MainThreadQuickDiff:Ye("MainThreadQuickDiff"),MainThreadQuickOpen:Ye("MainThreadQuickOpen"),MainThreadStatusBar:Ye("MainThreadStatusBar"),MainThreadSecretState:Ye("MainThreadSecretState"),MainThreadStorage:Ye("MainThreadStorage"),MainThreadSpeech:Ye("MainThreadSpeechProvider"),MainThreadTelemetry:Ye("MainThreadTelemetry"),MainThreadTerminalService:Ye("MainThreadTerminalService"),MainThreadTerminalShellIntegration:Ye("MainThreadTerminalShellIntegration"),MainThreadWebviews:Ye("MainThreadWebviews"),MainThreadWebviewPanels:Ye("MainThreadWebviewPanels"),MainThreadWebviewViews:Ye("MainThreadWebviewViews"),MainThreadCustomEditors:Ye("MainThreadCustomEditors"),MainThreadUrls:Ye("MainThreadUrls"),MainThreadUriOpeners:Ye("MainThreadUriOpeners"),MainThreadProfileContentHandlers:Ye("MainThreadProfileContentHandlers"),MainThreadWorkspace:Ye("MainThreadWorkspace"),MainThreadFileSystem:Ye("MainThreadFileSystem"),MainThreadFileSystemEventService:Ye("MainThreadFileSystemEventService"),MainThreadExtensionService:Ye("MainThreadExtensionService"),MainThreadSCM:Ye("MainThreadSCM"),MainThreadSearch:Ye("MainThreadSearch"),MainThreadShare:Ye("MainThreadShare"),MainThreadTask:Ye("MainThreadTask"),MainThreadWindow:Ye("MainThreadWindow"),MainThreadLabelService:Ye("MainThreadLabelService"),MainThreadNotebook:Ye("MainThreadNotebook"),MainThreadNotebookDocuments:Ye("MainThreadNotebookDocumentsShape"),MainThreadNotebookEditors:Ye("MainThreadNotebookEditorsShape"),MainThreadNotebookKernels:Ye("MainThreadNotebookKernels"),MainThreadNotebookRenderers:Ye("MainThreadNotebookRenderers"),MainThreadInteractive:Ye("MainThreadInteractive"),MainThreadTheming:Ye("MainThreadTheming"),MainThreadTunnelService:Ye("MainThreadTunnelService"),MainThreadManagedSockets:Ye("MainThreadManagedSockets"),MainThreadTimeline:Ye("MainThreadTimeline"),MainThreadTesting:Ye("MainThreadTesting"),MainThreadLocalization:Ye("MainThreadLocalizationShape"),MainThreadAiRelatedInformation:Ye("MainThreadAiRelatedInformation"),MainThreadAiEmbeddingVector:Ye("MainThreadAiEmbeddingVector")},Je={ExtHostCommands:Ye("ExtHostCommands"),ExtHostConfiguration:Ye("ExtHostConfiguration"),ExtHostDiagnostics:Ye("ExtHostDiagnostics"),ExtHostDebugService:Ye("ExtHostDebugService"),ExtHostDecorations:Ye("ExtHostDecorations"),ExtHostDocumentsAndEditors:Ye("ExtHostDocumentsAndEditors"),ExtHostDocuments:Ye("ExtHostDocuments"),ExtHostDocumentContentProviders:Ye("ExtHostDocumentContentProviders"),ExtHostDocumentSaveParticipant:Ye("ExtHostDocumentSaveParticipant"),ExtHostEditors:Ye("ExtHostEditors"),ExtHostTreeViews:Ye("ExtHostTreeViews"),ExtHostFileSystem:Ye("ExtHostFileSystem"),ExtHostFileSystemInfo:Ye("ExtHostFileSystemInfo"),ExtHostFileSystemEventService:Ye("ExtHostFileSystemEventService"),ExtHostLanguages:Ye("ExtHostLanguages"),ExtHostLanguageFeatures:Ye("ExtHostLanguageFeatures"),ExtHostQuickOpen:Ye("ExtHostQuickOpen"),ExtHostQuickDiff:Ye("ExtHostQuickDiff"),ExtHostStatusBar:Ye("ExtHostStatusBar"),ExtHostShare:Ye("ExtHostShare"),ExtHostExtensionService:Ye("ExtHostExtensionService"),ExtHostLogLevelServiceShape:Ye("ExtHostLogLevelServiceShape"),ExtHostTerminalService:Ye("ExtHostTerminalService"),ExtHostTerminalShellIntegration:Ye("ExtHostTerminalShellIntegration"),ExtHostSCM:Ye("ExtHostSCM"),ExtHostSearch:Ye("ExtHostSearch"),ExtHostTask:Ye("ExtHostTask"),ExtHostWorkspace:Ye("ExtHostWorkspace"),ExtHostWindow:Ye("ExtHostWindow"),ExtHostWebviews:Ye("ExtHostWebviews"),ExtHostWebviewPanels:Ye("ExtHostWebviewPanels"),ExtHostCustomEditors:Ye("ExtHostCustomEditors"),ExtHostWebviewViews:Ye("ExtHostWebviewViews"),ExtHostEditorInsets:Ye("ExtHostEditorInsets"),ExtHostEditorTabs:Ye("ExtHostEditorTabs"),ExtHostProgress:Ye("ExtHostProgress"),ExtHostComments:Ye("ExtHostComments"),ExtHostSecretState:Ye("ExtHostSecretState"),ExtHostStorage:Ye("ExtHostStorage"),ExtHostUrls:Ye("ExtHostUrls"),ExtHostUriOpeners:Ye("ExtHostUriOpeners"),ExtHostProfileContentHandlers:Ye("ExtHostProfileContentHandlers"),ExtHostOutputService:Ye("ExtHostOutputService"),ExtHostLabelService:Ye("ExtHostLabelService"),ExtHostNotebook:Ye("ExtHostNotebook"),ExtHostNotebookDocuments:Ye("ExtHostNotebookDocuments"),ExtHostNotebookEditors:Ye("ExtHostNotebookEditors"),ExtHostNotebookKernels:Ye("ExtHostNotebookKernels"),ExtHostNotebookRenderers:Ye("ExtHostNotebookRenderers"),ExtHostNotebookDocumentSaveParticipant:Ye("ExtHostNotebookDocumentSaveParticipant"),ExtHostInteractive:Ye("ExtHostInteractive"),ExtHostChatAgents2:Ye("ExtHostChatAgents"),ExtHostChatVariables:Ye("ExtHostChatVariables"),ExtHostLanguageModelTools:Ye("ExtHostChatSkills"),ExtHostChatProvider:Ye("ExtHostChatProvider"),ExtHostSpeech:Ye("ExtHostSpeech"),ExtHostEmbeddings:Ye("ExtHostEmbeddings"),ExtHostAiRelatedInformation:Ye("ExtHostAiRelatedInformation"),ExtHostAiEmbeddingVector:Ye("ExtHostAiEmbeddingVector"),ExtHostTheming:Ye("ExtHostTheming"),ExtHostTunnelService:Ye("ExtHostTunnelService"),ExtHostManagedSockets:Ye("ExtHostManagedSockets"),ExtHostAuthentication:Ye("ExtHostAuthentication"),ExtHostTimeline:Ye("ExtHostTimeline"),ExtHostTesting:Ye("ExtHostTesting"),ExtHostTelemetry:Ye("ExtHostTelemetry"),ExtHostLocalization:Ye("ExtHostLocalization")};var Lte;(function(s){s[s.Complete=100]="Complete",s[s.Partial=50]="Partial",s[s.None=0]="None"})(Lte||(Lte={}));let SEe;function $st(s){SEe=s}function Sd(s){return new Proxy({},{get(e,t){if(SEe==null)throw new Error("Default api is not ready yet, do not forget to import 'vscode/localExtensionHost' and wait for services initialization");return SEe[s][t]}})}const _7t={version:"1.92.2",tasks:Sd("tasks"),notebooks:Sd("notebooks"),scm:Sd("scm"),comments:Sd("comments"),authentication:Sd("authentication"),tests:Sd("tests"),extensions:Sd("extensions"),debug:Sd("debug"),env:Sd("env"),commands:Sd("commands"),window:Sd("window"),workspace:Sd("workspace"),languages:Sd("languages"),l10n:Sd("l10n"),interactive:Sd("interactive"),ai:Sd("ai"),chat:Sd("chat"),speech:Sd("speech"),lm:Sd("lm"),Breakpoint:uN,TerminalOutputAnchor:qee,ChatResultFeedbackKind:IH,ChatVariableLevel:Ete,ChatCompletionItem:Vst,CallHierarchyIncomingCall:fPe,CallHierarchyItem:tle,CallHierarchyOutgoingCall:pPe,CancellationError:Na,CancellationTokenSource:li,CandidatePortSource:iL,CodeAction:V9,CodeActionKind:Aa,CodeActionTriggerKind:dH,CodeLens:z9,Color:dN,ColorInformation:j9,ColorPresentation:Y9,ColorThemeKind:wS,CommentMode:fte,CommentState:pte,CommentThreadCollapsibleState:yH,CommentThreadState:CH,CommentThreadApplicability:SH,CommentThreadFocus:AH,CompletionItem:K9,CompletionItemKind:en,CompletionItemTag:uH,CompletionList:aN,CompletionTriggerKind:QT,ConfigurationTarget:YT,CustomExecution:ile,DebugAdapterExecutable:t$,DebugAdapterInlineImplementation:n$,DebugAdapterNamedPipeServer:i$,DebugAdapterServer:vH,DebugConfigurationProviderTriggerKind:R9,DebugConsoleMode:c$,DebugVisualization:Rst,DecorationRangeBehavior:Kx,Diagnostic:O9,DiagnosticRelatedInformation:rH,DiagnosticSeverity:Hd,DiagnosticTag:$x,Disposable:js,DocumentHighlight:H9,DocumentHighlightKind:oH,MultiDocumentHighlight:U9,DocumentLink:Q9,DocumentSymbol:lH,EndOfLine:T_,EnvironmentVariableMutatorType:KT,EvaluatableExpression:s$,InlineValueText:r$,InlineValueVariableLookup:o$,InlineValueEvaluatableExpression:a$,InlineCompletionTriggerKind:bH,EventEmitter:I,ExtensionKind:ED,ExtensionMode:eL,ExternalUriOpenerPriority:Cte,FileChangeType:XT,FileDecoration:l$,FileDecoration2:l$,FileSystemError:Xc,FileType:rn,FilePermission:up,FoldingRange:gte,FoldingRangeKind:Gw,FunctionBreakpoint:Qx,InlineCompletionItem:ete,InlineCompletionList:tte,Hover:B9,VerboseHover:W9,HoverVerbosityAction:Qee,IndentAction:Co,Location:Ap,MarkdownString:gf,OverviewRulerLane:Il,ParameterInformation:jee,PortAutoForwardAction:Ste,Position:ws,ProcessExecution:hN,ProgressLocation:SD,QuickInputButtonLocation:_te,QuickInputButtons:EH,Range:Xn,RelativePattern:JT,Selection:uC,SelectionRange:hH,SemanticTokens:gN,SemanticTokensBuilder:Tst,SemanticTokensEdit:vPe,SemanticTokensEdits:gz,SemanticTokensLegend:mte,ShellExecution:bI,ShellQuoting:ate,SignatureHelp:Jee,SignatureHelpTriggerKind:Xee,SignatureInformation:Yee,SnippetString:vI,SourceBreakpoint:qx,StandardTokenType:PS,StatusBarAlignment:NS,SymbolInformation:cH,SymbolKind:vo,SymbolTag:aH,Task:J9,TaskGroup:pH,TaskPanelKind:ote,TaskRevealKind:rte,TaskScope:wI,TerminalLink:Cst,TerminalQuickFixTerminalCommand:Ast,TerminalQuickFixOpener:Sst,TerminalLocation:ste,TerminalProfile:Est,TerminalExitReason:nte,TerminalShellExecutionCommandLineConfidence:CD,TextDocumentSaveReason:jT,TextEdit:qA,SnippetTextEdit:ele,TextEditorCursorStyle:Qo,TextEditorLineNumbersStyle:c_,TextEditorRevealType:q9,TextEditorSelectionChangeKind:cN,SyntaxTokenType:lN,TextDocumentChangeReason:fH,ThemeColor:_H,ThemeIcon:fu,TreeItem:X9,TreeItemCheckboxState:fb,TreeItemCollapsibleState:AD,TypeHierarchyItem:nle,UIKind:sv,Uri:N,ViewColumn:gH,WorkspaceEdit:_I,DocumentPasteTriggerKind:dte,DocumentDropEdit:lte,DocumentDropOrPasteEditKind:e$,DocumentPasteEdit:Dst,InlayHint:G9,InlayHintLabelPart:$9,InlayHintKind:Zee,RemoteAuthorityResolverError:a1,ResolvedAuthority:yst,ManagedResolvedAuthority:uz,SourceControlInputBoxValidationType:ite,ExtensionRuntime:f$,TimelineItem:wte,NotebookRange:Dy,NotebookCellKind:jx,NotebookCellExecutionState:fN,NotebookCellData:vG,NotebookData:bPe,NotebookRendererScript:yPe,NotebookCellStatusBarAlignment:h$,NotebookEditorRevealType:u$,NotebookCellOutput:d$,NotebookCellOutputItem:wPe,NotebookCellStatusBarItem:Mst,NotebookControllerAffinity:bte,NotebookControllerAffinity2:g$,NotebookEdit:F9,NotebookKernelSourceAction:Nst,NotebookVariablesRequestKind:DH,PortAttributes:Fst,LinkedEditingRanges:Pst,TestResultState:yte,TestRunRequest:p$,TestMessage:pN,TestMessage2:pN,TestMessageStackFrame:Ost,TestTag:kH,TestRunProfileKind:tL,TextSearchCompleteMessageType:Mee,DataTransfer:mH,DataTransferItem:Z9,TestCoverageCount:fz,FileCoverage:mN,FileCoverage2:mN,StatementCoverage:Wst,BranchCoverage:Hst,DeclarationCoverage:Ust,LanguageStatusSeverity:qT,QuickPickItemKind:xH,InputBoxValidationSeverity:ZT,TabInputText:sle,TabInputTextDiff:m$,TabInputTextMerge:CPe,TabInputCustom:rle,TabInputNotebook:ole,TabInputNotebookDiff:ale,TabInputWebview:SPe,TabInputTerminal:APe,TabInputInteractiveWindow:EPe,TabInputChat:xPe,TabInputTextMultiDiff:DPe,TelemetryTrustedValue:rce,LogLevel:Kn,EditSessionIdentityMatch:Lte,ChatCopyKind:Ate,DebugStackFrame:mPe,DebugThread:_Pe,RelatedInformationType:Dte,SpeechToTextStatus:kte,TextToSpeechStatus:Ite,PartialAcceptTriggerKind:Gx,KeywordRecognitionStatus:Tte,ChatResponseMarkdownPart:bG,ChatResponseFileTreePart:wG,ChatResponseAnchorPart:yG,ChatResponseProgressPart:RH,ChatResponseProgressPart2:kPe,ChatResponseReferencePart:Rb,ChatResponseReferencePart2:Rb,ChatResponseCodeCitationPart:v$,ChatResponseWarningPart:MH,ChatResponseTextEditPart:NH,ChatResponseMarkdownWithVulnerabilitiesPart:TH,ChatResponseCommandButtonPart:CG,ChatResponseDetectedParticipantPart:LH,ChatResponseConfirmationPart:_$,ChatResponseReferencePartStatusKind:xte,ChatRequestTurn:IPe,ChatResponseTurn:TPe,ChatLocation:l_,ChatRequestEditorData:LPe,ChatRequestNotebookData:RPe,LanguageModelChatMessageRole:jp,LanguageModelChatMessage:MPe,LanguageModelChatMessageFunctionResultPart:b$,LanguageModelChatResponseTextPart:PH,LanguageModelChatResponseFunctionUsePart:cle,LanguageModelError:Ow,NewSymbolName:Ist,NewSymbolNameTag:ute,NewSymbolNameTriggerKind:wH,InlineEdit:zst,InlineEditTriggerKind:FH,ExcludeSettingOptions:Fw,TextSearchContextNew:uPe,TextSearchMatchNew:hPe,TextSearchCompleteMessageTypeNew:Nee},{version:v7t,tasks:b7t,notebooks:w7t,scm:y7t,comments:C7t,authentication:S7t,tests:A7t,extensions:E7t,debug:x7t,env:D7t,commands:k7t,window:I7t,workspace:T7t,languages:L7t,l10n:R7t,interactive:M7t,ai:N7t,chat:P7t,speech:F7t,lm:O7t,Breakpoint:B7t,TerminalOutputAnchor:W7t,ChatResultFeedbackKind:H7t,ChatVariableLevel:U7t,ChatCompletionItem:V7t,CallHierarchyIncomingCall:z7t,CallHierarchyItem:$7t,CallHierarchyOutgoingCall:G7t,CancellationError:K7t,CancellationTokenSource:q7t,CandidatePortSource:Q7t,CodeAction:j7t,CodeActionKind:Y7t,CodeActionTriggerKind:J7t,CodeLens:X7t,Color:Z7t,ColorInformation:e6t,ColorPresentation:t6t,ColorThemeKind:i6t,CommentMode:n6t,CommentState:s6t,CommentThreadCollapsibleState:r6t,CommentThreadState:o6t,CommentThreadApplicability:a6t,CommentThreadFocus:c6t,CompletionItem:l6t,CompletionItemKind:d6t,CompletionItemTag:h6t,CompletionList:u6t,CompletionTriggerKind:g6t,ConfigurationTarget:f6t,CustomExecution:p6t,DebugAdapterExecutable:m6t,DebugAdapterInlineImplementation:_6t,DebugAdapterNamedPipeServer:v6t,DebugAdapterServer:b6t,DebugConfigurationProviderTriggerKind:w6t,DebugConsoleMode:y6t,DebugVisualization:C6t,DecorationRangeBehavior:S6t,Diagnostic:A6t,DiagnosticRelatedInformation:E6t,DiagnosticSeverity:x6t,DiagnosticTag:D6t,Disposable:k6t,DocumentHighlight:I6t,DocumentHighlightKind:T6t,MultiDocumentHighlight:L6t,DocumentLink:R6t,DocumentSymbol:M6t,EndOfLine:N6t,EnvironmentVariableMutatorType:P6t,EvaluatableExpression:F6t,InlineValueText:O6t,InlineValueVariableLookup:B6t,InlineValueEvaluatableExpression:W6t,InlineCompletionTriggerKind:H6t,EventEmitter:U6t,ExtensionKind:V6t,ExtensionMode:z6t,ExternalUriOpenerPriority:$6t,FileChangeType:G6t,FileDecoration:K6t,FileDecoration2:q6t,FileSystemError:Q6t,FileType:j6t,FilePermission:Y6t,FoldingRange:J6t,FoldingRangeKind:X6t,FunctionBreakpoint:Z6t,InlineCompletionItem:eGt,InlineCompletionList:tGt,Hover:iGt,VerboseHover:nGt,HoverVerbosityAction:sGt,IndentAction:rGt,Location:oGt,MarkdownString:aGt,OverviewRulerLane:cGt,ParameterInformation:lGt,PortAutoForwardAction:dGt,Position:hGt,ProcessExecution:uGt,ProgressLocation:gGt,QuickInputButtonLocation:fGt,QuickInputButtons:pGt,Range:mGt,RelativePattern:_Gt,Selection:vGt,SelectionRange:bGt,SemanticTokens:wGt,SemanticTokensBuilder:yGt,SemanticTokensEdit:CGt,SemanticTokensEdits:SGt,SemanticTokensLegend:AGt,ShellExecution:EGt,ShellQuoting:xGt,SignatureHelp:DGt,SignatureHelpTriggerKind:kGt,SignatureInformation:IGt,SnippetString:TGt,SourceBreakpoint:LGt,StandardTokenType:RGt,StatusBarAlignment:MGt,SymbolInformation:NGt,SymbolKind:PGt,SymbolTag:FGt,Task:OGt,TaskGroup:BGt,TaskPanelKind:WGt,TaskRevealKind:HGt,TaskScope:UGt,TerminalLink:VGt,TerminalQuickFixTerminalCommand:zGt,TerminalQuickFixOpener:$Gt,TerminalLocation:GGt,TerminalProfile:KGt,TerminalExitReason:qGt,TerminalShellExecutionCommandLineConfidence:QGt,TextDocumentSaveReason:jGt,TextEdit:YGt,SnippetTextEdit:JGt,TextEditorCursorStyle:XGt,TextEditorLineNumbersStyle:ZGt,TextEditorRevealType:eKt,TextEditorSelectionChangeKind:tKt,SyntaxTokenType:iKt,TextDocumentChangeReason:nKt,ThemeColor:sKt,ThemeIcon:rKt,TreeItem:oKt,TreeItemCheckboxState:aKt,TreeItemCollapsibleState:cKt,TypeHierarchyItem:lKt,UIKind:dKt,Uri:hKt,ViewColumn:uKt,WorkspaceEdit:gKt,DocumentPasteTriggerKind:fKt,DocumentDropEdit:pKt,DocumentDropOrPasteEditKind:mKt,DocumentPasteEdit:_Kt,InlayHint:vKt,InlayHintLabelPart:bKt,InlayHintKind:wKt,RemoteAuthorityResolverError:yKt,ResolvedAuthority:CKt,ManagedResolvedAuthority:SKt,SourceControlInputBoxValidationType:AKt,ExtensionRuntime:EKt,TimelineItem:xKt,NotebookRange:DKt,NotebookCellKind:kKt,NotebookCellExecutionState:IKt,NotebookCellData:TKt,NotebookData:LKt,NotebookRendererScript:RKt,NotebookCellStatusBarAlignment:MKt,NotebookEditorRevealType:NKt,NotebookCellOutput:PKt,NotebookCellOutputItem:FKt,NotebookCellStatusBarItem:OKt,NotebookControllerAffinity:BKt,NotebookControllerAffinity2:WKt,NotebookEdit:HKt,NotebookKernelSourceAction:UKt,NotebookVariablesRequestKind:VKt,PortAttributes:zKt,LinkedEditingRanges:$Kt,TestResultState:GKt,TestRunRequest:KKt,TestMessage:qKt,TestMessage2:QKt,TestMessageStackFrame:jKt,TestTag:YKt,TestRunProfileKind:JKt,TextSearchCompleteMessageType:XKt,DataTransfer:ZKt,DataTransferItem:eqt,TestCoverageCount:tqt,FileCoverage:iqt,FileCoverage2:nqt,StatementCoverage:sqt,BranchCoverage:rqt,DeclarationCoverage:oqt,LanguageStatusSeverity:aqt,QuickPickItemKind:cqt,InputBoxValidationSeverity:lqt,TabInputText:dqt,TabInputTextDiff:hqt,TabInputTextMerge:uqt,TabInputCustom:gqt,TabInputNotebook:fqt,TabInputNotebookDiff:pqt,TabInputWebview:mqt,TabInputTerminal:_qt,TabInputInteractiveWindow:vqt,TabInputChat:bqt,TabInputTextMultiDiff:wqt,TelemetryTrustedValue:yqt,LogLevel:Cqt,EditSessionIdentityMatch:Sqt,ChatCopyKind:Aqt,DebugStackFrame:Eqt,DebugThread:xqt,RelatedInformationType:Dqt,SpeechToTextStatus:kqt,TextToSpeechStatus:Iqt,PartialAcceptTriggerKind:Tqt,KeywordRecognitionStatus:Lqt,ChatResponseMarkdownPart:Rqt,ChatResponseFileTreePart:Mqt,ChatResponseAnchorPart:Nqt,ChatResponseProgressPart:Pqt,ChatResponseProgressPart2:Fqt,ChatResponseReferencePart:Oqt,ChatResponseReferencePart2:Bqt,ChatResponseCodeCitationPart:Wqt,ChatResponseWarningPart:Hqt,ChatResponseTextEditPart:Uqt,ChatResponseMarkdownWithVulnerabilitiesPart:Vqt,ChatResponseCommandButtonPart:zqt,ChatResponseDetectedParticipantPart:$qt,ChatResponseConfirmationPart:Gqt,ChatResponseReferencePartStatusKind:Kqt,ChatRequestTurn:qqt,ChatResponseTurn:Qqt,ChatLocation:jqt,ChatRequestEditorData:Yqt,ChatRequestNotebookData:Jqt,LanguageModelChatMessageRole:Xqt,LanguageModelChatMessage:Zqt,LanguageModelChatMessageFunctionResultPart:eQt,LanguageModelChatResponseTextPart:tQt,LanguageModelChatResponseFunctionUsePart:iQt,LanguageModelError:nQt,NewSymbolName:sQt,NewSymbolNameTag:rQt,NewSymbolNameTriggerKind:oQt,InlineEdit:aQt,InlineEditTriggerKind:cQt,ExcludeSettingOptions:lQt,TextSearchContextNew:dQt,TextSearchMatchNew:hQt,TextSearchCompleteMessageTypeNew:uQt}=_7t,gQt=Object.freeze(Object.defineProperty({__proto__:null,BranchCoverage:rqt,Breakpoint:B7t,CallHierarchyIncomingCall:z7t,CallHierarchyItem:$7t,CallHierarchyOutgoingCall:G7t,CancellationError:K7t,CancellationTokenSource:q7t,CandidatePortSource:Q7t,ChatCompletionItem:V7t,ChatCopyKind:Aqt,ChatLocation:jqt,ChatRequestEditorData:Yqt,ChatRequestNotebookData:Jqt,ChatRequestTurn:qqt,ChatResponseAnchorPart:Nqt,ChatResponseCodeCitationPart:Wqt,ChatResponseCommandButtonPart:zqt,ChatResponseConfirmationPart:Gqt,ChatResponseDetectedParticipantPart:$qt,ChatResponseFileTreePart:Mqt,ChatResponseMarkdownPart:Rqt,ChatResponseMarkdownWithVulnerabilitiesPart:Vqt,ChatResponseProgressPart:Pqt,ChatResponseProgressPart2:Fqt,ChatResponseReferencePart:Oqt,ChatResponseReferencePart2:Bqt,ChatResponseReferencePartStatusKind:Kqt,ChatResponseTextEditPart:Uqt,ChatResponseTurn:Qqt,ChatResponseWarningPart:Hqt,ChatResultFeedbackKind:H7t,ChatVariableLevel:U7t,CodeAction:j7t,CodeActionKind:Y7t,CodeActionTriggerKind:J7t,CodeLens:X7t,Color:Z7t,ColorInformation:e6t,ColorPresentation:t6t,ColorThemeKind:i6t,CommentMode:n6t,CommentState:s6t,CommentThreadApplicability:a6t,CommentThreadCollapsibleState:r6t,CommentThreadFocus:c6t,CommentThreadState:o6t,CompletionItem:l6t,CompletionItemKind:d6t,CompletionItemTag:h6t,CompletionList:u6t,CompletionTriggerKind:g6t,ConfigurationTarget:f6t,CustomExecution:p6t,DataTransfer:ZKt,DataTransferItem:eqt,DebugAdapterExecutable:m6t,DebugAdapterInlineImplementation:_6t,DebugAdapterNamedPipeServer:v6t,DebugAdapterServer:b6t,DebugConfigurationProviderTriggerKind:w6t,DebugConsoleMode:y6t,DebugStackFrame:Eqt,DebugThread:xqt,DebugVisualization:C6t,DeclarationCoverage:oqt,DecorationRangeBehavior:S6t,Diagnostic:A6t,DiagnosticRelatedInformation:E6t,DiagnosticSeverity:x6t,DiagnosticTag:D6t,Disposable:k6t,DocumentDropEdit:pKt,DocumentDropOrPasteEditKind:mKt,DocumentHighlight:I6t,DocumentHighlightKind:T6t,DocumentLink:R6t,DocumentPasteEdit:_Kt,DocumentPasteTriggerKind:fKt,DocumentSymbol:M6t,EditSessionIdentityMatch:Sqt,EndOfLine:N6t,EnvironmentVariableMutatorType:P6t,EvaluatableExpression:F6t,EventEmitter:U6t,ExcludeSettingOptions:lQt,ExtensionKind:V6t,ExtensionMode:z6t,ExtensionRuntime:EKt,ExternalUriOpenerPriority:$6t,FileChangeType:G6t,FileCoverage:iqt,FileCoverage2:nqt,FileDecoration:K6t,FileDecoration2:q6t,FilePermission:Y6t,FileSystemError:Q6t,FileType:j6t,FoldingRange:J6t,FoldingRangeKind:X6t,FunctionBreakpoint:Z6t,Hover:iGt,HoverVerbosityAction:sGt,IndentAction:rGt,InlayHint:vKt,InlayHintKind:wKt,InlayHintLabelPart:bKt,InlineCompletionItem:eGt,InlineCompletionList:tGt,InlineCompletionTriggerKind:H6t,InlineEdit:aQt,InlineEditTriggerKind:cQt,InlineValueEvaluatableExpression:W6t,InlineValueText:O6t,InlineValueVariableLookup:B6t,InputBoxValidationSeverity:lqt,KeywordRecognitionStatus:Lqt,LanguageModelChatMessage:Zqt,LanguageModelChatMessageFunctionResultPart:eQt,LanguageModelChatMessageRole:Xqt,LanguageModelChatResponseFunctionUsePart:iQt,LanguageModelChatResponseTextPart:tQt,LanguageModelError:nQt,LanguageStatusSeverity:aqt,LinkedEditingRanges:$Kt,Location:oGt,LogLevel:Cqt,ManagedResolvedAuthority:SKt,MarkdownString:aGt,MultiDocumentHighlight:L6t,NewSymbolName:sQt,NewSymbolNameTag:rQt,NewSymbolNameTriggerKind:oQt,NotebookCellData:TKt,NotebookCellExecutionState:IKt,NotebookCellKind:kKt,NotebookCellOutput:PKt,NotebookCellOutputItem:FKt,NotebookCellStatusBarAlignment:MKt,NotebookCellStatusBarItem:OKt,NotebookControllerAffinity:BKt,NotebookControllerAffinity2:WKt,NotebookData:LKt,NotebookEdit:HKt,NotebookEditorRevealType:NKt,NotebookKernelSourceAction:UKt,NotebookRange:DKt,NotebookRendererScript:RKt,NotebookVariablesRequestKind:VKt,OverviewRulerLane:cGt,ParameterInformation:lGt,PartialAcceptTriggerKind:Tqt,PortAttributes:zKt,PortAutoForwardAction:dGt,Position:hGt,ProcessExecution:uGt,ProgressLocation:gGt,QuickInputButtonLocation:fGt,QuickInputButtons:pGt,QuickPickItemKind:cqt,Range:mGt,RelatedInformationType:Dqt,RelativePattern:_Gt,RemoteAuthorityResolverError:yKt,ResolvedAuthority:CKt,Selection:vGt,SelectionRange:bGt,SemanticTokens:wGt,SemanticTokensBuilder:yGt,SemanticTokensEdit:CGt,SemanticTokensEdits:SGt,SemanticTokensLegend:AGt,ShellExecution:EGt,ShellQuoting:xGt,SignatureHelp:DGt,SignatureHelpTriggerKind:kGt,SignatureInformation:IGt,SnippetString:TGt,SnippetTextEdit:JGt,SourceBreakpoint:LGt,SourceControlInputBoxValidationType:AKt,SpeechToTextStatus:kqt,StandardTokenType:RGt,StatementCoverage:sqt,StatusBarAlignment:MGt,SymbolInformation:NGt,SymbolKind:PGt,SymbolTag:FGt,SyntaxTokenType:iKt,TabInputChat:bqt,TabInputCustom:gqt,TabInputInteractiveWindow:vqt,TabInputNotebook:fqt,TabInputNotebookDiff:pqt,TabInputTerminal:_qt,TabInputText:dqt,TabInputTextDiff:hqt,TabInputTextMerge:uqt,TabInputTextMultiDiff:wqt,TabInputWebview:mqt,Task:OGt,TaskGroup:BGt,TaskPanelKind:WGt,TaskRevealKind:HGt,TaskScope:UGt,TelemetryTrustedValue:yqt,TerminalExitReason:qGt,TerminalLink:VGt,TerminalLocation:GGt,TerminalOutputAnchor:W7t,TerminalProfile:KGt,TerminalQuickFixOpener:$Gt,TerminalQuickFixTerminalCommand:zGt,TerminalShellExecutionCommandLineConfidence:QGt,TestCoverageCount:tqt,TestMessage:qKt,TestMessage2:QKt,TestMessageStackFrame:jKt,TestResultState:GKt,TestRunProfileKind:JKt,TestRunRequest:KKt,TestTag:YKt,TextDocumentChangeReason:nKt,TextDocumentSaveReason:jGt,TextEdit:YGt,TextEditorCursorStyle:XGt,TextEditorLineNumbersStyle:ZGt,TextEditorRevealType:eKt,TextEditorSelectionChangeKind:tKt,TextSearchCompleteMessageType:XKt,TextSearchCompleteMessageTypeNew:uQt,TextSearchContextNew:dQt,TextSearchMatchNew:hQt,TextToSpeechStatus:Iqt,ThemeColor:sKt,ThemeIcon:rKt,TimelineItem:xKt,TreeItem:oKt,TreeItemCheckboxState:aKt,TreeItemCollapsibleState:cKt,TypeHierarchyItem:lKt,UIKind:dKt,Uri:hKt,VerboseHover:nGt,ViewColumn:uKt,WorkspaceEdit:gKt,ai:N7t,authentication:S7t,chat:P7t,commands:k7t,comments:C7t,debug:x7t,env:D7t,extensions:E7t,interactive:M7t,l10n:R7t,languages:L7t,lm:O7t,notebooks:w7t,scm:y7t,setDefaultApi:$st,speech:F7t,tasks:b7t,tests:A7t,version:v7t,window:I7t,workspace:T7t},Symbol.toStringTag,{value:"Module"}));hMt(async({toAdd:s,toRemove:e})=>{await Hit(),await kt.get(ps).deltaExtensions(s,e)},(s,e)=>({toAdd:[...s.toAdd,...e.toAdd],toRemove:[...s.toRemove,...e.toRemove]}),0);const fQt=new Map;function pQt(s){return fQt.get(s)}let Aze=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()}};Aze=D([Ki(We.MainThreadLocalization),_(1,Xt),_(2,MXe)],Aze);class SG{constructor(e,t,i){this.viewType=e,this.serializer=t,this.extensionData=i}}var VV,KR;let nL=(KR=class extends ree{static getOrCreate(e,t,i,n,r={}){const o=e.createInstance(VV,t,i,n,r);return i&&o.setPreferredResource(i),o}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p){super(e,t,c,l,d,f,p),this.viewType=i,this.options=n,this._notebookService=r,this._notebookModelResolverService=o,this._fileDialogService=a,this.editorModelReference=null,this._defaultDirtyState=!1,this._defaultDirtyState=!!n.startDirty,this._sideLoadedListener=r.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(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 VV.ID}get editorId(){return this.viewType}get capabilities(){let e=xi.None;return this.resource.scheme===pe.untitled&&(e|=xi.Untitled),this.editorModelReference?this.editorModelReference.object.isReadonly()&&(e|=xi.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=xi.Readonly),e&xi.Readonly||(e|=xi.CanDropIntoEditor),e}getDescription(e=Rs.MEDIUM){if(!this.hasCapability(xi.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(xi.Untitled)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)}async save(e,t){if(this.editorModelReference)return this.hasCapability(xi.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(xi.Untitled)?await this._suggestName(i,this.labelService.getUriBasenameLabel(this.resource)):this.editorModelReference.object.resource;let r;if(this.editorModelReference.object.hasAssociatedFilePath())r=n;else if(r=await this._fileDialogService.pickFileToSave(n,t?.availableFileSystems),!r)return;if(!i.matches(r)){const o=i.selectors.map(a=>typeof a=="string"?a:$je(a)?`${a} (base ${a.base})`:a.exclude?`${a.include} (exclude: ${a.exclude})`:`${a.include}`).join(", ");throw new Error(`File name ${r} is not supported by ${i.providerDisplayName}. +`);return{data:i,dispose:()=>{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"enabledApiProposals",label:g(1137,"API Proposals"),access:{canToggle:!1},renderer:new yi(a$t)});async function c$t(s,e){const t=[];return await cst(s,t,e.logsHome,e.logsHome),t}async function cst(s,e,t,i){const n=await s.resolve(t);for(const{resource:r,isDirectory:o}of n.children||[])if(o)await cst(s,e,r,i);else{const a=(await s.readFile(r)).value.toString();if(a){const c=MN(i,r);c&&e.push({relativePath:c,contents:a})}}}var Wf;(function(s){s[s.Promise=100]="Promise",s[s.PromiseCancel=101]="PromiseCancel",s[s.EventListen=102]="EventListen",s[s.EventDispose=103]="EventDispose"})(Wf||(Wf={}));function cze(s){switch(s){case Wf.Promise:return"req";case Wf.PromiseCancel:return"cancel";case Wf.EventListen:return"subscribe";case Wf.EventDispose:return"unsubscribe"}}var Iu;(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"})(Iu||(Iu={}));function lze(s){switch(s){case Iu.Initialize:return"init";case Iu.PromiseSuccess:return"reply:";case Iu.PromiseError:case Iu.PromiseErrorObj:return"replyErr:";case Iu.EventFire:return"event:"}}var IF;(function(s){s[s.Uninitialized=0]="Uninitialized",s[s.Idle=1]="Idle"})(IF||(IF={}));function AP(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=Ge.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 d$t{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 h$t{constructor(){this.buffers=[]}get buffer(){return Ge.concat(this.buffers)}write(e){this.buffers.push(e)}}var Bu;(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"})(Bu||(Bu={}));function LE(s){const e=Ge.alloc(1);return e.writeUInt8(s,0),e}const JI={Undefined:LE(Bu.Undefined),String:LE(Bu.String),Buffer:LE(Bu.Buffer),VSBuffer:LE(Bu.VSBuffer),Array:LE(Bu.Array),Object:LE(Bu.Object),Uint:LE(Bu.Int)},u$t=typeof Buffer<"u";function VAe(s,e){if(typeof e>"u")s.write(JI.Undefined);else if(typeof e=="string"){const t=Ge.fromString(e);s.write(JI.String),EP(s,t.byteLength),s.write(t)}else if(u$t&&Buffer.isBuffer(e)){const t=Ge.wrap(e);s.write(JI.Buffer),EP(s,t.byteLength),s.write(t)}else if(e instanceof Ge)s.write(JI.VSBuffer),EP(s,e.byteLength),s.write(e);else if(Array.isArray(e)){s.write(JI.Array),EP(s,e.length);for(const t of e)VAe(s,t)}else if(typeof e=="number"&&(e|0)===e)s.write(JI.Uint),EP(s,e);else{const t=Ge.fromString(JSON.stringify(e));s.write(JI.Object),EP(s,t.byteLength),s.write(t)}}function zAe(s){switch(s.read(1).readUInt8(0)){case Bu.Undefined:return;case Bu.String:return s.read(AP(s)).toString();case Bu.Buffer:return s.read(AP(s)).buffer;case Bu.VSBuffer:return s.read(AP(s));case Bu.Array:{const t=AP(s),i=[];for(let n=0;nthis.onBuffer(i)),this.logger=t}getChannel(e){const t=this;return{call(i,n,r){return t.isDisposed?Promise.reject(new Pa):t.requestPromise(e,i,n,r)},listen(i,n){return t.isDisposed?M.None:t.requestEvent(e,i,n)}}}requestPromise(e,t,i,n=Ue.None){const r=this.lastRequestId++,o=Wf.Promise,a={id:r,type:o,channelName:e,name:t,arg:i};if(n.isCancellationRequested)return Promise.reject(new Pa);let c;return new Promise((d,h)=>{if(n.isCancellationRequested)return h(new Pa);const u=()=>{const v=b=>{switch(b.type){case Iu.PromiseSuccess:this.handlers.delete(r),d(b.data);break;case Iu.PromiseError:{this.handlers.delete(r);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 Iu.PromiseErrorObj:this.handlers.delete(r),h(b.data);break}};this.handlers.set(r,v),this.sendRequest(a)};let f=null;this.state===IF.Idle?u():(f=Mo(v=>this.whenInitialized()),f.then(()=>{f=null,u()}));const p=()=>{f?(f.cancel(),f=null):this.sendRequest({id:r,type:Wf.PromiseCancel}),h(new Pa)},m=n.onCancellationRequested(p);c=Yo(Ee(p),m),this.activeRequests.add(c)}).finally(()=>{c.dispose(),this.activeRequests.delete(c)})}requestEvent(e,t,i){const n=this.lastRequestId++,r=Wf.EventListen,o={id:n,type:r,channelName:e,name:t,arg:i};let a=null;const c=new I({onWillAddFirstListener:()=>{a=Mo(d=>this.whenInitialized()),a.then(()=>{a=null,this.activeRequests.add(c),this.sendRequest(o)})},onDidRemoveLastListener:()=>{a?(a.cancel(),a=null):(this.activeRequests.delete(c),this.sendRequest({id:n,type:Wf.EventDispose}))}}),l=d=>c.fire(d.data);return this.handlers.set(n,l),c.event}sendRequest(e){switch(e.type){case Wf.Promise:case Wf.EventListen:{const t=this.send([e.type,e.id,e.channelName,e.name],e.arg);this.logger?.logOutgoing(t,e.id,TF.LocalSide,`${cze(e.type)}: ${e.channelName}.${e.name}`,e.arg);return}case Wf.PromiseCancel:case Wf.EventDispose:{const t=this.send([e.type,e.id]);this.logger?.logOutgoing(t,e.id,TF.LocalSide,cze(e.type));return}}}send(e,t=void 0){const i=new h$t;return VAe(i,e),VAe(i,t),this.sendBuffer(i.buffer)}sendBuffer(e){try{return this.protocol.send(e),e.byteLength}catch{return 0}}onBuffer(e){const t=new d$t(e),i=zAe(t),n=zAe(t),r=i[0];switch(r){case Iu.Initialize:return this.logger?.logIncoming(e.byteLength,0,TF.LocalSide,lze(r)),this.onResponse({type:i[0]});case Iu.PromiseSuccess:case Iu.PromiseError:case Iu.EventFire:case Iu.PromiseErrorObj:return this.logger?.logIncoming(e.byteLength,i[1],TF.LocalSide,lze(r),n),this.onResponse({type:i[0],id:i[1],data:n})}}onResponse(e){if(e.type===Iu.Initialize){this.state=IF.Idle,this._onDidInitialize.fire();return}this.handlers.get(e.id)?.(e)}get onDidInitializePromise(){return M.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===IF.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),wt(this.activeRequests.values()),this.activeRequests.clear()}}dze.__decorator=D([ei],dze.prototype,"onDidInitializePromise",null);var $T;(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"})($T||($T={}));var $Ae;(function(s){s.enableDiagnostics=!1,s.records=[];const e=new WeakMap;let t=0;function i(r,o){if(!e.has(r)){const a=String(++t);e.set(r,a)}return e.get(r)}function n(r,o,a,c){if(!s.enableDiagnostics)return;const l=i(r);if(c instanceof Ge||c instanceof Uint8Array||c instanceof ArrayBuffer||ArrayBuffer.isView(c)){const d=Ge.alloc(c.byteLength);d.set(c),s.records.push({timestamp:Date.now(),id:l,label:o,type:a,buff:d})}else s.records.push({timestamp:Date.now(),id:l,label:o,type:a,data:c})}s.traceSocketEvent=n})($Ae||($Ae={}));var Oee;(function(s){s[s.NodeSocketCloseEvent=0]="NodeSocketCloseEvent",s[s.WebSocketCloseEvent=1]="WebSocketCloseEvent"})(Oee||(Oee={}));let Kue=null;function RE(){return Kue||(Kue=Ge.alloc(0)),Kue}class g$t{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 RE();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const o=this._chunks[0];return t&&(this._chunks.shift(),this._totalLength-=e),o}if(this._chunks[0].byteLength>e){const o=this._chunks[0].slice(0,e);return t&&(this._chunks[0]=this._chunks[0].slice(e),this._totalLength-=e),o}const i=Ge.alloc(e);let n=0,r=0;for(;e>0;){const o=this._chunks[r];if(o.byteLength>e){const a=o.slice(0,e);i.set(a,n),n+=e,t&&(this._chunks[r]=o.slice(e),this._totalLength-=e),e-=e}else i.set(o,n),n+=o.byteLength,t?(this._chunks.shift(),this._totalLength-=o.byteLength):r++,e-=o.byteLength}return i}}var zo;(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"})(zo||(zo={}));function lst(s){switch(s){case zo.None:return"None";case zo.Regular:return"Regular";case zo.Control:return"Control";case zo.Ack:return"Ack";case zo.Disconnect:return"Disconnect";case zo.ReplayRequest:return"ReplayRequest";case zo.Pause:return"PauseWriting";case zo.Resume:return"ResumeWriting";case zo.KeepAlive:return"KeepAlive"}}var Pf;(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"})(Pf||(Pf={}));class aw{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 hze extends V{constructor(e){super(),this._onMessage=this._register(new I),this.onMessage=this._onMessage.event,this._state={readHead:!0,readLen:Pf.HeaderLength,messageType:zo.None,id:0,ack:0},this._socket=e,this._isDisposed=!1,this._incomingData=new g$t,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($T.ProtocolHeaderRead,{messageType:lst(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,r=this._state.ack;if(this._state.readHead=!0,this._state.readLen=Pf.HeaderLength,this._state.messageType=zo.None,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent($T.ProtocolMessageRead,t),this._onMessage.fire(new aw(i,n,r,t)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}}class uze{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=Ge.alloc(Pf.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($T.ProtocolHeaderWrite,{messageType:lst(e.type),id:e.id,ack:e.ack,messageSize:e.data.byteLength}),this._socket.traceSocketEvent($T.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=Ge.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($T.ProtocolWrite,{byteLength:e.byteLength}),this._socket.write(e)}}class o1{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 f$t{constructor(e){this.data=e,this.next=null}}class p$t{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 f$t(e);if(!this._first){this._first=t,this._last=t;return}this._last.next=t,this._last=t}}const Np=class Np{static getInstance(){return Np._INSTANCE||(Np._INSTANCE=new Np),Np._INSTANCE}constructor(){this.lastRuns=[];const e=Date.now();for(let t=0;t{for(let t=Np._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+Np._HISTORY_LENGTH)*1e3;let i=0;for(let n=0;n=.5}};Np._HISTORY_LENGTH=10,Np._INSTANCE=null;let GAe=Np;class m$t{get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}constructor(e){this._onControlMessage=new o1,this.onControlMessage=this._onControlMessage.event,this._onMessage=new o1,this.onMessage=this._onMessage.event,this._onDidDispose=new o1,this.onDidDispose=this._onDidDispose.event,this._onSocketClose=new o1,this.onSocketClose=this._onSocketClose.event,this._onSocketTimeout=new o1,this.onSocketTimeout=this._onSocketTimeout.event,this._loadEstimator=e.loadEstimator??GAe.getInstance(),this._shouldSendKeepAlive=e.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new p$t,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 uze(this._socket)),this._socketReader=this._socketDisposables.add(new hze(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()},Pf.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 aw(zo.Disconnect,0,0,RE());this._socketWriter.write(e),this._socketWriter.flush()}}sendPause(){const e=new aw(zo.Pause,0,0,RE());this._socketWriter.write(e)}sendResume(){const e=new aw(zo.Resume,0,0,RE());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 uze(this._socket)),this._socketReader=this._socketDisposables.add(new hze(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 aw(zo.Ack,0,this._incomingAckId,RE());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 zo.None:break;case zo.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 aw(zo.ReplayRequest,0,0,RE())))}else this._incomingMsgId=e.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(e.data);break}case zo.Control:{this._onControlMessage.fire(e.data);break}case zo.Ack:break;case zo.Disconnect:{this._onDidDispose.fire();break}case zo.ReplayRequest:{const t=this._outgoingUnackMsg.toArray();for(let i=0,n=t.length;i=Pf.AcknowledgeTime){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},Pf.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>=Pf.TimeoutTime&&i>=Pf.TimeoutTime&&n>=Pf.TimeoutTime&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:t,timeSinceLastReceivedSomeData:i});return}const r=Math.max(Pf.TimeoutTime-t,Pf.TimeoutTime-i,Pf.TimeoutTime-n,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},r)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;const e=new aw(zo.Ack,0,this._incomingAckId,RE());this._socketWriter.write(e)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;const e=new aw(zo.KeepAlive,0,this._incomingAckId,RE());this._socketWriter.write(e)}}const _$t=30*1e3;var GT;(function(s){s[s.Management=1]="Management",s[s.ExtensionHost=2]="ExtensionHost",s[s.Tunnel=3]="Tunnel"})(GT||(GT={}));function KAe(s){switch(s){case GT.Management:return"Management";case GT.ExtensionHost:return"ExtensionHost";case GT.Tunnel:return"Tunnel"}}function dst(s){const e=new li;return setTimeout(()=>e.cancel(),s),e.token}function v$t(s,e){if(s.isCancellationRequested||e.isCancellationRequested)return Ue.Cancelled;const t=new li;return s.onCancellationRequested(()=>t.cancel()),e.onCancellationRequested(()=>t.cancel()),t.token}class Zce{get didTimeout(){return this._state==="timedout"}constructor(e){this._state="pending",this._disposables=new Z,{promise:this.promise,resolve:this._resolvePromise,reject:this._rejectPromise}=H2(),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 b$t(s,e){const t=new Zce(e);return t.registerDisposable(s.onControlMessage(i=>{const n=JSON.parse(i.toString()),r=gst(n);r?t.reject(r):t.resolve(n)})),t.promise}function w$t(s,e,t,i,n,r,o,a){const c=new Zce(a),l=Ys.create(!1);return s.info(`Creating a socket (${o})...`),ls(`code/willCreateSocket/${r}`),e.connect(t,i,n,o).then(d=>{c.didTimeout?(ls(`code/didCreateSocketError/${r}`),s.info(`Creating a socket (${o}) finished after ${l.elapsed()} ms, but this is too late and has timed out already.`),d?.dispose()):(ls(`code/didCreateSocketOK/${r}`),s.info(`Creating a socket (${o}) was successful after ${l.elapsed()} ms.`),c.resolve(d))},d=>{ls(`code/didCreateSocketError/${r}`),s.info(`Creating a socket (${o}) returned an error after ${l.elapsed()} ms.`),s.error(d),c.reject(d)}),c.promise}function que(s,e){const t=new Zce(e);return s.then(i=>{t.didTimeout||t.resolve(i)},i=>{t.didTimeout||t.reject(i)}),t.promise}async function y$t(s,e,t,i){const n=fst(s,e);s.logService.trace(`${n} 1/6. invoking socketFactory.connect().`);let r;try{r=await w$t(s.logService,s.remoteSocketFactoryService,s.connectTo,M8.getServerRootPath(),`reconnectionToken=${s.reconnectionToken}&reconnection=${s.reconnectionProtocol?"true":"false"}`,KAe(e),`renderer-${KAe(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 o,a;s.reconnectionProtocol?(s.reconnectionProtocol.beginAcceptReconnection(r,null),o=s.reconnectionProtocol,a=!1):(o=new m$t({socket:r}),a=!0),s.logService.trace(`${n} 3/6. sending AuthRequest control message.`);const c=await que(s.signService.createNewMessage(ao()),i),l={type:"auth",auth:s.connectionToken||"00000000000000000000",data:c.data};o.sendControl(Ge.fromString(JSON.stringify(l)));try{const d=await b$t(o,v$t(i,dst(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 que(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 que(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.`),o.sendControl(Ge.fromString(JSON.stringify(f))),{protocol:o,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&&gPe(o),d}}async function C$t(s,e,t,i){const n=Date.now(),r=fst(s,e),{protocol:o,ownsProtocol:a}=await y$t(s,e,t,i),c=new Zce(i);return c.registerDisposable(o.onControlMessage(l=>{const d=JSON.parse(l.toString()),h=gst(d);h?(s.logService.error(`${r} received error control message when negotiating connection. Error:`),s.logService.error(h),a&&gPe(o),c.reject(h)):(s.reconnectionProtocol?.endAcceptReconnection(),s.logService.trace(`${r} 6/6. handshake finished, connection is up and running after ${M$t(n)}!`),c.resolve({protocol:o,firstMessage:d}))})),c.promise}async function hst(s,e,t){const{protocol:i,firstMessage:n}=await C$t(s,GT.ExtensionHost,e,t),r=n&&n.debugPort;return{protocol:i,debugPort:r}}async function ust(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 S$t(s,e){return A$t(s,async t=>{const{protocol:i,debugPort:n}=await hst(t,e,Ue.None);return new T$t(s,e,t.reconnectionToken,i,n)})}async function A$t(s,e){for(let i=1;;i++)try{const n=ao(),r=await ust(s,n,null);return await e(r)}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),Bee.triggerPermanentFailure(0,0,wD.isHandled(n)),n}}function E$t(s){return Mo(e=>new Promise((t,i)=>{const n=setTimeout(t,s*1e3);e.onCancellationRequested(()=>{clearTimeout(n),t()})}))}var pI;(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"})(pI||(pI={}));class x$t{constructor(e,t){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.type=pI.ConnectionLost}}class D$t{constructor(e,t,i,n){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.durationSeconds=i,this.cancellableTimer=n,this.type=pI.ReconnectionWait}skipWait(){this.cancellableTimer.cancel()}}class k$t{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=pI.ReconnectionRunning}}class gze{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=pI.ConnectionGain}}class I$t{constructor(e,t,i,n){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.handled=n,this.type=pI.ReconnectionPermanentFailure}}const kg=class kg 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||kg._permanentFailure}constructor(e,t,i,n,r){super(),this._connectionType=e,this._options=t,this.reconnectionToken=i,this.protocol=n,this._reconnectionFailureIsFatal=r,this._onDidStateChange=this._register(new I),this.onDidStateChange=this._onDidStateChange.event,this._permanentFailure=!1,this._isReconnecting=!1,this._isDisposed=!1,this._onDidStateChange.fire(new gze(this.reconnectionToken,0,0)),this._register(n.onSocketClose(o=>{const a=dj(this._connectionType,this.reconnectionToken,!0);o?o.type===Oee.NodeSocketCloseEvent?(this._options.logService.info(`${a} received socket close event (hadError: ${o.hadError}).`),o.error&&this._options.logService.error(o.error)):(this._options.logService.info(`${a} received socket close event (wasClean: ${o.wasClean}, code: ${o.code}, reason: ${o.reason}).`),o.event&&this._options.logService.error(o.event)):this._options.logService.info(`${a} received socket close event.`),this._beginReconnecting()})),this._register(n.onSocketTimeout(o=>{const a=dj(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${a} received socket timeout event (unacknowledgedMsgCount: ${o.unacknowledgedMsgCount}, timeSinceOldestUnacknowledgedMsg: ${o.timeSinceOldestUnacknowledgedMsg}, timeSinceLastReceivedSomeData: ${o.timeSinceLastReceivedSomeData}).`),this._beginReconnecting()})),kg._instances.push(this),this._register(Ee(()=>{const o=kg._instances.indexOf(this);o>=0&&kg._instances.splice(o,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(kg._permanentFailureMillisSinceLastIncomingData,kg._permanentFailureAttempt,kg._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=dj(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 x$t(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 o=E$t(n);this._onDidStateChange.fire(new D$t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),n,o)),this._options.logService.info(`${e} waiting for ${n} seconds before reconnecting...`);try{await o}catch{}}if(this._isPermanentFailure){this._options.logService.error(`${e} permanent failure occurred while running the reconnecting loop.`);break}this._onDidStateChange.fire(new k$t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1)),this._options.logService.info(`${e} resolving connection...`);const r=await ust(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${r.connectTo}...`),await this._reconnect(r,dst(_$t)),this._options.logService.info(`${e} reconnected!`),this._onDidStateChange.fire(new gze(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1));break}catch(r){if(r.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(r),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(r),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}if(wD.isTemporarilyNotAvailable(r)){this._options.logService.info(`${e} A temporarily not available error occurred while trying to reconnect, will try again...`),this._options.logService.trace(r);continue}if((r.code==="ETIMEDOUT"||r.code==="ENETUNREACH"||r.code==="ECONNREFUSED"||r.code==="ECONNRESET")&&r.syscall==="connect"){this._options.logService.info(`${e} A network error occurred while trying to reconnect, will try again...`),this._options.logService.trace(r);continue}if(Oo(r)){this._options.logService.info(`${e} A promise cancelation error occurred while trying to reconnect, will try again...`),this._options.logService.trace(r);continue}if(r instanceof wD){this._options.logService.error(`${e} A RemoteAuthorityResolverError occurred while trying to reconnect. Will give up now! Error:`),this._options.logService.error(r),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,wD.isHandled(r));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(r),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),i+1,!1);break}}while(!this._isPermanentFailure&&!this._isDisposed)}_onReconnectionPermanentFailure(e,t,i){this._reconnectionFailureIsFatal?kg.triggerPermanentFailure(e,t,i):this._gotoPermanentFailure(e,t,i)}_gotoPermanentFailure(e,t,i){this._onDidStateChange.fire(new I$t(this.reconnectionToken,e,t,i)),gPe(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}};kg._permanentFailure=!1,kg._permanentFailureMillisSinceLastIncomingData=0,kg._permanentFailureAttempt=0,kg._permanentFailureHandled=!1,kg._instances=[];let Bee=kg;class T$t extends Bee{constructor(e,t,i,n,r){super(GT.ExtensionHost,e,i,n,!1),this._startArguments=t,this.debugPort=r}async _reconnect(e,t){await hst(e,this._startArguments,t)}}function gPe(s){try{s.acceptDisconnect();const e=s.getSocket();s.dispose(),e.dispose()}catch(e){bt(e)}}function gst(s){if(s&&s.type==="error"){const e=new Error(`Connection error: ${s.reason}`);return e.code="VSCODE_CONNECTION_ERROR",e}return null}function L$t(s,e){for(;s.length"u"&&(l=ao(),this._storageService.store(c,l,Ie.WORKSPACE,cn.MACHINE));const d=await Odt(ri.origin,l),h=r.replace("{{uuid}}",`v--${d}`).replace("{{commit}}",o).replace("{{quality}}",a),u=new URL(`${h}/out/${i}${t}`);return u.searchParams.set("parentOrigin",ri.origin),u.searchParams.set("salt",l),u.toString()}}return`${sf.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=ao();i.setAttribute("src",`${e}&vscodeWebWorkerExtHostId=${n}`);const r=new jd;let o,a=null,c=!1,l=null;const d=(p,m)=>{a=m,c=!0,bt(a),clearTimeout(l),this._onDidExit.fire([cz.UnexpectedError,a.message]),r.open()},h=p=>{o=p,clearTimeout(l),r.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(ri,"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(cz.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(r.isOpen()||!(m instanceof MessagePort)){console.warn("UNEXPECTED message",p);const v=new Error("UNEXPECTED message");return d(cz.UnexpectedError,v)}h(m)})),this._layoutService.mainContainer.appendChild(i),this._register(Ee(()=>i.remove())),await r.wait(),c)throw a;const u=this._environmentService.options?.messagePorts??new Map;i.contentWindow.postMessage({type:"vscode.init",data:u},"*",[...u.values()]),o.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(Ge.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);o.postMessage(m,[m])}};return this._performHandshake(f)}async _performHandshake(e){if(await M.toPromise(M.filter(e.onMessage,t=>Wee(t,pp.Ready))),this._isTerminating||(e.send(Ge.fromString(JSON.stringify(await this._createExtHostInitData()))),this._isTerminating)||(await M.toPromise(M.filter(e.onMessage,t=>Wee(t,pp.Initialized))),this._isTerminating))throw Ty();return e}dispose(){this._isTerminating||(this._isTerminating=!0,this._protocol?.send(pst(pp.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&&!Rk.isDefaultVariant()&&(n=N.joinPath(N.parse(i),this._productService.commit,this._productService.version,Rk.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??(Hn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:jl,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:pMe(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===OA.EagerAutoStart,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Hn?sv.Web:sv.Desktop}}};Hee=D([_(3,Ji),_(4,Ci),_(5,Os),_(6,Ke),_(7,pf),_(8,fv),_(9,km),_(10,xo),_(11,_u),_(12,Gi)],Hee);class N$t{constructor(){this.capabilities=zn.Readonly+zn.FileReadWrite+zn.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 gs(t.statusText,ot.Unknown)}catch(t){throw gs(t,ot.Unknown)}}async stat(e){return{type:rn.File,size:0,mtime:0,ctime:0}}watch(){return V.None}writeFile(e,t,i){throw new dS}readdir(e){throw new dS}mkdir(e){throw new dS}delete(e,t){throw new dS}rename(e,t,i){throw new dS}}var qAe={exports:{}},Que={};(function(s,e){e=s.exports=On;var t;typeof process=="object"&&Que&&Que.NODE_DEBUG&&/\bsemver\b/i.test(Que.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,r=16,o=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,"+r+"})(?:\\.(\\d{1,"+r+"}))?(?:\\.(\\d{1,"+r+"}))?(?:$|[^\\d])";var De=c++;a[De]="(?:~>?)";var Be=c++;a[Be]="(\\s*)"+a[De]+"\\s+",o[Be]=new RegExp(a[Be],"g");var Ct="$1~",Ne=c++;a[Ne]="^"+a[De]+a[G]+"$";var dt=c++;a[dt]="^"+a[De]+a[Y]+"$";var Dt=c++;a[Dt]="(?:\\^)";var Xi=c++;a[Xi]="(\\s*)"+a[Dt]+"\\s+",o[Xi]=new RegExp(a[Xi],"g");var Ti="$1^",ss=c++;a[ss]="^"+a[Dt]+a[G]+"$";var $s=c++;a[$s]="^"+a[Dt]+a[Y]+"$";var Fn=c++;a[Fn]="^"+a[P]+"\\s*("+L+")$|^$";var Zo=c++;a[Zo]="^"+a[P]+"\\s*("+A+")$|^$";var hs=c++;a[hs]="(\\s*)"+a[P]+"\\s*("+L+"|"+a[G]+")",o[hs]=new RegExp(a[hs],"g");var Zr="$1$2$3",ea=c++;a[ea]="^\\s*("+a[G]+")\\s+-\\s+("+a[G]+")\\s*$";var ki=c++;a[ki]="^\\s*("+a[Y]+")\\s+-\\s+("+a[Y]+")\\s*$";var rs=c++;a[rs]="(<|>)?=?\\s*\\*";for(var Or=0;Ori)return null;var T=de?o[k]:o[C];if(!T.test(K))return null;try{return new On(K,de)}catch{return null}}e.valid=Ha;function Ha(K,de){var T=Ln(K,de);return T?T.version:null}e.clean=wd;function wd(K,de){var T=Ln(K.trim().replace(/^[=v]+/,""),de);return T?T.version:null}e.SemVer=On;function On(K,de){if(K instanceof On){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 On))return new On(K,de);t("SemVer",K,de),this.loose=de;var T=K.trim().match(de?o[k]:o[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=nh;function nh(K,de,T,ie){typeof T=="string"&&(ie=T,T=void 0);try{return new On(K,T).inc(de,ie).version}catch{return null}}e.diff=mc;function mc(K,de){if(_l(K,de))return null;var T=Ln(K),ie=Ln(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=Gs;var $c=/^[0-9]+$/;function Gs(K,de){var T=$c.test(K),ie=$c.test(de);return T&&ie&&(K=+K,de=+de),T&&!ie?-1:ie&&!T?1:Kde?1:0}e.rcompareIdentifiers=ic;function ic(K,de){return Gs(de,K)}e.major=pl;function pl(K,de){return new On(K,de).major}e.minor=sh;function sh(K,de){return new On(K,de).minor}e.patch=mg;function mg(K,de){return new On(K,de).patch}e.compare=_c;function _c(K,de,T){return new On(K,T).compare(new On(de,T))}e.compareLoose=Gc;function Gc(K,de){return _c(K,de,!0)}e.rcompare=rh;function rh(K,de,T){return _c(de,K,T)}e.sort=kc;function kc(K,de){return K.sort(function(T,ie){return e.compare(T,ie,de)})}e.rsort=ml;function ml(K,de){return K.sort(function(T,ie){return e.rcompare(T,ie,de)})}e.gt=nc;function nc(K,de,T){return _c(K,de,T)>0}e.lt=Bo;function Bo(K,de,T){return _c(K,de,T)<0}e.eq=_l;function _l(K,de,T){return _c(K,de,T)===0}e.neq=oh;function oh(K,de,T){return _c(K,de,T)!==0}e.gte=ah;function ah(K,de,T){return _c(K,de,T)>=0}e.lte=Kc;function Kc(K,de,T){return _c(K,de,T)<=0}e.cmp=qc;function qc(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=_l(K,T,ie);break;case"!=":ye=oh(K,T,ie);break;case">":ye=nc(K,T,ie);break;case">=":ye=ah(K,T,ie);break;case"<":ye=Bo(K,T,ie);break;case"<=":ye=Kc(K,T,ie);break;default:throw new TypeError("Invalid operator: "+de)}return ye}e.Comparator=Ua;function Ua(K,de){if(K instanceof Ua){if(K.loose===de)return K;K=K.value}if(!(this instanceof Ua))return new Ua(K,de);t("comparator",K,de),this.loose=de,this.parse(K),this.semver===Br?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}var Br={};Ua.prototype.parse=function(K){var de=this.loose?o[Fn]:o[Zo],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 On(T[2],this.loose):this.semver=Br},Ua.prototype.toString=function(){return this.value},Ua.prototype.test=function(K){return t("Comparator.test",K,this.loose),this.semver===Br?!0:(typeof K=="string"&&(K=new On(K,this.loose)),qc(K,this.operator,this.semver,this.loose))},Ua.prototype.intersects=function(K,de){if(!(K instanceof Ua))throw new TypeError("a Comparator is required");var T;if(this.operator==="")return T=new Ts(K.value,de),Oh(this.value,T,de);if(K.operator==="")return T=new Ts(this.value,de),Oh(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=qc(this.semver,"<",K.semver,de)&&(this.operator===">="||this.operator===">")&&(K.operator==="<="||K.operator==="<"),qe=qc(this.semver,">",K.semver,de)&&(this.operator==="<="||this.operator==="<")&&(K.operator===">="||K.operator===">");return ie||ye||O&&$||se||qe},e.Range=Ts;function Ts(K,de){if(K instanceof Ts)return K.loose===de?K:new Ts(K.raw,de);if(K instanceof Ua)return new Ts(K.value,de);if(!(this instanceof Ts))return new Ts(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()}Ts.prototype.format=function(){return this.range=this.set.map(function(K){return K.join(" ").trim()}).join("||").trim(),this.range},Ts.prototype.toString=function(){return this.range},Ts.prototype.parseRange=function(K){var de=this.loose;K=K.trim(),t("range",K,de);var T=de?o[ki]:o[ea];K=K.replace(T,Va),t("hyphen replace",K),K=K.replace(o[hs],Zr),t("comparator trim",K,o[hs]),K=K.replace(o[Be],Ct),K=K.replace(o[Xi],Ti),K=K.split(/\s+/).join(" ");var ie=de?o[Fn]:o[Zo],ye=K.split(" ").map(function(O){return Fh(O,de)}).join(" ").split(/\s+/);return this.loose&&(ye=ye.filter(function(O){return!!O.match(ie)})),ye=ye.map(function(O){return new Ua(O,de)}),ye},Ts.prototype.intersects=function(K,de){if(!(K instanceof Ts))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=Ic;function Ic(K,de){return new Ts(K,de).set.map(function(T){return T.map(function(ie){return ie.value}).join(" ").trim().split(" ")})}function Fh(K,de){return t("comp",K),K=xe(K,de),t("caret",K),K=Ea(K,de),t("tildes",K),K=$n(K,de),t("xrange",K),K=Wr(K,de),t("stars",K),K}function be(K){return!K||K.toLowerCase()==="x"||K==="*"}function Ea(K,de){return K.trim().split(/\s+/).map(function(T){return ee(T,de)}).join(" ")}function ee(K,de){var T=de?o[dt]:o[Ne];return K.replace(T,function(ie,ye,O,$,se){t("tilde",K,ie,ye,O,$,se);var qe;return be(ye)?qe="":be(O)?qe=">="+ye+".0.0 <"+(+ye+1)+".0.0":be($)?qe=">="+ye+"."+O+".0 <"+ye+"."+(+O+1)+".0":se?(t("replaceTilde pr",se),se.charAt(0)!=="-"&&(se="-"+se),qe=">="+ye+"."+O+"."+$+se+" <"+ye+"."+(+O+1)+".0"):qe=">="+ye+"."+O+"."+$+" <"+ye+"."+(+O+1)+".0",t("tilde return",qe),qe})}function xe(K,de){return K.trim().split(/\s+/).map(function(T){return ft(T,de)}).join(" ")}function ft(K,de){t("caret",K,de);var T=de?o[$s]:o[ss];return K.replace(T,function(ie,ye,O,$,se){t("caret",K,ie,ye,O,$,se);var qe;return be(ye)?qe="":be(O)?qe=">="+ye+".0.0 <"+(+ye+1)+".0.0":be($)?ye==="0"?qe=">="+ye+"."+O+".0 <"+ye+"."+(+O+1)+".0":qe=">="+ye+"."+O+".0 <"+(+ye+1)+".0.0":se?(t("replaceCaret pr",se),se.charAt(0)!=="-"&&(se="-"+se),ye==="0"?O==="0"?qe=">="+ye+"."+O+"."+$+se+" <"+ye+"."+O+"."+(+$+1):qe=">="+ye+"."+O+"."+$+se+" <"+ye+"."+(+O+1)+".0":qe=">="+ye+"."+O+"."+$+se+" <"+(+ye+1)+".0.0"):(t("no pr"),ye==="0"?O==="0"?qe=">="+ye+"."+O+"."+$+" <"+ye+"."+O+"."+(+$+1):qe=">="+ye+"."+O+"."+$+" <"+ye+"."+(+O+1)+".0":qe=">="+ye+"."+O+"."+$+" <"+(+ye+1)+".0.0"),t("caret return",qe),qe})}function $n(K,de){return t("replaceXRanges",K,de),K.split(/\s+/).map(function(T){return Ss(T,de)}).join(" ")}function Ss(K,de){K=K.trim();var T=de?o[ne]:o[j];return K.replace(T,function(ie,ye,O,$,se,qe){t("xRange",K,ie,ye,O,$,se,qe);var Wi=be(O),Hi=Wi||be($),ia=Hi||be(se),Bl=ia;return ye==="="&&Bl&&(ye=""),Wi?ye===">"||ye==="<"?ie="<0.0.0":ie="*":ye&&Bl?(Hi&&($=0),ia&&(se=0),ye===">"?(ye=">=",Hi?(O=+O+1,$=0,se=0):ia&&($=+$+1,se=0)):ye==="<="&&(ye="<",Hi?O=+O+1:$=+$+1),ie=ye+O+"."+$+"."+se):Hi?ie=">="+O+".0.0 <"+(+O+1)+".0.0":ia&&(ie=">="+O+"."+$+".0 <"+O+"."+(+$+1)+".0"),t("xRange return",ie),ie})}function Wr(K,de){return t("replaceStars",K,de),K.trim().replace(o[rs],"")}function Va(K,de,T,ie,ye,O,$,se,qe,Wi,Hi,ia,Bl){return be(T)?de="":be(ie)?de=">="+T+".0.0":be(ye)?de=">="+T+"."+ie+".0":de=">="+de,be(qe)?se="":be(Wi)?se="<"+(+qe+1)+".0.0":be(Hi)?se="<"+qe+"."+(+Wi+1)+".0":ia?se="<="+qe+"."+Wi+"."+Hi+"-"+ia:se="<="+se,(de+" "+se).trim()}Ts.prototype.test=function(K){if(!K)return!1;typeof K=="string"&&(K=new On(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=Oh;function Oh(K,de,T){try{de=new Ts(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 Ts(de,T)}catch{return null}return K.forEach(function($){O.test($)&&(!ie||ye.compare($)===-1)&&(ie=$,ye=new On(ie,T))}),ie}e.minSatisfying=ho;function ho(K,de,T){var ie=null,ye=null;try{var O=new Ts(de,T)}catch{return null}return K.forEach(function($){O.test($)&&(!ie||ye.compare($)===1)&&(ie=$,ye=new On(ie,T))}),ie}e.validRange=nr;function nr(K,de){try{return new Ts(K,de).range||"*"}catch{return null}}e.ltr=gn;function gn(K,de,T){return at(K,de,"<",T)}e.gtr=Se;function Se(K,de,T){return at(K,de,">",T)}e.outside=at;function at(K,de,T,ie){K=new On(K,ie),de=new Ts(de,ie);var ye,O,$,se,qe;switch(T){case">":ye=nc,O=Kc,$=Bo,se=">",qe=">=";break;case"<":ye=Bo,O=ah,$=nc,se="<",qe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Oh(K,de,ie))return!1;for(var Wi=0;Wi=0.0.0")),ia=ia||_g,Bl=Bl||_g,ye(_g.semver,ia.semver,ie)?ia=_g:$(_g.semver,Bl.semver,ie)&&(Bl=_g)}),ia.operator===se||ia.operator===qe||(!Bl.operator||Bl.operator===se)&&O(K,Bl.semver))return!1;if(Bl.operator===qe&&$(K,Bl.semver))return!1}return!0}e.prerelease=Ot;function Ot(K,de){var T=Ln(K,de);return T&&T.prerelease.length?T.prerelease:null}e.intersects=Si;function Si(K,de,T){return K=new Ts(K,T),de=new Ts(de,T),K.intersects(de)}e.coerce=Bt;function Bt(K){if(K instanceof On)return K;if(typeof K!="string")return null;var de=K.match(o[ge]);return de==null?null:Ln((de[1]||"0")+"."+(de[2]||"0")+"."+(de[3]||"0"))}})(qAe,qAe.exports);var iH=qAe.exports;function P$t(s,e,t,i,n){const r=new ba;return s.forEach(o=>{const a=r.get(o.identifier);a&&n.warn(g(4825,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,o.extensionLocation.fsPath)),r.set(o.identifier,o)}),e.forEach(o=>{const a=r.get(o.identifier);if(a)if(a.isBuiltin){if(iH.gte(a.version,o.version)){n.warn(`Skipping extension ${o.extensionLocation.path} in favour of the builtin extension ${a.extensionLocation.path}.`);return}o.isBuiltin=!0}else n.warn(g(4825,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,o.extensionLocation.fsPath));else if(o.isBuiltin){n.warn(`Skipping obsolete builtin extension ${o.extensionLocation.path}`);return}r.set(o.identifier,o)}),t.forEach(o=>{const a=r.get(o.identifier);a&&n.warn(g(4826,"Overwriting {0} with Workspace Extension {1}.",a.extensionLocation.fsPath,o.extensionLocation.fsPath)),r.set(o.identifier,o)}),i.forEach(o=>{n.info(g(4827,"Loading development extension at {0}",o.extensionLocation.fsPath));const a=r.get(o.identifier);a&&a.isBuiltin&&(o.isBuiltin=!0),r.set(o.identifier,o)}),Array.from(r.values())}let QAe=class extends V{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(),this.runningLocation=e,this._initDataProvider=t,this.remoteSocketFactoryService=i,this._contextService=n,this._environmentService=r,this._telemetryService=o,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=OA.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=lPe(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:jl,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 r=!0;return n&&n.length>0&&n[0].scheme===pe.file&&(r=!1),r||(i.break=!1),S$t(e,i).then(o=>{this._register(o);const{protocol:a,debugPort:c,reconnectionToken:l}=o,d=typeof c=="number";return r&&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(Wee(m,pp.Ready)){this._createExtHostInitData(d).then(v=>{a.send(Ge.fromString(JSON.stringify(v)))});return}if(Wee(m,pp.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:pMe(this._productService,this._environmentService),appLanguage:jl,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===OA.EagerAutoStart,uiKind:Hn?sv.Web:sv.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){if(super.dispose(),this._terminating=!0,this._protocol){const e=this._protocol.getSocket();this._protocol.send(pst(pp.Terminate)),this._protocol.sendDisconnect(),this._protocol.dispose(),e.end(),this._protocol=null}}};QAe=D([_(2,fMe),_(3,Ci),_(4,Xo),_(5,Ji),_(6,Ke),_(7,pf),_(8,Os),_(9,bC),_(10,LXe),_(11,xo),_(12,FXe)],QAe);var jAe;let YAe=class extends OAe{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k,P,R){super(e,t,i,n,r,o,a,c,l,d,h,u,f,p,v,b,w,y,C,R),this._browserEnvironmentService=o,this._webExtensionsScannerService=m,this._userDataInitializationService=A,this._userDataProfileService=L,this._workspaceTrustManagementService=k,this._remoteExplorerService=P,y.when(Ms.Ready).then(async()=>{await this._userDataInitializationService.initializeInstalledExtensions(this._instantiationService),this._initialize()}),this._initFetchFileSystem()}_initFetchFileSystem(){const e=new N$t;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(r=>mD(r)))),this._webExtensionsScannerService.scanUserExtensions(this._userDataProfileService.currentProfile.extensionsResource,{skipInvalidExtensions:!0}).then(n=>t.push(...n.map(r=>mD(r)))),this._webExtensionsScannerService.scanExtensionsUnderDevelopment().then(n=>i.push(...n.map(r=>mD(r,!0))))])}catch(n){this._logService.error(n)}return P$t(e,t,[],i,this._logService)}async _resolveExtensionsDefault(){const[e,t]=await Promise.all([this._scanWebExtensions(),this._remoteExtensionsScannerService.scanExtensions()]);return new Q9t(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 wD.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===pI.ConnectionLost&&this._remoteAuthorityResolverService._clearResolvedAuthority(e)}),i.onReconnecting(()=>this._resolveAuthorityAgain())),this._resolveExtensionsDefault()}async _onExtensionHostExit(e){this._doStopExtensionHosts();const t=ri;typeof t.codeAutomationExit=="function"&&t.codeAutomationExit(e,await c$t(this._fileService,this._environmentService))}async _resolveAuthority(e){return this._resolveAuthorityOnExtensionHosts(dr.LocalWebWorker,e)}};YAe=D([_(3,we),_(4,wi),_(5,fv),_(6,Ji),_(7,Ol),_(8,Xt),_(9,xo),_(10,q6),_(11,Ci),_(12,Te),_(13,Rm),_(14,MMe),_(15,Ke),_(16,fg),_(17,sce),_(18,rg),_(19,bC),_(20,yce),_(21,pg),_(22,mC),_(23,vce),_(24,ir)],YAe);let JAe=class{constructor(e,t,i,n,r,o,a,c){this._extensionsProposedApi=e,this._scanWebExtensions=t,this._getExtensionRegistrySnapshotWhenReady=i,this._instantiationService=n,this._remoteAgentService=r,this._remoteAuthorityResolverService=o,this._extensionEnablementService=a,this._logService=c}createExtensionHost(e,t,i){switch(t.kind){case dr.LocalProcess:return null;case dr.LocalWebWorker:{const n=i?OA.EagerManualStart:OA.EagerAutoStart;return this._instantiationService.createInstance(Hee,t,n,this._createLocalExtensionHostDataProvider(e,t,i))}case dr.Remote:{const n=this._remoteAgentService.getConnection();return n?this._instantiationService.createInstance(QAe,t,this._createRemoteExtensionHostDataProvider(e,n.remoteAuthority)):null}}}_createLocalExtensionHostDataProvider(e,t,i){return{getInitData:async()=>{if(i){const n=BAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,await this._scanWebExtensions(),!0),r=e.computeRunningLocation(n,[],!1),o=cj(n,r,c=>t.equals(c));return{extensions:new dQ(0,n,o.map(c=>c.identifier))}}else{const n=await this._getExtensionRegistrySnapshotWhenReady(),r=e.filterByRunningLocation(n.extensions,t);return{extensions:new dQ(n.versionId,n.extensions,r.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 r=e.filterByExtensionHostKind(i.extensions,dr.Remote),o=new dQ(i.versionId,i.extensions,r.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:o}}}}};JAe=D([_(3,we),_(4,fg),_(5,bC),_(6,Ol),_(7,Ke)],JAe);let XAe=jAe=class{constructor(e){this._logService=e}pickExtensionHostKind(e,t,i,n,r){const o=jAe.pickRunningLocation(t,i,n,r);return this._logService.trace(`pickRunningLocation for ${e.value}, extension kinds: [${t.join(", ")}], isInstalledLocally: ${i}, isInstalledRemotely: ${n}, preference: ${d9t(r)} => ${bS(o)}`),o}static pickRunningLocation(e,t,i,n){const r=[];let o=!1;for(const a of e){if(a==="ui"&&i){if(n===Jg.Remote)return dr.Remote;o=!0}if(a==="workspace"&&i){if(n===Jg.None||n===Jg.Remote)return dr.Remote;r.push(dr.Remote)}if(a==="web"&&(t||i)){if(n===Jg.None||n===Jg.Local)return dr.LocalWebWorker;r.push(dr.LocalWebWorker)}}return o&&r.push(dr.Remote),r.length>0?r[0]:null}};XAe=jAe=D([_(0,Ke)],XAe);async function F$t(s,e,t){let i=t&&t.get("storage.serviceMachineId",Ie.APPLICATION)||null;if(i)return i;try{const r=(await e.readFile(s.serviceMachineIdResource)).value.toString();i=$xt(r)?r:null}catch{i=null}if(!i){i=ao();try{await e.writeFile(s.serviceMachineIdResource,Ge.fromString(i))}catch{}}return t?.store("storage.serviceMachineId",i,Ie.APPLICATION,cn.MACHINE),i}const O$t="/web-extension-resource/";class B$t{constructor(e,t,i,n,r){this._fileService=e,this._storageService=t,this._productService=i,this._environmentService=n,this._configurationService=r,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},r){if(this._extensionGalleryResourceUrlTemplate){const o=N.parse(wfe(this._extensionGalleryResourceUrlTemplate,{publisher:e,name:t,version:n!==void 0&&n!==xs.UNDEFINED&&n!==xs.UNKNOWN&&n!==xs.UNIVERSAL?`${i}+${n}`:i,path:"extension"}));return this._isWebExtensionResourceEndPoint(o)?o.with({scheme:M8.getPreferredWebSchema()}):o}}isExtensionGalleryResource(e){return!!this._extensionGalleryAuthority&&this._extensionGalleryAuthority===this._getExtensionGalleryAuthority(e)}async getExtensionGalleryRequestHeaders(){const e={"X-Client-Name":`${this._productService.applicationName}${Hn?"-web":""}`,"X-Client-Version":this._productService.version};return lQ(this._productService,this._environmentService)&&cLt(this._configurationService)===jg.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=F$t(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=M8.getServerRootPath();return t.startsWith(i)&&t.startsWith(O$t,i.length)}}let ZAe=class extends B$t{constructor(e,t,i,n,r,o){super(e,t,i,n,r),this._logService=o}async readExtensionResource(e){if(e=sf.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()}};ZAe=D([_(0,Xt),_(1,Gi),_(2,xo),_(3,ec),_(4,Te),_(5,Ke)],ZAe);var QP,eEe;class lz{static fromJSON(e){if(e)try{const t=JSON.parse(e);return new lz(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 zR;let tEe=(zR=class{constructor(e,t,i){this._storageService=t,this._envService=i,this._disabled=new Map;const n=t.get(QP._storageKey,Ie.APPLICATION);if(this._state=lz.fromJSON(n),this._state){const{mid:r,high:o}=this._state;for(let a=0;a=r&&aNa({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 lz(t,0,t.length,0);this._storageService.store(QP._storageKey,JSON.stringify(i),Ie.APPLICATION,cn.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 lz(this._state.extensions,e?this._state.low:this._state.mid,e?this._state.mid:this._state.high);this._storageService.store(QP._storageKey,JSON.stringify(t),Ie.APPLICATION,cn.MACHINE),await this._storageService.flush()}async reset(){this._storageService.remove(QP._storageKey,Ie.APPLICATION),await this._storageService.flush()}},QP=zR,zR._storageKey="extensionBisectState",zR);tEe=QP=D([_(0,Ke),_(1,Gi),_(2,Xo)],tEe);var $R;let nH=($R=class{constructor(e,t,i,n){this._extensionBisectService=t,this._notificationService=i,this._commandService=n,t.isActive&&(eEe.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(Ze.Info,n,[e,t,i],{sticky:!0,priority:Z2.URGENT})}},eEe=$R,$R.ctxIsBisectActive=new Q("isExtensionBisectActive",!1),$R);nH=eEe=D([_(0,Le),_(1,qU),_(2,wi),_(3,bi)],nH);je.as(hf.Workbench).registerWorkbenchContribution(nH,Ms.Restored);Et(class extends di{constructor(){super({id:"extension.bisect.start",title:Pe(1142,"Start Extension Bisect"),category:la.Help,f1:!0,precondition:nH.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(ir),t=s.get(Dc),i=s.get(H6),n=s.get(Ol),r=s.get(qU),o=(await i.getInstalled(wo.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(o.length)|0),primaryButton:g(1145,"&&Start Extension Bisect")})).confirmed&&(await r.start(o),t.reload())}});Et(class extends di{constructor(){super({id:"extension.bisect.next",title:Pe(1146,"Continue Extension Bisect"),category:la.Help,f1:!0,precondition:nH.ctxIsBisectActive})}async run(s,e){const t=s.get(ir),i=s.get(Dc),n=s.get(qU),r=s.get(xo),o=s.get(RXe),a=s.get(bi);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}.",r.nameShort));else{const l=await t.confirm({type:Ze.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 o.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:Ze.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}});Et(class extends di{constructor(){super({id:"extension.bisect.stop",title:Pe(1159,"Stop Extension Bisect"),category:la.Help,f1:!0,precondition:nH.ctxIsBisectActive})}async run(s){const e=s.get(qU),t=s.get(Dc);await e.reset(),t.reload()}});function W$t(s,e){return s}function H$t(s){for(const[e,t]of Object.entries(s))sf.registerAppResourcePathUrl(e,t)}function Uee(s){switch(s){case Hr.InvalidSymbol:return g(1162,"Invalid symbol");case Hr.InvalidNumberFormat:return g(1163,"Invalid number format");case Hr.PropertyNameExpected:return g(1164,"Property name expected");case Hr.ValueExpected:return g(1165,"Value expected");case Hr.ColonExpected:return g(1166,"Colon expected");case Hr.CommaExpected:return g(1167,"Comma expected");case Hr.CloseBraceExpected:return g(1168,"Closing brace expected");case Hr.CloseBracketExpected:return g(1169,"Closing bracket expected");case Hr.EndOfFileExpected:return g(1170,"End of file expected");default:return""}}const mst=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,U$t=/^-(\d{4})(\d{2})(\d{2})$/;function V$t(s){return s=s.trim(),s==="*"||mst.test(s)}function N9(s){if(!V$t(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(mst);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 P9(s){if(!s)return null;const e=s.majorBase,t=s.majorMustEqual,i=s.minorBase;let n=s.minorMustEqual;const r=s.patchBase;let o=s.patchMustEqual;s.hasCaret&&(e===0||(n=!1),o=!1);let a=0;if(s.preRelease){const c=U$t.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:r,patchMustEqual:o,isMinimum:s.hasGreaterEquals,notBefore:a}}function z$t(s,e,t){let i;typeof s=="string"?i=P9(N9(s)):i=s;let n;e instanceof Date?n=e.getTime():typeof e=="string"&&(n=new Date(e).getTime());let r;if(typeof t=="string"?r=P9(N9(t)):r=t,!i||!r)return!1;const o=i.majorBase,a=i.minorBase,c=i.patchBase;let l=r.majorBase,d=r.minorBase,h=r.patchBase;const u=r.notBefore;let f=r.majorMustEqual,p=r.minorMustEqual,m=r.patchMustEqual;return r.isMinimum?o>l?!0:od?!0:a=h:(o===1&&l===0&&(!f||!p||!m)&&(l=1,d=0,h=0,f=!0,p=!1,m=!1),ol?!f:ad?!p:ch?!m:!(n&&n"u"&&typeof i.browser>"u")return o.push([Ze.Error,g(1178,"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([Ze.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 o.push([Ze.Error,g(1180,"property `{0}` can be omitted or must be of type `string`","main")]),o;{const l=Ft(t,i.main);Jy(l,t)||o.push([Ze.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 o.push([Ze.Error,g(1182,"property `{0}` can be omitted or must be of type `string`","browser")]),o;{const l=Ft(t,i.browser);Jy(l,t)||o.push([Ze.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(!iH.valid(i.version))return o.push([Ze.Error,g(1184,"Extension version is not semver compatible.")]),o;const a=[];if(!G$t(s,e,i,n,a))for(const l of a)o.push([Ze.Error,l]);if(r&&i.enabledApiProposals?.length){const l=[];if(!K$t([...i.enabledApiProposals],l))for(const d of l)o.push([Ze.Error,d])}return o}function G$t(s,e,t,i,n){return i||typeof t.main>"u"&&typeof t.browser>"u"?!0:q$t(s,e,t.engines.vscode,n)}function K$t(s,e){if(s.length===0)return!0;const t=Array.isArray(e)?e:void 0,i=(t?void 0:e)??BM,n=[],r=w1t(s);for(const{proposalName:o,version:a}of r){const c=i[o];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.",o))}return t?.push(...n),n.length===0}function q$t(s,e,t,i=[]){const n=P9(N9(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 z$t(s,e,n)?!0:(i.push(g(1189,"Extension is not compatible with Code {0}. Extension requires: {1}.",s,t)),!1)}function fze(s){if(!Array.isArray(s))return!1;for(let e=0,t=s.length;e{const a=[];if(i)a.push(...o);else for(const c of o)e.some(([l])=>Na(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=>Na(u.identifier,c.identifier)&&u.version===c.manifest.version),h={identifier:c.identifier,version:c.manifest.version,location:c.location,metadata:l};d===-1?(r.push(h),a.push(h)):a.splice(d,1,h)}return r.length&&this._onAddExtensions.fire({extensions:r,profileLocation:t}),n.length&&this._onRemoveExtensions.fire({extensions:n,profileLocation:t}),a}),r.length&&this._onDidAddExtensions.fire({extensions:r,profileLocation:t}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,profileLocation:t}),r}catch(o){throw r.length&&this._onDidAddExtensions.fire({extensions:r,error:o,profileLocation:t}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,error:o,profileLocation:t}),o}}async updateMetadata(e,t){const i=[];return await this.withProfileExtensions(t,n=>{const r=[];for(const o of n){const a=e.find(([c])=>Na(c.identifier,o.identifier)&&c.manifest.version===o.version);a&&(o.metadata={...o.metadata,...a[1]},i.push(o)),r.push(o)}return r}),i}async removeExtensionFromProfile(e,t){const i=[];try{await this.withProfileExtensions(t,n=>{const r=[];for(const o of n)Na(o.identifier,e.identifier)?i.push(o):r.push(o);return i.length&&this._onRemoveExtensions.fire({extensions:i,profileLocation:t}),r}),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=[],r;try{const o=await this.fileService.readFile(e);r=JSON.parse(o.value.toString().trim()||"[]")}catch(o){if(Qw(o)!==ji.FILE_NOT_FOUND)throw o;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(r=await this.migrateFromOldDefaultProfileExtensionsLocation()),!r&&i?.bailOutWhenFileNotFound)throw new Vee(ou(o),sH.ERROR_PROFILE_NOT_FOUND)}if(r){Array.isArray(r)||this.reportAndThrowInvalidConentError(e);let o=!1;for(const a of r){mze(a)||this.reportAndThrowInvalidConentError(e);let c;if(Rt(a.relativeLocation)&&a.relativeLocation)c=this.resolveExtensionLocation(a.relativeLocation);else if(Rt(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&&(o=!0,a.relativeLocation=l)}Ja(a.metadata?.hasPreReleaseVersion)&&a.metadata?.preRelease&&(o=!0,a.metadata.hasPreReleaseVersion=!0),n.push({identifier:a.identifier,location:c,version:a.version,metadata:a.metadata})}o&&await this.fileService.writeFile(e,Ge.fromString(JSON.stringify(r)))}if(t){n=t(n);const o=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,Ge.fromString(JSON.stringify(o)))}return n})}reportAndThrowInvalidConentError(e){const t=new Vee(`Invalid extensions content in ${e.toString()}`,sH.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(r){if(Qw(r)===ji.FILE_NOT_FOUND)return;throw r}this.logService.info("Migrating extensions from old default profile location",e.toString());let n;try{const r=JSON.parse(i);Array.isArray(r)&&r.every(o=>mze(o))?n=r:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",r)}catch(r){this.logService.error(r)}if(n)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,Ge.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(r){if(Qw(r)===ji.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 r}try{await this.fileService.del(e)}catch(r){Qw(r)!==ji.FILE_NOT_FOUND&&this.logService.error(r)}try{await this.fileService.del(t)}catch(r){Qw(r)!==ji.FILE_NOT_FOUND&&this.logService.error(r)}return n})()),this._migrationPromise}getResourceAccessQueue(e){let t=this.resourcesAccessQueueMap.get(e);return t||(t=new EI,this.resourcesAccessQueueMap.set(e,t)),t}};pze=D([_(1,Xt),_(2,km),_(3,Is),_(4,Ji),_(5,Ke)],pze);function mze(s){return In(s)&&XRt(s.identifier)&&(Q$t(s.location)||Rt(s.location)&&s.location)&&(Ja(s.relativeLocation)||Rt(s.relativeLocation))&&s.version&&Rt(s.version)}function Q$t(s){return s?Rt(s.path)&&Rt(s.scheme):!1}function j$t(s,e,t,i){try{Y$t(s,e,t,i)}catch(n){s.error(n?.message??n)}return e}function Y$t(s,e,t,i){const n=(r,o,a)=>{const c=r[o];if(Rt(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&&(o==="title"||o==="category")&&m&&m!==f){const v={value:f,original:m};r[o]=v}else r[o]=f}}else if(In(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(wo.System))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(wo.User)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=iMt(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,t,i){const[n,r]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(t)]),o=i?await this.scanExtensionsUnderDevelopment(e,[...n,...r]):[];return this.dedupExtensions(n,r,o,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],wo.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,wo.User,!e.includeUninstalled,e.language,!0,i,e.productVersion??this.getProductVersion()),r=e.useCache&&!n.devMode&&n.excludeObsolete?this.userExtensionsCachedScanner:this.extensionsScanner;let o;try{o=await r.scanExtensions(n)}catch(a){if(a instanceof Vee&&a.code===sH.ERROR_PROFILE_NOT_FOUND)await this.doInitializeDefaultProfileExtensions(),o=await r.scanExtensions(n);else throw a}return o=await this.applyScanOptions(o,wo.User,e,!0),this.logService.trace("Scanned user extensions:",o.length),o}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 r=await this.createExtensionScannerInput(n,!1,wo.User,!0,e.language,!1,void 0,e.productVersion??this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(r)).map(a=>(a.type=t.find(c=>Na(c.identifier,a.identifier))?.type??a.type,this.extensionsScanner.validate(a,r)))}))).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()),r=await this.extensionsScanner.scanExtension(n);return!r||!i.includeInvalid&&!r.isValid?null:r}async scanOneOrMultipleExtensions(e,t,i){const n=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),r=await this.extensionsScanner.scanOneOrMultipleExtensions(n);return this.applyScanOptions(r,t,i,!0)}async scanMultipleExtensions(e,t,i){const n=[];return await Promise.all(e.map(async r=>{const o=await this.scanOneOrMultipleExtensions(r,t,i);n.push(...o)})),this.applyScanOptions(n,t,i,!0)}async scanMetadata(e){const t=Ft(e,"package.json"),i=(await this.fileService.readFile(t)).value.toString();return JSON.parse(i).__metadata}async updateMetadata(e,t){const i=Ft(e,"package.json"),n=(await this.fileService.readFile(i)).value.toString(),r=JSON.parse(n);t.isMachineScoped===!1&&delete t.isMachineScoped,t.isBuiltin===!1&&delete t.isBuiltin,r.__metadata={...r.__metadata,...t},await this.fileService.writeFile(Ft(e,"package.json"),Ge.fromString(JSON.stringify(r,null," ")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Vee&&e.code===sH.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,Ge.fromString(JSON.stringify([])))}catch(t){Qw(t)!==ji.FILE_NOT_FOUND&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),ou(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===wo.System?e:void 0,t===wo.User?e:void 0,t==="development"?e:void 0,await this.getTargetPlatform(),n)),i.includeInvalid||(e=e.filter(r=>r.isValid)),e.sort((r,o)=>{const a=Kr(r.location.fsPath),c=Kr(o.location.fsPath);return ac?1:0})}dedupExtensions(e,t,i,n,r){const o=(c,l,d)=>{if(c.isValid&&!l.isValid)return!1;if(c.isValid===l.isValid){if(r&&iH.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(iH.eq(c.manifest.version,l.manifest.version)){if(c.type===wo.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 ba;return e?.forEach(c=>{const l=a.get(c.identifier.id);(!l||o(l,c,!1))&&a.set(c.identifier.id,c)}),t?.forEach(c=>{const l=a.get(c.identifier.id);if(!l&&e&&c.type===wo.System){this.logService.debug(`Skipping obsolete system extension ${c.location.path}.`);return}(!l||o(l,c,!1))&&a.set(c.identifier.id,c)}),i?.forEach(c=>{const l=a.get(c.identifier.id);(!l||o(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,wo.System,!0,t,!0,void 0,this.getProductVersion()),r=await(e&&!i.devMode?this.systemExtensionsCachedScanner:this.extensionsScanner).scanExtensions(i);return this.logService.trace("Scanned system extensions:",r.length),r}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():{},r=[],o=N.file(Bk(kfe(sf.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const c of i){const l=n[c.name]||"marketplace";switch(l){case"disabled":break;case"marketplace":r.push(Ft(o,c.name));break;default:r.push(N.file(l));break}}const a=await Promise.all(r.map(async c=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(c,!1,wo.System,!0,e,!0,void 0,this.getProductVersion()))));return this.logService.trace("Scanned dev system extensions:",a.length),Oi(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,r,o,a,c){const l=await this.getTranslations(r??jl),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 dz(e,d,h,u,t,a,i,n,o,c.version,c.date,this.productService.commit,!this.environmentService.isBuilt,r,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}}};_ze=D([_(4,km),_(5,tce),_(6,Xt),_(7,Ke),_(8,ec),_(9,xo),_(10,Is),_(11,we)],_ze);class dz{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m){this.location=e,this.mtime=t,this.applicationExtensionslocation=i,this.applicationExtensionslocationMtime=n,this.profile=r,this.profileScanOptions=o,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 Yi(e.location,t.location)&&e.mtime===t.mtime&&Yi(e.applicationExtensionslocation,t.applicationExtensionslocation)&&e.applicationExtensionslocationMtime===t.applicationExtensionslocationMtime&&e.profile===t.profile&&Js(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&&iEe.equals(e.translations,t.translations)}}let nEe=class extends V{constructor(e,t){super(),this.fileService=e,this.logService=t}async getLocalizedMessages(e,t,i){const n=Ft(e,"package.nls.json"),r=(l,d)=>{d.forEach(h=>{this.logService.error(this.formatMessage(e,g(444,"Failed to parse {0}: {1}.",l?.path,Uee(h.error))))})},o=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=af(d,h);return h.length>0?(r(l,h),{values:void 0,default:n}):dD(u)!=="object"?(o(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=af(h,u);return u.length>0?(r(d.localized,u),{values:void 0,default:d.original}):dD(f)!=="object"?(o(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 r=[],o=await this.resolveOriginalMessageBundle(n.default,r);if(r.length>0)return r.forEach(c=>{this.logService.error(this.formatMessage(e,g(444,"Failed to parse {0}: {1}.",n.default?.path,Uee(c.error))))}),t;if(dD(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 j$t(this.logService,t,a,o)}catch{}return t}async resolveOriginalMessageBundle(e,t){if(e)try{const i=(await this.fileService.readFile(e)).value.toString();return af(i,t)}catch{}}findMessageBundles(e,t){return new Promise((i,n)=>{const r=o=>{const a=Ft(e,`package.nls.${o}.json`);this.fileService.exists(a).then(c=>{c&&i({localized:a,original:Ft(e,"package.nls.json")});const l=o.lastIndexOf("-");l===-1?i({localized:Ft(e,"package.nls.json"),original:null}):(o=o.substring(0,l),r(o))})};if(t.devMode||t.pseudo||!t.language)return i({localized:Ft(e,"package.nls.json"),original:null});r(t.language)})}formatMessage(e,t){return`[${e.path}]: ${t}`}};nEe=D([_(0,Xt),_(1,Ke)],nEe);let zee=class extends nEe{constructor(e,t,i,n,r,o,a){super(n,a),this.obsoleteFile=e,this.extensionsProfileScannerService=t,this.uriIdentityService=i,this.environmentService=o,this.extensionsEnabledWithApiProposalVersion=r.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===wo.User)try{const n=(await this.fileService.readFile(this.obsoleteFile)).value.toString();i=JSON.parse(n)}catch{}return DA(i)?t:t.filter(n=>!i[V5.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===wo.User&&vi(n.resource).indexOf(".")===0)return null;const r=new dz(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(r)}));return Oi(i).sort((n,r)=>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 r=await Promise.all(n.map(async o=>{if(t(o)){const a=new dz(o.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,o.metadata)}return null}));return Oi(r)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(Ft(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}:`,ou(t)),[]}}async scanExtension(e,t){try{let i=await this.scanExtensionManifest(e.location);if(i){i.publisher||(i.publisher=pXe),t=t??i.__metadata,delete i.__metadata;const n=Mw(i.publisher,i.name),r=t?.id?{id:n,uuid:t.id}:{id:n},o=t?.isSystem?wo.System:e.type,a=o===wo.System||!!t?.isBuiltin;i=await this.translateManifest(e.location,i,dz.createNlsConfiguration(e));let c={type:o,identifier:r,manifest:i,location:e.location,isBuiltin:a,targetPlatform:t?.targetPlatform??xs.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=y1t([...i.enabledApiProposals])),c}}catch(i){e.type!==wo.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()),r=$$t(t.productVersion,t.productDate,t.location,e.manifest,e.isBuiltin,n);for(const[o,a]of r)o===Ze.Error&&(i=!1,this.logService.error(this.formatMessage(t.location,a)));return e.isValid=i,e.validations=r,e}async scanExtensionManifest(e){const t=Ft(e,"package.json");let i;try{i=(await this.fileService.readFile(t)).value.toString()}catch(r){return Qw(r)!==ji.FILE_NOT_FOUND&&this.logService.error(this.formatMessage(e,g(446,"Cannot read file {0}: {1}.",t.path,r.message))),null}let n;try{n=JSON.parse(i)}catch{const o=[];af(i,o);for(const a of o)this.logService.error(this.formatMessage(e,g(447,"Failed to parse {0}: [{1}, {2}] {3}.",t.path,a.offset,a.length,Uee(a.error))));return null}return dD(n)!=="object"?(this.logService.error(this.formatMessage(e,g(448,"Invalid manifest file {0}: Not a JSON object.",t.path))),null):n}};zee=D([_(1,tce),_(2,Is),_(3,Xt),_(4,xo),_(5,ec),_(6,Ke)],zee);let $ee=class extends zee{constructor(e,t,i,n,r,o,a,c,l){super(t,n,r,o,a,c,l),this.currentProfile=e,this.userDataProfilesService=i,this.cacheValidatorThrottler=this._register(new c6(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&&dz.equals(i.input,this.input))return this.logService.debug("Using cached extensions scan result",e.type===wo.System?"system":"user",e.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),i.result.map(r=>(r.location=N.revive(r.location),r));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:Mr(i.input)}}catch(t){this.logService.debug("Error while reading the extension cache file:",e.path,ou(t))}return null}async writeExtensionCache(e,t){try{await this.fileService.writeFile(e,Ge.fromString(JSON.stringify(t)))}catch(i){this.logService.debug("Error while writing the extension cache file:",e.path,ou(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(!Js(n,i))try{this.logService.info("Invalidating Cache",i,n),await this.fileService.del(e),this._onDidChangeCache.fire()}catch(r){this.logService.error(r)}}getCacheFile(e){const t=this.getProfile(e);return this.uriIdentityService.extUri.joinPath(t.cacheHome,e.type===wo.System?m1t:p1t)}getProfile(e){return e.type===wo.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}};$ee=D([_(2,km),_(3,tce),_(4,Is),_(5,Xt),_(6,xo),_(7,ec),_(8,Ke)],$ee);const sEe=["W","X","Y","Z","a","b","c","d","e","f"],J$t=new RegExp(`^[${sEe.join("")}]+`),_st=7;function X$t(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(J$t,""),_st),i=Rqe(s.fragment.substring(e+1)).toString();if(!isNaN(t))return{handle:t,notebook:s.with({scheme:i,fragment:null})}}function Z$t(s,e){const t=e.toString(_st),n=`${t.lengthGe.wrap(o))),r=d7t(n);return i=i||r.byteLength!==n.byteLength,{data:r,didCompression:i}}const hj="\x1B[A",jue=hj.split("").map(s=>s.charCodeAt(0)),s7t=10;function r7t(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 c7t=8,l7t=13;function d7t(s){return!s.buffer.includes(c7t)&&!s.buffer.includes(l7t)?s:Ge.fromString(a7t(o7t(i7t.decode(s.buffer))))}var aEe,T0,kC,cEe,L0,ME,R0,lEe,dEe,uj,HV,hEe,cw,lw,uEe,Ag,gEe;function Ii(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 qee;(function(s){s[s.Top=0]="Top",s[s.Bottom=1]="Bottom"})(qee||(qee={}));var X1,FGe;let js=aEe=(FGe=class{constructor(e){Ht(this,X1);St(this,X1,e)}static from(...e){let t=e;return new aEe(function(){if(t){for(const i of t)i&&typeof i.dispose=="function"&&i.dispose();t=void 0}})}dispose(){typeof Ce(this,X1)=="function"&&(Ce(this,X1).call(this),St(this,X1,void 0))}},X1=new WeakMap,FGe);js=aEe=D([Ii],js);let ws=T0=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 Fi();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 T0(this.line+i,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw Fi();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 T0(i,t)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};ws=T0=D([Ii],ws);let Xn=kC=class{static isRange(e){return e instanceof kC?!0:e?ws.isPosition(e.start)&&ws.isPosition(e.end):!1}static of(e){if(e instanceof kC)return e;if(this.isRange(e))return new kC(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 r,o;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof n=="number"?(r=new ws(e,t),o=new ws(i,n)):ws.isPosition(e)&&ws.isPosition(t)&&(r=ws.of(e),o=ws.of(t)),!r||!o)throw new Error("Invalid arguments");r.isBefore(o)?(this._start=r,this._end=o):(this._start=o,this._end=r)}contains(e){return kC.isRange(e)?this.contains(e.start)&&this.contains(e.end):ws.isPosition(e)?!(ws.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=ws.Max(e.start,this._start),i=ws.Min(e.end,this._end);if(!t.isAfter(i))return new kC(t,i)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;const t=ws.Min(e.start,this._start),i=ws.Max(e.end,this.end);return new kC(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 Fi();let i;return e?ws.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 kC(i,t)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return bst(this)}};Xn=kC=D([Ii],Xn);let uC=cEe=class extends Xn{static isSelection(e){return e instanceof cEe?!0:e?Xn.isRange(e)&&ws.isPosition(e.anchor)&&ws.isPosition(e.active)&&typeof e.isReversed=="boolean":!1}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,i,n){let r,o;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof n=="number"?(r=new ws(e,t),o=new ws(i,n)):ws.isPosition(e)&&ws.isPosition(t)&&(r=ws.of(e),o=ws.of(t)),!r||!o)throw new Error("Invalid arguments");super(r,o),this._anchor=r,this._active=o}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 h7t(this)}};uC=cEe=D([Ii],uC);function bst(s){return s.isEmpty?`[${s.start.line}:${s.start.character})`:`[${s.start.line}:${s.start.character} -> ${s.end.line}:${s.end.character})`}function h7t(s){let e=bst(s);return s.isEmpty||(s.active.isEqual(s.start)?e=`|${e}`:e=`${e}|`),e}const wst=s=>{if(typeof s!="string"||s.length===0||!/^[0-9A-Za-z_\-]+$/.test(s))throw Fi("connectionToken")};let yst=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 Fi("host");if(typeof t!="number"||t===0||Math.round(t)!==t)throw Fi("port");typeof i<"u"&&wst(i),this.host=e,this.port=Math.round(t),this.connectionToken=i}},uz=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"&&wst(t)}},a1=class gj extends Error{static NotAvailable(e,t){return new gj(e,id.NotAvailable,t)}static TemporarilyNotAvailable(e){return new gj(e,id.TemporarilyNotAvailable)}constructor(e,t=id.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,Object.setPrototypeOf(this,gj.prototype)}};var T_;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(T_||(T_={}));var KT;(function(s){s[s.Replace=1]="Replace",s[s.Append=2]="Append",s[s.Prepend=3]="Prepend"})(KT||(KT={}));let qA=L0=class{static isTextEdit(e){return e instanceof L0?!0:e?Xn.isRange(e)&&typeof e.newText=="string":!1}static replace(e,t){return new L0(e,t)}static insert(e,t){return L0.replace(new Xn(e,e),t)}static delete(e){return L0.replace(e,"")}static setEndOfLine(e){const t=new L0(new Xn(new ws(0,0),new ws(0,0)),"");return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!Xn.isRange(e))throw Fi("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw Fi("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw Fi("newEol");this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};qA=L0=D([Ii],qA);let F9=ME=class{static isNotebookCellEdit(e){return e instanceof ME?!0:e?Dy.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new ME(e,t)}static insertCells(e,t){return new ME(new Dy(e,e),t)}static deleteCells(e){return new ME(e,[])}static updateCellMetadata(e,t){const i=new ME(new Dy(e,e),[]);return i.newCellMetadata=t,i}static updateNotebookMetadata(e){const t=new ME(new Dy(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};F9=ME=D([Ii],F9);let ele=class fj{static isSnippetTextEdit(e){return e instanceof fj?!0:e?Xn.isRange(e.range)&&vI.isSnippetString(e.snippet):!1}static replace(e,t){return new fj(e,t)}static insert(e,t){return fj.replace(new Xn(e,e),t)}constructor(e,t){this.range=e,this.snippet=t}};var bc;(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"})(bc||(bc={}));let _I=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,i,n){this._edits.push({_type:bc.File,from:e,to:t,options:i,metadata:n})}createFile(e,t,i){this._edits.push({_type:bc.File,from:void 0,to:e,options:t,metadata:i})}deleteFile(e,t,i){this._edits.push({_type:bc.File,from:e,to:void 0,options:t,metadata:i})}replaceNotebookMetadata(e,t,i){this._edits.push({_type:bc.Cell,metadata:i,uri:e,edit:{editType:mI.DocumentMetadata,metadata:t},notebookMetadata:t})}replaceNotebookCells(e,t,i,n){const r=t.start,o=t.end;(r!==o||i.length>0)&&this._edits.push({_type:bc.CellReplace,uri:e,index:r,count:o-r,cells:i,metadata:n})}replaceNotebookCellMetadata(e,t,i,n){this._edits.push({_type:bc.Cell,metadata:n,uri:e,edit:{editType:mI.Metadata,index:t,metadata:i}})}replace(e,t,i,n){this._edits.push({_type:bc.Text,uri:e,edit:new qA(t,i),metadata:n})}insert(e,t,i,n){this.replace(e,new Xn(t,t),i,n)}delete(e,t,i){this.replace(e,t,"",i)}has(e){return this._edits.some(t=>t._type===bc.Text&&t.uri.toString()===e.toString())}set(e,t){if(t)for(const i of t){if(!i)continue;let n,r;Array.isArray(i)?(n=i[0],r=i[1]):n=i,F9.isNotebookCellEdit(n)?n.newCellMetadata?this.replaceNotebookCellMetadata(e,n.range.start,n.newCellMetadata,r):n.newNotebookMetadata?this.replaceNotebookMetadata(e,n.newNotebookMetadata,r):this.replaceNotebookCells(e,n.range,n.newCells,r):ele.isSnippetTextEdit(n)?this._edits.push({_type:bc.Snippet,uri:e,range:n.range,edit:n.snippet,metadata:r}):this._edits.push({_type:bc.Text,uri:e,edit:n,metadata:r})}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 R0;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}};vI=R0=D([Ii],vI);var $x;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})($x||($x={}));var Hd;(function(s){s[s.Hint=3]="Hint",s[s.Information=2]="Information",s[s.Warning=1]="Warning",s[s.Error=0]="Error"})(Hd||(Hd={}));let Ap=lEe=class{static isLocation(e){return e instanceof lEe?!0:e?Xn.isRange(e.range)&&N.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(Xn.isRange(t))this.range=Xn.of(t);else if(ws.isPosition(t))this.range=new Xn(t,t);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};Ap=lEe=D([Ii],Ap);let rH=class{static is(e){return e?typeof e.message=="string"&&e.location&&Xn.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()}};rH=D([Ii],rH);let O9=class{constructor(e,t,i=Hd.Error){if(!Xn.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:Hd[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)&&ns(e.tags,t.tags)&&ns(e.relatedInformation,t.relatedInformation,rH.isEqual)}};O9=D([Ii],O9);let B9=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}};B9=D([Ii],B9);let W9=class extends B9{constructor(e,t,i,n){super(e,t),this.canIncreaseVerbosity=i,this.canDecreaseVerbosity=n}};W9=D([Ii],W9);var Qee;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(Qee||(Qee={}));var oH;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(oH||(oH={}));let H9=class{constructor(e,t=oH.Text){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:oH[this.kind]}}};H9=D([Ii],H9);let U9=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};U9=D([Ii],U9);var vo;(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"})(vo||(vo={}));var aH;(function(s){s[s.Deprecated=1]="Deprecated"})(aH||(aH={}));let cH=dEe=class{static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,t,i,n,r){this.name=e,this.kind=t,this.containerName=r,typeof i=="string"&&(this.containerName=i),n instanceof Ap?this.location=n:i instanceof Xn&&(this.location=new Ap(n,i)),dEe.validate(this)}toJSON(){return{name:this.name,kind:vo[this.kind],location:this.location,containerName:this.containerName}}};cH=dEe=D([Ii],cH);let lH=uj=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(uj.validate)}constructor(e,t,i,n,r){this.name=e,this.detail=t,this.kind=i,this.range=n,this.selectionRange=r,this.children=[],uj.validate(this)}};lH=uj=D([Ii],lH);var dH;(function(s){s[s.Invoke=1]="Invoke",s[s.Automatic=2]="Automatic"})(dH||(dH={}));let V9=class{constructor(e,t){this.title=e,this.kind=t}};V9=D([Ii],V9);var GR;let Aa=(GR=class{constructor(e){this.value=e}append(e){return new HV(this.value?this.value+HV.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+HV.sep)}},HV=GR,GR.sep=".",GR);Aa=HV=D([Ii],Aa);Aa.Empty=new Aa("");Aa.QuickFix=Aa.Empty.append("quickfix");Aa.Refactor=Aa.Empty.append("refactor");Aa.RefactorExtract=Aa.Refactor.append("extract");Aa.RefactorInline=Aa.Refactor.append("inline");Aa.RefactorMove=Aa.Refactor.append("move");Aa.RefactorRewrite=Aa.Refactor.append("rewrite");Aa.Source=Aa.Empty.append("source");Aa.SourceOrganizeImports=Aa.Source.append("organizeImports");Aa.SourceFixAll=Aa.Source.append("fixAll");Aa.Notebook=Aa.Empty.append("notebook");let hH=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")}};hH=D([Ii],hH);let tle=class{constructor(e,t,i,n,r,o){this.kind=e,this.name=t,this.detail=i,this.uri=n,this.range=r,this.selectionRange=o}},fPe=class{constructor(e,t){this.fromRanges=t,this.from=e}},pPe=class{constructor(e,t){this.fromRanges=t,this.to=e}};var qT;(function(s){s[s.Information=0]="Information",s[s.Warning=1]="Warning",s[s.Error=2]="Error"})(qT||(qT={}));let z9=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};z9=D([Ii],z9);var Hh,OGe;let gf=hEe=(OGe=class{constructor(e,t=!1){Ht(this,Hh);St(this,Hh,new Nt(e,{supportThemeIcons:t}))}static isMarkdownString(e){return e instanceof hEe?!0:e&&e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}get value(){return Ce(this,Hh).value}set value(e){Ce(this,Hh).value=e}get isTrusted(){return Ce(this,Hh).isTrusted}set isTrusted(e){Ce(this,Hh).isTrusted=e}get supportThemeIcons(){return Ce(this,Hh).supportThemeIcons}set supportThemeIcons(e){Ce(this,Hh).supportThemeIcons=e}get supportHtml(){return Ce(this,Hh).supportHtml}set supportHtml(e){Ce(this,Hh).supportHtml=e}get baseUri(){return Ce(this,Hh).baseUri}set baseUri(e){Ce(this,Hh).baseUri=e}appendText(e){return Ce(this,Hh).appendText(e),this}appendMarkdown(e){return Ce(this,Hh).appendMarkdown(e),this}appendCodeblock(e,t){return Ce(this,Hh).appendCodeblock(t??"",e),this}},Hh=new WeakMap,OGe);gf=hEe=D([Ii],gf);let jee=class{constructor(e,t){this.label=e,this.documentation=t}};jee=D([Ii],jee);let Yee=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};Yee=D([Ii],Yee);let Jee=class{constructor(){this.activeSignature=0,this.activeParameter=0,this.signatures=[]}};Jee=D([Ii],Jee);var Xee;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(Xee||(Xee={}));var Zee;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Zee||(Zee={}));let $9=class{constructor(e){this.value=e}};$9=D([Ii],$9);let G9=class{constructor(e,t,i){this.position=e,this.label=t,this.kind=i}};G9=D([Ii],G9);var QT;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(QT||(QT={}));var en;(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"})(en||(en={}));var uH;(function(s){s[s.Deprecated=1]="Deprecated"})(uH||(uH={}));let K9=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&en[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};K9=D([Ii],K9);let aN=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};aN=D([Ii],aN);let ete=class{constructor(e,t,i){this.insertText=e,this.range=t,this.command=i}};ete=D([Ii],ete);let tte=class{constructor(e){this.commands=void 0,this.suppressSuggestions=void 0,this.items=e}};tte=D([Ii],tte);var Gx;(function(s){s[s.Unknown=0]="Unknown",s[s.Word=1]="Word",s[s.Line=2]="Line",s[s.Suggest=3]="Suggest"})(Gx||(Gx={}));var gH;(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"})(gH||(gH={}));var NS;(function(s){s[s.Left=1]="Left",s[s.Right=2]="Right"})(NS||(NS={}));function u7t(s,e){return`${An.toKey(s)}.${e}`}var c_;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval"})(c_||(c_={}));var jT;(function(s){s[s.Manual=1]="Manual",s[s.AfterDelay=2]="AfterDelay",s[s.FocusOut=3]="FocusOut"})(jT||(jT={}));var q9;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(q9||(q9={}));var cN;(function(s){s[s.Keyboard=1]="Keyboard",s[s.Mouse=2]="Mouse",s[s.Command=3]="Command"})(cN||(cN={}));var fH;(function(s){s[s.Undo=1]="Undo",s[s.Redo=2]="Redo"})(fH||(fH={}));var Kx;(function(s){s[s.OpenOpen=0]="OpenOpen",s[s.ClosedClosed=1]="ClosedClosed",s[s.OpenClosed=2]="OpenClosed",s[s.ClosedOpen=3]="ClosedOpen"})(Kx||(Kx={}));(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})(cN||(cN={}));var lN;(function(s){s[s.Other=0]="Other",s[s.Comment=1]="Comment",s[s.String=2]="String",s[s.RegEx=3]="RegEx"})(lN||(lN={}));(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})(lN||(lN={}));let Q9=class{constructor(e,t){if(t&&!N.isUri(t))throw Fi("target");if(!Xn.isRange(e)||e.isEmpty)throw Fi("range");this.range=e,this.target=t}};Q9=D([Ii],Q9);let dN=class{constructor(e,t,i,n){this.red=e,this.green=t,this.blue=i,this.alpha=n}};dN=D([Ii],dN);let j9=class{constructor(e,t){if(t&&!(t instanceof dN))throw Fi("color");if(!Xn.isRange(e)||e.isEmpty)throw Fi("range");this.range=e,this.color=t}};j9=D([Ii],j9);let Y9=class{constructor(e){if(!e||typeof e!="string")throw Fi("label");this.label=e}};Y9=D([Ii],Y9);var ite;(function(s){s[s.Error=0]="Error",s[s.Warning=1]="Warning",s[s.Information=2]="Information"})(ite||(ite={}));var nte;(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"})(nte||(nte={}));var CD;(function(s){s[s.Low=0]="Low",s[s.Medium=1]="Medium",s[s.High=2]="High"})(CD||(CD={}));let Cst=class{constructor(e,t,i){if(this.startIndex=e,this.length=t,this.tooltip=i,typeof e!="number"||e<0)throw Fi("startIndex");if(typeof t!="number"||t<1)throw Fi("length");if(i!==void 0&&typeof i!="string")throw Fi("tooltip")}},Sst=class{constructor(e){this.uri=e}};class Ast{constructor(e){this.terminalCommand=e}}var ste;(function(s){s[s.Panel=1]="Panel",s[s.Editor=2]="Editor"})(ste||(ste={}));let Est=class{constructor(e){if(this.options=e,typeof e!="object")throw Fi("options")}};var rte;(function(s){s[s.Always=1]="Always",s[s.Silent=2]="Silent",s[s.Never=3]="Never"})(rte||(rte={}));var ote;(function(s){s[s.Shared=1]="Shared",s[s.Dedicated=2]="Dedicated",s[s.New=3]="New"})(ote||(ote={}));var fy;let pH=(fy=class{static from(e){switch(e){case"clean":return cw.Clean;case"build":return cw.Build;case"rebuild":return cw.Rebuild;case"test":return cw.Test;default:return}}constructor(e,t){if(this.label=t,typeof e!="string"||typeof t!="string")throw Fi("name");this._id=e}get id(){return this._id}},cw=fy,fy.Clean=new cw("clean","Clean"),fy.Build=new cw("build","Build"),fy.Rebuild=new cw("rebuild","Rebuild"),fy.Test=new cw("test","Test"),fy);pH=cw=D([Ii],pH);function xst(s){let e="";for(let t=0;t0)for(const t of this._args)e.push(t);return xst(e)}};hN=D([Ii],hN);let bI=class{constructor(e,t,i){if(this._args=[],Array.isArray(t)){if(!e)throw Fi("command can't be undefined or null");if(typeof e!="string"&&typeof e.value!="string")throw Fi("command");this._command=e,this._args=t,this._options=i}else{if(typeof e!="string")throw Fi("commandLine");this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!="string")throw Fi("commandLine");this._commandLine=e}get command(){return this._command?this._command:""}set command(e){if(typeof e!="string"&&typeof e.value!="string")throw Fi("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 xst(e)}};bI=D([Ii],bI);var ate;(function(s){s[s.Escape=1]="Escape",s[s.Strong=2]="Strong",s[s.Weak=3]="Weak"})(ate||(ate={}));var wI;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace"})(wI||(wI={}));let ile=class{constructor(e){this._callback=e}computeId(){return"customExecution"+ao()}set callback(e){this._callback=e}get callback(){return this._callback}};var py;let J9=(py=class{constructor(e,t,i,n,r,o){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=r,this.__deprecated=!0):t===wI.Global||t===wI.Workspace?(this.target=t,this._name=this.name=i,this._source=this.source=n,this.execution=r,a=o):(this.target=t,this._name=this.name=i,this._source=this.source=n,this.execution=r,a=o),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 hN?this._definition={type:lw.ProcessType,id:this._execution.computeId()}:this._execution instanceof bI?this._definition={type:lw.ShellType,id:this._execution.computeId()}:this._execution instanceof ile?this._definition={type:lw.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:lw.EmptyType,id:ao()}}get definition(){return this._definition}set definition(e){if(e==null)throw Fi("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 Fi("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;(lw.EmptyType===t||lw.ProcessType===t||lw.ShellType===t||lw.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 Fi("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}},lw=py,py.ExtensionCallbackType="customExecution",py.ProcessType="process",py.ShellType="shell",py.EmptyType="$empty",py);J9=lw=D([Ii],J9);var SD;(function(s){s[s.SourceControl=1]="SourceControl",s[s.Window=10]="Window",s[s.Notification=15]="Notification"})(SD||(SD={}));var fEe;(function(s){function e(t){const i=t;return dc(i.value)?i.tooltip&&!Rt(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})(fEe||(fEe={}));let X9=uEe=class{static isTreeItem(e,t){const i=e;if(i.checkboxState!==void 0){const n=dc(i.checkboxState)?i.checkboxState:In(i.checkboxState)&&dc(i.checkboxState.state)?i.checkboxState.state:void 0,r=!dc(i.checkboxState)&&In(i.checkboxState)?i.checkboxState.tooltip:void 0;if(n===void 0||n!==fb.Checked&&n!==fb.Unchecked||r!==void 0&&!Rt(r))return console.log("INVALID tree item, invalid checkboxState",i.checkboxState),!1}if(e instanceof uEe)return!0;if(i.label!==void 0&&!Rt(i.label)&&!i.label?.label)return console.log("INVALID tree item, invalid label",i.label),!1;if(i.id!==void 0&&!Rt(i.id))return console.log("INVALID tree item, invalid id",i.id),!1;if(i.iconPath!==void 0&&!Rt(i.iconPath)&&!N.isUri(i.iconPath)&&(!i.iconPath||!Rt(i.iconPath.id))){const n=i.iconPath;if(!n||!Rt(n.light)&&!N.isUri(n.light)&&!Rt(n.dark)&&!N.isUri(n.dark))return console.log("INVALID tree item, invalid iconPath",i.iconPath),!1}return i.description!==void 0&&!Rt(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&&!Rt(i.tooltip)&&!(i.tooltip instanceof gf)?(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.collapsibleStateAD.Expanded?(console.log("INVALID tree item, invalid collapsibleState",i.collapsibleState),!1):i.contextValue!==void 0&&!Rt(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=AD.None){this.collapsibleState=t,N.isUri(e)?this.resourceUri=e:this.label=e}};X9=uEe=D([Ii],X9);var AD;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(AD||(AD={}));var fb;(function(s){s[s.Unchecked=0]="Unchecked",s[s.Checked=1]="Checked"})(fb||(fb={}));let Z9=class{async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}constructor(e){this.value=e}};Z9=D([Ii],Z9);class cte extends Z9{}var x7;class g7t extends cte{constructor(t){super("");Ht(this,x7);St(this,x7,t)}asFile(){return Ce(this,x7)}}x7=new WeakMap;class f7t{constructor(e,t,i,n){this.name=e,this.uri=t,this._itemId=i,this._getData=n}data(){return this._getData()}}var nS,Z1,UV,BGe;let mH=(BGe=class{constructor(e){Ht(this,Z1);Ht(this,nS,new Map);for(const[t,i]of e??[]){const n=Ce(this,nS).get(a4(this,Z1,UV).call(this,t));n?n.push(i):Ce(this,nS).set(a4(this,Z1,UV).call(this,t),[i])}}get(e){return Ce(this,nS).get(a4(this,Z1,UV).call(this,e))?.[0]}set(e,t){Ce(this,nS).set(a4(this,Z1,UV).call(this,e),[t])}forEach(e,t){for(const[i,n]of Ce(this,nS))for(const r of n)e.call(t,r,i,this)}*[Symbol.iterator](){for(const[e,t]of Ce(this,nS))for(const i of t)yield[e,i]}},nS=new WeakMap,Z1=new WeakSet,UV=function(e){return e.toLowerCase()},BGe);mH=D([Ii],mH);let lte=class{constructor(e,t,i){this.insertText=e,this.title=t,this.kind=i}};lte=D([Ii],lte);var dte;(function(s){s[s.Automatic=0]="Automatic",s[s.PasteAs=1]="PasteAs"})(dte||(dte={}));var eA;let e$=(eA=class{constructor(e){this.value=e}append(...e){return new eA((this.value?[this.value,...e]:e).join(eA.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+eA.sep)}},eA.sep=".",eA);e$.Empty=new e$("");let Dst=class{constructor(e,t,i){this.title=t,this.insertText=e,this.kind=i}},fu=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}};fu=D([Ii],fu);fu.File=new fu("file");fu.Folder=new fu("folder");let _H=class{constructor(e){this.id=e}};_H=D([Ii],_H);var YT;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace",s[s.WorkspaceFolder=3]="WorkspaceFolder"})(YT||(YT={}));let JT=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 Fi("base");if(typeof t!="string")throw Fi("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()}}};JT=D([Ii],JT);const kst=new WeakMap;function p7t(s,e){kst.set(s,e)}let uN=class{constructor(e,t,i,n,r){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 r=="string"&&(this.mode=r)}get id(){return this._id||(this._id=kst.get(this)??ao()),this._id}};uN=D([Ii],uN);let qx=class extends uN{constructor(e,t,i,n,r,o){if(super(t,i,n,r,o),e===null)throw Fi("location");this.location=e}};qx=D([Ii],qx);let Qx=class extends uN{constructor(e,t,i,n,r,o){super(t,i,n,r,o),this.functionName=e}};Qx=D([Ii],Qx);let hte=class extends uN{constructor(e,t,i,n,r,o,a,c){if(super(n,r,o,a,c),!t)throw Fi("dataId");this.label=e,this.dataId=t,this.canPersist=i}};hte=D([Ii],hte);let t$=class{constructor(e,t,i){this.command=e,this.args=t||[],this.options=i}};t$=D([Ii],t$);let vH=class{constructor(e,t){this.port=e,this.host=t}};vH=D([Ii],vH);let i$=class{constructor(e){this.path=e}};i$=D([Ii],i$);let n$=class{constructor(e){this.implementation=e}};n$=D([Ii],n$);let mPe=class{constructor(e,t,i){this.session=e,this.threadId=t,this.frameId=i}},_Pe=class{constructor(e,t){this.session=e,this.threadId=t}},s$=class{constructor(e,t){this.range=e,this.expression=t}};s$=D([Ii],s$);var bH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(bH||(bH={}));let r$=class{constructor(e,t){this.range=e,this.text=t}};r$=D([Ii],r$);let o$=class{constructor(e,t,i=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=i}};o$=D([Ii],o$);let a$=class{constructor(e,t){this.range=e,this.expression=t}};a$=D([Ii],a$);let pEe=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};pEe=D([Ii],pEe);var ute;(function(s){s[s.AIGenerated=1]="AIGenerated"})(ute||(ute={}));var wH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(wH||(wH={}));let Ist=class{constructor(e,t){this.newSymbolName=e,this.tags=t}};var XT;(function(s){s[s.Changed=1]="Changed",s[s.Created=2]="Created",s[s.Deleted=3]="Deleted"})(XT||(XT={}));let Xc=Ag=class extends Error{static FileExists(e){return new Ag(e,ot.FileExists,Ag.FileExists)}static FileNotFound(e){return new Ag(e,ot.FileNotFound,Ag.FileNotFound)}static FileNotADirectory(e){return new Ag(e,ot.FileNotADirectory,Ag.FileNotADirectory)}static FileIsADirectory(e){return new Ag(e,ot.FileIsADirectory,Ag.FileIsADirectory)}static NoPermissions(e){return new Ag(e,ot.NoPermissions,Ag.NoPermissions)}static Unavailable(e){return new Ag(e,ot.Unavailable,Ag.Unavailable)}constructor(e,t=ot.Unknown,i){super(N.isUri(e)?e.toString(!0):e),this.code=i?.name??"Unknown",xYe(this,t),Object.setPrototypeOf(this,Ag.prototype),typeof Error.captureStackTrace=="function"&&typeof i=="function"&&Error.captureStackTrace(this,i)}};Xc=Ag=D([Ii],Xc);let gte=class{constructor(e,t,i){this.start=e,this.end=t,this.kind=i}};gte=D([Ii],gte);var Gw;(function(s){s[s.Comment=1]="Comment",s[s.Imports=2]="Imports",s[s.Region=3]="Region"})(Gw||(Gw={}));var yH;(function(s){s[s.Collapsed=0]="Collapsed",s[s.Expanded=1]="Expanded"})(yH||(yH={}));var fte;(function(s){s[s.Editing=0]="Editing",s[s.Preview=1]="Preview"})(fte||(fte={}));var pte;(function(s){s[s.Published=0]="Published",s[s.Draft=1]="Draft"})(pte||(pte={}));var CH;(function(s){s[s.Unresolved=0]="Unresolved",s[s.Resolved=1]="Resolved"})(CH||(CH={}));var SH;(function(s){s[s.Current=0]="Current",s[s.Outdated=1]="Outdated"})(SH||(SH={}));var AH;(function(s){s[s.Reply=1]="Reply",s[s.Comment=2]="Comment"})(AH||(AH={}));let mte=class{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}};function m7t(s){return typeof s>"u"||KGe(s)}let Tst=class Lst{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 r>"u"&&(r=0),this._pushEncoded(e,t,i,n,r);if(Xn.isRange(e)&&typeof t=="string"&&m7t(i))return this._push(e,t,i);throw Fi()}_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,r=e.start.character,o=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,r,o,a,c)}_pushEncoded(e,t,i,n,r){if(this._dataIsSortedAndDeltaEncoded&&(e0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,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 r=0,o=0;for(let a=0;at)throw new Error("The 'badge'-property must be undefined or a short character")}else if(e.badge&&!fu.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}},vte=class{constructor(e){this.kind=e}};vte=D([Ii],vte);var wS;(function(s){s[s.Light=1]="Light",s[s.Dark=2]="Dark",s[s.HighContrast=3]="HighContrast",s[s.HighContrastLight=4]="HighContrastLight"})(wS||(wS={}));let Dy=class mEe{static isNotebookRange(e){return e instanceof mEe?!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 Fi("start must be positive");if(t<0)throw Fi("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 mEe(t,i)}},vG=class _Ee{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=>_Ee.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(e,t,i,n,r,o,a){this.kind=e,this.value=t,this.languageId=i,this.mime=n,this.outputs=r??[],this.metadata=o,this.executionSummary=a,_Ee.validate(this)}},bPe=class{constructor(e){this.cells=e}};var Uf,loe;let wPe=(Uf=class{static isNotebookCellOutputItem(e){return e instanceof Uf?!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 Uf.json(t,"application/vnd.code.notebook.error")}static stdout(e){return Uf.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return Uf.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,t="application/octet-stream"){return new Uf(e,t)}static text(e,t=Vs.text){const i=Ce(Uf,loe).encode(String(e));return new Uf(i,t)}static json(e,t="text/x-json"){const i=JSON.stringify(e,void 0," ");return Uf.text(i,t)}constructor(e,t){this.data=e,this.mime=t;const i=Bqe(t,!0);if(!i)throw new Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=i}},loe=new WeakMap,Ht(Uf,loe,new TextEncoder),Uf),d$=class vEe{static isNotebookCellOutput(e){return e instanceof vEe?!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 r=0;r!n.has(o))}constructor(e,t,i){this.items=vEe.ensureUniqueMimeTypes(e,!0),typeof t=="string"?(this.id=t,this.metadata=i):(this.id=ao(),this.metadata=t??i)}};var jx;(function(s){s[s.Markup=1]="Markup",s[s.Code=2]="Code"})(jx||(jx={}));var fN;(function(s){s[s.Idle=1]="Idle",s[s.Pending=2]="Pending",s[s.Executing=3]="Executing"})(fN||(fN={}));var h$;(function(s){s[s.Left=1]="Left",s[s.Right=2]="Right"})(h$||(h$={}));var u$;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(u$||(u$={}));let Mst=class{constructor(e,t){this.text=e,this.alignment=t}};var bte;(function(s){s[s.Default=1]="Default",s[s.Preferred=2]="Preferred"})(bte||(bte={}));var g$;(function(s){s[s.Default=1]="Default",s[s.Preferred=2]="Preferred",s[s.Hidden=-1]="Hidden"})(g$||(g$={}));let yPe=class{constructor(e,t=[]){this.uri=e,this.provides=z_(t)}},Nst=class{constructor(e){this.label=e}};var DH;(function(s){s[s.Named=1]="Named",s[s.Indexed=2]="Indexed"})(DH||(DH={}));let wte=class{constructor(e,t){this.label=e,this.timestamp=t}};wte=D([Ii],wte);var eL;(function(s){s[s.Production=1]="Production",s[s.Development=2]="Development",s[s.Test=3]="Test"})(eL||(eL={}));var f$;(function(s){s[s.Node=1]="Node",s[s.Webworker=2]="Webworker"})(f$||(f$={}));var PS;(function(s){s[s.Other=0]="Other",s[s.Comment=1]="Comment",s[s.String=2]="String",s[s.RegEx=3]="RegEx"})(PS||(PS={}));let Pst=class{constructor(e,t){this.ranges=e,this.wordPattern=t}},Fst=class{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}};var yte;(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"})(yte||(yte={}));var tL;(function(s){s[s.Run=1]="Run",s[s.Debug=2]="Debug",s[s.Coverage=3]="Coverage"})(tL||(tL={}));let p$=class{constructor(e=void 0,t=void 0,i=void 0,n=!1,r=!0){this.include=e,this.exclude=t,this.profile=i,this.continuous=n,this.preserveFocus=r}};p$=D([Ii],p$);let pN=gEe=class{static diff(e,t,i){const n=new gEe(e);return n.expectedOutput=t,n.actualOutput=i,n}constructor(e){this.message=e}};pN=gEe=D([Ii],pN);let kH=class{constructor(e){this.id=e}};kH=D([Ii],kH);let Ost=class{constructor(e,t,i){this.label=e,this.file=t,this.position=i}},fz=class{constructor(e,t){this.covered=e,this.total=t,pj(this)}};function pj(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 mN=class Bst{static fromDetails(e,t){const i=new fz(0,0),n=new fz(0,0),r=new fz(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 r.total+=1,r.covered+=a.executed?1:0;const o=new Bst(e,i,n.total>0?n:void 0,r.total>0?r:void 0);return o.detailedCoverage=t,o}constructor(e,t,i,n,r=[]){this.uri=e,this.statementCoverage=t,this.branchCoverage=i,this.declarationCoverage=n,this.fromTests=r}},Wst=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}},Hst=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}},Ust=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 Cte;(function(s){s[s.None=0]="None",s[s.Option=1]="Option",s[s.Default=2]="Default",s[s.Preferred=3]="Preferred"})(Cte||(Cte={}));var bEe;(function(s){s[s.Untrusted=0]="Untrusted",s[s.Trusted=1]="Trusted",s[s.Unspecified=2]="Unspecified"})(bEe||(bEe={}));var Ste;(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"})(Ste||(Ste={}));let nle=class{constructor(e,t,i,n,r,o){this.kind=e,this.name=t,this.detail=i,this.uri=n,this.range=r,this.selectionRange=o}};class sle{constructor(e){this.uri=e}}class m${constructor(e,t){this.original=e,this.modified=t}}class CPe{constructor(e,t,i,n){this.base=e,this.input1=t,this.input2=i,this.result=n}}class rle{constructor(e,t){this.uri=e,this.viewType=t}}class SPe{constructor(e){this.viewType=e}}class ole{constructor(e,t){this.uri=e,this.notebookType=t}}class ale{constructor(e,t,i){this.original=e,this.modified=t,this.notebookType=i}}class APe{constructor(){}}class EPe{constructor(e,t){this.uri=e,this.inputBoxUri=t}}class xPe{constructor(){}}class DPe{constructor(e){this.textDiffs=e}}var wEe;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(wEe||(wEe={}));var Ate;(function(s){s[s.Action=1]="Action",s[s.Toolbar=2]="Toolbar"})(Ate||(Ate={}));var Ete;(function(s){s[s.Short=1]="Short",s[s.Medium=2]="Medium",s[s.Full=3]="Full"})(Ete||(Ete={}));let Vst=class{constructor(e,t,i){this.id=e,this.label=t,this.values=i}};var yEe;(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"})(yEe||(yEe={}));var IH;(function(s){s[s.Unhelpful=0]="Unhelpful",s[s.Helpful=1]="Helpful"})(IH||(IH={}));let bG=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 gf(e):e}},TH=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 gf(e):e,this.vulnerabilities=t}},LH=class{constructor(e,t){this.participant=e,this.command=t}},_$=class{constructor(e,t,i,n){this.title=e,this.message=t,this.data=i,this.buttons=n}},wG=class{constructor(e,t){this.value=e,this.baseUri=t}},yG=class{constructor(e,t){this.value=e,this.title=t}},RH=class{constructor(e){this.value=e}},kPe=class{constructor(e,t){this.value=e,this.task=t}},MH=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 gf(e):e}},CG=class{constructor(e){this.value=e}},Rb=class{constructor(e,t,i){this.value=e,this.iconPath=t,this.options=i}},v$=class{constructor(e,t,i){this.value=e,this.license=t,this.snippet=i}},NH=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}},TPe=class{constructor(e,t,i,n){this.response=e,this.result=t,this.participant=i,this.command=n}};var l_;(function(s){s[s.Panel=1]="Panel",s[s.Terminal=2]="Terminal",s[s.Notebook=3]="Notebook",s[s.Editor=4]="Editor"})(l_||(l_={}));var xte;(function(s){s[s.Complete=1]="Complete",s[s.Partial=2]="Partial",s[s.Omitted=3]="Omitted"})(xte||(xte={}));let LPe=class{constructor(e,t,i){this.document=e,this.selection=t,this.wholeRange=i}},RPe=class{constructor(e){this.cell=e}};var jp;(function(s){s[s.User=1]="User",s[s.Assistant=2]="Assistant",s[s.System=3]="System"})(jp||(jp={}));class b${constructor(e,t,i){this.name=e,this.content=t,this.isError=i??!1}}let MPe=class CEe{static User(e,t){const i=new CEe(jp.User,typeof e=="string"?e:"",t);return i.content2=e,i}static Assistant(e,t){return new CEe(jp.Assistant,e,t)}constructor(e,t,i){this.role=e,this.content=t,this.content2=t,this.name=i}};class cle{constructor(e,t){this.name=e,this.parameters=t}}class PH{constructor(e){this.value=e}}let Ow=class M0 extends Error{static NotFound(e){return new M0(e,M0.NotFound.name)}static NoPermissions(e){return new M0(e,M0.NoPermissions.name)}static Blocked(e){return new M0(e,M0.Blocked.name)}constructor(e,t,i){super(e,{cause:i}),this.name="LanguageModelError",this.code=t??""}};var Dte;(function(s){s[s.SymbolInformation=1]="SymbolInformation",s[s.CommandInformation=2]="CommandInformation",s[s.SearchInformation=3]="SearchInformation",s[s.SettingInformation=4]="SettingInformation"})(Dte||(Dte={}));var kte;(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"})(kte||(kte={}));var Ite;(function(s){s[s.Started=1]="Started",s[s.Stopped=2]="Stopped",s[s.Error=3]="Error"})(Ite||(Ite={}));var Tte;(function(s){s[s.Recognized=1]="Recognized",s[s.Stopped=2]="Stopped"})(Tte||(Tte={}));let zst=class{constructor(e,t){this.text=e,this.range=t}};var FH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(FH||(FH={}));var RF;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(RF||(RF={}));var ua;(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"})(ua||(ua={}));var mh;(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"})(mh||(mh={}));var wc;(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"})(wc||(wc={}));var MF;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(MF||(MF={}));var iL;(function(s){s[s.None=0]="None",s[s.Process=1]="Process",s[s.Output=2]="Output",s[s.Hybrid=3]="Hybrid"})(iL||(iL={}));var Ri;(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"})(Ri||(Ri={}));var ky;(function(s){s.defaultRanges="a",s.completions="b",s.isIncomplete="c",s.duration="d"})(ky||(ky={}));const We={MainThreadAuthentication:Ye("MainThreadAuthentication"),MainThreadBulkEdits:Ye("MainThreadBulkEdits"),MainThreadLanguageModels:Ye("MainThreadLanguageModels"),MainThreadEmbeddings:Ye("MainThreadEmbeddings"),MainThreadChatAgents2:Ye("MainThreadChatAgents2"),MainThreadChatVariables:Ye("MainThreadChatVariables"),MainThreadLanguageModelTools:Ye("MainThreadChatSkills"),MainThreadClipboard:Ye("MainThreadClipboard"),MainThreadCommands:Ye("MainThreadCommands"),MainThreadComments:Ye("MainThreadComments"),MainThreadConfiguration:Ye("MainThreadConfiguration"),MainThreadConsole:Ye("MainThreadConsole"),MainThreadDebugService:Ye("MainThreadDebugService"),MainThreadDecorations:Ye("MainThreadDecorations"),MainThreadDiagnostics:Ye("MainThreadDiagnostics"),MainThreadDialogs:Ye("MainThreadDiaglogs"),MainThreadDocuments:Ye("MainThreadDocuments"),MainThreadDocumentContentProviders:Ye("MainThreadDocumentContentProviders"),MainThreadTextEditors:Ye("MainThreadTextEditors"),MainThreadEditorInsets:Ye("MainThreadEditorInsets"),MainThreadEditorTabs:Ye("MainThreadEditorTabs"),MainThreadErrors:Ye("MainThreadErrors"),MainThreadTreeViews:Ye("MainThreadTreeViews"),MainThreadDownloadService:Ye("MainThreadDownloadService"),MainThreadLanguageFeatures:Ye("MainThreadLanguageFeatures"),MainThreadLanguages:Ye("MainThreadLanguages"),MainThreadLogger:Ye("MainThreadLogger"),MainThreadMessageService:Ye("MainThreadMessageService"),MainThreadOutputService:Ye("MainThreadOutputService"),MainThreadProgress:Ye("MainThreadProgress"),MainThreadQuickDiff:Ye("MainThreadQuickDiff"),MainThreadQuickOpen:Ye("MainThreadQuickOpen"),MainThreadStatusBar:Ye("MainThreadStatusBar"),MainThreadSecretState:Ye("MainThreadSecretState"),MainThreadStorage:Ye("MainThreadStorage"),MainThreadSpeech:Ye("MainThreadSpeechProvider"),MainThreadTelemetry:Ye("MainThreadTelemetry"),MainThreadTerminalService:Ye("MainThreadTerminalService"),MainThreadTerminalShellIntegration:Ye("MainThreadTerminalShellIntegration"),MainThreadWebviews:Ye("MainThreadWebviews"),MainThreadWebviewPanels:Ye("MainThreadWebviewPanels"),MainThreadWebviewViews:Ye("MainThreadWebviewViews"),MainThreadCustomEditors:Ye("MainThreadCustomEditors"),MainThreadUrls:Ye("MainThreadUrls"),MainThreadUriOpeners:Ye("MainThreadUriOpeners"),MainThreadProfileContentHandlers:Ye("MainThreadProfileContentHandlers"),MainThreadWorkspace:Ye("MainThreadWorkspace"),MainThreadFileSystem:Ye("MainThreadFileSystem"),MainThreadFileSystemEventService:Ye("MainThreadFileSystemEventService"),MainThreadExtensionService:Ye("MainThreadExtensionService"),MainThreadSCM:Ye("MainThreadSCM"),MainThreadSearch:Ye("MainThreadSearch"),MainThreadShare:Ye("MainThreadShare"),MainThreadTask:Ye("MainThreadTask"),MainThreadWindow:Ye("MainThreadWindow"),MainThreadLabelService:Ye("MainThreadLabelService"),MainThreadNotebook:Ye("MainThreadNotebook"),MainThreadNotebookDocuments:Ye("MainThreadNotebookDocumentsShape"),MainThreadNotebookEditors:Ye("MainThreadNotebookEditorsShape"),MainThreadNotebookKernels:Ye("MainThreadNotebookKernels"),MainThreadNotebookRenderers:Ye("MainThreadNotebookRenderers"),MainThreadInteractive:Ye("MainThreadInteractive"),MainThreadTheming:Ye("MainThreadTheming"),MainThreadTunnelService:Ye("MainThreadTunnelService"),MainThreadManagedSockets:Ye("MainThreadManagedSockets"),MainThreadTimeline:Ye("MainThreadTimeline"),MainThreadTesting:Ye("MainThreadTesting"),MainThreadLocalization:Ye("MainThreadLocalizationShape"),MainThreadAiRelatedInformation:Ye("MainThreadAiRelatedInformation"),MainThreadAiEmbeddingVector:Ye("MainThreadAiEmbeddingVector")},Je={ExtHostCommands:Ye("ExtHostCommands"),ExtHostConfiguration:Ye("ExtHostConfiguration"),ExtHostDiagnostics:Ye("ExtHostDiagnostics"),ExtHostDebugService:Ye("ExtHostDebugService"),ExtHostDecorations:Ye("ExtHostDecorations"),ExtHostDocumentsAndEditors:Ye("ExtHostDocumentsAndEditors"),ExtHostDocuments:Ye("ExtHostDocuments"),ExtHostDocumentContentProviders:Ye("ExtHostDocumentContentProviders"),ExtHostDocumentSaveParticipant:Ye("ExtHostDocumentSaveParticipant"),ExtHostEditors:Ye("ExtHostEditors"),ExtHostTreeViews:Ye("ExtHostTreeViews"),ExtHostFileSystem:Ye("ExtHostFileSystem"),ExtHostFileSystemInfo:Ye("ExtHostFileSystemInfo"),ExtHostFileSystemEventService:Ye("ExtHostFileSystemEventService"),ExtHostLanguages:Ye("ExtHostLanguages"),ExtHostLanguageFeatures:Ye("ExtHostLanguageFeatures"),ExtHostQuickOpen:Ye("ExtHostQuickOpen"),ExtHostQuickDiff:Ye("ExtHostQuickDiff"),ExtHostStatusBar:Ye("ExtHostStatusBar"),ExtHostShare:Ye("ExtHostShare"),ExtHostExtensionService:Ye("ExtHostExtensionService"),ExtHostLogLevelServiceShape:Ye("ExtHostLogLevelServiceShape"),ExtHostTerminalService:Ye("ExtHostTerminalService"),ExtHostTerminalShellIntegration:Ye("ExtHostTerminalShellIntegration"),ExtHostSCM:Ye("ExtHostSCM"),ExtHostSearch:Ye("ExtHostSearch"),ExtHostTask:Ye("ExtHostTask"),ExtHostWorkspace:Ye("ExtHostWorkspace"),ExtHostWindow:Ye("ExtHostWindow"),ExtHostWebviews:Ye("ExtHostWebviews"),ExtHostWebviewPanels:Ye("ExtHostWebviewPanels"),ExtHostCustomEditors:Ye("ExtHostCustomEditors"),ExtHostWebviewViews:Ye("ExtHostWebviewViews"),ExtHostEditorInsets:Ye("ExtHostEditorInsets"),ExtHostEditorTabs:Ye("ExtHostEditorTabs"),ExtHostProgress:Ye("ExtHostProgress"),ExtHostComments:Ye("ExtHostComments"),ExtHostSecretState:Ye("ExtHostSecretState"),ExtHostStorage:Ye("ExtHostStorage"),ExtHostUrls:Ye("ExtHostUrls"),ExtHostUriOpeners:Ye("ExtHostUriOpeners"),ExtHostProfileContentHandlers:Ye("ExtHostProfileContentHandlers"),ExtHostOutputService:Ye("ExtHostOutputService"),ExtHostLabelService:Ye("ExtHostLabelService"),ExtHostNotebook:Ye("ExtHostNotebook"),ExtHostNotebookDocuments:Ye("ExtHostNotebookDocuments"),ExtHostNotebookEditors:Ye("ExtHostNotebookEditors"),ExtHostNotebookKernels:Ye("ExtHostNotebookKernels"),ExtHostNotebookRenderers:Ye("ExtHostNotebookRenderers"),ExtHostNotebookDocumentSaveParticipant:Ye("ExtHostNotebookDocumentSaveParticipant"),ExtHostInteractive:Ye("ExtHostInteractive"),ExtHostChatAgents2:Ye("ExtHostChatAgents"),ExtHostChatVariables:Ye("ExtHostChatVariables"),ExtHostLanguageModelTools:Ye("ExtHostChatSkills"),ExtHostChatProvider:Ye("ExtHostChatProvider"),ExtHostSpeech:Ye("ExtHostSpeech"),ExtHostEmbeddings:Ye("ExtHostEmbeddings"),ExtHostAiRelatedInformation:Ye("ExtHostAiRelatedInformation"),ExtHostAiEmbeddingVector:Ye("ExtHostAiEmbeddingVector"),ExtHostTheming:Ye("ExtHostTheming"),ExtHostTunnelService:Ye("ExtHostTunnelService"),ExtHostManagedSockets:Ye("ExtHostManagedSockets"),ExtHostAuthentication:Ye("ExtHostAuthentication"),ExtHostTimeline:Ye("ExtHostTimeline"),ExtHostTesting:Ye("ExtHostTesting"),ExtHostTelemetry:Ye("ExtHostTelemetry"),ExtHostLocalization:Ye("ExtHostLocalization")};var Lte;(function(s){s[s.Complete=100]="Complete",s[s.Partial=50]="Partial",s[s.None=0]="None"})(Lte||(Lte={}));let SEe;function $st(s){SEe=s}function Sd(s){return new Proxy({},{get(e,t){if(SEe==null)throw new Error("Default api is not ready yet, do not forget to import 'vscode/localExtensionHost' and wait for services initialization");return SEe[s][t]}})}const _7t={version:"1.92.2",tasks:Sd("tasks"),notebooks:Sd("notebooks"),scm:Sd("scm"),comments:Sd("comments"),authentication:Sd("authentication"),tests:Sd("tests"),extensions:Sd("extensions"),debug:Sd("debug"),env:Sd("env"),commands:Sd("commands"),window:Sd("window"),workspace:Sd("workspace"),languages:Sd("languages"),l10n:Sd("l10n"),interactive:Sd("interactive"),ai:Sd("ai"),chat:Sd("chat"),speech:Sd("speech"),lm:Sd("lm"),Breakpoint:uN,TerminalOutputAnchor:qee,ChatResultFeedbackKind:IH,ChatVariableLevel:Ete,ChatCompletionItem:Vst,CallHierarchyIncomingCall:fPe,CallHierarchyItem:tle,CallHierarchyOutgoingCall:pPe,CancellationError:Pa,CancellationTokenSource:li,CandidatePortSource:iL,CodeAction:V9,CodeActionKind:Aa,CodeActionTriggerKind:dH,CodeLens:z9,Color:dN,ColorInformation:j9,ColorPresentation:Y9,ColorThemeKind:wS,CommentMode:fte,CommentState:pte,CommentThreadCollapsibleState:yH,CommentThreadState:CH,CommentThreadApplicability:SH,CommentThreadFocus:AH,CompletionItem:K9,CompletionItemKind:en,CompletionItemTag:uH,CompletionList:aN,CompletionTriggerKind:QT,ConfigurationTarget:YT,CustomExecution:ile,DebugAdapterExecutable:t$,DebugAdapterInlineImplementation:n$,DebugAdapterNamedPipeServer:i$,DebugAdapterServer:vH,DebugConfigurationProviderTriggerKind:R9,DebugConsoleMode:c$,DebugVisualization:Rst,DecorationRangeBehavior:Kx,Diagnostic:O9,DiagnosticRelatedInformation:rH,DiagnosticSeverity:Hd,DiagnosticTag:$x,Disposable:js,DocumentHighlight:H9,DocumentHighlightKind:oH,MultiDocumentHighlight:U9,DocumentLink:Q9,DocumentSymbol:lH,EndOfLine:T_,EnvironmentVariableMutatorType:KT,EvaluatableExpression:s$,InlineValueText:r$,InlineValueVariableLookup:o$,InlineValueEvaluatableExpression:a$,InlineCompletionTriggerKind:bH,EventEmitter:I,ExtensionKind:ED,ExtensionMode:eL,ExternalUriOpenerPriority:Cte,FileChangeType:XT,FileDecoration:l$,FileDecoration2:l$,FileSystemError:Xc,FileType:rn,FilePermission:up,FoldingRange:gte,FoldingRangeKind:Gw,FunctionBreakpoint:Qx,InlineCompletionItem:ete,InlineCompletionList:tte,Hover:B9,VerboseHover:W9,HoverVerbosityAction:Qee,IndentAction:Co,Location:Ap,MarkdownString:gf,OverviewRulerLane:Tl,ParameterInformation:jee,PortAutoForwardAction:Ste,Position:ws,ProcessExecution:hN,ProgressLocation:SD,QuickInputButtonLocation:_te,QuickInputButtons:EH,Range:Xn,RelativePattern:JT,Selection:uC,SelectionRange:hH,SemanticTokens:gN,SemanticTokensBuilder:Tst,SemanticTokensEdit:vPe,SemanticTokensEdits:gz,SemanticTokensLegend:mte,ShellExecution:bI,ShellQuoting:ate,SignatureHelp:Jee,SignatureHelpTriggerKind:Xee,SignatureInformation:Yee,SnippetString:vI,SourceBreakpoint:qx,StandardTokenType:PS,StatusBarAlignment:NS,SymbolInformation:cH,SymbolKind:vo,SymbolTag:aH,Task:J9,TaskGroup:pH,TaskPanelKind:ote,TaskRevealKind:rte,TaskScope:wI,TerminalLink:Cst,TerminalQuickFixTerminalCommand:Ast,TerminalQuickFixOpener:Sst,TerminalLocation:ste,TerminalProfile:Est,TerminalExitReason:nte,TerminalShellExecutionCommandLineConfidence:CD,TextDocumentSaveReason:jT,TextEdit:qA,SnippetTextEdit:ele,TextEditorCursorStyle:Qo,TextEditorLineNumbersStyle:c_,TextEditorRevealType:q9,TextEditorSelectionChangeKind:cN,SyntaxTokenType:lN,TextDocumentChangeReason:fH,ThemeColor:_H,ThemeIcon:fu,TreeItem:X9,TreeItemCheckboxState:fb,TreeItemCollapsibleState:AD,TypeHierarchyItem:nle,UIKind:sv,Uri:N,ViewColumn:gH,WorkspaceEdit:_I,DocumentPasteTriggerKind:dte,DocumentDropEdit:lte,DocumentDropOrPasteEditKind:e$,DocumentPasteEdit:Dst,InlayHint:G9,InlayHintLabelPart:$9,InlayHintKind:Zee,RemoteAuthorityResolverError:a1,ResolvedAuthority:yst,ManagedResolvedAuthority:uz,SourceControlInputBoxValidationType:ite,ExtensionRuntime:f$,TimelineItem:wte,NotebookRange:Dy,NotebookCellKind:jx,NotebookCellExecutionState:fN,NotebookCellData:vG,NotebookData:bPe,NotebookRendererScript:yPe,NotebookCellStatusBarAlignment:h$,NotebookEditorRevealType:u$,NotebookCellOutput:d$,NotebookCellOutputItem:wPe,NotebookCellStatusBarItem:Mst,NotebookControllerAffinity:bte,NotebookControllerAffinity2:g$,NotebookEdit:F9,NotebookKernelSourceAction:Nst,NotebookVariablesRequestKind:DH,PortAttributes:Fst,LinkedEditingRanges:Pst,TestResultState:yte,TestRunRequest:p$,TestMessage:pN,TestMessage2:pN,TestMessageStackFrame:Ost,TestTag:kH,TestRunProfileKind:tL,TextSearchCompleteMessageType:Mee,DataTransfer:mH,DataTransferItem:Z9,TestCoverageCount:fz,FileCoverage:mN,FileCoverage2:mN,StatementCoverage:Wst,BranchCoverage:Hst,DeclarationCoverage:Ust,LanguageStatusSeverity:qT,QuickPickItemKind:xH,InputBoxValidationSeverity:ZT,TabInputText:sle,TabInputTextDiff:m$,TabInputTextMerge:CPe,TabInputCustom:rle,TabInputNotebook:ole,TabInputNotebookDiff:ale,TabInputWebview:SPe,TabInputTerminal:APe,TabInputInteractiveWindow:EPe,TabInputChat:xPe,TabInputTextMultiDiff:DPe,TelemetryTrustedValue:rce,LogLevel:Kn,EditSessionIdentityMatch:Lte,ChatCopyKind:Ate,DebugStackFrame:mPe,DebugThread:_Pe,RelatedInformationType:Dte,SpeechToTextStatus:kte,TextToSpeechStatus:Ite,PartialAcceptTriggerKind:Gx,KeywordRecognitionStatus:Tte,ChatResponseMarkdownPart:bG,ChatResponseFileTreePart:wG,ChatResponseAnchorPart:yG,ChatResponseProgressPart:RH,ChatResponseProgressPart2:kPe,ChatResponseReferencePart:Rb,ChatResponseReferencePart2:Rb,ChatResponseCodeCitationPart:v$,ChatResponseWarningPart:MH,ChatResponseTextEditPart:NH,ChatResponseMarkdownWithVulnerabilitiesPart:TH,ChatResponseCommandButtonPart:CG,ChatResponseDetectedParticipantPart:LH,ChatResponseConfirmationPart:_$,ChatResponseReferencePartStatusKind:xte,ChatRequestTurn:IPe,ChatResponseTurn:TPe,ChatLocation:l_,ChatRequestEditorData:LPe,ChatRequestNotebookData:RPe,LanguageModelChatMessageRole:jp,LanguageModelChatMessage:MPe,LanguageModelChatMessageFunctionResultPart:b$,LanguageModelChatResponseTextPart:PH,LanguageModelChatResponseFunctionUsePart:cle,LanguageModelError:Ow,NewSymbolName:Ist,NewSymbolNameTag:ute,NewSymbolNameTriggerKind:wH,InlineEdit:zst,InlineEditTriggerKind:FH,ExcludeSettingOptions:Fw,TextSearchContextNew:uPe,TextSearchMatchNew:hPe,TextSearchCompleteMessageTypeNew:Nee},{version:v7t,tasks:b7t,notebooks:w7t,scm:y7t,comments:C7t,authentication:S7t,tests:A7t,extensions:E7t,debug:x7t,env:D7t,commands:k7t,window:I7t,workspace:T7t,languages:L7t,l10n:R7t,interactive:M7t,ai:N7t,chat:P7t,speech:F7t,lm:O7t,Breakpoint:B7t,TerminalOutputAnchor:W7t,ChatResultFeedbackKind:H7t,ChatVariableLevel:U7t,ChatCompletionItem:V7t,CallHierarchyIncomingCall:z7t,CallHierarchyItem:$7t,CallHierarchyOutgoingCall:G7t,CancellationError:K7t,CancellationTokenSource:q7t,CandidatePortSource:Q7t,CodeAction:j7t,CodeActionKind:Y7t,CodeActionTriggerKind:J7t,CodeLens:X7t,Color:Z7t,ColorInformation:e6t,ColorPresentation:t6t,ColorThemeKind:i6t,CommentMode:n6t,CommentState:s6t,CommentThreadCollapsibleState:r6t,CommentThreadState:o6t,CommentThreadApplicability:a6t,CommentThreadFocus:c6t,CompletionItem:l6t,CompletionItemKind:d6t,CompletionItemTag:h6t,CompletionList:u6t,CompletionTriggerKind:g6t,ConfigurationTarget:f6t,CustomExecution:p6t,DebugAdapterExecutable:m6t,DebugAdapterInlineImplementation:_6t,DebugAdapterNamedPipeServer:v6t,DebugAdapterServer:b6t,DebugConfigurationProviderTriggerKind:w6t,DebugConsoleMode:y6t,DebugVisualization:C6t,DecorationRangeBehavior:S6t,Diagnostic:A6t,DiagnosticRelatedInformation:E6t,DiagnosticSeverity:x6t,DiagnosticTag:D6t,Disposable:k6t,DocumentHighlight:I6t,DocumentHighlightKind:T6t,MultiDocumentHighlight:L6t,DocumentLink:R6t,DocumentSymbol:M6t,EndOfLine:N6t,EnvironmentVariableMutatorType:P6t,EvaluatableExpression:F6t,InlineValueText:O6t,InlineValueVariableLookup:B6t,InlineValueEvaluatableExpression:W6t,InlineCompletionTriggerKind:H6t,EventEmitter:U6t,ExtensionKind:V6t,ExtensionMode:z6t,ExternalUriOpenerPriority:$6t,FileChangeType:G6t,FileDecoration:K6t,FileDecoration2:q6t,FileSystemError:Q6t,FileType:j6t,FilePermission:Y6t,FoldingRange:J6t,FoldingRangeKind:X6t,FunctionBreakpoint:Z6t,InlineCompletionItem:eGt,InlineCompletionList:tGt,Hover:iGt,VerboseHover:nGt,HoverVerbosityAction:sGt,IndentAction:rGt,Location:oGt,MarkdownString:aGt,OverviewRulerLane:cGt,ParameterInformation:lGt,PortAutoForwardAction:dGt,Position:hGt,ProcessExecution:uGt,ProgressLocation:gGt,QuickInputButtonLocation:fGt,QuickInputButtons:pGt,Range:mGt,RelativePattern:_Gt,Selection:vGt,SelectionRange:bGt,SemanticTokens:wGt,SemanticTokensBuilder:yGt,SemanticTokensEdit:CGt,SemanticTokensEdits:SGt,SemanticTokensLegend:AGt,ShellExecution:EGt,ShellQuoting:xGt,SignatureHelp:DGt,SignatureHelpTriggerKind:kGt,SignatureInformation:IGt,SnippetString:TGt,SourceBreakpoint:LGt,StandardTokenType:RGt,StatusBarAlignment:MGt,SymbolInformation:NGt,SymbolKind:PGt,SymbolTag:FGt,Task:OGt,TaskGroup:BGt,TaskPanelKind:WGt,TaskRevealKind:HGt,TaskScope:UGt,TerminalLink:VGt,TerminalQuickFixTerminalCommand:zGt,TerminalQuickFixOpener:$Gt,TerminalLocation:GGt,TerminalProfile:KGt,TerminalExitReason:qGt,TerminalShellExecutionCommandLineConfidence:QGt,TextDocumentSaveReason:jGt,TextEdit:YGt,SnippetTextEdit:JGt,TextEditorCursorStyle:XGt,TextEditorLineNumbersStyle:ZGt,TextEditorRevealType:eKt,TextEditorSelectionChangeKind:tKt,SyntaxTokenType:iKt,TextDocumentChangeReason:nKt,ThemeColor:sKt,ThemeIcon:rKt,TreeItem:oKt,TreeItemCheckboxState:aKt,TreeItemCollapsibleState:cKt,TypeHierarchyItem:lKt,UIKind:dKt,Uri:hKt,ViewColumn:uKt,WorkspaceEdit:gKt,DocumentPasteTriggerKind:fKt,DocumentDropEdit:pKt,DocumentDropOrPasteEditKind:mKt,DocumentPasteEdit:_Kt,InlayHint:vKt,InlayHintLabelPart:bKt,InlayHintKind:wKt,RemoteAuthorityResolverError:yKt,ResolvedAuthority:CKt,ManagedResolvedAuthority:SKt,SourceControlInputBoxValidationType:AKt,ExtensionRuntime:EKt,TimelineItem:xKt,NotebookRange:DKt,NotebookCellKind:kKt,NotebookCellExecutionState:IKt,NotebookCellData:TKt,NotebookData:LKt,NotebookRendererScript:RKt,NotebookCellStatusBarAlignment:MKt,NotebookEditorRevealType:NKt,NotebookCellOutput:PKt,NotebookCellOutputItem:FKt,NotebookCellStatusBarItem:OKt,NotebookControllerAffinity:BKt,NotebookControllerAffinity2:WKt,NotebookEdit:HKt,NotebookKernelSourceAction:UKt,NotebookVariablesRequestKind:VKt,PortAttributes:zKt,LinkedEditingRanges:$Kt,TestResultState:GKt,TestRunRequest:KKt,TestMessage:qKt,TestMessage2:QKt,TestMessageStackFrame:jKt,TestTag:YKt,TestRunProfileKind:JKt,TextSearchCompleteMessageType:XKt,DataTransfer:ZKt,DataTransferItem:eqt,TestCoverageCount:tqt,FileCoverage:iqt,FileCoverage2:nqt,StatementCoverage:sqt,BranchCoverage:rqt,DeclarationCoverage:oqt,LanguageStatusSeverity:aqt,QuickPickItemKind:cqt,InputBoxValidationSeverity:lqt,TabInputText:dqt,TabInputTextDiff:hqt,TabInputTextMerge:uqt,TabInputCustom:gqt,TabInputNotebook:fqt,TabInputNotebookDiff:pqt,TabInputWebview:mqt,TabInputTerminal:_qt,TabInputInteractiveWindow:vqt,TabInputChat:bqt,TabInputTextMultiDiff:wqt,TelemetryTrustedValue:yqt,LogLevel:Cqt,EditSessionIdentityMatch:Sqt,ChatCopyKind:Aqt,DebugStackFrame:Eqt,DebugThread:xqt,RelatedInformationType:Dqt,SpeechToTextStatus:kqt,TextToSpeechStatus:Iqt,PartialAcceptTriggerKind:Tqt,KeywordRecognitionStatus:Lqt,ChatResponseMarkdownPart:Rqt,ChatResponseFileTreePart:Mqt,ChatResponseAnchorPart:Nqt,ChatResponseProgressPart:Pqt,ChatResponseProgressPart2:Fqt,ChatResponseReferencePart:Oqt,ChatResponseReferencePart2:Bqt,ChatResponseCodeCitationPart:Wqt,ChatResponseWarningPart:Hqt,ChatResponseTextEditPart:Uqt,ChatResponseMarkdownWithVulnerabilitiesPart:Vqt,ChatResponseCommandButtonPart:zqt,ChatResponseDetectedParticipantPart:$qt,ChatResponseConfirmationPart:Gqt,ChatResponseReferencePartStatusKind:Kqt,ChatRequestTurn:qqt,ChatResponseTurn:Qqt,ChatLocation:jqt,ChatRequestEditorData:Yqt,ChatRequestNotebookData:Jqt,LanguageModelChatMessageRole:Xqt,LanguageModelChatMessage:Zqt,LanguageModelChatMessageFunctionResultPart:eQt,LanguageModelChatResponseTextPart:tQt,LanguageModelChatResponseFunctionUsePart:iQt,LanguageModelError:nQt,NewSymbolName:sQt,NewSymbolNameTag:rQt,NewSymbolNameTriggerKind:oQt,InlineEdit:aQt,InlineEditTriggerKind:cQt,ExcludeSettingOptions:lQt,TextSearchContextNew:dQt,TextSearchMatchNew:hQt,TextSearchCompleteMessageTypeNew:uQt}=_7t,gQt=Object.freeze(Object.defineProperty({__proto__:null,BranchCoverage:rqt,Breakpoint:B7t,CallHierarchyIncomingCall:z7t,CallHierarchyItem:$7t,CallHierarchyOutgoingCall:G7t,CancellationError:K7t,CancellationTokenSource:q7t,CandidatePortSource:Q7t,ChatCompletionItem:V7t,ChatCopyKind:Aqt,ChatLocation:jqt,ChatRequestEditorData:Yqt,ChatRequestNotebookData:Jqt,ChatRequestTurn:qqt,ChatResponseAnchorPart:Nqt,ChatResponseCodeCitationPart:Wqt,ChatResponseCommandButtonPart:zqt,ChatResponseConfirmationPart:Gqt,ChatResponseDetectedParticipantPart:$qt,ChatResponseFileTreePart:Mqt,ChatResponseMarkdownPart:Rqt,ChatResponseMarkdownWithVulnerabilitiesPart:Vqt,ChatResponseProgressPart:Pqt,ChatResponseProgressPart2:Fqt,ChatResponseReferencePart:Oqt,ChatResponseReferencePart2:Bqt,ChatResponseReferencePartStatusKind:Kqt,ChatResponseTextEditPart:Uqt,ChatResponseTurn:Qqt,ChatResponseWarningPart:Hqt,ChatResultFeedbackKind:H7t,ChatVariableLevel:U7t,CodeAction:j7t,CodeActionKind:Y7t,CodeActionTriggerKind:J7t,CodeLens:X7t,Color:Z7t,ColorInformation:e6t,ColorPresentation:t6t,ColorThemeKind:i6t,CommentMode:n6t,CommentState:s6t,CommentThreadApplicability:a6t,CommentThreadCollapsibleState:r6t,CommentThreadFocus:c6t,CommentThreadState:o6t,CompletionItem:l6t,CompletionItemKind:d6t,CompletionItemTag:h6t,CompletionList:u6t,CompletionTriggerKind:g6t,ConfigurationTarget:f6t,CustomExecution:p6t,DataTransfer:ZKt,DataTransferItem:eqt,DebugAdapterExecutable:m6t,DebugAdapterInlineImplementation:_6t,DebugAdapterNamedPipeServer:v6t,DebugAdapterServer:b6t,DebugConfigurationProviderTriggerKind:w6t,DebugConsoleMode:y6t,DebugStackFrame:Eqt,DebugThread:xqt,DebugVisualization:C6t,DeclarationCoverage:oqt,DecorationRangeBehavior:S6t,Diagnostic:A6t,DiagnosticRelatedInformation:E6t,DiagnosticSeverity:x6t,DiagnosticTag:D6t,Disposable:k6t,DocumentDropEdit:pKt,DocumentDropOrPasteEditKind:mKt,DocumentHighlight:I6t,DocumentHighlightKind:T6t,DocumentLink:R6t,DocumentPasteEdit:_Kt,DocumentPasteTriggerKind:fKt,DocumentSymbol:M6t,EditSessionIdentityMatch:Sqt,EndOfLine:N6t,EnvironmentVariableMutatorType:P6t,EvaluatableExpression:F6t,EventEmitter:U6t,ExcludeSettingOptions:lQt,ExtensionKind:V6t,ExtensionMode:z6t,ExtensionRuntime:EKt,ExternalUriOpenerPriority:$6t,FileChangeType:G6t,FileCoverage:iqt,FileCoverage2:nqt,FileDecoration:K6t,FileDecoration2:q6t,FilePermission:Y6t,FileSystemError:Q6t,FileType:j6t,FoldingRange:J6t,FoldingRangeKind:X6t,FunctionBreakpoint:Z6t,Hover:iGt,HoverVerbosityAction:sGt,IndentAction:rGt,InlayHint:vKt,InlayHintKind:wKt,InlayHintLabelPart:bKt,InlineCompletionItem:eGt,InlineCompletionList:tGt,InlineCompletionTriggerKind:H6t,InlineEdit:aQt,InlineEditTriggerKind:cQt,InlineValueEvaluatableExpression:W6t,InlineValueText:O6t,InlineValueVariableLookup:B6t,InputBoxValidationSeverity:lqt,KeywordRecognitionStatus:Lqt,LanguageModelChatMessage:Zqt,LanguageModelChatMessageFunctionResultPart:eQt,LanguageModelChatMessageRole:Xqt,LanguageModelChatResponseFunctionUsePart:iQt,LanguageModelChatResponseTextPart:tQt,LanguageModelError:nQt,LanguageStatusSeverity:aqt,LinkedEditingRanges:$Kt,Location:oGt,LogLevel:Cqt,ManagedResolvedAuthority:SKt,MarkdownString:aGt,MultiDocumentHighlight:L6t,NewSymbolName:sQt,NewSymbolNameTag:rQt,NewSymbolNameTriggerKind:oQt,NotebookCellData:TKt,NotebookCellExecutionState:IKt,NotebookCellKind:kKt,NotebookCellOutput:PKt,NotebookCellOutputItem:FKt,NotebookCellStatusBarAlignment:MKt,NotebookCellStatusBarItem:OKt,NotebookControllerAffinity:BKt,NotebookControllerAffinity2:WKt,NotebookData:LKt,NotebookEdit:HKt,NotebookEditorRevealType:NKt,NotebookKernelSourceAction:UKt,NotebookRange:DKt,NotebookRendererScript:RKt,NotebookVariablesRequestKind:VKt,OverviewRulerLane:cGt,ParameterInformation:lGt,PartialAcceptTriggerKind:Tqt,PortAttributes:zKt,PortAutoForwardAction:dGt,Position:hGt,ProcessExecution:uGt,ProgressLocation:gGt,QuickInputButtonLocation:fGt,QuickInputButtons:pGt,QuickPickItemKind:cqt,Range:mGt,RelatedInformationType:Dqt,RelativePattern:_Gt,RemoteAuthorityResolverError:yKt,ResolvedAuthority:CKt,Selection:vGt,SelectionRange:bGt,SemanticTokens:wGt,SemanticTokensBuilder:yGt,SemanticTokensEdit:CGt,SemanticTokensEdits:SGt,SemanticTokensLegend:AGt,ShellExecution:EGt,ShellQuoting:xGt,SignatureHelp:DGt,SignatureHelpTriggerKind:kGt,SignatureInformation:IGt,SnippetString:TGt,SnippetTextEdit:JGt,SourceBreakpoint:LGt,SourceControlInputBoxValidationType:AKt,SpeechToTextStatus:kqt,StandardTokenType:RGt,StatementCoverage:sqt,StatusBarAlignment:MGt,SymbolInformation:NGt,SymbolKind:PGt,SymbolTag:FGt,SyntaxTokenType:iKt,TabInputChat:bqt,TabInputCustom:gqt,TabInputInteractiveWindow:vqt,TabInputNotebook:fqt,TabInputNotebookDiff:pqt,TabInputTerminal:_qt,TabInputText:dqt,TabInputTextDiff:hqt,TabInputTextMerge:uqt,TabInputTextMultiDiff:wqt,TabInputWebview:mqt,Task:OGt,TaskGroup:BGt,TaskPanelKind:WGt,TaskRevealKind:HGt,TaskScope:UGt,TelemetryTrustedValue:yqt,TerminalExitReason:qGt,TerminalLink:VGt,TerminalLocation:GGt,TerminalOutputAnchor:W7t,TerminalProfile:KGt,TerminalQuickFixOpener:$Gt,TerminalQuickFixTerminalCommand:zGt,TerminalShellExecutionCommandLineConfidence:QGt,TestCoverageCount:tqt,TestMessage:qKt,TestMessage2:QKt,TestMessageStackFrame:jKt,TestResultState:GKt,TestRunProfileKind:JKt,TestRunRequest:KKt,TestTag:YKt,TextDocumentChangeReason:nKt,TextDocumentSaveReason:jGt,TextEdit:YGt,TextEditorCursorStyle:XGt,TextEditorLineNumbersStyle:ZGt,TextEditorRevealType:eKt,TextEditorSelectionChangeKind:tKt,TextSearchCompleteMessageType:XKt,TextSearchCompleteMessageTypeNew:uQt,TextSearchContextNew:dQt,TextSearchMatchNew:hQt,TextToSpeechStatus:Iqt,ThemeColor:sKt,ThemeIcon:rKt,TimelineItem:xKt,TreeItem:oKt,TreeItemCheckboxState:aKt,TreeItemCollapsibleState:cKt,TypeHierarchyItem:lKt,UIKind:dKt,Uri:hKt,VerboseHover:nGt,ViewColumn:uKt,WorkspaceEdit:gKt,ai:N7t,authentication:S7t,chat:P7t,commands:k7t,comments:C7t,debug:x7t,env:D7t,extensions:E7t,interactive:M7t,l10n:R7t,languages:L7t,lm:O7t,notebooks:w7t,scm:y7t,setDefaultApi:$st,speech:F7t,tasks:b7t,tests:A7t,version:v7t,window:I7t,workspace:T7t},Symbol.toStringTag,{value:"Module"}));hMt(async({toAdd:s,toRemove:e})=>{await Hit(),await kt.get(ps).deltaExtensions(s,e)},(s,e)=>({toAdd:[...s.toAdd,...e.toAdd],toRemove:[...s.toRemove,...e.toRemove]}),0);const fQt=new Map;function pQt(s){return fQt.get(s)}let Aze=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()}};Aze=D([Ki(We.MainThreadLocalization),_(1,Xt),_(2,MXe)],Aze);class SG{constructor(e,t,i){this.viewType=e,this.serializer=t,this.extensionData=i}}var VV,KR;let nL=(KR=class extends ree{static getOrCreate(e,t,i,n,r={}){const o=e.createInstance(VV,t,i,n,r);return i&&o.setPreferredResource(i),o}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p){super(e,t,c,l,d,f,p),this.viewType=i,this.options=n,this._notebookService=r,this._notebookModelResolverService=o,this._fileDialogService=a,this.editorModelReference=null,this._defaultDirtyState=!1,this._defaultDirtyState=!!n.startDirty,this._sideLoadedListener=r.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(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 VV.ID}get editorId(){return this.viewType}get capabilities(){let e=xi.None;return this.resource.scheme===pe.untitled&&(e|=xi.Untitled),this.editorModelReference?this.editorModelReference.object.isReadonly()&&(e|=xi.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=xi.Readonly),e&xi.Readonly||(e|=xi.CanDropIntoEditor),e}getDescription(e=Rs.MEDIUM){if(!this.hasCapability(xi.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(xi.Untitled)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)}async save(e,t){if(this.editorModelReference)return this.hasCapability(xi.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(xi.Untitled)?await this._suggestName(i,this.labelService.getUriBasenameLabel(this.resource)):this.editorModelReference.object.resource;let r;if(this.editorModelReference.object.hasAssociatedFilePath())r=n;else if(r=await this._fileDialogService.pickFileToSave(n,t?.availableFileSystems),!r)return;if(!i.matches(r)){const o=i.selectors.map(a=>typeof a=="string"?a:$je(a)?`${a} (base ${a.base})`:a.exclude?`${a.include} (exclude: ${a.exclude})`:`${a.include}`).join(", ");throw new Error(`File name ${r} is not supported by ${i.providerDisplayName}. Please make sure the file name matches following patterns: ${o}`)}return await this.editorModelReference.object.saveAs(r)}async _suggestName(e,t){const i=e.selectors[0];let n=i&&typeof i=="string"?i:void 0;if(!n&&i){const r=i.include;typeof r=="string"&&(n=r)}if(n){const r=/^\*\.([A-Za-z_-]*)$/.exec(n);if(r&&r.length>1){const o=r[1];if(!t.endsWith(o))return Ft(await this._fileDialogService.defaultFilePath(),t+"."+o)}}return Ft(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&xi.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 SG))throw new Error("CANNOT open file notebook with this provider");const n=await i.serializer.dataToNotebook(Ge.fromString(JSON.stringify({__webview_backup:this.options._backupId})));this.editorModelReference.object.notebook.applyEdits([{editType:mI.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 VV?this.viewType===e.viewType&&Yi(this.resource,e.resource):!1}},VV=KR,KR.ID="workbench.input.notebook",KR);nL=VV=D([_(4,oE),_(5,dce),_(6,dg),_(7,Os),_(8,Xt),_(9,bd),_(10,ps),_(11,ti),_(12,xc),_(13,cE)],nL);function mQt(s){return!!s&&typeof s=="object"&&Array.isArray(s.editorInputs)&&s.editorInputs.every(e=>e instanceof nL)}const Gst="jupyter-notebook",_Qt="ms-toolsai.jupyter",Kst=new Map;Kst.set(Gst,new Map);Kst.get(Gst)?.set("python",{extensionIds:["ms-python.python",_Qt],displayName:"Python + Jupyter"});var Eze;(function(s){s[s.Html=0]="Html",s[s.Extension=1]="Extension"})(Eze||(Eze={}));var xze;(function(s){s[s.fullCell=0]="fullCell",s[s.firstLine=1]="firstLine"})(xze||(xze={}));var Dze;(function(s){s[s.Uninitialized=0]="Uninitialized",s[s.Estimated=1]="Estimated",s[s.FromCache=2]="FromCache",s[s.Measured=3]="Measured"})(Dze||(Dze={}));var kze;(function(s){s[s.Fold=0]="Fold"})(kze||(kze={}));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 Tze;(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"})(Tze||(Tze={}));var Lze;(function(s){s[s.Default=1]="Default",s[s.Center=2]="Center",s[s.CenterIfOutsideViewport=3]="CenterIfOutsideViewport"})(Lze||(Lze={}));var Rze;(function(s){s[s.Preview=0]="Preview",s[s.Editing=1]="Editing"})(Rze||(Rze={}));var Mze;(function(s){s[s.Container=0]="Container",s[s.Editor=1]="Editor",s[s.Output=2]="Output",s[s.ChatInput=3]="ChatInput"})(Mze||(Mze={}));var Nze;(function(s){s[s.None=0]="None",s[s.Top=1]="Top",s[s.Bottom=2]="Bottom",s[s.Both=3]="Both"})(Nze||(Nze={}));var Pze;(function(s){s[s.None=0]="None",s[s.Start=1]="Start",s[s.End=2]="End",s[s.Both=3]="Both"})(Pze||(Pze={}));function lB(s){if(!s)return;if(s.getId()===e7t)return s.getControl();const e=s.input;if(e&&mQt(e)||s.getId()===t7t)return s.getControl()?.notebookEditor}var Fze;(function(s){s[s.None=0]="None",s[s.Expanded=1]="Expanded",s[s.Collapsed=2]="Collapsed"})(Fze||(Fze={}));class dB extends Mae{static is(e){return e instanceof dB?!0:N.isUri(e.resource)&&In(e.cellEdit)}static lift(e){return e instanceof dB?e:new dB(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 Oze=class{constructor(e,t,i,n,r,o,a){this._undoRedoGroup=e,this._progress=i,this._token=n,this._edits=r,this._editorService=o,this._notebookModelService=a,this._edits=this._edits.map(c=>{if(c.resource.scheme===Gee.scheme){const l=Gee.parse(c.resource)?.notebook;if(!l)throw new Error(`Invalid notebook URI: ${c.resource}`);return new dB(l,c.cellEdit,c.notebookVersionId,c.metadata)}else return c})}async apply(){const e=[],t=d8(this._edits,(i,n)=>mm(i.resource.toString(),n.resource.toString()));for(const i of t){if(this._token.isCancellationRequested)break;const[n]=i,r=await this._notebookModelService.resolve(n.resource);if(typeof n.notebookVersionId=="number"&&r.object.notebook.versionId!==n.notebookVersionId)throw r.dispose(),new Error(`Notebook '${n.resource}' has changed in the meantime`);const o=i.map(d=>d.cellEdit),a=!r.object.isReadonly(),c=lB(this._editorService.activeEditorPane),l=c?.textModel?.uri.toString()===r.object.notebook.uri.toString()?{kind:rEe.Index,focus:c.getFocus(),selections:c.getSelections()}:void 0;r.object.notebook.applyEdits(o,!0,l,()=>{},this._undoRedoGroup,a),r.dispose(),this._progress.report(void 0),e.push(n.resource)}return e}};Oze=D([_(5,ti),_(6,dce)],Oze);let Bze=class{constructor(e,t,i,n){this._bulkEditService=t,this._logService=i,this._uriIdentService=n}dispose(){}$tryApplyWorkspaceEdit(e,t,i){const n=Vy(e.value,this._uriIdentService);return this._bulkEditService.apply(n,{undoRedoGroupId:t,respectAutoSaveConfig:i}).then(r=>r.isApplied,r=>(this._logService.warn(`IGNORING workspace edit: ${r}`),!1))}};Bze=D([Ki(We.MainThreadBulkEdits),_(1,UN),_(2,Ke),_(3,Is)],Bze);function Vy(s,e,t){if(!s||!s.edits)return s;const i=Mr(s);for(const n of i.edits){if(rA.is(n)&&(n.resource=e.asCanonicalUri(n.resource)),hp.is(n)){if(n.options){const r=n.options?.contents;if(r)if(r.type==="base64")n.options.contents=Promise.resolve(Rqe(r.value));else if(t)n.options.contents=t(r.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(dB.is(n)){n.resource=e.asCanonicalUri(n.resource);const r=n.cellEdit;r.editType===mI.Replace&&(n.cellEdit={...r,cells:r.cells.map(o=>({...o,outputs:o.outputs.map(a=>({...a,outputs:a.items.map(c=>({mime:c.mime,data:c.valueBytes}))}))}))})}}return s}const lle="__";let Wze=class{constructor(e,t,i,n,r,o,a){this._chatProviderService=t,this._languageModelStatsService=i,this._logService=n,this._authenticationService=r,this._authenticationAccessService=o,this._extensionService=a,this._store=new Z,this._providerRegistrations=new mr,this._pendingProgress=new Map,this._proxy=e.getProxy(Je.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(r,o,a,c)=>{const l=Math.random()*1e6|0,d=new hc,h=new V2;try{this._pendingProgress.set(l,{defer:d,stream:h}),await this._proxy.$startChatRequest(e,l,o,r,a,c)}catch(u){throw this._pendingProgress.delete(l),u}return{result:d.p,stream:h.asyncIterable}},provideTokenCount:(r,o)=>this._proxy.$provideTokenLength(e,r,o)})),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=_8(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,r,o){this._logService.trace("[CHAT] request STARTED",e.value,i);const a=await this._chatProviderService.sendChatRequest(t,e,n,r,o),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,kA(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,kA(l))})}$countTokens(e,t,i){return this._chatProviderService.computeTokenLength(e,t,i)}_registerAuthenticationProvider(e,t){const i=lle+e.value;if(this._authenticationService.getProviderIds().includes(i))return V.None;const n=t.accountLabel??g(4828,"Language Models"),r=new Z;return this._authenticationService.registerAuthenticationProvider(i,new vQt(i,t.providerLabel,n)),r.add(Ee(()=>{this._authenticationService.unregisterAuthenticationProvider(i)})),r.add(this._authenticationAccessService.onDidChangeExtensionSessionAccess(async o=>{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)})),r}};Wze=D([Ki(We.MainThreadLanguageModels),_(1,JXe),_(2,WZe),_(3,Ke),_(4,LMe),_(5,fce),_(6,ps)],Wze);class vQt{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 AEe;const bQt="chat-dynamic-variable";var qR;let w$=(qR=class extends V{get variables(){return[...this._variables]}get id(){return AEe.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 r=!1;this._variables=Oi(this._variables.map(o=>{const a=F.intersectRanges(o.range,n.range);if(a&&!a.isEmpty()){if(!F.containsRange(n.range,o.range)){const c=new F(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn-1);this.widget.inputEditor.executeEdits(this.id,[{range:c,text:""}])}return r=!0,null}else if(F.compareRangesUsingStarts(o.range,n.range)>0){const c=n.text.length-n.rangeLength;return r=!0,{...o,range:{startLineNumber:o.range.startLineNumber,startColumn:o.range.startColumn+c,endLineNumber:o.range.endLineNumber,endColumn:o.range.endColumn+c}}}return o})),r&&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",bQt,this._variables.map(e=>({range:e.range,hoverMessage:this.getHoverForReference(e)})))}getHoverForReference(e){const t=e.data;return N.isUri(t)?new Nt(this.labelService.getUriLabel(t,{relative:!0})):t.toString()}},AEe=qR,qR.ID="chatDynamicVariableModel",qR);w$=AEe=D([_(1,Os)],w$);I9.CONTRIBS.push(w$);function wQt(s){return"widget"in s&&"range"in s}const Lw=class Lw extends di{constructor(){super({id:Lw.ID,title:""})}async run(e,...t){const i=e.get(pn),n=e.get(Ke),r=e.get(Tn),o=e.get(z6),a=t[0];if(!wQt(a))return;const c=()=>{a.widget.inputEditor.executeEdits("chatInsertFile",[{range:a.range,text:""}])};let l;o.hasVariable(Lw.Name)&&(l={providerOptions:{additionPicks:[Lw.Item,{type:"separator"}]}});const d=await r.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]===Lw.Item){const b=`#${Lw.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:${vi(f)}`;if(!h.executeEdits("chatInsertFile",[{range:u,text:m+" "}])){n.trace(`SelectAndInsertFileAction: failed to insert "${m}"`),c();return}a.widget.getContrib(w$.ID)?.addReference({id:"vscode.file",range:{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.startColumn+m.length},data:f})}};Lw.Name="files",Lw.Item={label:g(7003,"All Files"),description:g(7004,"Search for relevant files in the workspace and provide context from them")},Lw.ID="workbench.action.chat.selectAndInsertFile";let EEe=Lw;Et(EEe);function yQt(s){return"widget"in s&&"range"in s&&"variableData"in s}const doe=class doe extends di{constructor(){super({id:doe.ID,title:""})}async run(e,...t){const i=t[0];if(!yQt(i))return;let n=i.range;const r=i.variableData,o=()=>{i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:i.range,text:""}])};if(i.command){const c=await e.get(bi).executeCommand(i.command.id,...i.command.arguments??[]);if(!c){o();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+" "}])){o();return}}i.widget.getContrib(w$.ID)?.addReference({id:i.id,range:n,data:r})}};doe.ID="workbench.action.chat.addDynamicVariable";let Rte=doe;Et(Rte);class CQt{get onDidAddProgress(){return this._onDidAddProgress.event}constructor(e){this.content=e,this.kind="progressTask",this.deferred=new hc,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 Hze=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this._chatAgentService=t,this._chatService=i,this._languageFeaturesService=n,this._chatWidgetService=r,this._instantiationService=o,this._logService=a,this._extensionService=c,this._agents=this._register(new mr),this._agentCompletionProviders=this._register(new mr),this._agentIdsToCompletionProviders=this._register(new mr),this._pendingProgress=new Map,this._responsePartHandlePool=0,this._activeTasks=new Map,this._proxy=e.getProxy(Je.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,r){const o=this._chatAgentService.getAgent(i);if(!o&&!r)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(!o&&r){const l=this._extensionService.extensions.find(d=>An.equals(d.identifier,t));c=this._chatAgentService.registerDynamicAgent({id:i,name:r.name??"",description:r.description,extensionId:t,extensionDisplayName:l?.displayName??t.value,extensionPublisherId:l?.publisher??"",publisherDisplayName:r.publisherName,fullName:r.fullName,metadata:Mr(n),slashCommands:[],locations:[To.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,Mr(t))}async $handleProgressChunk(e,t,i){const n=Mr(t);if(n.kind==="progressTask"){const r=++this._responsePartHandlePool,o=`${e}_${r}`,a=new CQt(n.content);return this._activeTasks.set(o,a),this._pendingProgress.get(e)?.(a),r}else if(i!==void 0){const r=`${e}_${i}`,o=this._activeTasks.get(r);switch(n.kind){case"progressTaskResult":return o&&n.content?(o.complete(n.content.value),this._activeTasks.delete(r)):o?.complete(void 0),i;case"warning":case"reference":o?.add(n);return}}this._pendingProgress.get(e)?.(n)}$registerAgentCompletionsProvider(e,t,i){const n=async(r,o)=>(await this._proxy.$invokeCompletionProvider(e,r,o)).map(c=>({...c,icon:c.icon?He.fromId(c.icon):void 0}));this._agentIdsToCompletionProviders.set(t,this._chatAgentService.registerAgentCompletionProvider(t,n)),this._agentCompletionProviders.set(e,this._languageFeaturesService.completionProvider.register({scheme:DZ.INPUT_SCHEME,hasAccessToAllModels:!0},{_debugDisplayName:"chatAgentCompletions:"+e,triggerCharacters:i,provideCompletionItems:async(r,o,a,c)=>{const l=this._chatWidgetService.getWidgetByInputUri(r.uri);if(!l||!l.viewModel)return;const d=i.map(y=>Nh(y)).join(""),h=new RegExp(`[${d}]\\S*`,"g"),u=Pk(o.column,h,r.getLineContent(o.lineNumber),0)?.word??"";if(u&&!i.some(y=>u.startsWith(y)))return;const p=this._instantiationService.createInstance(see).parseChatRequest(l.viewModel.sessionId,r.getValue()).parts.find(y=>y instanceof qg),m=this._agents.get(e)?.id;if(p?.agent.id!==m)return;const v=SQt(r,o,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:Rte.ID,title:"",arguments:[{id:y.id,widget:l,range:A,variableData:Mr(y.value),command:y.command}]}}})}:null}}))}$unregisterAgentCompletionsProvider(e,t){this._agentCompletionProviders.deleteAndDispose(e),this._agentIdsToCompletionProviders.deleteAndDispose(t)}};Hze=D([Ki(We.MainThreadChatAgents2),_(1,wf),_(2,Lm),_(3,nt),_(4,qN),_(5,we),_(6,Ke),_(7,ps)],Hze);function SQt(s,e,t){const i=Pk(e.column,t,s.getLineContent(e.lineNumber),0);if(!i&&s.getWordUntilPosition(e).word)return;let n,r;return i?(n=new F(e.lineNumber,i.startColumn,e.lineNumber,e.column),r=new F(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn)):n=r=F.fromPositions(e),{insert:n,replace:r}}let Uze=class{constructor(e,t){this._chatVariablesService=t,this._variables=new mr,this._pendingProgress=new Map,this._proxy=e.getProxy(Je.ExtHostChatVariables)}dispose(){this._variables.clearAndDisposeAll()}$registerVariable(e,t){const i=this._chatVariablesService.registerVariable(t,async(n,r,o,a,c)=>{const l=`${o.sessionId}-${e}`;this._pendingProgress.set(l,a);const d=Mr(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=Mr(t);this._pendingProgress.get(e)?.(i)}$unregisterVariable(e){this._variables.deleteAndDispose(e)}};Uze=D([Ki(We.MainThreadChatVariables),_(1,z6)],Uze);let Vze=class extends V{constructor(e,t){super(),this._languageModelToolsService=t,this._tools=this._register(new mr),this._proxy=e.getProxy(Je.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)}};Vze=D([Ki(We.MainThreadLanguageModelTools),_(1,HZe)],Vze);const qst=ae("embeddingsService");class AQt{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(qst,AQt,Qt.Delayed);let zze=class{constructor(e,t){this.embeddingsService=t,this._store=new Z,this._providers=this._store.add(new mr),this._proxy=e.getProxy(Je.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,r)=>this._proxy.$provideEmbeddings(e,n,r)});this._providers.set(e,i)}$unregisterEmbeddingProvider(e){this._providers.deleteAndDispose(e)}$computeEmbeddings(e,t,i){return this.embeddingsService.computeEmbeddings(e,t,i)}};zze=D([Ki(We.MainThreadEmbeddings),_(1,qst)],zze);class EQt{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}}function Qst(s,e){if(e.serializeBuffersForPostMessage){const t=new EQt,n=JSON.stringify(s,(o,a)=>{if(a instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a)};if(ArrayBuffer.isView(a)){const c=xQt(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}),r=t.buffers.map(o=>{const a=new Uint8Array(o);return Ge.wrap(a)});return{message:n,buffers:r}}else return{message:JSON.stringify(s),buffers:[]}}function xQt(s){switch(s.constructor.name){case"Int8Array":return wc.Int8Array;case"Uint8Array":return wc.Uint8Array;case"Uint8ClampedArray":return wc.Uint8ClampedArray;case"Int16Array":return wc.Int16Array;case"Uint16Array":return wc.Uint16Array;case"Int32Array":return wc.Int32Array;case"Uint32Array":return wc.Uint32Array;case"Float32Array":return wc.Float32Array;case"Float64Array":return wc.Float64Array;case"BigInt64Array":return wc.BigInt64Array;case"BigUint64Array":return wc.BigUint64Array}}function jst(s,e){const t=e.map(r=>{const o=new ArrayBuffer(r.byteLength);return new Uint8Array(o).set(r.buffer),o}),i=e.length?(r,o)=>{if(o&&typeof o=="object"&&o.$$vscode_array_buffer_reference$$){const a=o,{index:c}=a,l=t[c];if(a.view)switch(a.view.type){case wc.Int8Array:return new Int8Array(l,a.view.byteOffset,a.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case wc.Uint8Array:return new Uint8Array(l,a.view.byteOffset,a.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case wc.Uint8ClampedArray:return new Uint8ClampedArray(l,a.view.byteOffset,a.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case wc.Int16Array:return new Int16Array(l,a.view.byteOffset,a.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case wc.Uint16Array:return new Uint16Array(l,a.view.byteOffset,a.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case wc.Int32Array:return new Int32Array(l,a.view.byteOffset,a.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case wc.Uint32Array:return new Uint32Array(l,a.view.byteOffset,a.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case wc.Float32Array:return new Float32Array(l,a.view.byteOffset,a.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case wc.Float64Array:return new Float64Array(l,a.view.byteOffset,a.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case wc.BigInt64Array:return new BigInt64Array(l,a.view.byteOffset,a.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case wc.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 o}:void 0;return{message:JSON.parse(s,i),arrayBuffers:t}}var xEe,QR;let DEe=(QR=class extends V{constructor(e,t,i){super(),this._openerService=t,this._productService=i,this._webviews=new Map,this._proxy=e.getProxy(Je.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=Nte(t))}async $postMessage(e,t,...i){const n=this.tryGetWebview(e);if(!n)return!1;const{message:r,arrayBuffers:o}=jst(t,i);return n.postMessage(r,o)}hookupWebviewEventDelegate(e,t,i){const n=new Z;n.add(t.onDidClickLink(r=>this.onDidClickLink(e,r))),n.add(t.onMessage(r=>{const o=Qst(r.message,i);this._proxy.$onMessage(e,o.message,new Jd(o.buffers))})),n.add(t.onMissingCsp(r=>this._proxy.$onMissingCsp(e,r.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 xEe.standardSupportedLinkSchemes.has(t.scheme)||!Hn&&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` @@ -899,8 +899,8 @@ ${o}`)}return await this.editorModelReference.object.saveAs(r)}async _suggestNam ${g(9799,"An error occurred while loading view: {0}",wT(e))} - `}},xEe=QR,QR.standardSupportedLinkSchemes=new Set([pe.http,pe.https,pe.mailto,pe.vscode,"vscode-insider"]),QR);DEe=xEe=D([_(1,Ar),_(2,xo)],DEe);function Mte(s){return{id:s.id,location:N.revive(s.location)}}function Nte(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 DQt{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(r=>this._id=r.addZone(this)),n.mountTo(this.domNode,lt(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(Je.ExtHostEditorInsets)}dispose(){this._disposables.dispose()}async $createEditorInset(e,t,i,n,r,o,a,c){let l;t=t.substr(0,t.indexOf(","));for(const p of this._editorService.listCodeEditors())if(p.getId()===t&&p.hasModel()&&Yi(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:Nte(o),extension:{id:a,location:N.revive(c)}}),u=new DQt(l,n,r,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=Nte(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([Ki(We.MainThreadEditorInsets),_(1,qt),_(2,gce)],$ze);const kQt=s=>g(9800,"Extension '{0}' not found.",s),Gze=g(9801,"Make sure you use the full extension ID, including the publisher, e.g.: {0}","ms-dotnettools.csharp");let kEe=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(wo.User,i);const r=mXe.map(a=>a.toLowerCase());if(t&&t!==""){if(r.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: "),r.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 o;for(const a of n)o!==a.identifier.id&&(o=a.identifier.id,this.logger.info(e?`${o}@${a.manifest.version}`:o))}async installExtensions(e,t,i,n){const r=[];try{e.length&&this.logger.info(this.location?g(9803,"Installing extensions on {0}...",this.location):g(9804,"Installing extensions..."));const o=[],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)o.push({vsix:d,installOptions:i});else{const[h,u]=$He(d);c(h,u,!1)}for(const d of t)if(d instanceof N)o.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(o.length&&await Promise.all(o.map(async({vsix:d,installOptions:h})=>{try{await this.installVSIX(d,h,n,l)}catch(u){this.logger.error(u),r.push(d.toString())}})),a.length){const d=await this.installGalleryExtensions(a,l,n);r.push(...d)}}catch(o){throw this.logger.error(g(9805,"Error while installing extensions: {0}",ou(o))),o}if(r.length)throw new Error(g(9806,"Failed Installing Extensions: {0}",r.join(", ")))}async updateExtensions(e){const t=await this.extensionManagementService.getInstalled(wo.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},Ue.None),r=[];for(const a of n)for(const c of t)Ma(c.identifier,a.identifier)&&iH.gt(a.version,c.manifest.version)&&r.push({extension:a,options:{operation:FA.Update,installPreReleaseVersion:c.preRelease,profileLocation:e,isApplicationScoped:c.isApplicationScoped}});if(!r.length){this.logger.info(g(9808,"No extension to update"));return}this.logger.info(g(9809,"Updating extensions: {0}",r.map(a=>a.extension.identifier.id).join(", ")));const o=await this.extensionManagementService.installGalleryExtensions(r);for(const a of o)a.error?this.logger.error(g(9810,"Error while updating extension {0}: {1}",a.identifier.id,ou(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=>Ma(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=[],r=[],o=await this.getGalleryExtensions(e);if(await Promise.all(e.map(async({id:a,version:c,installOptions:l})=>{const d=o.get(a.toLowerCase());if(!d){this.logger.error(`${kQt(c?`${a}@${c}`:a)} -${Gze}`),n.push(a);return}try{const u=await this.extensionGalleryService.getManifest(d,Ue.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=>Ma(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)),r.push({extension:d,options:{...l,installGivenVersion:!!c,isApplicationScoped:l.isApplicationScoped||h?.isApplicationScoped}})})),r.length){const a=await this.extensionManagementService.installGalleryExtensions(r);for(const c of a)c.error?(this.logger.error(g(9819,"Error while installing extension {0}: {1}",c.identifier.id,ou(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 r=await this.extensionManagementService.getManifest(e);if(!r)throw new Error("Invalid vsix");if(await this.validateVSIX(r,i,t.profileLocation,n))try{await this.extensionManagementService.install(e,{...t,installGivenVersion:!0}),this.logger.info(g(9821,"Extension '{0}' was successfully installed.",vi(e)))}catch(a){if(Oo(a))this.logger.info(g(9822,"Cancelled installing extension '{0}'.",vi(e)));else throw a}}async getGalleryExtensions(e){const t=new Map,i=e.some(o=>o.installOptions.installPreReleaseVersion),n=await this.extensionManagementService.getTargetPlatform(),r=[];for(const o of e)jRt.test(o.id)&&r.push({...o,preRelease:i});if(r.length){const o=await this.extensionGalleryService.getExtensions(r,{targetPlatform:n},Ue.None);for(const a of o)t.set(a.identifier.id.toLowerCase(),a)}return t}validateExtensionKind(e){return!0}async validateVSIX(e,t,i,n){if(!t){const r={id:Mw(e.publisher,e.name)},o=n.find(a=>Ma(r,a.identifier)&&iH.gt(a.manifest.version,e.version));if(o)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.",o.identifier.id,o.manifest.version,e.version)),!1}return this.validateExtensionKind(e)}async uninstallExtensions(e,t,i){const n=async r=>{if(r instanceof N){const o=await this.extensionManagementService.getManifest(r);return OM(o.publisher,o.name)}return r};for(const r of e){const o=await n(r),c=(await this.extensionManagementService.getInstalled(void 0,i)).filter(l=>Ma(l.identifier,{id:o}));if(!c.length)throw new Error(`${this.notInstalled(o)} + `}},xEe=QR,QR.standardSupportedLinkSchemes=new Set([pe.http,pe.https,pe.mailto,pe.vscode,"vscode-insider"]),QR);DEe=xEe=D([_(1,Ar),_(2,xo)],DEe);function Mte(s){return{id:s.id,location:N.revive(s.location)}}function Nte(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 DQt{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(r=>this._id=r.addZone(this)),n.mountTo(this.domNode,lt(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(Je.ExtHostEditorInsets)}dispose(){this._disposables.dispose()}async $createEditorInset(e,t,i,n,r,o,a,c){let l;t=t.substr(0,t.indexOf(","));for(const p of this._editorService.listCodeEditors())if(p.getId()===t&&p.hasModel()&&Yi(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:Nte(o),extension:{id:a,location:N.revive(c)}}),u=new DQt(l,n,r,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=Nte(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([Ki(We.MainThreadEditorInsets),_(1,qt),_(2,gce)],$ze);const kQt=s=>g(9800,"Extension '{0}' not found.",s),Gze=g(9801,"Make sure you use the full extension ID, including the publisher, e.g.: {0}","ms-dotnettools.csharp");let kEe=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(wo.User,i);const r=mXe.map(a=>a.toLowerCase());if(t&&t!==""){if(r.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: "),r.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 o;for(const a of n)o!==a.identifier.id&&(o=a.identifier.id,this.logger.info(e?`${o}@${a.manifest.version}`:o))}async installExtensions(e,t,i,n){const r=[];try{e.length&&this.logger.info(this.location?g(9803,"Installing extensions on {0}...",this.location):g(9804,"Installing extensions..."));const o=[],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)o.push({vsix:d,installOptions:i});else{const[h,u]=$He(d);c(h,u,!1)}for(const d of t)if(d instanceof N)o.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(o.length&&await Promise.all(o.map(async({vsix:d,installOptions:h})=>{try{await this.installVSIX(d,h,n,l)}catch(u){this.logger.error(u),r.push(d.toString())}})),a.length){const d=await this.installGalleryExtensions(a,l,n);r.push(...d)}}catch(o){throw this.logger.error(g(9805,"Error while installing extensions: {0}",ou(o))),o}if(r.length)throw new Error(g(9806,"Failed Installing Extensions: {0}",r.join(", ")))}async updateExtensions(e){const t=await this.extensionManagementService.getInstalled(wo.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},Ue.None),r=[];for(const a of n)for(const c of t)Na(c.identifier,a.identifier)&&iH.gt(a.version,c.manifest.version)&&r.push({extension:a,options:{operation:FA.Update,installPreReleaseVersion:c.preRelease,profileLocation:e,isApplicationScoped:c.isApplicationScoped}});if(!r.length){this.logger.info(g(9808,"No extension to update"));return}this.logger.info(g(9809,"Updating extensions: {0}",r.map(a=>a.extension.identifier.id).join(", ")));const o=await this.extensionManagementService.installGalleryExtensions(r);for(const a of o)a.error?this.logger.error(g(9810,"Error while updating extension {0}: {1}",a.identifier.id,ou(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=>Na(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=[],r=[],o=await this.getGalleryExtensions(e);if(await Promise.all(e.map(async({id:a,version:c,installOptions:l})=>{const d=o.get(a.toLowerCase());if(!d){this.logger.error(`${kQt(c?`${a}@${c}`:a)} +${Gze}`),n.push(a);return}try{const u=await this.extensionGalleryService.getManifest(d,Ue.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=>Na(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)),r.push({extension:d,options:{...l,installGivenVersion:!!c,isApplicationScoped:l.isApplicationScoped||h?.isApplicationScoped}})})),r.length){const a=await this.extensionManagementService.installGalleryExtensions(r);for(const c of a)c.error?(this.logger.error(g(9819,"Error while installing extension {0}: {1}",c.identifier.id,ou(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 r=await this.extensionManagementService.getManifest(e);if(!r)throw new Error("Invalid vsix");if(await this.validateVSIX(r,i,t.profileLocation,n))try{await this.extensionManagementService.install(e,{...t,installGivenVersion:!0}),this.logger.info(g(9821,"Extension '{0}' was successfully installed.",vi(e)))}catch(a){if(Oo(a))this.logger.info(g(9822,"Cancelled installing extension '{0}'.",vi(e)));else throw a}}async getGalleryExtensions(e){const t=new Map,i=e.some(o=>o.installOptions.installPreReleaseVersion),n=await this.extensionManagementService.getTargetPlatform(),r=[];for(const o of e)jRt.test(o.id)&&r.push({...o,preRelease:i});if(r.length){const o=await this.extensionGalleryService.getExtensions(r,{targetPlatform:n},Ue.None);for(const a of o)t.set(a.identifier.id.toLowerCase(),a)}return t}validateExtensionKind(e){return!0}async validateVSIX(e,t,i,n){if(!t){const r={id:Mw(e.publisher,e.name)},o=n.find(a=>Na(r,a.identifier)&&iH.gt(a.manifest.version,e.version));if(o)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.",o.identifier.id,o.manifest.version,e.version)),!1}return this.validateExtensionKind(e)}async uninstallExtensions(e,t,i){const n=async r=>{if(r instanceof N){const o=await this.extensionManagementService.getManifest(r);return OM(o.publisher,o.name)}return r};for(const r of e){const o=await n(r),c=(await this.extensionManagementService.getInstalled(void 0,i)).filter(l=>Na(l.identifier,{id:o}));if(!c.length)throw new Error(`${this.notInstalled(o)} ${Gze}`);if(c.some(l=>l.type===wo.System)){this.logger.info(g(9824,"Extension '{0}' is a Built-in extension and cannot be uninstalled",o));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.",o));return}this.logger.info(g(9826,"Uninstalling {0}...",o));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}!",o,this.location)):this.logger.info(g(9828,"Extension '{0}' was successfully uninstalled!",o))}}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)}};kEe=D([_(1,H6),_(2,LI)],kEe);vt.registerCommand("_remoteCLI.openExternal",function(s,e){return s.get(Ar).open(Rt(e)?e:N.revive(e),{openExternal:!0,allowTunneling:!0})});vt.registerCommand("_remoteCLI.windowOpen",function(s,e,t){const i=s.get(bi);return e.length?i.executeCommand("_files.windowOpen",e,t):i.executeCommand("_files.newWindow",t)});vt.registerCommand("_remoteCLI.getSystemStatus",function(s){return s.get(bi).executeCommand("_issues.getSystemStatus")});vt.registerCommand("_remoteCLI.manageExtensions",async function(s,e){const t=s.get(we),n=s.get(gv).remoteExtensionManagementServer?.extensionManagementService;if(!n)return;const r=[],o=new class extends xae{log(c,l){r.push(l)}},a=t.createChild(new Vc([H6,n])).createInstance(IEe,o);if(e.list)await a.listExtensions(!!e.list.showVersions,e.list.category,void 0);else{const c=l=>l.map(d=>Rt(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){r.push(l.message)}if(Array.isArray(e.uninstall)&&e.uninstall.length)try{await a.uninstallExtensions(c(e.uninstall),!!e.force,void 0)}catch(l){r.push(l.message)}}return r.join(` `)});let IEe=class extends kEe{constructor(e,t,i,n,r,o){super(e,t,i),this._extensionManifestPropertiesService=o;const a=r.remoteAuthority;this._location=a?n.getHostLabel(pe.vscodeRemote,a):void 0}get location(){return this._location}validateExtensionKind(e){return!this._extensionManifestPropertiesService.canExecuteOnWorkspace(e)&&!(Hn&&this._extensionManifestPropertiesService.canExecuteOnWeb(e))?(this.logger.info(g(4829,"Cannot install the '{0}' extension because it is declared to not run in this setup.",OM(e.publisher,e.name))),!1):!0}};IEe=D([_(1,H6),_(2,LI),_(3,Os),_(4,Xo),_(5,Rm)],IEe);let Kze=class{constructor(e,t){this._clipboardService=t}dispose(){}$readText(){return this._clipboardService.readText()}$writeText(e){return this._clipboardService.writeText(e)}};Kze=D([Ki(We.MainThreadClipboard),_(1,gg)],Kze);let qze=class{constructor(e,t,i){this._commandService=t,this._extensionService=i,this._commandRegistrations=new mr,this._proxy=e.getProxy(Je.ExtHostCommands),this._generateCommandsDocumentationRegistration=vt.registerCommand("_generateCommandsDocumentation",()=>this._generateCommandsDocumentation())}dispose(){this._commandRegistrations.dispose(),this._generateCommandsDocumentationRegistration.dispose()}async _generateCommandsDocumentation(){const e=await this._proxy.$getContributedCommandMetadata(),t=vt.getCommands();for(const[n,r]of t)r.metadata&&(e[n]=r.metadata);const i=[];for(const n in e)i.push("`"+n+"` - "+IQt(e[n]));console.log(i.join(` `))}$registerCommand(e){this._commandRegistrations.set(e,vt.registerCommand(e,(t,...i)=>this._proxy.$executeContributedCommand(e,...i).then(n=>Mr(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&&!vt.getCommand(e))throw await this._extensionService.activateByEvent(`onCommand:${e}`),new Error("$executeCommand:retry");return this._commandService.executeCommand(e,...t)}$getCommands(){return Promise.resolve([...vt.getCommands().keys()])}};qze=D([Ki(We.MainThreadCommands),_(1,bi),_(2,ps)],qze);function IQt(s){if(typeof s=="string")return s;{const t=[Rt(s.description)?s.description:s.description.original];if(t.push(` @@ -909,8 +909,8 @@ ${Gze}`);if(c.some(l=>l.type===wo.System)){this.logger.info(g(9824,"Extension '{ `);return s.returns&&t.push(`* _(returns)_ - ${s.returns}`),t.push(` `),t.join("")}}let Qze=class{constructor(e,t,i,n){this._workspaceContextService=t,this.configurationService=i,this._environmentService=n;const r=e.getProxy(Je.ExtHostConfiguration);r.$initializeConfiguration(this._getConfigurationData()),this._configurationListener=i.onDidChangeConfiguration(o=>{r.$acceptConfigurationChanged(this._getConfigurationData(),o.change)})}_getConfigurationData(){const e={...this.configurationService.getConfigurationData(),configurationScopes:[]};return(!this._environmentService.isBuilt||this._environmentService.isExtensionDevelopment)&&(e.configurationScopes=Ngt()),e}dispose(){this._configurationListener.dispose()}$updateConfigurationOption(e,t,i,n,r){return n={resource:n?.resource?N.revive(n.resource):void 0,overrideIdentifier:n?.overrideIdentifier},this.writeConfiguration(e,t,i,n,r)}$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,r){e=e??this.deriveConfigurationTarget(t,n);const o=this.configurationService.inspect(t,n);switch(e){case At.MEMORY:return this._updateValue(t,i,e,o?.memory?.override,n,r);case At.WORKSPACE_FOLDER:return this._updateValue(t,i,e,o?.workspaceFolder?.override,n,r);case At.WORKSPACE:return this._updateValue(t,i,e,o?.workspace?.override,n,r);case At.USER_REMOTE:return this._updateValue(t,i,e,o?.userRemote?.override,n,r);default:return this._updateValue(t,i,e,o?.userLocal?.override,n,r)}}_updateValue(e,t,i,n,r,o){return r=o===!0?r:o===!1?{resource:r.resource}:r.overrideIdentifier&&n!==void 0?r:{resource:r.resource},this.configurationService.updateValue(e,t,r,i,{donotNotifyError:!0})}deriveConfigurationTarget(e,t){if(t.resource&&this._workspaceContextService.getWorkbenchState()===Qi.WORKSPACE){const i=je.as(Pn.Configuration).getConfigurationProperties();if(i[e]&&(i[e].scope===ct.RESOURCE||i[e].scope===ct.LANGUAGE_OVERRIDABLE))return At.WORKSPACE_FOLDER}return At.WORKSPACE}};Qze=D([Ki(We.MainThreadConfiguration),_(1,Ci),_(2,Te),_(3,ec)],Qze);function NPe(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 TQt(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}=NPe(s),n=typeof t[0]=="string"&&t.length===1;let r=TQt(i);r&&(r=`(${r.trim()})`);let o=[];if(typeof t[0]=="string"?r&&n?o=[`%c[${e}] %c${t[0]} %c${r}`,xP("blue"),xP(""),xP("grey")]:o=[`%c[${e}] %c${t[0]}`,xP("blue"),xP(""),...t.slice(1)]:o=[`%c[${e}]%`,xP("blue"),...t],r&&!n&&o.push(r),typeof console[s.severity]!="function")throw new Error("Unknown console method");console[s.severity].apply(console,o)}function xP(s){return`color: ${s}`}function RQt(s,e,t=null){const i=NPe(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 MQt(s,e,t){const i=NPe(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 jze=class{constructor(e,t,i){this._environmentService=t,this._logService=i;const n=lPe(this._environmentService);this._isExtensionDevTestFromCli=n.isExtensionDevTestFromCli}dispose(){}$logExtensionHostMessage(e){this._isExtensionDevTestFromCli?RQt(this._logService,e):(MQt(this._logService,e,"Extension Host"),LQt(e,"Extension Host"))}};jze=D([Ki(We.MainThreadConsole),_(1,ec),_(2,Ke)],jze);class Yst{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 r={command:e};if(t&&Object.keys(t).length>0&&(r.arguments=t),this.internalSend("request",r),typeof n=="number"){const o=setTimeout(()=>{clearTimeout(o);const a=this.pendingRequests.get(r.seq);if(a){this.pendingRequests.delete(r.seq);const c={type:"response",seq:0,request_seq:r.seq,success:!1,command:e,message:g(3793,"Timeout after {0} ms for '{1}'",n,e)};a(c)}},n)}return i&&this.pendingRequests.set(r.seq,i),r.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 Ao(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 Ao(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 Jst(s){return s.configuration.request==="attach"&&!Xst(s)&&(!s.parentSession||Jst(s.parentSession))}function Xst(s){let e=s.configuration.type;if(e)return e==="vslsShare"&&(e=s.configuration.adapterProxy.configuration.type),ga(e,"extensionhost")||ga(e,"pwa-extensionhost")?s:s.parentSession?Xst(s.parentSession):void 0}function NQt(s){return s.type&&(s.label||s.program||s.runtime)}const PQt=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function FQt(s){return!!(s&&s.match(PQt))}function Zst(s){if(typeof s.path=="string"&&!(typeof s.sourceReference=="number"&&s.sourceReference>0)){if(FQt(s.path))return N.parse(s.path);if(yM(s.path))return N.file(s.path)}return s.path}function ert(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 trt(s,e){const t=e?Zst:ert,i=Ds(s);return nrt(i,(n,r)=>{n&&r&&(r.path=t(r))}),i}function irt(s,e){const t=e?Zst:ert,i=Ds(s);return nrt(i,(n,r)=>{!n&&r&&(r.path=t(r))}),i}function nrt(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 Yze=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(Je.ExtHostDebugService);const n=new mr;this._toDispose.add(n),this._toDispose.add(t.onDidNewSession(o=>{this._proxy.$acceptDebugSessionStarted(this.getSessionDto(o)),n.get(o).add(o.onDidChangeName(c=>{this._proxy.$acceptDebugSessionNameChanged(this.getSessionDto(o),c)}))})),this._toDispose.add(t.onWillNewSession(o=>{let a=n.get(o);a||(a=new Z,n.set(o,a)),a.add(o.onDidCustomEvent(c=>this._proxy.$acceptDebugSessionCustomEvent(this.getSessionDto(o),c)))})),this._toDispose.add(t.onDidEndSession(({session:o,restart:a})=>{this._proxy.$acceptDebugSessionTerminated(this.getSessionDto(o)),this._extHostKnownSessions.delete(o.getId()),a||n.deleteAndDispose(o);for(const[c,l]of this._debugAdapters)l.session===o&&this._debugAdapters.delete(c)})),this._toDispose.add(t.getViewModel().onDidFocusSession(o=>{this._proxy.$acceptDebugSessionActiveChanged(this.getSessionDto(o))})),this._toDispose.add(Ee(()=>{for(const[o,a]of this._debugAdapters)a.fireError(o,new Error("Extension host shut down"))})),this._debugAdapters=new Map,this._debugConfigurationProviders=new Map,this._debugAdapterDescriptorFactories=new Map,this._extHostKnownSessions=new Set;const r=this.debugService.getViewModel();this._toDispose.add(M.any(r.onDidFocusStackFrame,r.onDidFocusThread)(()=>{const o=r.focusedStackFrame,a=r.focusedThread;o?this._proxy.$acceptStackFrameFocus({kind:"stackFrame",threadId:o.thread.threadId,frameId:o.frameId,sessionId:o.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 An(e),id:t,disposeDebugVisualizers:n=>this._proxy.$disposeDebugVisualizers(n),executeDebugVisualizerCommand:n=>this._proxy.$executeDebugVisualizerCommand(n),provideDebugVisualizers:(n,r)=>this._proxy.$provideDebugVisualizers(e,t,n,r).then(o=>o.map(gAe.deserialize)),resolveDebugVisualizer:(n,r)=>this._proxy.$resolveDebugVisualizer(n.id,r)});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 r={};n.added&&(r.added=this.convertToDto(n.added)),n.removed&&(r.removed=n.removed.map(o=>o.getId())),n.changed&&(r.changed=this.convertToDto(n.changed)),(r.added||r.removed||r.changed)&&this._proxy.$acceptBreakpointsDelta(r)}}));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 OQt(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:uee.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,r,o){const a={type:e,triggerKind:t};return i&&(a.provideDebugConfigurations=(c,l)=>this._proxy.$provideDebugConfigurations(o,c,l)),n&&(a.resolveDebugConfiguration=(c,l,d)=>this._proxy.$resolveDebugConfiguration(o,c,l,d)),r&&(a.resolveDebugConfigurationWithSubstitutedVariables=(c,l,d)=>this._proxy.$resolveDebugConfigurationWithSubstitutedVariables(o,c,l,d)),this._debugConfigurationProviders.set(o,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,r=this.debugService.getConfigurationManager().getLaunch(n),o=this.getSession(i.parentSessionID),a=typeof i.suppressSaveBeforeStart=="boolean"?!i.suppressSaveBeforeStart:void 0,c={noDebug:i.noDebug,parentSession:o,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.repl,compact:i.compact,compoundRoot:o?.compoundRoot,saveBeforeRestart:a,testRun:i.testRun,suppressDebugStatusbar:i.suppressDebugStatusbar,suppressDebugToolbar:i.suppressDebugToolbar,suppressDebugView:i.suppressDebugView};try{return this.debugService.startDebugging(r,t,c,a)}catch(l){throw new Ra(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(r=>r&&r.success?r.body:Promise.reject(new Ra(r?r.message:"custom request failed"))):Promise.reject(new Ra("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 Ra("debug session not found"))}$stopDebugging(e){if(e){const t=this.debugService.getModel().getSession(e,!0);if(t)return this.debugService.stopSession(t,Jst(t))}else return this.debugService.stopSession(void 0);return Promise.reject(new Ra("debug session not found"))}$appendDebugConsole(e){this.debugService.getViewModel().focusedSession?.appendToRepl({output:e,sev:Ze.Warning})}$acceptDAMessage(e,t){this.getDebugAdapter(e).acceptMessage(irt(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===uee.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(Oc)}};Yze=D([Ki(We.MainThreadDebugService),_(1,EMe),_(2,XXe)],Yze);class OQt extends Yst{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,trt(e,!0))}async stopSession(){return await this.cancelPendingRequests(),Promise.resolve(this._proxy.$stopDASession(this._handle))}}class BQt{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(o=>{this._requests.set(i,{id:i,uri:e}),this._resolver.set(i,o),this._processQueue()}),r=t.onCancellationRequested(()=>{this._requests.delete(i),this._resolver.delete(i)});return n.finally(()=>r.dispose())}_processQueue(){typeof this._timer!="number"&&(this._timer=setTimeout(()=>{const e=this._requests,t=this._resolver;this._proxy.$provideDecorations(this._handle,[...e.values()],Ue.None).then(i=>{for(const[n,r]of t)r(i[n])}),this._requests=new Map,this._resolver=new Map,this._timer=void 0},0))}}let Jze=class{constructor(e,t){this._decorationsService=t,this._provider=new Map,this._proxy=e.getProxy(Je.ExtHostDecorations)}dispose(){this._provider.forEach(e=>wt(e)),this._provider.clear()}$registerDecorationProvider(e,t){const i=new I,n=new BQt(this._proxy,e),r=this._decorationsService.registerDecorationsProvider({label:t,onDidChange:i.event,provideDecorations:async(o,a)=>{const c=await n.enqueue(o,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,r])}$onDidChange(e,t){const i=this._provider.get(e);if(i){const[n]=i;n.fire(t&&t.map(r=>N.revive(r)))}}$unregisterDecorationProvider(e){const t=this._provider.get(e);t&&(wt(t),this._provider.delete(e))}};Jze=D([Ki(We.MainThreadDecorations),_(1,aE)],Jze);let Xze=class{constructor(e,t,i){this._markerService=t,this._uriIdentService=i,this._activeOwners=new Set,this._proxy=e.getProxy(Je.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 r=n.filter(o=>!this._activeOwners.has(o.owner));r.length>0&&t.push([i,r])}}t.length>0&&this._proxy.$acceptMarkersChange(t)}$changeMany(e,t){for(const i of t){const[n,r]=i;if(r)for(const o of r){if(o.relatedInformation)for(const a of o.relatedInformation)a.resource=N.revive(a.resource);o.code&&typeof o.code!="string"&&(o.code.target=N.revive(o.code.target))}this._markerService.changeOne(e,this._uriIdentService.asCanonicalUri(N.revive(n)),r)}this._activeOwners.add(e)}$clear(e){this._markerService.changeAll(e,[]),this._activeOwners.delete(e)}};Xze=D([Ki(We.MainThreadDiagnostics),_(1,Dm),_(2,Is)],Xze);var mj;let Zze=mj=class{constructor(e,t){this._fileDialogService=t}dispose(){}async $showOpenDialog(e){const t=mj._convertOpenOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showOpenDialog(t))}async $showSaveDialog(e){const t=mj._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}};Zze=mj=D([Ki(We.MainThreadDialogs),_(1,dg)],Zze);let e8e=class{constructor(e,t,i,n,r){this._textModelResolverService=t,this._languageService=i,this._modelService=n,this._editorWorkerService=r,this._resourceContentProvider=new mr,this._pendingUpdate=new Map,this._proxy=e.getProxy(Je.ExtHostDocumentContentProviders)}dispose(){this._resourceContentProvider.dispose(),wt(this._pendingUpdate.values())}$registerTextContentProvider(e,t){const i=this._textModelResolverService.registerTextModelContentProvider(t,{provideTextContent:n=>this._proxy.$provideTextDocumentContent(e,n).then(r=>{if(typeof r=="string"){const o=r.substr(0,1+r.search(/\r?\n/)),a=this._languageService.createByFilepathOrFirstLine(n,o);return this._modelService.createModel(r,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 r=new li;this._pendingUpdate.set(i.id,r);try{const o=await this._editorWorkerService.computeMoreMinimalEdits(i.uri,[{text:t,range:i.getFullModelRange()}]);if(this._pendingUpdate.delete(i.id),r.token.isCancellationRequested)return;o&&o.length>0&&i.applyEdits(o.map(a=>es.replace(F.lift(a.range),a.text)))}catch(o){bt(o)}}};e8e=D([Ki(We.MainThreadDocumentContentProviders),_(1,pn),_(2,Di),_(3,fi),_(4,Pl)],e8e);class srt{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=wt(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(o);a>=0&&(this._length-=i,t.dispose(),clearTimeout(r),this._data.splice(a,1))},r=setTimeout(n,this._maxAge),o={uri:e,length:i,dispose:n};this._data.push(o),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&&wt(this._data.slice(0,e-this._maxSize))}}class WQt 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(r=>{this._knownVersionId=r.versionId,this._proxy.$acceptModelChanged(this._model.uri,r,this._textFileService.isDirty(this._model.uri)),this.isCaughtUpWithContentChanges()&&this._onIsCaughtUpWithContentChanges.fire(this._model.uri)}))}isCaughtUpWithContentChanges(){return this._model.getVersionId()===this._knownVersionId}}let TEe=class extends V{constructor(e,t,i,n,r,o,a,c,l){super(),this._modelService=t,this._textFileService=i,this._fileService=n,this._textModelResolverService=r,this._environmentService=o,this._uriIdentityService=a,this._pathService=l,this._onIsCaughtUpWithContentChanges=this._store.add(new I),this.onIsCaughtUpWithContentChanges=this._onIsCaughtUpWithContentChanges.event,this._modelTrackers=new gi,this._modelReferenceCollection=this._store.add(new srt(a.extUri)),this._proxy=e.getProxy(Je.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===Ei.MOVE;if(h||d.operation===Ei.DELETE)for(const u of d.files){const f=h?u.source:u.target;f&&this._modelReferenceCollection.remove(f)}}))}dispose(){wt(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&&Py(t)}handleModelAdded(e){Py(e)&&this._modelTrackers.set(e.uri,new WQt(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 Ra("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 r;try{r=await n}catch(o){throw new Ra(`cannot open ${i.toString()}. Detail: ${Po(o)}`)}if(r)if(Dn.isEqual(r,i)){if(this._modelTrackers.has(i))return i;throw new Ra(`cannot open ${i.toString()}. Detail: Files above 50MB cannot be synchronized with extensions.`)}else throw new Ra(`cannot open ${i.toString()}. Detail: Actual document opened as ${r.toString()}`);else throw new Ra(`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=N8(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}),r=n.resource,o=await this._textModelResolverService.createModelReference(r);if(!this._modelTrackers.has(r))throw o.dispose(),new Error(`expected URI ${r.toString()} to have come to LIFE`);return this._modelReferenceCollection.add(r,o,o.object.textEditorModel.getValueLength()),M.once(n.onDidRevert)(()=>this._modelReferenceCollection.remove(r)),this._proxy.$acceptDirtyStateChanged(r,!0),r}};TEe=D([_(1,fi),_(2,Fr),_(3,Xt),_(4,pn),_(5,Xo),_(6,Is),_(7,qb),_(8,Cf)],TEe);class Bw{static readFromEditor(e,t,i){const n=Bw._readSelectionsFromCodeEditor(e,i),r=Bw._readOptionsFromCodeEditor(e,t,i),o=Bw._readVisibleRangesFromCodeEditor(e,i);return new Bw(n,r,o)}static _readSelectionsFromCodeEditor(e,t){let i=null;return t&&(i=t.getSelections()),!i&&e&&(i=e.selections),i||(i=[new ht(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,r;if(i){const a=i.getOptions(),c=a.get(x.lineNumbers);n=a.get(x.cursorStyle),r=c.renderType}else e?(n=e.options.cursorStyle,r=e.options.lineNumbers):(n=Qo.Line,r=yo.On);const o=t.getOptions();return{insertSpaces:o.insertSpaces,tabSize:o.tabSize,indentSize:o.indentSize,originalIndentSize:o.originalIndentSize,cursorStyle:n,lineNumbers:r}}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||!Bw._selectionsEqual(e.selections,this.selections))&&(i.selections={selections:this.selections,source:t??void 0}),(!e||!Bw._optionsEqual(e.options,this.options))&&(i.options=this.options),(!e||!Bw._rangesEqual(e.visibleRanges,this.visibleRanges))&&(i.visibleRanges=this.visibleRanges),i.selections||i.options||i.visibleRanges?i:null}static _selectionsEqual(e,t){return ns(e,t,(i,n)=>i.equalsSelection(n))}static _rangesEqual(e,t){return ns(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 HQt{constructor(e,t,i,n,r,o,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=r,this._modelService=o,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(Bw.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(r=>{if(r.toString()===this._model.uri.toString()){const o=t;t=null,this._updatePropertiesNow(o)}}));const i=()=>this._codeEditor&&this._codeEditor.getModel()===this._model,n=r=>{this._mainThreadDocuments.isCaughtUpWithContentChanges(this._model.uri)?(t=null,this._updatePropertiesNow(r)):t=r};this._codeEditorListeners.add(this._codeEditor.onDidChangeCursorSelection(r=>{i()&&n(r.source)})),this._codeEditorListeners.add(this._codeEditor.onDidChangeConfiguration(r=>{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(ht.liftSelection);this._setProperties(new Bw(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,r=t.tabSize;e.insertSpaces!=="auto"&&typeof e.insertSpaces<"u"&&(n=e.insertSpaces),e.tabSize!=="auto"&&typeof e.tabSize<"u"&&(r=e.tabSize),this._model.detectIndentation(n,r);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=dlt(e.cursorStyle);this._codeEditor.updateOptions({cursorStyle:t})}if(typeof e.lineNumbers<"u"){let t;switch(e.lineNumbers){case yo.On:t="on";break;case yo.Relative:t="relative";break;case yo.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,r=Math.floor(t.length/4);n({range:F.lift(r.range),text:r.text,forceMoveMarkers:r.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 r;if(tv.guessNeedsClipboard(t)){const l=new Yae(this._codeEditor,jr.Value|jr.Position);if(r=await this._clipboardService.readText(),!l.validate(this._codeEditor))return!1}if(this._codeEditor.getModel().getVersionId()!==e)return!1;const a=pc.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:r}),!0}}var LEe,jR;let REe=(jR=class{constructor(e,t,i,n,r,o){this._editorLocator=e,this._codeEditorService=i,this._editorService=n,this._editorGroupService=r,this._configurationService=o,this._toDispose=new Z,this._instanceId=String(++LEe.INSTANCE_COUNT),this._proxy=t.getProxy(Je.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=>{wt(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){wt(this._textEditorsListenersMap[e]),delete this._textEditorsListenersMap[e]}_updateActiveAndVisibleTextEditors(){const e=this._getTextEditorPositionData();Js(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]=uI(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?Jk.RESTORE:void 0,override:O_e.EXCLUSIVE_ONLY},r={resource:i,options:n},o=await this._editorService.openEditor(r,GZ(this._editorGroupService,this._configurationService,t.position));if(!o)return;const a=o.getControl(),c=m6(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}},GZ(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(Fi(`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(Fi(`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(Fi(`TextEditor(${e})`))}$tryRevealRange(e,t,i){const n=this._editorLocator.getEditor(e);return n?(n.revealRange(t,i),Promise.resolve()):Promise.reject(Fi(`TextEditor(${e})`))}$trySetOptions(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setConfiguration(t),Promise.resolve(void 0)):Promise.reject(Fi(`TextEditor(${e})`))}$tryApplyEdits(e,t,i,n){const r=this._editorLocator.getEditor(e);return r?Promise.resolve(r.applyEdits(t,i,n)):Promise.reject(Fi(`TextEditor(${e})`))}$tryInsertSnippet(e,t,i,n,r){const o=this._editorLocator.getEditor(e);return o?Promise.resolve(o.insertSnippet(t,i,n,r)):Promise.reject(Fi(`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(),r=this._codeEditorService.listDiffEditors(),[o]=r.filter(c=>c.getOriginalEditor().getId()===n||c.getModifiedEditor().getId()===n);if(o)return Promise.resolve(o.getLineChanges()||[]);const a=i.getContribution("editor.contrib.dirtydiff");return a?Promise.resolve(a.getChanges()):Promise.resolve([])}},LEe=jR,jR.INSTANCE_COUNT=0,jR);REe=LEe=D([_(2,qt),_(3,ti),_(4,Pr),_(5,Te)],REe);vt.registerCommand("_workbench.revertAllDirty",async function(s){if(!s.get(ec).extensionTestsLocationURI)throw new Error("Command is only available when running extension tests.");const t=s.get(Pm);for(const i of t.dirtyWorkingCopies)await i.revert({soft:!0})});let t8e=class{};class UQt{static[Symbol.hasInstance](e){return t8e!=null&&e instanceof t8e}}class VQt{constructor(e){this.editor=e,this.id=`${e.getId()},${e.getModel().id}`}}class MEe{constructor(e,t,i,n,r,o){this.removedDocuments=e,this.addedDocuments=t,this.removedEditors=i,this.addedEditors=n,this.oldActiveEditor=r,this.newActiveEditor=o,this.isEmpty=this.removedDocuments.length===0&&this.addedDocuments.length===0&&this.removedEditors.length===0&&this.addedEditors.length===0&&r===o}toString(){let e=`DocumentAndEditorStateDelta +`);return e===-1?s:s.substring(0,e)}function LQt(s,e){const{args:t,stack:i}=NPe(s),n=typeof t[0]=="string"&&t.length===1;let r=TQt(i);r&&(r=`(${r.trim()})`);let o=[];if(typeof t[0]=="string"?r&&n?o=[`%c[${e}] %c${t[0]} %c${r}`,xP("blue"),xP(""),xP("grey")]:o=[`%c[${e}] %c${t[0]}`,xP("blue"),xP(""),...t.slice(1)]:o=[`%c[${e}]%`,xP("blue"),...t],r&&!n&&o.push(r),typeof console[s.severity]!="function")throw new Error("Unknown console method");console[s.severity].apply(console,o)}function xP(s){return`color: ${s}`}function RQt(s,e,t=null){const i=NPe(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 MQt(s,e,t){const i=NPe(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 jze=class{constructor(e,t,i){this._environmentService=t,this._logService=i;const n=lPe(this._environmentService);this._isExtensionDevTestFromCli=n.isExtensionDevTestFromCli}dispose(){}$logExtensionHostMessage(e){this._isExtensionDevTestFromCli?RQt(this._logService,e):(MQt(this._logService,e,"Extension Host"),LQt(e,"Extension Host"))}};jze=D([Ki(We.MainThreadConsole),_(1,ec),_(2,Ke)],jze);class Yst{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 r={command:e};if(t&&Object.keys(t).length>0&&(r.arguments=t),this.internalSend("request",r),typeof n=="number"){const o=setTimeout(()=>{clearTimeout(o);const a=this.pendingRequests.get(r.seq);if(a){this.pendingRequests.delete(r.seq);const c={type:"response",seq:0,request_seq:r.seq,success:!1,command:e,message:g(3793,"Timeout after {0} ms for '{1}'",n,e)};a(c)}},n)}return i&&this.pendingRequests.set(r.seq,i),r.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 Ao(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 Ao(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 Jst(s){return s.configuration.request==="attach"&&!Xst(s)&&(!s.parentSession||Jst(s.parentSession))}function Xst(s){let e=s.configuration.type;if(e)return e==="vslsShare"&&(e=s.configuration.adapterProxy.configuration.type),ga(e,"extensionhost")||ga(e,"pwa-extensionhost")?s:s.parentSession?Xst(s.parentSession):void 0}function NQt(s){return s.type&&(s.label||s.program||s.runtime)}const PQt=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function FQt(s){return!!(s&&s.match(PQt))}function Zst(s){if(typeof s.path=="string"&&!(typeof s.sourceReference=="number"&&s.sourceReference>0)){if(FQt(s.path))return N.parse(s.path);if(yM(s.path))return N.file(s.path)}return s.path}function ert(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 trt(s,e){const t=e?Zst:ert,i=Ds(s);return nrt(i,(n,r)=>{n&&r&&(r.path=t(r))}),i}function irt(s,e){const t=e?Zst:ert,i=Ds(s);return nrt(i,(n,r)=>{!n&&r&&(r.path=t(r))}),i}function nrt(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 Yze=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(Je.ExtHostDebugService);const n=new mr;this._toDispose.add(n),this._toDispose.add(t.onDidNewSession(o=>{this._proxy.$acceptDebugSessionStarted(this.getSessionDto(o)),n.get(o).add(o.onDidChangeName(c=>{this._proxy.$acceptDebugSessionNameChanged(this.getSessionDto(o),c)}))})),this._toDispose.add(t.onWillNewSession(o=>{let a=n.get(o);a||(a=new Z,n.set(o,a)),a.add(o.onDidCustomEvent(c=>this._proxy.$acceptDebugSessionCustomEvent(this.getSessionDto(o),c)))})),this._toDispose.add(t.onDidEndSession(({session:o,restart:a})=>{this._proxy.$acceptDebugSessionTerminated(this.getSessionDto(o)),this._extHostKnownSessions.delete(o.getId()),a||n.deleteAndDispose(o);for(const[c,l]of this._debugAdapters)l.session===o&&this._debugAdapters.delete(c)})),this._toDispose.add(t.getViewModel().onDidFocusSession(o=>{this._proxy.$acceptDebugSessionActiveChanged(this.getSessionDto(o))})),this._toDispose.add(Ee(()=>{for(const[o,a]of this._debugAdapters)a.fireError(o,new Error("Extension host shut down"))})),this._debugAdapters=new Map,this._debugConfigurationProviders=new Map,this._debugAdapterDescriptorFactories=new Map,this._extHostKnownSessions=new Set;const r=this.debugService.getViewModel();this._toDispose.add(M.any(r.onDidFocusStackFrame,r.onDidFocusThread)(()=>{const o=r.focusedStackFrame,a=r.focusedThread;o?this._proxy.$acceptStackFrameFocus({kind:"stackFrame",threadId:o.thread.threadId,frameId:o.frameId,sessionId:o.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 An(e),id:t,disposeDebugVisualizers:n=>this._proxy.$disposeDebugVisualizers(n),executeDebugVisualizerCommand:n=>this._proxy.$executeDebugVisualizerCommand(n),provideDebugVisualizers:(n,r)=>this._proxy.$provideDebugVisualizers(e,t,n,r).then(o=>o.map(gAe.deserialize)),resolveDebugVisualizer:(n,r)=>this._proxy.$resolveDebugVisualizer(n.id,r)});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 r={};n.added&&(r.added=this.convertToDto(n.added)),n.removed&&(r.removed=n.removed.map(o=>o.getId())),n.changed&&(r.changed=this.convertToDto(n.changed)),(r.added||r.removed||r.changed)&&this._proxy.$acceptBreakpointsDelta(r)}}));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 OQt(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:uee.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,r,o){const a={type:e,triggerKind:t};return i&&(a.provideDebugConfigurations=(c,l)=>this._proxy.$provideDebugConfigurations(o,c,l)),n&&(a.resolveDebugConfiguration=(c,l,d)=>this._proxy.$resolveDebugConfiguration(o,c,l,d)),r&&(a.resolveDebugConfigurationWithSubstitutedVariables=(c,l,d)=>this._proxy.$resolveDebugConfigurationWithSubstitutedVariables(o,c,l,d)),this._debugConfigurationProviders.set(o,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,r=this.debugService.getConfigurationManager().getLaunch(n),o=this.getSession(i.parentSessionID),a=typeof i.suppressSaveBeforeStart=="boolean"?!i.suppressSaveBeforeStart:void 0,c={noDebug:i.noDebug,parentSession:o,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.repl,compact:i.compact,compoundRoot:o?.compoundRoot,saveBeforeRestart:a,testRun:i.testRun,suppressDebugStatusbar:i.suppressDebugStatusbar,suppressDebugToolbar:i.suppressDebugToolbar,suppressDebugView:i.suppressDebugView};try{return this.debugService.startDebugging(r,t,c,a)}catch(l){throw new Ma(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(r=>r&&r.success?r.body:Promise.reject(new Ma(r?r.message:"custom request failed"))):Promise.reject(new Ma("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 Ma("debug session not found"))}$stopDebugging(e){if(e){const t=this.debugService.getModel().getSession(e,!0);if(t)return this.debugService.stopSession(t,Jst(t))}else return this.debugService.stopSession(void 0);return Promise.reject(new Ma("debug session not found"))}$appendDebugConsole(e){this.debugService.getViewModel().focusedSession?.appendToRepl({output:e,sev:Ze.Warning})}$acceptDAMessage(e,t){this.getDebugAdapter(e).acceptMessage(irt(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===uee.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(Oc)}};Yze=D([Ki(We.MainThreadDebugService),_(1,EMe),_(2,XXe)],Yze);class OQt extends Yst{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,trt(e,!0))}async stopSession(){return await this.cancelPendingRequests(),Promise.resolve(this._proxy.$stopDASession(this._handle))}}class BQt{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(o=>{this._requests.set(i,{id:i,uri:e}),this._resolver.set(i,o),this._processQueue()}),r=t.onCancellationRequested(()=>{this._requests.delete(i),this._resolver.delete(i)});return n.finally(()=>r.dispose())}_processQueue(){typeof this._timer!="number"&&(this._timer=setTimeout(()=>{const e=this._requests,t=this._resolver;this._proxy.$provideDecorations(this._handle,[...e.values()],Ue.None).then(i=>{for(const[n,r]of t)r(i[n])}),this._requests=new Map,this._resolver=new Map,this._timer=void 0},0))}}let Jze=class{constructor(e,t){this._decorationsService=t,this._provider=new Map,this._proxy=e.getProxy(Je.ExtHostDecorations)}dispose(){this._provider.forEach(e=>wt(e)),this._provider.clear()}$registerDecorationProvider(e,t){const i=new I,n=new BQt(this._proxy,e),r=this._decorationsService.registerDecorationsProvider({label:t,onDidChange:i.event,provideDecorations:async(o,a)=>{const c=await n.enqueue(o,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,r])}$onDidChange(e,t){const i=this._provider.get(e);if(i){const[n]=i;n.fire(t&&t.map(r=>N.revive(r)))}}$unregisterDecorationProvider(e){const t=this._provider.get(e);t&&(wt(t),this._provider.delete(e))}};Jze=D([Ki(We.MainThreadDecorations),_(1,aE)],Jze);let Xze=class{constructor(e,t,i){this._markerService=t,this._uriIdentService=i,this._activeOwners=new Set,this._proxy=e.getProxy(Je.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 r=n.filter(o=>!this._activeOwners.has(o.owner));r.length>0&&t.push([i,r])}}t.length>0&&this._proxy.$acceptMarkersChange(t)}$changeMany(e,t){for(const i of t){const[n,r]=i;if(r)for(const o of r){if(o.relatedInformation)for(const a of o.relatedInformation)a.resource=N.revive(a.resource);o.code&&typeof o.code!="string"&&(o.code.target=N.revive(o.code.target))}this._markerService.changeOne(e,this._uriIdentService.asCanonicalUri(N.revive(n)),r)}this._activeOwners.add(e)}$clear(e){this._markerService.changeAll(e,[]),this._activeOwners.delete(e)}};Xze=D([Ki(We.MainThreadDiagnostics),_(1,Dm),_(2,Is)],Xze);var mj;let Zze=mj=class{constructor(e,t){this._fileDialogService=t}dispose(){}async $showOpenDialog(e){const t=mj._convertOpenOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showOpenDialog(t))}async $showSaveDialog(e){const t=mj._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}};Zze=mj=D([Ki(We.MainThreadDialogs),_(1,dg)],Zze);let e8e=class{constructor(e,t,i,n,r){this._textModelResolverService=t,this._languageService=i,this._modelService=n,this._editorWorkerService=r,this._resourceContentProvider=new mr,this._pendingUpdate=new Map,this._proxy=e.getProxy(Je.ExtHostDocumentContentProviders)}dispose(){this._resourceContentProvider.dispose(),wt(this._pendingUpdate.values())}$registerTextContentProvider(e,t){const i=this._textModelResolverService.registerTextModelContentProvider(t,{provideTextContent:n=>this._proxy.$provideTextDocumentContent(e,n).then(r=>{if(typeof r=="string"){const o=r.substr(0,1+r.search(/\r?\n/)),a=this._languageService.createByFilepathOrFirstLine(n,o);return this._modelService.createModel(r,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 r=new li;this._pendingUpdate.set(i.id,r);try{const o=await this._editorWorkerService.computeMoreMinimalEdits(i.uri,[{text:t,range:i.getFullModelRange()}]);if(this._pendingUpdate.delete(i.id),r.token.isCancellationRequested)return;o&&o.length>0&&i.applyEdits(o.map(a=>es.replace(F.lift(a.range),a.text)))}catch(o){bt(o)}}};e8e=D([Ki(We.MainThreadDocumentContentProviders),_(1,pn),_(2,Di),_(3,fi),_(4,Fl)],e8e);class srt{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=wt(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(o);a>=0&&(this._length-=i,t.dispose(),clearTimeout(r),this._data.splice(a,1))},r=setTimeout(n,this._maxAge),o={uri:e,length:i,dispose:n};this._data.push(o),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&&wt(this._data.slice(0,e-this._maxSize))}}class WQt 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(r=>{this._knownVersionId=r.versionId,this._proxy.$acceptModelChanged(this._model.uri,r,this._textFileService.isDirty(this._model.uri)),this.isCaughtUpWithContentChanges()&&this._onIsCaughtUpWithContentChanges.fire(this._model.uri)}))}isCaughtUpWithContentChanges(){return this._model.getVersionId()===this._knownVersionId}}let TEe=class extends V{constructor(e,t,i,n,r,o,a,c,l){super(),this._modelService=t,this._textFileService=i,this._fileService=n,this._textModelResolverService=r,this._environmentService=o,this._uriIdentityService=a,this._pathService=l,this._onIsCaughtUpWithContentChanges=this._store.add(new I),this.onIsCaughtUpWithContentChanges=this._onIsCaughtUpWithContentChanges.event,this._modelTrackers=new gi,this._modelReferenceCollection=this._store.add(new srt(a.extUri)),this._proxy=e.getProxy(Je.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===Ei.MOVE;if(h||d.operation===Ei.DELETE)for(const u of d.files){const f=h?u.source:u.target;f&&this._modelReferenceCollection.remove(f)}}))}dispose(){wt(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&&Py(t)}handleModelAdded(e){Py(e)&&this._modelTrackers.set(e.uri,new WQt(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 Ma("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 r;try{r=await n}catch(o){throw new Ma(`cannot open ${i.toString()}. Detail: ${Po(o)}`)}if(r)if(Dn.isEqual(r,i)){if(this._modelTrackers.has(i))return i;throw new Ma(`cannot open ${i.toString()}. Detail: Files above 50MB cannot be synchronized with extensions.`)}else throw new Ma(`cannot open ${i.toString()}. Detail: Actual document opened as ${r.toString()}`);else throw new Ma(`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=N8(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}),r=n.resource,o=await this._textModelResolverService.createModelReference(r);if(!this._modelTrackers.has(r))throw o.dispose(),new Error(`expected URI ${r.toString()} to have come to LIFE`);return this._modelReferenceCollection.add(r,o,o.object.textEditorModel.getValueLength()),M.once(n.onDidRevert)(()=>this._modelReferenceCollection.remove(r)),this._proxy.$acceptDirtyStateChanged(r,!0),r}};TEe=D([_(1,fi),_(2,Fr),_(3,Xt),_(4,pn),_(5,Xo),_(6,Is),_(7,qb),_(8,Cf)],TEe);class Bw{static readFromEditor(e,t,i){const n=Bw._readSelectionsFromCodeEditor(e,i),r=Bw._readOptionsFromCodeEditor(e,t,i),o=Bw._readVisibleRangesFromCodeEditor(e,i);return new Bw(n,r,o)}static _readSelectionsFromCodeEditor(e,t){let i=null;return t&&(i=t.getSelections()),!i&&e&&(i=e.selections),i||(i=[new ht(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,r;if(i){const a=i.getOptions(),c=a.get(x.lineNumbers);n=a.get(x.cursorStyle),r=c.renderType}else e?(n=e.options.cursorStyle,r=e.options.lineNumbers):(n=Qo.Line,r=yo.On);const o=t.getOptions();return{insertSpaces:o.insertSpaces,tabSize:o.tabSize,indentSize:o.indentSize,originalIndentSize:o.originalIndentSize,cursorStyle:n,lineNumbers:r}}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||!Bw._selectionsEqual(e.selections,this.selections))&&(i.selections={selections:this.selections,source:t??void 0}),(!e||!Bw._optionsEqual(e.options,this.options))&&(i.options=this.options),(!e||!Bw._rangesEqual(e.visibleRanges,this.visibleRanges))&&(i.visibleRanges=this.visibleRanges),i.selections||i.options||i.visibleRanges?i:null}static _selectionsEqual(e,t){return ns(e,t,(i,n)=>i.equalsSelection(n))}static _rangesEqual(e,t){return ns(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 HQt{constructor(e,t,i,n,r,o,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=r,this._modelService=o,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(Bw.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(r=>{if(r.toString()===this._model.uri.toString()){const o=t;t=null,this._updatePropertiesNow(o)}}));const i=()=>this._codeEditor&&this._codeEditor.getModel()===this._model,n=r=>{this._mainThreadDocuments.isCaughtUpWithContentChanges(this._model.uri)?(t=null,this._updatePropertiesNow(r)):t=r};this._codeEditorListeners.add(this._codeEditor.onDidChangeCursorSelection(r=>{i()&&n(r.source)})),this._codeEditorListeners.add(this._codeEditor.onDidChangeConfiguration(r=>{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(ht.liftSelection);this._setProperties(new Bw(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,r=t.tabSize;e.insertSpaces!=="auto"&&typeof e.insertSpaces<"u"&&(n=e.insertSpaces),e.tabSize!=="auto"&&typeof e.tabSize<"u"&&(r=e.tabSize),this._model.detectIndentation(n,r);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=dlt(e.cursorStyle);this._codeEditor.updateOptions({cursorStyle:t})}if(typeof e.lineNumbers<"u"){let t;switch(e.lineNumbers){case yo.On:t="on";break;case yo.Relative:t="relative";break;case yo.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,r=Math.floor(t.length/4);n({range:F.lift(r.range),text:r.text,forceMoveMarkers:r.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 r;if(tv.guessNeedsClipboard(t)){const l=new Yae(this._codeEditor,jr.Value|jr.Position);if(r=await this._clipboardService.readText(),!l.validate(this._codeEditor))return!1}if(this._codeEditor.getModel().getVersionId()!==e)return!1;const a=pc.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:r}),!0}}var LEe,jR;let REe=(jR=class{constructor(e,t,i,n,r,o){this._editorLocator=e,this._codeEditorService=i,this._editorService=n,this._editorGroupService=r,this._configurationService=o,this._toDispose=new Z,this._instanceId=String(++LEe.INSTANCE_COUNT),this._proxy=t.getProxy(Je.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=>{wt(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){wt(this._textEditorsListenersMap[e]),delete this._textEditorsListenersMap[e]}_updateActiveAndVisibleTextEditors(){const e=this._getTextEditorPositionData();Js(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]=uI(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?Jk.RESTORE:void 0,override:O_e.EXCLUSIVE_ONLY},r={resource:i,options:n},o=await this._editorService.openEditor(r,GZ(this._editorGroupService,this._configurationService,t.position));if(!o)return;const a=o.getControl(),c=m6(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}},GZ(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(Fi(`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(Fi(`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(Fi(`TextEditor(${e})`))}$tryRevealRange(e,t,i){const n=this._editorLocator.getEditor(e);return n?(n.revealRange(t,i),Promise.resolve()):Promise.reject(Fi(`TextEditor(${e})`))}$trySetOptions(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setConfiguration(t),Promise.resolve(void 0)):Promise.reject(Fi(`TextEditor(${e})`))}$tryApplyEdits(e,t,i,n){const r=this._editorLocator.getEditor(e);return r?Promise.resolve(r.applyEdits(t,i,n)):Promise.reject(Fi(`TextEditor(${e})`))}$tryInsertSnippet(e,t,i,n,r){const o=this._editorLocator.getEditor(e);return o?Promise.resolve(o.insertSnippet(t,i,n,r)):Promise.reject(Fi(`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(),r=this._codeEditorService.listDiffEditors(),[o]=r.filter(c=>c.getOriginalEditor().getId()===n||c.getModifiedEditor().getId()===n);if(o)return Promise.resolve(o.getLineChanges()||[]);const a=i.getContribution("editor.contrib.dirtydiff");return a?Promise.resolve(a.getChanges()):Promise.resolve([])}},LEe=jR,jR.INSTANCE_COUNT=0,jR);REe=LEe=D([_(2,qt),_(3,ti),_(4,Pr),_(5,Te)],REe);vt.registerCommand("_workbench.revertAllDirty",async function(s){if(!s.get(ec).extensionTestsLocationURI)throw new Error("Command is only available when running extension tests.");const t=s.get(Pm);for(const i of t.dirtyWorkingCopies)await i.revert({soft:!0})});let t8e=class{};class UQt{static[Symbol.hasInstance](e){return t8e!=null&&e instanceof t8e}}class VQt{constructor(e){this.editor=e,this.id=`${e.getId()},${e.getModel().id}`}}class MEe{constructor(e,t,i,n,r,o){this.removedDocuments=e,this.addedDocuments=t,this.removedEditors=i,this.addedEditors=n,this.oldActiveEditor=r,this.newActiveEditor=o,this.isEmpty=this.removedDocuments.length===0&&this.addedDocuments.length===0&&this.removedEditors.length===0&&this.addedEditors.length===0&&r===o}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(", ")}] @@ -920,13 +920,13 @@ ${n}`))}$acceptDAExit(e,t,i){this.getDebugAdapter(e).fireExit(e,t,i)}getDebugAda `)}};FEe=D([_(0,rg),_(1,Te)],FEe);function Pte(s,e){return s.canResolve(e)}let _N=class extends Wu{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=Mo(e=>this._webviewWorkbenchService.resolveWebview(this,e));try{await this._resolvePromise}catch(e){if(!Oo(e))throw e}}return super.resolve()}transfer(e){if(super.transfer(e))return e._resolved=this._resolved,e}};_N.__decorator=D([ei],_N.prototype,"resolve",null);_N=D([_(2,K6)],_N);class qQt{constructor(){this._awaitingRevival=[]}enqueueForRestoration(e,t){const i=new hc,n=()=>{const o=this._awaitingRevival.findIndex(a=>e===a.input);o>=0&&this._awaitingRevival.splice(o,1)},r=Yo(e.webview.onDidDispose(n),t.onCancellationRequested(()=>{n(),i.cancel()}));return this._awaitingRevival.push({input:e,promise:i,disposable:r}),i.p}reviveFor(e,t){const i=this._awaitingRevival.filter(({input:n})=>Pte(e,n));this._awaitingRevival=this._awaitingRevival.filter(({input:n})=>!Pte(e,n));for(const{input:n,promise:r,disposable:o}of i)e.resolveWebview(n,t).then(a=>r.complete(a),a=>r.error(a)).finally(()=>{o.dispose()})}}let r8e=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 qQt,this._onDidChangeActiveWebviewEditor=this._register(new I),this.onDidChangeActiveWebviewEditor=this._onDidChangeActiveWebviewEditor.event,this._iconManager=this._register(this._instantiationService.createInstance(FEe)),this._register(e.registerContextKeyProvider({contextKey:KQt,getGroupContextKeyValue:r=>this.getWebviewId(r.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 Wu?t=e:e instanceof Yg&&(e.primary instanceof Wu?t=e.primary:e.secondary instanceof Wu&&(t=e.secondary)),t?.webview.providedViewType??""}updateActiveWebview(){const e=this._editorService.activeEditor;let t;e instanceof Wu?t=e:e instanceof Yg&&(e.primary instanceof Wu&&e.primary.webview===this._webviewService.activeWebview?t=e.primary:e.secondary instanceof Wu&&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 r=this._webviewService.createWebviewOverlay(e),o=this._instantiationService.createInstance(Wu,{viewType:t,name:i,providedId:e.providedViewType},r,this.iconManager);return this._editorService.openEditor(o,{pinned:!0,preserveFocus:n.preserveFocus,activation:n.preserveFocus?Jk.RESTORE:void 0},n.group),o}revealWebview(e,t,i){const n=this.findTopLevelEditorForWebview(e);this._editorService.openEditor(n,{preserveFocus:i,activation:i?Jk.RESTORE:void 0},t)}findTopLevelEditorForWebview(e){for(const t of this._editorService.editors)if(t===e||t instanceof Yg&&(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(_N,{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 li;return this._revivalPool.reviveFor(e,t.token),Ee(()=>{this._revivers.delete(e),t.dispose(!0)})}shouldPersist(e){return e instanceof _N?!0:ui.some(this._revivers.values(),t=>Pte(t,e))}async tryRevive(e,t){for(const i of this._revivers.values())if(Pte(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)}};r8e=D([_(0,Pr),_(1,ti),_(2,we),_(3,gce)],r8e);var jP,XR;let hB=(XR=class extends _N{static create(e,t,i,n,r){return e.invokeFunction(o=>{const a=o.get(J6).getValue(t),c=a?Ge.fromString(a):void 0,l=o.get(gce).createWebviewOverlay({providedViewType:i,title:void 0,options:{customClasses:r?.customClasses},contentOptions:{},extension:void 0}),d=e.createInstance(jP,{resource:t,viewType:i},l,{untitledDocumentData:c,oldResource:r?.oldResource});return typeof n<"u"&&d.updateGroup(n),d})}get resource(){return this._editorResource}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p){super({providedId:e.viewType,viewType:e.viewType,name:""},t,n),this.instantiationService=r,this.labelService=o,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 jP.typeId}get editorId(){return this.viewType}get capabilities(){let e=xi.None;return e|=xi.CanDropIntoEditor,this.customEditorService.getCustomEditorCapabilities(this.viewType)?.supportsMultipleEditorsPerDocument||(e|=xi.Singleton),this._modelRef?this._modelRef.object.isReadonly()&&(e|=xi.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=xi.Readonly),this.resource.scheme===pe.untitled&&(e|=xi.Untitled),e}getName(){return typeof this._editorName!="string"&&(this._editorName=this.customEditorLabelService.getName(this.resource)??Kr(this.labelService.getUriLabel(this.resource))),this._editorName}getDescription(e=Rs.MEDIUM){switch(e){case Rs.SHORT:return this.shortDescription;case Rs.LONG:return this.longDescription;case Rs.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(Ro(this.resource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(Ro(this.resource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(Ro(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 Rs.SHORT:return this.shortTitle;case Rs.LONG:return this.longTitle;default:case Rs.MEDIUM:return this.mediumTitle}}matches(e){return super.matches(e)?!0:this===e||e instanceof jP&&this.viewType===e.viewType&&Yi(this.resource,e.resource)}copy(){return jP.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 Yi(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 DXe(g(9516,"Unable to open the editor in this window, it contains modifications that can only be saved in the original window."),[al({id:"openInOriginalWindow",label:g(9517,"Open in Original Window"),run:async()=>{const n=this.editorGroupsService.getPart(this.layoutService.getContainer(lt(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&<(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}},jP=XR,XR.typeId="workbench.editors.webviewEditor",XR);hB=jP=D([_(3,K6),_(4,we),_(5,Os),_(6,AMe),_(7,dg),_(8,iE),_(9,Xt),_(10,bd),_(11,Pr),_(12,NI),_(13,cE)],hB);var YP,Dk;let OEe=(Dk=class extends Ub{static create(e,t,i,n,r){return e.createInstance(YP,t,i,n,r)}static setName(e,t){t&&(this.windowNames[e.path]=t)}get editorId(){return"interactive"}get typeId(){return YP.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,r,o,a,c,l,d,h){const u=nL.getOrCreate(r,e,void 0,"interactive",{});super(),this._notebookService=l,this._fileDialogService=d,this.isScratchpad=h.getValue(oEe.InteractiveWindowPromptToSave)!==!0,this._notebookEditorInput=u,this._register(this._notebookEditorInput),this.name=i??YP.windowNames[e.path]??Kr(e.path,jy(e.path)),this._initLanguage=n,this._resource=e,this._inputResource=t,this._inputResolver=null,this._editorModelReference=null,this._inputModelRef=null,this._textModelService=o,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?xi.Scratchpad:0;return xi.Untitled|xi.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??Sa;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(xi.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",r=Ft(await this._fileDialogService.defaultFilePath(),n),o=await this._fileDialogService.pickFileToSave(r,t?.availableFileSystems);if(!o)return;const a=await this._editorModelReference.saveAs(o);return a&&"resource"in a&&a.resource&&this._notebookService.getNotebookTextModel(a.resource)?.dispose(),a}matches(e){return super.matches(e)?!0:e instanceof YP?Yi(this.resource,e.resource)&&Yi(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}},YP=Dk,Dk.windowNames={},Dk.ID="workbench.input.interactive",Dk);OEe=YP=D([_(4,we),_(5,pn),_(6,DMe),_(7,tZe),_(8,oE),_(9,dg),_(10,Te)],OEe);const QC=class QC{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 QC(t,i-t)}static fromLineNumbers(e,t){return new QC(e,t-e)}constructor(e,t){if(this.startLineNumber=e,this.lineCount=t,t<0)throw new Pi}join(e){return new QC(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 QC(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,ru);let Xg=QC;const QQt={start:"<<<<<<<",end:">>>>>>>"};function*jQt(s,e,t){const i=new Gy(e);for(const n of s){i.takeWhile(o=>Lk.isGreaterThan(t(n,o)));const r=i.takeWhile(o=>Lk.isNeitherLessOrGreaterThan(t(n,o)));yield{left:n,rights:r||[]}}}function rrt(...s){return[].concat(...s)}let o8e=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){bt(t)}this.hasValue=!0}return this.value}set(e){this.value=e,this.storageService.store(this.key,JSON.stringify(this.value),Ie.PROFILE,cn.USER)}};o8e=D([_(1,Gi)],o8e);class y${constructor(e,t){this.range=e,this.newLines=t}equals(e){return this.range.equals(e.range)&&ns(this.newLines,e.newLines)}toEdits(e){return new JQt([this]).toEdits(e)}}class YQt{constructor(e,t){this.range=e,this.newText=t}equals(e){return F.equalsRange(this.range,e.range)&&this.newText===e.newText}}class JQt{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 XQt(s,e){return!(e.lineNumbers.endLineNumber||e.lineNumber===s.startLineNumber&&e.column=s.endColumn)}function ZQt(s,e){return s.lineNumber===e.lineNumber?new ng(0,e.column-s.column):new ng(e.lineNumber-s.lineNumber,e.column-1)}function ejt(s,e){return e.lineCount===0?new re(s.lineNumber,s.column+e.columnCount):new re(s.lineNumber+e.lineCount,e.columnCount+1)}function a8e(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 Pi;const t=e.startLineNumber-this.inputRange.startLineNumber,i=e.endLineNumberExclusive-this.inputRange.endLineNumberExclusive;return new qu(e,new Xg(this.outputRange.startLineNumber+t,this.outputRange.lineCount-t+i))}join(e){return new qu(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 qu(this.inputRange,this.outputRange.delta(e))}addInputLineDelta(e){return new qu(this.inputRange.delta(e),this.outputRange)}reverse(){return new qu(this.outputRange,this.inputRange)}}class G1{static betweenOutputs(e,t,i){const r=dle.compute(e,t).map(o=>new qu(o.output1Range,o.output2Range));return new G1(r,i)}constructor(e,t){this.lineRangeMappings=e,this.inputLineCount=t,Q_(()=>DU(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=Tk(this.lineRangeMappings,r=>r.inputRange.startLineNumber<=e);if(!t)return new qu(new Xg(e,1),new Xg(e,1));if(t.inputRange.contains(e))return t;const i=new Xg(e,1),n=new Xg(e+t.outputRange.endLineNumberExclusive-t.inputRange.endLineNumberExclusive,1);return new qu(i,n)}get outputLineCount(){const e=UGe(this.lineRangeMappings),t=e?e.outputRange.endLineNumberExclusive-e.inputRange.endLineNumberExclusive:0;return this.inputLineCount+t}reverse(){return new G1(this.lineRangeMappings.map(e=>e.reverse()),this.outputLineCount)}}class dle{static compute(e,t){const i=Sc(d=>d.inputRange.startLineNumber,ru),n=rrt(e.map(d=>({source:0,diff:d})),t.map(d=>({source:1,diff:d}))).sort(Sc(d=>d.diff,i)),r=[new Array,new Array],o=[0,0],a=new Array;function c(d){const h=qu.join(r[0])||new qu(d,d.delta(o[0])),u=qu.join(r[1])||new qu(d,d.delta(o[1]));a.push(new dle(l,h.extendInputRange(l).outputRange,r[0],u.extendInputRange(l).outputRange,r[1])),r[0]=[],r[1]=[]}let l;for(const d of n){const h=d.diff.inputRange;l&&!l.touches(h)&&(c(l),l=void 0),o[d.source]=d.diff.resultingDeltaFromOriginalToModified,l=l?l.join(h):h,r[d.source].push(d.diff)}return l&&c(l),a}constructor(e,t,i,n,r){this.inputRange=e,this.output1Range=t,this.output1LineMappings=i,this.output2Range=n,this.output2LineMappings=r}toString(){return`${this.output1Range} <- ${this.inputRange} -> ${this.output2Range}`}}class xD extends qu{static join(e){return e.reduce((t,i)=>t?t.join(i):i,void 0)}constructor(e,t,i,n,r){super(e,i),this.inputTextModel=t,this.outputTextModel=n,this.rangeMappings=r||[new _A(this.inputRange.toRange(),this.outputRange.toRange())]}addOutputLineDelta(e){return new xD(this.inputRange,this.inputTextModel,this.outputRange.delta(e),this.outputTextModel,this.rangeMappings.map(t=>t.addOutputLineDelta(e)))}addInputLineDelta(e){return new xD(this.inputRange.delta(e),this.inputTextModel,this.outputRange,this.outputTextModel,this.rangeMappings.map(t=>t.addInputLineDelta(e)))}join(e){return new xD(this.inputRange.join(e.inputRange),this.inputTextModel,this.outputRange.join(e.outputRange),this.outputTextModel)}getLineEdit(){return new y$(this.inputRange,this.getOutputLines())}getReverseLineEdit(){return new y$(this.outputRange,this.getInputLines())}getOutputLines(){return this.outputRange.getLines(this.outputTextModel)}getInputLines(){return this.inputRange.getLines(this.inputTextModel)}}class _A{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 _A(this.inputRange,new F(this.outputRange.startLineNumber+e,this.outputRange.startColumn,this.outputRange.endLineNumber+e,this.outputRange.endColumn))}addInputLineDelta(e){return new _A(new F(this.inputRange.startLineNumber+e,this.inputRange.startColumn,this.inputRange.endLineNumber+e,this.inputRange.endColumn),this.outputRange)}reverse(){return new _A(this.outputRange,this.inputRange)}}class NF{constructor(e,t){this.rangeMappings=e,this.inputLineCount=t,Q_(()=>DU(e,(i,n)=>a8e(i.inputRange,n.inputRange)&&a8e(i.outputRange,n.outputRange)))}project(e){const t=Tk(this.rangeMappings,r=>r.inputRange.getStartPosition().isBeforeOrEqual(e));if(!t)return new _A(F.fromPositions(e,e),F.fromPositions(e,e));if(XQt(t.inputRange,e))return t;const i=ZQt(t.inputRange.getEndPosition(),e),n=ejt(t.outputRange.getEndPosition(),i);return new _A(F.fromPositions(e),F.fromPositions(n))}projectRange(e){const t=this.project(e.getStartPosition()),i=this.project(e.getEndPosition());return new _A(t.inputRange.plusRange(i.inputRange),t.outputRange.plusRange(i.outputRange))}get outputLineCount(){const e=UGe(this.rangeMappings),t=e?e.outputRange.endLineNumber-e.inputRange.endLineNumber:0;return this.inputLineCount+t}reverse(){return new NF(this.rangeMappings.map(e=>e.reverse()),this.outputLineCount)}}let Fte=class{constructor(e,t){this.editorWorkerService=e,this.configurationService=t,this.mergeAlgorithm=QRe("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),r=e.getVersionId(),o=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 xD(c8e(h.original),e,c8e(h.modified),t,h.innerChanges?.map(u=>tjt(u)))),l=e.getVersionId(),d=t.getVersionId();return r!==l||o!==d?{diffs:null}:(Q_(()=>{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&&DU(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 Xue 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=Yt(this,Kp.initializing),this._diffs=Yt(this,[]),this._barrier=new ijt,this._isDisposed=!1,this._isInitializing=!0;const n=_C("recompute");this._register(ci(r=>{n.read(r),this._recompute(r)})),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()===Kp.initializing&&(this._isInitializing=!0),is(n=>{this._state.set(this._isInitializing?Kp.initializing:Kp.updating,n,eS.other)}),this.diffComputer.computeDiff(this.baseTextModel,this.textModel,e).then(n=>{this._isDisposed||t===this._recomputeCount&&is(r=>{n.diffs?(this._state.set(Kp.upToDate,r,eS.textChange),this._diffs.set(n.diffs,r,eS.textChange)):this._state.set(Kp.error,r,eS.textChange),this._isInitializing=!1})})}ensureUpToDate(){if(this.state.get()!==Kp.upToDate)throw new Pi("Cannot remove diffs when the model is not up to date")}removeDiffs(e,t,i){this.ensureUpToDate(),e.sort(Sc(r=>r.inputRange.startLineNumber,ru)),e.reverse();let n=this._diffs.get();for(const r of e){const o=n.length;if(n=n.filter(a=>a!==r),o===n.length)throw new Pi;this._barrier.runExclusivelyOrThrow(()=>{const a=r.getReverseLineEdit().toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,a,()=>null,i)}),n=n.map(a=>a.outputRange.isAfter(r.outputRange)?a.addOutputLineDelta(r.inputRange.lineCount-r.outputRange.lineCount):a)}this._diffs.set(n,t,eS.other)}applyEditRelativeToOriginal(e,t,i){this.ensureUpToDate();const n=new xD(e.range,this.baseTextModel,new Xg(e.range.startLineNumber,e.newLines.length),this.textModel);let r=!1,o=0;const a=new Array;for(const c of this.diffs.get()){if(c.inputRange.touches(e.range))throw new Pi("Edit must be conflict free.");c.inputRange.isAfter(e.range)?(r||(r=!0,a.push(n.addOutputLineDelta(o))),a.push(c.addOutputLineDelta(e.newLines.length-e.range.lineCount))):a.push(c),r||(o+=c.outputRange.lineCount-c.inputRange.lineCount)}r||(r=!0,a.push(n.addOutputLineDelta(o))),this._barrier.runExclusivelyOrThrow(()=>{const c=new y$(e.range.delta(o),e.newLines).toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,c,()=>null,i)}),this._diffs.set(a,t,eS.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 r of n){if(r.inputRange.contains(e)||r.inputRange.endLineNumberExclusive===e)return r;if(r.inputRange.endLineNumberExclusivenew PPe(a.inputRange,i,a.output1Range,n,a.output1LineMappings,a.output2Range,r,a.output2LineMappings))}constructor(e,t,i,n,r,o,a,c){if(this.baseRange=e,this.baseTextModel=t,this.input1Range=i,this.input1TextModel=n,this.input1Diffs=r,this.input2Range=o,this.input2TextModel=a,this.input2Diffs=c,this.input1CombinedDiff=xD.join(this.input1Diffs),this.input2CombinedDiff=xD.join(this.input2Diffs),this.isEqualChange=ns(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 Pi("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:Ld.base};if(t.length===1)return{edit:t[0].diff.getLineEdit(),effectiveState:Ld.base.withInputValue(t[0].inputNumber,!0,!1)};if(e.kind!==Ur.both)throw new Pi;const i=e.smartCombination?this.smartCombineInputs(e.firstInput):this.dumbCombineInputs(e.firstInput);return i?{edit:i,effectiveState:e}:{edit:t[BEe(e.firstInput)-1].diff.getLineEdit(),effectiveState:Ld.base.withInputValue(BEe(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=rrt(this.input1Diffs.flatMap(r=>r.rangeMappings.map(o=>({diff:o,input:1}))),this.input2Diffs.flatMap(r=>r.rangeMappings.map(o=>({diff:o,input:2})))).sort($Ge(Sc(r=>r.diff.inputRange,F.compareRangesUsingStarts),Sc(r=>r.input===e?1:2,ru))).map(r=>{const o=r.input===1?this.input1TextModel:this.input2TextModel;return new YQt(r.diff.inputRange,o.getValueInRange(r.diff.outputRange))}),n=njt(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 y$(this.baseRange,t.concat(i));return e===1?this.dumbInput1LineRangeEdit=n:this.dumbInput2LineRangeEdit=n,n}}function njt(s,e,t){let i="";const n=s.startLineNumber>1;let r=n?new re(s.startLineNumber-1,t.getLineMaxColumn(s.startLineNumber-1)):new re(s.startLineNumber,1);for(const d of e){const h=d.range.getStartPosition();if(!r.isBeforeOrEqual(h))return;let u=t.getValueInRange(F.fromPositions(r,h));h.lineNumber>t.getLineCount()&&(u+=` -`),i+=u,i+=d.newText,r=d.range.getEndPosition()}const o=s.endLineNumberExclusive<=t.getLineCount(),a=o?new re(s.endLineNumberExclusive,1):new re(s.endLineNumberExclusive-1,Vn.MAX_SAFE_SMALL_INTEGER),c=t.getValueInRange(F.fromPositions(r,a));i+=c;const l=cv(i);if(n){if(l[0]!=="")return;l.shift()}if(o){if(l[l.length-1]!=="")return;l.pop()}return new y$(s,l)}var Ur;(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"})(Ur||(Ur={}));function BEe(s){return s===1?2:1}class AG{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)?OH.first:OH.excluded}}class FPe extends AG{get kind(){return Ur.base}toString(){return"base"}swap(){return this}withInputValue(e,t,i=!1){return e===1?t?new hle:this:t?new vN:this}equals(e){return e.kind===Ur.base}}class hle extends AG{get kind(){return Ur.input1}get includesInput1(){return!0}toString(){return"1✓"}swap(){return new vN}withInputValue(e,t,i=!1){return e===1?t?this:new FPe:t?new ule(1,i):new vN}equals(e){return e.kind===Ur.input1}}class vN extends AG{get kind(){return Ur.input2}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new hle}withInputValue(e,t,i=!1){return e===2?t?this:new FPe:t?new ule(2,i):new vN}equals(e){return e.kind===Ur.input2}}class ule extends AG{constructor(e,t){super(),this.firstInput=e,this.smartCombination=t}get kind(){return Ur.both}get includesInput1(){return!0}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new ule(BEe(this.firstInput),this.smartCombination)}withInputValue(e,t,i=!1){return t?this:e===1?new vN:new hle}equals(e){return e.kind===Ur.both&&this.firstInput===e.firstInput&&this.smartCombination===e.smartCombination}getInput(e){return e===this.firstInput?OH.first:OH.second}}class sjt extends AG{get kind(){return Ur.unrecognized}toString(){return"unrecognized"}swap(){return this}withInputValue(e,t,i=!1){return t?e===1?new hle:new vN:this}equals(e){return e.kind===Ur.unrecognized}}var Ld;(function(s){s.base=new FPe,s.unrecognized=new sjt})(Ld||(Ld={}));var OH;(function(s){s[s.excluded=0]="excluded",s[s.first=1]="first",s[s.second=2]="second",s[s.unrecognized=3]="unrecognized"})(OH||(OH={}));let Ote=class extends BI{constructor(e,t,i,n,r,o,a,c,l){super(),this.base=e,this.input1=t,this.input2=i,this.resultTextModel=n,this.diffComputer=r,this.options=o,this.telemetry=a,this.languageService=c,this.undoRedoService=l,this.input1TextModelDiffs=this._register(new Xue(this.base,this.input1.textModel,this.diffComputer)),this.input2TextModelDiffs=this._register(new Xue(this.base,this.input2.textModel,this.diffComputer)),this.resultTextModelDiffs=this._register(new Xue(this.base,this.resultTextModel,this.diffComputer)),this.modifiedBaseRanges=et(this,h=>{const u=this.input1TextModelDiffs.diffs.read(h),f=this.input2TextModelDiffs.diffs.read(h);return PPe.fromDiffs(u,f,this.base,this.input1.textModel,this.input2.textModel)}),this.modifiedBaseRangeResultStates=et(this,h=>new Map(this.modifiedBaseRanges.read(h).map(f=>[f,new l8e(f)]))),this.resultSnapshot=this.resultTextModel.createSnapshot(),this.baseInput1Diffs=this.input1TextModelDiffs.diffs,this.baseInput2Diffs=this.input2TextModelDiffs.diffs,this.baseResultDiffs=this.resultTextModelDiffs.diffs,this.input1ResultMapping=et(this,h=>this.getInputResultMapping(this.baseInput1Diffs.read(h),this.baseResultDiffs.read(h),this.input1.textModel.getLineCount())),this.resultInput1Mapping=et(this,h=>this.input1ResultMapping.read(h).reverse()),this.input2ResultMapping=et(this,h=>this.getInputResultMapping(this.baseInput2Diffs.read(h),this.baseResultDiffs.read(h),this.input2.textModel.getLineCount())),this.resultInput2Mapping=et(this,h=>this.input2ResultMapping.read(h).reverse()),this.baseResultMapping=et(this,h=>{const u=new G1(this.baseResultDiffs.read(h),-1);return new G1(u.lineRangeMappings.map(f=>f.inputRange.isEmpty||f.outputRange.isEmpty?new qu(f.inputRange.deltaStart(-1),f.outputRange.deltaStart(-1)):f),u.inputLineCount)}),this.resultBaseMapping=et(this,h=>this.baseResultMapping.read(h).reverse()),this.diffComputingState=et(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs,this.resultTextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===Kp.initializing)?Qm.initializing:u.some(f=>f===Kp.updating)?Qm.updating:Qm.upToDate}),this.inputDiffComputingState=et(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===Kp.initializing)?Qm.initializing:u.some(f=>f===Kp.updating)?Qm.updating:Qm.upToDate}),this.isUpToDate=et(this,h=>this.diffComputingState.read(h)===Qm.upToDate),this.onInitialized=B5(this.diffComputingState,h=>h===Qm.upToDate).then(()=>{}),this.firstRun=!0,this.unhandledConflictsCount=et(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(Yq(this.modifiedBaseRangeResultStates)),this._register(Yq(this.input1ResultMapping)),this._register(Yq(this.input2ResultMapping));const d=this.initialize();this.onInitialized=this.onInitialized.then(async()=>{await d}),d.then(()=>{let h=!0;this._register(WU({handleChange:u=>(u.didChange(this.modifiedBaseRangeResultStates)&&(h=!0),u.didChange(this.resultTextModelDiffs.diffs)?u.change===eS.textChange:!0)},u=>{const f=this.modifiedBaseRangeResultStates.read(u);if(!this.isUpToDate.read(u))return;const p=this.resultTextModelDiffs.diffs.read(u);is(m=>{if(this.updateBaseRangeAcceptedState(p,f,m),h){h=!1;for(const[v,b]of f){const w=b.accepted.get(),y=!(w.kind===Ur.base||w.kind===Ur.unrecognized);b.handledInput1.set(y,m),b.handledInput2.set(y,m)}}})}))})}async initialize(){this.options.resetResult&&await this.reset()}async reset(){await B5(this.inputDiffComputingState,t=>t===Qm.upToDate);const e=this.modifiedBaseRangeResultStates.get();is(t=>{for(const[i,n]of e){let r,o=!1;i.input1Diffs.length===0?(r=Ld.base.withInputValue(2,!0),o=!0):i.input2Diffs.length===0||i.isEqualChange?(r=Ld.base.withInputValue(1,!0),o=!0):(r=Ld.base,o=!1),n.accepted.set(r,t),n.computedFromDiffing=!1,n.previousNonDiffingState=void 0,n.handledInput1.set(o,t),n.handledInput2.set(o,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(),r=[];function o(c,l){for(let d=l.startLineNumber;dr.inputRange.isEmpty||r.outputRange.isEmpty?new qu(r.inputRange.deltaStart(-1),r.outputRange.deltaStart(-1)):r),n.inputLineCount)}translateInputRangeToBase(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new NF(i.flatMap(r=>r.rangeMappings),0).reverse().projectRange(t).outputRange}translateBaseRangeToInput(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new NF(i.flatMap(r=>r.rangeMappings),0).projectRange(t).outputRange}getLineRangeInResult(e,t){return this.resultTextModelDiffs.getResultLineRange(e,t)}translateResultRangeToBase(e){return new NF(this.baseResultDiffs.get().flatMap(i=>i.rangeMappings),0).reverse().projectRange(e).outputRange}translateBaseRangeToResult(e){return new NF(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=jQt(t,e,(r,o)=>r[0].baseRange.touches(o.inputRange)?Lk.neitherLessOrGreaterThan:Xg.compareByStart(r[0].baseRange,o.inputRange));for(const r of n){const o=this.computeState(r.left[0],r.rights),a=r.left[1],c=a.accepted.get();c.equals(o)||(!this.firstRun&&!a.computedFromDiffing&&(a.computedFromDiffing=!0,a.previousNonDiffingState=c),a.accepted.set(o,i))}this.firstRun&&(this.firstRun=!1)}computeState(e,t){if(t.length===0)return Ld.base;const i=t.map(o=>o.getLineEdit());function n(o){return ns(i,o.map(a=>a.getLineEdit()),(a,c)=>a.equals(c))}if(n(e.input1Diffs))return Ld.base.withInputValue(1,!0);if(n(e.input2Diffs))return Ld.base.withInputValue(2,!0);const r=[Ld.base.withInputValue(1,!0).withInputValue(2,!0,!0),Ld.base.withInputValue(2,!0).withInputValue(1,!0,!0),Ld.base.withInputValue(1,!0).withInputValue(2,!0,!1),Ld.base.withInputValue(2,!0).withInputValue(1,!0,!1)];for(const o of r){const{edit:a}=e.getEditForBase(o);if(a){const l=this.resultTextModelDiffs.getResultLineRange(e.baseRange).getLines(this.resultTextModel);if(ns(a.newLines,l,(d,h)=>d===h))return o}}return Ld.unrecognized}getState(e){const t=this.modifiedBaseRangeResultStates.get().get(e);if(!t)throw new Pi("object must be from this instance");return t.accepted}setState(e,t,i,n,r=!1){if(!this.isUpToDate.get())throw new Pi("Cannot set state while updating");const o=this.modifiedBaseRangeResultStates.get().get(e);if(!o)throw new Pi("object must be from this instance");const a=this.resultTextModelDiffs.findTouchingDiffs(e.baseRange),c=new RY;a&&this.resultTextModelDiffs.removeDiffs(a,n,c);const{edit:l,effectiveState:d}=e.getEditForBase(t);o.accepted.set(d,n),o.previousNonDiffingState=void 0,o.computedFromDiffing=!1;const h=o.handledInput1.get(),u=o.handledInput2.get();(!h||!u)&&this.undoRedoService.pushElement(new rjt(this.resultTextModel.uri,new WeakRef(this),new WeakRef(o),h,u),c),l&&(this.resultTextModel.pushStackElement(),this.resultTextModelDiffs.applyEditRelativeToOriginal(l,n,c),this.resultTextModel.pushStackElement()),o.handledInput1.set(!0,n),o.handledInput2.set(!0,n)}resetDirtyConflictsToBase(){is(e=>{this.resultTextModel.pushStackElement();for(const t of this.modifiedBaseRanges.get())this.getState(t).get().kind===Ur.unrecognized&&this.setState(t,Ld.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 r=this.modifiedBaseRangeResultStates.get().get(e);if(r.handled.get()===i)return;const o=new WeakRef(l8e),a=new WeakRef(this);this.undoRedoService.pushElement({type:El.Resource,resource:this.resultTextModel.uri,code:"setInputHandled",label:g(11380,"Set Input Handled"),redo(){const c=a.deref(),l=o.deref();c&&!c.isDisposed()&&l&&is(d=>{t===1?r.handledInput1.set(i,d):r.handledInput2.set(i,d)})},undo(){const c=a.deref(),l=o.deref();c&&!c.isDisposed()&&l&&is(d=>{t===1?r.handledInput1.set(!i,d):r.handledInput2.set(!i,d)})}}),t===1?r.handledInput1.set(i,n):r.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 B5(this.diffComputingState,c=>c===Qm.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(),r=[];function o(c,l){for(let d=l.startLineNumber;d>>>>>>")}return o(e,Xg.fromLineNumbers(a,e.length+1)),r.join(` -`)}get conflictCount(){return wg(this.modifiedBaseRanges.get(),e=>e.isConflicting)}get combinableConflictCount(){return wg(this.modifiedBaseRanges.get(),e=>e.isConflicting&&e.canBeCombined)}get conflictsResolvedWithBase(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Ur.base)}get conflictsResolvedWithInput1(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Ur.input1)}get conflictsResolvedWithInput2(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Ur.input2)}get conflictsResolvedWithSmartCombination(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualNone(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Ur.unrecognized)}get manuallySolvedConflictCountThatEqualSmartCombine(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Ur.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualInput1(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Ur.input1})}get manuallySolvedConflictCountThatEqualInput2(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Ur.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBase(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.unrecognized&&t.previousNonDiffingState?.kind===Ur.base})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.unrecognized&&t.previousNonDiffingState?.kind===Ur.input1})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.unrecognized&&t.previousNonDiffingState?.kind===Ur.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.unrecognized&&t.previousNonDiffingState?.kind===Ur.both&&!t.previousNonDiffingState?.smartCombination})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.unrecognized&&t.previousNonDiffingState?.kind===Ur.both&&t.previousNonDiffingState?.smartCombination})}};Ote=D([_(7,Di),_(8,iE)],Ote);function wg(s,e){let t=0;for(const i of s)e(i)&&t++;return t}class l8e{constructor(e){this.baseRange=e,this.accepted=Yt(`BaseRangeState${this.baseRange.baseRange}`,Ld.base),this.handledInput1=Yt(`BaseRangeHandledState${this.baseRange.baseRange}.Input1`,!1),this.handledInput2=Yt(`BaseRangeHandledState${this.baseRange.baseRange}.Input2`,!1),this.computedFromDiffing=!1,this.previousNonDiffingState=void 0,this.handled=et(this,t=>this.handledInput1.read(t)&&this.handledInput2.read(t))}}var Qm;(function(s){s[s.initializing=1]="initializing",s[s.upToDate=2]="upToDate",s[s.updating=3]="updating"})(Qm||(Qm={}));class rjt{constructor(e,t,i,n,r){this.resource=e,this.mergeEditorModelRef=t,this.stateRef=i,this.input1Handled=n,this.input2Handled=r,this.code="undoMarkAsHandled",this.label=g(11381,"Undo Mark As Handled"),this.type=El.Resource}redo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&is(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&&is(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 d8e="mergeEditorCloseWithConflicts";var WEe;let HEe=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,r,o]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),Bte(e.input1,this._textModelService,t),Bte(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(Fte),d=this._instantiationService.createInstance(Ote,i.object.textEditorModel,r,o,c,l,{resetResult:!0},this._mergeEditorTelemetry);return t.add(d),await d.onInitialized,this._instantiationService.createInstance(UEe,d,t,n.object,e.result)}};HEe=D([_(1,we),_(2,pn),_(3,fi)],HEe);let UEe=class extends BI{constructor(e,t,i,n,r,o,a){super(),this.model=e,this.disposable=t,this.result=i,this.resultUri=n,this.textFileService=r,this.dialogService=o,this.editorService=a,this.savedAltVersionId=Yt(this,this.model.resultTextModel.getAlternativeVersionId()),this.altVersionId=qn(this,c=>this.model.resultTextModel.onDidChangeContent(c),()=>this.model.resultTextModel.getAlternativeVersionId()),this.isDirty=et(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){Q_(()=>e.some(n=>n===this));const t=e.some(n=>n.isDirty.get());let i;if(t){const n=e.length>1,r=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}?",vi(e[0].model.resultTextModel.uri)),o=e.some(c=>c.model.hasUnhandledConflicts.get()),a=[{label:o?g(10665,"&&Save With Conflicts"):g(10666,"&&Save"),run:()=>qh.SAVE},{label:g(10667,"Do&&n't Save"),run:()=>qh.DONT_SAVE}];i=(await this.dialogService.prompt({type:Ze.Info,message:r,detail:o?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:()=>qh.CANCEL}})).result}else i=qh.DONT_SAVE;return i===qh.SAVE?await Promise.all(e.map(n=>n.accept())):i===qh.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){}};UEe=D([_(4,Fr),_(5,ir),_(6,ti)],UEe);var ZR;let VEe=(ZR=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),r=m=>{Yi(e.result,m.resource)&&(n.clear(),i=m)};n.add(this.textFileService.files.onDidCreate(r)),this.textFileService.files.models.forEach(r);const[o,a,c,l]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),Bte(e.input1,this._textModelService,t),Bte(e.input2,this._textModelService,t)]);if(t.add(o),t.add(a),!i)throw new Pi;await i.save({source:WEe.FILE_SAVED_SOURCE});const u=i.textEditorModel.getLinesContent().some(m=>m.startsWith(QQt.start)),f=this._instantiationService.createInstance(Fte),p=this._instantiationService.createInstance(Ote,o.object.textEditorModel,c,l,a.object.textEditorModel,f,{resetResult:u},this._mergeEditorTelemetry);return t.add(p),await p.onInitialized,this._instantiationService.createInstance(zEe,p,t,i,this._mergeEditorTelemetry)}},WEe=ZR,ZR.FILE_SAVED_SOURCE=QJ.registerSource("merge-editor.source",g(10675,"Before Resolving Conflicts In Merge Editor")),ZR);VEe=WEe=D([_(1,we),_(2,pn),_(3,Fr)],VEe);let zEe=class extends BI{constructor(e,t,i,n,r,o){super(),this.model=e,this.disposableStore=t,this.resultTextFileModel=i,this.telemetry=n,this._dialogService=r,this._storageService=o,this.isDirty=qn(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(r=>r.isDirty.get()),n=e.some(r=>r.model.hasUnhandledConflicts.get());if(i){const r=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}?",vi(e[0].resultUri)),{result:o}=await this._dialogService.prompt({type:Ze.Info,message:r,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:()=>qh.SAVE},{label:g(10684,"Do&&n't Save"),run:()=>qh.DONT_SAVE}],cancelButton:{run:()=>qh.CANCEL}});return o}else if(n&&!this._storageService.getBoolean(d8e,Ie.PROFILE,!1)){const{confirmed:r,checkboxChecked:o}=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}?",vi(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 o&&this._storageService.store(d8e,!0,Ie.PROFILE,cn.USER),r?qh.SAVE:qh.CANCEL}else return qh.SAVE}};zEe=D([_(4,ir),_(5,Gi)],zEe);async function Bte(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 $Ee=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",{})}};$Ee=D([_(0,Ji)],$Ee);var zV,eM;let GEe=(eM=class extends gb{get useWorkingCopy(){return this.configurationService.getValue("mergeEditor.useWorkingCopy")??!1}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(n,void 0,o,a,c,l,h,u,f),this.base=e,this.input1=t,this.input2=i,this.result=n,this._instaService=r,this.configurationService=d,this.closeHandler={showConfirm:()=>this._inputModel?.shouldConfirmClose()??!1,confirm:async p=>{Q_(()=>p.every(v=>v.editor instanceof zV));const m=p.map(v=>v.editor._inputModel).filter(Oc);return await this._inputModel.confirmClose(m)}},this.mergeEditorModeFactory=this._instaService.createInstance(this.useWorkingCopy?HEe:VEe,this._instaService.createInstance($Ee))}dispose(){super.dispose()}get typeId(){return zV.ID}get editorId(){return lm.id}get capabilities(){let e=super.capabilities|xi.MultipleEditors;return this.useWorkingCopy&&(e|=xi.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(ci(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 zV?Yi(this.base,e.base)&&Yi(this.input1.uri,e.input1.uri)&&Yi(this.input2.uri,e.input2.uri)&&Yi(this.result,e.result):Ab(e)?(this.editorId===e.options?.override||e.options?.override===void 0)&&Yi(this.base,e.base.resource)&&Yi(this.input1.uri,e.input1.resource)&&Yi(this.input2.uri,e.input2.resource)&&Yi(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)}},zV=eM,eM.ID="mergeEditor.Input",eM);GEe=zV=D([_(4,we),_(5,ti),_(6,Fr),_(7,Os),_(8,Xt),_(9,Te),_(10,bd),_(11,xc),_(12,cE)],GEe);const ojt=oi("multi-diff-editor-label-icon",ve.diffMultiple,g(10264,"Icon of the multi diff editor label."));class h8e{constructor(e,t,i){if(this.originalUri=e,this.modifiedUri=t,this.goToFileUri=i,!e&&!t)throw new Pi("Invalid arguments")}getKey(){return JSON.stringify([this.modifiedUri?.toString(),this.originalUri?.toString()])}}const ajt=je.as(Pn.Configuration),cjt={...eG,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"}}}};ajt.registerConfiguration(cjt);var C$;(function(s){s.builtin="builtin",s.option="option",s.exclusive="exclusive",s.default="default"})(C$||(C$={}));var pz;(function(s){s[s.ABORT=1]="ABORT",s[s.NONE=2]="NONE"})(pz||(pz={}));function ljt(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(zi.sep)>=0?`${e.scheme}:${e.path}`:vi(e);return jO(typeof s=="string"?s.toLowerCase():s,n.toLowerCase())}var JP,tM;let uB=(tM=class extends Ub{static fromResourceMultiDiffEditorInput(e,t){if(!e.multiDiffSource&&!e.resources)throw new Pi("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(JP,i,e.label,e.resources?.map(n=>new h8e(n.original.resource,n.modified.resource,n.goToFileResource)),e.isTransient??!1)}static fromSerialized(e,t){return t.createInstance(JP,N.parse(e.multiDiffSourceUri),e.label,e.resources?.map(i=>new h8e(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 xi.Readonly}get typeId(){return JP.ID}getName(){return this._name}get editorId(){return lm.id}getIcon(){return ojt}constructor(e,t,i,n=!1,r,o,a,c,l){super(),this.multiDiffSource=e,this.label=t,this.initialResources=i,this.isTransient=n,this._textModelService=r,this._textResourceConfigurationService=o,this._instantiationService=a,this._multiDiffSourceResolverService=c,this._textFileService=l,this._name="",this._viewModel=new iht(async()=>{const d=await this._createModel();this._register(d);const h=new uXe(d,this._instantiationService);return this._register(h),await JKe(h.waitForDiffs(),1e3),h}),this._resolvedSource=new $0t(async()=>{const d=this.initialResources?{resources:cKe.const(this.initialResources)}:await this._multiDiffSourceResolverService.resolve(this.multiDiffSource);return{source:d,resources:d?JYe(this,d.resources):rd([])}}),this.resources=et(this,d=>this._resolvedSource.cachedPromiseResult.read(d)?.data?.resources.read(d)),this._isDirtyObservables=lJ(this,this.resources.map(d=>d??[]),d=>{const h=d.modifiedUri?u8e(this._textFileService,d.modifiedUri):rd(!1),u=d.originalUri?u8e(this._textFileService,d.originalUri):rd(!1);return et(f=>h.read(f)||u.read(f))},d=>d.getKey()),this._isDirtyObservable=et(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 qh.DONT_SAVE},showConfirm(){return!1}},this._register(ci(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 r=n.modified??n.original;r&&r.setLanguage(e,t)}async getViewModel(){return this._viewModel.getPromise()}async _createModel(){const e=await this._resolvedSource.getPromise(),t=this._textResourceConfigurationService,i=lJ(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),bt(m);return}const f=c.modifiedUri??c.originalUri,p={multiDiffEditorItem:c,original:d?.object.textEditorModel,modified:h?.object.textEditorModel,get options(){return{...djt(h?.object.isReadonly()??!0),...hjt(t.getValue(f))}},onOptionsDidChange:m=>this._textResourceConfigurationService.onDidChangeConfiguration(v=>{(v.affectsConfiguration(f,"editor")||v.affectsConfiguration(f,"diffEditor"))&&m()})};return l.add(fW.createOfNonDisposable(p,u,this))},c=>JSON.stringify([c.modifiedUri?.toString(),c.originalUri?.toString()])),n=Yt("documents",[]),r=et(async c=>{const l=i.read(c),h=(await Promise.all(l)).filter(Oc);n.set(h,void 0)}),o=VN(r);return await r.get(),{dispose:()=>o.dispose(),documents:new _Re(n),contextKeys:e.source?.contextKeys}}matches(e){return super.matches(e)?!0:e instanceof JP?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 r=>{const o=r.diffEditorViewModel.model,a=o.original.uri.scheme!==pe.untitled&&this._textFileService.isDirty(o.original.uri);await Promise.all([a?e==="save"?this._textFileService.save(o.original.uri,i):this._textFileService.revert(o.original.uri,i):Promise.resolve(),e==="save"?this._textFileService.save(o.modified.uri,i):this._textFileService.revert(o.modified.uri,i)])}))}},JP=tM,tM.ID="workbench.input.multiDiffEditor",tM);uB=JP=D([_(4,pn),_(5,xc),_(6,we),_(7,iZe),_(8,Fr)],uB);function u8e(s,e){return qn(M.filter(s.files.onDidChangeDirty,t=>t.resource.toString()===e.toString()),()=>s.isDirty(e))}function djt(s){return{readOnly:!!s,readOnlyMessage:typeof s!="boolean"?s:void 0}}function hjt(s){const e=Ds(s.editor);if(In(s.diffEditor)){const t=Ds(s.diffEditor);t.diffCodeLens=t.codeLens,delete t.codeLens,t.diffWordWrap=t.wordWrap,delete t.wordWrap,Object.assign(e,t)}return e}var t2;let g8e=(t2=class extends V{constructor(e,t){super(),this._register(e.registerEditor("*",{id:lm.id,label:lm.displayName,detail:lm.providerDisplayName,priority:C$.builtin},{},{createMultiDiffEditorInput:i=>({editor:uB.fromResourceMultiDiffEditorInput(i,t)})}))}},t2.ID="workbench.contrib.multiDiffEditorResolver",t2);g8e=D([_(0,KU),_(1,we)],g8e);var f8e;(function(s){s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.Up=2]="Up",s[s.Down=3]="Down"})(f8e||(f8e={}));var p8e;(function(s){s[s.Connecting=0]="Connecting",s[s.Connected=1]="Connected"})(p8e||(p8e={}));const m8e="terminalEditor";var _8e;(function(s){s[s.SearchHighlightLimit=1e3]="SearchHighlightLimit"})(_8e||(_8e={}));var v8e;(function(s){s[s.Unknown=1]="Unknown",s[s.Fedora=2]="Fedora",s[s.Ubuntu=3]="Ubuntu"})(v8e||(v8e={}));var b8e;(function(s){s.Terminals="Terminals"})(b8e||(b8e={}));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 qK=W("terminal.selectionBackground",kS,g(9050,"The selection background color of the terminal."));W("terminal.inactiveSelectionBackground",{light:rt(qK,.5),dark:rt(qK,.5),hcDark:rt(qK,.7),hcLight:rt(qK,.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",bMe,g(9057,"The color of the border that separates split panes within the terminal. This defaults to panel.border."));W("terminalOverviewRuler.border",YQe,g(9058,"The overview ruler left-side border color."));W("terminal.findMatchBackground",{dark:mBe,light:mBe,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",rt(Ppt,.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:yb,light:yb,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:u5,light:u5,hcDark:"#f38518",hcLight:"#0F4A85"},g(9063,"Overview ruler marker color for find matches in the terminal."));W("terminal.dropBackground",vMe,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",jve,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 ujt(s){let e;if(typeof s=="string"?e=s:s.color?e=s.color.replace(/\./g,"_"):He.isThemeIcon(s.icon)&&s.icon.color&&(e=s.icon.color.id.replace(/\./g,"_")),e)return`terminal-icon-${e.replace(/\./g,"_")}`}function gjt(s,e,t){const i=s.icon;if(!i)return;const n=[];let r;if(i instanceof N?r=i:i instanceof Object&&"light"in i&&"dark"in i&&(r=e===ef.LIGHT?i.light:i.dark),r instanceof N){const a=`terminal-uri-icon-${Hc(r.path).toString(36)}`;n.push(a),n.push("terminal-uri-icon")}return n}var KEe;(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"})(KEe||(KEe={}));const fjt=[KEe.FocusAccessibleBuffer];var yw;(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"})(yw||(yw={}));const pjt=[yw.FindFocus,yw.FindHide,yw.FindNext,yw.FindPrevious,yw.ToggleFindRegex,yw.ToggleFindWholeWord,yw.ToggleFindCaseSensitive,yw.SearchWorkspace];var Cw;(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"})(Cw||(Cw={}));const mjt=[Cw.SelectPrevSuggestion,Cw.SelectPrevPageSuggestion,Cw.SelectNextSuggestion,Cw.SelectNextPageSuggestion,Cw.AcceptSelectedSuggestion,Cw.AcceptSelectedSuggestionEnter,Cw.HideSuggestWidget,Cw.ClearSuggestCache],_jt="terminal";var w8e;(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"})(w8e||(w8e={}));var _n;(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"})(_n||(_n={}));[_n.ClearSelection,_n.Clear,_n.CopyAndClearSelection,_n.CopySelection,_n.CopySelectionAsHtml,_n.CopyLastCommand,_n.CopyLastCommandOutput,_n.CopyLastCommandAndLastCommandOutput,_n.DeleteToLineStart,_n.DeleteWordLeft,_n.DeleteWordRight,_n.GoToRecentDirectory,_n.FocusNextPane,_n.FocusNext,_n.FocusPreviousPane,_n.FocusPrevious,_n.Focus,_n.SizeToContentWidth,_n.Kill,_n.KillEditor,_n.MoveToEditor,_n.MoveToLineEnd,_n.MoveToLineStart,_n.MoveToTerminalPanel,_n.NewInActiveWorkspace,_n.New,_n.Paste,_n.PasteSelection,_n.ResizePaneDown,_n.ResizePaneLeft,_n.ResizePaneRight,_n.ResizePaneUp,_n.RunActiveFile,_n.RunSelectedText,_n.RunRecentCommand,_n.ScrollDownLine,_n.ScrollDownPage,_n.ScrollToBottom,_n.ScrollToNextCommand,_n.ScrollToPreviousCommand,_n.ScrollToTop,_n.ScrollUpLine,_n.ScrollUpPage,_n.SendSequence,_n.SelectAll,_n.SelectToNextCommand,_n.SelectToNextLine,_n.SelectToPreviousCommand,_n.SelectToPreviousLine,_n.SplitInActiveWorkspace,_n.Split,_n.Toggle,_n.FocusHover,eh.OpenAccessibilityHelp,...fjt,...pjt,...mjt];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 fo;(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"})(fo||(fo={}));var qEe;(function(s){s.isOpen=new Q(fo.IsOpen,!1,!0),s.focus=new Q(fo.Focus,!1,g(8951,"Whether the terminal is focused.")),s.focusInAny=new Q(fo.FocusInAny,!1,g(8952,"Whether any terminal is focused, including detached terminals used in other UI.")),s.editorFocus=new Q(fo.EditorFocus,!1,g(8953,"Whether a terminal in the editor area is focused.")),s.count=new Q(fo.Count,0,g(8954,"The current number of terminals.")),s.groupCount=new Q(fo.GroupCount,0,!0),s.tabsNarrow=new Q(fo.TabsNarrow,!1,!0),s.terminalHasFixedWidth=new Q(fo.HasFixedWidth,!1,!0),s.tabsFocus=new Q(fo.TabsFocus,!1,g(8955,"Whether the terminal tabs widget is focused.")),s.webExtensionContributedProfile=new Q(fo.WebExtensionContributedProfile,!1,!0),s.terminalHasBeenCreated=new Q(fo.TerminalHasBeenCreated,!1,!0),s.terminalEditorActive=new Q(fo.TerminalEditorActive,!1,!0),s.tabsMouse=new Q(fo.TabsMouse,!1,!0),s.shellType=new Q(fo.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(fo.AltBufferActive,!1,g(8957,"Whether the terminal's alt buffer is active.")),s.suggestWidgetVisible=new Q(fo.SuggestWidgetVisible,!1,g(8958,"Whether the terminal's suggest widget is visible.")),s.notFocus=s.focus.toNegated(),s.viewShowing=new Q(fo.ViewShowing,!1,g(8959,"Whether the terminal view is showing")),s.textSelected=new Q(fo.TextSelected,!1,g(8960,"Whether text is selected in the active terminal.")),s.textSelectedInFocused=new Q(fo.TextSelectedInFocused,!1,g(8961,"Whether text is selected in a focused terminal.")),s.notTextSelected=s.textSelected.toNegated(),s.findVisible=new Q(fo.FindVisible,!1,!0),s.notFindVisible=s.findVisible.toNegated(),s.findInputFocus=new Q(fo.FindInputFocused,!1,!0),s.findFocus=new Q(fo.FindFocused,!1,!0),s.notFindFocus=s.findInputFocus.toNegated(),s.processSupported=new Q(fo.ProcessSupported,!1,g(8962,"Whether terminal processes can be launched in the current workspace.")),s.tabsSingularSelection=new Q(fo.TabsSingularSelection,!1,g(8963,"Whether one terminal is selected in the terminal tabs list.")),s.splitTerminal=new Q(fo.SplitTerminal,!1,g(8964,"Whether the focused tab's terminal is a split terminal.")),s.inTerminalRunCommandPicker=new Q(fo.InTerminalRunCommandPicker,!1,g(8965,"Whether the terminal run command picker is currently open.")),s.terminalShellIntegrationEnabled=new Q(fo.TerminalShellIntegrationEnabled,!1,g(8966,"Whether shell integration is enabled in the active terminal")),s.shouldShowViewInlineActions=he.and(he.equals("view",_jt),he.notEquals(`config.${zw.TabsHideCondition}`,"never"),he.or(he.not(`config.${zw.TabsEnabled}`),he.and(he.equals(`config.${zw.TabsShowActions}`,"singleTerminal"),he.equals(fo.GroupCount,1)),he.and(he.equals(`config.${zw.TabsShowActions}`,"singleTerminalOrNarrow"),he.or(he.equals(fo.GroupCount,1),he.has(fo.TabsNarrow))),he.and(he.equals(`config.${zw.TabsShowActions}`,"singleGroup"),he.equals(fo.GroupCount,1)),he.equals(`config.${zw.TabsShowActions}`,"always")))})(qEe||(qEe={}));var _j,iM;let QEe=(iM=class extends Ub{setGroup(e){this._group=e,e?.scopedContextKeyService&&this._terminalInstance?.setParentContextKeyService(e.scopedContextKeyService)}get group(){return this._group}get typeId(){return _j.ID}get editorId(){return m8e}get capabilities(){return xi.Readonly|xi.Singleton|xi.CanDropIntoEditor|xi.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||{},yW.Editor);return e.focusWhenReady(),this._copyLaunchConfig=void 0,this._instantiationService.createInstance(_j,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(zw.ConfirmOnKill);return(e==="editor"||e==="always")&&this._terminalInstance?.hasChildProcesses||!1}async confirm(e){const{confirmed:t}=await this._dialogService.confirm({type:Ze.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(` +`+i).join("")})}}function XQt(s,e){return!(e.lineNumbers.endLineNumber||e.lineNumber===s.startLineNumber&&e.column=s.endColumn)}function ZQt(s,e){return s.lineNumber===e.lineNumber?new ng(0,e.column-s.column):new ng(e.lineNumber-s.lineNumber,e.column-1)}function ejt(s,e){return e.lineCount===0?new re(s.lineNumber,s.column+e.columnCount):new re(s.lineNumber+e.lineCount,e.columnCount+1)}function a8e(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 Pi;const t=e.startLineNumber-this.inputRange.startLineNumber,i=e.endLineNumberExclusive-this.inputRange.endLineNumberExclusive;return new qu(e,new Xg(this.outputRange.startLineNumber+t,this.outputRange.lineCount-t+i))}join(e){return new qu(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 qu(this.inputRange,this.outputRange.delta(e))}addInputLineDelta(e){return new qu(this.inputRange.delta(e),this.outputRange)}reverse(){return new qu(this.outputRange,this.inputRange)}}class G1{static betweenOutputs(e,t,i){const r=dle.compute(e,t).map(o=>new qu(o.output1Range,o.output2Range));return new G1(r,i)}constructor(e,t){this.lineRangeMappings=e,this.inputLineCount=t,Q_(()=>DU(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=Tk(this.lineRangeMappings,r=>r.inputRange.startLineNumber<=e);if(!t)return new qu(new Xg(e,1),new Xg(e,1));if(t.inputRange.contains(e))return t;const i=new Xg(e,1),n=new Xg(e+t.outputRange.endLineNumberExclusive-t.inputRange.endLineNumberExclusive,1);return new qu(i,n)}get outputLineCount(){const e=UGe(this.lineRangeMappings),t=e?e.outputRange.endLineNumberExclusive-e.inputRange.endLineNumberExclusive:0;return this.inputLineCount+t}reverse(){return new G1(this.lineRangeMappings.map(e=>e.reverse()),this.outputLineCount)}}class dle{static compute(e,t){const i=Sc(d=>d.inputRange.startLineNumber,ru),n=rrt(e.map(d=>({source:0,diff:d})),t.map(d=>({source:1,diff:d}))).sort(Sc(d=>d.diff,i)),r=[new Array,new Array],o=[0,0],a=new Array;function c(d){const h=qu.join(r[0])||new qu(d,d.delta(o[0])),u=qu.join(r[1])||new qu(d,d.delta(o[1]));a.push(new dle(l,h.extendInputRange(l).outputRange,r[0],u.extendInputRange(l).outputRange,r[1])),r[0]=[],r[1]=[]}let l;for(const d of n){const h=d.diff.inputRange;l&&!l.touches(h)&&(c(l),l=void 0),o[d.source]=d.diff.resultingDeltaFromOriginalToModified,l=l?l.join(h):h,r[d.source].push(d.diff)}return l&&c(l),a}constructor(e,t,i,n,r){this.inputRange=e,this.output1Range=t,this.output1LineMappings=i,this.output2Range=n,this.output2LineMappings=r}toString(){return`${this.output1Range} <- ${this.inputRange} -> ${this.output2Range}`}}class xD extends qu{static join(e){return e.reduce((t,i)=>t?t.join(i):i,void 0)}constructor(e,t,i,n,r){super(e,i),this.inputTextModel=t,this.outputTextModel=n,this.rangeMappings=r||[new _A(this.inputRange.toRange(),this.outputRange.toRange())]}addOutputLineDelta(e){return new xD(this.inputRange,this.inputTextModel,this.outputRange.delta(e),this.outputTextModel,this.rangeMappings.map(t=>t.addOutputLineDelta(e)))}addInputLineDelta(e){return new xD(this.inputRange.delta(e),this.inputTextModel,this.outputRange,this.outputTextModel,this.rangeMappings.map(t=>t.addInputLineDelta(e)))}join(e){return new xD(this.inputRange.join(e.inputRange),this.inputTextModel,this.outputRange.join(e.outputRange),this.outputTextModel)}getLineEdit(){return new y$(this.inputRange,this.getOutputLines())}getReverseLineEdit(){return new y$(this.outputRange,this.getInputLines())}getOutputLines(){return this.outputRange.getLines(this.outputTextModel)}getInputLines(){return this.inputRange.getLines(this.inputTextModel)}}class _A{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 _A(this.inputRange,new F(this.outputRange.startLineNumber+e,this.outputRange.startColumn,this.outputRange.endLineNumber+e,this.outputRange.endColumn))}addInputLineDelta(e){return new _A(new F(this.inputRange.startLineNumber+e,this.inputRange.startColumn,this.inputRange.endLineNumber+e,this.inputRange.endColumn),this.outputRange)}reverse(){return new _A(this.outputRange,this.inputRange)}}class NF{constructor(e,t){this.rangeMappings=e,this.inputLineCount=t,Q_(()=>DU(e,(i,n)=>a8e(i.inputRange,n.inputRange)&&a8e(i.outputRange,n.outputRange)))}project(e){const t=Tk(this.rangeMappings,r=>r.inputRange.getStartPosition().isBeforeOrEqual(e));if(!t)return new _A(F.fromPositions(e,e),F.fromPositions(e,e));if(XQt(t.inputRange,e))return t;const i=ZQt(t.inputRange.getEndPosition(),e),n=ejt(t.outputRange.getEndPosition(),i);return new _A(F.fromPositions(e),F.fromPositions(n))}projectRange(e){const t=this.project(e.getStartPosition()),i=this.project(e.getEndPosition());return new _A(t.inputRange.plusRange(i.inputRange),t.outputRange.plusRange(i.outputRange))}get outputLineCount(){const e=UGe(this.rangeMappings),t=e?e.outputRange.endLineNumber-e.inputRange.endLineNumber:0;return this.inputLineCount+t}reverse(){return new NF(this.rangeMappings.map(e=>e.reverse()),this.outputLineCount)}}let Fte=class{constructor(e,t){this.editorWorkerService=e,this.configurationService=t,this.mergeAlgorithm=QRe("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),r=e.getVersionId(),o=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 xD(c8e(h.original),e,c8e(h.modified),t,h.innerChanges?.map(u=>tjt(u)))),l=e.getVersionId(),d=t.getVersionId();return r!==l||o!==d?{diffs:null}:(Q_(()=>{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&&DU(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 Xue 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=Yt(this,Kp.initializing),this._diffs=Yt(this,[]),this._barrier=new ijt,this._isDisposed=!1,this._isInitializing=!0;const n=_C("recompute");this._register(ci(r=>{n.read(r),this._recompute(r)})),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()===Kp.initializing&&(this._isInitializing=!0),is(n=>{this._state.set(this._isInitializing?Kp.initializing:Kp.updating,n,eS.other)}),this.diffComputer.computeDiff(this.baseTextModel,this.textModel,e).then(n=>{this._isDisposed||t===this._recomputeCount&&is(r=>{n.diffs?(this._state.set(Kp.upToDate,r,eS.textChange),this._diffs.set(n.diffs,r,eS.textChange)):this._state.set(Kp.error,r,eS.textChange),this._isInitializing=!1})})}ensureUpToDate(){if(this.state.get()!==Kp.upToDate)throw new Pi("Cannot remove diffs when the model is not up to date")}removeDiffs(e,t,i){this.ensureUpToDate(),e.sort(Sc(r=>r.inputRange.startLineNumber,ru)),e.reverse();let n=this._diffs.get();for(const r of e){const o=n.length;if(n=n.filter(a=>a!==r),o===n.length)throw new Pi;this._barrier.runExclusivelyOrThrow(()=>{const a=r.getReverseLineEdit().toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,a,()=>null,i)}),n=n.map(a=>a.outputRange.isAfter(r.outputRange)?a.addOutputLineDelta(r.inputRange.lineCount-r.outputRange.lineCount):a)}this._diffs.set(n,t,eS.other)}applyEditRelativeToOriginal(e,t,i){this.ensureUpToDate();const n=new xD(e.range,this.baseTextModel,new Xg(e.range.startLineNumber,e.newLines.length),this.textModel);let r=!1,o=0;const a=new Array;for(const c of this.diffs.get()){if(c.inputRange.touches(e.range))throw new Pi("Edit must be conflict free.");c.inputRange.isAfter(e.range)?(r||(r=!0,a.push(n.addOutputLineDelta(o))),a.push(c.addOutputLineDelta(e.newLines.length-e.range.lineCount))):a.push(c),r||(o+=c.outputRange.lineCount-c.inputRange.lineCount)}r||(r=!0,a.push(n.addOutputLineDelta(o))),this._barrier.runExclusivelyOrThrow(()=>{const c=new y$(e.range.delta(o),e.newLines).toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,c,()=>null,i)}),this._diffs.set(a,t,eS.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 r of n){if(r.inputRange.contains(e)||r.inputRange.endLineNumberExclusive===e)return r;if(r.inputRange.endLineNumberExclusivenew PPe(a.inputRange,i,a.output1Range,n,a.output1LineMappings,a.output2Range,r,a.output2LineMappings))}constructor(e,t,i,n,r,o,a,c){if(this.baseRange=e,this.baseTextModel=t,this.input1Range=i,this.input1TextModel=n,this.input1Diffs=r,this.input2Range=o,this.input2TextModel=a,this.input2Diffs=c,this.input1CombinedDiff=xD.join(this.input1Diffs),this.input2CombinedDiff=xD.join(this.input2Diffs),this.isEqualChange=ns(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 Pi("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:Ld.base};if(t.length===1)return{edit:t[0].diff.getLineEdit(),effectiveState:Ld.base.withInputValue(t[0].inputNumber,!0,!1)};if(e.kind!==Ur.both)throw new Pi;const i=e.smartCombination?this.smartCombineInputs(e.firstInput):this.dumbCombineInputs(e.firstInput);return i?{edit:i,effectiveState:e}:{edit:t[BEe(e.firstInput)-1].diff.getLineEdit(),effectiveState:Ld.base.withInputValue(BEe(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=rrt(this.input1Diffs.flatMap(r=>r.rangeMappings.map(o=>({diff:o,input:1}))),this.input2Diffs.flatMap(r=>r.rangeMappings.map(o=>({diff:o,input:2})))).sort($Ge(Sc(r=>r.diff.inputRange,F.compareRangesUsingStarts),Sc(r=>r.input===e?1:2,ru))).map(r=>{const o=r.input===1?this.input1TextModel:this.input2TextModel;return new YQt(r.diff.inputRange,o.getValueInRange(r.diff.outputRange))}),n=njt(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 y$(this.baseRange,t.concat(i));return e===1?this.dumbInput1LineRangeEdit=n:this.dumbInput2LineRangeEdit=n,n}}function njt(s,e,t){let i="";const n=s.startLineNumber>1;let r=n?new re(s.startLineNumber-1,t.getLineMaxColumn(s.startLineNumber-1)):new re(s.startLineNumber,1);for(const d of e){const h=d.range.getStartPosition();if(!r.isBeforeOrEqual(h))return;let u=t.getValueInRange(F.fromPositions(r,h));h.lineNumber>t.getLineCount()&&(u+=` +`),i+=u,i+=d.newText,r=d.range.getEndPosition()}const o=s.endLineNumberExclusive<=t.getLineCount(),a=o?new re(s.endLineNumberExclusive,1):new re(s.endLineNumberExclusive-1,Vn.MAX_SAFE_SMALL_INTEGER),c=t.getValueInRange(F.fromPositions(r,a));i+=c;const l=cv(i);if(n){if(l[0]!=="")return;l.shift()}if(o){if(l[l.length-1]!=="")return;l.pop()}return new y$(s,l)}var Ur;(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"})(Ur||(Ur={}));function BEe(s){return s===1?2:1}class AG{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)?OH.first:OH.excluded}}class FPe extends AG{get kind(){return Ur.base}toString(){return"base"}swap(){return this}withInputValue(e,t,i=!1){return e===1?t?new hle:this:t?new vN:this}equals(e){return e.kind===Ur.base}}class hle extends AG{get kind(){return Ur.input1}get includesInput1(){return!0}toString(){return"1✓"}swap(){return new vN}withInputValue(e,t,i=!1){return e===1?t?this:new FPe:t?new ule(1,i):new vN}equals(e){return e.kind===Ur.input1}}class vN extends AG{get kind(){return Ur.input2}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new hle}withInputValue(e,t,i=!1){return e===2?t?this:new FPe:t?new ule(2,i):new vN}equals(e){return e.kind===Ur.input2}}class ule extends AG{constructor(e,t){super(),this.firstInput=e,this.smartCombination=t}get kind(){return Ur.both}get includesInput1(){return!0}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new ule(BEe(this.firstInput),this.smartCombination)}withInputValue(e,t,i=!1){return t?this:e===1?new vN:new hle}equals(e){return e.kind===Ur.both&&this.firstInput===e.firstInput&&this.smartCombination===e.smartCombination}getInput(e){return e===this.firstInput?OH.first:OH.second}}class sjt extends AG{get kind(){return Ur.unrecognized}toString(){return"unrecognized"}swap(){return this}withInputValue(e,t,i=!1){return t?e===1?new hle:new vN:this}equals(e){return e.kind===Ur.unrecognized}}var Ld;(function(s){s.base=new FPe,s.unrecognized=new sjt})(Ld||(Ld={}));var OH;(function(s){s[s.excluded=0]="excluded",s[s.first=1]="first",s[s.second=2]="second",s[s.unrecognized=3]="unrecognized"})(OH||(OH={}));let Ote=class extends BI{constructor(e,t,i,n,r,o,a,c,l){super(),this.base=e,this.input1=t,this.input2=i,this.resultTextModel=n,this.diffComputer=r,this.options=o,this.telemetry=a,this.languageService=c,this.undoRedoService=l,this.input1TextModelDiffs=this._register(new Xue(this.base,this.input1.textModel,this.diffComputer)),this.input2TextModelDiffs=this._register(new Xue(this.base,this.input2.textModel,this.diffComputer)),this.resultTextModelDiffs=this._register(new Xue(this.base,this.resultTextModel,this.diffComputer)),this.modifiedBaseRanges=et(this,h=>{const u=this.input1TextModelDiffs.diffs.read(h),f=this.input2TextModelDiffs.diffs.read(h);return PPe.fromDiffs(u,f,this.base,this.input1.textModel,this.input2.textModel)}),this.modifiedBaseRangeResultStates=et(this,h=>new Map(this.modifiedBaseRanges.read(h).map(f=>[f,new l8e(f)]))),this.resultSnapshot=this.resultTextModel.createSnapshot(),this.baseInput1Diffs=this.input1TextModelDiffs.diffs,this.baseInput2Diffs=this.input2TextModelDiffs.diffs,this.baseResultDiffs=this.resultTextModelDiffs.diffs,this.input1ResultMapping=et(this,h=>this.getInputResultMapping(this.baseInput1Diffs.read(h),this.baseResultDiffs.read(h),this.input1.textModel.getLineCount())),this.resultInput1Mapping=et(this,h=>this.input1ResultMapping.read(h).reverse()),this.input2ResultMapping=et(this,h=>this.getInputResultMapping(this.baseInput2Diffs.read(h),this.baseResultDiffs.read(h),this.input2.textModel.getLineCount())),this.resultInput2Mapping=et(this,h=>this.input2ResultMapping.read(h).reverse()),this.baseResultMapping=et(this,h=>{const u=new G1(this.baseResultDiffs.read(h),-1);return new G1(u.lineRangeMappings.map(f=>f.inputRange.isEmpty||f.outputRange.isEmpty?new qu(f.inputRange.deltaStart(-1),f.outputRange.deltaStart(-1)):f),u.inputLineCount)}),this.resultBaseMapping=et(this,h=>this.baseResultMapping.read(h).reverse()),this.diffComputingState=et(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs,this.resultTextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===Kp.initializing)?Qm.initializing:u.some(f=>f===Kp.updating)?Qm.updating:Qm.upToDate}),this.inputDiffComputingState=et(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===Kp.initializing)?Qm.initializing:u.some(f=>f===Kp.updating)?Qm.updating:Qm.upToDate}),this.isUpToDate=et(this,h=>this.diffComputingState.read(h)===Qm.upToDate),this.onInitialized=B5(this.diffComputingState,h=>h===Qm.upToDate).then(()=>{}),this.firstRun=!0,this.unhandledConflictsCount=et(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(Yq(this.modifiedBaseRangeResultStates)),this._register(Yq(this.input1ResultMapping)),this._register(Yq(this.input2ResultMapping));const d=this.initialize();this.onInitialized=this.onInitialized.then(async()=>{await d}),d.then(()=>{let h=!0;this._register(WU({handleChange:u=>(u.didChange(this.modifiedBaseRangeResultStates)&&(h=!0),u.didChange(this.resultTextModelDiffs.diffs)?u.change===eS.textChange:!0)},u=>{const f=this.modifiedBaseRangeResultStates.read(u);if(!this.isUpToDate.read(u))return;const p=this.resultTextModelDiffs.diffs.read(u);is(m=>{if(this.updateBaseRangeAcceptedState(p,f,m),h){h=!1;for(const[v,b]of f){const w=b.accepted.get(),y=!(w.kind===Ur.base||w.kind===Ur.unrecognized);b.handledInput1.set(y,m),b.handledInput2.set(y,m)}}})}))})}async initialize(){this.options.resetResult&&await this.reset()}async reset(){await B5(this.inputDiffComputingState,t=>t===Qm.upToDate);const e=this.modifiedBaseRangeResultStates.get();is(t=>{for(const[i,n]of e){let r,o=!1;i.input1Diffs.length===0?(r=Ld.base.withInputValue(2,!0),o=!0):i.input2Diffs.length===0||i.isEqualChange?(r=Ld.base.withInputValue(1,!0),o=!0):(r=Ld.base,o=!1),n.accepted.set(r,t),n.computedFromDiffing=!1,n.previousNonDiffingState=void 0,n.handledInput1.set(o,t),n.handledInput2.set(o,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(),r=[];function o(c,l){for(let d=l.startLineNumber;dr.inputRange.isEmpty||r.outputRange.isEmpty?new qu(r.inputRange.deltaStart(-1),r.outputRange.deltaStart(-1)):r),n.inputLineCount)}translateInputRangeToBase(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new NF(i.flatMap(r=>r.rangeMappings),0).reverse().projectRange(t).outputRange}translateBaseRangeToInput(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new NF(i.flatMap(r=>r.rangeMappings),0).projectRange(t).outputRange}getLineRangeInResult(e,t){return this.resultTextModelDiffs.getResultLineRange(e,t)}translateResultRangeToBase(e){return new NF(this.baseResultDiffs.get().flatMap(i=>i.rangeMappings),0).reverse().projectRange(e).outputRange}translateBaseRangeToResult(e){return new NF(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=jQt(t,e,(r,o)=>r[0].baseRange.touches(o.inputRange)?Lk.neitherLessOrGreaterThan:Xg.compareByStart(r[0].baseRange,o.inputRange));for(const r of n){const o=this.computeState(r.left[0],r.rights),a=r.left[1],c=a.accepted.get();c.equals(o)||(!this.firstRun&&!a.computedFromDiffing&&(a.computedFromDiffing=!0,a.previousNonDiffingState=c),a.accepted.set(o,i))}this.firstRun&&(this.firstRun=!1)}computeState(e,t){if(t.length===0)return Ld.base;const i=t.map(o=>o.getLineEdit());function n(o){return ns(i,o.map(a=>a.getLineEdit()),(a,c)=>a.equals(c))}if(n(e.input1Diffs))return Ld.base.withInputValue(1,!0);if(n(e.input2Diffs))return Ld.base.withInputValue(2,!0);const r=[Ld.base.withInputValue(1,!0).withInputValue(2,!0,!0),Ld.base.withInputValue(2,!0).withInputValue(1,!0,!0),Ld.base.withInputValue(1,!0).withInputValue(2,!0,!1),Ld.base.withInputValue(2,!0).withInputValue(1,!0,!1)];for(const o of r){const{edit:a}=e.getEditForBase(o);if(a){const l=this.resultTextModelDiffs.getResultLineRange(e.baseRange).getLines(this.resultTextModel);if(ns(a.newLines,l,(d,h)=>d===h))return o}}return Ld.unrecognized}getState(e){const t=this.modifiedBaseRangeResultStates.get().get(e);if(!t)throw new Pi("object must be from this instance");return t.accepted}setState(e,t,i,n,r=!1){if(!this.isUpToDate.get())throw new Pi("Cannot set state while updating");const o=this.modifiedBaseRangeResultStates.get().get(e);if(!o)throw new Pi("object must be from this instance");const a=this.resultTextModelDiffs.findTouchingDiffs(e.baseRange),c=new RY;a&&this.resultTextModelDiffs.removeDiffs(a,n,c);const{edit:l,effectiveState:d}=e.getEditForBase(t);o.accepted.set(d,n),o.previousNonDiffingState=void 0,o.computedFromDiffing=!1;const h=o.handledInput1.get(),u=o.handledInput2.get();(!h||!u)&&this.undoRedoService.pushElement(new rjt(this.resultTextModel.uri,new WeakRef(this),new WeakRef(o),h,u),c),l&&(this.resultTextModel.pushStackElement(),this.resultTextModelDiffs.applyEditRelativeToOriginal(l,n,c),this.resultTextModel.pushStackElement()),o.handledInput1.set(!0,n),o.handledInput2.set(!0,n)}resetDirtyConflictsToBase(){is(e=>{this.resultTextModel.pushStackElement();for(const t of this.modifiedBaseRanges.get())this.getState(t).get().kind===Ur.unrecognized&&this.setState(t,Ld.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 r=this.modifiedBaseRangeResultStates.get().get(e);if(r.handled.get()===i)return;const o=new WeakRef(l8e),a=new WeakRef(this);this.undoRedoService.pushElement({type:xl.Resource,resource:this.resultTextModel.uri,code:"setInputHandled",label:g(11380,"Set Input Handled"),redo(){const c=a.deref(),l=o.deref();c&&!c.isDisposed()&&l&&is(d=>{t===1?r.handledInput1.set(i,d):r.handledInput2.set(i,d)})},undo(){const c=a.deref(),l=o.deref();c&&!c.isDisposed()&&l&&is(d=>{t===1?r.handledInput1.set(!i,d):r.handledInput2.set(!i,d)})}}),t===1?r.handledInput1.set(i,n):r.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 B5(this.diffComputingState,c=>c===Qm.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(),r=[];function o(c,l){for(let d=l.startLineNumber;d>>>>>>")}return o(e,Xg.fromLineNumbers(a,e.length+1)),r.join(` +`)}get conflictCount(){return wg(this.modifiedBaseRanges.get(),e=>e.isConflicting)}get combinableConflictCount(){return wg(this.modifiedBaseRanges.get(),e=>e.isConflicting&&e.canBeCombined)}get conflictsResolvedWithBase(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Ur.base)}get conflictsResolvedWithInput1(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Ur.input1)}get conflictsResolvedWithInput2(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Ur.input2)}get conflictsResolvedWithSmartCombination(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualNone(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Ur.unrecognized)}get manuallySolvedConflictCountThatEqualSmartCombine(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Ur.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualInput1(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Ur.input1})}get manuallySolvedConflictCountThatEqualInput2(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Ur.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBase(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.unrecognized&&t.previousNonDiffingState?.kind===Ur.base})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.unrecognized&&t.previousNonDiffingState?.kind===Ur.input1})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.unrecognized&&t.previousNonDiffingState?.kind===Ur.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.unrecognized&&t.previousNonDiffingState?.kind===Ur.both&&!t.previousNonDiffingState?.smartCombination})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart(){return wg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Ur.unrecognized&&t.previousNonDiffingState?.kind===Ur.both&&t.previousNonDiffingState?.smartCombination})}};Ote=D([_(7,Di),_(8,iE)],Ote);function wg(s,e){let t=0;for(const i of s)e(i)&&t++;return t}class l8e{constructor(e){this.baseRange=e,this.accepted=Yt(`BaseRangeState${this.baseRange.baseRange}`,Ld.base),this.handledInput1=Yt(`BaseRangeHandledState${this.baseRange.baseRange}.Input1`,!1),this.handledInput2=Yt(`BaseRangeHandledState${this.baseRange.baseRange}.Input2`,!1),this.computedFromDiffing=!1,this.previousNonDiffingState=void 0,this.handled=et(this,t=>this.handledInput1.read(t)&&this.handledInput2.read(t))}}var Qm;(function(s){s[s.initializing=1]="initializing",s[s.upToDate=2]="upToDate",s[s.updating=3]="updating"})(Qm||(Qm={}));class rjt{constructor(e,t,i,n,r){this.resource=e,this.mergeEditorModelRef=t,this.stateRef=i,this.input1Handled=n,this.input2Handled=r,this.code="undoMarkAsHandled",this.label=g(11381,"Undo Mark As Handled"),this.type=xl.Resource}redo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&is(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&&is(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 d8e="mergeEditorCloseWithConflicts";var WEe;let HEe=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,r,o]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),Bte(e.input1,this._textModelService,t),Bte(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(Fte),d=this._instantiationService.createInstance(Ote,i.object.textEditorModel,r,o,c,l,{resetResult:!0},this._mergeEditorTelemetry);return t.add(d),await d.onInitialized,this._instantiationService.createInstance(UEe,d,t,n.object,e.result)}};HEe=D([_(1,we),_(2,pn),_(3,fi)],HEe);let UEe=class extends BI{constructor(e,t,i,n,r,o,a){super(),this.model=e,this.disposable=t,this.result=i,this.resultUri=n,this.textFileService=r,this.dialogService=o,this.editorService=a,this.savedAltVersionId=Yt(this,this.model.resultTextModel.getAlternativeVersionId()),this.altVersionId=qn(this,c=>this.model.resultTextModel.onDidChangeContent(c),()=>this.model.resultTextModel.getAlternativeVersionId()),this.isDirty=et(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){Q_(()=>e.some(n=>n===this));const t=e.some(n=>n.isDirty.get());let i;if(t){const n=e.length>1,r=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}?",vi(e[0].model.resultTextModel.uri)),o=e.some(c=>c.model.hasUnhandledConflicts.get()),a=[{label:o?g(10665,"&&Save With Conflicts"):g(10666,"&&Save"),run:()=>qh.SAVE},{label:g(10667,"Do&&n't Save"),run:()=>qh.DONT_SAVE}];i=(await this.dialogService.prompt({type:Ze.Info,message:r,detail:o?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:()=>qh.CANCEL}})).result}else i=qh.DONT_SAVE;return i===qh.SAVE?await Promise.all(e.map(n=>n.accept())):i===qh.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){}};UEe=D([_(4,Fr),_(5,ir),_(6,ti)],UEe);var ZR;let VEe=(ZR=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),r=m=>{Yi(e.result,m.resource)&&(n.clear(),i=m)};n.add(this.textFileService.files.onDidCreate(r)),this.textFileService.files.models.forEach(r);const[o,a,c,l]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),Bte(e.input1,this._textModelService,t),Bte(e.input2,this._textModelService,t)]);if(t.add(o),t.add(a),!i)throw new Pi;await i.save({source:WEe.FILE_SAVED_SOURCE});const u=i.textEditorModel.getLinesContent().some(m=>m.startsWith(QQt.start)),f=this._instantiationService.createInstance(Fte),p=this._instantiationService.createInstance(Ote,o.object.textEditorModel,c,l,a.object.textEditorModel,f,{resetResult:u},this._mergeEditorTelemetry);return t.add(p),await p.onInitialized,this._instantiationService.createInstance(zEe,p,t,i,this._mergeEditorTelemetry)}},WEe=ZR,ZR.FILE_SAVED_SOURCE=QJ.registerSource("merge-editor.source",g(10675,"Before Resolving Conflicts In Merge Editor")),ZR);VEe=WEe=D([_(1,we),_(2,pn),_(3,Fr)],VEe);let zEe=class extends BI{constructor(e,t,i,n,r,o){super(),this.model=e,this.disposableStore=t,this.resultTextFileModel=i,this.telemetry=n,this._dialogService=r,this._storageService=o,this.isDirty=qn(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(r=>r.isDirty.get()),n=e.some(r=>r.model.hasUnhandledConflicts.get());if(i){const r=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}?",vi(e[0].resultUri)),{result:o}=await this._dialogService.prompt({type:Ze.Info,message:r,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:()=>qh.SAVE},{label:g(10684,"Do&&n't Save"),run:()=>qh.DONT_SAVE}],cancelButton:{run:()=>qh.CANCEL}});return o}else if(n&&!this._storageService.getBoolean(d8e,Ie.PROFILE,!1)){const{confirmed:r,checkboxChecked:o}=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}?",vi(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 o&&this._storageService.store(d8e,!0,Ie.PROFILE,cn.USER),r?qh.SAVE:qh.CANCEL}else return qh.SAVE}};zEe=D([_(4,ir),_(5,Gi)],zEe);async function Bte(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 $Ee=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",{})}};$Ee=D([_(0,Ji)],$Ee);var zV,eM;let GEe=(eM=class extends gb{get useWorkingCopy(){return this.configurationService.getValue("mergeEditor.useWorkingCopy")??!1}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(n,void 0,o,a,c,l,h,u,f),this.base=e,this.input1=t,this.input2=i,this.result=n,this._instaService=r,this.configurationService=d,this.closeHandler={showConfirm:()=>this._inputModel?.shouldConfirmClose()??!1,confirm:async p=>{Q_(()=>p.every(v=>v.editor instanceof zV));const m=p.map(v=>v.editor._inputModel).filter(Oc);return await this._inputModel.confirmClose(m)}},this.mergeEditorModeFactory=this._instaService.createInstance(this.useWorkingCopy?HEe:VEe,this._instaService.createInstance($Ee))}dispose(){super.dispose()}get typeId(){return zV.ID}get editorId(){return lm.id}get capabilities(){let e=super.capabilities|xi.MultipleEditors;return this.useWorkingCopy&&(e|=xi.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(ci(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 zV?Yi(this.base,e.base)&&Yi(this.input1.uri,e.input1.uri)&&Yi(this.input2.uri,e.input2.uri)&&Yi(this.result,e.result):Ab(e)?(this.editorId===e.options?.override||e.options?.override===void 0)&&Yi(this.base,e.base.resource)&&Yi(this.input1.uri,e.input1.resource)&&Yi(this.input2.uri,e.input2.resource)&&Yi(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)}},zV=eM,eM.ID="mergeEditor.Input",eM);GEe=zV=D([_(4,we),_(5,ti),_(6,Fr),_(7,Os),_(8,Xt),_(9,Te),_(10,bd),_(11,xc),_(12,cE)],GEe);const ojt=oi("multi-diff-editor-label-icon",ve.diffMultiple,g(10264,"Icon of the multi diff editor label."));class h8e{constructor(e,t,i){if(this.originalUri=e,this.modifiedUri=t,this.goToFileUri=i,!e&&!t)throw new Pi("Invalid arguments")}getKey(){return JSON.stringify([this.modifiedUri?.toString(),this.originalUri?.toString()])}}const ajt=je.as(Pn.Configuration),cjt={...eG,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"}}}};ajt.registerConfiguration(cjt);var C$;(function(s){s.builtin="builtin",s.option="option",s.exclusive="exclusive",s.default="default"})(C$||(C$={}));var pz;(function(s){s[s.ABORT=1]="ABORT",s[s.NONE=2]="NONE"})(pz||(pz={}));function ljt(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(zi.sep)>=0?`${e.scheme}:${e.path}`:vi(e);return jO(typeof s=="string"?s.toLowerCase():s,n.toLowerCase())}var JP,tM;let uB=(tM=class extends Ub{static fromResourceMultiDiffEditorInput(e,t){if(!e.multiDiffSource&&!e.resources)throw new Pi("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(JP,i,e.label,e.resources?.map(n=>new h8e(n.original.resource,n.modified.resource,n.goToFileResource)),e.isTransient??!1)}static fromSerialized(e,t){return t.createInstance(JP,N.parse(e.multiDiffSourceUri),e.label,e.resources?.map(i=>new h8e(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 xi.Readonly}get typeId(){return JP.ID}getName(){return this._name}get editorId(){return lm.id}getIcon(){return ojt}constructor(e,t,i,n=!1,r,o,a,c,l){super(),this.multiDiffSource=e,this.label=t,this.initialResources=i,this.isTransient=n,this._textModelService=r,this._textResourceConfigurationService=o,this._instantiationService=a,this._multiDiffSourceResolverService=c,this._textFileService=l,this._name="",this._viewModel=new iht(async()=>{const d=await this._createModel();this._register(d);const h=new uXe(d,this._instantiationService);return this._register(h),await JKe(h.waitForDiffs(),1e3),h}),this._resolvedSource=new $0t(async()=>{const d=this.initialResources?{resources:cKe.const(this.initialResources)}:await this._multiDiffSourceResolverService.resolve(this.multiDiffSource);return{source:d,resources:d?JYe(this,d.resources):rd([])}}),this.resources=et(this,d=>this._resolvedSource.cachedPromiseResult.read(d)?.data?.resources.read(d)),this._isDirtyObservables=lJ(this,this.resources.map(d=>d??[]),d=>{const h=d.modifiedUri?u8e(this._textFileService,d.modifiedUri):rd(!1),u=d.originalUri?u8e(this._textFileService,d.originalUri):rd(!1);return et(f=>h.read(f)||u.read(f))},d=>d.getKey()),this._isDirtyObservable=et(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 qh.DONT_SAVE},showConfirm(){return!1}},this._register(ci(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 r=n.modified??n.original;r&&r.setLanguage(e,t)}async getViewModel(){return this._viewModel.getPromise()}async _createModel(){const e=await this._resolvedSource.getPromise(),t=this._textResourceConfigurationService,i=lJ(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),bt(m);return}const f=c.modifiedUri??c.originalUri,p={multiDiffEditorItem:c,original:d?.object.textEditorModel,modified:h?.object.textEditorModel,get options(){return{...djt(h?.object.isReadonly()??!0),...hjt(t.getValue(f))}},onOptionsDidChange:m=>this._textResourceConfigurationService.onDidChangeConfiguration(v=>{(v.affectsConfiguration(f,"editor")||v.affectsConfiguration(f,"diffEditor"))&&m()})};return l.add(fW.createOfNonDisposable(p,u,this))},c=>JSON.stringify([c.modifiedUri?.toString(),c.originalUri?.toString()])),n=Yt("documents",[]),r=et(async c=>{const l=i.read(c),h=(await Promise.all(l)).filter(Oc);n.set(h,void 0)}),o=VN(r);return await r.get(),{dispose:()=>o.dispose(),documents:new _Re(n),contextKeys:e.source?.contextKeys}}matches(e){return super.matches(e)?!0:e instanceof JP?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 r=>{const o=r.diffEditorViewModel.model,a=o.original.uri.scheme!==pe.untitled&&this._textFileService.isDirty(o.original.uri);await Promise.all([a?e==="save"?this._textFileService.save(o.original.uri,i):this._textFileService.revert(o.original.uri,i):Promise.resolve(),e==="save"?this._textFileService.save(o.modified.uri,i):this._textFileService.revert(o.modified.uri,i)])}))}},JP=tM,tM.ID="workbench.input.multiDiffEditor",tM);uB=JP=D([_(4,pn),_(5,xc),_(6,we),_(7,iZe),_(8,Fr)],uB);function u8e(s,e){return qn(M.filter(s.files.onDidChangeDirty,t=>t.resource.toString()===e.toString()),()=>s.isDirty(e))}function djt(s){return{readOnly:!!s,readOnlyMessage:typeof s!="boolean"?s:void 0}}function hjt(s){const e=Ds(s.editor);if(In(s.diffEditor)){const t=Ds(s.diffEditor);t.diffCodeLens=t.codeLens,delete t.codeLens,t.diffWordWrap=t.wordWrap,delete t.wordWrap,Object.assign(e,t)}return e}var t2;let g8e=(t2=class extends V{constructor(e,t){super(),this._register(e.registerEditor("*",{id:lm.id,label:lm.displayName,detail:lm.providerDisplayName,priority:C$.builtin},{},{createMultiDiffEditorInput:i=>({editor:uB.fromResourceMultiDiffEditorInput(i,t)})}))}},t2.ID="workbench.contrib.multiDiffEditorResolver",t2);g8e=D([_(0,KU),_(1,we)],g8e);var f8e;(function(s){s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.Up=2]="Up",s[s.Down=3]="Down"})(f8e||(f8e={}));var p8e;(function(s){s[s.Connecting=0]="Connecting",s[s.Connected=1]="Connected"})(p8e||(p8e={}));const m8e="terminalEditor";var _8e;(function(s){s[s.SearchHighlightLimit=1e3]="SearchHighlightLimit"})(_8e||(_8e={}));var v8e;(function(s){s[s.Unknown=1]="Unknown",s[s.Fedora=2]="Fedora",s[s.Ubuntu=3]="Ubuntu"})(v8e||(v8e={}));var b8e;(function(s){s.Terminals="Terminals"})(b8e||(b8e={}));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 qK=W("terminal.selectionBackground",kS,g(9050,"The selection background color of the terminal."));W("terminal.inactiveSelectionBackground",{light:rt(qK,.5),dark:rt(qK,.5),hcDark:rt(qK,.7),hcLight:rt(qK,.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",bMe,g(9057,"The color of the border that separates split panes within the terminal. This defaults to panel.border."));W("terminalOverviewRuler.border",YQe,g(9058,"The overview ruler left-side border color."));W("terminal.findMatchBackground",{dark:mBe,light:mBe,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",rt(Ppt,.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:yb,light:yb,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:u5,light:u5,hcDark:"#f38518",hcLight:"#0F4A85"},g(9063,"Overview ruler marker color for find matches in the terminal."));W("terminal.dropBackground",vMe,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",jve,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 ujt(s){let e;if(typeof s=="string"?e=s:s.color?e=s.color.replace(/\./g,"_"):He.isThemeIcon(s.icon)&&s.icon.color&&(e=s.icon.color.id.replace(/\./g,"_")),e)return`terminal-icon-${e.replace(/\./g,"_")}`}function gjt(s,e,t){const i=s.icon;if(!i)return;const n=[];let r;if(i instanceof N?r=i:i instanceof Object&&"light"in i&&"dark"in i&&(r=e===ef.LIGHT?i.light:i.dark),r instanceof N){const a=`terminal-uri-icon-${Hc(r.path).toString(36)}`;n.push(a),n.push("terminal-uri-icon")}return n}var KEe;(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"})(KEe||(KEe={}));const fjt=[KEe.FocusAccessibleBuffer];var yw;(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"})(yw||(yw={}));const pjt=[yw.FindFocus,yw.FindHide,yw.FindNext,yw.FindPrevious,yw.ToggleFindRegex,yw.ToggleFindWholeWord,yw.ToggleFindCaseSensitive,yw.SearchWorkspace];var Cw;(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"})(Cw||(Cw={}));const mjt=[Cw.SelectPrevSuggestion,Cw.SelectPrevPageSuggestion,Cw.SelectNextSuggestion,Cw.SelectNextPageSuggestion,Cw.AcceptSelectedSuggestion,Cw.AcceptSelectedSuggestionEnter,Cw.HideSuggestWidget,Cw.ClearSuggestCache],_jt="terminal";var w8e;(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"})(w8e||(w8e={}));var _n;(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"})(_n||(_n={}));[_n.ClearSelection,_n.Clear,_n.CopyAndClearSelection,_n.CopySelection,_n.CopySelectionAsHtml,_n.CopyLastCommand,_n.CopyLastCommandOutput,_n.CopyLastCommandAndLastCommandOutput,_n.DeleteToLineStart,_n.DeleteWordLeft,_n.DeleteWordRight,_n.GoToRecentDirectory,_n.FocusNextPane,_n.FocusNext,_n.FocusPreviousPane,_n.FocusPrevious,_n.Focus,_n.SizeToContentWidth,_n.Kill,_n.KillEditor,_n.MoveToEditor,_n.MoveToLineEnd,_n.MoveToLineStart,_n.MoveToTerminalPanel,_n.NewInActiveWorkspace,_n.New,_n.Paste,_n.PasteSelection,_n.ResizePaneDown,_n.ResizePaneLeft,_n.ResizePaneRight,_n.ResizePaneUp,_n.RunActiveFile,_n.RunSelectedText,_n.RunRecentCommand,_n.ScrollDownLine,_n.ScrollDownPage,_n.ScrollToBottom,_n.ScrollToNextCommand,_n.ScrollToPreviousCommand,_n.ScrollToTop,_n.ScrollUpLine,_n.ScrollUpPage,_n.SendSequence,_n.SelectAll,_n.SelectToNextCommand,_n.SelectToNextLine,_n.SelectToPreviousCommand,_n.SelectToPreviousLine,_n.SplitInActiveWorkspace,_n.Split,_n.Toggle,_n.FocusHover,eh.OpenAccessibilityHelp,...fjt,...pjt,...mjt];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 fo;(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"})(fo||(fo={}));var qEe;(function(s){s.isOpen=new Q(fo.IsOpen,!1,!0),s.focus=new Q(fo.Focus,!1,g(8951,"Whether the terminal is focused.")),s.focusInAny=new Q(fo.FocusInAny,!1,g(8952,"Whether any terminal is focused, including detached terminals used in other UI.")),s.editorFocus=new Q(fo.EditorFocus,!1,g(8953,"Whether a terminal in the editor area is focused.")),s.count=new Q(fo.Count,0,g(8954,"The current number of terminals.")),s.groupCount=new Q(fo.GroupCount,0,!0),s.tabsNarrow=new Q(fo.TabsNarrow,!1,!0),s.terminalHasFixedWidth=new Q(fo.HasFixedWidth,!1,!0),s.tabsFocus=new Q(fo.TabsFocus,!1,g(8955,"Whether the terminal tabs widget is focused.")),s.webExtensionContributedProfile=new Q(fo.WebExtensionContributedProfile,!1,!0),s.terminalHasBeenCreated=new Q(fo.TerminalHasBeenCreated,!1,!0),s.terminalEditorActive=new Q(fo.TerminalEditorActive,!1,!0),s.tabsMouse=new Q(fo.TabsMouse,!1,!0),s.shellType=new Q(fo.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(fo.AltBufferActive,!1,g(8957,"Whether the terminal's alt buffer is active.")),s.suggestWidgetVisible=new Q(fo.SuggestWidgetVisible,!1,g(8958,"Whether the terminal's suggest widget is visible.")),s.notFocus=s.focus.toNegated(),s.viewShowing=new Q(fo.ViewShowing,!1,g(8959,"Whether the terminal view is showing")),s.textSelected=new Q(fo.TextSelected,!1,g(8960,"Whether text is selected in the active terminal.")),s.textSelectedInFocused=new Q(fo.TextSelectedInFocused,!1,g(8961,"Whether text is selected in a focused terminal.")),s.notTextSelected=s.textSelected.toNegated(),s.findVisible=new Q(fo.FindVisible,!1,!0),s.notFindVisible=s.findVisible.toNegated(),s.findInputFocus=new Q(fo.FindInputFocused,!1,!0),s.findFocus=new Q(fo.FindFocused,!1,!0),s.notFindFocus=s.findInputFocus.toNegated(),s.processSupported=new Q(fo.ProcessSupported,!1,g(8962,"Whether terminal processes can be launched in the current workspace.")),s.tabsSingularSelection=new Q(fo.TabsSingularSelection,!1,g(8963,"Whether one terminal is selected in the terminal tabs list.")),s.splitTerminal=new Q(fo.SplitTerminal,!1,g(8964,"Whether the focused tab's terminal is a split terminal.")),s.inTerminalRunCommandPicker=new Q(fo.InTerminalRunCommandPicker,!1,g(8965,"Whether the terminal run command picker is currently open.")),s.terminalShellIntegrationEnabled=new Q(fo.TerminalShellIntegrationEnabled,!1,g(8966,"Whether shell integration is enabled in the active terminal")),s.shouldShowViewInlineActions=he.and(he.equals("view",_jt),he.notEquals(`config.${zw.TabsHideCondition}`,"never"),he.or(he.not(`config.${zw.TabsEnabled}`),he.and(he.equals(`config.${zw.TabsShowActions}`,"singleTerminal"),he.equals(fo.GroupCount,1)),he.and(he.equals(`config.${zw.TabsShowActions}`,"singleTerminalOrNarrow"),he.or(he.equals(fo.GroupCount,1),he.has(fo.TabsNarrow))),he.and(he.equals(`config.${zw.TabsShowActions}`,"singleGroup"),he.equals(fo.GroupCount,1)),he.equals(`config.${zw.TabsShowActions}`,"always")))})(qEe||(qEe={}));var _j,iM;let QEe=(iM=class extends Ub{setGroup(e){this._group=e,e?.scopedContextKeyService&&this._terminalInstance?.setParentContextKeyService(e.scopedContextKeyService)}get group(){return this._group}get typeId(){return _j.ID}get editorId(){return m8e}get capabilities(){return xi.Readonly|xi.Singleton|xi.CanDropIntoEditor|xi.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||{},yW.Editor);return e.focusWhenReady(),this._copyLaunchConfig=void 0,this._instantiationService.createInstance(_j,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(zw.ConfirmOnKill);return(e==="editor"||e==="always")&&this._terminalInstance?.hasChildProcesses||!1}async confirm(e){const{confirmed:t}=await this._dialogService.confirm({type:Ze.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(8931,"Closing will terminate the running processes in the terminals."):g(8932,"Closing will terminate the running processes in this terminal.")});return t?qh.DONT_SAVE:qh.CANCEL}async revert(){this._isReverted=!0}constructor(e,t,i,n,r,o,a,c,l){super(),this.resource=e,this._terminalInstance=t,this._themeService=i,this._terminalInstanceService=n,this._instantiationService=r,this._configurationService=o,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=qEe.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(NT.User),wt([t,i])}));const n=[e.onExit(r=>{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(r=>{this._isShuttingDown=!0,wt(n),this._configurationService.getValue(zw.EnablePersistentSessions)&&r.reason===pD.RELOAD?e.detachProcessAndDispose(NT.Shutdown):e.dispose(NT.Shutdown)})}getName(){return this._terminalInstance?.title||this.resource.fragment}getIcon(){if(!(!this._terminalInstance||!He.isThemeIcon(this._terminalInstance.icon)))return this._terminalInstance.icon}getLabelExtraClasses(){if(!this._terminalInstance)return[];const e=["terminal-tab","predefined-file-icon"],t=ujt(this._terminalInstance);t&&e.push(t);const i=gjt(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:m8e,pinned:!0,forceReload:!0}}}},_j=iM,iM.ID="workbench.editors.terminal",iM);QEe=_j=D([_(2,mn),_(3,hZe),_(4,we),_(5,Te),_(6,rg),_(7,Le),_(8,ir)],QEe);let y8e=class{constructor(e,t,i,n,r){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 mr,this._proxy=e.getProxy(Je.ExtHostEditorTabs),this._dispoables.add(r.onDidEditorsChange(o=>{try{this._updateTabsModel(o)}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 GEe)return{kind:ua.TextMergeInput,base:e.base,input1:e.input1.uri,input2:e.input2.uri,result:e.resource};if(e instanceof gb)return{kind:ua.TextInput,uri:e.resource};if(e instanceof cp&&!(e instanceof Yg)){const t=e.primary.resource,i=e.secondary.resource;return e.primary instanceof gb&&e.secondary instanceof gb&&Yi(t,i)&&t&&i?{kind:ua.TextInput,uri:t}:{kind:ua.UnknownInput}}if(e instanceof nL)return{kind:ua.NotebookInput,notebookType:e.viewType,uri:e.resource};if(e instanceof hB)return{kind:ua.CustomEditorInput,viewType:e.viewType,uri:e.resource};if(e instanceof Wu)return{kind:ua.WebviewEditorInput,viewType:e.viewType};if(e instanceof QEe)return{kind:ua.TerminalEditorInput};if(e instanceof Yg){if(e.modified instanceof gb&&e.original instanceof gb)return{kind:ua.TextDiffInput,modified:e.modified.resource,original:e.original.resource};if(e.modified instanceof nL&&e.original instanceof nL)return{kind:ua.NotebookDiffInput,notebookType:e.original.viewType,modified:e.modified.resource,original:e.original.resource}}if(e instanceof OEe)return{kind:ua.InteractiveEditorInput,uri:e.resource,inputBoxUri:e.inputResource};if(e instanceof mCe)return{kind:ua.ChatEditorInput};if(e instanceof uB){const t=[];for(const i of e?.resources.get()??[])i.originalUri&&i.modifiedUri&&t.push({kind:ua.TextDiffInput,original:i.originalUri,modified:i.modifiedUri});return{kind:ua.MultiDiffEditorInput,diffEditors:t}}return{kind:ua.UnknownInput}}_generateTabId(e,t){let i;const n=Pa.getCanonicalUri(e,{supportSideBySide:Us.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),r=this._tabInfoLookup.get(n);r?(r.tab.label=t.getName(),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:r.tab,kind:mh.TAB_UPDATE})):(this._logService.error("Invalid model for label change, rebuilding"),this._createTabsModel())}_onDidTabOpen(e,t,i){const n=this._editorGroupsService.getGroup(e),r=this._groupLookup.get(e)!==void 0;if(!n||!r){this._createTabsModel();return}const o=this._groupLookup.get(e)?.tabs;if(!o)return;const a=this._buildTabObject(n,t,i);o.splice(i,0,a);const c=this._generateTabId(t,e);this._tabInfoLookup.set(c,{group:n,editorInput:t,tab:a}),t instanceof uB&&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:mh.TAB_UPDATE}))})),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:a,kind:mh.TAB_OPEN})}_onDidTabClose(e,t){const i=this._editorGroupsService.getGroup(e),n=this._groupLookup.get(e)?.tabs;if(!i||!n){this._createTabsModel();return}const r=n.splice(t,1);r.length!==0&&(this._tabInfoLookup.delete(r[0]?.id??""),r[0]?.input instanceof uB&&this._multiDiffEditorInputListeners.deleteAndDispose(r[0]?.input),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:r[0],kind:mh.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:mh.TAB_UPDATE})}_onDidTabDirty(e,t,i){const n=this._generateTabId(i,e),r=this._tabInfoLookup.get(n);if(!r){this._logService.error("Invalid model for dirty change, rebuilding"),this._createTabsModel();return}r.tab.isDirty=i.isDirty(),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:r.tab,kind:mh.TAB_UPDATE})}_onDidTabPinChange(e,t,i){const n=this._generateTabId(i,e),r=this._tabInfoLookup.get(n),o=r?.group,a=r?.tab;if(!o||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPinned=o.isSticky(t),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:a,kind:mh.TAB_UPDATE})}_onDidTabPreviewChange(e,t,i){const n=this._generateTabId(i,e),r=this._tabInfoLookup.get(n),o=r?.group,a=r?.tab;if(!o||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPreview=!o.isPinned(t),this._proxy.$acceptTabOperation({kind:mh.TAB_UPDATE,groupId:e,tabDto:a,index:t})}_onDidTabMove(e,t,i,n){const r=this._groupLookup.get(e)?.tabs;if(!r){this._logService.error("Invalid model for move change, rebuilding"),this._createTabsModel();return}const o=r.splice(i,1);o.length!==0&&(r.splice(t,0,o[0]),this._proxy.$acceptTabOperation({kind:mh.TAB_MOVE,groupId:e,tabDto:o[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:uI(this._editorGroupsService,t),tabs:[]};t.editors.forEach((n,r)=>{const o=this._buildTabObject(t,n,r);e.push(o),this._tabInfoLookup.set(this._generateTabId(n,t.id),{group:t,tab:o,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 Dr.GROUP_ACTIVE:if(i===this._editorGroupsService.activeGroup.id){this._onDidGroupActivate();break}else return;case Dr.EDITOR_LABEL:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabLabelChange(i,t.editor,t.editorIndex);break}case Dr.EDITOR_OPEN:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabOpen(i,t.editor,t.editorIndex);break}case Dr.EDITOR_CLOSE:if(t.editorIndex!==void 0){this._onDidTabClose(i,t.editorIndex);break}case Dr.EDITOR_ACTIVE:if(t.editorIndex!==void 0){this._onDidTabActiveChange(i,t.editorIndex);break}case Dr.EDITOR_DIRTY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabDirty(i,t.editorIndex,t.editor);break}case Dr.EDITOR_STICKY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPinChange(i,t.editorIndex,t.editor);break}case Dr.EDITOR_PIN:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPreviewChange(i,t.editorIndex,t.editor);break}case Dr.EDITOR_TRANSIENT:break;case Dr.EDITOR_MOVE:if($Qt(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 r=GZ(this._editorGroupsService,this._configurationService,i),o=this._tabInfoLookup.get(e);if(!o?.tab)throw new Error(`Attempted to close tab with id ${e} which does not exist`);let c;const l=this._editorGroupsService.getGroup(o.group.id);if(!l)return;if(this._groupLookup.get(r)===void 0){let h=qW.RIGHT;i===nv&&(h=QW(this._configurationService)),c=this._editorGroupsService.addGroup(this._editorGroupsService.groups[this._editorGroupsService.groups.length-1],h)}else c=this._editorGroupsService.getGroup(r);if(!c)return;(t<0||t>c.editors.length)&&(t=c.editors.length);const d=o?.editorInput;d&&l.moveEditor(d,c,{index:t,preserveFocus:n})}async $closeTab(e,t){const i=new Map;for(const r of e){const o=this._tabInfoLookup.get(r),a=o?.tab,c=o?.group,l=o?.editorInput;if(!c||!a||!o||!l)continue;const d=i.get(c);d?d.push(l):i.set(c,[l])}const n=[];for(const[r,o]of i)n.push(await r.closeEditors(o,{preserveFocus:t}));return n.every(r=>r)}async $closeGroup(e,t){const i=[];for(const n of e){const r=this._editorGroupsService.getGroup(n);r&&(i.push(await r.closeAllEditors()),r.count===0&&this._editorGroupsService.getGroup(r.id)&&this._editorGroupsService.removeGroup(r))}return i.every(n=>n)}};y8e=D([Ki(We.MainThreadEditorTabs),_(1,Pr),_(2,Te),_(3,Ke),_(4,ti)],y8e);let C8e=class{dispose(){}$onUnexpectedError(e){e&&e.$isError&&(e=_8(e)),bt(e)}};C8e=D([Ki(We.MainThreadErrors)],C8e);let S8e=class{constructor(e,t,i,n,r,o,a,c,l){this._extensionService=t,this._notificationService=i,this._extensionsWorkbenchService=n,this._hostService=r,this._extensionEnablementService=o,this._timerService=a,this._commandService=c,this._environmentService=l,this._extensionHostKind=e.extensionHostKind;const d=e;this._internalExtensionService=d.internalExtensionService,d._setExtensionHostProxy(new vjt(e.getProxy(Je.ExtHostExtensionService))),d._setAllMainProxyIdentifiers(Object.keys(We).map(h=>We[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,r){this._internalExtensionService._onDidActivateExtension(e,t,i,n,r)}$onExtensionRuntimeError(e,t){const i=_8(t);this._internalExtensionService._onExtensionRuntimeError(e,i),console.error(`[${e.value}]${i.message}`),console.error(i.stack)}async $onExtensionActivationError(e,t,i){const n=_8(t);if(this._internalExtensionService._onDidActivateExtensionError(e,n),i){const o=await this._extensionService.getExtension(e.value);if(o){const c=(await this._extensionsWorkbenchService.queryLocal()).find(l=>Ma(l.identifier,{id:i.dependency}));if(c?.local){await this._handleMissingInstalledDependency(o,c.local);return}else{await this._handleMissingNotInstalledDependency(o,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:Ze.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 an("reload",g(4831,"Reload Window"),"",!0,()=>this._hostService.reload())]}});else{const n=this._extensionEnablementService.getEnablementState(t);n===Ko.DisabledByVirtualWorkspace?this._notificationService.notify({severity:Ze.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===Ko.DisabledByTrustRequirement?this._notificationService.notify({severity:Ze.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 an("manageWorkspaceTrust",g(4834,"Manage Workspace Trust"),"",!0,()=>this._commandService.executeCommand("workbench.trust.manage"))]}}):this._extensionEnablementService.canChangeEnablement(t)?this._notificationService.notify({severity:Ze.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 an("enable",g(4836,"Enable and Reload"),"",!0,()=>this._extensionEnablementService.setEnablement([t],n===Ko.DisabledGlobally?Ko.EnabledGlobally:Ko.EnabledWorkspace).then(()=>this._hostService.reload(),r=>this._notificationService.error(r)))]}}):this._notificationService.notify({severity:Ze.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}],Ue.None))[0]}catch{}n?this._notificationService.notify({severity:Ze.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 an("install",g(4839,"Install and Reload"),"",!0,()=>this._extensionsWorkbenchService.install(n).then(()=>this._hostService.reload(),r=>this._notificationService.error(r)))]}}):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===dr.LocalProcess?this._timerService.setPerformanceMarks("localExtHost",e):this._extensionHostKind===dr.LocalWebWorker?this._timerService.setPerformanceMarks("workerExtHost",e):this._timerService.setPerformanceMarks("remoteExtHost",e)}async $asBrowserUri(e){return sf.uriToBrowserUri(N.revive(e))}async $getAllStaticBrowserUris(){return Array.from(sf.getRegisteredBrowserUris(),e=>[e,sf.uriToBrowserUri(e)])}};S8e=D([Ki(We.MainThreadExtensionService),_(1,ps),_(2,wi),_(3,Xr),_(4,Dc),_(5,Fl),_(6,PZe),_(7,bi),_(8,Xo)],S8e);class vjt{constructor(e){this._actual=e}async resolveAuthority(e,t){return bjt(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 bjt(s){return s.type==="ok"?{type:"ok",value:{...s.value,authority:wjt(s.value.authority)}}:s}function wjt(s){return{...s,connectTo:yjt(s.connectTo)}}function yjt(s){return s.type===eH.WebSocket?new jnt(s.host,s.port):new Qnt(s.id)}var Vm;let A8e=Vm=class{constructor(e,t){this._fileService=t,this._fileProvider=new mr,this._disposables=new Z,this._proxy=e.getProxy(Je.ExtHostFileSystem);const i=e.getProxy(Je.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 OPe(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?up.Readonly:void 0,type:Vm._asFileType(t)})).catch(Vm._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,Vm._asFileType(i)]):[]}).catch(Vm._handleError)}static _asFileType(e){let t=0;return e.isFile?t+=rn.File:e.isDirectory&&(t+=rn.Directory),e.isSymbolicLink&&(t+=rn.SymbolicLink),t}$readFile(e){return this._fileService.readFile(N.revive(e)).then(t=>t.value).catch(Vm._handleError)}$writeFile(e,t){return this._fileService.writeFile(N.revive(e),t).then(()=>{}).catch(Vm._handleError)}$rename(e,t,i){return this._fileService.move(N.revive(e),N.revive(t),i.overwrite).then(()=>{}).catch(Vm._handleError)}$copy(e,t,i){return this._fileService.copy(N.revive(e),N.revive(t),i.overwrite).then(()=>{}).catch(Vm._handleError)}$mkdir(e){return this._fileService.createFolder(N.revive(e)).then(()=>{}).catch(Vm._handleError)}$delete(e,t){return this._fileService.del(N.revive(e),t).catch(Vm._handleError)}static _handleError(e){if(e instanceof Rd)switch(e.fileOperationResult){case ji.FILE_NOT_FOUND:e.name=ot.FileNotFound;break;case ji.FILE_IS_DIRECTORY:e.name=ot.FileIsADirectory;break;case ji.FILE_PERMISSION_DENIED:e.name=ot.NoPermissions;break;case ji.FILE_MOVE_CONFLICT:e.name=ot.FileExists;break}else if(e instanceof Error){const t=Qk(e);t!==ot.Unknown&&(e.name=t)}throw e}$ensureActivation(e){return this._fileService.activateProvider(e)}};A8e=Vm=D([Ki(We.MainThreadFileSystem),_(1,Xt)],A8e);class OPe{constructor(e,t,i,n,r,o){this.readOnlyMessage=n,this._handle=r,this._proxy=o,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(OPe._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,Ge.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,r){return this._proxy.$read(this._handle,e,t,r).then(o=>(i.set(o.buffer,n),o.byteLength))}write(e,t,i,n,r){return this._proxy.$write(this._handle,e,t,Ge.wrap(i).slice(n,n+r))}}const uoe=class uoe 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 yn),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 li(C),L=setTimeout(()=>A.cancel(),y),k=await r.withProgress({location:fd.Notification,title:this._progressLabel(b),cancellable:!0,delay:Math.min(y/2,3e3)},()=>{const z=p._proxy.$onWillRunFileOperation(b,v,y,A.token);return $_(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(vj.MementoKeyAdditionalEdits,Ie.PROFILE);if(l.extensionTestsLocationURI&&(R=!1),R===void 0){let z;if(k.extensionNames.length===1?b===Ei.CREATE?z=g(4841,"Extension '{0}' wants to make refactoring changes with this file creation",k.extensionNames[0]):b===Ei.COPY?z=g(4842,"Extension '{0}' wants to make refactoring changes with this file copy",k.extensionNames[0]):b===Ei.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===Ei.CREATE?z=g(4845,"{0} extensions want to make refactoring changes with this file creation",k.extensionNames.length):b===Ei.COPY?z=g(4846,"{0} extensions want to make refactoring changes with this file copy",k.extensionNames.length):b===Ei.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 o.confirm({type:Ze.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 o.prompt({type:Ze.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(vj.MementoKeyAdditionalEdits,R,Ie.PROFILE,cn.USER)}}c.info("[onWill-handler] applying additional workspace edit from extensions",k.extensionNames),await n.apply(Vy(k.edit,d),{undoRedoGroupId:w?.undoRedoGroupId,showPreview:R})}_progressLabel(v){switch(v){case Ei.CREATE:return g(4853,"Running 'File Create' participants...");case Ei.MOVE:return g(4854,"Running 'File Rename' participants...");case Ei.COPY:return g(4855,"Running 'File Copy' participants...");case Ei.DELETE:return g(4856,"Running 'File Delete' participants...");case Ei.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,r){const o=N.revive(i),a={...n};if(a.recursive)try{(await this._fileService.stat(o)).isDirectory||(a.recursive=!1)}catch{}if(r){this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching correlated (extension: ${e}, path: ${o.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=new Z,l=c.add(this._fileService.createWatcher(o,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: ${o.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=this._contextService.getWorkspaceFolder(o);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=`${qy(h,"/")}/${P1}`;a.includes.push(Cjt(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: ${o.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);return}}const l=this._fileService.watch(o,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()}},vj=nM,nM.MementoKeyAdditionalEdits="file.particpants.additionalEdits",nM);jEe=vj=D([Ki(We.MainThreadFileSystemEventService),_(1,Xt),_(2,qb),_(3,UN),_(4,hg),_(5,ir),_(6,Gi),_(7,Ke),_(8,ec),_(9,Is),_(10,Ci),_(11,Ke),_(12,Te)],jEe);Et(class extends di{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(Gi).remove(jEe.MementoKeyAdditionalEdits,Ie.PROFILE)}});const Ig=Symbol("unset");class Wte{constructor(){this.root=new Zue,this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||ui.empty()}get entries(){return this.root.children?.entries()||ui.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===Ig?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!==Ig){for(this._size--,t[i].node._value=Ig;i>0;i--){const{node:r,part:o}=t[i];if(r.children?.size||r._value!==Ig)break;t[i-1].node.children.delete(o)}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 r=t[n-1];if(r.node.children.delete(t[n].part),r.node.children.size>0||r.node._value!==Ig)break}for(const n of x8e(i))n._value!==Ig&&(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===Ig?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!==Ig)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!==Ig}getPathToKey(e){const t=[{part:"",node:this.root}];let i=0;for(const n of e){const r=t[i].node.children?.get(n);if(!r)return;t.push({part:n,node:r}),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 Zue;n.children.set(a,c),n=c}else{const c=new Zue;n.children=new Map([[a,c]]),n=c}i?.(n)}const r=n._value===Ig?0:1;t(n);const o=n._value===Ig?0:1;this._size+=o-r}*values(){for(const{_value:e}of x8e(this.root))e!==Ig&&(yield e)}}function*x8e(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 Zue=class{constructor(){this._value=Ig}get value(){return this._value===Ig?void 0:this._value}set value(e){this._value=e===void 0?Ig:e}};var s_;(function(s){s.Delimiter="\0"})(s_||(s_={}));var Hv;(function(s){s[s.IsSame=0]="IsSame",s[s.Disconnected=1]="Disconnected",s[s.IsChild=2]="IsChild",s[s.IsParent=3]="IsParent"})(Hv||(Hv={}));class bn{static fromExtHostTestItem(e,t,i=e.parent){if(e._isRoot)return new bn([t]);const n=[e.id];for(let r=i;r&&r.id!==t;r=r.parent)n.push(r.id);return n.push(t),new bn(n.reverse())}static isRoot(e){return!e.includes(s_.Delimiter)}static root(e){const t=e.indexOf(s_.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(e){return new bn(e.split(s_.Delimiter))}static join(e,t){return new bn([...e.path,t])}static joinToString(e,t){return e.toString()+s_.Delimiter+t}static parentId(e){const t=e.lastIndexOf(s_.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){const t=e.lastIndexOf(s_.Delimiter);return t===-1?e:e.slice(t+s_.Delimiter.length)}static isChild(e,t){return t[e.length]===s_.Delimiter&&t.startsWith(e)}static compare(e,t){return e===t?Hv.IsSame:bn.isChild(e,t)?Hv.IsChild:bn.isChild(t,e)?Hv.IsParent:Hv.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?Hv.IsChild:e.viewEnd"runId"in s;var BH;(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))})})(BH||(BH={}));var H_;(function(s){s[s.Error=0]="Error",s[s.Output=1]="Output"})(H_||(H_={}));var Hte;(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?re.lift(t.position):void 0})})(Hte||(Hte={}));var Ute;(function(s){s.serialize=e=>({message:e.message,type:H_.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&BH.serialize(e.location),stackTrace:e.stackTrace?.map(Hte.serialize)}),s.deserialize=(e,t)=>({message:t.message,type:H_.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&BH.deserialize(e,t.location),stackTrace:t.stackTrace&&t.stackTrace.map(i=>Hte.deserialize(e,i))})})(Ute||(Ute={}));const Ajt=(s,e)=>`${e?"s":"e"}${s}`;var Vte;(function(s){s.serialize=e=>({message:e.message,type:H_.Output,offset:e.offset,length:e.length,location:e.location&&BH.serialize(e.location)}),s.deserialize=(e,t)=>({message:t.message,type:H_.Output,offset:t.offset,length:t.length,location:t.location&&BH.deserialize(e,t.location)})})(Vte||(Vte={}));var S$;(function(s){s.serialize=e=>e.type===H_.Error?Ute.serialize(e):Vte.serialize(e),s.deserialize=(e,t)=>t.type===H_.Error?Ute.deserialize(e,t):Vte.deserialize(e,t),s.isDiffable=e=>e.type===H_.Error&&e.actual!==void 0&&e.expected!==void 0})(S$||(S$={}));var _z;(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(S$.serialize)}),s.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(i=>S$.deserialize(e,i))})})(_z||(_z={}));const ort="\0",bj=(s,e)=>s+ort+e,art=s=>{const e=s.indexOf(ort);return{ctrlId:s.slice(0,e),tagId:s.slice(e+1)}};var A$;(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})})(A$||(A$={}));var Md;(function(s){s[s.NotExpandable=0]="NotExpandable",s[s.Expandable=1]="Expandable",s[s.BusyExpanding=2]="BusyExpanding",s[s.Expanded=3]="Expanded"})(Md||(Md={}));var DD;(function(s){s.serialize=e=>({expand:e.expand,item:A$.serialize(e.item)}),s.deserialize=(e,t)=>({controllerId:bn.root(t.item.extId),expand:t.expand,item:A$.deserialize(e,t.item)})})(DD||(DD={}));var E$;(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}}})(E$||(E$={}));const YEe=(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 zte;(function(s){s.serializeWithoutMessages=e=>({...DD.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(_z.serializeWithoutMessages)}),s.serialize=e=>({...DD.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(_z.serialize)}),s.deserialize=(e,t)=>({...DD.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(i=>_z.deserialize(e,i)),retired:!0})})(zte||(zte={}));var JEe;(function(s){s.empty=()=>({covered:0,total:0}),s.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})(JEe||(JEe={}));var XEe;(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:JEe.empty()})})(XEe||(XEe={}));function BPe(s){return{...s,location:s.location?.toJSON()}}function WPe(s){return s.location=s.location?re.isIPosition(s.location)?re.lift(s.location):F.lift(s.location):void 0,s}var WH;(function(s){s[s.Declaration=0]="Declaration",s[s.Statement=1]="Statement",s[s.Branch=2]="Branch"})(WH||(WH={}));var ZEe;(function(s){s.serialize=e=>e.type===WH.Declaration?Gte.serialize(e):Kte.serialize(e),s.deserialize=e=>e.type===WH.Declaration?Gte.deserialize(e):Kte.deserialize(e)})(ZEe||(ZEe={}));var $te;(function(s){s.serialize=BPe,s.deserialize=WPe})($te||($te={}));var Gte;(function(s){s.serialize=BPe,s.deserialize=WPe})(Gte||(Gte={}));var Kte;(function(s){s.serialize=e=>({...BPe(e),branches:e.branches?.map($te.serialize)}),s.deserialize=e=>({...WPe(e),branches:e.branches?.map($te.deserialize)})})(Kte||(Kte={}));var pa;(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"})(pa||(pa={}));var HH;(function(s){s.deserialize=(e,t)=>t.op===pa.Add?{op:t.op,item:DD.deserialize(e,t.item)}:t.op===pa.Update?{op:t.op,item:E$.deserialize(t.item)}:t.op===pa.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(N.revive(t.uri)),docv:t.docv}:t,s.serialize=e=>e.op===pa.Add?{op:e.op,item:DD.serialize(e.item)}:e.op===pa.Update?{op:e.op,item:E$.serialize(e.item)}:e})(HH||(HH={}));class Ejt{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 pa.Add:this.add(DD.deserialize(this.uriIdentity,i.item),t);break;case pa.Update:this.update(E$.deserialize(i.item),t);break;case pa.Remove:this.remove(i.itemId,t);break;case pa.Retire:this.retireTest(i.itemId);break;case pa.IncrementPendingExtHosts:this.updatePendingRoots(i.amount);break;case pa.AddTag:this._tags.set(i.tag.id,i.tag);break;case pa.RemoveTag:this._tags.delete(i.id);break}t.complete?.()}add(e,t){const i=bn.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 r=this.items.get(i);r.children.add(e.item.extId),n=this.createItem(e,r),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===Md.BusyExpanding&&this.busyControllerCount++,n}update(e,t){const i=this.items.get(e.extId);if(i)return e.expand!==void 0&&(i.expand===Md.BusyExpanding&&this.busyControllerCount--,e.expand===Md.BusyExpanding&&this.busyControllerCount++),YEe(i,e),t.update?.(i),i}remove(e,t){const i=this.items.get(e);if(!i)return;const n=bn.parentId(i.item.extId)?.toString();n?this.items.get(n).children.delete(i.item.extId):this.roots.delete(i);const r=[[e]];for(;r.length;)for(const o of r.pop()){const a=this.items.get(o);a&&(r.push(a.children),this.items.delete(o),t.remove?.(a,a!==i),a.expand===Md.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}}var Vd;(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"})(Vd||(Vd={}));const O4=(s,e)=>s===e,xjt={range:(s,e)=>s===e?!0:!s||!e?!1:s.equalsRange(e),busy:O4,label:O4,description:O4,error:O4,sortText:O4,tags:(s,e)=>!(s.length!==e.length||s.some(t=>!e.includes(t)))},Djt=Object.entries(xjt),kjt=(s,e)=>{let t;for(const[i,n]of Djt)n(s[i],e[i])||(t?t[i]=e[i]:t={[i]:e[i]});return t};class Ijt extends V{get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new ln(()=>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 pa.DocumentSynced:{for(const t of this.diff)if(t.op===pa.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break}case pa.Update:{const t=this.diff[this.diff.length-1];if(t){if(t.op===pa.Update&&t.item.extId===e.item.extId){YEe(t.item,e.item);return}if(t.op===pa.Add&&t.item.item.extId===e.item.extId){YEe(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===Md.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===Md.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 Vd.RemoveChild:this.removeItem(bn.joinToString(e.fullId,t.id));break;case Vd.Upsert:this.upsertItem(t.item,e);break;case Vd.Bulk:for(const i of t.ops)this.onTestItemEvent(e,i);break;case Vd.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case Vd.UpdateCanResolveChildren:this.updateExpandability(e);break;case Vd.SetProp:this.pushDiff({op:pa.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case Vd.DocumentSynced:this.documentSynced(e.actual.uri);break;default:h6()}}documentSynced(e){e&&this.pushDiff({op:pa.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){const i=bn.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 r=this.tree.get(i.toString());if(!r){r={fullId:i,actual:e,expandLevels:t?.expandLevels?t.expandLevels-1:void 0,expand:Md.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(r.fullId.toString(),r),this.setItemParent(e,t),this.pushDiff({op:pa.Add,item:{controllerId:this.options.controllerId,expand:r.expand,item:this.options.toITestItem(e)}}),this.connectItemAndChildren(e,r,t);return}if(r.actual===e){this.connectItem(e,r,t);return}if(r.actual.uri?.toString()!==e.uri?.toString())return this.removeItem(i.toString()),this.upsertItem(e,t);const o=this.options.getChildren(r.actual),a=r.actual,c=kjt(this.options.toITestItem(a),this.options.toITestItem(e));this.options.getApiFor(a).listener=void 0,r.actual=e,r.resolveBarrier=void 0,r.expand=Md.NotExpandable,c&&(c.hasOwnProperty("tags")&&(this.diffTagRefs(e.tags,a.tags,i.toString()),delete c.tags),this.onTestItemEvent(r,{op:Vd.SetProp,update:c})),this.connectItemAndChildren(e,r,t);for(const[d,h]of o)this.options.getChildren(e).get(h.id)||this.removeItem(bn.joinToString(i,h.id));const l=r.expandLevels;l!==void 0&&queueMicrotask(()=>{r.expand===Md.Expandable&&(r.expandLevels=void 0,this.expand(i.toString(),l))}),this.documentSynced(r.actual.uri)}diffTagRefs(e,t,i){const n=new Set(t.map(r=>r.id));for(const r of e)n.delete(r.id)||this.incrementTagRefs(r);this.pushDiff({op:pa.Update,item:{extId:i,item:{tags:e.map(r=>bj(this.options.controllerId,r.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:pa.AddTag,tag:{id:bj(this.options.controllerId,e.id)}}))}decrementTagRefs(e){const t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:pa.RemoveTag,id:bj(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=r=>this.onTestItemEvent(t,r),this.updateExpandability(t)}connectItemAndChildren(e,t,i){this.connectItem(e,t,i);for(const[n,r]of this.options.getChildren(e))this.upsertItem(r,t)}updateExpandability(e){let t;this._resolveHandler?e.resolveBarrier?t=e.resolveBarrier.isOpen()?Md.Expanded:Md.BusyExpanding:t=e.actual.canResolveChildren?Md.Expandable:Md.NotExpandable:t=Md.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:pa.Update,item:{extId:e.fullId.toString(),expand:t}}),t===Md.Expandable&&e.expandLevels!==void 0&&this.resolveChildren(e))}expandChildren(e,t){if(t<0)return;const i=[];for(const[n,r]of this.options.getChildren(e.actual)){const o=this.expand(bn.joinToString(e.fullId,r.id),t);Xy(o)&&i.push(o)}if(i.length)return Promise.all(i).then(()=>{})}resolveChildren(e){if(e.resolveBarrier)return e.resolveBarrier;if(!this._resolveHandler){const r=new jd;return r.open(),r}e.expand=Md.BusyExpanding,this.pushExpandStateUpdate(e);const t=e.resolveBarrier=new jd,i=r=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,r)};let n;try{n=this._resolveHandler(e.actual===this.root?void 0:e.actual)}catch(r){i(r)}return Xy(n)?n.catch(i).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:pa.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:pa.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 r of n.actual.tags)this.decrementTagRefs(r.id);this.tree.delete(n.fullId.toString());for(const[r,o]of this.options.getChildren(n.actual))i.push(this.tree.get(bn.joinToString(n.fullId,o.id)))}}}flushDiff(){const e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}}class Tjt extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}}class qte extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}}class Ljt 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 Rjt=(s,e,t)=>{let i=new Map;return{get size(){return i.size},forEach(n,r){for(const o of i.values())n.call(r,o,this)},[Symbol.iterator](){return i.entries()},replace(n){const r=new Map,o=new Set(i.keys()),a={op:Vd.Bulk,ops:[]};for(const c of n){if(!(c instanceof t))throw new qte(c.id);const l=e(c).controllerId;if(l!==s.controllerId)throw new Ljt(c.id,l,s.controllerId);if(r.has(c.id))throw new Tjt(c.id);r.set(c.id,c),o.delete(c.id),a.ops.push({op:Vd.Upsert,item:c})}for(const c of o.keys())a.ops.push({op:Vd.RemoveChild,id:c});s.listener?.(a),i=r},add(n){if(!(n instanceof t))throw new qte(n.id);i.set(n.id,n),s.listener?.({op:Vd.Upsert,item:n})},delete(n){i.delete(n)&&s.listener?.({op:Vd.RemoveChild,id:n})},get(n){return i.get(n)},toJSON(){return Array.from(i.values())}}},crt=new WeakMap,Mjt=(s,e)=>{const t={controllerId:e};return crt.set(s,t),t},gle=s=>{const e=crt.get(s);if(!e)throw new qte(s?.id||"");return e};var OC;(function(s){s[s.System=0]="System",s[s.User=1]="User",s[s.Assistant=2]="Assistant"})(OC||(OC={}));const k8e={type:"object",properties:{vendor:{type:"string",description:g(3049,"A globally unique vendor of language models.")}}},Njt=ih.registerExtensionPoint({extensionPoint:"languageModels",jsonSchema:{description:g(3050,"Contribute language models of a specific vendor."),oneOf:[k8e,{type:"array",items:k8e}]},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(Njt.setHandler(i=>{this._vendors.clear();for(const r of i){if(!hl(r.description,"chatProvider")){r.collector.error(g(3051,"This contribution point requires the 'chatProvider' proposal."));continue}for(const o of ui.wrap(r.value)){if(this._vendors.has(o.vendor)){r.collector.error(g(3052,"The vendor '{0}' is already registered and cannot be registered twice",o.vendor));continue}if(Qu(o.vendor)){r.collector.error(g(3053,"The vendor field cannot be empty."));continue}if(o.vendor.trim()!==o.vendor){r.collector.error(g(3054,"The vendor field cannot start or end with whitespace."));continue}this._vendors.add(o.vendor)}}const n=[];for(const[r,o]of this._providers)this._vendors.has(o.metadata.vendor)||(this._providers.delete(r),n.push(r));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(r=>An.equals(r,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,r){const o=this._providers.get(e);if(!o)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return o.sendChatRequest(i,t,n,r)}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,ps),_(1,Ke)],I8e);var zb;(function(s){function e(i){const{selectionStartLineNumber:n,selectionStartColumn:r,positionLineNumber:o,positionColumn:a}=i,c=new ws(n-1,r-1),l=new ws(o-1,a-1);return new uC(c,l)}s.to=e;function t(i){const{anchor:n,active:r}=i;return{selectionStartLineNumber:n.line+1,selectionStartColumn:n.character+1,positionLineNumber:r.line+1,positionColumn:r.character+1}}s.from=t})(zb||(zb={}));var tt;(function(s){function e(i){if(!i)return;const{start:n,end:r}=i;return{startLineNumber:n.line+1,startColumn:n.character+1,endLineNumber:r.line+1,endColumn:r.character+1}}s.from=e;function t(i){if(!i)return;const{startLineNumber:n,startColumn:r,endLineNumber:o,endColumn:a}=i;return new Xn(n-1,r-1,o-1,a-1)}s.to=t})(tt||(tt={}));var kD;(function(s){function e(i){return{uri:i.uri,range:tt.from(i.range)}}s.from=e;function t(i){return new Ap(N.revive(i.uri),tt.to(i.range))}s.to=t})(kD||(kD={}));var exe;(function(s){function e(t){switch(t){case no.Comment:return PS.Comment;case no.Other:return PS.Other;case no.RegEx:return PS.RegEx;case no.String:return PS.String}}s.to=e})(exe||(exe={}));var Yr;(function(s){function e(i){return new ws(i.lineNumber-1,i.column-1)}s.to=e;function t(i){return{lineNumber:i.line+1,column:i.character+1}}s.from=t})(Yr||(Yr={}));var UH;(function(s){function e(n,r,o){return Oi(z_(n).map(a=>t(a,r,o)))}s.from=e;function t(n,r,o){if(typeof n=="string")return{$serialized:!0,language:n,isBuiltin:o?.isBuiltin};if(n)return{$serialized:!0,language:n.language,scheme:i(n.scheme,r),pattern:Qf.from(n.pattern)??void 0,exclusive:n.exclusive,notebookType:n.notebookType,isBuiltin:o?.isBuiltin}}function i(n,r){return r&&typeof n=="string"?r.transformOutgoingScheme(n):n}})(UH||(UH={}));var Qte;(function(s){function e(i){switch(i){case $x.Unnecessary:return p_.Unnecessary;case $x.Deprecated:return p_.Deprecated}}s.from=e;function t(i){switch(i){case p_.Unnecessary:return $x.Unnecessary;case p_.Deprecated:return $x.Deprecated;default:return}}s.to=t})(Qte||(Qte={}));var VH;(function(s){function e(i){let n;return i.code&&(Rt(i.code)||dc(i.code)?n=String(i.code):n={value:String(i.code.value),target:i.code.target}),{...tt.from(i.range),message:i.message,source:i.source,code:n,severity:Yte.from(i.severity),relatedInformation:i.relatedInformation&&i.relatedInformation.map(jte.from),tags:Array.isArray(i.tags)?Oi(i.tags.map(Qte.from)):void 0}}s.from=e;function t(i){const n=new O9(tt.to(i),i.message,Yte.to(i.severity));return n.source=i.source,n.code=Rt(i.code)?i.code:i.code?.value,n.relatedInformation=i.relatedInformation&&i.relatedInformation.map(jte.to),n.tags=i.tags&&Oi(i.tags.map(Qte.to)),n}s.to=t})(VH||(VH={}));var jte;(function(s){function e(i){return{...tt.from(i.location.range),message:i.message,resource:i.location.uri}}s.from=e;function t(i){return new rH(new Ap(i.resource,tt.to(i)),i.message)}s.to=t})(jte||(jte={}));var Yte;(function(s){function e(i){switch(i){case Hd.Error:return Hs.Error;case Hd.Warning:return Hs.Warning;case Hd.Information:return Hs.Info;case Hd.Hint:return Hs.Hint}return Hs.Error}s.from=e;function t(i){switch(i){case Hs.Info:return Hd.Information;case Hs.Warning:return Hd.Warning;case Hs.Error:return Hd.Error;case Hs.Hint:return Hd.Hint;default:return Hd.Error}}s.to=t})(Yte||(Yte={}));var Dl;(function(s){function e(i){return typeof i=="number"&&i>=gH.One?i-1:i===gH.Beside?nv:pA}s.from=e;function t(i){if(typeof i=="number"&&i>=0)return i+1;throw new Error("invalid 'EditorGroupColumn'")}s.to=t})(Dl||(Dl={}));function Pjt(s){return typeof s.range<"u"}function lrt(s){return s.length===0?!0:!!Pjt(s[0])}var Fs;(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 gf.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 Ku.Renderer;return h.link=d,h.image=u=>typeof u=="string"?d(dYe(u).href):"",Ku(c.value,{renderer:h}),c}s.from=i;function n(a,c){if(!a)return a;let l;try{l=iW(a)}catch{}if(!l)return a;let d=!1;return l=T2(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 r(a){const c=new gf(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=r;function o(a){if(a)return typeof a=="string"?a:s.from(a)}s.fromStrict=o})(Fs||(Fs={}));function Fjt(s){return lrt(s)?s.map(e=>({range:tt.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Fs.fromMany(e.hoverMessage):e.hoverMessage?Fs.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):s.map(e=>({range:tt.from(e)}))}function fle(s){return typeof s>"u"?s:typeof s=="string"?N.file(s):s}var zH;(function(s){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?fle(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})(zH||(zH={}));var Jte;(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?fle(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?zH.from(t.before):void 0,after:t.after?zH.from(t.after):void 0}}s.from=e})(Jte||(Jte={}));var txe;(function(s){function e(t){if(typeof t>"u")return t;switch(t){case Kx.OpenOpen:return si.AlwaysGrowsWhenTypingAtEdges;case Kx.ClosedClosed:return si.NeverGrowsWhenTypingAtEdges;case Kx.OpenClosed:return si.GrowsOnlyWhenTypingBefore;case Kx.ClosedOpen:return si.GrowsOnlyWhenTypingAfter}}s.from=e})(txe||(txe={}));var ixe;(function(s){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?txe.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?Jte.from(t.light):void 0,dark:t.dark?Jte.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?fle(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?zH.from(t.before):void 0,after:t.after?zH.from(t.after):void 0}}s.from=e})(ixe||(ixe={}));var ad;(function(s){function e(i){return{text:i.newText,eol:i.newEol&&KH.from(i.newEol),range:tt.from(i.range)}}s.from=e;function t(i){const n=new qA(tt.to(i.range),i.text);return n.newEol=typeof i.eol>"u"?void 0:KH.to(i.eol),n}s.to=t})(ad||(ad={}));var Zu;(function(s){function e(i,n){const r={edits:[]};if(i instanceof _I){const o=new Mk;for(const a of i._allEntries())a._type===bc.File&&N.isUri(a.to)&&a.from===void 0&&o.add(a.to);for(const a of i._allEntries())if(a._type===bc.File){let c;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?c={type:"base64",value:zTe(Ge.wrap(a.options.contents))}:c={type:"dataTransferItem",id:a.options.contents._itemId}),r.edits.push({oldResource:a.from,newResource:a.to,options:{...a.options,contents:c},metadata:a.metadata})}else a._type===bc.Text?r.edits.push({resource:a.uri,textEdit:ad.from(a.edit),versionId:o.has(a.uri)?void 0:n?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===bc.Snippet?r.edits.push({resource:a.uri,textEdit:{range:tt.from(a.range),text:a.edit.value,insertAsSnippet:!0},versionId:o.has(a.uri)?void 0:n?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===bc.Cell?r.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookMetadata:a.notebookMetadata,notebookVersionId:n?.getNotebookDocumentVersion(a.uri)}):a._type===bc.CellReplace&&r.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:n?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:mI.Replace,index:a.index,count:a.count,cells:a.cells.map(L$.from)}})}return r}s.from=e;function t(i){const n=new _I,r=new gi;for(const o of i.edits)if(o.textEdit){const a=o,c=N.revive(a.resource),l=tt.to(a.textEdit.range),d=a.textEdit.text,h=a.textEdit.insertAsSnippet;let u;h?u=ele.replace(l,new vI(d)):u=qA.replace(l,d);const f=r.get(c);f?f.push(u):r.set(c,[u])}else n.renameFile(N.revive(o.oldResource),N.revive(o.newResource),o.options);for(const[o,a]of r)n.set(o,a);return n}s.to=t})(Zu||(Zu={}));var rv;(function(s){const e=Object.create(null);e[vo.File]=mt.File,e[vo.Module]=mt.Module,e[vo.Namespace]=mt.Namespace,e[vo.Package]=mt.Package,e[vo.Class]=mt.Class,e[vo.Method]=mt.Method,e[vo.Property]=mt.Property,e[vo.Field]=mt.Field,e[vo.Constructor]=mt.Constructor,e[vo.Enum]=mt.Enum,e[vo.Interface]=mt.Interface,e[vo.Function]=mt.Function,e[vo.Variable]=mt.Variable,e[vo.Constant]=mt.Constant,e[vo.String]=mt.String,e[vo.Number]=mt.Number,e[vo.Boolean]=mt.Boolean,e[vo.Array]=mt.Array,e[vo.Object]=mt.Object,e[vo.Key]=mt.Key,e[vo.Null]=mt.Null,e[vo.EnumMember]=mt.EnumMember,e[vo.Struct]=mt.Struct,e[vo.Event]=mt.Event,e[vo.Operator]=mt.Operator,e[vo.TypeParameter]=mt.TypeParameter;function t(n){return typeof e[n]=="number"?e[n]:mt.Property}s.from=t;function i(n){for(const r in e)if(e[r]===n)return Number(r);return vo.Property}s.to=i})(rv||(rv={}));var QA;(function(s){function e(i){switch(i){case aH.Deprecated:return I8.Deprecated}}s.from=e;function t(i){switch(i){case I8.Deprecated:return aH.Deprecated}}s.to=t})(QA||(QA={}));var x$;(function(s){function e(i){return{name:i.name,kind:rv.from(i.kind),tags:i.tags&&i.tags.map(QA.from),containerName:i.containerName,location:ff.from(i.location)}}s.from=e;function t(i){const n=new cH(i.name,rv.to(i.kind),i.containerName,ff.to(i.location));return n.tags=i.tags&&i.tags.map(QA.to),n}s.to=t})(x$||(x$={}));var nxe;(function(s){function e(i){const n={name:i.name||"!!MISSING: name!!",detail:i.detail,range:tt.from(i.range),selectionRange:tt.from(i.selectionRange),kind:rv.from(i.kind),tags:i.tags?.map(QA.from)??[]};return i.children&&(n.children=i.children.map(e)),n}s.from=e;function t(i){const n=new lH(i.name,i.detail,rv.to(i.kind),tt.to(i.range),tt.to(i.selectionRange));return tr(i.tags)&&(n.tags=i.tags.map(QA.to)),i.children&&(n.children=i.children.map(t)),n}s.to=t})(nxe||(nxe={}));var bN;(function(s){function e(i){const n=new tle(rv.to(i.kind),i.name,i.detail||"",N.revive(i.uri),tt.to(i.range),tt.to(i.selectionRange));return n._sessionId=i._sessionId,n._itemId=i._itemId,n}s.to=e;function t(i,n,r){if(n=n??i._sessionId,r=r??i._itemId,n===void 0||r===void 0)throw new Error("invalid item");return{_sessionId:n,_itemId:r,name:i.name,detail:i.detail,kind:rv.from(i.kind),uri:i.uri,range:tt.from(i.range),selectionRange:tt.from(i.selectionRange),tags:i.tags?.map(QA.from)}}s.from=t})(bN||(bN={}));var sxe;(function(s){function e(t){return new fPe(bN.to(t.from),t.fromRanges.map(i=>tt.to(i)))}s.to=e})(sxe||(sxe={}));var rxe;(function(s){function e(t){return new pPe(bN.to(t.to),t.fromRanges.map(i=>tt.to(i)))}s.to=e})(rxe||(rxe={}));var ff;(function(s){function e(i){return{range:i.range&&tt.from(i.range),uri:i.uri}}s.from=e;function t(i){return new Ap(N.revive(i.uri),tt.to(i.range))}s.to=t})(ff||(ff={}));var D$;(function(s){function e(i){const n=i,r=i;return{originSelectionRange:n.originSelectionRange?tt.from(n.originSelectionRange):void 0,uri:n.targetUri?n.targetUri:r.uri,range:tt.from(n.targetRange?n.targetRange:r.range),targetSelectionRange:n.targetSelectionRange?tt.from(n.targetSelectionRange):void 0}}s.from=e;function t(i){return{targetUri:N.revive(i.uri),targetRange:tt.to(i.range),targetSelectionRange:i.targetSelectionRange?tt.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?tt.to(i.originSelectionRange):void 0}}s.to=t})(D$||(D$={}));var k$;(function(s){function e(i){return{range:tt.from(i.range),contents:Fs.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}s.from=e;function t(i){const n=i.contents.map(Fs.to),r=tt.to(i.range),o=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new W9(n,r,o,a)}s.to=t})(k$||(k$={}));var oxe;(function(s){function e(i){return{range:tt.from(i.range),expression:i.expression}}s.from=e;function t(i){return new s$(tt.to(i.range),i.expression)}s.to=t})(oxe||(oxe={}));var Xte;(function(s){function e(i){if(i instanceof r$)return{type:"text",range:tt.from(i.range),text:i.text};if(i instanceof o$)return{type:"variable",range:tt.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof a$)return{type:"expression",range:tt.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:tt.to(i.range),text:i.text};case"variable":return{range:tt.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:tt.to(i.range),expression:i.expression}}}s.to=t})(Xte||(Xte={}));var Zte;(function(s){function e(i){return{frameId:i.frameId,stoppedLocation:tt.from(i.stoppedLocation)}}s.from=e;function t(i){return new pEe(i.frameId,tt.to(i.stoppedLocation))}s.to=t})(Zte||(Zte={}));var $H;(function(s){function e(i){return{range:tt.from(i.range),kind:i.kind}}s.from=e;function t(i){return new H9(tt.to(i.range),i.kind)}s.to=t})($H||($H={}));var axe;(function(s){function e(i){return{uri:i.uri,highlights:i.highlights.map($H.from)}}s.from=e;function t(i){return new U9(N.revive(i.uri),i.highlights.map($H.to))}s.to=t})(axe||(axe={}));var cxe;(function(s){function e(t){switch(t){case ju.TriggerCharacter:return QT.TriggerCharacter;case ju.TriggerForIncompleteCompletions:return QT.TriggerForIncompleteCompletions;case ju.Invoke:default:return QT.Invoke}}s.to=e})(cxe||(cxe={}));var lxe;(function(s){function e(t){return{triggerKind:cxe.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}s.to=e})(lxe||(lxe={}));var eie;(function(s){function e(i){switch(i){case uH.Deprecated:return F2.Deprecated}}s.from=e;function t(i){switch(i){case F2.Deprecated:return uH.Deprecated}}s.to=t})(eie||(eie={}));var tie;(function(s){const e=new Map([[en.Method,Me.Method],[en.Function,Me.Function],[en.Constructor,Me.Constructor],[en.Field,Me.Field],[en.Variable,Me.Variable],[en.Class,Me.Class],[en.Interface,Me.Interface],[en.Struct,Me.Struct],[en.Module,Me.Module],[en.Property,Me.Property],[en.Unit,Me.Unit],[en.Value,Me.Value],[en.Constant,Me.Constant],[en.Enum,Me.Enum],[en.EnumMember,Me.EnumMember],[en.Keyword,Me.Keyword],[en.Snippet,Me.Snippet],[en.Text,Me.Text],[en.Color,Me.Color],[en.File,Me.File],[en.Reference,Me.Reference],[en.Folder,Me.Folder],[en.Event,Me.Event],[en.Operator,Me.Operator],[en.TypeParameter,Me.TypeParameter],[en.Issue,Me.Issue],[en.User,Me.User]]);function t(r){return e.get(r)??Me.Property}s.from=t;const i=new Map([[Me.Method,en.Method],[Me.Function,en.Function],[Me.Constructor,en.Constructor],[Me.Field,en.Field],[Me.Variable,en.Variable],[Me.Class,en.Class],[Me.Interface,en.Interface],[Me.Struct,en.Struct],[Me.Module,en.Module],[Me.Property,en.Property],[Me.Unit,en.Unit],[Me.Value,en.Value],[Me.Constant,en.Constant],[Me.Enum,en.Enum],[Me.EnumMember,en.EnumMember],[Me.Keyword,en.Keyword],[Me.Snippet,en.Snippet],[Me.Text,en.Text],[Me.Color,en.Color],[Me.File,en.File],[Me.Reference,en.Reference],[Me.Folder,en.Folder],[Me.Event,en.Event],[Me.Operator,en.Operator],[Me.TypeParameter,en.TypeParameter],[Me.User,en.User],[Me.Issue,en.Issue]]);function n(r){return i.get(r)??en.Property}s.to=n})(tie||(tie={}));var dxe;(function(s){function e(t,i){const n=new K9(t.label);return n.insertText=t.insertText,n.kind=tie.to(t.kind),n.tags=t.tags?.map(eie.to),n.detail=t.detail,n.documentation=ud(t.documentation)?Fs.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=tt.to(t.range):typeof t.range=="object"&&(n.range={inserting:tt.to(t.range.insert),replacing:tt.to(t.range.replace)}),n.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&Zg.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&Zg.InsertAsSnippet?n.insertText=new vI(t.insertText):(n.insertText=t.insertText,n.textEdit=n.range instanceof Xn?new qA(n.range,n.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(n.additionalTextEdits=t.additionalTextEdits.map(r=>ad.to(r))),n.command=i&&t.command?i.fromInternal(t.command):void 0,n}s.to=e})(dxe||(dxe={}));var iie;(function(s){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Fs.fromStrict(i.documentation)}}s.from=e;function t(i){return{label:i.label,documentation:ud(i.documentation)?Fs.to(i.documentation):i.documentation}}s.to=t})(iie||(iie={}));var nie;(function(s){function e(i){return{label:i.label,documentation:Fs.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(iie.from):[],activeParameter:i.activeParameter}}s.from=e;function t(i){return{label:i.label,documentation:ud(i.documentation)?Fs.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(iie.to):[],activeParameter:i.activeParameter}}s.to=t})(nie||(nie={}));var I$;(function(s){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(nie.from):[]}}s.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(nie.to):[]}}s.to=t})(I$||(I$={}));var hxe;(function(s){function e(t,i){const n=new G9(Yr.to(i.position),typeof i.label=="string"?i.label:i.label.map(uxe.to.bind(void 0,t)),i.kind&&sie.to(i.kind));return n.textEdits=i.textEdits&&i.textEdits.map(ad.to),n.tooltip=ud(i.tooltip)?Fs.to(i.tooltip):i.tooltip,n.paddingLeft=i.paddingLeft,n.paddingRight=i.paddingRight,n}s.to=e})(hxe||(hxe={}));var uxe;(function(s){function e(t,i){const n=new $9(i.label);return n.tooltip=ud(i.tooltip)?Fs.to(i.tooltip):i.tooltip,jj.is(i.command)&&(n.command=t.fromInternal(i.command)),i.location&&(n.location=ff.to(i.location)),n}s.to=e})(uxe||(uxe={}));var sie;(function(s){function e(i){return i}s.from=e;function t(i){return i}s.to=t})(sie||(sie={}));var sL;(function(s){function e(i){return{range:tt.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 r=new Q9(tt.to(i.range),n);return r.tooltip=i.tooltip,r}s.to=t})(sL||(sL={}));var rie;(function(s){function e(i){const n=new Y9(i.label);return i.textEdit&&(n.textEdit=ad.to(i.textEdit)),i.additionalTextEdits&&(n.additionalTextEdits=i.additionalTextEdits.map(r=>ad.to(r))),n}s.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?ad.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(n=>ad.from(n)):void 0}}s.from=t})(rie||(rie={}));var GH;(function(s){function e(i){return new dN(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})(GH||(GH={}));var gxe;(function(s){function e(i){return{range:tt.from(i.range)}}s.from=e;function t(i){return new hH(tt.to(i.range))}s.to=t})(gxe||(gxe={}));var oie;(function(s){function e(t){switch(t){case Sn.AUTO:return jT.AfterDelay;case Sn.EXPLICIT:return jT.Manual;case Sn.FOCUS_CHANGE:case Sn.WINDOW_CHANGE:return jT.FocusOut}}s.to=e})(oie||(oie={}));var gB;(function(s){function e(i){switch(i){case c_.Off:return yo.Off;case c_.Relative:return yo.Relative;case c_.Interval:return yo.Interval;case c_.On:default:return yo.On}}s.from=e;function t(i){switch(i){case yo.Off:return c_.Off;case yo.Relative:return c_.Relative;case yo.Interval:return c_.Interval;case yo.On:default:return c_.On}}s.to=t})(gB||(gB={}));var KH;(function(s){function e(i){if(i===T_.CRLF)return Eh.CRLF;if(i===T_.LF)return Eh.LF}s.from=e;function t(i){if(i===Eh.CRLF)return T_.CRLF;if(i===Eh.LF)return T_.LF}s.to=t})(KH||(KH={}));var fxe;(function(s){function e(t){if(typeof t=="object")return t.viewId;switch(t){case SD.SourceControl:return fd.Scm;case SD.Window:return fd.Window;case SD.Notification:return fd.Notification}throw new Error("Unknown 'ProgressLocation'")}s.from=e})(fxe||(fxe={}));var aie;(function(s){function e(i){const n={start:i.start+1,end:i.end+1};return i.kind&&(n.kind=cie.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=cie.to(i.kind)),n}s.to=t})(aie||(aie={}));var cie;(function(s){function e(i){if(i)switch(i){case Gw.Comment:return u_.Comment;case Gw.Imports:return u_.Imports;case Gw.Region:return u_.Region}}s.from=e;function t(i){if(i)switch(i.value){case u_.Comment.value:return Gw.Comment;case u_.Imports.value:return Gw.Imports;case u_.Region.value:return Gw.Region}}s.to=t})(cie||(cie={}));var vz;(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"?tt.from(t.selection):void 0,override:typeof t.override=="boolean"?lm.id:void 0}}s.from=e})(vz||(vz={}));var Qf;(function(s){function e(r){return r instanceof JT?r.toJSON():typeof r=="string"?r:t(r)||i(r)?new JT(r.baseUri??r.base,r.pattern).toJSON():r}s.from=e;function t(r){const o=r;return o?N.isUri(o.baseUri)&&typeof o.pattern=="string":!1}function i(r){const o=r;return o?typeof o.base=="string"&&typeof o.pattern=="string":!1}function n(r){return typeof r=="string"?r:new JT(N.revive(r.baseUri),r.pattern)}s.to=n})(Qf||(Qf={}));var pxe;(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:Qf.from(i.pattern),exclusive:i.exclusive,notebookType:i.notebookType}}}else return}s.from=e})(pxe||(pxe={}));var lie;(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(r=>r&&typeof r=="object"&&"uri"in r&&N.isUri(r.uri)&&"version"in r&&typeof r.version=="number"&&"ranges"in r&&Array.isArray(r.ranges)&&r.ranges.every(o=>o instanceof Xn)))}s.is=e;function t(i){return{documents:i.documents.map(n=>n.map(r=>({uri:N.from(r.uri),version:r.version,ranges:r.ranges.map(o=>tt.from(o))})))}}s.from=t})(lie||(lie={}));var zy;(function(s){function e(i){return{start:i.start,end:i.end}}s.from=e;function t(i){return new Dy(i.start,i.end)}s.to=t})(zy||(zy={}));var qH;(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})(qH||(qH={}));var mxe;(function(s){function e(t){if(t===hz.Unconfirmed)return fN.Pending;if(t===hz.Pending)return;if(t===hz.Executing)return fN.Executing;throw new Error(`Unknown state: ${t}`)}s.to=e})(mxe||(mxe={}));var T$;(function(s){function e(i){switch(i){case jx.Markup:return LF.Markup;case jx.Code:default:return LF.Code}}s.from=e;function t(i){switch(i){case LF.Markup:return jx.Markup;case LF.Code:default:return jx.Code}}s.to=t})(T$||(T$={}));var VE;(function(s){function e(i){const n={metadata:i.metadata??Object.create(null),cells:[]};for(const r of i.cells)vG.validate(r),n.cells.push(L$.from(r));return n}s.from=e;function t(i){const n=new bPe(i.cells.map(L$.to));return DA(i.metadata)||(n.metadata=i.metadata),n}s.to=t})(VE||(VE={}));var L$;(function(s){function e(i){return{cellKind:T$.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:qH.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(yI.from):[]}}s.from=e;function t(i){return new vG(T$.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(yI.to):void 0,i.metadata,i.internalMetadata?qH.to(i.internalMetadata):void 0)}s.to=t})(L$||(L$={}));var QH;(function(s){function e(i){return{mime:i.mime,valueBytes:Ge.wrap(i.data)}}s.from=e;function t(i){return new wPe(i.valueBytes.buffer,i.mime)}s.to=t})(QH||(QH={}));var yI;(function(s){function e(i){return{outputId:i.id,items:i.items.map(QH.from),metadata:i.metadata}}s.from=e;function t(i){const n=i.items.map(QH.to);return new d$(n,i.outputId,i.metadata)}s.to=t})(yI||(yI={}));var die;(function(s){function e(n){return i(n)?{include:Qf.from(n.include)??void 0,exclude:Qf.from(n.exclude)??void 0}:Qf.from(n)??void 0}s.from=e;function t(n){return i(n)?{include:Qf.to(n.include),exclude:Qf.to(n.exclude)}:Qf.to(n)}s.to=t;function i(n){const r=n;return r?!aa(r.include)&&!aa(r.exclude):!1}})(die||(die={}));var _xe;(function(s){function e(t,i,n){const r=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===h$.Left?Kee.Left:Kee.Right,command:i.toInternal(r,n),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}s.from=e})(_xe||(_xe={}));var vxe;(function(s){function e(t,i,n){const r=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{command:i.toInternal(r,n),label:t.label,description:t.description,detail:t.detail,documentation:t.documentation}}s.from=e})(vxe||(vxe={}));var bxe;(function(s){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}s.from=e})(bxe||(bxe={}));var hie;(function(s){function e(i){return{uri:i.uri,provides:i.provides}}s.from=e;function t(i){return new yPe(N.revive(i.uri),i.provides)}s.to=t})(hie||(hie={}));var jH;(function(s){function e(i){return{message:Fs.fromStrict(i.message)||"",type:H_.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:tt.from(i.location.range),uri:i.location.uri},stackTrace:i.stackTrace?.map(n=>({label:n.label,position:n.position&&Yr.from(n.position),uri:n.file&&N.revive(n.file).toJSON()}))}}s.from=e;function t(i){const n=new pN(typeof i.message=="string"?i.message:Fs.to(i.message));return n.actualOutput=i.actual,n.expectedOutput=i.expected,n.contextValue=i.contextValue,n.location=i.location?ff.to(i.location):void 0,n}s.to=t})(jH||(jH={}));var $b;(function(s){s.namespace=bj,s.denamespace=art})($b||($b={}));var CI;(function(s){function e(i){const n=gle(i).controllerId;return{extId:bn.fromExtHostTestItem(i,n).toString(),label:i.label,uri:N.revive(i.uri),busy:i.busy,tags:i.tags.map(r=>$b.namespace(n,r.id)),range:F.lift(tt.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Fs.fromStrict(i.error)||null}}s.from=e;function t(i){return{parent:void 0,error:void 0,id:bn.fromString(i.extId).localId,label:i.label,uri:N.revive(i.uri),tags:(i.tags||[]).map(n=>{const{tagId:r}=$b.denamespace(n);return new kH(r)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:tt.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}s.toPlain=t})(CI||(CI={}));(function(s){function e(i){return{id:i.id}}s.from=e;function t(i){return new kH(i.id)}s.to=t})($b||($b={}));var wxe;(function(s){const e=(i,n)=>{const r=i.value;if(!r)return;const o={...CI.toPlain(r.item),parent:n,taskStates:r.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(c=>c.type===H_.Error).map(jH.to)})),children:[]};if(i.children)for(const a of i.children.values()){const c=e(a,o);c&&o.children.push(c)}return o};function t(i){const n=new Wte;for(const a of i.items)n.insert(bn.fromString(a.item.extId).path,a);const r=[n.nodes],o=[];for(;r.length;)for(const a of r.pop())a.value?o.push(a):a.children&&r.push(a.children.values());return{completedAt:i.completedAt,results:o.map(a=>e(a)).filter(Oc)}}s.to=t})(wxe||(wxe={}));var uie;(function(s){function e(r){return{covered:r.covered,total:r.total}}function t(r){return"line"in r?Yr.from(r):tt.from(r)}function i(r){if(typeof r.executed=="number"&&r.executed<0)throw new Error(`Invalid coverage count ${r.executed}`);return"branches"in r?{count:r.executed,location:t(r.location),type:WH.Statement,branches:r.branches.length?r.branches.map(o=>({count:o.executed,location:o.location&&t(o.location),label:o.label})):void 0}:{type:WH.Declaration,name:r.name,count:r.executed,location:t(r.location)}}s.fromDetails=i;function n(r,o,a){return pj(a.statementCoverage),pj(a.branchCoverage),pj(a.declarationCoverage),{id:o,uri:a.uri,statement:e(a.statementCoverage),branch:a.branchCoverage&&e(a.branchCoverage),declaration:a.declarationCoverage&&e(a.declarationCoverage),testIds:a instanceof mN&&a.fromTests.length?a.fromTests.map(c=>bn.fromExtHostTestItem(c,r).toString()):void 0}}s.fromFile=n})(uie||(uie={}));var yxe;(function(s){function e(t){switch(t){case Ah.Invoke:return dH.Invoke;case Ah.Auto:return dH.Automatic}}s.to=e})(yxe||(yxe={}));var rL;(function(s){function e(i){const n=new nle(rv.to(i.kind),i.name,i.detail||"",N.revive(i.uri),tt.to(i.range),tt.to(i.selectionRange));return n._sessionId=i._sessionId,n._itemId=i._itemId,n}s.to=e;function t(i,n,r){if(n=n??i._sessionId,r=r??i._itemId,n===void 0||r===void 0)throw new Error("invalid item");return{_sessionId:n,_itemId:r,kind:rv.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:tt.from(i.range),selectionRange:tt.from(i.selectionRange),tags:i.tags?.map(QA.from)}}s.from=t})(rL||(rL={}));var gie;(function(s){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}s.from=e})(gie||(gie={}));var fie;(function(s){function e(r,o,a){const c=o.fileData;return c?new g7t(new f7t(c.name,N.revive(c.uri),c.id,fm(()=>a(c.id)))):r===Vs.uriList&&o.uriListData?new cte(n(o.uriListData)):new cte(o.asString)}s.to=e;async function t(r,o){const a=await o.asString();if(r===Vs.uriList)return{asString:a,fileData:void 0,uriListData:i(a)};const c=o.asFile();return{asString:a,fileData:c?{name:c.name,uri:c.uri,id:c._itemId??c.id}:void 0}}s.from=t;function i(r){return rI.split(r).map(o=>{if(o.startsWith("#"))return o;try{return N.parse(o)}catch{}return o})}function n(r){return rI.create(r.map(o=>typeof o=="string"?o:N.revive(o)))}})(fie||(fie={}));var U_;(function(s){function e(i,n){const r=i.items.map(([o,a])=>[o,fie.to(o,a,n)]);return new mH(r)}s.toDataTransfer=e;async function t(i){const n={items:[]},r=[];for(const[o,a]of i)r.push((async()=>{n.items.push([o,await fie.from(o,a)])})());return await Promise.all(r),n}s.from=t})(U_||(U_={}));var R$;(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})(R$||(R$={}));var pie;(function(s){function e(i){switch(i){case OC.System:return jp.System;case OC.User:return jp.User;case OC.Assistant:return jp.Assistant}}s.to=e;function t(i){switch(i){case jp.System:return OC.System;case jp.User:return OC.User;case jp.Assistant:return OC.Assistant}return OC.User}s.from=t})(pie||(pie={}));var PF;(function(s){function e(i){let n="",r;i.content.type==="text"?n=i.content.value:r=new b$(i.content.name,i.content.value,i.content.isError);const o=pie.to(i.role),a=new MPe(o,n,i.name);return r!==void 0&&(a.content2=r),a}s.to=e;function t(i){const n=pie.from(i.role),r=i.name;let o;return i.content2 instanceof b$?o={type:"function_result",name:i.content2.name,value:i.content2.content,isError:i.content2.isError}:o={type:"text",value:i.content},{role:n,name:r,content:o}}s.from=t})(PF||(PF={}));var M$;(function(s){function e(i){return{kind:"markdownContent",content:Fs.from(i.value)}}s.from=e;function t(i){return new bG(Fs.to(i.content))}s.to=t})(M$||(M$={}));var mie;(function(s){function e(i){return{kind:"markdownVuln",content:Fs.from(i.value),vulnerabilities:i.vulnerabilities}}s.from=e;function t(i){return new TH(Fs.to(i.content),i.vulnerabilities)}s.to=t})(mie||(mie={}));var _ie;(function(s){function e(i){return{kind:"agentDetection",agentId:i.participant,command:i.command}}s.from=e;function t(i){return new LH(i.agentId,i.command)}s.to=t})(_ie||(_ie={}));var vie;(function(s){function e(t){return{kind:"confirmation",title:t.title,message:t.message,data:t.data,buttons:t.buttons}}s.from=e})(vie||(vie={}));var N$;(function(s){function e(i){const{value:n,baseUri:r}=i;function o(a,c){return a.map(l=>{const d=N.joinPath(c,l.name);return{label:l.name,uri:d,children:l.children&&o(l.children,d)}})}return{kind:"treeData",treeData:{label:vi(r),uri:r,children:o(n,r)}}}s.from=e;function t(i){const n=Mr(i.treeData);function r(c){return c.map(l=>({name:l.label,children:l.children&&r(l.children)}))}const o=n.uri,a=n.children?r(n.children):[];return new wG(a,o)}s.to=t})(N$||(N$={}));var P$;(function(s){function e(i){const n=r=>N.isUri(r);return{kind:"inlineReference",name:i.title,inlineReference:n(i.value)?i.value:kD.from(i.value)}}s.from=e;function t(i){const n=Mr(i);return new yG(N.isUri(n.inlineReference)?n.inlineReference:kD.to(n.inlineReference),i.name)}s.to=t})(P$||(P$={}));var YH;(function(s){function e(i){return{kind:"progressMessage",content:Fs.from(i.value)}}s.from=e;function t(i){return new RH(i.content.value)}s.to=t})(YH||(YH={}));var F$;(function(s){function e(i){return{kind:"warning",content:Fs.from(i.value)}}s.from=e;function t(i){return new MH(i.content.value)}s.to=t})(F$||(F$={}));var Cxe;(function(s){function e(t){return{kind:"progressTask",content:Fs.from(t.value)}}s.from=e})(Cxe||(Cxe={}));var Sxe;(function(s){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Fs.from(t):void 0}}s.from=e})(Sxe||(Sxe={}));var O$;(function(s){function e(i,n,r){return{kind:"command",command:n.toInternal(i.value,r)??{command:i.value.command,title:i.value.title}}}s.from=e;function t(i,n){return new CG(n.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}s.to=t})(O$||(O$={}));var bie;(function(s){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(n=>ad.from(n))}}s.from=e;function t(i){return new NH(N.revive(i.uri),i.edits.map(n=>ad.to(n)))}s.to=t})(bie||(bie={}));var vA;(function(s){function e(i){const n=He.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:kD.from(i.value.value)},iconPath:n,options:i.options}:{kind:"reference",reference:N.isUri(i.value)?i.value:kD.from(i.value),iconPath:n,options:i.options}}s.from=e;function t(i){const n=Mr(i),r=o=>N.isUri(o)?o:kD.to(o);return new Rb("variableName"in n.reference?{variableName:n.reference.variableName,value:n.reference.value&&r(n.reference.value)}:r(n.reference))}s.to=t})(vA||(vA={}));var wie;(function(s){function e(t){return{kind:"codeCitation",value:t.value,license:t.license,snippet:t.snippet}}s.from=e})(wie||(wie={}));var yie;(function(s){function e(n,r,o){return n instanceof bG?M$.from(n):n instanceof yG?P$.from(n):n instanceof Rb?vA.from(n):n instanceof RH?YH.from(n):n instanceof wG?N$.from(n):n instanceof CG?O$.from(n,r,o):n instanceof NH?bie.from(n):n instanceof TH?mie.from(n):n instanceof LH?_ie.from(n):n instanceof MH?F$.from(n):n instanceof _$?vie.from(n):n instanceof v$?wie.from(n):{kind:"markdownContent",content:Fs.from("")}}s.from=e;function t(n,r){switch(n.kind){case"reference":return vA.to(n);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return i(n,r)}}s.to=t;function i(n,r){switch(n.kind){case"markdownContent":return M$.to(n);case"inlineReference":return P$.to(n);case"progressMessage":return;case"treeData":return N$.to(n);case"command":return O$.to(n,r)}}s.toContent=i})(yie||(yie={}));var Axe;(function(s){function e(t,i){const n=t.variables.variables.filter(o=>o.isTool).map(o=>o.id),r=t.variables.variables.filter(o=>!o.isTool);return{prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,references:r.map(Cie.to),location:B$.to(t.location),acceptedConfirmationData:t.acceptedConfirmationData,rejectedConfirmationData:t.rejectedConfirmationData,location2:i,requestedTools:n}}s.to=e})(Axe||(Axe={}));var B$;(function(s){function e(i){switch(i){case To.Notebook:return l_.Notebook;case To.Terminal:return l_.Terminal;case To.Panel:return l_.Panel;case To.Editor:return l_.Editor}}s.to=e;function t(i){switch(i){case l_.Notebook:return To.Notebook;case l_.Terminal:return To.Terminal;case l_.Panel:return To.Panel;case l_.Editor:return To.Editor}}s.from=t})(B$||(B$={}));var Cie;(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:Ife(i)?N.revive(i):i&&typeof i=="object"&&"uri"in i&&"range"in i&&Ife(i.uri)?kD.to(Mr(i)):i,modelDescription:t.modelDescription}}s.to=e})(Cie||(Cie={}));var Exe;(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})(Exe||(Exe={}));var fB;(function(s){function e(t){return{errorDetails:t.errorDetails,metadata:t.metadata}}s.to=e})(fB||(fB={}));var xxe;(function(s){function e(t,i,n){if(i.action.kind==="vote")return;const r=fB.to(t);if(i.action.kind==="command"){const o=i.action.commandButton.command;return{action:{kind:"command",commandButton:{command:n.fromInternal(o)??{command:o.id,title:o.title}}},result:r}}else return i.action.kind==="followUp"?{action:{kind:"followUp",followup:R$.to(i.action.followup)},result:r}:i.action.kind==="inlineChat"?{action:{kind:"editor",accepted:i.action.action==="accepted"},result:r}:{action:i.action,result:r}}s.to=e})(xxe||(xxe={}));var Sie;(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})(Sie||(Sie={}));var Dxe;(function(s){function e(t){return{kind:kxe.to(t.kind)}}s.to=e})(Dxe||(Dxe={}));var kxe;(function(s){function e(t){switch(t){case nD.Word:return Gx.Word;case nD.Line:return Gx.Line;case nD.Suggest:return Gx.Suggest;default:return Gx.Unknown}}s.to=e})(kxe||(kxe={}));var Ixe;(function(s){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||uAe.None,contextValue:t.contextValue}}s.from=e})(Ixe||(Ixe={}));var Txe;(function(s){function e(t){return{name:t.name,description:t.description,parametersSchema:t.parametersSchema}}s.to=e})(Txe||(Txe={}));class HPe{constructor(){this.requestIdPool=0,this.dataTransferFiles=new Map}add(e){const t=this.requestIdPool++;return this.dataTransferFiles.set(t,Oi(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(r=>r.id===t);if(!n)throw new Error("No matching file found in data transfer");return Ge.wrap(await n.data())}dispose(){this.dataTransferFiles.clear()}}var T8e;(function(s){s.CallsTo="incomingCalls",s.CallsFrom="outgoingCalls"})(T8e||(T8e={}));const drt=new or;class Aie{static async create(e,t,i){const[n]=drt.ordered(e);if(!n)return;const r=await n.prepareCallHierarchy(e,t,i);if(r)return new Aie(r.roots.reduce((o,a)=>o+a._sessionId,""),n,r.roots,new bTe(r))}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 Aie{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async resolveIncomingCalls(e,t){try{const i=await this.provider.provideIncomingCalls(e,t);if(tr(i))return i}catch(i){Nr(i)}return[]}async resolveOutgoingCalls(e,t){try{const i=await this.provider.provideOutgoingCalls(e,t);if(tr(i))return i}catch(i){Nr(i)}return[]}}const bz=new Map;vt.registerCommand("_executePrepareCallHierarchy",async(s,...e)=>{const[t,i]=e;Lt(N.isUri(t)),Lt(re.isIPosition(i));let r=s.get(fi).getModel(t),o;if(!r){const c=await s.get(pn).createModelReference(t);r=c.object.textEditorModel,o=c}try{const a=await Aie.create(r,i,Ue.None);return a?(bz.set(a.id,a),bz.forEach((c,l,d)=>{d.size>10&&(c.dispose(),bz.delete(l))}),[a.root]):[]}finally{o?.dispose()}});function hrt(s){return!0}vt.registerCommand("_executeProvideIncomingCalls",async(s,...e)=>{const[t]=e;Lt(hrt());const i=bz.get(t._sessionId);if(i)return i.resolveIncomingCalls(t,Ue.None)});vt.registerCommand("_executeProvideOutgoingCalls",async(s,...e)=>{const[t]=e;Lt(hrt());const i=bz.get(t._sessionId);if(i)return i.resolveOutgoingCalls(t,Ue.None)});var Lxe;(function(s){const e=[];function t(n){let r=n;return r&&e.push(r),{dispose(){if(r){const o=e.indexOf(r);o>=0&&(e.splice(o,1),r=void 0)}}}}s.register=t;function i(){return e.slice(0)}s.all=i})(Lxe||(Lxe={}));var Rxe;(function(s){s[s.Idle=0]="Idle",s[s.Searching=1]="Searching",s[s.SlowSearch=2]="SlowSearch"})(Rxe||(Rxe={}));new Q("searchState",Rxe.Idle);var L8e;(function(s){s.Subtypes="subtypes",s.Supertypes="supertypes"})(L8e||(L8e={}));const urt=new or;class Eie{static async create(e,t,i){const[n]=urt.ordered(e);if(!n)return;const r=await n.prepareTypeHierarchy(e,t,i);if(r)return new Eie(r.roots.reduce((o,a)=>o+a._sessionId,""),n,r.roots,new bTe(r))}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 Eie{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async provideSupertypes(e,t){try{const i=await this.provider.provideSupertypes(e,t);if(tr(i))return i}catch(i){Nr(i)}return[]}async provideSubtypes(e,t){try{const i=await this.provider.provideSubtypes(e,t);if(tr(i))return i}catch(i){Nr(i)}return[]}}const wz=new Map;vt.registerCommand("_executePrepareTypeHierarchy",async(s,...e)=>{const[t,i]=e;Lt(N.isUri(t)),Lt(re.isIPosition(i));let r=s.get(fi).getModel(t),o;if(!r){const c=await s.get(pn).createModelReference(t);r=c.object.textEditorModel,o=c}try{const a=await Eie.create(r,i,Ue.None);return a?(wz.set(a.id,a),wz.forEach((c,l,d)=>{d.size>10&&(c.dispose(),wz.delete(l))}),[a.root]):[]}finally{o?.dispose()}});function grt(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)}vt.registerCommand("_executeProvideSupertypes",async(s,...e)=>{const[t]=e;Lt(grt(t));const i=wz.get(t._sessionId);if(i)return i.provideSupertypes(t,Ue.None)});vt.registerCommand("_executeProvideSubtypes",async(s,...e)=>{const[t]=e;Lt(grt(t));const i=wz.get(t._sessionId);if(i)return i.provideSubtypes(t,Ue.None)});var Er;let R8e=Er=class extends V{constructor(e,t,i,n,r){if(super(),this._languageService=t,this._languageConfigurationService=i,this._languageFeaturesService=n,this._uriIdentService=r,this._registrations=this._register(new mr),this._pasteEditProviders=new Map,this._documentOnDropEditProviders=new Map,this._proxy=e.getProxy(Je.ExtHostLanguageFeatures),this._languageService){const o=()=>{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)o();else{const c=this._languageConfigurationService.getLanguageConfiguration(a.languageId).getWordDefinition();this._proxy.$setWordDefinitions([{languageId:a.languageId,regexSource:c.source,regexFlags:c.flags}])}})),o()}}$unregister(e){this._registrations.deleteAndDispose(e)}static _reviveLocationDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>Er._reviveLocationDto(t)),e):(e.uri=N.revive(e.uri),e))}static _reviveLocationLinkDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>Er._reviveLocationLinkDto(t)),e):(e.uri=N.revive(e.uri),e))}static _reviveWorkspaceSymbolDto(e){return e&&(Array.isArray(e)?(e.forEach(Er._reviveWorkspaceSymbolDto),e):(e.location=Er._reviveLocationDto(e.location),e))}static _reviveCodeActionDto(e,t){return e?.forEach(i=>Vy(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,r)=>this._proxy.$provideDocumentSymbols(e,n.uri,r)}))}$registerCodeLensSupport(e,t,i){const n={provideCodeLenses:async(r,o)=>{const a=await this._proxy.$provideCodeLenses(e,r.uri,o);if(a)return{lenses:a.lenses,dispose:()=>a.cacheId&&this._proxy.$releaseCodeLenses(e,a.cacheId)}},resolveCodeLens:async(r,o,a)=>{const c=await this._proxy.$resolveCodeLens(e,o,a);if(c)return{...c,range:r.validateRange(c.range)}}};if(typeof i=="number"){const r=new I;this._registrations.set(i,r),n.onDidChange=r.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,r)=>this._proxy.$provideDefinition(e,i.uri,n,r).then(Er._reviveLocationLinkDto)}))}$registerDeclarationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.declarationProvider.register(t,{provideDeclaration:(i,n,r)=>this._proxy.$provideDeclaration(e,i.uri,n,r).then(Er._reviveLocationLinkDto)}))}$registerImplementationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.implementationProvider.register(t,{provideImplementation:(i,n,r)=>this._proxy.$provideImplementation(e,i.uri,n,r).then(Er._reviveLocationLinkDto)}))}$registerTypeDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.typeDefinitionProvider.register(t,{provideTypeDefinition:(i,n,r)=>this._proxy.$provideTypeDefinition(e,i.uri,n,r).then(Er._reviveLocationLinkDto)}))}$registerHoverProvider(e,t){this._registrations.set(e,this._languageFeaturesService.hoverProvider.register(t,{provideHover:async(i,n,r,o)=>{const a={verbosityRequest:o?.verbosityRequest?{verbosityDelta:o.verbosityRequest.verbosityDelta,previousHover:{id:o.verbosityRequest.previousHover.id}}:void 0};return await this._proxy.$provideHover(e,i.uri,n,a,r)}}))}$registerEvaluatableExpressionProvider(e,t){this._registrations.set(e,this._languageFeaturesService.evaluatableExpressionProvider.register(t,{provideEvaluatableExpression:(i,n,r)=>this._proxy.$provideEvaluatableExpression(e,i.uri,n,r)}))}$registerInlineValuesProvider(e,t,i){const n={provideInlineValues:(r,o,a,c)=>this._proxy.$provideInlineValues(e,r.uri,o,a,c)};if(typeof i=="number"){const r=new I;this._registrations.set(i,r),n.onDidChangeInlineValues=r.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,r)=>this._proxy.$provideDocumentHighlights(e,i.uri,n,r)}))}$registerMultiDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.multiDocumentHighlightProvider.register(t,{selector:t,provideMultiDocumentHighlights:(i,n,r,o)=>this._proxy.$provideMultiDocumentHighlights(e,i.uri,n,r.map(a=>a.uri),o).then(a=>{if(wU(a))return;const c=new gi;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,r)=>{const o=await this._proxy.$provideLinkedEditingRanges(e,i.uri,n,r);if(o)return{ranges:o.ranges,wordPattern:o.wordPattern?Er._reviveRegExp(o.wordPattern):void 0}}}))}$registerReferenceSupport(e,t){this._registrations.set(e,this._languageFeaturesService.referenceProvider.register(t,{provideReferences:(i,n,r,o)=>this._proxy.$provideReferences(e,i.uri,n,r,o).then(Er._reviveLocationDto)}))}$registerCodeActionSupport(e,t,i,n,r,o){const a={provideCodeActions:async(c,l,d,h)=>{const u=await this._proxy.$provideCodeActions(e,c.uri,l,d,h);if(u)return{actions:Er._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:r};o&&(a.resolveCodeAction=async(c,l)=>{const d=await this._proxy.$resolveCodeAction(e,c.cacheId,l);return d.edit&&(c.edit=Vy(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 Mxe(e,this._proxy,i,this._uriIdentService);this._pasteEditProviders.set(e,n),this._registrations.set(e,Yo(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:(r,o,a)=>this._proxy.$provideDocumentFormattingEdits(e,r.uri,o,a)}))}$registerRangeFormattingSupport(e,t,i,n,r){this._registrations.set(e,this._languageFeaturesService.documentRangeFormattingEditProvider.register(t,{extensionId:i,displayName:n,provideDocumentRangeFormattingEdits:(o,a,c,l)=>this._proxy.$provideDocumentRangeFormattingEdits(e,o.uri,a,c,l),provideDocumentRangesFormattingEdits:r?(o,a,c,l)=>this._proxy.$provideDocumentRangesFormattingEdits(e,o.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:(r,o,a,c,l)=>this._proxy.$provideOnTypeFormattingEdits(e,r.uri,o,a,c,l)}))}$registerNavigateTypeSupport(e,t){let i;const n={provideWorkspaceSymbols:async(r,o)=>{const a=await this._proxy.$provideWorkspaceSymbols(e,r,o);return i!==void 0&&this._proxy.$releaseWorkspaceSymbols(e,i),i=a.cacheId,Er._reviveWorkspaceSymbolDto(a.symbols)}};t&&(n.resolveWorkspaceSymbol=async(r,o)=>{const a=await this._proxy.$resolveWorkspaceSymbol(e,r,o);return a&&Er._reviveWorkspaceSymbolDto(a)}),this._registrations.set(e,Lxe.register(n))}$registerRenameSupport(e,t,i){this._registrations.set(e,this._languageFeaturesService.renameProvider.register(t,{provideRenameEdits:(n,r,o,a)=>this._proxy.$provideRenameEdits(e,n.uri,r,o,a).then(c=>Vy(c,this._uriIdentService)),resolveRenameLocation:i?(n,r,o)=>this._proxy.$resolveRenameLocation(e,n.uri,r,o):void 0}))}$registerNewSymbolNamesProvider(e,t){this._registrations.set(e,this._languageFeaturesService.newSymbolNamesProvider.register(t,{supportsAutomaticNewSymbolNamesTriggerKind:this._proxy.$supportsAutomaticNewSymbolNamesTriggerKind(e),provideNewSymbolNames:(i,n,r,o)=>this._proxy.$provideNewSymbolNames(e,i.uri,n,r,o)}))}$registerDocumentSemanticTokensProvider(e,t,i,n){let r;if(typeof n=="number"){const o=new I;this._registrations.set(n,o),r=o.event}this._registrations.set(e,this._languageFeaturesService.documentSemanticTokensProvider.register(t,new Ojt(this._proxy,e,i,r)))}$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 Bjt(this._proxy,e,i)))}static _inflateSuggestDto(e,t,i){const n=t[Ri.label],r=t[Ri.commandId],o=t[Ri.commandIdent],a=t[Ri.commitCharacters];return{label:n,extensionId:i,kind:t[Ri.kind]??Me.Property,tags:t[Ri.kindModifier],detail:t[Ri.detail],documentation:t[Ri.documentation],sortText:t[Ri.sortText],filterText:t[Ri.filterText],preselect:t[Ri.preselect],insertText:t[Ri.insertText]??(typeof n=="string"?n:n.label),range:t[Ri.range]??e,insertTextRules:t[Ri.insertTextRules],commitCharacters:a?Array.from(a):void 0,additionalTextEdits:t[Ri.additionalTextEdits],command:r?{$ident:o,id:r,title:"",arguments:o?[o]:t[Ri.commandArguments]}:void 0,_id:t.x}}$registerCompletionsProvider(e,t,i,n,r){const o={triggerCharacters:i,_debugDisplayName:`${r.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[ky.completions].map(u=>Er._inflateSuggestDto(h[ky.defaultRanges],u,r)),incomplete:h[ky.isIncomplete]||!1,duration:h[ky.duration],dispose:()=>{typeof h.x=="number"&&this._proxy.$releaseCompletionItems(e,h.x)}}}};n&&(o.resolveCompletionItem=(a,c)=>this._proxy.$resolveCompletionItem(e,a._id,c).then(l=>{if(!l)return a;const d=Er._inflateSuggestDto(a.range,l,r);return mp(a,d,!0)})),this._registrations.set(e,this._languageFeaturesService.completionProvider.register(t,o))}$registerInlineCompletionsSupport(e,t,i,n,r){const o={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:r,toString(){return`InlineCompletionsProvider(${n})`}};this._registrations.set(e,this._languageFeaturesService.inlineCompletionsProvider.register(t,o))}$registerInlineEditProvider(e,t,i){const n={provideInlineEdit:async(r,o,a)=>this._proxy.$provideInlineEdit(e,r.uri,o,a),freeInlineEdit:r=>{this._proxy.$freeInlineEdit(e,r.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,r,o,a)=>{const c=await this._proxy.$provideSignatureHelp(e,n.uri,r,a,o);if(c)return{value:c,dispose:()=>{this._proxy.$releaseSignatureHelp(e,c.id)}}}}))}$registerInlayHintsProvider(e,t,i,n,r){const o={displayName:r,provideInlayHints:async(a,c,l)=>{const d=await this._proxy.$provideInlayHints(e,a.uri,c,l);if(d)return{hints:Mr(d.hints),dispose:()=>{d.cacheId&&this._proxy.$releaseInlayHints(e,d.cacheId)}}}};if(i&&(o.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 Na;return d?{...a,tooltip:d.tooltip,label:Mr(d.label),textEdits:d.textEdits}:a}),typeof n=="number"){const a=new I;this._registrations.set(n,a),o.onDidChangeInlayHints=a.event}this._registrations.set(e,this._languageFeaturesService.inlayHintsProvider.register(t,o))}$emitInlayHintsEvent(e){const t=this._registrations.get(e);t instanceof I&&t.fire(void 0)}$registerDocumentLinkProvider(e,t,i){const n={provideLinks:(r,o)=>this._proxy.$provideDocumentLinks(e,r.uri,o).then(a=>{if(a)return{links:a.links.map(Er._reviveLinkDTO),dispose:()=>{typeof a.cacheId=="number"&&this._proxy.$releaseDocumentLinks(e,a.cacheId)}}})};i&&(n.resolveLink=(r,o)=>{const a=r;return a.cacheId?this._proxy.$resolveDocumentLink(e,a.cacheId,o).then(c=>c&&Er._reviveLinkDTO(c)):r}),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,r)=>i.$provideDocumentColors(e,n.uri,r).then(o=>o.map(a=>{const[c,l,d,h]=a.color;return{color:{red:c,green:l,blue:d,alpha:h},range:a.range}})),provideColorPresentations:(n,r,o)=>i.$provideColorPresentations(e,n.uri,{color:[r.color.red,r.color.green,r.color.blue,r.color.alpha],range:r.range},o)}))}$registerFoldingRangeProvider(e,t,i,n){const r={id:i.value,provideFoldingRanges:(o,a,c)=>this._proxy.$provideFoldingRanges(e,o.uri,a,c)};if(typeof n=="number"){const o=new I;this._registrations.set(n,o),r.onDidChange=o.event}this._registrations.set(e,this._languageFeaturesService.foldingRangeProvider.register(t,r))}$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,r)=>this._proxy.$provideSelectionRanges(e,i.uri,n,r)}))}$registerCallHierarchyProvider(e,t){this._registrations.set(e,drt.register(t,{prepareCallHierarchy:async(i,n,r)=>{const o=await this._proxy.$prepareCallHierarchy(e,i.uri,n,r);if(!(!o||o.length===0))return{dispose:()=>{for(const a of o)this._proxy.$releaseCallHierarchy(e,a._sessionId)},roots:o.map(Er._reviveCallHierarchyItemDto)}},provideOutgoingCalls:async(i,n)=>{const r=await this._proxy.$provideCallHierarchyOutgoingCalls(e,i._sessionId,i._itemId,n);return r&&(r.forEach(o=>{o.to=Er._reviveCallHierarchyItemDto(o.to)}),r)},provideIncomingCalls:async(i,n)=>{const r=await this._proxy.$provideCallHierarchyIncomingCalls(e,i._sessionId,i._itemId,n);return r&&(r.forEach(o=>{o.from=Er._reviveCallHierarchyItemDto(o.from)}),r)}}))}static _reviveRegExp(e){return new RegExp(e.pattern,e.flags)}static _reviveIndentationRule(e){return{decreaseIndentPattern:Er._reviveRegExp(e.decreaseIndentPattern),increaseIndentPattern:Er._reviveRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Er._reviveRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Er._reviveRegExp(e.unIndentedLinePattern):void 0}}static _reviveOnEnterRule(e){return{beforeText:Er._reviveRegExp(e.beforeText),afterText:e.afterText?Er._reviveRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Er._reviveRegExp(e.previousLineText):void 0,action:e.action}}static _reviveOnEnterRules(e){return e.map(Er._reviveOnEnterRule)}$setLanguageConfiguration(e,t,i){const n={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Er._reviveRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Er._reviveIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Er._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,urt.register(t,{prepareTypeHierarchy:async(i,n,r)=>{const o=await this._proxy.$prepareTypeHierarchy(e,i.uri,n,r);if(o)return{dispose:()=>{for(const a of o)this._proxy.$releaseTypeHierarchy(e,a._sessionId)},roots:o.map(Er._reviveTypeHierarchyItemDto)}},provideSupertypes:async(i,n)=>{const r=await this._proxy.$provideTypeHierarchySupertypes(e,i._sessionId,i._itemId,n);return r&&r.map(Er._reviveTypeHierarchyItemDto)},provideSubtypes:async(i,n)=>{const r=await this._proxy.$provideTypeHierarchySubtypes(e,i._sessionId,i._itemId,n);return r&&r.map(Er._reviveTypeHierarchyItemDto)}}))}$registerDocumentOnDropEditProvider(e,t,i){const n=new Nxe(e,this._proxy,i,this._uriIdentService);this._documentOnDropEditProviders.set(e,n),this._registrations.set(e,Yo(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 Wjt(i,e,this._proxy,this._uriIdentService);this._registrations.set(e,this._languageFeaturesService.mappedEditsProvider.register(t,n))}};R8e=Er=D([Ki(We.MainThreadLanguageFeatures),_(1,Di),_(2,zs),_(3,nt),_(4,Is)],R8e);let Mxe=class{constructor(e,t,i,n){this._handle=e,this._proxy=t,this._uriIdentService=n,this.dataTransfers=new HPe,this.copyMimeTypes=i.copyMimeTypes,this.pasteMimeTypes=i.pasteMimeTypes,this.providedPasteEditKinds=i.providedPasteEditKinds?.map(r=>new Jn(r)),i.supportsCopy&&(this.prepareDocumentPaste=async(r,o,a,c)=>{const l=await U_.from(a);if(c.isCancellationRequested)return;const d=await this._proxy.$prepareDocumentPaste(e,r.uri,o,l,c);if(!d)return;const h=new Ice;for(const[u,f]of d.items)h.replace(u,rG(f.asString));return h}),i.supportsPaste&&(this.provideDocumentPasteEdits=async(r,o,a,c,l)=>{const d=this.dataTransfers.add(a);try{const h=await U_.from(a);if(l.isCancellationRequested)return;const u=await this._proxy.$providePasteEdits(this._handle,d.id,r.uri,o,h,{only:c.only?.value,triggerKind:c.triggerKind},l);return u?{edits:u.map(f=>({...f,kind:f.kind?new Jn(f.kind.value):new Jn(""),yieldTo:f.yieldTo?.map(p=>({kind:new Jn(p)})),additionalEdit:f.additionalEdit?Vy(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(r,o)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,r._cacheId,o);return a.additionalEdit&&(r.additionalEdit=Vy(a.additionalEdit,this._uriIdentService)),r})}resolveFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};Mxe=D([_(3,Is)],Mxe);let Nxe=class{constructor(e,t,i,n){this._handle=e,this._proxy=t,this._uriIdentService=n,this.dataTransfers=new HPe,this.dropMimeTypes=i?.dropMimeTypes??["*/*"],i?.supportsResolve&&(this.resolveDocumentDropEdit=async(r,o)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,r._cacheId,o);return a.additionalEdit&&(r.additionalEdit=Vy(a.additionalEdit,this._uriIdentService)),r})}async provideDocumentDropEdits(e,t,i,n){const r=this.dataTransfers.add(i);try{const o=await U_.from(i);if(n.isCancellationRequested)return;const a=await this._proxy.$provideDocumentOnDropEdits(this._handle,r.id,e.uri,t,o,n);return a?{edits:a.map(c=>({...c,yieldTo:c.yieldTo?.map(l=>({kind:new Jn(l)})),kind:c.kind?new Jn(c.kind):void 0,additionalEdit:Vy(c.additionalEdit,this._uriIdentService,l=>this.resolveDocumentOnDropFileData(r.id,l))})),dispose:()=>{this._proxy.$releaseDocumentOnDropEdits(this._handle,r.id)}}:void 0}finally{r.dispose()}}resolveDocumentOnDropFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};Nxe=D([_(3,Is)],Nxe);class Ojt{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,r=await this._proxy.$provideDocumentSemanticTokens(this._handle,e.uri,n,i);if(!r||i.isCancellationRequested)return null;const o=pZ(r);return o.type==="full"?{resultId:String(o.id),data:o.data}:{resultId:String(o.id),edits:o.deltas}}}class Bjt{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 r=pZ(n);if(r.type==="full")return{resultId:String(r.id),data:r.data};throw new Error("Unexpected")}}class Wjt{constructor(e,t,i,n){this.displayName=e,this._handle=t,this._proxy=i,this._uriService=n}async provideMappedEdits(e,t,i,n){const r=await this._proxy.$provideMappedEdits(this._handle,e.uri,t,i,n);return r?Vy(r,this._uriService):null}}let M8e=class{constructor(e,t,i,n,r){this._languageService=t,this._modelService=i,this._resolverService=n,this._languageStatusService=r,this._disposables=new Z,this._status=new mr,this._proxy=e.getProxy(Je.ExtHostLanguages),this._proxy.$acceptLanguageIds(t.getRegisteredLanguageIds()),this._disposables.add(t.onDidChange(o=>{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 r=n.tokenization.getLineTokens(t.lineNumber),o=r.findTokenIndexAtOffset(t.column-1);return{type:r.getStandardTokenType(o),range:new F(t.lineNumber,1+r.getStartOffset(o),t.lineNumber,1+r.getEndOffset(o))}}$setLanguageStatus(e,t){this._status.get(e)?.dispose(),this._status.set(e,this._languageStatusService.addStatus(t))}$removeLanguageStatus(e){this._status.get(e)?.dispose()}};M8e=D([Ki(We.MainThreadLanguages),_(1,Di),_(2,fi),_(3,pn),_(4,mce)],M8e);let N8e=class{constructor(e,t){this.loggerService=t,this.disposables=new Z;const i=e.getProxy(Je.ExtHostLogLevelServiceShape);this.disposables.add(t.onDidChangeLogLevel(n=>{Bje(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,r]of t)$Y(i,n,r)}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()}};N8e=D([Ki(We.MainThreadLogger),_(1,pf)],N8e);vt.registerCommand("_extensionTests.setLogLevel",function(s,e){const t=s.get(pf),i=s.get(ec);if(i.isExtensionDevelopment&&i.extensionTestsLocationURI){const n=Uje(e);n!==void 0&&t.setLogLevel(n)}});vt.registerCommand("_extensionTests.getLogLevel",function(s){const e=s.get(Ke);return f3(e.getLevel())});let P8e=class{constructor(e,t,i,n,r){this._notificationService=t,this._commandService=i,this._dialogService=n,this.extensionsListener=r.onDidChangeExtensions(o=>{for(const a of o.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(r=>{const o=i.map(d=>al({id:`_extension_message_handle_${d.handle}`,label:d.title,enabled:!0,run:()=>(r(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(al({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:o,secondary:c},source:a});M.once(l.onDidClose)(()=>{r(void 0)})})}async _showModalMessage(e,t,i,n,r){const o=[];let a;for(const l of n){const d={label:l.title,run:()=>l.handle};l.isCloseAffordance?a=d:o.push(d)}a||(o.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:o,cancelButton:a,custom:r});return c}};P8e=D([Ki(We.MainThreadMessageService),_(1,wi),_(2,bi),_(3,ir),_(4,ps)],P8e);const Hjt=(s,e,t)=>{const i=new Uint8Array(16);for(let o=0;o<16;o++)i[o]=Math.round(Math.random()*256);const n=zTe(Ge.wrap(i));return[`GET ws://localhost${s}?${e}&skipWebSocketFrames=true HTTP/1.1`,"Connection: Upgrade","Upgrade: websocket",`Sec-WebSocket-Key: ${n}`].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?qh.DONT_SAVE:qh.CANCEL}async revert(){this._isReverted=!0}constructor(e,t,i,n,r,o,a,c,l){super(),this.resource=e,this._terminalInstance=t,this._themeService=i,this._terminalInstanceService=n,this._instantiationService=r,this._configurationService=o,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=qEe.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(NT.User),wt([t,i])}));const n=[e.onExit(r=>{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(r=>{this._isShuttingDown=!0,wt(n),this._configurationService.getValue(zw.EnablePersistentSessions)&&r.reason===pD.RELOAD?e.detachProcessAndDispose(NT.Shutdown):e.dispose(NT.Shutdown)})}getName(){return this._terminalInstance?.title||this.resource.fragment}getIcon(){if(!(!this._terminalInstance||!He.isThemeIcon(this._terminalInstance.icon)))return this._terminalInstance.icon}getLabelExtraClasses(){if(!this._terminalInstance)return[];const e=["terminal-tab","predefined-file-icon"],t=ujt(this._terminalInstance);t&&e.push(t);const i=gjt(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:m8e,pinned:!0,forceReload:!0}}}},_j=iM,iM.ID="workbench.editors.terminal",iM);QEe=_j=D([_(2,mn),_(3,hZe),_(4,we),_(5,Te),_(6,rg),_(7,Le),_(8,ir)],QEe);let y8e=class{constructor(e,t,i,n,r){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 mr,this._proxy=e.getProxy(Je.ExtHostEditorTabs),this._dispoables.add(r.onDidEditorsChange(o=>{try{this._updateTabsModel(o)}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 GEe)return{kind:ua.TextMergeInput,base:e.base,input1:e.input1.uri,input2:e.input2.uri,result:e.resource};if(e instanceof gb)return{kind:ua.TextInput,uri:e.resource};if(e instanceof cp&&!(e instanceof Yg)){const t=e.primary.resource,i=e.secondary.resource;return e.primary instanceof gb&&e.secondary instanceof gb&&Yi(t,i)&&t&&i?{kind:ua.TextInput,uri:t}:{kind:ua.UnknownInput}}if(e instanceof nL)return{kind:ua.NotebookInput,notebookType:e.viewType,uri:e.resource};if(e instanceof hB)return{kind:ua.CustomEditorInput,viewType:e.viewType,uri:e.resource};if(e instanceof Wu)return{kind:ua.WebviewEditorInput,viewType:e.viewType};if(e instanceof QEe)return{kind:ua.TerminalEditorInput};if(e instanceof Yg){if(e.modified instanceof gb&&e.original instanceof gb)return{kind:ua.TextDiffInput,modified:e.modified.resource,original:e.original.resource};if(e.modified instanceof nL&&e.original instanceof nL)return{kind:ua.NotebookDiffInput,notebookType:e.original.viewType,modified:e.modified.resource,original:e.original.resource}}if(e instanceof OEe)return{kind:ua.InteractiveEditorInput,uri:e.resource,inputBoxUri:e.inputResource};if(e instanceof mCe)return{kind:ua.ChatEditorInput};if(e instanceof uB){const t=[];for(const i of e?.resources.get()??[])i.originalUri&&i.modifiedUri&&t.push({kind:ua.TextDiffInput,original:i.originalUri,modified:i.modifiedUri});return{kind:ua.MultiDiffEditorInput,diffEditors:t}}return{kind:ua.UnknownInput}}_generateTabId(e,t){let i;const n=Fa.getCanonicalUri(e,{supportSideBySide:Us.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),r=this._tabInfoLookup.get(n);r?(r.tab.label=t.getName(),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:r.tab,kind:mh.TAB_UPDATE})):(this._logService.error("Invalid model for label change, rebuilding"),this._createTabsModel())}_onDidTabOpen(e,t,i){const n=this._editorGroupsService.getGroup(e),r=this._groupLookup.get(e)!==void 0;if(!n||!r){this._createTabsModel();return}const o=this._groupLookup.get(e)?.tabs;if(!o)return;const a=this._buildTabObject(n,t,i);o.splice(i,0,a);const c=this._generateTabId(t,e);this._tabInfoLookup.set(c,{group:n,editorInput:t,tab:a}),t instanceof uB&&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:mh.TAB_UPDATE}))})),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:a,kind:mh.TAB_OPEN})}_onDidTabClose(e,t){const i=this._editorGroupsService.getGroup(e),n=this._groupLookup.get(e)?.tabs;if(!i||!n){this._createTabsModel();return}const r=n.splice(t,1);r.length!==0&&(this._tabInfoLookup.delete(r[0]?.id??""),r[0]?.input instanceof uB&&this._multiDiffEditorInputListeners.deleteAndDispose(r[0]?.input),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:r[0],kind:mh.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:mh.TAB_UPDATE})}_onDidTabDirty(e,t,i){const n=this._generateTabId(i,e),r=this._tabInfoLookup.get(n);if(!r){this._logService.error("Invalid model for dirty change, rebuilding"),this._createTabsModel();return}r.tab.isDirty=i.isDirty(),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:r.tab,kind:mh.TAB_UPDATE})}_onDidTabPinChange(e,t,i){const n=this._generateTabId(i,e),r=this._tabInfoLookup.get(n),o=r?.group,a=r?.tab;if(!o||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPinned=o.isSticky(t),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:a,kind:mh.TAB_UPDATE})}_onDidTabPreviewChange(e,t,i){const n=this._generateTabId(i,e),r=this._tabInfoLookup.get(n),o=r?.group,a=r?.tab;if(!o||!a){this._logService.error("Invalid model for sticky change, rebuilding"),this._createTabsModel();return}a.isPreview=!o.isPinned(t),this._proxy.$acceptTabOperation({kind:mh.TAB_UPDATE,groupId:e,tabDto:a,index:t})}_onDidTabMove(e,t,i,n){const r=this._groupLookup.get(e)?.tabs;if(!r){this._logService.error("Invalid model for move change, rebuilding"),this._createTabsModel();return}const o=r.splice(i,1);o.length!==0&&(r.splice(t,0,o[0]),this._proxy.$acceptTabOperation({kind:mh.TAB_MOVE,groupId:e,tabDto:o[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:uI(this._editorGroupsService,t),tabs:[]};t.editors.forEach((n,r)=>{const o=this._buildTabObject(t,n,r);e.push(o),this._tabInfoLookup.set(this._generateTabId(n,t.id),{group:t,tab:o,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 Dr.GROUP_ACTIVE:if(i===this._editorGroupsService.activeGroup.id){this._onDidGroupActivate();break}else return;case Dr.EDITOR_LABEL:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabLabelChange(i,t.editor,t.editorIndex);break}case Dr.EDITOR_OPEN:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabOpen(i,t.editor,t.editorIndex);break}case Dr.EDITOR_CLOSE:if(t.editorIndex!==void 0){this._onDidTabClose(i,t.editorIndex);break}case Dr.EDITOR_ACTIVE:if(t.editorIndex!==void 0){this._onDidTabActiveChange(i,t.editorIndex);break}case Dr.EDITOR_DIRTY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabDirty(i,t.editorIndex,t.editor);break}case Dr.EDITOR_STICKY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPinChange(i,t.editorIndex,t.editor);break}case Dr.EDITOR_PIN:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPreviewChange(i,t.editorIndex,t.editor);break}case Dr.EDITOR_TRANSIENT:break;case Dr.EDITOR_MOVE:if($Qt(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 r=GZ(this._editorGroupsService,this._configurationService,i),o=this._tabInfoLookup.get(e);if(!o?.tab)throw new Error(`Attempted to close tab with id ${e} which does not exist`);let c;const l=this._editorGroupsService.getGroup(o.group.id);if(!l)return;if(this._groupLookup.get(r)===void 0){let h=qW.RIGHT;i===nv&&(h=QW(this._configurationService)),c=this._editorGroupsService.addGroup(this._editorGroupsService.groups[this._editorGroupsService.groups.length-1],h)}else c=this._editorGroupsService.getGroup(r);if(!c)return;(t<0||t>c.editors.length)&&(t=c.editors.length);const d=o?.editorInput;d&&l.moveEditor(d,c,{index:t,preserveFocus:n})}async $closeTab(e,t){const i=new Map;for(const r of e){const o=this._tabInfoLookup.get(r),a=o?.tab,c=o?.group,l=o?.editorInput;if(!c||!a||!o||!l)continue;const d=i.get(c);d?d.push(l):i.set(c,[l])}const n=[];for(const[r,o]of i)n.push(await r.closeEditors(o,{preserveFocus:t}));return n.every(r=>r)}async $closeGroup(e,t){const i=[];for(const n of e){const r=this._editorGroupsService.getGroup(n);r&&(i.push(await r.closeAllEditors()),r.count===0&&this._editorGroupsService.getGroup(r.id)&&this._editorGroupsService.removeGroup(r))}return i.every(n=>n)}};y8e=D([Ki(We.MainThreadEditorTabs),_(1,Pr),_(2,Te),_(3,Ke),_(4,ti)],y8e);let C8e=class{dispose(){}$onUnexpectedError(e){e&&e.$isError&&(e=_8(e)),bt(e)}};C8e=D([Ki(We.MainThreadErrors)],C8e);let S8e=class{constructor(e,t,i,n,r,o,a,c,l){this._extensionService=t,this._notificationService=i,this._extensionsWorkbenchService=n,this._hostService=r,this._extensionEnablementService=o,this._timerService=a,this._commandService=c,this._environmentService=l,this._extensionHostKind=e.extensionHostKind;const d=e;this._internalExtensionService=d.internalExtensionService,d._setExtensionHostProxy(new vjt(e.getProxy(Je.ExtHostExtensionService))),d._setAllMainProxyIdentifiers(Object.keys(We).map(h=>We[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,r){this._internalExtensionService._onDidActivateExtension(e,t,i,n,r)}$onExtensionRuntimeError(e,t){const i=_8(t);this._internalExtensionService._onExtensionRuntimeError(e,i),console.error(`[${e.value}]${i.message}`),console.error(i.stack)}async $onExtensionActivationError(e,t,i){const n=_8(t);if(this._internalExtensionService._onDidActivateExtensionError(e,n),i){const o=await this._extensionService.getExtension(e.value);if(o){const c=(await this._extensionsWorkbenchService.queryLocal()).find(l=>Na(l.identifier,{id:i.dependency}));if(c?.local){await this._handleMissingInstalledDependency(o,c.local);return}else{await this._handleMissingNotInstalledDependency(o,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:Ze.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 an("reload",g(4831,"Reload Window"),"",!0,()=>this._hostService.reload())]}});else{const n=this._extensionEnablementService.getEnablementState(t);n===Ko.DisabledByVirtualWorkspace?this._notificationService.notify({severity:Ze.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===Ko.DisabledByTrustRequirement?this._notificationService.notify({severity:Ze.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 an("manageWorkspaceTrust",g(4834,"Manage Workspace Trust"),"",!0,()=>this._commandService.executeCommand("workbench.trust.manage"))]}}):this._extensionEnablementService.canChangeEnablement(t)?this._notificationService.notify({severity:Ze.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 an("enable",g(4836,"Enable and Reload"),"",!0,()=>this._extensionEnablementService.setEnablement([t],n===Ko.DisabledGlobally?Ko.EnabledGlobally:Ko.EnabledWorkspace).then(()=>this._hostService.reload(),r=>this._notificationService.error(r)))]}}):this._notificationService.notify({severity:Ze.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}],Ue.None))[0]}catch{}n?this._notificationService.notify({severity:Ze.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 an("install",g(4839,"Install and Reload"),"",!0,()=>this._extensionsWorkbenchService.install(n).then(()=>this._hostService.reload(),r=>this._notificationService.error(r)))]}}):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===dr.LocalProcess?this._timerService.setPerformanceMarks("localExtHost",e):this._extensionHostKind===dr.LocalWebWorker?this._timerService.setPerformanceMarks("workerExtHost",e):this._timerService.setPerformanceMarks("remoteExtHost",e)}async $asBrowserUri(e){return sf.uriToBrowserUri(N.revive(e))}async $getAllStaticBrowserUris(){return Array.from(sf.getRegisteredBrowserUris(),e=>[e,sf.uriToBrowserUri(e)])}};S8e=D([Ki(We.MainThreadExtensionService),_(1,ps),_(2,wi),_(3,Xr),_(4,Dc),_(5,Ol),_(6,PZe),_(7,bi),_(8,Xo)],S8e);class vjt{constructor(e){this._actual=e}async resolveAuthority(e,t){return bjt(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 bjt(s){return s.type==="ok"?{type:"ok",value:{...s.value,authority:wjt(s.value.authority)}}:s}function wjt(s){return{...s,connectTo:yjt(s.connectTo)}}function yjt(s){return s.type===eH.WebSocket?new jnt(s.host,s.port):new Qnt(s.id)}var Vm;let A8e=Vm=class{constructor(e,t){this._fileService=t,this._fileProvider=new mr,this._disposables=new Z,this._proxy=e.getProxy(Je.ExtHostFileSystem);const i=e.getProxy(Je.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 OPe(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?up.Readonly:void 0,type:Vm._asFileType(t)})).catch(Vm._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,Vm._asFileType(i)]):[]}).catch(Vm._handleError)}static _asFileType(e){let t=0;return e.isFile?t+=rn.File:e.isDirectory&&(t+=rn.Directory),e.isSymbolicLink&&(t+=rn.SymbolicLink),t}$readFile(e){return this._fileService.readFile(N.revive(e)).then(t=>t.value).catch(Vm._handleError)}$writeFile(e,t){return this._fileService.writeFile(N.revive(e),t).then(()=>{}).catch(Vm._handleError)}$rename(e,t,i){return this._fileService.move(N.revive(e),N.revive(t),i.overwrite).then(()=>{}).catch(Vm._handleError)}$copy(e,t,i){return this._fileService.copy(N.revive(e),N.revive(t),i.overwrite).then(()=>{}).catch(Vm._handleError)}$mkdir(e){return this._fileService.createFolder(N.revive(e)).then(()=>{}).catch(Vm._handleError)}$delete(e,t){return this._fileService.del(N.revive(e),t).catch(Vm._handleError)}static _handleError(e){if(e instanceof Rd)switch(e.fileOperationResult){case ji.FILE_NOT_FOUND:e.name=ot.FileNotFound;break;case ji.FILE_IS_DIRECTORY:e.name=ot.FileIsADirectory;break;case ji.FILE_PERMISSION_DENIED:e.name=ot.NoPermissions;break;case ji.FILE_MOVE_CONFLICT:e.name=ot.FileExists;break}else if(e instanceof Error){const t=Qk(e);t!==ot.Unknown&&(e.name=t)}throw e}$ensureActivation(e){return this._fileService.activateProvider(e)}};A8e=Vm=D([Ki(We.MainThreadFileSystem),_(1,Xt)],A8e);class OPe{constructor(e,t,i,n,r,o){this.readOnlyMessage=n,this._handle=r,this._proxy=o,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(OPe._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,Ge.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,r){return this._proxy.$read(this._handle,e,t,r).then(o=>(i.set(o.buffer,n),o.byteLength))}write(e,t,i,n,r){return this._proxy.$write(this._handle,e,t,Ge.wrap(i).slice(n,n+r))}}const uoe=class uoe 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 yn),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 li(C),L=setTimeout(()=>A.cancel(),y),k=await r.withProgress({location:fd.Notification,title:this._progressLabel(b),cancellable:!0,delay:Math.min(y/2,3e3)},()=>{const z=p._proxy.$onWillRunFileOperation(b,v,y,A.token);return $_(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(vj.MementoKeyAdditionalEdits,Ie.PROFILE);if(l.extensionTestsLocationURI&&(R=!1),R===void 0){let z;if(k.extensionNames.length===1?b===Ei.CREATE?z=g(4841,"Extension '{0}' wants to make refactoring changes with this file creation",k.extensionNames[0]):b===Ei.COPY?z=g(4842,"Extension '{0}' wants to make refactoring changes with this file copy",k.extensionNames[0]):b===Ei.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===Ei.CREATE?z=g(4845,"{0} extensions want to make refactoring changes with this file creation",k.extensionNames.length):b===Ei.COPY?z=g(4846,"{0} extensions want to make refactoring changes with this file copy",k.extensionNames.length):b===Ei.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 o.confirm({type:Ze.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 o.prompt({type:Ze.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(vj.MementoKeyAdditionalEdits,R,Ie.PROFILE,cn.USER)}}c.info("[onWill-handler] applying additional workspace edit from extensions",k.extensionNames),await n.apply(Vy(k.edit,d),{undoRedoGroupId:w?.undoRedoGroupId,showPreview:R})}_progressLabel(v){switch(v){case Ei.CREATE:return g(4853,"Running 'File Create' participants...");case Ei.MOVE:return g(4854,"Running 'File Rename' participants...");case Ei.COPY:return g(4855,"Running 'File Copy' participants...");case Ei.DELETE:return g(4856,"Running 'File Delete' participants...");case Ei.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,r){const o=N.revive(i),a={...n};if(a.recursive)try{(await this._fileService.stat(o)).isDirectory||(a.recursive=!1)}catch{}if(r){this._logService.trace(`MainThreadFileSystemEventService#$watch(): request to start watching correlated (extension: ${e}, path: ${o.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=new Z,l=c.add(this._fileService.createWatcher(o,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: ${o.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);const c=this._contextService.getWorkspaceFolder(o);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=`${qy(h,"/")}/${P1}`;a.includes.push(Cjt(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: ${o.toString(!0)}, recursive: ${a.recursive}, session: ${t})`);return}}const l=this._fileService.watch(o,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()}},vj=nM,nM.MementoKeyAdditionalEdits="file.particpants.additionalEdits",nM);jEe=vj=D([Ki(We.MainThreadFileSystemEventService),_(1,Xt),_(2,qb),_(3,UN),_(4,hg),_(5,ir),_(6,Gi),_(7,Ke),_(8,ec),_(9,Is),_(10,Ci),_(11,Ke),_(12,Te)],jEe);Et(class extends di{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(Gi).remove(jEe.MementoKeyAdditionalEdits,Ie.PROFILE)}});const Ig=Symbol("unset");class Wte{constructor(){this.root=new Zue,this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||ui.empty()}get entries(){return this.root.children?.entries()||ui.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===Ig?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!==Ig){for(this._size--,t[i].node._value=Ig;i>0;i--){const{node:r,part:o}=t[i];if(r.children?.size||r._value!==Ig)break;t[i-1].node.children.delete(o)}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 r=t[n-1];if(r.node.children.delete(t[n].part),r.node.children.size>0||r.node._value!==Ig)break}for(const n of x8e(i))n._value!==Ig&&(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===Ig?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!==Ig)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!==Ig}getPathToKey(e){const t=[{part:"",node:this.root}];let i=0;for(const n of e){const r=t[i].node.children?.get(n);if(!r)return;t.push({part:n,node:r}),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 Zue;n.children.set(a,c),n=c}else{const c=new Zue;n.children=new Map([[a,c]]),n=c}i?.(n)}const r=n._value===Ig?0:1;t(n);const o=n._value===Ig?0:1;this._size+=o-r}*values(){for(const{_value:e}of x8e(this.root))e!==Ig&&(yield e)}}function*x8e(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 Zue=class{constructor(){this._value=Ig}get value(){return this._value===Ig?void 0:this._value}set value(e){this._value=e===void 0?Ig:e}};var s_;(function(s){s.Delimiter="\0"})(s_||(s_={}));var Hv;(function(s){s[s.IsSame=0]="IsSame",s[s.Disconnected=1]="Disconnected",s[s.IsChild=2]="IsChild",s[s.IsParent=3]="IsParent"})(Hv||(Hv={}));class bn{static fromExtHostTestItem(e,t,i=e.parent){if(e._isRoot)return new bn([t]);const n=[e.id];for(let r=i;r&&r.id!==t;r=r.parent)n.push(r.id);return n.push(t),new bn(n.reverse())}static isRoot(e){return!e.includes(s_.Delimiter)}static root(e){const t=e.indexOf(s_.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(e){return new bn(e.split(s_.Delimiter))}static join(e,t){return new bn([...e.path,t])}static joinToString(e,t){return e.toString()+s_.Delimiter+t}static parentId(e){const t=e.lastIndexOf(s_.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){const t=e.lastIndexOf(s_.Delimiter);return t===-1?e:e.slice(t+s_.Delimiter.length)}static isChild(e,t){return t[e.length]===s_.Delimiter&&t.startsWith(e)}static compare(e,t){return e===t?Hv.IsSame:bn.isChild(e,t)?Hv.IsChild:bn.isChild(t,e)?Hv.IsParent:Hv.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?Hv.IsChild:e.viewEnd"runId"in s;var BH;(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))})})(BH||(BH={}));var H_;(function(s){s[s.Error=0]="Error",s[s.Output=1]="Output"})(H_||(H_={}));var Hte;(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?re.lift(t.position):void 0})})(Hte||(Hte={}));var Ute;(function(s){s.serialize=e=>({message:e.message,type:H_.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&BH.serialize(e.location),stackTrace:e.stackTrace?.map(Hte.serialize)}),s.deserialize=(e,t)=>({message:t.message,type:H_.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&BH.deserialize(e,t.location),stackTrace:t.stackTrace&&t.stackTrace.map(i=>Hte.deserialize(e,i))})})(Ute||(Ute={}));const Ajt=(s,e)=>`${e?"s":"e"}${s}`;var Vte;(function(s){s.serialize=e=>({message:e.message,type:H_.Output,offset:e.offset,length:e.length,location:e.location&&BH.serialize(e.location)}),s.deserialize=(e,t)=>({message:t.message,type:H_.Output,offset:t.offset,length:t.length,location:t.location&&BH.deserialize(e,t.location)})})(Vte||(Vte={}));var S$;(function(s){s.serialize=e=>e.type===H_.Error?Ute.serialize(e):Vte.serialize(e),s.deserialize=(e,t)=>t.type===H_.Error?Ute.deserialize(e,t):Vte.deserialize(e,t),s.isDiffable=e=>e.type===H_.Error&&e.actual!==void 0&&e.expected!==void 0})(S$||(S$={}));var _z;(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(S$.serialize)}),s.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(i=>S$.deserialize(e,i))})})(_z||(_z={}));const ort="\0",bj=(s,e)=>s+ort+e,art=s=>{const e=s.indexOf(ort);return{ctrlId:s.slice(0,e),tagId:s.slice(e+1)}};var A$;(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})})(A$||(A$={}));var Md;(function(s){s[s.NotExpandable=0]="NotExpandable",s[s.Expandable=1]="Expandable",s[s.BusyExpanding=2]="BusyExpanding",s[s.Expanded=3]="Expanded"})(Md||(Md={}));var DD;(function(s){s.serialize=e=>({expand:e.expand,item:A$.serialize(e.item)}),s.deserialize=(e,t)=>({controllerId:bn.root(t.item.extId),expand:t.expand,item:A$.deserialize(e,t.item)})})(DD||(DD={}));var E$;(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}}})(E$||(E$={}));const YEe=(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 zte;(function(s){s.serializeWithoutMessages=e=>({...DD.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(_z.serializeWithoutMessages)}),s.serialize=e=>({...DD.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(_z.serialize)}),s.deserialize=(e,t)=>({...DD.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(i=>_z.deserialize(e,i)),retired:!0})})(zte||(zte={}));var JEe;(function(s){s.empty=()=>({covered:0,total:0}),s.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})(JEe||(JEe={}));var XEe;(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:JEe.empty()})})(XEe||(XEe={}));function BPe(s){return{...s,location:s.location?.toJSON()}}function WPe(s){return s.location=s.location?re.isIPosition(s.location)?re.lift(s.location):F.lift(s.location):void 0,s}var WH;(function(s){s[s.Declaration=0]="Declaration",s[s.Statement=1]="Statement",s[s.Branch=2]="Branch"})(WH||(WH={}));var ZEe;(function(s){s.serialize=e=>e.type===WH.Declaration?Gte.serialize(e):Kte.serialize(e),s.deserialize=e=>e.type===WH.Declaration?Gte.deserialize(e):Kte.deserialize(e)})(ZEe||(ZEe={}));var $te;(function(s){s.serialize=BPe,s.deserialize=WPe})($te||($te={}));var Gte;(function(s){s.serialize=BPe,s.deserialize=WPe})(Gte||(Gte={}));var Kte;(function(s){s.serialize=e=>({...BPe(e),branches:e.branches?.map($te.serialize)}),s.deserialize=e=>({...WPe(e),branches:e.branches?.map($te.deserialize)})})(Kte||(Kte={}));var pa;(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"})(pa||(pa={}));var HH;(function(s){s.deserialize=(e,t)=>t.op===pa.Add?{op:t.op,item:DD.deserialize(e,t.item)}:t.op===pa.Update?{op:t.op,item:E$.deserialize(t.item)}:t.op===pa.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(N.revive(t.uri)),docv:t.docv}:t,s.serialize=e=>e.op===pa.Add?{op:e.op,item:DD.serialize(e.item)}:e.op===pa.Update?{op:e.op,item:E$.serialize(e.item)}:e})(HH||(HH={}));class Ejt{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 pa.Add:this.add(DD.deserialize(this.uriIdentity,i.item),t);break;case pa.Update:this.update(E$.deserialize(i.item),t);break;case pa.Remove:this.remove(i.itemId,t);break;case pa.Retire:this.retireTest(i.itemId);break;case pa.IncrementPendingExtHosts:this.updatePendingRoots(i.amount);break;case pa.AddTag:this._tags.set(i.tag.id,i.tag);break;case pa.RemoveTag:this._tags.delete(i.id);break}t.complete?.()}add(e,t){const i=bn.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 r=this.items.get(i);r.children.add(e.item.extId),n=this.createItem(e,r),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===Md.BusyExpanding&&this.busyControllerCount++,n}update(e,t){const i=this.items.get(e.extId);if(i)return e.expand!==void 0&&(i.expand===Md.BusyExpanding&&this.busyControllerCount--,e.expand===Md.BusyExpanding&&this.busyControllerCount++),YEe(i,e),t.update?.(i),i}remove(e,t){const i=this.items.get(e);if(!i)return;const n=bn.parentId(i.item.extId)?.toString();n?this.items.get(n).children.delete(i.item.extId):this.roots.delete(i);const r=[[e]];for(;r.length;)for(const o of r.pop()){const a=this.items.get(o);a&&(r.push(a.children),this.items.delete(o),t.remove?.(a,a!==i),a.expand===Md.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}}var Vd;(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"})(Vd||(Vd={}));const O4=(s,e)=>s===e,xjt={range:(s,e)=>s===e?!0:!s||!e?!1:s.equalsRange(e),busy:O4,label:O4,description:O4,error:O4,sortText:O4,tags:(s,e)=>!(s.length!==e.length||s.some(t=>!e.includes(t)))},Djt=Object.entries(xjt),kjt=(s,e)=>{let t;for(const[i,n]of Djt)n(s[i],e[i])||(t?t[i]=e[i]:t={[i]:e[i]});return t};class Ijt extends V{get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new ln(()=>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 pa.DocumentSynced:{for(const t of this.diff)if(t.op===pa.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break}case pa.Update:{const t=this.diff[this.diff.length-1];if(t){if(t.op===pa.Update&&t.item.extId===e.item.extId){YEe(t.item,e.item);return}if(t.op===pa.Add&&t.item.item.extId===e.item.extId){YEe(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===Md.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===Md.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 Vd.RemoveChild:this.removeItem(bn.joinToString(e.fullId,t.id));break;case Vd.Upsert:this.upsertItem(t.item,e);break;case Vd.Bulk:for(const i of t.ops)this.onTestItemEvent(e,i);break;case Vd.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case Vd.UpdateCanResolveChildren:this.updateExpandability(e);break;case Vd.SetProp:this.pushDiff({op:pa.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case Vd.DocumentSynced:this.documentSynced(e.actual.uri);break;default:h6()}}documentSynced(e){e&&this.pushDiff({op:pa.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){const i=bn.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 r=this.tree.get(i.toString());if(!r){r={fullId:i,actual:e,expandLevels:t?.expandLevels?t.expandLevels-1:void 0,expand:Md.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(r.fullId.toString(),r),this.setItemParent(e,t),this.pushDiff({op:pa.Add,item:{controllerId:this.options.controllerId,expand:r.expand,item:this.options.toITestItem(e)}}),this.connectItemAndChildren(e,r,t);return}if(r.actual===e){this.connectItem(e,r,t);return}if(r.actual.uri?.toString()!==e.uri?.toString())return this.removeItem(i.toString()),this.upsertItem(e,t);const o=this.options.getChildren(r.actual),a=r.actual,c=kjt(this.options.toITestItem(a),this.options.toITestItem(e));this.options.getApiFor(a).listener=void 0,r.actual=e,r.resolveBarrier=void 0,r.expand=Md.NotExpandable,c&&(c.hasOwnProperty("tags")&&(this.diffTagRefs(e.tags,a.tags,i.toString()),delete c.tags),this.onTestItemEvent(r,{op:Vd.SetProp,update:c})),this.connectItemAndChildren(e,r,t);for(const[d,h]of o)this.options.getChildren(e).get(h.id)||this.removeItem(bn.joinToString(i,h.id));const l=r.expandLevels;l!==void 0&&queueMicrotask(()=>{r.expand===Md.Expandable&&(r.expandLevels=void 0,this.expand(i.toString(),l))}),this.documentSynced(r.actual.uri)}diffTagRefs(e,t,i){const n=new Set(t.map(r=>r.id));for(const r of e)n.delete(r.id)||this.incrementTagRefs(r);this.pushDiff({op:pa.Update,item:{extId:i,item:{tags:e.map(r=>bj(this.options.controllerId,r.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:pa.AddTag,tag:{id:bj(this.options.controllerId,e.id)}}))}decrementTagRefs(e){const t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:pa.RemoveTag,id:bj(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=r=>this.onTestItemEvent(t,r),this.updateExpandability(t)}connectItemAndChildren(e,t,i){this.connectItem(e,t,i);for(const[n,r]of this.options.getChildren(e))this.upsertItem(r,t)}updateExpandability(e){let t;this._resolveHandler?e.resolveBarrier?t=e.resolveBarrier.isOpen()?Md.Expanded:Md.BusyExpanding:t=e.actual.canResolveChildren?Md.Expandable:Md.NotExpandable:t=Md.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:pa.Update,item:{extId:e.fullId.toString(),expand:t}}),t===Md.Expandable&&e.expandLevels!==void 0&&this.resolveChildren(e))}expandChildren(e,t){if(t<0)return;const i=[];for(const[n,r]of this.options.getChildren(e.actual)){const o=this.expand(bn.joinToString(e.fullId,r.id),t);Xy(o)&&i.push(o)}if(i.length)return Promise.all(i).then(()=>{})}resolveChildren(e){if(e.resolveBarrier)return e.resolveBarrier;if(!this._resolveHandler){const r=new jd;return r.open(),r}e.expand=Md.BusyExpanding,this.pushExpandStateUpdate(e);const t=e.resolveBarrier=new jd,i=r=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,r)};let n;try{n=this._resolveHandler(e.actual===this.root?void 0:e.actual)}catch(r){i(r)}return Xy(n)?n.catch(i).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:pa.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:pa.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 r of n.actual.tags)this.decrementTagRefs(r.id);this.tree.delete(n.fullId.toString());for(const[r,o]of this.options.getChildren(n.actual))i.push(this.tree.get(bn.joinToString(n.fullId,o.id)))}}}flushDiff(){const e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}}class Tjt extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}}class qte extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}}class Ljt 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 Rjt=(s,e,t)=>{let i=new Map;return{get size(){return i.size},forEach(n,r){for(const o of i.values())n.call(r,o,this)},[Symbol.iterator](){return i.entries()},replace(n){const r=new Map,o=new Set(i.keys()),a={op:Vd.Bulk,ops:[]};for(const c of n){if(!(c instanceof t))throw new qte(c.id);const l=e(c).controllerId;if(l!==s.controllerId)throw new Ljt(c.id,l,s.controllerId);if(r.has(c.id))throw new Tjt(c.id);r.set(c.id,c),o.delete(c.id),a.ops.push({op:Vd.Upsert,item:c})}for(const c of o.keys())a.ops.push({op:Vd.RemoveChild,id:c});s.listener?.(a),i=r},add(n){if(!(n instanceof t))throw new qte(n.id);i.set(n.id,n),s.listener?.({op:Vd.Upsert,item:n})},delete(n){i.delete(n)&&s.listener?.({op:Vd.RemoveChild,id:n})},get(n){return i.get(n)},toJSON(){return Array.from(i.values())}}},crt=new WeakMap,Mjt=(s,e)=>{const t={controllerId:e};return crt.set(s,t),t},gle=s=>{const e=crt.get(s);if(!e)throw new qte(s?.id||"");return e};var OC;(function(s){s[s.System=0]="System",s[s.User=1]="User",s[s.Assistant=2]="Assistant"})(OC||(OC={}));const k8e={type:"object",properties:{vendor:{type:"string",description:g(3049,"A globally unique vendor of language models.")}}},Njt=ih.registerExtensionPoint({extensionPoint:"languageModels",jsonSchema:{description:g(3050,"Contribute language models of a specific vendor."),oneOf:[k8e,{type:"array",items:k8e}]},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(Njt.setHandler(i=>{this._vendors.clear();for(const r of i){if(!hl(r.description,"chatProvider")){r.collector.error(g(3051,"This contribution point requires the 'chatProvider' proposal."));continue}for(const o of ui.wrap(r.value)){if(this._vendors.has(o.vendor)){r.collector.error(g(3052,"The vendor '{0}' is already registered and cannot be registered twice",o.vendor));continue}if(Qu(o.vendor)){r.collector.error(g(3053,"The vendor field cannot be empty."));continue}if(o.vendor.trim()!==o.vendor){r.collector.error(g(3054,"The vendor field cannot start or end with whitespace."));continue}this._vendors.add(o.vendor)}}const n=[];for(const[r,o]of this._providers)this._vendors.has(o.metadata.vendor)||(this._providers.delete(r),n.push(r));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(r=>An.equals(r,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,r){const o=this._providers.get(e);if(!o)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return o.sendChatRequest(i,t,n,r)}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,ps),_(1,Ke)],I8e);var zb;(function(s){function e(i){const{selectionStartLineNumber:n,selectionStartColumn:r,positionLineNumber:o,positionColumn:a}=i,c=new ws(n-1,r-1),l=new ws(o-1,a-1);return new uC(c,l)}s.to=e;function t(i){const{anchor:n,active:r}=i;return{selectionStartLineNumber:n.line+1,selectionStartColumn:n.character+1,positionLineNumber:r.line+1,positionColumn:r.character+1}}s.from=t})(zb||(zb={}));var tt;(function(s){function e(i){if(!i)return;const{start:n,end:r}=i;return{startLineNumber:n.line+1,startColumn:n.character+1,endLineNumber:r.line+1,endColumn:r.character+1}}s.from=e;function t(i){if(!i)return;const{startLineNumber:n,startColumn:r,endLineNumber:o,endColumn:a}=i;return new Xn(n-1,r-1,o-1,a-1)}s.to=t})(tt||(tt={}));var kD;(function(s){function e(i){return{uri:i.uri,range:tt.from(i.range)}}s.from=e;function t(i){return new Ap(N.revive(i.uri),tt.to(i.range))}s.to=t})(kD||(kD={}));var exe;(function(s){function e(t){switch(t){case no.Comment:return PS.Comment;case no.Other:return PS.Other;case no.RegEx:return PS.RegEx;case no.String:return PS.String}}s.to=e})(exe||(exe={}));var Yr;(function(s){function e(i){return new ws(i.lineNumber-1,i.column-1)}s.to=e;function t(i){return{lineNumber:i.line+1,column:i.character+1}}s.from=t})(Yr||(Yr={}));var UH;(function(s){function e(n,r,o){return Oi(z_(n).map(a=>t(a,r,o)))}s.from=e;function t(n,r,o){if(typeof n=="string")return{$serialized:!0,language:n,isBuiltin:o?.isBuiltin};if(n)return{$serialized:!0,language:n.language,scheme:i(n.scheme,r),pattern:Qf.from(n.pattern)??void 0,exclusive:n.exclusive,notebookType:n.notebookType,isBuiltin:o?.isBuiltin}}function i(n,r){return r&&typeof n=="string"?r.transformOutgoingScheme(n):n}})(UH||(UH={}));var Qte;(function(s){function e(i){switch(i){case $x.Unnecessary:return p_.Unnecessary;case $x.Deprecated:return p_.Deprecated}}s.from=e;function t(i){switch(i){case p_.Unnecessary:return $x.Unnecessary;case p_.Deprecated:return $x.Deprecated;default:return}}s.to=t})(Qte||(Qte={}));var VH;(function(s){function e(i){let n;return i.code&&(Rt(i.code)||dc(i.code)?n=String(i.code):n={value:String(i.code.value),target:i.code.target}),{...tt.from(i.range),message:i.message,source:i.source,code:n,severity:Yte.from(i.severity),relatedInformation:i.relatedInformation&&i.relatedInformation.map(jte.from),tags:Array.isArray(i.tags)?Oi(i.tags.map(Qte.from)):void 0}}s.from=e;function t(i){const n=new O9(tt.to(i),i.message,Yte.to(i.severity));return n.source=i.source,n.code=Rt(i.code)?i.code:i.code?.value,n.relatedInformation=i.relatedInformation&&i.relatedInformation.map(jte.to),n.tags=i.tags&&Oi(i.tags.map(Qte.to)),n}s.to=t})(VH||(VH={}));var jte;(function(s){function e(i){return{...tt.from(i.location.range),message:i.message,resource:i.location.uri}}s.from=e;function t(i){return new rH(new Ap(i.resource,tt.to(i)),i.message)}s.to=t})(jte||(jte={}));var Yte;(function(s){function e(i){switch(i){case Hd.Error:return Hs.Error;case Hd.Warning:return Hs.Warning;case Hd.Information:return Hs.Info;case Hd.Hint:return Hs.Hint}return Hs.Error}s.from=e;function t(i){switch(i){case Hs.Info:return Hd.Information;case Hs.Warning:return Hd.Warning;case Hs.Error:return Hd.Error;case Hs.Hint:return Hd.Hint;default:return Hd.Error}}s.to=t})(Yte||(Yte={}));var kl;(function(s){function e(i){return typeof i=="number"&&i>=gH.One?i-1:i===gH.Beside?nv:pA}s.from=e;function t(i){if(typeof i=="number"&&i>=0)return i+1;throw new Error("invalid 'EditorGroupColumn'")}s.to=t})(kl||(kl={}));function Pjt(s){return typeof s.range<"u"}function lrt(s){return s.length===0?!0:!!Pjt(s[0])}var Fs;(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 gf.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 Ku.Renderer;return h.link=d,h.image=u=>typeof u=="string"?d(dYe(u).href):"",Ku(c.value,{renderer:h}),c}s.from=i;function n(a,c){if(!a)return a;let l;try{l=iW(a)}catch{}if(!l)return a;let d=!1;return l=T2(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 r(a){const c=new gf(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=r;function o(a){if(a)return typeof a=="string"?a:s.from(a)}s.fromStrict=o})(Fs||(Fs={}));function Fjt(s){return lrt(s)?s.map(e=>({range:tt.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Fs.fromMany(e.hoverMessage):e.hoverMessage?Fs.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):s.map(e=>({range:tt.from(e)}))}function fle(s){return typeof s>"u"?s:typeof s=="string"?N.file(s):s}var zH;(function(s){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?fle(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})(zH||(zH={}));var Jte;(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?fle(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?zH.from(t.before):void 0,after:t.after?zH.from(t.after):void 0}}s.from=e})(Jte||(Jte={}));var txe;(function(s){function e(t){if(typeof t>"u")return t;switch(t){case Kx.OpenOpen:return si.AlwaysGrowsWhenTypingAtEdges;case Kx.ClosedClosed:return si.NeverGrowsWhenTypingAtEdges;case Kx.OpenClosed:return si.GrowsOnlyWhenTypingBefore;case Kx.ClosedOpen:return si.GrowsOnlyWhenTypingAfter}}s.from=e})(txe||(txe={}));var ixe;(function(s){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?txe.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?Jte.from(t.light):void 0,dark:t.dark?Jte.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?fle(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?zH.from(t.before):void 0,after:t.after?zH.from(t.after):void 0}}s.from=e})(ixe||(ixe={}));var ad;(function(s){function e(i){return{text:i.newText,eol:i.newEol&&KH.from(i.newEol),range:tt.from(i.range)}}s.from=e;function t(i){const n=new qA(tt.to(i.range),i.text);return n.newEol=typeof i.eol>"u"?void 0:KH.to(i.eol),n}s.to=t})(ad||(ad={}));var Zu;(function(s){function e(i,n){const r={edits:[]};if(i instanceof _I){const o=new Mk;for(const a of i._allEntries())a._type===bc.File&&N.isUri(a.to)&&a.from===void 0&&o.add(a.to);for(const a of i._allEntries())if(a._type===bc.File){let c;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?c={type:"base64",value:zTe(Ge.wrap(a.options.contents))}:c={type:"dataTransferItem",id:a.options.contents._itemId}),r.edits.push({oldResource:a.from,newResource:a.to,options:{...a.options,contents:c},metadata:a.metadata})}else a._type===bc.Text?r.edits.push({resource:a.uri,textEdit:ad.from(a.edit),versionId:o.has(a.uri)?void 0:n?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===bc.Snippet?r.edits.push({resource:a.uri,textEdit:{range:tt.from(a.range),text:a.edit.value,insertAsSnippet:!0},versionId:o.has(a.uri)?void 0:n?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===bc.Cell?r.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookMetadata:a.notebookMetadata,notebookVersionId:n?.getNotebookDocumentVersion(a.uri)}):a._type===bc.CellReplace&&r.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:n?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:mI.Replace,index:a.index,count:a.count,cells:a.cells.map(L$.from)}})}return r}s.from=e;function t(i){const n=new _I,r=new gi;for(const o of i.edits)if(o.textEdit){const a=o,c=N.revive(a.resource),l=tt.to(a.textEdit.range),d=a.textEdit.text,h=a.textEdit.insertAsSnippet;let u;h?u=ele.replace(l,new vI(d)):u=qA.replace(l,d);const f=r.get(c);f?f.push(u):r.set(c,[u])}else n.renameFile(N.revive(o.oldResource),N.revive(o.newResource),o.options);for(const[o,a]of r)n.set(o,a);return n}s.to=t})(Zu||(Zu={}));var rv;(function(s){const e=Object.create(null);e[vo.File]=mt.File,e[vo.Module]=mt.Module,e[vo.Namespace]=mt.Namespace,e[vo.Package]=mt.Package,e[vo.Class]=mt.Class,e[vo.Method]=mt.Method,e[vo.Property]=mt.Property,e[vo.Field]=mt.Field,e[vo.Constructor]=mt.Constructor,e[vo.Enum]=mt.Enum,e[vo.Interface]=mt.Interface,e[vo.Function]=mt.Function,e[vo.Variable]=mt.Variable,e[vo.Constant]=mt.Constant,e[vo.String]=mt.String,e[vo.Number]=mt.Number,e[vo.Boolean]=mt.Boolean,e[vo.Array]=mt.Array,e[vo.Object]=mt.Object,e[vo.Key]=mt.Key,e[vo.Null]=mt.Null,e[vo.EnumMember]=mt.EnumMember,e[vo.Struct]=mt.Struct,e[vo.Event]=mt.Event,e[vo.Operator]=mt.Operator,e[vo.TypeParameter]=mt.TypeParameter;function t(n){return typeof e[n]=="number"?e[n]:mt.Property}s.from=t;function i(n){for(const r in e)if(e[r]===n)return Number(r);return vo.Property}s.to=i})(rv||(rv={}));var QA;(function(s){function e(i){switch(i){case aH.Deprecated:return I8.Deprecated}}s.from=e;function t(i){switch(i){case I8.Deprecated:return aH.Deprecated}}s.to=t})(QA||(QA={}));var x$;(function(s){function e(i){return{name:i.name,kind:rv.from(i.kind),tags:i.tags&&i.tags.map(QA.from),containerName:i.containerName,location:ff.from(i.location)}}s.from=e;function t(i){const n=new cH(i.name,rv.to(i.kind),i.containerName,ff.to(i.location));return n.tags=i.tags&&i.tags.map(QA.to),n}s.to=t})(x$||(x$={}));var nxe;(function(s){function e(i){const n={name:i.name||"!!MISSING: name!!",detail:i.detail,range:tt.from(i.range),selectionRange:tt.from(i.selectionRange),kind:rv.from(i.kind),tags:i.tags?.map(QA.from)??[]};return i.children&&(n.children=i.children.map(e)),n}s.from=e;function t(i){const n=new lH(i.name,i.detail,rv.to(i.kind),tt.to(i.range),tt.to(i.selectionRange));return tr(i.tags)&&(n.tags=i.tags.map(QA.to)),i.children&&(n.children=i.children.map(t)),n}s.to=t})(nxe||(nxe={}));var bN;(function(s){function e(i){const n=new tle(rv.to(i.kind),i.name,i.detail||"",N.revive(i.uri),tt.to(i.range),tt.to(i.selectionRange));return n._sessionId=i._sessionId,n._itemId=i._itemId,n}s.to=e;function t(i,n,r){if(n=n??i._sessionId,r=r??i._itemId,n===void 0||r===void 0)throw new Error("invalid item");return{_sessionId:n,_itemId:r,name:i.name,detail:i.detail,kind:rv.from(i.kind),uri:i.uri,range:tt.from(i.range),selectionRange:tt.from(i.selectionRange),tags:i.tags?.map(QA.from)}}s.from=t})(bN||(bN={}));var sxe;(function(s){function e(t){return new fPe(bN.to(t.from),t.fromRanges.map(i=>tt.to(i)))}s.to=e})(sxe||(sxe={}));var rxe;(function(s){function e(t){return new pPe(bN.to(t.to),t.fromRanges.map(i=>tt.to(i)))}s.to=e})(rxe||(rxe={}));var ff;(function(s){function e(i){return{range:i.range&&tt.from(i.range),uri:i.uri}}s.from=e;function t(i){return new Ap(N.revive(i.uri),tt.to(i.range))}s.to=t})(ff||(ff={}));var D$;(function(s){function e(i){const n=i,r=i;return{originSelectionRange:n.originSelectionRange?tt.from(n.originSelectionRange):void 0,uri:n.targetUri?n.targetUri:r.uri,range:tt.from(n.targetRange?n.targetRange:r.range),targetSelectionRange:n.targetSelectionRange?tt.from(n.targetSelectionRange):void 0}}s.from=e;function t(i){return{targetUri:N.revive(i.uri),targetRange:tt.to(i.range),targetSelectionRange:i.targetSelectionRange?tt.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?tt.to(i.originSelectionRange):void 0}}s.to=t})(D$||(D$={}));var k$;(function(s){function e(i){return{range:tt.from(i.range),contents:Fs.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}s.from=e;function t(i){const n=i.contents.map(Fs.to),r=tt.to(i.range),o=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new W9(n,r,o,a)}s.to=t})(k$||(k$={}));var oxe;(function(s){function e(i){return{range:tt.from(i.range),expression:i.expression}}s.from=e;function t(i){return new s$(tt.to(i.range),i.expression)}s.to=t})(oxe||(oxe={}));var Xte;(function(s){function e(i){if(i instanceof r$)return{type:"text",range:tt.from(i.range),text:i.text};if(i instanceof o$)return{type:"variable",range:tt.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof a$)return{type:"expression",range:tt.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:tt.to(i.range),text:i.text};case"variable":return{range:tt.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:tt.to(i.range),expression:i.expression}}}s.to=t})(Xte||(Xte={}));var Zte;(function(s){function e(i){return{frameId:i.frameId,stoppedLocation:tt.from(i.stoppedLocation)}}s.from=e;function t(i){return new pEe(i.frameId,tt.to(i.stoppedLocation))}s.to=t})(Zte||(Zte={}));var $H;(function(s){function e(i){return{range:tt.from(i.range),kind:i.kind}}s.from=e;function t(i){return new H9(tt.to(i.range),i.kind)}s.to=t})($H||($H={}));var axe;(function(s){function e(i){return{uri:i.uri,highlights:i.highlights.map($H.from)}}s.from=e;function t(i){return new U9(N.revive(i.uri),i.highlights.map($H.to))}s.to=t})(axe||(axe={}));var cxe;(function(s){function e(t){switch(t){case ju.TriggerCharacter:return QT.TriggerCharacter;case ju.TriggerForIncompleteCompletions:return QT.TriggerForIncompleteCompletions;case ju.Invoke:default:return QT.Invoke}}s.to=e})(cxe||(cxe={}));var lxe;(function(s){function e(t){return{triggerKind:cxe.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}s.to=e})(lxe||(lxe={}));var eie;(function(s){function e(i){switch(i){case uH.Deprecated:return F2.Deprecated}}s.from=e;function t(i){switch(i){case F2.Deprecated:return uH.Deprecated}}s.to=t})(eie||(eie={}));var tie;(function(s){const e=new Map([[en.Method,Me.Method],[en.Function,Me.Function],[en.Constructor,Me.Constructor],[en.Field,Me.Field],[en.Variable,Me.Variable],[en.Class,Me.Class],[en.Interface,Me.Interface],[en.Struct,Me.Struct],[en.Module,Me.Module],[en.Property,Me.Property],[en.Unit,Me.Unit],[en.Value,Me.Value],[en.Constant,Me.Constant],[en.Enum,Me.Enum],[en.EnumMember,Me.EnumMember],[en.Keyword,Me.Keyword],[en.Snippet,Me.Snippet],[en.Text,Me.Text],[en.Color,Me.Color],[en.File,Me.File],[en.Reference,Me.Reference],[en.Folder,Me.Folder],[en.Event,Me.Event],[en.Operator,Me.Operator],[en.TypeParameter,Me.TypeParameter],[en.Issue,Me.Issue],[en.User,Me.User]]);function t(r){return e.get(r)??Me.Property}s.from=t;const i=new Map([[Me.Method,en.Method],[Me.Function,en.Function],[Me.Constructor,en.Constructor],[Me.Field,en.Field],[Me.Variable,en.Variable],[Me.Class,en.Class],[Me.Interface,en.Interface],[Me.Struct,en.Struct],[Me.Module,en.Module],[Me.Property,en.Property],[Me.Unit,en.Unit],[Me.Value,en.Value],[Me.Constant,en.Constant],[Me.Enum,en.Enum],[Me.EnumMember,en.EnumMember],[Me.Keyword,en.Keyword],[Me.Snippet,en.Snippet],[Me.Text,en.Text],[Me.Color,en.Color],[Me.File,en.File],[Me.Reference,en.Reference],[Me.Folder,en.Folder],[Me.Event,en.Event],[Me.Operator,en.Operator],[Me.TypeParameter,en.TypeParameter],[Me.User,en.User],[Me.Issue,en.Issue]]);function n(r){return i.get(r)??en.Property}s.to=n})(tie||(tie={}));var dxe;(function(s){function e(t,i){const n=new K9(t.label);return n.insertText=t.insertText,n.kind=tie.to(t.kind),n.tags=t.tags?.map(eie.to),n.detail=t.detail,n.documentation=ud(t.documentation)?Fs.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=tt.to(t.range):typeof t.range=="object"&&(n.range={inserting:tt.to(t.range.insert),replacing:tt.to(t.range.replace)}),n.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&Zg.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&Zg.InsertAsSnippet?n.insertText=new vI(t.insertText):(n.insertText=t.insertText,n.textEdit=n.range instanceof Xn?new qA(n.range,n.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(n.additionalTextEdits=t.additionalTextEdits.map(r=>ad.to(r))),n.command=i&&t.command?i.fromInternal(t.command):void 0,n}s.to=e})(dxe||(dxe={}));var iie;(function(s){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Fs.fromStrict(i.documentation)}}s.from=e;function t(i){return{label:i.label,documentation:ud(i.documentation)?Fs.to(i.documentation):i.documentation}}s.to=t})(iie||(iie={}));var nie;(function(s){function e(i){return{label:i.label,documentation:Fs.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(iie.from):[],activeParameter:i.activeParameter}}s.from=e;function t(i){return{label:i.label,documentation:ud(i.documentation)?Fs.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(iie.to):[],activeParameter:i.activeParameter}}s.to=t})(nie||(nie={}));var I$;(function(s){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(nie.from):[]}}s.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(nie.to):[]}}s.to=t})(I$||(I$={}));var hxe;(function(s){function e(t,i){const n=new G9(Yr.to(i.position),typeof i.label=="string"?i.label:i.label.map(uxe.to.bind(void 0,t)),i.kind&&sie.to(i.kind));return n.textEdits=i.textEdits&&i.textEdits.map(ad.to),n.tooltip=ud(i.tooltip)?Fs.to(i.tooltip):i.tooltip,n.paddingLeft=i.paddingLeft,n.paddingRight=i.paddingRight,n}s.to=e})(hxe||(hxe={}));var uxe;(function(s){function e(t,i){const n=new $9(i.label);return n.tooltip=ud(i.tooltip)?Fs.to(i.tooltip):i.tooltip,jj.is(i.command)&&(n.command=t.fromInternal(i.command)),i.location&&(n.location=ff.to(i.location)),n}s.to=e})(uxe||(uxe={}));var sie;(function(s){function e(i){return i}s.from=e;function t(i){return i}s.to=t})(sie||(sie={}));var sL;(function(s){function e(i){return{range:tt.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 r=new Q9(tt.to(i.range),n);return r.tooltip=i.tooltip,r}s.to=t})(sL||(sL={}));var rie;(function(s){function e(i){const n=new Y9(i.label);return i.textEdit&&(n.textEdit=ad.to(i.textEdit)),i.additionalTextEdits&&(n.additionalTextEdits=i.additionalTextEdits.map(r=>ad.to(r))),n}s.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?ad.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(n=>ad.from(n)):void 0}}s.from=t})(rie||(rie={}));var GH;(function(s){function e(i){return new dN(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})(GH||(GH={}));var gxe;(function(s){function e(i){return{range:tt.from(i.range)}}s.from=e;function t(i){return new hH(tt.to(i.range))}s.to=t})(gxe||(gxe={}));var oie;(function(s){function e(t){switch(t){case Sn.AUTO:return jT.AfterDelay;case Sn.EXPLICIT:return jT.Manual;case Sn.FOCUS_CHANGE:case Sn.WINDOW_CHANGE:return jT.FocusOut}}s.to=e})(oie||(oie={}));var gB;(function(s){function e(i){switch(i){case c_.Off:return yo.Off;case c_.Relative:return yo.Relative;case c_.Interval:return yo.Interval;case c_.On:default:return yo.On}}s.from=e;function t(i){switch(i){case yo.Off:return c_.Off;case yo.Relative:return c_.Relative;case yo.Interval:return c_.Interval;case yo.On:default:return c_.On}}s.to=t})(gB||(gB={}));var KH;(function(s){function e(i){if(i===T_.CRLF)return Eh.CRLF;if(i===T_.LF)return Eh.LF}s.from=e;function t(i){if(i===Eh.CRLF)return T_.CRLF;if(i===Eh.LF)return T_.LF}s.to=t})(KH||(KH={}));var fxe;(function(s){function e(t){if(typeof t=="object")return t.viewId;switch(t){case SD.SourceControl:return fd.Scm;case SD.Window:return fd.Window;case SD.Notification:return fd.Notification}throw new Error("Unknown 'ProgressLocation'")}s.from=e})(fxe||(fxe={}));var aie;(function(s){function e(i){const n={start:i.start+1,end:i.end+1};return i.kind&&(n.kind=cie.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=cie.to(i.kind)),n}s.to=t})(aie||(aie={}));var cie;(function(s){function e(i){if(i)switch(i){case Gw.Comment:return u_.Comment;case Gw.Imports:return u_.Imports;case Gw.Region:return u_.Region}}s.from=e;function t(i){if(i)switch(i.value){case u_.Comment.value:return Gw.Comment;case u_.Imports.value:return Gw.Imports;case u_.Region.value:return Gw.Region}}s.to=t})(cie||(cie={}));var vz;(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"?tt.from(t.selection):void 0,override:typeof t.override=="boolean"?lm.id:void 0}}s.from=e})(vz||(vz={}));var Qf;(function(s){function e(r){return r instanceof JT?r.toJSON():typeof r=="string"?r:t(r)||i(r)?new JT(r.baseUri??r.base,r.pattern).toJSON():r}s.from=e;function t(r){const o=r;return o?N.isUri(o.baseUri)&&typeof o.pattern=="string":!1}function i(r){const o=r;return o?typeof o.base=="string"&&typeof o.pattern=="string":!1}function n(r){return typeof r=="string"?r:new JT(N.revive(r.baseUri),r.pattern)}s.to=n})(Qf||(Qf={}));var pxe;(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:Qf.from(i.pattern),exclusive:i.exclusive,notebookType:i.notebookType}}}else return}s.from=e})(pxe||(pxe={}));var lie;(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(r=>r&&typeof r=="object"&&"uri"in r&&N.isUri(r.uri)&&"version"in r&&typeof r.version=="number"&&"ranges"in r&&Array.isArray(r.ranges)&&r.ranges.every(o=>o instanceof Xn)))}s.is=e;function t(i){return{documents:i.documents.map(n=>n.map(r=>({uri:N.from(r.uri),version:r.version,ranges:r.ranges.map(o=>tt.from(o))})))}}s.from=t})(lie||(lie={}));var zy;(function(s){function e(i){return{start:i.start,end:i.end}}s.from=e;function t(i){return new Dy(i.start,i.end)}s.to=t})(zy||(zy={}));var qH;(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})(qH||(qH={}));var mxe;(function(s){function e(t){if(t===hz.Unconfirmed)return fN.Pending;if(t===hz.Pending)return;if(t===hz.Executing)return fN.Executing;throw new Error(`Unknown state: ${t}`)}s.to=e})(mxe||(mxe={}));var T$;(function(s){function e(i){switch(i){case jx.Markup:return LF.Markup;case jx.Code:default:return LF.Code}}s.from=e;function t(i){switch(i){case LF.Markup:return jx.Markup;case LF.Code:default:return jx.Code}}s.to=t})(T$||(T$={}));var VE;(function(s){function e(i){const n={metadata:i.metadata??Object.create(null),cells:[]};for(const r of i.cells)vG.validate(r),n.cells.push(L$.from(r));return n}s.from=e;function t(i){const n=new bPe(i.cells.map(L$.to));return DA(i.metadata)||(n.metadata=i.metadata),n}s.to=t})(VE||(VE={}));var L$;(function(s){function e(i){return{cellKind:T$.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:qH.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(yI.from):[]}}s.from=e;function t(i){return new vG(T$.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(yI.to):void 0,i.metadata,i.internalMetadata?qH.to(i.internalMetadata):void 0)}s.to=t})(L$||(L$={}));var QH;(function(s){function e(i){return{mime:i.mime,valueBytes:Ge.wrap(i.data)}}s.from=e;function t(i){return new wPe(i.valueBytes.buffer,i.mime)}s.to=t})(QH||(QH={}));var yI;(function(s){function e(i){return{outputId:i.id,items:i.items.map(QH.from),metadata:i.metadata}}s.from=e;function t(i){const n=i.items.map(QH.to);return new d$(n,i.outputId,i.metadata)}s.to=t})(yI||(yI={}));var die;(function(s){function e(n){return i(n)?{include:Qf.from(n.include)??void 0,exclude:Qf.from(n.exclude)??void 0}:Qf.from(n)??void 0}s.from=e;function t(n){return i(n)?{include:Qf.to(n.include),exclude:Qf.to(n.exclude)}:Qf.to(n)}s.to=t;function i(n){const r=n;return r?!aa(r.include)&&!aa(r.exclude):!1}})(die||(die={}));var _xe;(function(s){function e(t,i,n){const r=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===h$.Left?Kee.Left:Kee.Right,command:i.toInternal(r,n),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}s.from=e})(_xe||(_xe={}));var vxe;(function(s){function e(t,i,n){const r=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{command:i.toInternal(r,n),label:t.label,description:t.description,detail:t.detail,documentation:t.documentation}}s.from=e})(vxe||(vxe={}));var bxe;(function(s){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}s.from=e})(bxe||(bxe={}));var hie;(function(s){function e(i){return{uri:i.uri,provides:i.provides}}s.from=e;function t(i){return new yPe(N.revive(i.uri),i.provides)}s.to=t})(hie||(hie={}));var jH;(function(s){function e(i){return{message:Fs.fromStrict(i.message)||"",type:H_.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:tt.from(i.location.range),uri:i.location.uri},stackTrace:i.stackTrace?.map(n=>({label:n.label,position:n.position&&Yr.from(n.position),uri:n.file&&N.revive(n.file).toJSON()}))}}s.from=e;function t(i){const n=new pN(typeof i.message=="string"?i.message:Fs.to(i.message));return n.actualOutput=i.actual,n.expectedOutput=i.expected,n.contextValue=i.contextValue,n.location=i.location?ff.to(i.location):void 0,n}s.to=t})(jH||(jH={}));var $b;(function(s){s.namespace=bj,s.denamespace=art})($b||($b={}));var CI;(function(s){function e(i){const n=gle(i).controllerId;return{extId:bn.fromExtHostTestItem(i,n).toString(),label:i.label,uri:N.revive(i.uri),busy:i.busy,tags:i.tags.map(r=>$b.namespace(n,r.id)),range:F.lift(tt.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Fs.fromStrict(i.error)||null}}s.from=e;function t(i){return{parent:void 0,error:void 0,id:bn.fromString(i.extId).localId,label:i.label,uri:N.revive(i.uri),tags:(i.tags||[]).map(n=>{const{tagId:r}=$b.denamespace(n);return new kH(r)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:tt.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}s.toPlain=t})(CI||(CI={}));(function(s){function e(i){return{id:i.id}}s.from=e;function t(i){return new kH(i.id)}s.to=t})($b||($b={}));var wxe;(function(s){const e=(i,n)=>{const r=i.value;if(!r)return;const o={...CI.toPlain(r.item),parent:n,taskStates:r.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(c=>c.type===H_.Error).map(jH.to)})),children:[]};if(i.children)for(const a of i.children.values()){const c=e(a,o);c&&o.children.push(c)}return o};function t(i){const n=new Wte;for(const a of i.items)n.insert(bn.fromString(a.item.extId).path,a);const r=[n.nodes],o=[];for(;r.length;)for(const a of r.pop())a.value?o.push(a):a.children&&r.push(a.children.values());return{completedAt:i.completedAt,results:o.map(a=>e(a)).filter(Oc)}}s.to=t})(wxe||(wxe={}));var uie;(function(s){function e(r){return{covered:r.covered,total:r.total}}function t(r){return"line"in r?Yr.from(r):tt.from(r)}function i(r){if(typeof r.executed=="number"&&r.executed<0)throw new Error(`Invalid coverage count ${r.executed}`);return"branches"in r?{count:r.executed,location:t(r.location),type:WH.Statement,branches:r.branches.length?r.branches.map(o=>({count:o.executed,location:o.location&&t(o.location),label:o.label})):void 0}:{type:WH.Declaration,name:r.name,count:r.executed,location:t(r.location)}}s.fromDetails=i;function n(r,o,a){return pj(a.statementCoverage),pj(a.branchCoverage),pj(a.declarationCoverage),{id:o,uri:a.uri,statement:e(a.statementCoverage),branch:a.branchCoverage&&e(a.branchCoverage),declaration:a.declarationCoverage&&e(a.declarationCoverage),testIds:a instanceof mN&&a.fromTests.length?a.fromTests.map(c=>bn.fromExtHostTestItem(c,r).toString()):void 0}}s.fromFile=n})(uie||(uie={}));var yxe;(function(s){function e(t){switch(t){case Ah.Invoke:return dH.Invoke;case Ah.Auto:return dH.Automatic}}s.to=e})(yxe||(yxe={}));var rL;(function(s){function e(i){const n=new nle(rv.to(i.kind),i.name,i.detail||"",N.revive(i.uri),tt.to(i.range),tt.to(i.selectionRange));return n._sessionId=i._sessionId,n._itemId=i._itemId,n}s.to=e;function t(i,n,r){if(n=n??i._sessionId,r=r??i._itemId,n===void 0||r===void 0)throw new Error("invalid item");return{_sessionId:n,_itemId:r,kind:rv.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:tt.from(i.range),selectionRange:tt.from(i.selectionRange),tags:i.tags?.map(QA.from)}}s.from=t})(rL||(rL={}));var gie;(function(s){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}s.from=e})(gie||(gie={}));var fie;(function(s){function e(r,o,a){const c=o.fileData;return c?new g7t(new f7t(c.name,N.revive(c.uri),c.id,fm(()=>a(c.id)))):r===Vs.uriList&&o.uriListData?new cte(n(o.uriListData)):new cte(o.asString)}s.to=e;async function t(r,o){const a=await o.asString();if(r===Vs.uriList)return{asString:a,fileData:void 0,uriListData:i(a)};const c=o.asFile();return{asString:a,fileData:c?{name:c.name,uri:c.uri,id:c._itemId??c.id}:void 0}}s.from=t;function i(r){return rI.split(r).map(o=>{if(o.startsWith("#"))return o;try{return N.parse(o)}catch{}return o})}function n(r){return rI.create(r.map(o=>typeof o=="string"?o:N.revive(o)))}})(fie||(fie={}));var U_;(function(s){function e(i,n){const r=i.items.map(([o,a])=>[o,fie.to(o,a,n)]);return new mH(r)}s.toDataTransfer=e;async function t(i){const n={items:[]},r=[];for(const[o,a]of i)r.push((async()=>{n.items.push([o,await fie.from(o,a)])})());return await Promise.all(r),n}s.from=t})(U_||(U_={}));var R$;(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})(R$||(R$={}));var pie;(function(s){function e(i){switch(i){case OC.System:return jp.System;case OC.User:return jp.User;case OC.Assistant:return jp.Assistant}}s.to=e;function t(i){switch(i){case jp.System:return OC.System;case jp.User:return OC.User;case jp.Assistant:return OC.Assistant}return OC.User}s.from=t})(pie||(pie={}));var PF;(function(s){function e(i){let n="",r;i.content.type==="text"?n=i.content.value:r=new b$(i.content.name,i.content.value,i.content.isError);const o=pie.to(i.role),a=new MPe(o,n,i.name);return r!==void 0&&(a.content2=r),a}s.to=e;function t(i){const n=pie.from(i.role),r=i.name;let o;return i.content2 instanceof b$?o={type:"function_result",name:i.content2.name,value:i.content2.content,isError:i.content2.isError}:o={type:"text",value:i.content},{role:n,name:r,content:o}}s.from=t})(PF||(PF={}));var M$;(function(s){function e(i){return{kind:"markdownContent",content:Fs.from(i.value)}}s.from=e;function t(i){return new bG(Fs.to(i.content))}s.to=t})(M$||(M$={}));var mie;(function(s){function e(i){return{kind:"markdownVuln",content:Fs.from(i.value),vulnerabilities:i.vulnerabilities}}s.from=e;function t(i){return new TH(Fs.to(i.content),i.vulnerabilities)}s.to=t})(mie||(mie={}));var _ie;(function(s){function e(i){return{kind:"agentDetection",agentId:i.participant,command:i.command}}s.from=e;function t(i){return new LH(i.agentId,i.command)}s.to=t})(_ie||(_ie={}));var vie;(function(s){function e(t){return{kind:"confirmation",title:t.title,message:t.message,data:t.data,buttons:t.buttons}}s.from=e})(vie||(vie={}));var N$;(function(s){function e(i){const{value:n,baseUri:r}=i;function o(a,c){return a.map(l=>{const d=N.joinPath(c,l.name);return{label:l.name,uri:d,children:l.children&&o(l.children,d)}})}return{kind:"treeData",treeData:{label:vi(r),uri:r,children:o(n,r)}}}s.from=e;function t(i){const n=Mr(i.treeData);function r(c){return c.map(l=>({name:l.label,children:l.children&&r(l.children)}))}const o=n.uri,a=n.children?r(n.children):[];return new wG(a,o)}s.to=t})(N$||(N$={}));var P$;(function(s){function e(i){const n=r=>N.isUri(r);return{kind:"inlineReference",name:i.title,inlineReference:n(i.value)?i.value:kD.from(i.value)}}s.from=e;function t(i){const n=Mr(i);return new yG(N.isUri(n.inlineReference)?n.inlineReference:kD.to(n.inlineReference),i.name)}s.to=t})(P$||(P$={}));var YH;(function(s){function e(i){return{kind:"progressMessage",content:Fs.from(i.value)}}s.from=e;function t(i){return new RH(i.content.value)}s.to=t})(YH||(YH={}));var F$;(function(s){function e(i){return{kind:"warning",content:Fs.from(i.value)}}s.from=e;function t(i){return new MH(i.content.value)}s.to=t})(F$||(F$={}));var Cxe;(function(s){function e(t){return{kind:"progressTask",content:Fs.from(t.value)}}s.from=e})(Cxe||(Cxe={}));var Sxe;(function(s){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Fs.from(t):void 0}}s.from=e})(Sxe||(Sxe={}));var O$;(function(s){function e(i,n,r){return{kind:"command",command:n.toInternal(i.value,r)??{command:i.value.command,title:i.value.title}}}s.from=e;function t(i,n){return new CG(n.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}s.to=t})(O$||(O$={}));var bie;(function(s){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(n=>ad.from(n))}}s.from=e;function t(i){return new NH(N.revive(i.uri),i.edits.map(n=>ad.to(n)))}s.to=t})(bie||(bie={}));var vA;(function(s){function e(i){const n=He.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:kD.from(i.value.value)},iconPath:n,options:i.options}:{kind:"reference",reference:N.isUri(i.value)?i.value:kD.from(i.value),iconPath:n,options:i.options}}s.from=e;function t(i){const n=Mr(i),r=o=>N.isUri(o)?o:kD.to(o);return new Rb("variableName"in n.reference?{variableName:n.reference.variableName,value:n.reference.value&&r(n.reference.value)}:r(n.reference))}s.to=t})(vA||(vA={}));var wie;(function(s){function e(t){return{kind:"codeCitation",value:t.value,license:t.license,snippet:t.snippet}}s.from=e})(wie||(wie={}));var yie;(function(s){function e(n,r,o){return n instanceof bG?M$.from(n):n instanceof yG?P$.from(n):n instanceof Rb?vA.from(n):n instanceof RH?YH.from(n):n instanceof wG?N$.from(n):n instanceof CG?O$.from(n,r,o):n instanceof NH?bie.from(n):n instanceof TH?mie.from(n):n instanceof LH?_ie.from(n):n instanceof MH?F$.from(n):n instanceof _$?vie.from(n):n instanceof v$?wie.from(n):{kind:"markdownContent",content:Fs.from("")}}s.from=e;function t(n,r){switch(n.kind){case"reference":return vA.to(n);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return i(n,r)}}s.to=t;function i(n,r){switch(n.kind){case"markdownContent":return M$.to(n);case"inlineReference":return P$.to(n);case"progressMessage":return;case"treeData":return N$.to(n);case"command":return O$.to(n,r)}}s.toContent=i})(yie||(yie={}));var Axe;(function(s){function e(t,i){const n=t.variables.variables.filter(o=>o.isTool).map(o=>o.id),r=t.variables.variables.filter(o=>!o.isTool);return{prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,references:r.map(Cie.to),location:B$.to(t.location),acceptedConfirmationData:t.acceptedConfirmationData,rejectedConfirmationData:t.rejectedConfirmationData,location2:i,requestedTools:n}}s.to=e})(Axe||(Axe={}));var B$;(function(s){function e(i){switch(i){case To.Notebook:return l_.Notebook;case To.Terminal:return l_.Terminal;case To.Panel:return l_.Panel;case To.Editor:return l_.Editor}}s.to=e;function t(i){switch(i){case l_.Notebook:return To.Notebook;case l_.Terminal:return To.Terminal;case l_.Panel:return To.Panel;case l_.Editor:return To.Editor}}s.from=t})(B$||(B$={}));var Cie;(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:Ife(i)?N.revive(i):i&&typeof i=="object"&&"uri"in i&&"range"in i&&Ife(i.uri)?kD.to(Mr(i)):i,modelDescription:t.modelDescription}}s.to=e})(Cie||(Cie={}));var Exe;(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})(Exe||(Exe={}));var fB;(function(s){function e(t){return{errorDetails:t.errorDetails,metadata:t.metadata}}s.to=e})(fB||(fB={}));var xxe;(function(s){function e(t,i,n){if(i.action.kind==="vote")return;const r=fB.to(t);if(i.action.kind==="command"){const o=i.action.commandButton.command;return{action:{kind:"command",commandButton:{command:n.fromInternal(o)??{command:o.id,title:o.title}}},result:r}}else return i.action.kind==="followUp"?{action:{kind:"followUp",followup:R$.to(i.action.followup)},result:r}:i.action.kind==="inlineChat"?{action:{kind:"editor",accepted:i.action.action==="accepted"},result:r}:{action:i.action,result:r}}s.to=e})(xxe||(xxe={}));var Sie;(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})(Sie||(Sie={}));var Dxe;(function(s){function e(t){return{kind:kxe.to(t.kind)}}s.to=e})(Dxe||(Dxe={}));var kxe;(function(s){function e(t){switch(t){case nD.Word:return Gx.Word;case nD.Line:return Gx.Line;case nD.Suggest:return Gx.Suggest;default:return Gx.Unknown}}s.to=e})(kxe||(kxe={}));var Ixe;(function(s){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||uAe.None,contextValue:t.contextValue}}s.from=e})(Ixe||(Ixe={}));var Txe;(function(s){function e(t){return{name:t.name,description:t.description,parametersSchema:t.parametersSchema}}s.to=e})(Txe||(Txe={}));class HPe{constructor(){this.requestIdPool=0,this.dataTransferFiles=new Map}add(e){const t=this.requestIdPool++;return this.dataTransferFiles.set(t,Oi(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(r=>r.id===t);if(!n)throw new Error("No matching file found in data transfer");return Ge.wrap(await n.data())}dispose(){this.dataTransferFiles.clear()}}var T8e;(function(s){s.CallsTo="incomingCalls",s.CallsFrom="outgoingCalls"})(T8e||(T8e={}));const drt=new or;class Aie{static async create(e,t,i){const[n]=drt.ordered(e);if(!n)return;const r=await n.prepareCallHierarchy(e,t,i);if(r)return new Aie(r.roots.reduce((o,a)=>o+a._sessionId,""),n,r.roots,new bTe(r))}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 Aie{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async resolveIncomingCalls(e,t){try{const i=await this.provider.provideIncomingCalls(e,t);if(tr(i))return i}catch(i){Nr(i)}return[]}async resolveOutgoingCalls(e,t){try{const i=await this.provider.provideOutgoingCalls(e,t);if(tr(i))return i}catch(i){Nr(i)}return[]}}const bz=new Map;vt.registerCommand("_executePrepareCallHierarchy",async(s,...e)=>{const[t,i]=e;Lt(N.isUri(t)),Lt(re.isIPosition(i));let r=s.get(fi).getModel(t),o;if(!r){const c=await s.get(pn).createModelReference(t);r=c.object.textEditorModel,o=c}try{const a=await Aie.create(r,i,Ue.None);return a?(bz.set(a.id,a),bz.forEach((c,l,d)=>{d.size>10&&(c.dispose(),bz.delete(l))}),[a.root]):[]}finally{o?.dispose()}});function hrt(s){return!0}vt.registerCommand("_executeProvideIncomingCalls",async(s,...e)=>{const[t]=e;Lt(hrt());const i=bz.get(t._sessionId);if(i)return i.resolveIncomingCalls(t,Ue.None)});vt.registerCommand("_executeProvideOutgoingCalls",async(s,...e)=>{const[t]=e;Lt(hrt());const i=bz.get(t._sessionId);if(i)return i.resolveOutgoingCalls(t,Ue.None)});var Lxe;(function(s){const e=[];function t(n){let r=n;return r&&e.push(r),{dispose(){if(r){const o=e.indexOf(r);o>=0&&(e.splice(o,1),r=void 0)}}}}s.register=t;function i(){return e.slice(0)}s.all=i})(Lxe||(Lxe={}));var Rxe;(function(s){s[s.Idle=0]="Idle",s[s.Searching=1]="Searching",s[s.SlowSearch=2]="SlowSearch"})(Rxe||(Rxe={}));new Q("searchState",Rxe.Idle);var L8e;(function(s){s.Subtypes="subtypes",s.Supertypes="supertypes"})(L8e||(L8e={}));const urt=new or;class Eie{static async create(e,t,i){const[n]=urt.ordered(e);if(!n)return;const r=await n.prepareTypeHierarchy(e,t,i);if(r)return new Eie(r.roots.reduce((o,a)=>o+a._sessionId,""),n,r.roots,new bTe(r))}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 Eie{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async provideSupertypes(e,t){try{const i=await this.provider.provideSupertypes(e,t);if(tr(i))return i}catch(i){Nr(i)}return[]}async provideSubtypes(e,t){try{const i=await this.provider.provideSubtypes(e,t);if(tr(i))return i}catch(i){Nr(i)}return[]}}const wz=new Map;vt.registerCommand("_executePrepareTypeHierarchy",async(s,...e)=>{const[t,i]=e;Lt(N.isUri(t)),Lt(re.isIPosition(i));let r=s.get(fi).getModel(t),o;if(!r){const c=await s.get(pn).createModelReference(t);r=c.object.textEditorModel,o=c}try{const a=await Eie.create(r,i,Ue.None);return a?(wz.set(a.id,a),wz.forEach((c,l,d)=>{d.size>10&&(c.dispose(),wz.delete(l))}),[a.root]):[]}finally{o?.dispose()}});function grt(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)}vt.registerCommand("_executeProvideSupertypes",async(s,...e)=>{const[t]=e;Lt(grt(t));const i=wz.get(t._sessionId);if(i)return i.provideSupertypes(t,Ue.None)});vt.registerCommand("_executeProvideSubtypes",async(s,...e)=>{const[t]=e;Lt(grt(t));const i=wz.get(t._sessionId);if(i)return i.provideSubtypes(t,Ue.None)});var Er;let R8e=Er=class extends V{constructor(e,t,i,n,r){if(super(),this._languageService=t,this._languageConfigurationService=i,this._languageFeaturesService=n,this._uriIdentService=r,this._registrations=this._register(new mr),this._pasteEditProviders=new Map,this._documentOnDropEditProviders=new Map,this._proxy=e.getProxy(Je.ExtHostLanguageFeatures),this._languageService){const o=()=>{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)o();else{const c=this._languageConfigurationService.getLanguageConfiguration(a.languageId).getWordDefinition();this._proxy.$setWordDefinitions([{languageId:a.languageId,regexSource:c.source,regexFlags:c.flags}])}})),o()}}$unregister(e){this._registrations.deleteAndDispose(e)}static _reviveLocationDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>Er._reviveLocationDto(t)),e):(e.uri=N.revive(e.uri),e))}static _reviveLocationLinkDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>Er._reviveLocationLinkDto(t)),e):(e.uri=N.revive(e.uri),e))}static _reviveWorkspaceSymbolDto(e){return e&&(Array.isArray(e)?(e.forEach(Er._reviveWorkspaceSymbolDto),e):(e.location=Er._reviveLocationDto(e.location),e))}static _reviveCodeActionDto(e,t){return e?.forEach(i=>Vy(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,r)=>this._proxy.$provideDocumentSymbols(e,n.uri,r)}))}$registerCodeLensSupport(e,t,i){const n={provideCodeLenses:async(r,o)=>{const a=await this._proxy.$provideCodeLenses(e,r.uri,o);if(a)return{lenses:a.lenses,dispose:()=>a.cacheId&&this._proxy.$releaseCodeLenses(e,a.cacheId)}},resolveCodeLens:async(r,o,a)=>{const c=await this._proxy.$resolveCodeLens(e,o,a);if(c)return{...c,range:r.validateRange(c.range)}}};if(typeof i=="number"){const r=new I;this._registrations.set(i,r),n.onDidChange=r.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,r)=>this._proxy.$provideDefinition(e,i.uri,n,r).then(Er._reviveLocationLinkDto)}))}$registerDeclarationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.declarationProvider.register(t,{provideDeclaration:(i,n,r)=>this._proxy.$provideDeclaration(e,i.uri,n,r).then(Er._reviveLocationLinkDto)}))}$registerImplementationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.implementationProvider.register(t,{provideImplementation:(i,n,r)=>this._proxy.$provideImplementation(e,i.uri,n,r).then(Er._reviveLocationLinkDto)}))}$registerTypeDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.typeDefinitionProvider.register(t,{provideTypeDefinition:(i,n,r)=>this._proxy.$provideTypeDefinition(e,i.uri,n,r).then(Er._reviveLocationLinkDto)}))}$registerHoverProvider(e,t){this._registrations.set(e,this._languageFeaturesService.hoverProvider.register(t,{provideHover:async(i,n,r,o)=>{const a={verbosityRequest:o?.verbosityRequest?{verbosityDelta:o.verbosityRequest.verbosityDelta,previousHover:{id:o.verbosityRequest.previousHover.id}}:void 0};return await this._proxy.$provideHover(e,i.uri,n,a,r)}}))}$registerEvaluatableExpressionProvider(e,t){this._registrations.set(e,this._languageFeaturesService.evaluatableExpressionProvider.register(t,{provideEvaluatableExpression:(i,n,r)=>this._proxy.$provideEvaluatableExpression(e,i.uri,n,r)}))}$registerInlineValuesProvider(e,t,i){const n={provideInlineValues:(r,o,a,c)=>this._proxy.$provideInlineValues(e,r.uri,o,a,c)};if(typeof i=="number"){const r=new I;this._registrations.set(i,r),n.onDidChangeInlineValues=r.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,r)=>this._proxy.$provideDocumentHighlights(e,i.uri,n,r)}))}$registerMultiDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.multiDocumentHighlightProvider.register(t,{selector:t,provideMultiDocumentHighlights:(i,n,r,o)=>this._proxy.$provideMultiDocumentHighlights(e,i.uri,n,r.map(a=>a.uri),o).then(a=>{if(wU(a))return;const c=new gi;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,r)=>{const o=await this._proxy.$provideLinkedEditingRanges(e,i.uri,n,r);if(o)return{ranges:o.ranges,wordPattern:o.wordPattern?Er._reviveRegExp(o.wordPattern):void 0}}}))}$registerReferenceSupport(e,t){this._registrations.set(e,this._languageFeaturesService.referenceProvider.register(t,{provideReferences:(i,n,r,o)=>this._proxy.$provideReferences(e,i.uri,n,r,o).then(Er._reviveLocationDto)}))}$registerCodeActionSupport(e,t,i,n,r,o){const a={provideCodeActions:async(c,l,d,h)=>{const u=await this._proxy.$provideCodeActions(e,c.uri,l,d,h);if(u)return{actions:Er._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:r};o&&(a.resolveCodeAction=async(c,l)=>{const d=await this._proxy.$resolveCodeAction(e,c.cacheId,l);return d.edit&&(c.edit=Vy(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 Mxe(e,this._proxy,i,this._uriIdentService);this._pasteEditProviders.set(e,n),this._registrations.set(e,Yo(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:(r,o,a)=>this._proxy.$provideDocumentFormattingEdits(e,r.uri,o,a)}))}$registerRangeFormattingSupport(e,t,i,n,r){this._registrations.set(e,this._languageFeaturesService.documentRangeFormattingEditProvider.register(t,{extensionId:i,displayName:n,provideDocumentRangeFormattingEdits:(o,a,c,l)=>this._proxy.$provideDocumentRangeFormattingEdits(e,o.uri,a,c,l),provideDocumentRangesFormattingEdits:r?(o,a,c,l)=>this._proxy.$provideDocumentRangesFormattingEdits(e,o.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:(r,o,a,c,l)=>this._proxy.$provideOnTypeFormattingEdits(e,r.uri,o,a,c,l)}))}$registerNavigateTypeSupport(e,t){let i;const n={provideWorkspaceSymbols:async(r,o)=>{const a=await this._proxy.$provideWorkspaceSymbols(e,r,o);return i!==void 0&&this._proxy.$releaseWorkspaceSymbols(e,i),i=a.cacheId,Er._reviveWorkspaceSymbolDto(a.symbols)}};t&&(n.resolveWorkspaceSymbol=async(r,o)=>{const a=await this._proxy.$resolveWorkspaceSymbol(e,r,o);return a&&Er._reviveWorkspaceSymbolDto(a)}),this._registrations.set(e,Lxe.register(n))}$registerRenameSupport(e,t,i){this._registrations.set(e,this._languageFeaturesService.renameProvider.register(t,{provideRenameEdits:(n,r,o,a)=>this._proxy.$provideRenameEdits(e,n.uri,r,o,a).then(c=>Vy(c,this._uriIdentService)),resolveRenameLocation:i?(n,r,o)=>this._proxy.$resolveRenameLocation(e,n.uri,r,o):void 0}))}$registerNewSymbolNamesProvider(e,t){this._registrations.set(e,this._languageFeaturesService.newSymbolNamesProvider.register(t,{supportsAutomaticNewSymbolNamesTriggerKind:this._proxy.$supportsAutomaticNewSymbolNamesTriggerKind(e),provideNewSymbolNames:(i,n,r,o)=>this._proxy.$provideNewSymbolNames(e,i.uri,n,r,o)}))}$registerDocumentSemanticTokensProvider(e,t,i,n){let r;if(typeof n=="number"){const o=new I;this._registrations.set(n,o),r=o.event}this._registrations.set(e,this._languageFeaturesService.documentSemanticTokensProvider.register(t,new Ojt(this._proxy,e,i,r)))}$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 Bjt(this._proxy,e,i)))}static _inflateSuggestDto(e,t,i){const n=t[Ri.label],r=t[Ri.commandId],o=t[Ri.commandIdent],a=t[Ri.commitCharacters];return{label:n,extensionId:i,kind:t[Ri.kind]??Me.Property,tags:t[Ri.kindModifier],detail:t[Ri.detail],documentation:t[Ri.documentation],sortText:t[Ri.sortText],filterText:t[Ri.filterText],preselect:t[Ri.preselect],insertText:t[Ri.insertText]??(typeof n=="string"?n:n.label),range:t[Ri.range]??e,insertTextRules:t[Ri.insertTextRules],commitCharacters:a?Array.from(a):void 0,additionalTextEdits:t[Ri.additionalTextEdits],command:r?{$ident:o,id:r,title:"",arguments:o?[o]:t[Ri.commandArguments]}:void 0,_id:t.x}}$registerCompletionsProvider(e,t,i,n,r){const o={triggerCharacters:i,_debugDisplayName:`${r.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[ky.completions].map(u=>Er._inflateSuggestDto(h[ky.defaultRanges],u,r)),incomplete:h[ky.isIncomplete]||!1,duration:h[ky.duration],dispose:()=>{typeof h.x=="number"&&this._proxy.$releaseCompletionItems(e,h.x)}}}};n&&(o.resolveCompletionItem=(a,c)=>this._proxy.$resolveCompletionItem(e,a._id,c).then(l=>{if(!l)return a;const d=Er._inflateSuggestDto(a.range,l,r);return mp(a,d,!0)})),this._registrations.set(e,this._languageFeaturesService.completionProvider.register(t,o))}$registerInlineCompletionsSupport(e,t,i,n,r){const o={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:r,toString(){return`InlineCompletionsProvider(${n})`}};this._registrations.set(e,this._languageFeaturesService.inlineCompletionsProvider.register(t,o))}$registerInlineEditProvider(e,t,i){const n={provideInlineEdit:async(r,o,a)=>this._proxy.$provideInlineEdit(e,r.uri,o,a),freeInlineEdit:r=>{this._proxy.$freeInlineEdit(e,r.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,r,o,a)=>{const c=await this._proxy.$provideSignatureHelp(e,n.uri,r,a,o);if(c)return{value:c,dispose:()=>{this._proxy.$releaseSignatureHelp(e,c.id)}}}}))}$registerInlayHintsProvider(e,t,i,n,r){const o={displayName:r,provideInlayHints:async(a,c,l)=>{const d=await this._proxy.$provideInlayHints(e,a.uri,c,l);if(d)return{hints:Mr(d.hints),dispose:()=>{d.cacheId&&this._proxy.$releaseInlayHints(e,d.cacheId)}}}};if(i&&(o.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 Pa;return d?{...a,tooltip:d.tooltip,label:Mr(d.label),textEdits:d.textEdits}:a}),typeof n=="number"){const a=new I;this._registrations.set(n,a),o.onDidChangeInlayHints=a.event}this._registrations.set(e,this._languageFeaturesService.inlayHintsProvider.register(t,o))}$emitInlayHintsEvent(e){const t=this._registrations.get(e);t instanceof I&&t.fire(void 0)}$registerDocumentLinkProvider(e,t,i){const n={provideLinks:(r,o)=>this._proxy.$provideDocumentLinks(e,r.uri,o).then(a=>{if(a)return{links:a.links.map(Er._reviveLinkDTO),dispose:()=>{typeof a.cacheId=="number"&&this._proxy.$releaseDocumentLinks(e,a.cacheId)}}})};i&&(n.resolveLink=(r,o)=>{const a=r;return a.cacheId?this._proxy.$resolveDocumentLink(e,a.cacheId,o).then(c=>c&&Er._reviveLinkDTO(c)):r}),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,r)=>i.$provideDocumentColors(e,n.uri,r).then(o=>o.map(a=>{const[c,l,d,h]=a.color;return{color:{red:c,green:l,blue:d,alpha:h},range:a.range}})),provideColorPresentations:(n,r,o)=>i.$provideColorPresentations(e,n.uri,{color:[r.color.red,r.color.green,r.color.blue,r.color.alpha],range:r.range},o)}))}$registerFoldingRangeProvider(e,t,i,n){const r={id:i.value,provideFoldingRanges:(o,a,c)=>this._proxy.$provideFoldingRanges(e,o.uri,a,c)};if(typeof n=="number"){const o=new I;this._registrations.set(n,o),r.onDidChange=o.event}this._registrations.set(e,this._languageFeaturesService.foldingRangeProvider.register(t,r))}$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,r)=>this._proxy.$provideSelectionRanges(e,i.uri,n,r)}))}$registerCallHierarchyProvider(e,t){this._registrations.set(e,drt.register(t,{prepareCallHierarchy:async(i,n,r)=>{const o=await this._proxy.$prepareCallHierarchy(e,i.uri,n,r);if(!(!o||o.length===0))return{dispose:()=>{for(const a of o)this._proxy.$releaseCallHierarchy(e,a._sessionId)},roots:o.map(Er._reviveCallHierarchyItemDto)}},provideOutgoingCalls:async(i,n)=>{const r=await this._proxy.$provideCallHierarchyOutgoingCalls(e,i._sessionId,i._itemId,n);return r&&(r.forEach(o=>{o.to=Er._reviveCallHierarchyItemDto(o.to)}),r)},provideIncomingCalls:async(i,n)=>{const r=await this._proxy.$provideCallHierarchyIncomingCalls(e,i._sessionId,i._itemId,n);return r&&(r.forEach(o=>{o.from=Er._reviveCallHierarchyItemDto(o.from)}),r)}}))}static _reviveRegExp(e){return new RegExp(e.pattern,e.flags)}static _reviveIndentationRule(e){return{decreaseIndentPattern:Er._reviveRegExp(e.decreaseIndentPattern),increaseIndentPattern:Er._reviveRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Er._reviveRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Er._reviveRegExp(e.unIndentedLinePattern):void 0}}static _reviveOnEnterRule(e){return{beforeText:Er._reviveRegExp(e.beforeText),afterText:e.afterText?Er._reviveRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Er._reviveRegExp(e.previousLineText):void 0,action:e.action}}static _reviveOnEnterRules(e){return e.map(Er._reviveOnEnterRule)}$setLanguageConfiguration(e,t,i){const n={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Er._reviveRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Er._reviveIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Er._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,urt.register(t,{prepareTypeHierarchy:async(i,n,r)=>{const o=await this._proxy.$prepareTypeHierarchy(e,i.uri,n,r);if(o)return{dispose:()=>{for(const a of o)this._proxy.$releaseTypeHierarchy(e,a._sessionId)},roots:o.map(Er._reviveTypeHierarchyItemDto)}},provideSupertypes:async(i,n)=>{const r=await this._proxy.$provideTypeHierarchySupertypes(e,i._sessionId,i._itemId,n);return r&&r.map(Er._reviveTypeHierarchyItemDto)},provideSubtypes:async(i,n)=>{const r=await this._proxy.$provideTypeHierarchySubtypes(e,i._sessionId,i._itemId,n);return r&&r.map(Er._reviveTypeHierarchyItemDto)}}))}$registerDocumentOnDropEditProvider(e,t,i){const n=new Nxe(e,this._proxy,i,this._uriIdentService);this._documentOnDropEditProviders.set(e,n),this._registrations.set(e,Yo(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 Wjt(i,e,this._proxy,this._uriIdentService);this._registrations.set(e,this._languageFeaturesService.mappedEditsProvider.register(t,n))}};R8e=Er=D([Ki(We.MainThreadLanguageFeatures),_(1,Di),_(2,zs),_(3,nt),_(4,Is)],R8e);let Mxe=class{constructor(e,t,i,n){this._handle=e,this._proxy=t,this._uriIdentService=n,this.dataTransfers=new HPe,this.copyMimeTypes=i.copyMimeTypes,this.pasteMimeTypes=i.pasteMimeTypes,this.providedPasteEditKinds=i.providedPasteEditKinds?.map(r=>new Jn(r)),i.supportsCopy&&(this.prepareDocumentPaste=async(r,o,a,c)=>{const l=await U_.from(a);if(c.isCancellationRequested)return;const d=await this._proxy.$prepareDocumentPaste(e,r.uri,o,l,c);if(!d)return;const h=new Ice;for(const[u,f]of d.items)h.replace(u,rG(f.asString));return h}),i.supportsPaste&&(this.provideDocumentPasteEdits=async(r,o,a,c,l)=>{const d=this.dataTransfers.add(a);try{const h=await U_.from(a);if(l.isCancellationRequested)return;const u=await this._proxy.$providePasteEdits(this._handle,d.id,r.uri,o,h,{only:c.only?.value,triggerKind:c.triggerKind},l);return u?{edits:u.map(f=>({...f,kind:f.kind?new Jn(f.kind.value):new Jn(""),yieldTo:f.yieldTo?.map(p=>({kind:new Jn(p)})),additionalEdit:f.additionalEdit?Vy(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(r,o)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,r._cacheId,o);return a.additionalEdit&&(r.additionalEdit=Vy(a.additionalEdit,this._uriIdentService)),r})}resolveFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};Mxe=D([_(3,Is)],Mxe);let Nxe=class{constructor(e,t,i,n){this._handle=e,this._proxy=t,this._uriIdentService=n,this.dataTransfers=new HPe,this.dropMimeTypes=i?.dropMimeTypes??["*/*"],i?.supportsResolve&&(this.resolveDocumentDropEdit=async(r,o)=>{const a=await this._proxy.$resolvePasteEdit(this._handle,r._cacheId,o);return a.additionalEdit&&(r.additionalEdit=Vy(a.additionalEdit,this._uriIdentService)),r})}async provideDocumentDropEdits(e,t,i,n){const r=this.dataTransfers.add(i);try{const o=await U_.from(i);if(n.isCancellationRequested)return;const a=await this._proxy.$provideDocumentOnDropEdits(this._handle,r.id,e.uri,t,o,n);return a?{edits:a.map(c=>({...c,yieldTo:c.yieldTo?.map(l=>({kind:new Jn(l)})),kind:c.kind?new Jn(c.kind):void 0,additionalEdit:Vy(c.additionalEdit,this._uriIdentService,l=>this.resolveDocumentOnDropFileData(r.id,l))})),dispose:()=>{this._proxy.$releaseDocumentOnDropEdits(this._handle,r.id)}}:void 0}finally{r.dispose()}}resolveDocumentOnDropFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};Nxe=D([_(3,Is)],Nxe);class Ojt{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,r=await this._proxy.$provideDocumentSemanticTokens(this._handle,e.uri,n,i);if(!r||i.isCancellationRequested)return null;const o=pZ(r);return o.type==="full"?{resultId:String(o.id),data:o.data}:{resultId:String(o.id),edits:o.deltas}}}class Bjt{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 r=pZ(n);if(r.type==="full")return{resultId:String(r.id),data:r.data};throw new Error("Unexpected")}}class Wjt{constructor(e,t,i,n){this.displayName=e,this._handle=t,this._proxy=i,this._uriService=n}async provideMappedEdits(e,t,i,n){const r=await this._proxy.$provideMappedEdits(this._handle,e.uri,t,i,n);return r?Vy(r,this._uriService):null}}let M8e=class{constructor(e,t,i,n,r){this._languageService=t,this._modelService=i,this._resolverService=n,this._languageStatusService=r,this._disposables=new Z,this._status=new mr,this._proxy=e.getProxy(Je.ExtHostLanguages),this._proxy.$acceptLanguageIds(t.getRegisteredLanguageIds()),this._disposables.add(t.onDidChange(o=>{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 r=n.tokenization.getLineTokens(t.lineNumber),o=r.findTokenIndexAtOffset(t.column-1);return{type:r.getStandardTokenType(o),range:new F(t.lineNumber,1+r.getStartOffset(o),t.lineNumber,1+r.getEndOffset(o))}}$setLanguageStatus(e,t){this._status.get(e)?.dispose(),this._status.set(e,this._languageStatusService.addStatus(t))}$removeLanguageStatus(e){this._status.get(e)?.dispose()}};M8e=D([Ki(We.MainThreadLanguages),_(1,Di),_(2,fi),_(3,pn),_(4,mce)],M8e);let N8e=class{constructor(e,t){this.loggerService=t,this.disposables=new Z;const i=e.getProxy(Je.ExtHostLogLevelServiceShape);this.disposables.add(t.onDidChangeLogLevel(n=>{Bje(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,r]of t)$Y(i,n,r)}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()}};N8e=D([Ki(We.MainThreadLogger),_(1,pf)],N8e);vt.registerCommand("_extensionTests.setLogLevel",function(s,e){const t=s.get(pf),i=s.get(ec);if(i.isExtensionDevelopment&&i.extensionTestsLocationURI){const n=Uje(e);n!==void 0&&t.setLogLevel(n)}});vt.registerCommand("_extensionTests.getLogLevel",function(s){const e=s.get(Ke);return f3(e.getLevel())});let P8e=class{constructor(e,t,i,n,r){this._notificationService=t,this._commandService=i,this._dialogService=n,this.extensionsListener=r.onDidChangeExtensions(o=>{for(const a of o.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(r=>{const o=i.map(d=>al({id:`_extension_message_handle_${d.handle}`,label:d.title,enabled:!0,run:()=>(r(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(al({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:o,secondary:c},source:a});M.once(l.onDidClose)(()=>{r(void 0)})})}async _showModalMessage(e,t,i,n,r){const o=[];let a;for(const l of n){const d={label:l.title,run:()=>l.handle};l.isCloseAffordance?a=d:o.push(d)}a||(o.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:o,cancelButton:a,custom:r});return c}};P8e=D([Ki(We.MainThreadMessageService),_(1,wi),_(2,bi),_(3,ir),_(4,ps)],P8e);const Hjt=(s,e,t)=>{const i=new Uint8Array(16);for(let o=0;o<16;o++)i[o]=Math.round(Math.random()*256);const n=zTe(Ge.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 `},F8e=Ge.fromString(`\r @@ -936,7 +936,7 @@ ${n}`))}$acceptDAExit(e,t,i){this.getDebugAdapter(e).fireExit(e,t,i)}getDebugAda Example patterns: {0}`,l3e)},{type:"string",markdownDescription:g(8682,`Map URI pattern to an opener id. Example patterns: -{0}`,l3e),enum:[vrt],enumDescriptions:[g(8683,"Open using VS Code's standard opener.")]},Hxe]}}}};function dYt(s,e){Hxe.enum=s,Hxe.enumDescriptions=e,je.as(Pn.Configuration).notifyConfigurationSchemaUpdated(lYt)}var Uxe,oM;let Vxe=(oM=class extends V{constructor(e,t){super(),this._extensionService=t,this._openers=new Map,this._memento=new dI(Uxe.STORAGE_ID,e),this._mementoObject=this._memento.getMemento(Ie.PROFILE,cn.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 r={extensionId:t,isCurrentlyRegistered:i.isCurrentlyRegistered};this._openers.set(e,r),this._mementoObject[e]=r,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(r=>r.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);dYt(e,t)}},Uxe=oM,oM.STORAGE_ID="externalUriOpeners",oM);Vxe=Uxe=D([_(0,Gi),_(1,ps)],Vxe);let d3e=class extends V{constructor(e,t,i,n,r,o){super(),this.extensionService=n,this.openerService=r,this.notificationService=o,this._registeredOpeners=new Map,this.proxy=e.getProxy(Je.ExtHostUriOpeners),this._register(i.registerExternalOpenerProvider(this)),this._contributedExternalUriOpenersStore=this._register(new Vxe(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,r)=>{try{await this.proxy.$openUri(e,{resolvedUri:i,sourceUri:n.sourceUri},r)}catch(o){if(!Oo(o)){const a=new an("default",g(4866,"Open using default opener"),void 0,void 0,async()=>{await this.openerService.open(i,{allowTunneling:!1,allowContributedOpeners:vrt})});a.tooltip=i.toString(),this.notificationService.notify({severity:Ze.Error,message:g(4867,"Could not open uri with '{0}': {1}",e,o.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()}};d3e=D([Ki(We.MainThreadUriOpeners),_(1,Gi),_(2,ZXe),_(3,ps),_(4,Ar),_(5,wi)],d3e);let h3e=class{constructor(e,t,i,n){this.hostService=t,this.openerService=i,this.userActivityService=n,this.disposables=new Z,this.proxy=e.getProxy(Je.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 r;return t&&N.parse(t).toString()===n.toString()?r=t:r=n,this.openerService.open(r,{openExternal:!0,allowTunneling:i.allowTunneling,allowContributedOpeners:i.allowContributedOpeners})}async $asExternalUri(e,t){return(await this.openerService.resolveExternalUri(N.revive(e),t)).resolved}};h3e=D([Ki(We.MainThreadWindow),_(1,Dc),_(2,Ar),_(3,NMe)],h3e);var zxe;let $xe=zxe=class extends V{static async create(e,t,i){return e.invokeFunction(async n=>{const o=await n.get(pn).createModelReference(i);return e.createInstance(zxe,t,i,o)})}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(r=>{Yi(this.resource,r.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(ph.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)}};$xe=zxe=D([_(3,Fr)],$xe);new Q("webviewFindWidgetVisible",!1);new Q("webviewFindWidgetFocused",!1);new Q("webviewFindWidgetEnabled",!1);var u3e;(function(s){s.NotebookRenderer="notebookRenderer",s.CustomEditor="customEditor",s.WebviewView="webviewView"})(u3e||(u3e={}));let Gxe=class{constructor(e,t){this._memento=new dI(e,t),this._state=this._memento.getMemento(Ie.APPLICATION,cn.MACHINE)}getOrigin(e,t){const i=this._getKey(e,t),n=this._state[i];if(n&&typeof n=="string")return n;const r=ao();return this._state[i]=r,this._memento.saveMemento(),r}_getKey(e,t){return JSON.stringify({viewType:e,key:t})}};Gxe=D([_(1,Gi)],Gxe);let xie=class{constructor(e,t){this._store=new Gxe(e,t)}getOrigin(e,t){return this._store.getOrigin(e,t.value)}};xie=D([_(1,Gi)],xie);let Die=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,Tr.ADDED)&&(i=!1,t=!0):e.contains(this.resource,Tr.DELETED)&&(i=!0,t=!0),t&&this.orphaned!==i){let n=!1;i&&(await Ao(100,Ue.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()}};Die=D([_(1,Xt)],Die);var yj,FF;(function(s){s[s.Custom=0]="Custom",s[s.Text=1]="Text"})(FF||(FF={}));let Kxe=class extends V{constructor(e,t,i,n,r,o,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 mr),this._editorRenameBackups=new Map,this._webviewOriginStore=new xie("mainThreadCustomEditors.origins",r),this._proxyCustomEditors=e.getProxy(Je.ExtHostCustomEditors),this._register(a.registerWorkingCopyProvider(f=>{const p=[];for(const m of o.workingCopies)m instanceof OF&&Jy(f,m.editorResource)&&p.push(m);return p})),this._register(u.registerResolver({canResolve:f=>(f instanceof hB&&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,r){this.registerEditorProvider(FF.Text,Mte(e),t,i,n,!0,r)}$registerCustomEditorProvider(e,t,i,n,r){this.registerEditorProvider(FF.Custom,Mte(e),t,i,{},n,r)}registerEditorProvider(e,t,i,n,r,o,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:o})),c.add(this._webviewWorkbenchService.registerResolver({canResolve:l=>l instanceof hB&&l.viewType===i,resolveWebview:async(l,d)=>{const h=ao(),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){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()}),r.supportsMove&&l.onMove(async m=>{const v=p;p=await this.getOrCreateCustomEditorModel(e,m,i,{},Ue.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},uI(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,n,r){const o=this._customEditorService.models.tryRetain(t,i);if(o)return o;switch(e){case FF.Text:{const a=$xe.create(this._instantiationService,i,t);return this._customEditorService.models.add(t,i,a)}case FF.Custom:{const a=OF.create(this._instantiationService,this._proxyCustomEditors,i,t,n,()=>Array.from(this.mainThreadWebviewPanels.webviewInputs).filter(c=>c instanceof hB&&Yi(c.resource,t)),r);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 OF))throw new Error("Could not find model for webview editor");return n}async onWillRunWorkingCopyFileOperation(e){e.operation===Ei.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 OF&&i.isDirty()){const n=await i.backup(Ue.None);n.meta&&this._editorRenameBackups.set(i.editorResource.toString(),n.meta)}})())}};Kxe=D([_(3,ps),_(4,Gi),_(5,Pm),_(6,qb),_(7,AMe),_(8,Pr),_(9,ti),_(10,we),_(11,K6)],Kxe);var BC;(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})(BC||(BC={}));let OF=yj=class extends Die{static async create(e,t,i,n,r,o,a){const c=o();let l;c.length!==0&&(l=c[0].untitledDocumentData);const{editable:d}=await t.$createCustomDocument(n,i,r.backupId,l,a);return e.createInstance(yj,t,i,n,!!r.backupId,d,!!l,o)}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m){super(yj.toWorkingCopyResource(t,i),l),this._proxy=e,this._viewType=t,this._editorResource=i,this._editable=r,this._getEditors=a,this._fileDialogService=c,this._labelService=d,this._undoService=h,this._environmentService=u,this._pathService=p,this._fromBackup=!1,this._hotExitState=BC.Allowed,this._currentEditIndex=-1,this._savePoint=-1,this._edits=[],this._isDirtyFromContentChange=!1,this.typeId=rPe,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,r&&(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))}))),o&&(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=`/${B8(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 Kr(this._labelService.getUriLabel(this._editorResource))}get capabilities(){return this.isUntitled()?hC.Untitled:hC.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:El.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,Ue.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=Mo(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=N8(this._editorResource,t,this._pathService.defaultUriScheme);return this._fileDialogService.pickFileToSave(i,e?.availableFileSystems)}async saveCustomEditorAs(e,t,i){return this._editable?(await Mo(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===BC.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],r={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 r;this._hotExitState.type===BC.Type.Pending&&this._hotExitState.operation.cancel();const o=new BC.Pending(Mo(c=>this._proxy.$backup(this._editorResource.toJSON(),this.viewType,c)));this._hotExitState=o,e.onCancellationRequested(()=>{o.operation.cancel()});let a="";try{const c=await o.operation;this._hotExitState===o&&(this._hotExitState=BC.Allowed,r.meta.backupId=c,this._backupId=c)}catch(c){if(Oo(c))throw c;this._hotExitState===o&&(this._hotExitState=BC.NotAllowed),c.message&&(a=c.message)}if(this._hotExitState===BC.Allowed)return r;throw new Error(`Cannot backup in this state: ${a}`)}};OF=yj=D([_(7,dg),_(8,Xt),_(9,Os),_(10,iE),_(11,Xo),_(12,Pm),_(13,Cf),_(14,ps)],OF);class hYt{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 uYt{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 qxe=class extends V{constructor(e,t,i,n,r,o,a,c,l){super(),this._mainThreadWebviews=t,this._configurationService=i,this._editorGroupService=n,this._editorService=r,this._telemetryService=c,this._webviewWorkbenchService=l,this.webviewPanelViewType=new uYt("mainThreadWebview-"),this._webviewInputs=new hYt,this._revivers=this._register(new mr),this.webviewOriginStore=new xie("mainThreadWebviewPanel.origins",a),this._proxy=e.getProxy(Je.ExtHostWebviewPanels),this._register(M.any(r.onDidActiveEditorChange,r.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"&&o.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,r){const o=this.getTargetGroupFromShowOptions(r),a=r?{preserveFocus:!!r.preserveFocus,group:o}:{},c=Mte(e),l=this.webviewOriginStore.getOrigin(i,c.id),d=this._webviewWorkbenchService.openWebview({origin:l,providedViewType:i,title:n.title,options:fYt(n.panelOptions),contentOptions:Nte(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=gYt(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===pA||this._editorGroupService.count===1&&this._editorGroupService.activeGroup.isEmpty)return pA;if(e.viewColumn===nv)return nv;if(e.viewColumn>=0){const t=this._editorGroupService.getGroups(gu.GRID_APPEARANCE)[e.viewColumn];if(t)return t.id;const i=this._editorGroupService.findGroup({location:yCe.LAST});if(i){const n=QW(this._configurationService);return this._editorGroupService.addGroup(i,n)}}return pA}$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 r=ao();this.addWebviewInput(r,i,t);let o;if(i.webview.state)try{o=JSON.parse(i.webview.state)}catch(a){console.error("Could not load webview state",a,i.webview.state)}try{await this._proxy.$deserializeWebviewPanel(r,n,{title:i.getTitle(),state:o,panelOptions:i.webview.options,webviewOptions:i.webview.contentOptions,active:i===this._editorService.activeEditor},uI(this._editorGroupService,i.group||0))}catch(a){bt(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,r,o)=>{if(!(o instanceof Wu))return;o.updateGroup(n.id);const a=this._webviewInputs.getHandleForInput(o);a&&(t[a]={visible:r===n.activeEditor,active:o===e,position:uI(this._editorGroupService,n.id)})};for(const n of this._editorGroupService.groups)for(const r of n.editors)r instanceof Yg?(i(n,r,r.primary),i(n,r,r.secondary)):i(n,r,r);Object.keys(t).length&&this._proxy.$onDidChangeWebviewPanelViewStates(t)}tryGetWebviewInput(e){return this._webviewInputs.getInputForHandle(e)}};qxe=D([_(2,Te),_(3,Pr),_(4,ti),_(5,ps),_(6,Gi),_(7,Ji),_(8,K6)],qxe);function gYt(s){if(s)return{light:N.revive(s.light),dark:N.revive(s.dark)}}function fYt(s){return{enableFindWidget:s.enableFindWidget,retainContextWhenHidden:s.retainContextWhenHidden}}let Qxe=class extends V{constructor(e,t,i,n){super(),this.mainThreadWebviews=t,this._telemetryService=i,this._webviewViewService=n,this._webviewViews=this._register(new mr),this._webviewViewProviders=this._register(new mr),this._proxy=e.getProxy(Je.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=Mte(e),r=this._webviewViewService.register(t,{resolve:async(o,a)=>{const c=ao();this._webviewViews.set(c,o),this.mainThreadWebviews.addWebview(c,o.webview,{serializeBuffersForPostMessage:i.serializeBuffersForPostMessage});let l;if(o.webview.state)try{l=JSON.parse(o.webview.state)}catch(d){console.error("Could not load webview state",d,o.webview.state)}o.webview.extension=n,i&&(o.webview.options=i),o.onDidChangeVisibility(d=>{this._proxy.$onDidChangeWebviewViewVisibility(c,d)}),o.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,o.title,l,a)}catch(d){bt(d),o.webview.setHtml(this.mainThreadWebviews.getWebviewResolvedFailedContent(t))}}});this._webviewViewProviders.set(t,r)}$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}};Qxe=D([_(2,Ji),_(3,yZe)],Qxe);let g3e=class extends V{constructor(e,t){super();const i=this._register(t.createInstance(DEe,e));e.set(We.MainThreadWebviews,i);const n=this._register(t.createInstance(qxe,e,i));e.set(We.MainThreadWebviewPanels,n);const r=this._register(t.createInstance(Kxe,e,i,n));e.set(We.MainThreadCustomEditors,r);const o=this._register(t.createInstance(Qxe,e,i));e.set(We.MainThreadWebviewViews,o)}};g3e=D([eP,_(1,we)],g3e);let f3e=class{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m){this._searchService=t,this._contextService=i,this._editSessionIdentityService=n,this._canonicalUriService=r,this._editorService=o,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(Fee),this.registeredEditSessionProviders=new Map,this.registeredCanonicalUriProviders=new Map,this._proxy=e.getProxy(Je.ExtHostWorkspace);const v=this._contextService.getWorkspace();v.configuration&&!ld&&!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 r=n.map(o=>({uri:N.revive(o.uri),name:o.name}));return this._notificationService.status(this.getStatusMessage(e,r.length,i),{hideAfter:10*1e3}),this._workspaceEditingService.updateFolders(t,i,r,!0)}getStatusMessage(e,t,i){let n;const r=t>0,o=i>0;return r&&!o?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):o&&!r?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?y3(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),r=this._contextService.getWorkspace(),o=this._queryBuilder.file(n?[n]:r.folders,t);return this._searchService.fileSearch(o,i).then(a=>a.results.map(c=>c.resource),a=>Oo(a)?null:Promise.reject(a))}$startTextSearch(e,t,i,n,r){const o=N.revive(t),a=this._contextService.getWorkspace(),c=o?[o]: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,r,d).then(u=>({limitHit:u.limitHit}),u=>Oo(u)?null:Promise.reject(u))}$checkExists(e,t,i){return this._instantiationService.invokeFunction(n=>ast(n,e,t,i))}async $save(e,t){const i=N.revive(e),n=[...this._editorService.findEditors(i,{supportSideBySide:Us.PRIMARY})],r=await this._editorService.save(n,{reason:Sn.EXPLICIT,saveAs:t.saveAs,force:!t.saveAs});return um(this._saveResultToUris(r))}_saveResultToUris(e){return e.success?Oi(e.editors.map(t=>Pa.getCanonicalUri(t,{supportSideBySide:Us.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,r)=>this._proxy.$getEditSessionIdentifier(n.uri,r),provideEditSessionIdentityMatch:async(n,r,o,a)=>this._proxy.$provideEditSessionIdentityMatch(n.uri,r,o,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,r,o)=>{const a=await this._proxy.$provideCanonicalUri(n,r,o);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)}};f3e=D([Ki(We.MainThreadWorkspace),_(1,bce),_(2,Ci),_(3,_Me),_(4,mMe),_(5,ti),_(6,oC),_(7,wi),_(8,U6),_(9,we),_(10,Os),_(11,ec),_(12,Xt),_(13,mC),_(14,Bae)],f3e);var pYt=".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}";gt(pYt,{});let ty=class{constructor(e,t,i,n,r){this.uniqueOwner=e,this.owner=t,this.resource=i,this.comment=n,this.thread=r,this.isRoot=!1,this.replies=[],this.threadId=r.threadId,this.range=r.range,this.threadState=r.state,this.threadRelevance=r.applicability,this.contextValue=r.contextValue,this.controllerHandle=r.controllerHandle,this.threadHandle=r.commentThreadHandle}hasReply(){return this.replies&&this.replies.length!==0}};class sp{constructor(e,t,i,n){this.uniqueOwner=e,this.owner=t,this.id=i.toString(),this.resource=i,this.commentThreads=n.filter(r=>r.comments&&r.comments.length).map(r=>sp.createCommentNode(e,t,i,r))}static createCommentNode(e,t,i,n){const{comments:r}=n,o=r.map(a=>new ty(e,t,i,a,n));return o.length>1&&(o[0].replies=o.slice(1,o.length)),o[0].isRoot=!0,o[0]}}const ple="comments";class jxe extends V{constructor(e,t,i,n){super(),this.configurationService=e,this._date=oe(i,fe("span.timestamp")),this._date.style.display="none",this._useRelativeTime=this.useRelativeTimeSetting,this.hover=this._register(t.setupManagedHover(Fo("mouse"),this._date,"")),this.setTimestamp(n)}get useRelativeTimeSetting(){return this.configurationService.getValue(ple).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 WNe(e,!0,!0)}getDateString(e){return e.toLocaleString(jl)}}const Yxe=W("commentsView.resolvedIcon",{dark:fBe,light:fBe,hcDark:yt,hcLight:yt},g(9987,"Icon color for resolved comments.")),Jxe=W("commentsView.unresolvedIcon",{dark:dme,light:dme,hcDark:yt,hcLight:yt},g(9988,"Icon color for unresolved comments."));W("editorCommentsWidget.replyInputBackground",Ace,g(9989,"Background color for comment reply input box."));const mYt=W("editorCommentsWidget.resolvedBorder",{dark:Yxe,light:Yxe,hcDark:yt,hcLight:yt},g(9990,"Color of borders and arrow for resolved comments.")),VPe=W("editorCommentsWidget.unresolvedBorder",{dark:Jxe,light:Jxe,hcDark:yt,hcLight:yt},g(9991,"Color of borders and arrow for unresolved comments."));W("editorCommentsWidget.rangeBackground",rt(VPe,.1),g(9992,"Color of background for comment ranges."));W("editorCommentsWidget.rangeActiveBackground",rt(VPe,.1),g(9993,"Color of background for currently selected or hovered comment range."));const _Yt=new Map([[cu.Unresolved,VPe],[cu.Resolved,mYt]]),vYt=new Map([[cu.Unresolved,Jxe],[cu.Resolved,Yxe]]),brt="--comment-thread-state-color",p3e="--comment-view-thread-state-color",wrt="--comment-thread-state-background-color";function yrt(s,e,t){const i=s!==void 0?t.get(s):void 0;return i!==void 0?e.getColor(i):void 0}function bYt(s,e){return yrt(s,e,_Yt)}function wYt(s,e){return yrt(s,e,vYt)}const poe=class poe{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?SU(e,"!"):e).trim(),negate:n}}};poe._filter=rYe,poe._messageFilter=YY;let yS=poe;class mle 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:r,changed:o,added:a}=e,c=this.commentThreadsMap.get(t)?.resourceWithCommentThreads||[];return r.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)}),o.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]=sp.createCommentNode(t,i,N.parse(h.id),l):l.comments&&l.comments.length&&h.commentThreads.push(sp.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(sp.createCommentNode(t,i,h.resource,l))}else c.push(new sp(t,i,N.parse(l.resource),[l]))}),this.commentThreadsMap.set(t,{ownerLabel:n,resourceWithCommentThreads:c}),this.updateResourceCommentThreads(),r.length>0||o.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=[],r=new Map;for(const o of d8(i,mle._compareURIs))r.set(o[0].resource,new sp(e,t,N.parse(o[0].resource),o));return r.forEach((o,a,c)=>{n.push(o)}),n}static _compareURIs(e,t){const i=e.resource.toString(),n=t.resource.toString();return in?1:0}}const Jl="workbench.panel.comments",yYt="Comments",Xxe=Pe(5319,"Comments"),EO=class EO{getHeight(e){return e instanceof ty&&e.hasReply()?44:22}getTemplateId(e){return e instanceof sp?EO.RESOURCE_ID:e instanceof ty?EO.COMMENT_ID:""}};EO.RESOURCE_ID="resource-with-comments",EO.COMMENT_ID="comment-node";let Zxe=EO;class CYt{constructor(e){this.labels=e,this.templateId="resource-with-comments"}renderTemplate(e){const t=oe(e,fe(".resource-container")),i=this.labels.create(t),n=oe(t,fe(".separator")),r=t.appendChild(fe(".owner"));return{resourceLabel:i,owner:r,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 eDe=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),r=this.menuService.getMenuActions(e,n,{shouldForwardArgs:!0}),c={primary:[],secondary:[],menu:r};return hJe(r,c,"inline"),c}dispose(){this.contextKeyService=void 0}};eDe=D([_(0,Ba)],eDe);let tDe=class{constructor(e,t,i,n,r,o){this.actionViewItemProvider=e,this.menus=t,this.openerService=i,this.configurationService=n,this.hoverService=r,this.themeService=o,this.templateId="comment-node"}renderTemplate(e){const t=oe(e,fe(".comment-thread-container")),i=oe(t,fe(".comment-metadata-container")),n=oe(i,fe(".comment-metadata")),r={icon:oe(n,fe(".icon")),userNames:oe(n,fe(".user")),timestamp:new jxe(this.configurationService,this.hoverService,oe(n,fe(".timestamp-container"))),relevance:oe(n,fe(".relevance")),separator:oe(n,fe(".separator")),commentPreview:oe(n,fe(".text")),range:oe(n,fe(".range"))};r.separator.innerText="·";const o=oe(i,fe(".actions")),a=new gd(o,{actionViewItemProvider:this.actionViewItemProvider}),c=oe(t,fe(".comment-snippet-container")),l={container:c,icon:oe(c,fe(".icon")),count:oe(c,fe(".count")),lastReplyDetail:oe(c,fe(".reply-detail")),separator:oe(c,fe(".separator")),timestamp:new jxe(this.configurationService,this.hoverService,oe(c,fe(".timestamp-container")))};l.separator.innerText="·",l.icon.classList.add(...He.asClassNameArray(ve.indent));const d=[r.timestamp,l.timestamp];return{threadMetadata:r,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=x6(e,{inline:!0,actionHandler:{callback:r=>Rae(this.openerService,r,e.isTrusted),disposables:t}}),n=i.element.getElementsByTagName("img");for(let r=0;rl.startsWith("codicon"))),i.threadMetadata.icon.classList.add(...He.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(p3e,`${l}`),i.threadMetadata.icon.style.color=`var(${p3e})`}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 o=e.element;if(i.threadMetadata.commentPreview.innerText="",i.threadMetadata.commentPreview.style.height="22px",typeof o.comment.body=="string")i.threadMetadata.commentPreview.innerText=o.comment.body;else{const l=new Z;i.disposables.push(l);const d=this.getRenderedComment(o.comment.body,l);i.disposables.push(d),i.threadMetadata.commentPreview.appendChild(d.element.firstElementChild??d.element),i.disposables.push(this.hoverService.setupManagedHover(Fo("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:ys.CommentThread},!e.element.hasReply()){i.repliesMetadata.container.style.display="none";return}i.repliesMetadata.container.style.display="",i.repliesMetadata.count.textContent=this.getCountString(r);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?wYt(e,t):void 0}disposeTemplate(e){e.disposables.forEach(t=>t.dispose()),e.actionBar.dispose()}};tDe=D([_(2,Ar),_(3,Te),_(4,tc),_(5,mn)],tDe);var kie;(function(s){s[s.Resource=0]="Resource",s[s.Comment=1]="Comment"})(kie||(kie={}));class SYt{constructor(e){this.options=e}filter(e,t){return this.options.filter===""&&this.options.showResolved&&this.options.showUnresolved?Qs.Visible:e instanceof sp?this.filterResourceMarkers(e):this.filterCommentNode(e,t)}filterResourceMarkers(e){if(this.options.textFilter.text&&!this.options.textFilter.negate){const t=yS._filter(this.options.textFilter.text,vi(e.resource));if(t)return{visibility:!0,data:{type:kie.Resource,uriMatches:t||[]}}}return Qs.Recurse}filterCommentNode(e,t){if(!(e.threadState===void 0||this.options.showResolved&&cu.Resolved===e.threadState||this.options.showUnresolved&&cu.Unresolved===e.threadState))return!1;if(!this.options.textFilter.text)return!0;const n=yS._messageFilter(this.options.textFilter.text,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)||yS._messageFilter(this.options.textFilter.text,e.comment.userName)||e.replies.map(r=>yS._messageFilter(this.options.textFilter.text,r.comment.userName)||yS._messageFilter(this.options.textFilter.text,typeof r.comment.body=="string"?r.comment.body:r.comment.body.value)).filter(r=>!!r).flat();return n.length&&!this.options.textFilter.negate?{visibility:!0,data:{type:kie.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 iDe=class extends N3{constructor(e,t,i,n,r,o,a,c,l){const d=new Zxe,h=GN.bind(void 0,o),u=o.createInstance(eDe);u.setContextKeyService(n);const f=[o.createInstance(CYt,e),o.createInstance(tDe,h,u)];super("CommentsTree",t,d,f,{accessibilityProvider:i.accessibilityProvider,identityProvider:{getId:p=>p instanceof mle?"root":p instanceof sp?`${p.uniqueOwner}-${p.id}`:p instanceof ty?`${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},o,n,r,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 ty))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:r=>{const o=this.keybindingService.lookupKeybinding(r.id);if(o)return new tC(r,r,{label:!0,keybinding:o.getLabel()})},onHide:r=>{r&&this.domFocus()},getActionsContext:()=>({commentControlHandle:t.controllerHandle,commentThreadHandle:t.threadHandle,$mid:ys.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}};iDe=D([_(3,Le),_(4,ug),_(5,we),_(6,Te),_(7,lo),_(8,Vt)],iDe);const zPe=new Q("commentsFilterFocus",!1),Crt=new Q("commentsView.showResolvedFilter",!0),Srt=new Q("commentsView.showUnResolvedFilter",!0);class AYt extends V{constructor(e,t){super(),this.contextKeyService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._showUnresolved=Srt.bindTo(this.contextKeyService),this._showResolved=Crt.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}))}}Et(class extends _G{constructor(){super({id:"commentsFocusViewFromFilter",title:g(9994,"Focus Comments view"),keybinding:{when:zPe,weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.DownArrow},viewId:Jl})}async runInView(s,e){e.focus()}});Et(class extends _G{constructor(){super({id:"commentsClearFilterText",title:g(9995,"Clear filter text"),keybinding:{when:zPe,weight:Ae.WorkbenchContrib,primary:S.Escape},viewId:Jl})}async runInView(s,e){e.clearFilterText()}});Et(class extends _G{constructor(){super({id:"commentsFocusFilter",title:g(9996,"Focus comments filter"),keybinding:{when:$U.isEqualTo(Jl),weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.KeyF},viewId:Jl})}async runInView(s,e){e.focusFilter()}});Et(class extends _G{constructor(){super({id:`workbench.actions.${Jl}.toggleUnResolvedComments`,title:g(9997,"Show Unresolved"),category:g(9998,"Comments"),toggled:{condition:Srt,title:g(9999,"Show Unresolved")},menu:{id:jce,group:"1_filter",when:he.equals("view",Jl),order:1},viewId:Jl})}async runInView(s,e){e.filters.showUnresolved=!e.filters.showUnresolved}});Et(class extends _G{constructor(){super({id:`workbench.actions.${Jl}.toggleResolvedComments`,title:g(1e4,"Show Resolved"),category:g(9998,"Comments"),toggled:{condition:Crt,title:g(10001,"Show Resolved")},menu:{id:jce,group:"1_filter",when:he.equals("view",Jl),order:1},viewId:Jl})}async runInView(s,e){e.filters.showResolved=!e.filters.showResolved}});var EYt=".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}";gt(EYt,{});const xYt=W("editorGutter.commentRangeForeground",{dark:hBe(hme,Uc),light:vp(hBe(hme,Uc),.05),hcDark:me.white,hcLight:me.black},g(10014,"Editor gutter decoration color for commenting ranges. This color should be opaque.")),Art=W("editorOverviewRuler.commentForeground",xYt,g(10015,"Editor overview ruler decoration color for resolved comments. This color should be opaque.")),DYt=W("editorOverviewRuler.commentUnresolvedForeground",Art,g(10016,"Editor overview ruler decoration color for unresolved comments. This color should be opaque.")),kYt=W("editorGutter.commentGlyphForeground",{dark:Nl,light:Nl,hcDark:me.black,hcLight:me.white},g(10017,"Editor gutter decoration color for commenting glyphs."));W("editorGutter.commentUnresolvedGlyphForeground",kYt,g(10018,"Editor gutter decoration color for commenting glyphs for unresolved comment threads."));const moe=class moe{constructor(e,t){this._commentsOptions=this.createDecorationOptions(),this._editor=e,this._commentsDecorations=this._editor.createDecorationsCollection(),this.setLineNumber(t)}createDecorationOptions(){const e=this._threadState===cu.Unresolved,t={description:moe.description,isWholeLine:!0,overviewRuler:{color:$r(e?DYt:Art),position:Il.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:[ts.EXACT]}}dispose(){this._commentsDecorations.clear()}};moe.description="comment-glyph-widget";let W$=moe;class H${constructor(e,t,i,n,r){this.keybindingService=e,this.contextKeyService=t,this.container=i,this.actionHandler=n,this.maxActions=r,this._buttonElements=[],this._toDispose=new Z,this._actions=[]}setActions(e,t=!1){this._toDispose.clear(),this._buttonElements.forEach(r=>r.remove()),this._buttonElements=[];const i=e.getActions({shouldForwardArgs:!0});let n=!t;for(const r of i){const[,o]=r;this._actions=o;for(const a of o){let c=this.keybindingService.lookupKeybinding(a.id,this.contextKeyService)?.getLabel();!c&&n&&(c=this.keybindingService.lookupKeybinding(XC.Submit,this.contextKeyService)?.getLabel());const l=c?`${a.label} (${c})`:a.label,d=new Zd(this.container,{secondary:!n,title:l,...M6});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 IYt=0;const TYt="commenteditordecoration";let nDe=class extends V{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b){super(),this.owner=e,this._parentEditor=i,this._commentThread=n,this._scopedInstatiationService=r,this._contextKeyService=o,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=q5,this.form=oe(t,fe(".comment-form")),this.commentEditor=this._register(this._scopedInstatiationService.createInstance(LW,this.form,LW.getEditorOptions(p),o,this._parentThread)),this.commentEditorIsEmpty=I_.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=ao()+"-"+(t?this._commentThread.threadId:++IYt),n=JSON.stringify({extensionId:this._commentThread.extensionId,commentThreadId:this._commentThread.threadId});let r=N.from({scheme:pe.commentsInput,path:`/${this._commentThread.extensionId}/commentinput-${i}.md?${n}`});const o=this.commentService.getCommentController(this.owner);o&&(r=r.with({authority:o.id}));const a=await this.textModelService.createModelReference(r);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=oe(this.form,fe(".validation-error.hidden"));const c=oe(this.form,fe(".form-actions"));this._formActions=oe(c,fe(".other-actions")),this.createCommentWidgetFormActions(this._formActions,a.object.textEditorModel),this._editorActions=oe(c,fe(".editor-actions")),this.createCommentWidgetEditorActions(this._editorActions,a.object.textEditorModel)}calculateEditorHeight(){const e=wtt(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,r=e.getModel();n.input&&r&&n.input.uri!==r.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 H$(this.keybindingService,this._contextKeyService,e,async n=>{await this._actionRunDelegate?.(),await n.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:ys.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 H$(this.keybindingService,this._contextKeyService,e,async n=>{this._actionRunDelegate?.(),n.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:ys.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=oe(t,fe(`button.review-thread-reply-button.${nA}`)),this._register(this.hoverService.setupManagedHover(Fo("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(),wt(this._commentThreadDisposables)}};nDe=D([_(12,rE),_(13,Te),_(14,Vt),_(15,tc),_(16,pn)],nDe);const _oe=class _oe extends an{constructor(e,t){super(_oe.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}};_oe.ID="toolbar.toggle.pickReactions";let l1=_oe;class LYt extends tC{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=oe(this.label,fe(".reaction-icon")),i=N.revive(e.icon);t.style.backgroundImage=ig(i)}else{const t=oe(this.label,fe("span.reaction-label"));t.innerText=e.label}if(e.count){const t=oe(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 voe=class voe extends an{constructor(e,t="",i="",n=!0,r,o,a,c){super(voe.ID,t,i,n,r),this.reactors=o,this.icon=a,this.count=c}};voe.ID="toolbar.toggle.reaction";let sDe=voe;class m3e extends q_{async runAction(e,t){await e.run(...t)}}let rDe=class extends V{get domNode(){return this._domNode}constructor(e,t,i,n,r,o,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=r,this.resource=o,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=q5,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=I_.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=oe(this._domNode,fe("div.avatar-container")),this.updateCommentUserIcon(this.comment.userIconPath),this._commentDetailsContainer=oe(this._domNode,fe(".review-comment-contents")),this.createHeader(this._commentDetailsContainer),this._body=document.createElement("div"),this._body.classList.add("comment-body",nA),p.getValue(ple)?.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 DN({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>Ml(lt(e),n)}),this._scrollableElement=this._register(new y6(t,{horizontal:Cr.Visible,vertical:Cr.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 ni(t,"scroll")).event;this._register(i(n=>{const r=this._scrollableElement.getScrollPosition(),o=Math.abs(t.scrollLeft-r.scrollLeft)<=1?void 0:t.scrollLeft,a=Math.abs(t.scrollTop-r.scrollTop)<=1?void 0:t.scrollTop;(o!==void 0||a!==void 0)&&this._scrollableElement.setScrollPosition({scrollLeft:o,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=oe(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=oe(this._avatar,fe("img.avatar"));t.src=sf.uriToBrowserUri(N.revive(e)).toString(!0),t.onerror=i=>t.remove()}}get onDidClick(){return this._onDidClick.event}createTimestamp(e){this._timestamp=oe(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 jxe(this.configurationService,this.hoverService,this._timestamp,t),this._register(this._timestampWidget)):this._timestampWidget?.dispose()}createHeader(e){const t=oe(e,fe(`div.comment-title.${nA}`)),i=oe(t,fe("comment-header-info")),n=oe(i,fe("strong.author"));n.innerText=this.comment.userName,this.createTimestamp(i),this._isPendingLabel=oe(i,fe("span.isPending")),this.comment.label?this._isPendingLabel.innerText=this.comment.label:this._isPendingLabel.innerText="",this._actionsToolbarContainer=oe(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}),r={primary:[],secondary:[]};return RYt(t,r,!1,o=>/^inline/.test(o)),r}get commentNodeContext(){return[{thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,$mid:ys.CommentNode},{commentControlHandle:this.commentThread.controllerHandle,commentThreadHandle:this.commentThread.commentThreadHandle,$mid:ys.CommentThread}]}createToolbar(){this.toolbar=new dXe(this._actionsToolbarContainer,this.contextMenuService,{actionViewItemProvider:(e,t)=>e.id===l1.ID?new cA(e,e.menuActions,this.contextMenuService,{...t,actionViewItemProvider:(i,n)=>this.actionViewItemProvider(i,n),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...He.asClassNameArray(ve.reactions)],anchorAlignmentProvider:()=>Cb.RIGHT}):this.actionViewItemProvider(e,t),orientation:W_.HORIZONTAL}),this.toolbar.context=this.commentNodeContext,this.toolbar.actionRunner=new m3e,this.registerActionBarListeners(this._actionsToolbarContainer),this._register(this.toolbar)}createActionsToolbar(){const e=[];if(this.commentService.hasReactionHandler(this.owner)){const o=this.createReactionPicker(this.comment.commentReactions||[]);e.push(o)}const i=this._commentMenus.getCommentTitleActions(this.comment,this._contextKeyService);this._register(i),this._register(i.onDidChange(o=>{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:r}=this.getToolbarActions(i);e.push(...n),(e.length||r.length)&&(this.createToolbar(),this.toolbar.setActions(e,r))}actionViewItemProvider(e,t){return e.id===l1.ID?t={label:!1,icon:!0}:t={label:!1,icon:!0},e.id===sDe.ID?new LYt(e):e instanceof Ac?this.instantiationService.createInstance(Pb,e,{hoverDelegate:t.hoverDelegate}):e instanceof Ny?this.instantiationService.createInstance(E3,e,t):new tC({},e,t)}async submitComment(){this._commentEditor&&this._commentFormActions&&(await this._commentFormActions.triggerDefaultAction(),this.pendingEdit=void 0)}createReactionPicker(e){const t=this._register(new l1(()=>{n?.show()},g(11540,"Toggle Reaction")));let i=[];e&&e.length&&(i=e.map(r=>new an(`reaction.command.${r.label}`,`${r.label}`,"",!0,async()=>{try{await this.commentService.toggleReaction(this.owner,this.resource,this.commentThread,this.comment,r)}catch(o){const a=o.message?g(11541,"Toggling the comment reaction failed: {0}.",o.message):g(11542,"Toggling the comment reaction failed");this.notificationService.error(a)}}))),t.menuActions=i;const n=new cA(t,t.menuActions,this.contextMenuService,{actionViewItemProvider:(r,o)=>r.id===l1.ID?n:this.actionViewItemProvider(r,o),actionRunner:this.actionRunner,classNames:"toolbar-toggle-pickReactions",anchorAlignmentProvider:()=>Cb.RIGHT});return t}createReactionsContainer(e){if(this._reactionActionsContainer=oe(e,fe("div.comment-reactions")),this._reactionsActionBar=new gd(this._reactionActionsContainer,{actionViewItemProvider:(i,n)=>i.id===l1.ID?new cA(i,i.menuActions,this.contextMenuService,{actionViewItemProvider:(r,o)=>this.actionViewItemProvider(r,o),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...He.asClassNameArray(ve.reactions)],anchorAlignmentProvider:()=>Cb.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=oe(e,fe(".edit-textarea"));this._commentEditor=this.instantiationService.createInstance(LW,t,LW.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(),Ml(lt(e),()=>{this._commentEditor.layout({width:t.clientWidth-14,height:this._editorHeight}),this._commentEditor.focus()});const r=this._commentEditorModel.object.textEditorModel.getLineCount(),o=this._commentEditorModel.object.textEditorModel.getLineLength(r)+1;this._commentEditor.setSelection(new ht(r,o,r,o));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=wtt(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(),wt(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=a5(this._body),r=this._body.scrollHeight,o=PTe(this._body)+4;this._scrollableElement.setScrollDimensions({width:n,scrollWidth:i,height:o,scrollHeight:r})}async switchToEditMode(){if(this.isEditing)return;this.isEditing=!0,this._body.classList.add("hidden"),this._commentEditContainer=oe(this._commentDetailsContainer,fe(".edit-container")),await this.createCommentEditor(this._commentEditContainer);const e=oe(this._commentEditContainer,fe(".form-actions")),t=oe(e,fe(".other-actions"));this.createCommentWidgetFormActions(t);const i=oe(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 H$(this.keybindingService,this._contextKeyService,e,n=>{const r=this._commentEditor.getValue();n.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:r,$mid:ys.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 H$(this.keybindingService,this._contextKeyService,e,n=>{const r=this._commentEditor.getValue();n.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:r,$mid:ys.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===O2.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===O2.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 Dh(lt(this._domNode),e);this.contextMenuService.showContextMenu({getAnchor:()=>t,menuId:_e.CommentThreadCommentContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:this._contextKeyService,actionRunner:new m3e,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(),wt(this._commentEditorDisposables)}};rDe=D([_(8,we),_(9,rE),_(10,wi),_(11,lo),_(12,Le),_(13,Te),_(14,tc),_(15,_o),_(16,Vt),_(17,pn)],rDe);function RYt(s,e,t,i=n=>n==="navigation"){for(const n of s){let[r,o]=n;if(i(r))(Array.isArray(e)?e:e.primary).unshift(...o);else{const a=Array.isArray(e)?e:e.secondary;a.length>0&&a.push(new Eo),a.push(...o)}}}let oDe=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,r,o,a,c,l,d,h,u){super(),this._parentEditor=e,this.owner=t,this.parentResourceUri=i,this.container=n,this._options=r,this._commentThread=o,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 mr,this._register(ue(n,ke.FOCUS_IN,f=>{this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._markdownRenderer=this._register(new Z_(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=oe(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 xn(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 r=this._focusedComment+n;return Math.min(Math.max(0,r),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===O2.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=K_(this.container);this._onDidResize.fire(e)}getDimensions(){return K_(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=So(this._commentElements[0].domNode),n=So(t[0].domNode);return{thread:i,comment:n}}}async updateCommentThread(e,t){const i=this._commentElements.length,n=e.comments?e.comments.length:0,r=[],o=[];for(let d=0;df.uniqueIdInThread===h.uniqueIdInThread):[];u.length?this._commentElements[d].update(u[0]):(o.push(d),r.push(this._commentElements[d]))}for(let d=r.length-1;d>=0;d--){const h=r[d];this._commentDisposable.deleteAndDispose(h),this._commentElements.splice(o[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===O2.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(rDe,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(r=>r.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()}};oDe=D([_(9,rE),_(10,Ar),_(11,Di)],oDe);const MYt=oi("review-comment-collapse",ve.chevronUp,g(11504,"Icon to collapse a review comment.")),NYt="expand-review-action "+He.asClassName(MYt);class PYt extends V{constructor(e,t,i,n,r,o,a){super(),this._delegate=t,this._commentMenus=i,this._commentThread=n,this._contextKeyService=r,this.instantiationService=o,this._contextMenuService=a,this._headElement=fe(".head"),e.appendChild(this._headElement),this._register(Ee(()=>this._headElement.remove())),this._fillHead()}_fillHead(){const e=oe(this._headElement,fe(".review-title"));this._headingLabel=oe(e,fe("span.filename")),this.createThreadLabel();const t=oe(this._headElement,fe(".review-actions"));this._actionbarWidget=new gd(t,{actionViewItemProvider:GN.bind(void 0,this.instantiationService)}),this._register(this._actionbarWidget),this._collapseAction=new an("review.expand",g(11505,"Collapse"),NYt,!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=wT(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 Dh(lt(this._headElement),e);this._contextMenuService.showContextMenu({getAnchor:()=>i,getActions:()=>t,actionRunner:new q_,getActionsContext:()=>({commentControlHandle:this._commentThread.controllerHandle,commentThreadHandle:this._commentThread.commentThreadHandle,$mid:ys.CommentThread})})}}let aDe=class extends V{constructor(e,t,i,n,r,o){super(),this._commentThread=t,this._contextKeyService=i,this._commentMenus=n,this._actionRunDelegate=r,this._keybindingService=o,this._container=oe(e,fe(".comment-additional-actions")),oe(this._container,fe(".section-separator")),this._buttonBar=oe(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 r of n){if(r.enabled){this._showMenu();return}for(const o of r.actions??[])if(o.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 H$(this._keybindingService,this._contextKeyService,e,async i=>{this._actionRunDelegate?.(),i.run({thread:this._commentThread,$mid:ys.CommentThreadInstance})},4),this._register(this._commentFormActions),this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)}};aDe=D([_(5,Vt)],aDe);var Cj;function FYt(s,e,t){const i=new Set;return Yo(...s.map((n,r)=>Yo(n.onDidFocus(()=>{t?.(r,"focus"),i.size||e(!0),i.add(r)}),n.onDidBlur(()=>{t?.(r,"blur"),i.delete(r),i.size||e(!1)}))))}const $Pe=new Q("navigableContainerFocused",!1);var aM;let wN=(aM=class{constructor(e,t,i){this.logService=t,this.configurationService=i,this.containers=new Set,this.focused=$Pe.bindTo(e),Cj.INSTANCE=this}dispose(){this.containers.clear(),this.focused.reset(),Cj.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),Yo(FYt(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}},Cj=aM,aM.ID="workbench.contrib.navigableContainerManager",aM);wN=Cj=D([_(0,Le),_(1,Ke),_(2,Te)],wN);function Ert(s){return wN.register(s)}Ju(wN.ID,wN,Cc.BlockStartup);Sr.registerCommandAndKeybindingRule({id:"widgetNavigation.focusPrevious",weight:Ae.WorkbenchContrib,when:he.and($Pe,he.or(zae?.negate(),Ykt)),primary:U.CtrlCmd|S.UpArrow,handler:()=>{wN.getActive()?.focusPreviousWidget()}});Sr.registerCommandAndKeybindingRule({id:"widgetNavigation.focusNext",weight:Ae.WorkbenchContrib,when:he.and($Pe,he.or(zae?.negate(),Jkt)),primary:U.CtrlCmd|S.DownArrow,handler:()=>{wN.getActive()?.focusNextWidget()}});let cDe=class extends V{get commentThread(){return this._commentThread}constructor(e,t,i,n,r,o,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=r,this._scopedInstantiationService=o,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=I_.commentThreadIsEmpty.bindTo(this._contextKeyService),this._threadIsEmpty.set(!a.comments||!a.comments.length),this._focusedContextKey=I_.commentFocused.bindTo(this._contextKeyService),this._commentMenus=this.commentService.getCommentMenus(this._owner),this._register(this._header=new PYt(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(Ec(b));this._register(Ert({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(bo.Comments)&&this._setAriaLabel()})),this._body=this._scopedInstantiationService.createInstance(oDe,this._parentEditor,this._owner,this._parentResourceUri,b,this._markdownOptions,this._commentThread,this._pendingEdits,this._scopedInstantiationService,this),this._register(this._body),this._setAriaLabel(),this._styleElement=fl(this.container),this._commentThreadContextValue=I_.commentThreadContext.bindTo(this._contextKeyService),this._commentThreadContextValue.set(a.contextValue);const y=I_.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(bo.Comments)&&(t=this._keybindingService.lookupKeybinding(eh.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===Rc.Expanded&&this._commentThreadState===cu.Unresolved&&e.state===cu.Resolved;this._commentThreadState=e.state,this._commentThread=e,wt(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(ple).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(),wt(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(nDe,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(aDe,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(${brt}) }`),i.push(`.monaco-editor .review-widget > .head { background-color: var(${wrt}) }`);const n=e.getColor(iLe);n&&i.push(`.review-widget .body .comment-body a { color: ${n} }`);const r=e.getColor(Spt);r&&i.push(`.review-widget .body .comment-body a:hover, a:active { color: ${r} }`);const o=e.getColor(bp);o&&(i.push(`.review-widget .body .comment-body a:focus { outline: 1px solid ${o}; }`),i.push(`.review-widget .body .monaco-editor.focused { outline: 1px solid ${o}; }`));const a=e.getColor(Apt);a&&i.push(`.review-widget .body .review-comment blockquote { background: ${a}; }`);const c=e.getColor(Ept);c&&i.push(`.review-widget .body .review-comment blockquote { border-color: ${c}; }`);const l=e.getColor(bMe);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(yt);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(DQe);h&&i.push(`.review-widget .validation-error { border: 1px solid ${h}; }`);const u=e.getColor(EQe);u&&i.push(`.review-widget .validation-error { background: ${u}; }`);const f=e.getColor(xQe);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}`,l3e),enum:[vrt],enumDescriptions:[g(8683,"Open using VS Code's standard opener.")]},Hxe]}}}};function dYt(s,e){Hxe.enum=s,Hxe.enumDescriptions=e,je.as(Pn.Configuration).notifyConfigurationSchemaUpdated(lYt)}var Uxe,oM;let Vxe=(oM=class extends V{constructor(e,t){super(),this._extensionService=t,this._openers=new Map,this._memento=new dI(Uxe.STORAGE_ID,e),this._mementoObject=this._memento.getMemento(Ie.PROFILE,cn.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 r={extensionId:t,isCurrentlyRegistered:i.isCurrentlyRegistered};this._openers.set(e,r),this._mementoObject[e]=r,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(r=>r.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);dYt(e,t)}},Uxe=oM,oM.STORAGE_ID="externalUriOpeners",oM);Vxe=Uxe=D([_(0,Gi),_(1,ps)],Vxe);let d3e=class extends V{constructor(e,t,i,n,r,o){super(),this.extensionService=n,this.openerService=r,this.notificationService=o,this._registeredOpeners=new Map,this.proxy=e.getProxy(Je.ExtHostUriOpeners),this._register(i.registerExternalOpenerProvider(this)),this._contributedExternalUriOpenersStore=this._register(new Vxe(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,r)=>{try{await this.proxy.$openUri(e,{resolvedUri:i,sourceUri:n.sourceUri},r)}catch(o){if(!Oo(o)){const a=new an("default",g(4866,"Open using default opener"),void 0,void 0,async()=>{await this.openerService.open(i,{allowTunneling:!1,allowContributedOpeners:vrt})});a.tooltip=i.toString(),this.notificationService.notify({severity:Ze.Error,message:g(4867,"Could not open uri with '{0}': {1}",e,o.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()}};d3e=D([Ki(We.MainThreadUriOpeners),_(1,Gi),_(2,ZXe),_(3,ps),_(4,Ar),_(5,wi)],d3e);let h3e=class{constructor(e,t,i,n){this.hostService=t,this.openerService=i,this.userActivityService=n,this.disposables=new Z,this.proxy=e.getProxy(Je.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 r;return t&&N.parse(t).toString()===n.toString()?r=t:r=n,this.openerService.open(r,{openExternal:!0,allowTunneling:i.allowTunneling,allowContributedOpeners:i.allowContributedOpeners})}async $asExternalUri(e,t){return(await this.openerService.resolveExternalUri(N.revive(e),t)).resolved}};h3e=D([Ki(We.MainThreadWindow),_(1,Dc),_(2,Ar),_(3,NMe)],h3e);var zxe;let $xe=zxe=class extends V{static async create(e,t,i){return e.invokeFunction(async n=>{const o=await n.get(pn).createModelReference(i);return e.createInstance(zxe,t,i,o)})}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(r=>{Yi(this.resource,r.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(ph.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)}};$xe=zxe=D([_(3,Fr)],$xe);new Q("webviewFindWidgetVisible",!1);new Q("webviewFindWidgetFocused",!1);new Q("webviewFindWidgetEnabled",!1);var u3e;(function(s){s.NotebookRenderer="notebookRenderer",s.CustomEditor="customEditor",s.WebviewView="webviewView"})(u3e||(u3e={}));let Gxe=class{constructor(e,t){this._memento=new dI(e,t),this._state=this._memento.getMemento(Ie.APPLICATION,cn.MACHINE)}getOrigin(e,t){const i=this._getKey(e,t),n=this._state[i];if(n&&typeof n=="string")return n;const r=ao();return this._state[i]=r,this._memento.saveMemento(),r}_getKey(e,t){return JSON.stringify({viewType:e,key:t})}};Gxe=D([_(1,Gi)],Gxe);let xie=class{constructor(e,t){this._store=new Gxe(e,t)}getOrigin(e,t){return this._store.getOrigin(e,t.value)}};xie=D([_(1,Gi)],xie);let Die=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,Tr.ADDED)&&(i=!1,t=!0):e.contains(this.resource,Tr.DELETED)&&(i=!0,t=!0),t&&this.orphaned!==i){let n=!1;i&&(await Ao(100,Ue.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()}};Die=D([_(1,Xt)],Die);var yj,FF;(function(s){s[s.Custom=0]="Custom",s[s.Text=1]="Text"})(FF||(FF={}));let Kxe=class extends V{constructor(e,t,i,n,r,o,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 mr),this._editorRenameBackups=new Map,this._webviewOriginStore=new xie("mainThreadCustomEditors.origins",r),this._proxyCustomEditors=e.getProxy(Je.ExtHostCustomEditors),this._register(a.registerWorkingCopyProvider(f=>{const p=[];for(const m of o.workingCopies)m instanceof OF&&Jy(f,m.editorResource)&&p.push(m);return p})),this._register(u.registerResolver({canResolve:f=>(f instanceof hB&&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,r){this.registerEditorProvider(FF.Text,Mte(e),t,i,n,!0,r)}$registerCustomEditorProvider(e,t,i,n,r){this.registerEditorProvider(FF.Custom,Mte(e),t,i,{},n,r)}registerEditorProvider(e,t,i,n,r,o,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:o})),c.add(this._webviewWorkbenchService.registerResolver({canResolve:l=>l instanceof hB&&l.viewType===i,resolveWebview:async(l,d)=>{const h=ao(),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){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()}),r.supportsMove&&l.onMove(async m=>{const v=p;p=await this.getOrCreateCustomEditorModel(e,m,i,{},Ue.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},uI(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,n,r){const o=this._customEditorService.models.tryRetain(t,i);if(o)return o;switch(e){case FF.Text:{const a=$xe.create(this._instantiationService,i,t);return this._customEditorService.models.add(t,i,a)}case FF.Custom:{const a=OF.create(this._instantiationService,this._proxyCustomEditors,i,t,n,()=>Array.from(this.mainThreadWebviewPanels.webviewInputs).filter(c=>c instanceof hB&&Yi(c.resource,t)),r);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 OF))throw new Error("Could not find model for webview editor");return n}async onWillRunWorkingCopyFileOperation(e){e.operation===Ei.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 OF&&i.isDirty()){const n=await i.backup(Ue.None);n.meta&&this._editorRenameBackups.set(i.editorResource.toString(),n.meta)}})())}};Kxe=D([_(3,ps),_(4,Gi),_(5,Pm),_(6,qb),_(7,AMe),_(8,Pr),_(9,ti),_(10,we),_(11,K6)],Kxe);var BC;(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})(BC||(BC={}));let OF=yj=class extends Die{static async create(e,t,i,n,r,o,a){const c=o();let l;c.length!==0&&(l=c[0].untitledDocumentData);const{editable:d}=await t.$createCustomDocument(n,i,r.backupId,l,a);return e.createInstance(yj,t,i,n,!!r.backupId,d,!!l,o)}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m){super(yj.toWorkingCopyResource(t,i),l),this._proxy=e,this._viewType=t,this._editorResource=i,this._editable=r,this._getEditors=a,this._fileDialogService=c,this._labelService=d,this._undoService=h,this._environmentService=u,this._pathService=p,this._fromBackup=!1,this._hotExitState=BC.Allowed,this._currentEditIndex=-1,this._savePoint=-1,this._edits=[],this._isDirtyFromContentChange=!1,this.typeId=rPe,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,r&&(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))}))),o&&(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=`/${B8(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 Kr(this._labelService.getUriLabel(this._editorResource))}get capabilities(){return this.isUntitled()?hC.Untitled:hC.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:xl.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,Ue.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=Mo(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=N8(this._editorResource,t,this._pathService.defaultUriScheme);return this._fileDialogService.pickFileToSave(i,e?.availableFileSystems)}async saveCustomEditorAs(e,t,i){return this._editable?(await Mo(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===BC.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],r={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 r;this._hotExitState.type===BC.Type.Pending&&this._hotExitState.operation.cancel();const o=new BC.Pending(Mo(c=>this._proxy.$backup(this._editorResource.toJSON(),this.viewType,c)));this._hotExitState=o,e.onCancellationRequested(()=>{o.operation.cancel()});let a="";try{const c=await o.operation;this._hotExitState===o&&(this._hotExitState=BC.Allowed,r.meta.backupId=c,this._backupId=c)}catch(c){if(Oo(c))throw c;this._hotExitState===o&&(this._hotExitState=BC.NotAllowed),c.message&&(a=c.message)}if(this._hotExitState===BC.Allowed)return r;throw new Error(`Cannot backup in this state: ${a}`)}};OF=yj=D([_(7,dg),_(8,Xt),_(9,Os),_(10,iE),_(11,Xo),_(12,Pm),_(13,Cf),_(14,ps)],OF);class hYt{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 uYt{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 qxe=class extends V{constructor(e,t,i,n,r,o,a,c,l){super(),this._mainThreadWebviews=t,this._configurationService=i,this._editorGroupService=n,this._editorService=r,this._telemetryService=c,this._webviewWorkbenchService=l,this.webviewPanelViewType=new uYt("mainThreadWebview-"),this._webviewInputs=new hYt,this._revivers=this._register(new mr),this.webviewOriginStore=new xie("mainThreadWebviewPanel.origins",a),this._proxy=e.getProxy(Je.ExtHostWebviewPanels),this._register(M.any(r.onDidActiveEditorChange,r.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"&&o.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,r){const o=this.getTargetGroupFromShowOptions(r),a=r?{preserveFocus:!!r.preserveFocus,group:o}:{},c=Mte(e),l=this.webviewOriginStore.getOrigin(i,c.id),d=this._webviewWorkbenchService.openWebview({origin:l,providedViewType:i,title:n.title,options:fYt(n.panelOptions),contentOptions:Nte(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=gYt(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===pA||this._editorGroupService.count===1&&this._editorGroupService.activeGroup.isEmpty)return pA;if(e.viewColumn===nv)return nv;if(e.viewColumn>=0){const t=this._editorGroupService.getGroups(gu.GRID_APPEARANCE)[e.viewColumn];if(t)return t.id;const i=this._editorGroupService.findGroup({location:yCe.LAST});if(i){const n=QW(this._configurationService);return this._editorGroupService.addGroup(i,n)}}return pA}$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 r=ao();this.addWebviewInput(r,i,t);let o;if(i.webview.state)try{o=JSON.parse(i.webview.state)}catch(a){console.error("Could not load webview state",a,i.webview.state)}try{await this._proxy.$deserializeWebviewPanel(r,n,{title:i.getTitle(),state:o,panelOptions:i.webview.options,webviewOptions:i.webview.contentOptions,active:i===this._editorService.activeEditor},uI(this._editorGroupService,i.group||0))}catch(a){bt(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,r,o)=>{if(!(o instanceof Wu))return;o.updateGroup(n.id);const a=this._webviewInputs.getHandleForInput(o);a&&(t[a]={visible:r===n.activeEditor,active:o===e,position:uI(this._editorGroupService,n.id)})};for(const n of this._editorGroupService.groups)for(const r of n.editors)r instanceof Yg?(i(n,r,r.primary),i(n,r,r.secondary)):i(n,r,r);Object.keys(t).length&&this._proxy.$onDidChangeWebviewPanelViewStates(t)}tryGetWebviewInput(e){return this._webviewInputs.getInputForHandle(e)}};qxe=D([_(2,Te),_(3,Pr),_(4,ti),_(5,ps),_(6,Gi),_(7,Ji),_(8,K6)],qxe);function gYt(s){if(s)return{light:N.revive(s.light),dark:N.revive(s.dark)}}function fYt(s){return{enableFindWidget:s.enableFindWidget,retainContextWhenHidden:s.retainContextWhenHidden}}let Qxe=class extends V{constructor(e,t,i,n){super(),this.mainThreadWebviews=t,this._telemetryService=i,this._webviewViewService=n,this._webviewViews=this._register(new mr),this._webviewViewProviders=this._register(new mr),this._proxy=e.getProxy(Je.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=Mte(e),r=this._webviewViewService.register(t,{resolve:async(o,a)=>{const c=ao();this._webviewViews.set(c,o),this.mainThreadWebviews.addWebview(c,o.webview,{serializeBuffersForPostMessage:i.serializeBuffersForPostMessage});let l;if(o.webview.state)try{l=JSON.parse(o.webview.state)}catch(d){console.error("Could not load webview state",d,o.webview.state)}o.webview.extension=n,i&&(o.webview.options=i),o.onDidChangeVisibility(d=>{this._proxy.$onDidChangeWebviewViewVisibility(c,d)}),o.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,o.title,l,a)}catch(d){bt(d),o.webview.setHtml(this.mainThreadWebviews.getWebviewResolvedFailedContent(t))}}});this._webviewViewProviders.set(t,r)}$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}};Qxe=D([_(2,Ji),_(3,yZe)],Qxe);let g3e=class extends V{constructor(e,t){super();const i=this._register(t.createInstance(DEe,e));e.set(We.MainThreadWebviews,i);const n=this._register(t.createInstance(qxe,e,i));e.set(We.MainThreadWebviewPanels,n);const r=this._register(t.createInstance(Kxe,e,i,n));e.set(We.MainThreadCustomEditors,r);const o=this._register(t.createInstance(Qxe,e,i));e.set(We.MainThreadWebviewViews,o)}};g3e=D([eP,_(1,we)],g3e);let f3e=class{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m){this._searchService=t,this._contextService=i,this._editSessionIdentityService=n,this._canonicalUriService=r,this._editorService=o,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(Fee),this.registeredEditSessionProviders=new Map,this.registeredCanonicalUriProviders=new Map,this._proxy=e.getProxy(Je.ExtHostWorkspace);const v=this._contextService.getWorkspace();v.configuration&&!ld&&!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 r=n.map(o=>({uri:N.revive(o.uri),name:o.name}));return this._notificationService.status(this.getStatusMessage(e,r.length,i),{hideAfter:10*1e3}),this._workspaceEditingService.updateFolders(t,i,r,!0)}getStatusMessage(e,t,i){let n;const r=t>0,o=i>0;return r&&!o?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):o&&!r?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?y3(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),r=this._contextService.getWorkspace(),o=this._queryBuilder.file(n?[n]:r.folders,t);return this._searchService.fileSearch(o,i).then(a=>a.results.map(c=>c.resource),a=>Oo(a)?null:Promise.reject(a))}$startTextSearch(e,t,i,n,r){const o=N.revive(t),a=this._contextService.getWorkspace(),c=o?[o]: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,r,d).then(u=>({limitHit:u.limitHit}),u=>Oo(u)?null:Promise.reject(u))}$checkExists(e,t,i){return this._instantiationService.invokeFunction(n=>ast(n,e,t,i))}async $save(e,t){const i=N.revive(e),n=[...this._editorService.findEditors(i,{supportSideBySide:Us.PRIMARY})],r=await this._editorService.save(n,{reason:Sn.EXPLICIT,saveAs:t.saveAs,force:!t.saveAs});return um(this._saveResultToUris(r))}_saveResultToUris(e){return e.success?Oi(e.editors.map(t=>Fa.getCanonicalUri(t,{supportSideBySide:Us.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,r)=>this._proxy.$getEditSessionIdentifier(n.uri,r),provideEditSessionIdentityMatch:async(n,r,o,a)=>this._proxy.$provideEditSessionIdentityMatch(n.uri,r,o,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,r,o)=>{const a=await this._proxy.$provideCanonicalUri(n,r,o);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)}};f3e=D([Ki(We.MainThreadWorkspace),_(1,bce),_(2,Ci),_(3,_Me),_(4,mMe),_(5,ti),_(6,oC),_(7,wi),_(8,U6),_(9,we),_(10,Os),_(11,ec),_(12,Xt),_(13,mC),_(14,Bae)],f3e);var pYt=".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}";gt(pYt,{});let ty=class{constructor(e,t,i,n,r){this.uniqueOwner=e,this.owner=t,this.resource=i,this.comment=n,this.thread=r,this.isRoot=!1,this.replies=[],this.threadId=r.threadId,this.range=r.range,this.threadState=r.state,this.threadRelevance=r.applicability,this.contextValue=r.contextValue,this.controllerHandle=r.controllerHandle,this.threadHandle=r.commentThreadHandle}hasReply(){return this.replies&&this.replies.length!==0}};class sp{constructor(e,t,i,n){this.uniqueOwner=e,this.owner=t,this.id=i.toString(),this.resource=i,this.commentThreads=n.filter(r=>r.comments&&r.comments.length).map(r=>sp.createCommentNode(e,t,i,r))}static createCommentNode(e,t,i,n){const{comments:r}=n,o=r.map(a=>new ty(e,t,i,a,n));return o.length>1&&(o[0].replies=o.slice(1,o.length)),o[0].isRoot=!0,o[0]}}const ple="comments";class jxe extends V{constructor(e,t,i,n){super(),this.configurationService=e,this._date=oe(i,fe("span.timestamp")),this._date.style.display="none",this._useRelativeTime=this.useRelativeTimeSetting,this.hover=this._register(t.setupManagedHover(Fo("mouse"),this._date,"")),this.setTimestamp(n)}get useRelativeTimeSetting(){return this.configurationService.getValue(ple).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 WNe(e,!0,!0)}getDateString(e){return e.toLocaleString(jl)}}const Yxe=W("commentsView.resolvedIcon",{dark:fBe,light:fBe,hcDark:yt,hcLight:yt},g(9987,"Icon color for resolved comments.")),Jxe=W("commentsView.unresolvedIcon",{dark:dme,light:dme,hcDark:yt,hcLight:yt},g(9988,"Icon color for unresolved comments."));W("editorCommentsWidget.replyInputBackground",Ace,g(9989,"Background color for comment reply input box."));const mYt=W("editorCommentsWidget.resolvedBorder",{dark:Yxe,light:Yxe,hcDark:yt,hcLight:yt},g(9990,"Color of borders and arrow for resolved comments.")),VPe=W("editorCommentsWidget.unresolvedBorder",{dark:Jxe,light:Jxe,hcDark:yt,hcLight:yt},g(9991,"Color of borders and arrow for unresolved comments."));W("editorCommentsWidget.rangeBackground",rt(VPe,.1),g(9992,"Color of background for comment ranges."));W("editorCommentsWidget.rangeActiveBackground",rt(VPe,.1),g(9993,"Color of background for currently selected or hovered comment range."));const _Yt=new Map([[cu.Unresolved,VPe],[cu.Resolved,mYt]]),vYt=new Map([[cu.Unresolved,Jxe],[cu.Resolved,Yxe]]),brt="--comment-thread-state-color",p3e="--comment-view-thread-state-color",wrt="--comment-thread-state-background-color";function yrt(s,e,t){const i=s!==void 0?t.get(s):void 0;return i!==void 0?e.getColor(i):void 0}function bYt(s,e){return yrt(s,e,_Yt)}function wYt(s,e){return yrt(s,e,vYt)}const poe=class poe{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?SU(e,"!"):e).trim(),negate:n}}};poe._filter=rYe,poe._messageFilter=YY;let yS=poe;class mle 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:r,changed:o,added:a}=e,c=this.commentThreadsMap.get(t)?.resourceWithCommentThreads||[];return r.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)}),o.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]=sp.createCommentNode(t,i,N.parse(h.id),l):l.comments&&l.comments.length&&h.commentThreads.push(sp.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(sp.createCommentNode(t,i,h.resource,l))}else c.push(new sp(t,i,N.parse(l.resource),[l]))}),this.commentThreadsMap.set(t,{ownerLabel:n,resourceWithCommentThreads:c}),this.updateResourceCommentThreads(),r.length>0||o.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=[],r=new Map;for(const o of d8(i,mle._compareURIs))r.set(o[0].resource,new sp(e,t,N.parse(o[0].resource),o));return r.forEach((o,a,c)=>{n.push(o)}),n}static _compareURIs(e,t){const i=e.resource.toString(),n=t.resource.toString();return in?1:0}}const Jl="workbench.panel.comments",yYt="Comments",Xxe=Pe(5319,"Comments"),EO=class EO{getHeight(e){return e instanceof ty&&e.hasReply()?44:22}getTemplateId(e){return e instanceof sp?EO.RESOURCE_ID:e instanceof ty?EO.COMMENT_ID:""}};EO.RESOURCE_ID="resource-with-comments",EO.COMMENT_ID="comment-node";let Zxe=EO;class CYt{constructor(e){this.labels=e,this.templateId="resource-with-comments"}renderTemplate(e){const t=oe(e,fe(".resource-container")),i=this.labels.create(t),n=oe(t,fe(".separator")),r=t.appendChild(fe(".owner"));return{resourceLabel:i,owner:r,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 eDe=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),r=this.menuService.getMenuActions(e,n,{shouldForwardArgs:!0}),c={primary:[],secondary:[],menu:r};return hJe(r,c,"inline"),c}dispose(){this.contextKeyService=void 0}};eDe=D([_(0,Wa)],eDe);let tDe=class{constructor(e,t,i,n,r,o){this.actionViewItemProvider=e,this.menus=t,this.openerService=i,this.configurationService=n,this.hoverService=r,this.themeService=o,this.templateId="comment-node"}renderTemplate(e){const t=oe(e,fe(".comment-thread-container")),i=oe(t,fe(".comment-metadata-container")),n=oe(i,fe(".comment-metadata")),r={icon:oe(n,fe(".icon")),userNames:oe(n,fe(".user")),timestamp:new jxe(this.configurationService,this.hoverService,oe(n,fe(".timestamp-container"))),relevance:oe(n,fe(".relevance")),separator:oe(n,fe(".separator")),commentPreview:oe(n,fe(".text")),range:oe(n,fe(".range"))};r.separator.innerText="·";const o=oe(i,fe(".actions")),a=new gd(o,{actionViewItemProvider:this.actionViewItemProvider}),c=oe(t,fe(".comment-snippet-container")),l={container:c,icon:oe(c,fe(".icon")),count:oe(c,fe(".count")),lastReplyDetail:oe(c,fe(".reply-detail")),separator:oe(c,fe(".separator")),timestamp:new jxe(this.configurationService,this.hoverService,oe(c,fe(".timestamp-container")))};l.separator.innerText="·",l.icon.classList.add(...He.asClassNameArray(ve.indent));const d=[r.timestamp,l.timestamp];return{threadMetadata:r,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=x6(e,{inline:!0,actionHandler:{callback:r=>Rae(this.openerService,r,e.isTrusted),disposables:t}}),n=i.element.getElementsByTagName("img");for(let r=0;rl.startsWith("codicon"))),i.threadMetadata.icon.classList.add(...He.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(p3e,`${l}`),i.threadMetadata.icon.style.color=`var(${p3e})`}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 o=e.element;if(i.threadMetadata.commentPreview.innerText="",i.threadMetadata.commentPreview.style.height="22px",typeof o.comment.body=="string")i.threadMetadata.commentPreview.innerText=o.comment.body;else{const l=new Z;i.disposables.push(l);const d=this.getRenderedComment(o.comment.body,l);i.disposables.push(d),i.threadMetadata.commentPreview.appendChild(d.element.firstElementChild??d.element),i.disposables.push(this.hoverService.setupManagedHover(Fo("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:ys.CommentThread},!e.element.hasReply()){i.repliesMetadata.container.style.display="none";return}i.repliesMetadata.container.style.display="",i.repliesMetadata.count.textContent=this.getCountString(r);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?wYt(e,t):void 0}disposeTemplate(e){e.disposables.forEach(t=>t.dispose()),e.actionBar.dispose()}};tDe=D([_(2,Ar),_(3,Te),_(4,tc),_(5,mn)],tDe);var kie;(function(s){s[s.Resource=0]="Resource",s[s.Comment=1]="Comment"})(kie||(kie={}));class SYt{constructor(e){this.options=e}filter(e,t){return this.options.filter===""&&this.options.showResolved&&this.options.showUnresolved?Qs.Visible:e instanceof sp?this.filterResourceMarkers(e):this.filterCommentNode(e,t)}filterResourceMarkers(e){if(this.options.textFilter.text&&!this.options.textFilter.negate){const t=yS._filter(this.options.textFilter.text,vi(e.resource));if(t)return{visibility:!0,data:{type:kie.Resource,uriMatches:t||[]}}}return Qs.Recurse}filterCommentNode(e,t){if(!(e.threadState===void 0||this.options.showResolved&&cu.Resolved===e.threadState||this.options.showUnresolved&&cu.Unresolved===e.threadState))return!1;if(!this.options.textFilter.text)return!0;const n=yS._messageFilter(this.options.textFilter.text,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)||yS._messageFilter(this.options.textFilter.text,e.comment.userName)||e.replies.map(r=>yS._messageFilter(this.options.textFilter.text,r.comment.userName)||yS._messageFilter(this.options.textFilter.text,typeof r.comment.body=="string"?r.comment.body:r.comment.body.value)).filter(r=>!!r).flat();return n.length&&!this.options.textFilter.negate?{visibility:!0,data:{type:kie.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 iDe=class extends N3{constructor(e,t,i,n,r,o,a,c,l){const d=new Zxe,h=GN.bind(void 0,o),u=o.createInstance(eDe);u.setContextKeyService(n);const f=[o.createInstance(CYt,e),o.createInstance(tDe,h,u)];super("CommentsTree",t,d,f,{accessibilityProvider:i.accessibilityProvider,identityProvider:{getId:p=>p instanceof mle?"root":p instanceof sp?`${p.uniqueOwner}-${p.id}`:p instanceof ty?`${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},o,n,r,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 ty))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:r=>{const o=this.keybindingService.lookupKeybinding(r.id);if(o)return new tC(r,r,{label:!0,keybinding:o.getLabel()})},onHide:r=>{r&&this.domFocus()},getActionsContext:()=>({commentControlHandle:t.controllerHandle,commentThreadHandle:t.threadHandle,$mid:ys.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}};iDe=D([_(3,Le),_(4,ug),_(5,we),_(6,Te),_(7,lo),_(8,Vt)],iDe);const zPe=new Q("commentsFilterFocus",!1),Crt=new Q("commentsView.showResolvedFilter",!0),Srt=new Q("commentsView.showUnResolvedFilter",!0);class AYt extends V{constructor(e,t){super(),this.contextKeyService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._showUnresolved=Srt.bindTo(this.contextKeyService),this._showResolved=Crt.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}))}}Et(class extends _G{constructor(){super({id:"commentsFocusViewFromFilter",title:g(9994,"Focus Comments view"),keybinding:{when:zPe,weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.DownArrow},viewId:Jl})}async runInView(s,e){e.focus()}});Et(class extends _G{constructor(){super({id:"commentsClearFilterText",title:g(9995,"Clear filter text"),keybinding:{when:zPe,weight:Ae.WorkbenchContrib,primary:S.Escape},viewId:Jl})}async runInView(s,e){e.clearFilterText()}});Et(class extends _G{constructor(){super({id:"commentsFocusFilter",title:g(9996,"Focus comments filter"),keybinding:{when:$U.isEqualTo(Jl),weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.KeyF},viewId:Jl})}async runInView(s,e){e.focusFilter()}});Et(class extends _G{constructor(){super({id:`workbench.actions.${Jl}.toggleUnResolvedComments`,title:g(9997,"Show Unresolved"),category:g(9998,"Comments"),toggled:{condition:Srt,title:g(9999,"Show Unresolved")},menu:{id:jce,group:"1_filter",when:he.equals("view",Jl),order:1},viewId:Jl})}async runInView(s,e){e.filters.showUnresolved=!e.filters.showUnresolved}});Et(class extends _G{constructor(){super({id:`workbench.actions.${Jl}.toggleResolvedComments`,title:g(1e4,"Show Resolved"),category:g(9998,"Comments"),toggled:{condition:Crt,title:g(10001,"Show Resolved")},menu:{id:jce,group:"1_filter",when:he.equals("view",Jl),order:1},viewId:Jl})}async runInView(s,e){e.filters.showResolved=!e.filters.showResolved}});var EYt=".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}";gt(EYt,{});const xYt=W("editorGutter.commentRangeForeground",{dark:hBe(hme,Uc),light:vp(hBe(hme,Uc),.05),hcDark:me.white,hcLight:me.black},g(10014,"Editor gutter decoration color for commenting ranges. This color should be opaque.")),Art=W("editorOverviewRuler.commentForeground",xYt,g(10015,"Editor overview ruler decoration color for resolved comments. This color should be opaque.")),DYt=W("editorOverviewRuler.commentUnresolvedForeground",Art,g(10016,"Editor overview ruler decoration color for unresolved comments. This color should be opaque.")),kYt=W("editorGutter.commentGlyphForeground",{dark:Pl,light:Pl,hcDark:me.black,hcLight:me.white},g(10017,"Editor gutter decoration color for commenting glyphs."));W("editorGutter.commentUnresolvedGlyphForeground",kYt,g(10018,"Editor gutter decoration color for commenting glyphs for unresolved comment threads."));const moe=class moe{constructor(e,t){this._commentsOptions=this.createDecorationOptions(),this._editor=e,this._commentsDecorations=this._editor.createDecorationsCollection(),this.setLineNumber(t)}createDecorationOptions(){const e=this._threadState===cu.Unresolved,t={description:moe.description,isWholeLine:!0,overviewRuler:{color:$r(e?DYt:Art),position:Tl.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:[ts.EXACT]}}dispose(){this._commentsDecorations.clear()}};moe.description="comment-glyph-widget";let W$=moe;class H${constructor(e,t,i,n,r){this.keybindingService=e,this.contextKeyService=t,this.container=i,this.actionHandler=n,this.maxActions=r,this._buttonElements=[],this._toDispose=new Z,this._actions=[]}setActions(e,t=!1){this._toDispose.clear(),this._buttonElements.forEach(r=>r.remove()),this._buttonElements=[];const i=e.getActions({shouldForwardArgs:!0});let n=!t;for(const r of i){const[,o]=r;this._actions=o;for(const a of o){let c=this.keybindingService.lookupKeybinding(a.id,this.contextKeyService)?.getLabel();!c&&n&&(c=this.keybindingService.lookupKeybinding(XC.Submit,this.contextKeyService)?.getLabel());const l=c?`${a.label} (${c})`:a.label,d=new Zd(this.container,{secondary:!n,title:l,...M6});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 IYt=0;const TYt="commenteditordecoration";let nDe=class extends V{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b){super(),this.owner=e,this._parentEditor=i,this._commentThread=n,this._scopedInstatiationService=r,this._contextKeyService=o,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=q5,this.form=oe(t,fe(".comment-form")),this.commentEditor=this._register(this._scopedInstatiationService.createInstance(LW,this.form,LW.getEditorOptions(p),o,this._parentThread)),this.commentEditorIsEmpty=I_.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=ao()+"-"+(t?this._commentThread.threadId:++IYt),n=JSON.stringify({extensionId:this._commentThread.extensionId,commentThreadId:this._commentThread.threadId});let r=N.from({scheme:pe.commentsInput,path:`/${this._commentThread.extensionId}/commentinput-${i}.md?${n}`});const o=this.commentService.getCommentController(this.owner);o&&(r=r.with({authority:o.id}));const a=await this.textModelService.createModelReference(r);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=oe(this.form,fe(".validation-error.hidden"));const c=oe(this.form,fe(".form-actions"));this._formActions=oe(c,fe(".other-actions")),this.createCommentWidgetFormActions(this._formActions,a.object.textEditorModel),this._editorActions=oe(c,fe(".editor-actions")),this.createCommentWidgetEditorActions(this._editorActions,a.object.textEditorModel)}calculateEditorHeight(){const e=wtt(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,r=e.getModel();n.input&&r&&n.input.uri!==r.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 H$(this.keybindingService,this._contextKeyService,e,async n=>{await this._actionRunDelegate?.(),await n.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:ys.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 H$(this.keybindingService,this._contextKeyService,e,async n=>{this._actionRunDelegate?.(),n.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:ys.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=oe(t,fe(`button.review-thread-reply-button.${nA}`)),this._register(this.hoverService.setupManagedHover(Fo("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(),wt(this._commentThreadDisposables)}};nDe=D([_(12,rE),_(13,Te),_(14,Vt),_(15,tc),_(16,pn)],nDe);const _oe=class _oe extends an{constructor(e,t){super(_oe.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}};_oe.ID="toolbar.toggle.pickReactions";let l1=_oe;class LYt extends tC{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=oe(this.label,fe(".reaction-icon")),i=N.revive(e.icon);t.style.backgroundImage=ig(i)}else{const t=oe(this.label,fe("span.reaction-label"));t.innerText=e.label}if(e.count){const t=oe(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 voe=class voe extends an{constructor(e,t="",i="",n=!0,r,o,a,c){super(voe.ID,t,i,n,r),this.reactors=o,this.icon=a,this.count=c}};voe.ID="toolbar.toggle.reaction";let sDe=voe;class m3e extends q_{async runAction(e,t){await e.run(...t)}}let rDe=class extends V{get domNode(){return this._domNode}constructor(e,t,i,n,r,o,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=r,this.resource=o,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=q5,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=I_.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=oe(this._domNode,fe("div.avatar-container")),this.updateCommentUserIcon(this.comment.userIconPath),this._commentDetailsContainer=oe(this._domNode,fe(".review-comment-contents")),this.createHeader(this._commentDetailsContainer),this._body=document.createElement("div"),this._body.classList.add("comment-body",nA),p.getValue(ple)?.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 DN({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>Nl(lt(e),n)}),this._scrollableElement=this._register(new y6(t,{horizontal:Cr.Visible,vertical:Cr.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 ni(t,"scroll")).event;this._register(i(n=>{const r=this._scrollableElement.getScrollPosition(),o=Math.abs(t.scrollLeft-r.scrollLeft)<=1?void 0:t.scrollLeft,a=Math.abs(t.scrollTop-r.scrollTop)<=1?void 0:t.scrollTop;(o!==void 0||a!==void 0)&&this._scrollableElement.setScrollPosition({scrollLeft:o,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=oe(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=oe(this._avatar,fe("img.avatar"));t.src=sf.uriToBrowserUri(N.revive(e)).toString(!0),t.onerror=i=>t.remove()}}get onDidClick(){return this._onDidClick.event}createTimestamp(e){this._timestamp=oe(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 jxe(this.configurationService,this.hoverService,this._timestamp,t),this._register(this._timestampWidget)):this._timestampWidget?.dispose()}createHeader(e){const t=oe(e,fe(`div.comment-title.${nA}`)),i=oe(t,fe("comment-header-info")),n=oe(i,fe("strong.author"));n.innerText=this.comment.userName,this.createTimestamp(i),this._isPendingLabel=oe(i,fe("span.isPending")),this.comment.label?this._isPendingLabel.innerText=this.comment.label:this._isPendingLabel.innerText="",this._actionsToolbarContainer=oe(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}),r={primary:[],secondary:[]};return RYt(t,r,!1,o=>/^inline/.test(o)),r}get commentNodeContext(){return[{thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,$mid:ys.CommentNode},{commentControlHandle:this.commentThread.controllerHandle,commentThreadHandle:this.commentThread.commentThreadHandle,$mid:ys.CommentThread}]}createToolbar(){this.toolbar=new dXe(this._actionsToolbarContainer,this.contextMenuService,{actionViewItemProvider:(e,t)=>e.id===l1.ID?new cA(e,e.menuActions,this.contextMenuService,{...t,actionViewItemProvider:(i,n)=>this.actionViewItemProvider(i,n),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...He.asClassNameArray(ve.reactions)],anchorAlignmentProvider:()=>Cb.RIGHT}):this.actionViewItemProvider(e,t),orientation:W_.HORIZONTAL}),this.toolbar.context=this.commentNodeContext,this.toolbar.actionRunner=new m3e,this.registerActionBarListeners(this._actionsToolbarContainer),this._register(this.toolbar)}createActionsToolbar(){const e=[];if(this.commentService.hasReactionHandler(this.owner)){const o=this.createReactionPicker(this.comment.commentReactions||[]);e.push(o)}const i=this._commentMenus.getCommentTitleActions(this.comment,this._contextKeyService);this._register(i),this._register(i.onDidChange(o=>{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:r}=this.getToolbarActions(i);e.push(...n),(e.length||r.length)&&(this.createToolbar(),this.toolbar.setActions(e,r))}actionViewItemProvider(e,t){return e.id===l1.ID?t={label:!1,icon:!0}:t={label:!1,icon:!0},e.id===sDe.ID?new LYt(e):e instanceof Ac?this.instantiationService.createInstance(Pb,e,{hoverDelegate:t.hoverDelegate}):e instanceof Ny?this.instantiationService.createInstance(E3,e,t):new tC({},e,t)}async submitComment(){this._commentEditor&&this._commentFormActions&&(await this._commentFormActions.triggerDefaultAction(),this.pendingEdit=void 0)}createReactionPicker(e){const t=this._register(new l1(()=>{n?.show()},g(11540,"Toggle Reaction")));let i=[];e&&e.length&&(i=e.map(r=>new an(`reaction.command.${r.label}`,`${r.label}`,"",!0,async()=>{try{await this.commentService.toggleReaction(this.owner,this.resource,this.commentThread,this.comment,r)}catch(o){const a=o.message?g(11541,"Toggling the comment reaction failed: {0}.",o.message):g(11542,"Toggling the comment reaction failed");this.notificationService.error(a)}}))),t.menuActions=i;const n=new cA(t,t.menuActions,this.contextMenuService,{actionViewItemProvider:(r,o)=>r.id===l1.ID?n:this.actionViewItemProvider(r,o),actionRunner:this.actionRunner,classNames:"toolbar-toggle-pickReactions",anchorAlignmentProvider:()=>Cb.RIGHT});return t}createReactionsContainer(e){if(this._reactionActionsContainer=oe(e,fe("div.comment-reactions")),this._reactionsActionBar=new gd(this._reactionActionsContainer,{actionViewItemProvider:(i,n)=>i.id===l1.ID?new cA(i,i.menuActions,this.contextMenuService,{actionViewItemProvider:(r,o)=>this.actionViewItemProvider(r,o),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...He.asClassNameArray(ve.reactions)],anchorAlignmentProvider:()=>Cb.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=oe(e,fe(".edit-textarea"));this._commentEditor=this.instantiationService.createInstance(LW,t,LW.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(),Nl(lt(e),()=>{this._commentEditor.layout({width:t.clientWidth-14,height:this._editorHeight}),this._commentEditor.focus()});const r=this._commentEditorModel.object.textEditorModel.getLineCount(),o=this._commentEditorModel.object.textEditorModel.getLineLength(r)+1;this._commentEditor.setSelection(new ht(r,o,r,o));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=wtt(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(),wt(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=a5(this._body),r=this._body.scrollHeight,o=PTe(this._body)+4;this._scrollableElement.setScrollDimensions({width:n,scrollWidth:i,height:o,scrollHeight:r})}async switchToEditMode(){if(this.isEditing)return;this.isEditing=!0,this._body.classList.add("hidden"),this._commentEditContainer=oe(this._commentDetailsContainer,fe(".edit-container")),await this.createCommentEditor(this._commentEditContainer);const e=oe(this._commentEditContainer,fe(".form-actions")),t=oe(e,fe(".other-actions"));this.createCommentWidgetFormActions(t);const i=oe(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 H$(this.keybindingService,this._contextKeyService,e,n=>{const r=this._commentEditor.getValue();n.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:r,$mid:ys.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 H$(this.keybindingService,this._contextKeyService,e,n=>{const r=this._commentEditor.getValue();n.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:r,$mid:ys.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===O2.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===O2.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 Dh(lt(this._domNode),e);this.contextMenuService.showContextMenu({getAnchor:()=>t,menuId:_e.CommentThreadCommentContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:this._contextKeyService,actionRunner:new m3e,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(),wt(this._commentEditorDisposables)}};rDe=D([_(8,we),_(9,rE),_(10,wi),_(11,lo),_(12,Le),_(13,Te),_(14,tc),_(15,_o),_(16,Vt),_(17,pn)],rDe);function RYt(s,e,t,i=n=>n==="navigation"){for(const n of s){let[r,o]=n;if(i(r))(Array.isArray(e)?e:e.primary).unshift(...o);else{const a=Array.isArray(e)?e:e.secondary;a.length>0&&a.push(new Eo),a.push(...o)}}}let oDe=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,r,o,a,c,l,d,h,u){super(),this._parentEditor=e,this.owner=t,this.parentResourceUri=i,this.container=n,this._options=r,this._commentThread=o,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 mr,this._register(ue(n,ke.FOCUS_IN,f=>{this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._markdownRenderer=this._register(new Z_(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=oe(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 xn(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 r=this._focusedComment+n;return Math.min(Math.max(0,r),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===O2.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=K_(this.container);this._onDidResize.fire(e)}getDimensions(){return K_(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=So(this._commentElements[0].domNode),n=So(t[0].domNode);return{thread:i,comment:n}}}async updateCommentThread(e,t){const i=this._commentElements.length,n=e.comments?e.comments.length:0,r=[],o=[];for(let d=0;df.uniqueIdInThread===h.uniqueIdInThread):[];u.length?this._commentElements[d].update(u[0]):(o.push(d),r.push(this._commentElements[d]))}for(let d=r.length-1;d>=0;d--){const h=r[d];this._commentDisposable.deleteAndDispose(h),this._commentElements.splice(o[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===O2.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(rDe,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(r=>r.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()}};oDe=D([_(9,rE),_(10,Ar),_(11,Di)],oDe);const MYt=oi("review-comment-collapse",ve.chevronUp,g(11504,"Icon to collapse a review comment.")),NYt="expand-review-action "+He.asClassName(MYt);class PYt extends V{constructor(e,t,i,n,r,o,a){super(),this._delegate=t,this._commentMenus=i,this._commentThread=n,this._contextKeyService=r,this.instantiationService=o,this._contextMenuService=a,this._headElement=fe(".head"),e.appendChild(this._headElement),this._register(Ee(()=>this._headElement.remove())),this._fillHead()}_fillHead(){const e=oe(this._headElement,fe(".review-title"));this._headingLabel=oe(e,fe("span.filename")),this.createThreadLabel();const t=oe(this._headElement,fe(".review-actions"));this._actionbarWidget=new gd(t,{actionViewItemProvider:GN.bind(void 0,this.instantiationService)}),this._register(this._actionbarWidget),this._collapseAction=new an("review.expand",g(11505,"Collapse"),NYt,!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=wT(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 Dh(lt(this._headElement),e);this._contextMenuService.showContextMenu({getAnchor:()=>i,getActions:()=>t,actionRunner:new q_,getActionsContext:()=>({commentControlHandle:this._commentThread.controllerHandle,commentThreadHandle:this._commentThread.commentThreadHandle,$mid:ys.CommentThread})})}}let aDe=class extends V{constructor(e,t,i,n,r,o){super(),this._commentThread=t,this._contextKeyService=i,this._commentMenus=n,this._actionRunDelegate=r,this._keybindingService=o,this._container=oe(e,fe(".comment-additional-actions")),oe(this._container,fe(".section-separator")),this._buttonBar=oe(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 r of n){if(r.enabled){this._showMenu();return}for(const o of r.actions??[])if(o.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 H$(this._keybindingService,this._contextKeyService,e,async i=>{this._actionRunDelegate?.(),i.run({thread:this._commentThread,$mid:ys.CommentThreadInstance})},4),this._register(this._commentFormActions),this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)}};aDe=D([_(5,Vt)],aDe);var Cj;function FYt(s,e,t){const i=new Set;return Yo(...s.map((n,r)=>Yo(n.onDidFocus(()=>{t?.(r,"focus"),i.size||e(!0),i.add(r)}),n.onDidBlur(()=>{t?.(r,"blur"),i.delete(r),i.size||e(!1)}))))}const $Pe=new Q("navigableContainerFocused",!1);var aM;let wN=(aM=class{constructor(e,t,i){this.logService=t,this.configurationService=i,this.containers=new Set,this.focused=$Pe.bindTo(e),Cj.INSTANCE=this}dispose(){this.containers.clear(),this.focused.reset(),Cj.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),Yo(FYt(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}},Cj=aM,aM.ID="workbench.contrib.navigableContainerManager",aM);wN=Cj=D([_(0,Le),_(1,Ke),_(2,Te)],wN);function Ert(s){return wN.register(s)}Ju(wN.ID,wN,Cc.BlockStartup);Sr.registerCommandAndKeybindingRule({id:"widgetNavigation.focusPrevious",weight:Ae.WorkbenchContrib,when:he.and($Pe,he.or(zae?.negate(),Ykt)),primary:U.CtrlCmd|S.UpArrow,handler:()=>{wN.getActive()?.focusPreviousWidget()}});Sr.registerCommandAndKeybindingRule({id:"widgetNavigation.focusNext",weight:Ae.WorkbenchContrib,when:he.and($Pe,he.or(zae?.negate(),Jkt)),primary:U.CtrlCmd|S.DownArrow,handler:()=>{wN.getActive()?.focusNextWidget()}});let cDe=class extends V{get commentThread(){return this._commentThread}constructor(e,t,i,n,r,o,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=r,this._scopedInstantiationService=o,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=I_.commentThreadIsEmpty.bindTo(this._contextKeyService),this._threadIsEmpty.set(!a.comments||!a.comments.length),this._focusedContextKey=I_.commentFocused.bindTo(this._contextKeyService),this._commentMenus=this.commentService.getCommentMenus(this._owner),this._register(this._header=new PYt(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(Ec(b));this._register(Ert({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(bo.Comments)&&this._setAriaLabel()})),this._body=this._scopedInstantiationService.createInstance(oDe,this._parentEditor,this._owner,this._parentResourceUri,b,this._markdownOptions,this._commentThread,this._pendingEdits,this._scopedInstantiationService,this),this._register(this._body),this._setAriaLabel(),this._styleElement=fl(this.container),this._commentThreadContextValue=I_.commentThreadContext.bindTo(this._contextKeyService),this._commentThreadContextValue.set(a.contextValue);const y=I_.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(bo.Comments)&&(t=this._keybindingService.lookupKeybinding(eh.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===Rc.Expanded&&this._commentThreadState===cu.Unresolved&&e.state===cu.Resolved;this._commentThreadState=e.state,this._commentThread=e,wt(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(ple).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(),wt(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(nDe,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(aDe,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(${brt}) }`),i.push(`.monaco-editor .review-widget > .head { background-color: var(${wrt}) }`);const n=e.getColor(iLe);n&&i.push(`.review-widget .body .comment-body a { color: ${n} }`);const r=e.getColor(Spt);r&&i.push(`.review-widget .body .comment-body a:hover, a:active { color: ${r} }`);const o=e.getColor(bp);o&&(i.push(`.review-widget .body .comment-body a:focus { outline: 1px solid ${o}; }`),i.push(`.review-widget .body .monaco-editor.focused { outline: 1px solid ${o}; }`));const a=e.getColor(Apt);a&&i.push(`.review-widget .body .review-comment blockquote { background: ${a}; }`);const c=e.getColor(Ept);c&&i.push(`.review-widget .body .review-comment blockquote { border-color: ${c}; }`);const l=e.getColor(bMe);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(yt);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(DQe);h&&i.push(`.review-widget .validation-error { border: 1px solid ${h}; }`);const u=e.getColor(EQe);u&&i.push(`.review-widget .validation-error { background: ${u}; }`);const f=e.getColor(xQe);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(` @@ -945,12 +945,12 @@ ${t.body}`,i[0].setPendingComment(r)}else if(!t.isReply){if(!this.commentService `,o):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),r=this.getRepliesAsString(e,t);return e.range?e.threadRelevance===sD.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,vi(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+r:i+g(5335,"{0} at line {1} column {2} in {3},{4} comment: {5}",e.comment.userName,e.range.startLineNumber,e.range.startColumn,vi(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+r:e.threadRelevance===sD.Outdated?i+g(5336,"Outdated from {0} in {1},{2} comment: {3}",e.comment.userName,vi(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+r:i+g(5337,"{0} in {1},{2} comment: {3}",e.comment.userName,vi(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+r}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(KA,this)),this.tree=this._register(this.instantiationService.createInstance(iDe,this.treeLabels,this.treeContainer,{overrideStyles:this.getLocationBasedColors().listOverrideStyles,selectionNavigation:!0,filter:this.filter,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:e=>{}},accessibilityProvider:{getAriaLabel:e=>e instanceof mle?g(5340,"Comments for current workspace"):e instanceof sp?g(5341,"Comments in {0}, full path {1}",vi(e.resource),e.resource.fsPath):e instanceof ty?this.getScreenReaderInfoForNode(e,!0):"",getWidgetAriaLabel(){return Xxe.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 sp||e instanceof ty))return;const r=e instanceof sp?e.commentThreads[0].thread:e.thread,o=e instanceof sp?e.commentThreads[0].comment:void 0;return xrt(this.commentService,this.editorService,this.uriIdentityService,r,o,!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,b3e(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}};hDe=D([_(1,we),_(2,Im),_(3,ti),_(4,Te),_(5,Le),_(6,lo),_(7,Vt),_(8,Ar),_(9,mn),_(10,rE),_(11,Ji),_(12,tc),_(13,Is),_(14,Gi)],hDe);const $Yt=new _e("Views");Yn.appendMenuItem(_e.ViewContainerTitle,{submenu:$Yt,title:g(5295,"Views"),order:1});var gh;(function(s){s[s.UP=0]="UP",s[s.DOWN=1]="DOWN",s[s.LEFT=2]="LEFT",s[s.RIGHT=3]="RIGHT"})(gh||(gh={}));const boe=class boe extends CLe{get currentDropOperation(){return this._currentDropOperation}constructor(e,t,i,n,r){super(r),this.paneElement=e,this.orientation=t,this.bounds=i,this.location=n,this.cleanupOverlayScheduler=this._register(new ln(()=>this.dispose(),300)),this.create()}get disposed(){return!!this._disposed}create(){this.container=document.createElement("div"),this.container.id=boe.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===io.Panel?VXe:KXe)||"";const e=this.getColor(Xs);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 nY(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,r=i/2,o=n/2;let a;switch(this.orientation===pi.VERTICAL?t=o&&(a=gh.DOWN):this.orientation===pi.HORIZONTAL&&(e=r&&(a=gh.RIGHT)),a){case gh.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"});break;case gh.DOWN:this.doPositionOverlay({bottom:"0",left:"0",width:"100%",height:"50%"});break;case gh.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"});break;case gh.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===pi.VERTICAL&&n<=25||this.orientation===pi.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===gh.UP?"2px":"0px",this.overlay.style.borderLeftWidth=e===gh.LEFT?"2px":"0px",this.overlay.style.borderBottomWidth=e===gh.DOWN?"2px":"0px",this.overlay.style.borderRightWidth=e===gh.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}};boe.OVERLAY_ID="monaco-pane-drop-overlay";let BF=boe,uDe=class extends XZ{constructor(e,t,i,n,r){const o=n.createScoped(e);o.createKey("viewContainer",t.id);const a=o.createKey("viewContainerLocation",QX(i.getViewContainerLocation(t)));super(_e.ViewContainerTitle,_e.ViewContainerTitleContext,{shouldForwardArgs:!0,renderShortTitle:!0},o,r),this._register(o),this._register(M.filter(i.onDidChangeContainerLocation,c=>c.viewContainer===t)(()=>a.set(QX(i.getViewContainerLocation(t)))))}};uDe=D([_(2,Im),_(3,Le),_(4,Ba)],uDe);let gDe=class extends vnt{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,r,o,a,c,l,d,h,u){super(e,l,d),this.options=t,this.instantiationService=i,this.configurationService=n,this.layoutService=r,this.contextMenuService=o,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 m8t(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 Dh(lt(e),c)))),this._register(md.addTarget(e)),this._register(ue(e,ur.Contextmenu,c=>this.showContextMenu(new Dh(lt(e),c)))),this._menuActions=this._register(this.instantiationService.createInstance(uDe,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===pi.VERTICAL?l.bottom:c.top,h=this.orientation===pi.HORIZONTAL?l.right:c.left;return{top:d,bottom:c.bottom,left:h,right:c.right}},r=(c,l)=>l.x>=c.left&&l.x<=c.right&&l.y>=c.top&&l.y<=c.bottom;let o;this._register(_S.INSTANCE.registerTarget(e,{onDragEnter:c=>{if(o=n(),i&&i.disposed&&(i=void 0),!i&&r(o,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 BF(e,void 0,o,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 BF(e,void 0,o,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:c=>{i&&i.disposed&&(i=void 0),i&&!r(o,c.eventData)&&(i.dispose(),i=void 0),r(o,c.eventData)&&l5e(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(em.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(yc(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):GN(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 io.Sidebar:case io.AuxiliaryBar:return pi.VERTICAL;case io.Panel:return _3t(this.layoutService.getPanelPosition())?pi.HORIZONTAL:pi.VERTICAL}return pi.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:r,disposable:o}of e)this.addPane(i,n,o,r);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===pi.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,cn.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:r,index:o,size:a}of e){const c=this.createView(n,{id:n.id,title:n.name.value,fromExtensionId:n.extensionId,expanded:!r,singleViewPaneContainerTitle:n.singleViewPaneContainerTitle});c.render();const l=ue(c.draggableElement,"contextmenu",h=>{h.stopPropagation(),h.preventDefault(),this.onContextMenu(new Dh(lt(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:o,disposable:Yo(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 r=e.onDidFocus(()=>{this._onDidFocusView.fire(e),this.lastFocusedPane=e}),o=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)===io.Panel;e.style({headerForeground:$e(d?MLt:$Lt),headerBackground:$e(d?RLt:zLt),headerBorder:$e(d?NLt:qXe),dropBackground:$e(d?VXe:KXe),leftBorder:d?$e(PLt):void 0});const h=new Z;h.add(i),h.add(Yo(e,r,o,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(_S.INSTANCE.registerDraggable(e.draggableElement,()=>({type:"view",id:e.id}),{})),h.add(_S.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 BF(e.dropTargetElement,this.orientation??pi.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 BF(e.dropTargetElement,this.orientation??pi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:p=>{l5e(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===gh.DOWN||f.currentDropOperation===gh.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),r=this.viewContainerModel.visibleViewDescriptors[i],o=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(r.id,o.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;nr?(this.resizePane(t,o),this.resizePane(i,a)):(this.resizePane(i,a),this.resizePane(t,o))}}dispose(){super.dispose(),this.paneItems.forEach(e=>e.disposable.dispose()),this.paneview&&this.paneview.dispose()}};gDe=D([_(2,we),_(3,Te),_(4,NI),_(5,lo),_(6,Ji),_(7,ps),_(8,mn),_(9,Gi),_(10,Ci),_(11,Im)],gDe);class _le extends di{constructor(e,t){super(e),this.offset=t}async run(e){const t=e.get(Im),i=e.get(Le),n=$U.getValue(i);if(n===void 0)return;const r=t.getViewContainerByViewId(n),o=t.getViewContainerModel(r),a=o.visibleViewDescriptors.find(d=>d.id===n),c=o.visibleViewDescriptors.indexOf(a);if(c+this.offset<0||c+this.offset>=o.visibleViewDescriptors.length)return;const l=o.visibleViewDescriptors[c+this.offset];o.move(a.id,l.id)}}Et(class extends _le{constructor(){super({id:"views.moveViewUp",title:g(5296,"Move View Up"),keybinding:{primary:oo(U.CtrlCmd+S.KeyK,S.UpArrow),weight:Ae.WorkbenchContrib+1,when:$U.notEqualsTo("")}},-1)}});Et(class extends _le{constructor(){super({id:"views.moveViewLeft",title:g(5297,"Move View Left"),keybinding:{primary:oo(U.CtrlCmd+S.KeyK,S.LeftArrow),weight:Ae.WorkbenchContrib+1,when:$U.notEqualsTo("")}},-1)}});Et(class extends _le{constructor(){super({id:"views.moveViewDown",title:g(5298,"Move View Down"),keybinding:{primary:oo(U.CtrlCmd+S.KeyK,S.DownArrow),weight:Ae.WorkbenchContrib+1,when:$U.notEqualsTo("")}},1)}});Et(class extends _le{constructor(){super({id:"views.moveViewRight",title:g(5299,"Move View Right"),keybinding:{primary:oo(U.CtrlCmd+S.KeyK,S.RightArrow),weight:Ae.WorkbenchContrib+1,when:$U.notEqualsTo("")}},1)}});Et(class extends di{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(Im),n=i.getViewContainerById(t.destinationId);if(n){for(const r of t.viewIds){const o=i.getViewDescriptorById(r);o?.canMoveView&&i.moveViewsToContainer([o],n,Lwe.Default,this.desc.id)}await e.get(Nm).openViewContainer(n.id,!0)}}});class GYt{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,r,o,a,c,l,d){this.commentThreadHandle=e,this.controllerHandle=t,this.extensionId=i,this.threadId=n,this.resource=r,this._range=o,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:ys.CommentThread,commentControlHandle:this.controllerHandle,commentThreadHandle:this.commentThreadHandle}}}class KYt{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,r,o,a){this._proxy=e,this._commentService=t,this._handle=i,this._uniqueId=n,this._id=r,this._label=o,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,r,o,a,c){const l=new GYt(t,this.handle,e,i,N.revive(n).toString(),r,o,!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 r=this.getKnownThread(e);r.batchUpdate(n),r.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[],removed:[],changed:[r],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[],removed:[],changed:[r],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 r of[...this._threads.keys()]){const o=this._threads.get(r);o.resource===e.toString()&&o.isDocumentCommentThread()&&i.push(o)}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 r=this._threads.get(n);r.resource===e.toString()&&(r.isDocumentCommentThread()||i.push(r))}return{uniqueOwner:this._uniqueId,label:this.label,threads:i}}async toggleReaction(e,t,i,n,r){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:ys.CommentController,handle:this.handle}}}const w3e=oi("comments-view-icon",ve.commentDiscussion,g(4873,"View icon of the comments view."));let y3e=class extends V{constructor(e,t,i,n,r,o){super(),this._commentService=t,this._viewsService=i,this._viewDescriptorService=n,this._uriIdentityService=r,this._editorService=o,this._handlers=new Map,this._commentControllers=new Map,this._activeEditingCommentThreadDisposables=this._register(new Z),this._openViewListener=null,this._proxy=e.getProxy(Je.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 r=`${t}-${n}`;this._handlers.set(e,r);const o=new KYt(this._proxy,this._commentService,e,r,t,i,{});this._commentService.registerCommentController(r,o),this._commentControllers.set(e,o);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,r,o,a,c,l){const d=this._commentControllers.get(e);if(d)return d.createCommentThread(a.value,t,i,n,r,o,c,l)}$updateCommentThread(e,t,i,n,r){const o=this._commentControllers.get(e);if(o)return o.updateCommentThread(t,i,n,r)}$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 r=this._commentControllers.get(e);if(!r)return Promise.resolve();const o=r.getAllComments().find(c=>c.commentThreadHandle===t);if(!o||!o.isDocumentCommentThread())return Promise.resolve();const a=o.comments?.find(c=>c.uniqueIdInThread===i);xrt(this._commentService,this._editorService,this._uriIdentityService,o,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(r=>r.commentThreadHandle===t);if(!n||!n.isDocumentCommentThread())return Promise.resolve();n.collapsibleState=Rc.Collapsed}registerView(e){if(!e){const t=je.as(oI.ViewContainersRegistry).registerViewContainer({id:Jl,title:Xxe,ctorDescriptor:new yi(gDe,[Jl,{mergeViewWithContainerWhenSingleView:!0}]),storageId:yYt,hideIfEmpty:!0,icon:w3e,order:10},io.Panel);je.as(oI.ViewsRegistry).registerViews([{id:Jl,name:Xxe,canToggleVisibility:!1,ctorDescriptor:new yi(hDe),canMoveView:!0,containerIcon:w3e,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)}};y3e=D([Ki(We.MainThreadComments),_(1,rE),_(2,Nm),_(3,Im),_(4,Is),_(5,ti)],y3e);var Yx;(function(s){s[s.Output=1]="Output",s[s.OutputItems=2]="OutputItems",s[s.ExecutionState=3]="ExecutionState"})(Yx||(Yx={}));var lp;(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 r(f){return{mime:f.mime,data:f.valueBytes}}s.fromNotebookOutputItemDto=r;function o(f){return{outputId:f.outputId,metadata:f.metadata,outputs:f.items.map(r)}}s.fromNotebookOutputDto=o;function a(f){return{cellKind:f.cellKind,language:f.language,mime:f.mime,source:f.source,outputs:f.outputs.map(o),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===Yx.Output?{editType:f.editType,cellHandle:f.cellHandle,append:f.append,outputs:f.outputs.map(o)}:f.editType===Yx.OutputItems?{editType:f.editType,append:f.append,outputId:f.outputId,items:f.items.map(r)}:f}s.fromCellExecuteUpdateDto=d;function h(f){return f}s.fromCellExecuteCompleteDto=h;function u(f){return f.editType===mI.Replace?{editType:f.editType,index:f.index,count:f.count,cells:f.cells.map(a)}:f}s.fromCellEditOperationDto=u})(lp||(lp={}));let C3e=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(Je.ExtHostNotebook)}dispose(){this._disposables.dispose(),wt(this._notebookSerializer.values())}$registerNotebookSerializer(e,t,i,n,r){const o=new Z;o.add(this._notebookService.registerNotebookSerializer(i,t,{options:n,dataToNotebook:async a=>{const c=new Ys;let l;if(a.byteLength===0&&i==="interactive")l=lp.fromNotebookDataDto({cells:[],metadata:{}});else{const d=await this._proxy.$dataToNotebook(e,a,Ue.None);l=lp.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 Ys,l=this._proxy.$notebookToData(e,new Jd(lp.toNotebookDataDto(a)),Ue.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=Oi([{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=>Mr(y))})),limitHit:m.limitHit}}})),r&&o.add(this._notebookService.registerContributedNotebookType(i,r)),this._notebookSerializer.set(e,o),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,r={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),r.onDidChangeStatusBarItems=a.event}const o=this._cellStatusBarService.registerCellStatusBarItemProvider(r);this._notebookCellStatusBarRegistrations.set(e,o)}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)}};C3e=D([Ki(We.MainThreadNotebook),_(1,oE),_(2,nZe),_(3,Ke)],C3e);vt.registerCommand("_executeDataToNotebook",async(s,...e)=>{const[t,i]=e;Lt(typeof t=="string","string"),Lt(i instanceof Ge,"VSBuffer");const r=await s.get(oE).withNotebookDataProvider(t);if(!(r instanceof SG))return;const o=await r.serializer.dataToNotebook(i);return new Jd(lp.toNotebookDataDto(o))});vt.registerCommand("_executeNotebookToData",async(s,...e)=>{const[t,i]=e;Lt(typeof t=="string","string"),Lt(typeof i=="object");const r=await s.get(oE).withNotebookDataProvider(t);if(!(r instanceof SG))return;const o=lp.fromNotebookDataDto(i.value);return await r.serializer.notebookToData(o)});var fDe;(function(s){s[s.cell=0]="cell",s[s.notebook=1]="notebook"})(fDe||(fDe={}));class qYt{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=tr(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=tr(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 QYt{constructor(e){this.notebookType=e}}let S3e=class{constructor(e,t,i,n,r,o){this._languageService=t,this._notebookKernelService=i,this._notebookExecutionStateService=n,this._notebookService=r,this._editors=new mr,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(Je.ExtHostNotebookKernels),o.listNotebookEditors().forEach(this._onEditorAdd,this),o.onDidAddNotebookEditor(this._onEditorAdd,this,this._disposables),o.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===fDe.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[r,o]of this._kernels)if(o[0]===n){this._proxy.$acceptKernelMessageFromRenderer(r,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[r]=n;let o=!1;for(const[a]of this._editors)if(a.hasModel()&&this._notebookKernelService.getMatchingKernel(a.textModel).selected===r){if(t===void 0)a.postMessage(i),o=!0;else if(a.getId()===t){a.postMessage(i),o=!0;break}}return o}$receiveVariable(e,t){const i=this.variableRequestMap.get(e);i&&i.emitOne(t)}async $addKernel(e,t){const i=this,n=new class extends qYt{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 V2;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),r=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)}),o=this._notebookKernelService.registerKernel(n);this._kernels.set(e,[n,Yo(r,o)])}$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 r=N.revive(i),o=this._notebookService.getNotebookTextModel(r);if(!o)throw new Error(`Notebook not found: ${r.toString()}`);const a=this._notebookKernelService.getMatchingKernel(o);if(!a.selected||a.selected.id!==t)throw new Error(`Kernel is not selected: ${a.selected?.id} !== ${t}`);const c=this._notebookExecutionStateService.createCellExecution(r,n);c.confirm(),this._executions.set(e,c)}$updateExecution(e,t){const i=t.value;try{this._executions.get(e)?.update(i.map(lp.fromCellExecuteUpdateDto))}catch(n){bt(n)}}$completeExecution(e,t){try{this._executions.get(e)?.complete(lp.fromCellExecuteCompleteDto(t.value))}catch(i){bt(i)}finally{this._executions.delete(e)}}$createNotebookExecution(e,t,i){const n=N.revive(i),r=this._notebookService.getNotebookTextModel(n);if(!r)throw new Error(`Notebook not found: ${n.toString()}`);const o=this._notebookKernelService.getMatchingKernel(r);if(!o.selected||o.selected.id!==t)throw new Error(`Kernel is not selected: ${o.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){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 QYt(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,Ue.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 o=new I;this._kernelSourceActionProvidersEventRegistrations.set(t,o),n.onDidChangeSourceActions=o.event}const r=this._notebookKernelService.registerKernelSourceActionProvider(i,n);this._kernelSourceActionProviders.set(e,[n,r])}$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))}};S3e=D([Ki(We.MainThreadNotebookKernels),_(1,Di),_(2,rZe),_(3,sZe),_(4,oE),_(5,$6)],S3e);let pDe=class{constructor(e,t,i){this._notebookEditorModelResolverService=t,this._uriIdentityService=i,this._disposables=new Z,this._documentEventListenersMapping=new gi,this._proxy=e.getProxy(Je.ExtHostNotebookDocuments),this._modelReferenceCollection=new srt(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(),wt(this._documentEventListenersMapping.values())}handleNotebooksAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeContent(n=>{const r={versionId:n.versionId,rawEvents:[]};for(const a of n.rawEvents)switch(a.kind){case Al.ModelChange:r.rawEvents.push({kind:a.kind,changes:a.changes.map(c=>[c[0],c[1],c[2].map(l=>lp.toNotebookCellDto(l))])});break;case Al.Move:r.rawEvents.push({kind:a.kind,index:a.index,length:a.length,newIdx:a.newIdx});break;case Al.Output:r.rawEvents.push({kind:a.kind,index:a.index,outputs:a.outputs.map(lp.toNotebookOutputDto)});break;case Al.OutputItem:r.rawEvents.push({kind:a.kind,index:a.index,outputId:a.outputId,outputItems:a.outputItems.map(lp.toNotebookOutputItemDto),append:a.append});break;case Al.ChangeCellLanguage:case Al.ChangeCellContent:case Al.ChangeCellMetadata:case Al.ChangeCellInternalMetadata:r.rawEvents.push(a);break}const o=n.rawEvents.find(a=>a.kind===Al.ChangeDocumentMetadata);this._proxy.$acceptModelChanged(t.uri,new Jd(r),this._notebookEditorModelResolverService.isDirty(t.uri),o?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=lp.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}};pDe=D([_(1,dce),_(2,Is)],pDe);class jYt{constructor(e,t){this.editor=e,this.disposables=t}dispose(){this.disposables.dispose()}}let mDe=class{constructor(e,t,i,n,r){this._editorService=t,this._notebookEditorService=i,this._editorGroupService=n,this._configurationService=r,this._disposables=new Z,this._mainThreadEditors=new Map,this._proxy=e.getProxy(Je.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(),wt(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 jYt(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=lB(t);i&&this._mainThreadEditors.has(i.getId())&&(e[i.getId()]=uI(this._editorGroupService,t.group))}Js(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?Jk.RESTORE:void 0,override:t},r=await this._editorService.openEditor({resource:N.revive(e),options:n},GZ(this._editorGroupService,this._configurationService,i.position)),o=lB(r);if(o)return o.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 r=n;if(!r.hasModel()||t.start>=r.getLength())return;const o=r.cellAt(t.start);switch(i){case MF.Default:return r.revealCellRangeInView(t);case MF.InCenter:return r.revealInCenter(o);case MF.InCenterIfOutsideViewport:return r.revealInCenterIfOutsideViewport(o);case MF.AtTop:return r.revealInViewAtTop(o)}}$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}))}};mDe=D([_(1,ti),_(2,$6),_(3,Pr),_(4,Te)],mDe);var Sj;class A3e{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=zoe(e.documents,t.documents),n=ffe(e.textEditors,t.textEditors),r=e.activeEditor!==t.activeEditor?t.activeEditor:void 0,o=ffe(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:r,visibleEditors:o.added.length===0&&o.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 E3e=Sj=class{constructor(e,t,i,n,r,o,a){this._notebookService=i,this._notebookEditorService=n,this._editorService=r,this._editorGroupService=o,this._logService=a,this._disposables=new Z,this._editorListeners=new mr,this._proxy=e.getProxy(Je.ExtHostNotebook),this._mainThreadNotebooks=t.createInstance(pDe,e),this._mainThreadEditors=t.createInstance(mDe,e),e.set(We.MainThreadNotebookDocuments,this._mainThreadNotebooks),e.set(We.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(),Yo(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=lB(this._editorService.activeEditorPane);let r=null;n?r=n.getId():e?.textModel&&(r=e.getId()),r&&!t.has(r)&&(this._logService.trace("MainThreadNotebooksAndEditors#_updateState: active editor is not in editors list",r,t.keys()),r=null);for(const a of this._editorService.visibleEditorPanes){const c=lB(a);c?.hasModel()&&t.has(c.getId())&&i.set(c.getId(),c)}const o=new A3e(new Set(this._notebookService.listNotebookDocuments()),t,r,i);this._onDelta(A3e.delta(this._currentState,o)),this._currentState=o}_onDelta(e){if(Sj._isDeltaEmpty(e))return;const t={removedDocuments:e.removedDocuments,removedEditors:e.removedEditors,newActiveEditor:e.newActiveEditor,visibleEditors:e.visibleEditors,addedDocuments:e.addedDocuments.map(Sj._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(lp.toNotebookCellDto)}}_asEditorAddData(e){const t=this._editorService.visibleEditorPanes.find(i=>lB(i)===e);return{id:e.getId(),documentUri:e.textModel.uri,selections:e.getSelections(),visibleRanges:e.visibleRanges,viewColumn:t&&uI(this._editorGroupService,t.group)}}};E3e=Sj=D([eP,_(1,we),_(2,oE),_(3,$6),_(4,ti),_(5,Pr),_(6,Ke)],E3e);let x3e=class extends V{constructor(e,t){super(),this.messaging=t,this.proxy=e.getProxy(Je.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)}};x3e=D([Ki(We.MainThreadNotebookRenderers),_(1,oZe)],x3e);var U$;(function(s){s[s.Save=1]="Save",s[s.Backup=2]="Backup"})(U$||(U$={}));var Aj,Wp;(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"})(Wp||(Wp={}));var cM;let D3e=(cM=class extends Die{get model(){return this._model}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v){super(t,o),this.typeId=e,this.name=i,this.modelFactory=n,this.externalResolver=r,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=hC.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 eqe,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,r=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=r}}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,r;try{const o=await this.fileService.stat(this.resource);t=o.mtime,i=o.ctime,n=o.size,r=o.etag,this.setOrphaned(!1)}catch(o){t=Date.now(),i=Date.now(),n=0,r=x_,this.setOrphaned(o.fileOperationResult===ji.FILE_NOT_FOUND)}return this.resolveFromContent({resource:this.resource,name:this.name,mtime:t,ctime:i,size:n,etag:r,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:x_,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=x_:this.lastResolvedFileStat&&(i=this.lastResolvedFileStat.etag);const n=this.versionId;try{const r=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(r,!1)}catch(r){const o=r.fileOperationResult;if(this.setOrphaned(o===ji.FILE_NOT_FOUND),this.isResolved()&&o===ji.FILE_NOT_MODIFIED_SINCE){r instanceof T5&&this.updateLastResolvedFileStat(r.stat);return}if(this.isResolved()&&o===ji.FILE_NOT_FOUND&&!t)return;throw r}}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,Ue.None)),this.installModelListeners(this._model)}async doUpdateModel(e){this.trace("doUpdateModel()"),this.ignoreDirtyOnModelContentChange=!0;try{await this.model?.update(e,Ue.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 $_(this.model.snapshot(U$.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(Wp.CONFLICT)||this.hasState(Wp.ERROR))&&(e.reason===Sn.AUTO||e.reason===Sn.FOCUS_CHANGE||e.reason===Sn.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(Wp.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Sn.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 li;return this.progressService.withProgress({title:g(10700,"Saving '{0}'",this.name),location:fd.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===Sn.AUTO&&typeof this.lastContentChangeFromUndoRedo=="number"){const a=Date.now()-this.lastContentChangeFromUndoRedo;a{try{const a={mtime:r.mtime,etag:t.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(r.resource)?x_:r.etag,unlock:t.writeUnlock};let c;if(typeof o.model.save=="function")try{c=await o.model.save(a,n.token)}catch(l){if(n.token.isCancellationRequested)return;throw l}else{const l=await $_(o.model.snapshot(U$.Save,n.token),n.token);if(n.token.isCancellationRequested)return;n.dispose(),t?.writeElevated&&this.elevatedFileService.isSupported(r.resource)?c=await this.elevatedFileService.writeFileElevated(r.resource,Qn(l),a):c=await this.fileService.writeFile(r.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===ji.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.doHandleSaveError(e,i),this._onDidSaveError.fire()}doHandleSaveError(e,t){const i=e,n=[];let r;if(i.fileOperationResult===ji.FILE_MODIFIED_SINCE)r=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(al({id:"fileWorkingCopy.overwrite",label:g(10703,"Overwrite"),run:()=>this.save({...t,ignoreModifiedSince:!0,reason:Sn.EXPLICIT})})),n.push(al({id:"fileWorkingCopy.revert",label:g(10704,"Discard"),run:()=>this.revert()}));else{const c=i.fileOperationResult===ji.FILE_WRITE_LOCKED,l=c&&i.options?.unlock,d=i.fileOperationResult===ji.FILE_PERMISSION_DENIED,h=this.elevatedFileService.isSupported(this.resource);UCt(e)&&n.push(...e.actions),h&&(d||l)?n.push(al({id:"fileWorkingCopy.saveElevated",label:l?jn?g(10705,"Overwrite as Admin..."):g(10706,"Overwrite as Sudo..."):jn?g(10707,"Retry as Admin..."):g(10708,"Retry as Sudo..."),run:()=>{this.save({...t,writeElevated:!0,writeUnlock:l,reason:Sn.EXPLICIT})}})):c?n.push(al({id:"fileWorkingCopy.unlock",label:g(10703,"Overwrite"),run:()=>this.save({...t,writeUnlock:!0,reason:Sn.EXPLICIT})})):n.push(al({id:"fileWorkingCopy.retry",label:g(10709,"Retry"),run:()=>this.save({...t,reason:Sn.EXPLICIT})})),n.push(al({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:Sn.EXPLICIT})).success||this.doHandleSaveError(e,t))}})),n.push(al({id:"fileWorkingCopy.revert",label:g(10704,"Discard"),run:()=>this.revert()})),c?l&&h?r=jn?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):r=g(10713,"Failed to save '{0}': File is read-only. Select 'Overwrite' to attempt to make it writeable.",this.name):h&&d?r=jn?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):r=g(10716,"Failed to save '{0}': {1}",this.name,Po(e,!1))}const o=this.notificationService.notify({id:`${Hc(this.resource.toString())}`,severity:Ze.Error,message:r,actions:{primary:n}}),a=this._register(M.once(M.any(this.onDidSave,this.onDidRevert))(()=>o.close()));this._register(M.once(o.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(r){if(r.fileOperationResult!==ji.FILE_NOT_FOUND)throw i(),r}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}hasState(e){switch(e){case Wp.CONFLICT:return this.inConflictMode;case Wp.DIRTY:return this.dirty;case Wp.ERROR:return this.inErrorMode;case Wp.ORPHAN:return this.isOrphaned();case Wp.PENDING_SAVE:return this.saveSequentializer.isRunning();case Wp.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()}},Aj=cM,cM.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,cM);D3e=Aj=D([_(5,Xt),_(6,Ke),_(7,qb),_(8,bd),_(9,X6),_(10,Pm),_(11,wi),_(12,OZe),_(13,ti),_(14,Q6),_(15,hg)],D3e);var XP;let k3e=XP=class extends BI{constructor(e,t,i,n,r,o){super(),this.resource=e,this._hasAssociatedFilePath=t,this.viewType=i,this._workingCopyManager=n,this._filesConfigurationService=o,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=r}dispose(){this._workingCopy?.dispose(),super.dispose()}get notebook(){return this._workingCopy?.model?.notebookModel}isResolved(){return!!this._workingCopy?.model?.notebookModel}async canDispose(){return this._workingCopy&&XP._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopyManager.stored.canDispose(this._workingCopy):!0}isDirty(){return this._workingCopy?.isDirty()??!1}isModified(){return this._workingCopy?.isModified()??!1}isOrphaned(){return XP._isStoredFileWorkingCopy(this._workingCopy)&&this._workingCopy.hasState(Wp.ORPHAN)}hasAssociatedFilePath(){return!XP._isStoredFileWorkingCopy(this._workingCopy)&&!!this._workingCopy?.hasAssociatedFilePath}isReadonly(){return XP._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopy?.isReadonly():this._filesConfigurationService.isReadonly(this.resource)}get hasErrorState(){return this._workingCopy&&"hasState"in this._workingCopy?this._workingCopy.hasState(Wp.ERROR):!1}revert(e){return Lt(this.isResolved()),this._workingCopy.revert(e)}save(e){return Lt(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}),Lt(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&hC.Untitled)}};k3e=XP=D([_(5,bd)],k3e);class Drt extends V{constructor(e,t,i,n,r){super(),this._notebookModel=e,this._notebookService=t,this._configurationService=i,this._telemetryService=n,this._logService=r,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!==Al.Initialize&&!c.transient){this._onDidChangeContent.fire({isRedoing:!1,isUndoing:!1,isInitial:!1});break}}));const o=this._configurationService.getValue(oEe.remoteSaving);(o||e.uri.scheme===pe.vscodeRemote)&&(this.configuration={backupDelay:1e4}),o&&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 Na;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:Mj(this._notebookModel.metadata,a=>!i.options.transientDocumentMetadata[a]),cells:[]};let r=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(oEe.outputBackupSizeLimit)*1024;if(e===U$.Backup&&l>0&&(a.outputs.forEach(d=>{d.outputs.forEach(h=>{r+=h.data.byteLength})}),r>l))throw new Error("Notebook too large to backup");c.outputs=i.options.transientOutputs?[]:a.outputs,c.metadata=Mj(a.metadata,d=>!i.options.transientCellMetadata[d]),n.cells.push(c)}const o=await i.notebookToData(n);if(t.isCancellationRequested)throw new Na;return g6(o)}async update(e,t){const i=await this.getNotebookSerializer(),n=await oD(e),r=await i.dataToNotebook(n);if(t.isCancellationRequested)throw new Na;this._notebookModel.reset(r.cells,r.metadata,i.options)}async getNotebookSerializer(){const e=await this._notebookService.withNotebookDataProvider(this.notebookModel.viewType);if(!(e instanceof SG))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,r){this._viewType=e,this._notebookService=t,this._configurationService=i,this._telemetryService=n,this._logService=r}async createModel(e,t,i){const n=await this._notebookService.withNotebookDataProvider(this._viewType);if(!(n instanceof SG))throw new Error("CANNOT open file notebook with this provider");const r=await oD(t),o=await n.serializer.dataToNotebook(r);if(i.isCancellationRequested)throw new Na;const a=this._notebookService.createNotebookTextModel(n.viewType,e,o,n.serializer.options);return new Drt(a,this._notebookService,this._configurationService,this._telemetryService,this._logService)}};I3e=D([_(1,oE),_(2,Te),_(3,Ji),_(4,Ke)],I3e);let YYt=class{constructor(e){this._proxy=e.getProxy(Je.ExtHostNotebookDocumentSaveParticipant)}async participate(e,t,i,n){if(!e.model||!(e.model instanceof Drt))return;let r;const o=new Promise((a,c)=>{r=setTimeout(()=>c(new Error(g(4874,"Aborted onWillSaveNotebookDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason,n).then(l=>{clearTimeout(r)}).then(a,c)});return Zoe(o,n)}},T3e=class{constructor(e,t,i){this.workingCopyFileService=i,this._saveParticipantDisposable=this.workingCopyFileService.addSaveParticipant(t.createInstance(YYt,e))}dispose(){this._saveParticipantDisposable.dispose()}};T3e=D([eP,_(1,we),_(2,qb)],T3e);let L3e=class{constructor(e,t){this._disposables=new Z,this._proxy=e.getProxy(Je.ExtHostInteractive),this._disposables.add(t.onWillAddInteractiveDocument(i=>{this._proxy.$willAddInteractiveDocument(i.inputUri,` -`,Sa,i.notebookUri)})),this._disposables.add(t.onWillRemoveInteractiveDocument(i=>{this._proxy.$willRemoveInteractiveDocument(i.inputUri,i.notebookUri)}))}dispose(){this._disposables.dispose()}};L3e=D([Ki(We.MainThreadInteractive),_(1,DMe)],L3e);const JYt={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 _De;(function(s){function e(t,i,n){if(!t)return;const r=Rt(t.type)?t.type:void 0;if(!r||r.length===0){n.error(g(6667,"The task type configuration is missing the required 'taskType' property"));return}const o=[];if(Array.isArray(t.required))for(const a of t.required)Rt(a)&&o.push(a);return{extensionId:i.value,taskType:r,required:o,properties:t.properties?Ds(t.properties):{},when:t.when?he.deserialize(t.when):void 0}}s.from=e})(_De||(_De={}));const XYt=ih.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:JYt}});class ZYt{constructor(){this._onDefinitionsChanged=new I,this.onDefinitionsChanged=this._onDefinitionsChanged.event,this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{XYt.setHandler((i,n)=>{this._schema=void 0;try{for(const r of n.removed){const o=r.value;for(const a of o)this.taskTypes&&a.type&&this.taskTypes[a.type]&&delete this.taskTypes[a.type]}for(const r of n.added){const o=r.value;for(const a of o){const c=_De.from(a,r.description.identifier,r.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=Ds(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 eJt=new ZYt,krt="settings";new Q("taskRunning",!1,g(3790,"Whether a task is currently running."));Pe(3791,"Tasks");var Lie;(function(s){s[s.Escape=1]="Escape",s[s.Strong=2]="Strong",s[s.Weak=3]="Weak"})(Lie||(Lie={}));const Irt="$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})(Lie||(Lie={}));var V$;(function(s){s.defaults={cwd:"${workspaceFolder}"}})(V$||(V$={}));var z$;(function(s){s[s.Always=1]="Always",s[s.Silent=2]="Silent",s[s.Never=3]="Never"})(z$||(z$={}));(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})(z$||(z$={}));var $$;(function(s){s[s.Never=1]="Never",s[s.OnProblem=2]="OnProblem",s[s.Always=3]="Always"})($$||($$={}));(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})($$||($$={}));var G$;(function(s){s[s.Shared=1]="Shared",s[s.Dedicated=2]="Dedicated",s[s.New=3]="New"})(G$||(G$={}));(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})(G$||(G$={}));var Rie;(function(s){s.defaults={echo:!0,reveal:z$.Always,revealProblems:$$.Never,focus:!1,panel:G$.Shared,showReuseMessage:!0,clear:!1}})(Rie||(Rie={}));var dm;(function(s){s[s.Shell=1]="Shell",s[s.Process=2]="Process",s[s.CustomExecution=3]="CustomExecution"})(dm||(dm={}));(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})(dm||(dm={}));var R3e;(function(s){function e(t){return Rt(t)?t:t.value}s.value=e})(R3e||(R3e={}));var M3e;(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 Rt(i)?e(i)?{_id:i,isDefault:!1}:void 0:i}s.from=t})(M3e||(M3e={}));var hx;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace",s[s.Folder=3]="Folder"})(hx||(hx={}));var bA;(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 At.USER;case s.WorkspaceFile:return At.WORKSPACE;default:return At.WORKSPACE_FOLDER}}s.toConfigurationTarget=e})(bA||(bA={}));var N3e;(function(s){s.parallel="parallel",s.sequence="sequence"})(N3e||(N3e={}));var vDe;(function(s){s[s.default=1]="default",s[s.folderOpen=2]="folderOpen"})(vDe||(vDe={}));var Mie;(function(s){s.defaults={reevaluateOnRerun:!0,runOn:vDe.default,instanceLimit:1}})(Mie||(Mie={}));class GPe{constructor(e,t,i,n,r,o){this._label="",this._id=e,t&&(this._label=t),i&&(this.type=i),this.runOptions=n,this.configurationProperties=r,this._source=o}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(Rt(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 Sz extends GPe{constructor(e,t,i,n,r,o,a,c){super(e,i,void 0,a,c,t),this.command={},this._source=t,this.hasDefinedMatchers=o,r&&(this.command=r)}clone(){return new Sz(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 dm.Shell:t="shell";break;case dm.Process:t="process";break;case dm.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 Sz}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===bA.User?krt: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!==bA.Workspace&&(t+=this._source.kind),JSON.stringify({type:Irt,folder:e,id:t})}getWorkspaceFolder(){return this._source.config.workspaceFolder}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?vi(this._source.config.workspace.configuration):void 0}getTelemetryKind(){return this._source.customizes?"workspace>extension":"workspace"}fromObject(e){return new Sz(e._id,e._source,e._label,e.type,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}class Az extends GPe{constructor(e,t,i,n,r,o,a){super(e,i,n,o,a,t),this._source=t,this.configures=r}static is(e){return e instanceof Az}fromObject(e){return e}getDefinition(){return this.configures}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?vi(this._source.config.workspace.configuration):void 0}getWorkspaceFolder(){return this._source.config.workspaceFolder}getFolderId(){return this._source.kind===bA.User?krt:this._source.config.workspaceFolder?.uri.toString()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==bA.Workspace&&(t+=this._source.kind),JSON.stringify({type:Irt,folder:e,id:t})}}class oL extends GPe{constructor(e,t,i,n,r,o,a,c,l){super(e,i,n,c,l,t),this.defines=r,this.hasDefinedMatchers=a,this.command=o,this.icon=l.icon,this.hide=l.hide}clone(){return new oL(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 oL}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===hx.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 oL(e._id,e._source,e._label,e.type,e.defines,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}var Nie;(function(s){s[s.Process=1]="Process",s[s.Terminal=2]="Terminal"})(Nie||(Nie={}));(function(s){s._default=s.Terminal})(Nie||(Nie={}));var P3e;(function(s){s[s.V0_1_0=1]="V0_1_0",s[s.V2_0_0=2]="V2_0_0"})(P3e||(P3e={}));var w_;(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"})(w_||(w_={}));var Pie;(function(s){s.SingleRun="singleRun",s.Background="background"})(Pie||(Pie={}));var F3e;(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"})(F3e||(F3e={}));var O3e;(function(s){function e(c){return{taskId:c._id,taskName:c.configurationProperties.name,runType:c.configurationProperties.isBackground?Pie.Background:Pie.SingleRun,group:c.configurationProperties.group,__task:c}}function t(c,l,d){return{...e(c),kind:w_.Start,terminalId:l,resolvedVariables:d}}s.start=t;function i(c,l,d){return{...e(c),kind:w_.ProcessStarted,terminalId:l,processId:d}}s.processStarted=i;function n(c,l,d){return{...e(c),kind:w_.ProcessEnded,terminalId:l,exitCode:d}}s.processEnded=n;function r(c,l,d){return{...e(c),kind:w_.Terminated,exitReason:d,terminalId:l}}s.terminated=r;function o(c,l,d){return{...e(l),kind:c,terminalId:d}}s.general=o;function a(){return{kind:w_.Changed}}s.changed=a})(O3e||(O3e={}));var Fie;(function(s){function e(i){const n=Object.keys(i).sort();let r="";for(const o of n){let a=i[o];a instanceof Object?a=e(a):typeof a=="string"&&(a=a.replace(/,/g,",,")),r+=o+","+a+","}return r}function t(i){const r={_key:e(i),type:i.taskType};return Object.assign(r,i),r}s.create=t})(Fie||(Fie={}));var B3e;(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"})(B3e||(B3e={}));var W3e;(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"})(W3e||(W3e={}));var bDe;(function(s){function e(t,i){const n=eJt.get(t.type);if(n===void 0){const c=Ds(t);return delete c._key,Fie.create(c)}const r=Object.create(null);r.type=n.taskType;const o=new Set;n.required.forEach(c=>o.add(c));const a=n.properties;for(const c of Object.keys(a)){const l=t[c];if(l!=null)r[c]=l;else if(o.has(c)){const d=a[c];if(d.default!==void 0)r[c]=Ds(d.default);else switch(d.type){case"boolean":r[c]=!1;break;case"number":case"integer":r[c]=0;break;case"string":r[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 Fie.create(r)}s.createTaskIdentifier=e})(bDe||(bDe={}));var Oie;(function(s){function e(t){return{id:t.id,task:Mf.from(t.task)}}s.from=e})(Oie||(Oie={}));var wDe;(function(s){function e(t,i){return{id:t.id,processId:i}}s.from=e})(wDe||(wDe={}));var yDe;(function(s){function e(t,i){return{id:t.id,exitCode:i}}s.from=e})(yDe||(yDe={}));var Bie;(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 r=bDe.createTaskIdentifier(i,console);return r===void 0&&n&&(r={_key:ao(),type:"$executeOnly"}),r}s.to=t})(Bie||(Bie={}));var Wie;(function(s){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}s.from=e;function t(i){return i==null?Rie.defaults:Object.assign(Object.create(null),Rie.defaults,i)}s.to=t})(Wie||(Wie={}));var Hie;(function(s){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}s.from=e;function t(i){return i==null?Mie.defaults:Object.assign(Object.create(null),Mie.defaults,i)}s.to=t})(Hie||(Hie={}));var Uie;(function(s){function e(i){if(i!=null)return{cwd:i.cwd,env:i.env}}s.from=e;function t(i){return i==null?V$.defaults:{cwd:i.cwd||V$.defaults.cwd,env:i.env}}s.to=t})(Uie||(Uie={}));var Ez;(function(s){function e(n){const r=n;return r&&!!r.process}s.is=e;function t(n){const r=Rt(n.name)?n.name:n.name.value,o=n.args?n.args.map(c=>Rt(c)?c:c.value):[],a={process:r,args:o};return n.options&&(a.options=Uie.from(n.options)),a}s.from=t;function i(n){const r={runtime:dm.Process,name:n.process,args:n.args,presentation:void 0};return r.options=Uie.to(n.options),r}s.to=i})(Ez||(Ez={}));var Vie;(function(s){function e(i){if(i==null)return;const n={cwd:i.cwd||V$.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})(Vie||(Vie={}));var xz;(function(s){function e(n){const r=n;return r&&(!!r.commandLine||!!r.command)}s.is=e;function t(n){const r={};return n.name&&Rt(n.name)&&(n.args===void 0||n.args===null||n.args.length===0)?r.commandLine=n.name:(r.command=n.name,r.args=n.args),n.options&&(r.options=Vie.from(n.options)),r}s.from=t;function i(n){const r={runtime:dm.Shell,name:n.commandLine?n.commandLine:n.command,args:n.args,presentation:void 0};return n.options&&(r.options=Vie.to(n.options)),r}s.to=i})(xz||(xz={}));var q1;(function(s){function e(n){const r=n;return r&&r.customExecution==="customExecution"}s.is=e;function t(n){return{customExecution:"customExecution"}}s.from=t;function i(n){return{runtime:dm.CustomExecution,presentation:void 0}}s.to=i})(q1||(q1={}));var zie;(function(s){function e(i){const n={label:i.label};return i.kind===bA.Extension?(n.extensionId=i.extension,i.workspaceFolder?n.scope=i.workspaceFolder.uri:n.scope=i.scope):i.kind===bA.Workspace&&(n.extensionId="$core",n.scope=i.config.workspaceFolder?i.config.workspaceFolder.uri:hx.Global),n}s.from=e;function t(i,n){let r,o;return i.scope===void 0||typeof i.scope=="number"&&i.scope!==hx.Global?n.getWorkspace().folders.length===0?(r=hx.Global,o=void 0):(r=hx.Folder,o=n.getWorkspace().folders[0]):typeof i.scope=="number"?r=i.scope:(r=hx.Folder,o=n.getWorkspaceFolder(N.revive(i.scope))??void 0),{kind:bA.Extension,label:i.label,extension:i.extensionId,scope:r,workspaceFolder:o}}s.to=t})(zie||(zie={}));var $ie;(function(s){function e(t){const i=t;return i&&Rt(i.id)&&!!i.workspaceFolder}s.is=e})($ie||($ie={}));var Mf;(function(s){function e(i){if(i==null||!Sz.is(i)&&!oL.is(i)&&!Az.is(i))return;const n={_id:i._id,name:i.configurationProperties.name,definition:Bie.from(i.getDefinition(!0)),source:zie.from(i._source),execution:void 0,presentationOptions:!Az.is(i)&&i.command?Wie.from(i.command.presentation):void 0,isBackground:i.configurationProperties.isBackground,problemMatchers:[],hasDefinedMatchers:oL.is(i)?i.hasDefinedMatchers:!1,runOptions:Hie.from(i.runOptions)};if(n.group=CDe.from(i.configurationProperties.group),i.configurationProperties.detail&&(n.detail=i.configurationProperties.detail),!Az.is(i)&&i.command)switch(i.command.runtime){case dm.Process:n.execution=Ez.from(i.command);break;case dm.Shell:n.execution=xz.from(i.command);break;case dm.CustomExecution:n.execution=q1.from(i.command);break}if(i.configurationProperties.problemMatchers)for(const r of i.configurationProperties.problemMatchers)Rt(r)&&n.problemMatchers.push(r);return n}s.from=e;function t(i,n,r,o,a){if(!i||typeof i.name!="string")return;let c;if(i.execution&&(xz.is(i.execution)?c=xz.to(i.execution):Ez.is(i.execution)?c=Ez.to(i.execution):q1.is(i.execution)&&(c=q1.to(i.execution))),!c)return;c.presentation=Wie.to(i.presentationOptions);const l=zie.to(i.source,n),d=g(4875,"{0}: {1}",l.label,i.name),h=Bie.to(i.definition,r),u=q1.is(i.execution)&&i._id?i._id:`${i.source.extensionId}.${h._key}`;return new oL(u,l,d,h.type,h,c,i.hasDefinedMatchers,Hie.to(i.runOptions),{name:i.name,identifier:d,group:i.group,isBackground:!!i.isBackground,problemMatchers:i.problemMatchers.slice(),detail:i.detail,icon:o,hide:a})}s.to=t})(Mf||(Mf={}));var CDe;(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})(CDe||(CDe={}));var SDe;(function(s){function e(i){return i}s.from=e;function t(i){return i}s.to=t})(SDe||(SDe={}));let H3e=class extends V{constructor(e,t,i,n){super(),this._taskService=t,this._workspaceContextServer=i,this._configurationResolverService=n,this._proxy=e.getProxy(Je.ExtHostTask),this._providers=new Map,this._register(this._taskService.onDidStateChange(async r=>{if(r.kind===w_.Changed)return;const o=r.__task;if(r.kind===w_.Start){const a=Oie.from(o.getTaskExecution());let c=a.task.definition;if(a.task?.execution&&q1.is(a.task.execution)&&r.resolvedVariables){const l={};for(const[d,h]of r.resolvedVariables.entries())l[d]=h;c=await this._configurationResolverService.resolveAnyAsync(o.getWorkspaceFolder(),a.task.definition,l)}this._proxy.$onDidStartTask(a,r.terminalId,c)}else r.kind===w_.ProcessStarted?this._proxy.$onDidStartTaskProcess(wDe.from(o.getTaskExecution(),r.processId)):r.kind===w_.ProcessEnded?this._proxy.$onDidEndTaskProcess(yDe.from(o.getTaskExecution(),r.exitCode)):r.kind===w_.End&&this._proxy.$OnDidEndTask(Oie.from(o.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=Mf.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:r=>Promise.resolve(this._proxy.$provideTasks(e,r)).then(o=>{const a=[];for(const c of o.tasks){const l=Mf.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:o.extension}}),resolveTask:r=>{const o=Mf.from(r);return o?(o.name=o.name===void 0?"":o.name,Promise.resolve(this._proxy.$resolveTask(e,o)).then(a=>{if(a)return Mf.to(a,this._workspaceContextServer,!0,r.configurationProperties.icon,r.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(SDe.to(e)).then(t=>{const i=[];for(const n of t){const r=Mf.from(n);r&&i.push(r)}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($ie.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:Mf.from(i)};throw new Error("Task not found")}else throw new Error("No workspace folder")}else{const t=Mf.to(e,this._workspaceContextServer,!0);return{id:t._id,task:Mf.from(t)}}}$executeTask(e){return new Promise((t,i)=>{if($ie.is(e)){const n=this.getWorkspace(e.workspaceFolder);n?this._taskService.getTask(n,e.id,!0).then(r=>{if(!r)i(new Error("Task not found"));else{const o={id:e.id,task:Mf.from(r)};this._taskService.run(r).then(a=>{(a?.exitCode===void 0||a.exitCode!==0)&&this._proxy.$OnDidEndTask(o)},a=>{}),t(o)}},r=>{i(new Error("Task not found"))}):i(new Error("No workspace folder"))}else{const n=Mf.to(e,this._workspaceContextServer,!0);this._taskService.run(n).then(void 0,o=>{});const r={id:n._id,task:Mf.from(n)};t(r)}})}$customExecutionComplete(e,t){return new Promise((i,n)=>{this._taskService.getActiveTasks().then(r=>{for(const o of r)if(e===o._id){this._taskService.extensionCallbackTaskComplete(o,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 r of n)if(e===r._id){this._taskService.terminate(r).then(o=>{t(void 0)},o=>{i(void 0)});return}i(new Ra("Task to terminate not found"))})})}$registerTaskSystem(e,t){let i;switch(t.platform){case"Web":i=Qd.Web;break;case"win32":i=Qd.Windows;break;case"darwin":i=Qd.Mac;break;case"linux":i=Qd.Linux;break;default:i=eKe}this._taskService.registerTaskSystem(e,{platform:i,uriProvider:n=>N.from({scheme:t.scheme,authority:t.authority,path:n}),context:this._extHostContext,resolveVariables:(n,r,o)=>{const a=[];return r.variables.forEach(c=>a.push(c)),Promise.resolve(this._proxy.$resolveVariables(n.uri,{process:r.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,o).then(u=>{u||d(void 0);const f={process:void 0,variables:new Map};for(let p=0;p{h(u)})})})},findExecutable:(n,r,o)=>this._proxy.$findExecutable(n,r,o)})}async $registerSupportedExecutions(e,t,i){return this._taskService.registerSupportedExecutions(e,t,i)}};H3e=D([Ki(We.MainThreadTask),_(1,lZe),_(2,Ci),_(3,RMe)],H3e);let U3e=class extends V{constructor(e,t){super(),this._labelService=t,this._resourceLabelFormatters=this._register(new mr)}$registerResourceLabelFormatter(e,t){t.priority=!0;const i=this._labelService.registerCachedFormatter(t);this._resourceLabelFormatters.set(e,i)}$unregisterResourceLabelFormatter(e){this._resourceLabelFormatters.deleteAndDispose(e)}};U3e=D([Ki(We.MainThreadLabelService),_(1,Os)],U3e);var Fp;(function(s){s.Http="http",s.Https="https"})(Fp||(Fp={}));var FS;(function(s){s.ConstantPrivate="constantPrivate",s.Private="private",s.Public="public"})(FS||(FS={}));var zE;(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"})(zE||(zE={}));function tJt(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 K$=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];function q$(s){return K$.indexOf(s)>=0}const Gie=["0.0.0.0","0:0:0:0:0:0:0:0","::"];function Q$(s){return Gie.indexOf(s)>=0}class iJt{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 V3e=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 r of n){const o=await r.value;o&&typeof o!="string"&&e.push(o)}}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,r){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:i,privacy:n,protocol:r,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(Q$(e)||q$(e))&&(e=K$[0]);const i=this.getTunnelFromMap(e,t);if(i)return++i.refcount,i.value}openTunnel(e,t,i,n,r,o=!1,a,c){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${t}:${i} on local port ${r}.`);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,r,o,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 r=>{r&&typeof r!="string"&&(await r.dispose(!0),this._onTunnelClosed.fire({host:r.tunnelRemoteHost,port:r.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),r=n?await n.value:void 0;(!r||typeof r=="string")&&i.delete(t),i.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){const i=[e];q$(e)?(i.push(...K$),i.push(...Gie)):Q$(e)&&i.push(...Gie);const n=i.map(r=>this._tunnels.get(r));for(const r of n){const o=r?.get(t);if(o)return o}}canTunnel(e){return!!tJt(e)}createWithProvider(e,t,i,n,r,o,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:r?this.isPortPrivileged(l):!1},h={remoteAddress:{host:t,port:i},localAddressPort:n,privacy:o,public:o?o!==FS.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}};V3e=D([_(0,Ke),_(1,Te)],V3e);const bu=ae("IExtHostInitDataService"),Jr=ae("IExtHostRpcService");class nJt{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 sJt extends iJt{}var Kie;(function(s){function e(i){return{remoteAddress:i.remoteAddress,localAddress:i.localAddress,public:!!i.public,privacy:i.privacy??(i.public?FS.Public:FS.Private),protocol:i.protocol}}s.fromApiTunnel=e;function t(i){return{remoteAddress:{host:i.tunnelRemoteHost,port:i.tunnelRemotePort},localAddress:i.localAddress,public:i.privacy!==FS.ConstantPrivate&&i.privacy!==FS.ConstantPrivate,privacy:i.privacy,protocol:i.protocol}}s.fromServiceTunnel=t})(Kie||(Kie={}));const KPe=ae("IExtHostTunnelService");let ADe=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(We.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 sJt(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 js(()=>{this._portAttributesProviders.delete(i),this._proxy.$unregisterPortsAttributesProvider(i)})}async $providePortAttributes(e,t,i,n,r){const o=[];for(const c of e){const l=this._portAttributesProviders.get(c);if(!l)return[];o.push(...await Promise.all(t.map(async d=>{let h;try{h=await l.provider.providePortAttributes({port:d,pid:i,commandLine:n},r)}catch{h=await l.provider.providePortAttributes(d,i,n,r)}return{providedAttributes:h,port:d}})))}const a=o.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,r)=>await e.provideTunnel(n,r,Ue.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 r=e.tunnelFeatures?{elevation:!!e.tunnelFeatures?.elevation,public:!!e.tunnelFeatures?.public,privacyOptions:n,protocol:!0}:void 0;this._proxy.$setTunnelProvider(r)}}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 r=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:r}),Kie.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,r)=>t[r]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${e.map(n=>n.port).join(", ")} to ${i.map(n=>n.port).join(", ")}`),i}};ADe=D([_(0,Jr),_(1,bu),_(2,Ke)],ADe);const rJt=10*1e3,jK="remote.tunnels.toRestore",ige="remote.tunnels.toRestoreExpiration",oJt=1e3*60*60*24*14,z3e="onTunnel",Trt=new Q("forwardedPortsViewEnabled",!1,g(8676,"Whether the Ports view is enabled."));function aJt(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 aL;(function(s){s.Other="Other",s.User="User",s.AutoForwardEnd="AutoForwardEnd"})(aL||(aL={}));var pb;(function(s){s[s.User=0]="User",s[s.Auto=1]="Auto",s[s.Extension=2]="Extension"})(pb||(pb={}));const nge={source:pb.User,description:g(8677,"User Forwarded")};pb.Auto,g(8678,"Auto Forwarded");function $3e(s,e,t){const i=s.get(Rg(e,t));if(i)return i;if(q$(e))for(const n of K$){const r=Rg(n,t);if(s.has(r))return s.get(r)}else if(Q$(e))for(const n of Gie){const r=Rg(n,t);if(s.has(r))return s.get(r)}}function yg(s,e,t){const i=$3e(s,e,t);if(i)return i;const n=Q$(e)?"localhost":q$(e)?"0.0.0.0":void 0;if(n)return $3e(s,n,t)}function Rg(s,e){return s+":"+e}var $E;(function(s){s.Notify="notify",s.OpenBrowser="openBrowser",s.OpenBrowserOnce="openBrowserOnce",s.OpenPreview="openPreview",s.Silent="silent",s.Ignore="ignore"})($E||($E={}));function cJt(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 Su=class Su 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(Su.SETTING)||t.affectsConfiguration(Su.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 r={label:void 0,onAutoForward:void 0,elevateIfNeeded:void 0,requireLocalPort:void 0,protocol:void 0};for(;n>=0;){const o=this.portsAttributes[n];o.key===e?(r.onAutoForward=o.onAutoForward??r.onAutoForward,r.elevateIfNeeded=o.elevateIfNeeded!==void 0?o.elevateIfNeeded:r.elevateIfNeeded,r.label=o.label??r.label,r.requireLocalPort=o.requireLocalPort,r.protocol=o.protocol):(r.onAutoForward=r.onAutoForward??o.onAutoForward,r.elevateIfNeeded=r.elevateIfNeeded!==void 0?r.elevateIfNeeded:o.elevateIfNeeded,r.label=r.label??o.label,r.requireLocalPort=r.requireLocalPort!==void 0?r.requireLocalPort:void 0,r.protocol=r.protocol??o.protocol),n=this.findNextIndex(e,t,i,this.portsAttributes,n+1)}return r.onAutoForward!==void 0||r.elevateIfNeeded!==void 0||r.label!==void 0||r.requireLocalPort!==void 0||r.protocol!==void 0?r:this.getOtherAttributes()}hasStartEnd(e){return e.start!==void 0&&e.end!==void 0}hasHostAndPort(e){return e.host!==void 0&&e.port!==void 0&&Rt(e.host)&&dc(e.port)}findNextIndex(e,t,i,n,r){if(r>=n.length)return-1;const o=!q$(t)&&!Q$(t),c=n.slice(r).findIndex(l=>dc(l.key)?o?!1:l.key===e:this.hasStartEnd(l.key)?o?!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+r:-1}readSetting(){const e=this.configurationService.getValue(Su.SETTING);if(!e||!In(e))return[];const t=[];for(const n in e){if(n===void 0)continue;const r=e[n];let o;if(Number(n))o=Number(n);else if(Rt(n))if(Su.RANGE.test(n)){const a=n.match(Su.RANGE);o={start:Number(a[1]),end:Number(a[2])}}else if(Su.HOST_AND_PORT.test(n)){const a=n.match(Su.HOST_AND_PORT);o={host:a[1],port:Number(a[2])}}else{let a;try{a=RegExp(n)}catch{}a&&(o=a)}o&&t.push({key:o,elevateIfNeeded:r.elevateIfNeeded,onAutoForward:r.onAutoForward,label:r.label,requireLocalPort:r.requireLocalPort,protocol:r.protocol})}const i=this.configurationService.getValue(Su.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 dc(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 zE.Notify:return $E.Notify;case zE.OpenBrowser:return $E.OpenBrowser;case zE.OpenBrowserOnce:return $E.OpenBrowserOnce;case zE.OpenPreview:return $E.OpenPreview;case zE.Silent:return $E.Silent;case zE.Ignore:return $E.Ignore;default:return}}async addAttributes(e,t,i){const r=this.configurationService.inspect(Su.SETTING).userRemoteValue;let o;!r||!In(r)?o={}:o=Ds(r),o[`${e}`]||(o[`${e}`]={});for(const a in t)o[`${e}`][a]=t[a];return this.configurationService.updateValue(Su.SETTING,o,i)}};Su.SETTING="remote.portsAttributes",Su.DEFAULTS="remote.otherPortsAttributes",Su.RANGE=/^(\d+)\-(\d+)$/,Su.HOST_AND_PORT=/^([a-z0-9\-]+):(\d{1,5})$/;let qie=Su,j$=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this.tunnelService=e,this.storageService=t,this.configurationService=i,this.environmentService=n,this.remoteAuthorityResolverService=r,this.workspaceContextService=o,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 qie(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=Rg(f.tunnelRemoteHost,f.tunnelRemotePort),m=yg(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??Fp.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:nge}),this.remoteTunnels.set(p,f)}}),this.detected=new Map,this._register(this.tunnelService.onTunnelOpened(async h=>{const u=Rg(h.tunnelRemoteHost,h.tunnelRemotePort);if(!yg(this.forwarded,h.tunnelRemoteHost,h.tunnelRemotePort)&&!yg(this.detected,h.tunnelRemoteHost,h.tunnelRemotePort)&&!yg(this.inProgress,h.tunnelRemoteHost,h.tunnelRemotePort)&&h.localAddress){const f=yg(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??Fp.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:nge})}await this.storeForwarded(),this.remoteTunnels.set(u,h),this._onForwardPort.fire(this.forwarded.get(u))})),this._register(this.tunnelService.onTunnelClosed(h=>this.onTunnelClosed(h,aL.Other))),this.checkExtensionActivationEvents()}extensionHasActivationEvent(){return this.extensionService.extensions.find(e=>e.activationEvents?.includes(z3e))?(this.contextKeyService.createKey(Trt.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=Rg(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?Hc(t.configuration.path):t.folders.length>0?Hc(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(jK)}async getRestoreExpirationStorageKey(){return this.addStorageKeyPostfix(ige)}async getTunnelRestoreValue(){const e=this.storageService.get(jK,Ie.WORKSPACE);if(e)return this.storageService.remove(jK,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=yg(this.detected,i.remoteHost,i.remotePort);i.source.source!==pb.Extension&&!n||i.source.source===pb.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===pb.Extension&&!n&&this.unrestoredExtensionTunnels.set(Rg(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,cn.USER).filter(t=>t.startsWith(ige));for(const t of e){const i=this.storageService.getNumber(t,Ie.PROFILE);if(i&&i({remoteHost:o.remoteHost,remotePort:o.remotePort,localPort:o.localPort,name:o.name,localAddress:o.localAddress,localUri:o.localUri,protocol:o.protocol,source:o.source}));let i;e.length>0&&(i=JSON.stringify(t));const n=await this.getTunnelRestoreStorageKey(),r=await this.getRestoreExpirationStorageKey();!i&&n&&r?(this.storageService.remove(n,Ie.PROFILE),this.storageService.remove(r,Ie.PROFILE)):i!==this.knownPortsRestoreValue&&n&&r&&(this.storageService.store(n,i,Ie.PROFILE,cn.USER),this.storageService.store(r,Date.now()+oJt,Ie.PROFILE,cn.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()+rJt>n.getTime())return;this.mismatchCooldown=n;const r=g(8679,`Local port {0} could not be used for forwarding to remote port {1}. +`)}getReplyCountAsString(e,t){return e.replies.length&&!t?g(5339," {0} replies,",e.replies.length):""}createTree(){this.treeLabels=this._register(this.instantiationService.createInstance(KA,this)),this.tree=this._register(this.instantiationService.createInstance(iDe,this.treeLabels,this.treeContainer,{overrideStyles:this.getLocationBasedColors().listOverrideStyles,selectionNavigation:!0,filter:this.filter,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:e=>{}},accessibilityProvider:{getAriaLabel:e=>e instanceof mle?g(5340,"Comments for current workspace"):e instanceof sp?g(5341,"Comments in {0}, full path {1}",vi(e.resource),e.resource.fsPath):e instanceof ty?this.getScreenReaderInfoForNode(e,!0):"",getWidgetAriaLabel(){return Xxe.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 sp||e instanceof ty))return;const r=e instanceof sp?e.commentThreads[0].thread:e.thread,o=e instanceof sp?e.commentThreads[0].comment:void 0;return xrt(this.commentService,this.editorService,this.uriIdentityService,r,o,!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,b3e(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}};hDe=D([_(1,we),_(2,Im),_(3,ti),_(4,Te),_(5,Le),_(6,lo),_(7,Vt),_(8,Ar),_(9,mn),_(10,rE),_(11,Ji),_(12,tc),_(13,Is),_(14,Gi)],hDe);const $Yt=new _e("Views");Yn.appendMenuItem(_e.ViewContainerTitle,{submenu:$Yt,title:g(5295,"Views"),order:1});var gh;(function(s){s[s.UP=0]="UP",s[s.DOWN=1]="DOWN",s[s.LEFT=2]="LEFT",s[s.RIGHT=3]="RIGHT"})(gh||(gh={}));const boe=class boe extends CLe{get currentDropOperation(){return this._currentDropOperation}constructor(e,t,i,n,r){super(r),this.paneElement=e,this.orientation=t,this.bounds=i,this.location=n,this.cleanupOverlayScheduler=this._register(new ln(()=>this.dispose(),300)),this.create()}get disposed(){return!!this._disposed}create(){this.container=document.createElement("div"),this.container.id=boe.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===io.Panel?VXe:KXe)||"";const e=this.getColor(Xs);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 nY(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,r=i/2,o=n/2;let a;switch(this.orientation===pi.VERTICAL?t=o&&(a=gh.DOWN):this.orientation===pi.HORIZONTAL&&(e=r&&(a=gh.RIGHT)),a){case gh.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"});break;case gh.DOWN:this.doPositionOverlay({bottom:"0",left:"0",width:"100%",height:"50%"});break;case gh.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"});break;case gh.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===pi.VERTICAL&&n<=25||this.orientation===pi.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===gh.UP?"2px":"0px",this.overlay.style.borderLeftWidth=e===gh.LEFT?"2px":"0px",this.overlay.style.borderBottomWidth=e===gh.DOWN?"2px":"0px",this.overlay.style.borderRightWidth=e===gh.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}};boe.OVERLAY_ID="monaco-pane-drop-overlay";let BF=boe,uDe=class extends XZ{constructor(e,t,i,n,r){const o=n.createScoped(e);o.createKey("viewContainer",t.id);const a=o.createKey("viewContainerLocation",QX(i.getViewContainerLocation(t)));super(_e.ViewContainerTitle,_e.ViewContainerTitleContext,{shouldForwardArgs:!0,renderShortTitle:!0},o,r),this._register(o),this._register(M.filter(i.onDidChangeContainerLocation,c=>c.viewContainer===t)(()=>a.set(QX(i.getViewContainerLocation(t)))))}};uDe=D([_(2,Im),_(3,Le),_(4,Wa)],uDe);let gDe=class extends vnt{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,r,o,a,c,l,d,h,u){super(e,l,d),this.options=t,this.instantiationService=i,this.configurationService=n,this.layoutService=r,this.contextMenuService=o,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 m8t(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 Dh(lt(e),c)))),this._register(md.addTarget(e)),this._register(ue(e,ur.Contextmenu,c=>this.showContextMenu(new Dh(lt(e),c)))),this._menuActions=this._register(this.instantiationService.createInstance(uDe,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===pi.VERTICAL?l.bottom:c.top,h=this.orientation===pi.HORIZONTAL?l.right:c.left;return{top:d,bottom:c.bottom,left:h,right:c.right}},r=(c,l)=>l.x>=c.left&&l.x<=c.right&&l.y>=c.top&&l.y<=c.bottom;let o;this._register(_S.INSTANCE.registerTarget(e,{onDragEnter:c=>{if(o=n(),i&&i.disposed&&(i=void 0),!i&&r(o,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 BF(e,void 0,o,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 BF(e,void 0,o,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:c=>{i&&i.disposed&&(i=void 0),i&&!r(o,c.eventData)&&(i.dispose(),i=void 0),r(o,c.eventData)&&l5e(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(em.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(yc(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):GN(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 io.Sidebar:case io.AuxiliaryBar:return pi.VERTICAL;case io.Panel:return _3t(this.layoutService.getPanelPosition())?pi.HORIZONTAL:pi.VERTICAL}return pi.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:r,disposable:o}of e)this.addPane(i,n,o,r);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===pi.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,cn.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:r,index:o,size:a}of e){const c=this.createView(n,{id:n.id,title:n.name.value,fromExtensionId:n.extensionId,expanded:!r,singleViewPaneContainerTitle:n.singleViewPaneContainerTitle});c.render();const l=ue(c.draggableElement,"contextmenu",h=>{h.stopPropagation(),h.preventDefault(),this.onContextMenu(new Dh(lt(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:o,disposable:Yo(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 r=e.onDidFocus(()=>{this._onDidFocusView.fire(e),this.lastFocusedPane=e}),o=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)===io.Panel;e.style({headerForeground:$e(d?MLt:$Lt),headerBackground:$e(d?RLt:zLt),headerBorder:$e(d?NLt:qXe),dropBackground:$e(d?VXe:KXe),leftBorder:d?$e(PLt):void 0});const h=new Z;h.add(i),h.add(Yo(e,r,o,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(_S.INSTANCE.registerDraggable(e.draggableElement,()=>({type:"view",id:e.id}),{})),h.add(_S.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 BF(e.dropTargetElement,this.orientation??pi.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 BF(e.dropTargetElement,this.orientation??pi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:p=>{l5e(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===gh.DOWN||f.currentDropOperation===gh.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),r=this.viewContainerModel.visibleViewDescriptors[i],o=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(r.id,o.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;nr?(this.resizePane(t,o),this.resizePane(i,a)):(this.resizePane(i,a),this.resizePane(t,o))}}dispose(){super.dispose(),this.paneItems.forEach(e=>e.disposable.dispose()),this.paneview&&this.paneview.dispose()}};gDe=D([_(2,we),_(3,Te),_(4,NI),_(5,lo),_(6,Ji),_(7,ps),_(8,mn),_(9,Gi),_(10,Ci),_(11,Im)],gDe);class _le extends di{constructor(e,t){super(e),this.offset=t}async run(e){const t=e.get(Im),i=e.get(Le),n=$U.getValue(i);if(n===void 0)return;const r=t.getViewContainerByViewId(n),o=t.getViewContainerModel(r),a=o.visibleViewDescriptors.find(d=>d.id===n),c=o.visibleViewDescriptors.indexOf(a);if(c+this.offset<0||c+this.offset>=o.visibleViewDescriptors.length)return;const l=o.visibleViewDescriptors[c+this.offset];o.move(a.id,l.id)}}Et(class extends _le{constructor(){super({id:"views.moveViewUp",title:g(5296,"Move View Up"),keybinding:{primary:oo(U.CtrlCmd+S.KeyK,S.UpArrow),weight:Ae.WorkbenchContrib+1,when:$U.notEqualsTo("")}},-1)}});Et(class extends _le{constructor(){super({id:"views.moveViewLeft",title:g(5297,"Move View Left"),keybinding:{primary:oo(U.CtrlCmd+S.KeyK,S.LeftArrow),weight:Ae.WorkbenchContrib+1,when:$U.notEqualsTo("")}},-1)}});Et(class extends _le{constructor(){super({id:"views.moveViewDown",title:g(5298,"Move View Down"),keybinding:{primary:oo(U.CtrlCmd+S.KeyK,S.DownArrow),weight:Ae.WorkbenchContrib+1,when:$U.notEqualsTo("")}},1)}});Et(class extends _le{constructor(){super({id:"views.moveViewRight",title:g(5299,"Move View Right"),keybinding:{primary:oo(U.CtrlCmd+S.KeyK,S.RightArrow),weight:Ae.WorkbenchContrib+1,when:$U.notEqualsTo("")}},1)}});Et(class extends di{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(Im),n=i.getViewContainerById(t.destinationId);if(n){for(const r of t.viewIds){const o=i.getViewDescriptorById(r);o?.canMoveView&&i.moveViewsToContainer([o],n,Lwe.Default,this.desc.id)}await e.get(Nm).openViewContainer(n.id,!0)}}});class GYt{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,r,o,a,c,l,d){this.commentThreadHandle=e,this.controllerHandle=t,this.extensionId=i,this.threadId=n,this.resource=r,this._range=o,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:ys.CommentThread,commentControlHandle:this.controllerHandle,commentThreadHandle:this.commentThreadHandle}}}class KYt{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,r,o,a){this._proxy=e,this._commentService=t,this._handle=i,this._uniqueId=n,this._id=r,this._label=o,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,r,o,a,c){const l=new GYt(t,this.handle,e,i,N.revive(n).toString(),r,o,!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 r=this.getKnownThread(e);r.batchUpdate(n),r.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[],removed:[],changed:[r],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[],removed:[],changed:[r],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 r of[...this._threads.keys()]){const o=this._threads.get(r);o.resource===e.toString()&&o.isDocumentCommentThread()&&i.push(o)}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 r=this._threads.get(n);r.resource===e.toString()&&(r.isDocumentCommentThread()||i.push(r))}return{uniqueOwner:this._uniqueId,label:this.label,threads:i}}async toggleReaction(e,t,i,n,r){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:ys.CommentController,handle:this.handle}}}const w3e=oi("comments-view-icon",ve.commentDiscussion,g(4873,"View icon of the comments view."));let y3e=class extends V{constructor(e,t,i,n,r,o){super(),this._commentService=t,this._viewsService=i,this._viewDescriptorService=n,this._uriIdentityService=r,this._editorService=o,this._handlers=new Map,this._commentControllers=new Map,this._activeEditingCommentThreadDisposables=this._register(new Z),this._openViewListener=null,this._proxy=e.getProxy(Je.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 r=`${t}-${n}`;this._handlers.set(e,r);const o=new KYt(this._proxy,this._commentService,e,r,t,i,{});this._commentService.registerCommentController(r,o),this._commentControllers.set(e,o);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,r,o,a,c,l){const d=this._commentControllers.get(e);if(d)return d.createCommentThread(a.value,t,i,n,r,o,c,l)}$updateCommentThread(e,t,i,n,r){const o=this._commentControllers.get(e);if(o)return o.updateCommentThread(t,i,n,r)}$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 r=this._commentControllers.get(e);if(!r)return Promise.resolve();const o=r.getAllComments().find(c=>c.commentThreadHandle===t);if(!o||!o.isDocumentCommentThread())return Promise.resolve();const a=o.comments?.find(c=>c.uniqueIdInThread===i);xrt(this._commentService,this._editorService,this._uriIdentityService,o,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(r=>r.commentThreadHandle===t);if(!n||!n.isDocumentCommentThread())return Promise.resolve();n.collapsibleState=Rc.Collapsed}registerView(e){if(!e){const t=je.as(oI.ViewContainersRegistry).registerViewContainer({id:Jl,title:Xxe,ctorDescriptor:new yi(gDe,[Jl,{mergeViewWithContainerWhenSingleView:!0}]),storageId:yYt,hideIfEmpty:!0,icon:w3e,order:10},io.Panel);je.as(oI.ViewsRegistry).registerViews([{id:Jl,name:Xxe,canToggleVisibility:!1,ctorDescriptor:new yi(hDe),canMoveView:!0,containerIcon:w3e,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)}};y3e=D([Ki(We.MainThreadComments),_(1,rE),_(2,Nm),_(3,Im),_(4,Is),_(5,ti)],y3e);var Yx;(function(s){s[s.Output=1]="Output",s[s.OutputItems=2]="OutputItems",s[s.ExecutionState=3]="ExecutionState"})(Yx||(Yx={}));var lp;(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 r(f){return{mime:f.mime,data:f.valueBytes}}s.fromNotebookOutputItemDto=r;function o(f){return{outputId:f.outputId,metadata:f.metadata,outputs:f.items.map(r)}}s.fromNotebookOutputDto=o;function a(f){return{cellKind:f.cellKind,language:f.language,mime:f.mime,source:f.source,outputs:f.outputs.map(o),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===Yx.Output?{editType:f.editType,cellHandle:f.cellHandle,append:f.append,outputs:f.outputs.map(o)}:f.editType===Yx.OutputItems?{editType:f.editType,append:f.append,outputId:f.outputId,items:f.items.map(r)}:f}s.fromCellExecuteUpdateDto=d;function h(f){return f}s.fromCellExecuteCompleteDto=h;function u(f){return f.editType===mI.Replace?{editType:f.editType,index:f.index,count:f.count,cells:f.cells.map(a)}:f}s.fromCellEditOperationDto=u})(lp||(lp={}));let C3e=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(Je.ExtHostNotebook)}dispose(){this._disposables.dispose(),wt(this._notebookSerializer.values())}$registerNotebookSerializer(e,t,i,n,r){const o=new Z;o.add(this._notebookService.registerNotebookSerializer(i,t,{options:n,dataToNotebook:async a=>{const c=new Ys;let l;if(a.byteLength===0&&i==="interactive")l=lp.fromNotebookDataDto({cells:[],metadata:{}});else{const d=await this._proxy.$dataToNotebook(e,a,Ue.None);l=lp.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 Ys,l=this._proxy.$notebookToData(e,new Jd(lp.toNotebookDataDto(a)),Ue.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=Oi([{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=>Mr(y))})),limitHit:m.limitHit}}})),r&&o.add(this._notebookService.registerContributedNotebookType(i,r)),this._notebookSerializer.set(e,o),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,r={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),r.onDidChangeStatusBarItems=a.event}const o=this._cellStatusBarService.registerCellStatusBarItemProvider(r);this._notebookCellStatusBarRegistrations.set(e,o)}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)}};C3e=D([Ki(We.MainThreadNotebook),_(1,oE),_(2,nZe),_(3,Ke)],C3e);vt.registerCommand("_executeDataToNotebook",async(s,...e)=>{const[t,i]=e;Lt(typeof t=="string","string"),Lt(i instanceof Ge,"VSBuffer");const r=await s.get(oE).withNotebookDataProvider(t);if(!(r instanceof SG))return;const o=await r.serializer.dataToNotebook(i);return new Jd(lp.toNotebookDataDto(o))});vt.registerCommand("_executeNotebookToData",async(s,...e)=>{const[t,i]=e;Lt(typeof t=="string","string"),Lt(typeof i=="object");const r=await s.get(oE).withNotebookDataProvider(t);if(!(r instanceof SG))return;const o=lp.fromNotebookDataDto(i.value);return await r.serializer.notebookToData(o)});var fDe;(function(s){s[s.cell=0]="cell",s[s.notebook=1]="notebook"})(fDe||(fDe={}));class qYt{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=tr(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=tr(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 QYt{constructor(e){this.notebookType=e}}let S3e=class{constructor(e,t,i,n,r,o){this._languageService=t,this._notebookKernelService=i,this._notebookExecutionStateService=n,this._notebookService=r,this._editors=new mr,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(Je.ExtHostNotebookKernels),o.listNotebookEditors().forEach(this._onEditorAdd,this),o.onDidAddNotebookEditor(this._onEditorAdd,this,this._disposables),o.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===fDe.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[r,o]of this._kernels)if(o[0]===n){this._proxy.$acceptKernelMessageFromRenderer(r,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[r]=n;let o=!1;for(const[a]of this._editors)if(a.hasModel()&&this._notebookKernelService.getMatchingKernel(a.textModel).selected===r){if(t===void 0)a.postMessage(i),o=!0;else if(a.getId()===t){a.postMessage(i),o=!0;break}}return o}$receiveVariable(e,t){const i=this.variableRequestMap.get(e);i&&i.emitOne(t)}async $addKernel(e,t){const i=this,n=new class extends qYt{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 V2;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),r=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)}),o=this._notebookKernelService.registerKernel(n);this._kernels.set(e,[n,Yo(r,o)])}$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 r=N.revive(i),o=this._notebookService.getNotebookTextModel(r);if(!o)throw new Error(`Notebook not found: ${r.toString()}`);const a=this._notebookKernelService.getMatchingKernel(o);if(!a.selected||a.selected.id!==t)throw new Error(`Kernel is not selected: ${a.selected?.id} !== ${t}`);const c=this._notebookExecutionStateService.createCellExecution(r,n);c.confirm(),this._executions.set(e,c)}$updateExecution(e,t){const i=t.value;try{this._executions.get(e)?.update(i.map(lp.fromCellExecuteUpdateDto))}catch(n){bt(n)}}$completeExecution(e,t){try{this._executions.get(e)?.complete(lp.fromCellExecuteCompleteDto(t.value))}catch(i){bt(i)}finally{this._executions.delete(e)}}$createNotebookExecution(e,t,i){const n=N.revive(i),r=this._notebookService.getNotebookTextModel(n);if(!r)throw new Error(`Notebook not found: ${n.toString()}`);const o=this._notebookKernelService.getMatchingKernel(r);if(!o.selected||o.selected.id!==t)throw new Error(`Kernel is not selected: ${o.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){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 QYt(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,Ue.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 o=new I;this._kernelSourceActionProvidersEventRegistrations.set(t,o),n.onDidChangeSourceActions=o.event}const r=this._notebookKernelService.registerKernelSourceActionProvider(i,n);this._kernelSourceActionProviders.set(e,[n,r])}$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))}};S3e=D([Ki(We.MainThreadNotebookKernels),_(1,Di),_(2,rZe),_(3,sZe),_(4,oE),_(5,$6)],S3e);let pDe=class{constructor(e,t,i){this._notebookEditorModelResolverService=t,this._uriIdentityService=i,this._disposables=new Z,this._documentEventListenersMapping=new gi,this._proxy=e.getProxy(Je.ExtHostNotebookDocuments),this._modelReferenceCollection=new srt(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(),wt(this._documentEventListenersMapping.values())}handleNotebooksAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeContent(n=>{const r={versionId:n.versionId,rawEvents:[]};for(const a of n.rawEvents)switch(a.kind){case El.ModelChange:r.rawEvents.push({kind:a.kind,changes:a.changes.map(c=>[c[0],c[1],c[2].map(l=>lp.toNotebookCellDto(l))])});break;case El.Move:r.rawEvents.push({kind:a.kind,index:a.index,length:a.length,newIdx:a.newIdx});break;case El.Output:r.rawEvents.push({kind:a.kind,index:a.index,outputs:a.outputs.map(lp.toNotebookOutputDto)});break;case El.OutputItem:r.rawEvents.push({kind:a.kind,index:a.index,outputId:a.outputId,outputItems:a.outputItems.map(lp.toNotebookOutputItemDto),append:a.append});break;case El.ChangeCellLanguage:case El.ChangeCellContent:case El.ChangeCellMetadata:case El.ChangeCellInternalMetadata:r.rawEvents.push(a);break}const o=n.rawEvents.find(a=>a.kind===El.ChangeDocumentMetadata);this._proxy.$acceptModelChanged(t.uri,new Jd(r),this._notebookEditorModelResolverService.isDirty(t.uri),o?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=lp.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}};pDe=D([_(1,dce),_(2,Is)],pDe);class jYt{constructor(e,t){this.editor=e,this.disposables=t}dispose(){this.disposables.dispose()}}let mDe=class{constructor(e,t,i,n,r){this._editorService=t,this._notebookEditorService=i,this._editorGroupService=n,this._configurationService=r,this._disposables=new Z,this._mainThreadEditors=new Map,this._proxy=e.getProxy(Je.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(),wt(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 jYt(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=lB(t);i&&this._mainThreadEditors.has(i.getId())&&(e[i.getId()]=uI(this._editorGroupService,t.group))}Js(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?Jk.RESTORE:void 0,override:t},r=await this._editorService.openEditor({resource:N.revive(e),options:n},GZ(this._editorGroupService,this._configurationService,i.position)),o=lB(r);if(o)return o.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 r=n;if(!r.hasModel()||t.start>=r.getLength())return;const o=r.cellAt(t.start);switch(i){case MF.Default:return r.revealCellRangeInView(t);case MF.InCenter:return r.revealInCenter(o);case MF.InCenterIfOutsideViewport:return r.revealInCenterIfOutsideViewport(o);case MF.AtTop:return r.revealInViewAtTop(o)}}$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}))}};mDe=D([_(1,ti),_(2,$6),_(3,Pr),_(4,Te)],mDe);var Sj;class A3e{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=zoe(e.documents,t.documents),n=ffe(e.textEditors,t.textEditors),r=e.activeEditor!==t.activeEditor?t.activeEditor:void 0,o=ffe(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:r,visibleEditors:o.added.length===0&&o.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 E3e=Sj=class{constructor(e,t,i,n,r,o,a){this._notebookService=i,this._notebookEditorService=n,this._editorService=r,this._editorGroupService=o,this._logService=a,this._disposables=new Z,this._editorListeners=new mr,this._proxy=e.getProxy(Je.ExtHostNotebook),this._mainThreadNotebooks=t.createInstance(pDe,e),this._mainThreadEditors=t.createInstance(mDe,e),e.set(We.MainThreadNotebookDocuments,this._mainThreadNotebooks),e.set(We.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(),Yo(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=lB(this._editorService.activeEditorPane);let r=null;n?r=n.getId():e?.textModel&&(r=e.getId()),r&&!t.has(r)&&(this._logService.trace("MainThreadNotebooksAndEditors#_updateState: active editor is not in editors list",r,t.keys()),r=null);for(const a of this._editorService.visibleEditorPanes){const c=lB(a);c?.hasModel()&&t.has(c.getId())&&i.set(c.getId(),c)}const o=new A3e(new Set(this._notebookService.listNotebookDocuments()),t,r,i);this._onDelta(A3e.delta(this._currentState,o)),this._currentState=o}_onDelta(e){if(Sj._isDeltaEmpty(e))return;const t={removedDocuments:e.removedDocuments,removedEditors:e.removedEditors,newActiveEditor:e.newActiveEditor,visibleEditors:e.visibleEditors,addedDocuments:e.addedDocuments.map(Sj._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(lp.toNotebookCellDto)}}_asEditorAddData(e){const t=this._editorService.visibleEditorPanes.find(i=>lB(i)===e);return{id:e.getId(),documentUri:e.textModel.uri,selections:e.getSelections(),visibleRanges:e.visibleRanges,viewColumn:t&&uI(this._editorGroupService,t.group)}}};E3e=Sj=D([eP,_(1,we),_(2,oE),_(3,$6),_(4,ti),_(5,Pr),_(6,Ke)],E3e);let x3e=class extends V{constructor(e,t){super(),this.messaging=t,this.proxy=e.getProxy(Je.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)}};x3e=D([Ki(We.MainThreadNotebookRenderers),_(1,oZe)],x3e);var U$;(function(s){s[s.Save=1]="Save",s[s.Backup=2]="Backup"})(U$||(U$={}));var Aj,Wp;(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"})(Wp||(Wp={}));var cM;let D3e=(cM=class extends Die{get model(){return this._model}constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v){super(t,o),this.typeId=e,this.name=i,this.modelFactory=n,this.externalResolver=r,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=hC.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 eqe,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,r=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=r}}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,r;try{const o=await this.fileService.stat(this.resource);t=o.mtime,i=o.ctime,n=o.size,r=o.etag,this.setOrphaned(!1)}catch(o){t=Date.now(),i=Date.now(),n=0,r=x_,this.setOrphaned(o.fileOperationResult===ji.FILE_NOT_FOUND)}return this.resolveFromContent({resource:this.resource,name:this.name,mtime:t,ctime:i,size:n,etag:r,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:x_,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=x_:this.lastResolvedFileStat&&(i=this.lastResolvedFileStat.etag);const n=this.versionId;try{const r=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(r,!1)}catch(r){const o=r.fileOperationResult;if(this.setOrphaned(o===ji.FILE_NOT_FOUND),this.isResolved()&&o===ji.FILE_NOT_MODIFIED_SINCE){r instanceof T5&&this.updateLastResolvedFileStat(r.stat);return}if(this.isResolved()&&o===ji.FILE_NOT_FOUND&&!t)return;throw r}}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,Ue.None)),this.installModelListeners(this._model)}async doUpdateModel(e){this.trace("doUpdateModel()"),this.ignoreDirtyOnModelContentChange=!0;try{await this.model?.update(e,Ue.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 $_(this.model.snapshot(U$.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(Wp.CONFLICT)||this.hasState(Wp.ERROR))&&(e.reason===Sn.AUTO||e.reason===Sn.FOCUS_CHANGE||e.reason===Sn.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(Wp.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Sn.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 li;return this.progressService.withProgress({title:g(10700,"Saving '{0}'",this.name),location:fd.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===Sn.AUTO&&typeof this.lastContentChangeFromUndoRedo=="number"){const a=Date.now()-this.lastContentChangeFromUndoRedo;a{try{const a={mtime:r.mtime,etag:t.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(r.resource)?x_:r.etag,unlock:t.writeUnlock};let c;if(typeof o.model.save=="function")try{c=await o.model.save(a,n.token)}catch(l){if(n.token.isCancellationRequested)return;throw l}else{const l=await $_(o.model.snapshot(U$.Save,n.token),n.token);if(n.token.isCancellationRequested)return;n.dispose(),t?.writeElevated&&this.elevatedFileService.isSupported(r.resource)?c=await this.elevatedFileService.writeFileElevated(r.resource,Qn(l),a):c=await this.fileService.writeFile(r.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===ji.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.doHandleSaveError(e,i),this._onDidSaveError.fire()}doHandleSaveError(e,t){const i=e,n=[];let r;if(i.fileOperationResult===ji.FILE_MODIFIED_SINCE)r=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(al({id:"fileWorkingCopy.overwrite",label:g(10703,"Overwrite"),run:()=>this.save({...t,ignoreModifiedSince:!0,reason:Sn.EXPLICIT})})),n.push(al({id:"fileWorkingCopy.revert",label:g(10704,"Discard"),run:()=>this.revert()}));else{const c=i.fileOperationResult===ji.FILE_WRITE_LOCKED,l=c&&i.options?.unlock,d=i.fileOperationResult===ji.FILE_PERMISSION_DENIED,h=this.elevatedFileService.isSupported(this.resource);UCt(e)&&n.push(...e.actions),h&&(d||l)?n.push(al({id:"fileWorkingCopy.saveElevated",label:l?jn?g(10705,"Overwrite as Admin..."):g(10706,"Overwrite as Sudo..."):jn?g(10707,"Retry as Admin..."):g(10708,"Retry as Sudo..."),run:()=>{this.save({...t,writeElevated:!0,writeUnlock:l,reason:Sn.EXPLICIT})}})):c?n.push(al({id:"fileWorkingCopy.unlock",label:g(10703,"Overwrite"),run:()=>this.save({...t,writeUnlock:!0,reason:Sn.EXPLICIT})})):n.push(al({id:"fileWorkingCopy.retry",label:g(10709,"Retry"),run:()=>this.save({...t,reason:Sn.EXPLICIT})})),n.push(al({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:Sn.EXPLICIT})).success||this.doHandleSaveError(e,t))}})),n.push(al({id:"fileWorkingCopy.revert",label:g(10704,"Discard"),run:()=>this.revert()})),c?l&&h?r=jn?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):r=g(10713,"Failed to save '{0}': File is read-only. Select 'Overwrite' to attempt to make it writeable.",this.name):h&&d?r=jn?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):r=g(10716,"Failed to save '{0}': {1}",this.name,Po(e,!1))}const o=this.notificationService.notify({id:`${Hc(this.resource.toString())}`,severity:Ze.Error,message:r,actions:{primary:n}}),a=this._register(M.once(M.any(this.onDidSave,this.onDidRevert))(()=>o.close()));this._register(M.once(o.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(r){if(r.fileOperationResult!==ji.FILE_NOT_FOUND)throw i(),r}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}hasState(e){switch(e){case Wp.CONFLICT:return this.inConflictMode;case Wp.DIRTY:return this.dirty;case Wp.ERROR:return this.inErrorMode;case Wp.ORPHAN:return this.isOrphaned();case Wp.PENDING_SAVE:return this.saveSequentializer.isRunning();case Wp.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()}},Aj=cM,cM.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,cM);D3e=Aj=D([_(5,Xt),_(6,Ke),_(7,qb),_(8,bd),_(9,X6),_(10,Pm),_(11,wi),_(12,OZe),_(13,ti),_(14,Q6),_(15,hg)],D3e);var XP;let k3e=XP=class extends BI{constructor(e,t,i,n,r,o){super(),this.resource=e,this._hasAssociatedFilePath=t,this.viewType=i,this._workingCopyManager=n,this._filesConfigurationService=o,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=r}dispose(){this._workingCopy?.dispose(),super.dispose()}get notebook(){return this._workingCopy?.model?.notebookModel}isResolved(){return!!this._workingCopy?.model?.notebookModel}async canDispose(){return this._workingCopy&&XP._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopyManager.stored.canDispose(this._workingCopy):!0}isDirty(){return this._workingCopy?.isDirty()??!1}isModified(){return this._workingCopy?.isModified()??!1}isOrphaned(){return XP._isStoredFileWorkingCopy(this._workingCopy)&&this._workingCopy.hasState(Wp.ORPHAN)}hasAssociatedFilePath(){return!XP._isStoredFileWorkingCopy(this._workingCopy)&&!!this._workingCopy?.hasAssociatedFilePath}isReadonly(){return XP._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopy?.isReadonly():this._filesConfigurationService.isReadonly(this.resource)}get hasErrorState(){return this._workingCopy&&"hasState"in this._workingCopy?this._workingCopy.hasState(Wp.ERROR):!1}revert(e){return Lt(this.isResolved()),this._workingCopy.revert(e)}save(e){return Lt(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}),Lt(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&hC.Untitled)}};k3e=XP=D([_(5,bd)],k3e);class Drt extends V{constructor(e,t,i,n,r){super(),this._notebookModel=e,this._notebookService=t,this._configurationService=i,this._telemetryService=n,this._logService=r,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!==El.Initialize&&!c.transient){this._onDidChangeContent.fire({isRedoing:!1,isUndoing:!1,isInitial:!1});break}}));const o=this._configurationService.getValue(oEe.remoteSaving);(o||e.uri.scheme===pe.vscodeRemote)&&(this.configuration={backupDelay:1e4}),o&&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 Pa;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:Mj(this._notebookModel.metadata,a=>!i.options.transientDocumentMetadata[a]),cells:[]};let r=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(oEe.outputBackupSizeLimit)*1024;if(e===U$.Backup&&l>0&&(a.outputs.forEach(d=>{d.outputs.forEach(h=>{r+=h.data.byteLength})}),r>l))throw new Error("Notebook too large to backup");c.outputs=i.options.transientOutputs?[]:a.outputs,c.metadata=Mj(a.metadata,d=>!i.options.transientCellMetadata[d]),n.cells.push(c)}const o=await i.notebookToData(n);if(t.isCancellationRequested)throw new Pa;return g6(o)}async update(e,t){const i=await this.getNotebookSerializer(),n=await oD(e),r=await i.dataToNotebook(n);if(t.isCancellationRequested)throw new Pa;this._notebookModel.reset(r.cells,r.metadata,i.options)}async getNotebookSerializer(){const e=await this._notebookService.withNotebookDataProvider(this.notebookModel.viewType);if(!(e instanceof SG))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,r){this._viewType=e,this._notebookService=t,this._configurationService=i,this._telemetryService=n,this._logService=r}async createModel(e,t,i){const n=await this._notebookService.withNotebookDataProvider(this._viewType);if(!(n instanceof SG))throw new Error("CANNOT open file notebook with this provider");const r=await oD(t),o=await n.serializer.dataToNotebook(r);if(i.isCancellationRequested)throw new Pa;const a=this._notebookService.createNotebookTextModel(n.viewType,e,o,n.serializer.options);return new Drt(a,this._notebookService,this._configurationService,this._telemetryService,this._logService)}};I3e=D([_(1,oE),_(2,Te),_(3,Ji),_(4,Ke)],I3e);let YYt=class{constructor(e){this._proxy=e.getProxy(Je.ExtHostNotebookDocumentSaveParticipant)}async participate(e,t,i,n){if(!e.model||!(e.model instanceof Drt))return;let r;const o=new Promise((a,c)=>{r=setTimeout(()=>c(new Error(g(4874,"Aborted onWillSaveNotebookDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason,n).then(l=>{clearTimeout(r)}).then(a,c)});return Zoe(o,n)}},T3e=class{constructor(e,t,i){this.workingCopyFileService=i,this._saveParticipantDisposable=this.workingCopyFileService.addSaveParticipant(t.createInstance(YYt,e))}dispose(){this._saveParticipantDisposable.dispose()}};T3e=D([eP,_(1,we),_(2,qb)],T3e);let L3e=class{constructor(e,t){this._disposables=new Z,this._proxy=e.getProxy(Je.ExtHostInteractive),this._disposables.add(t.onWillAddInteractiveDocument(i=>{this._proxy.$willAddInteractiveDocument(i.inputUri,` +`,Sa,i.notebookUri)})),this._disposables.add(t.onWillRemoveInteractiveDocument(i=>{this._proxy.$willRemoveInteractiveDocument(i.inputUri,i.notebookUri)}))}dispose(){this._disposables.dispose()}};L3e=D([Ki(We.MainThreadInteractive),_(1,DMe)],L3e);const JYt={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 _De;(function(s){function e(t,i,n){if(!t)return;const r=Rt(t.type)?t.type:void 0;if(!r||r.length===0){n.error(g(6667,"The task type configuration is missing the required 'taskType' property"));return}const o=[];if(Array.isArray(t.required))for(const a of t.required)Rt(a)&&o.push(a);return{extensionId:i.value,taskType:r,required:o,properties:t.properties?Ds(t.properties):{},when:t.when?he.deserialize(t.when):void 0}}s.from=e})(_De||(_De={}));const XYt=ih.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:JYt}});class ZYt{constructor(){this._onDefinitionsChanged=new I,this.onDefinitionsChanged=this._onDefinitionsChanged.event,this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{XYt.setHandler((i,n)=>{this._schema=void 0;try{for(const r of n.removed){const o=r.value;for(const a of o)this.taskTypes&&a.type&&this.taskTypes[a.type]&&delete this.taskTypes[a.type]}for(const r of n.added){const o=r.value;for(const a of o){const c=_De.from(a,r.description.identifier,r.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=Ds(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 eJt=new ZYt,krt="settings";new Q("taskRunning",!1,g(3790,"Whether a task is currently running."));Pe(3791,"Tasks");var Lie;(function(s){s[s.Escape=1]="Escape",s[s.Strong=2]="Strong",s[s.Weak=3]="Weak"})(Lie||(Lie={}));const Irt="$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})(Lie||(Lie={}));var V$;(function(s){s.defaults={cwd:"${workspaceFolder}"}})(V$||(V$={}));var z$;(function(s){s[s.Always=1]="Always",s[s.Silent=2]="Silent",s[s.Never=3]="Never"})(z$||(z$={}));(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})(z$||(z$={}));var $$;(function(s){s[s.Never=1]="Never",s[s.OnProblem=2]="OnProblem",s[s.Always=3]="Always"})($$||($$={}));(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})($$||($$={}));var G$;(function(s){s[s.Shared=1]="Shared",s[s.Dedicated=2]="Dedicated",s[s.New=3]="New"})(G$||(G$={}));(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})(G$||(G$={}));var Rie;(function(s){s.defaults={echo:!0,reveal:z$.Always,revealProblems:$$.Never,focus:!1,panel:G$.Shared,showReuseMessage:!0,clear:!1}})(Rie||(Rie={}));var dm;(function(s){s[s.Shell=1]="Shell",s[s.Process=2]="Process",s[s.CustomExecution=3]="CustomExecution"})(dm||(dm={}));(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})(dm||(dm={}));var R3e;(function(s){function e(t){return Rt(t)?t:t.value}s.value=e})(R3e||(R3e={}));var M3e;(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 Rt(i)?e(i)?{_id:i,isDefault:!1}:void 0:i}s.from=t})(M3e||(M3e={}));var hx;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace",s[s.Folder=3]="Folder"})(hx||(hx={}));var bA;(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 At.USER;case s.WorkspaceFile:return At.WORKSPACE;default:return At.WORKSPACE_FOLDER}}s.toConfigurationTarget=e})(bA||(bA={}));var N3e;(function(s){s.parallel="parallel",s.sequence="sequence"})(N3e||(N3e={}));var vDe;(function(s){s[s.default=1]="default",s[s.folderOpen=2]="folderOpen"})(vDe||(vDe={}));var Mie;(function(s){s.defaults={reevaluateOnRerun:!0,runOn:vDe.default,instanceLimit:1}})(Mie||(Mie={}));class GPe{constructor(e,t,i,n,r,o){this._label="",this._id=e,t&&(this._label=t),i&&(this.type=i),this.runOptions=n,this.configurationProperties=r,this._source=o}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(Rt(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 Sz extends GPe{constructor(e,t,i,n,r,o,a,c){super(e,i,void 0,a,c,t),this.command={},this._source=t,this.hasDefinedMatchers=o,r&&(this.command=r)}clone(){return new Sz(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 dm.Shell:t="shell";break;case dm.Process:t="process";break;case dm.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 Sz}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===bA.User?krt: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!==bA.Workspace&&(t+=this._source.kind),JSON.stringify({type:Irt,folder:e,id:t})}getWorkspaceFolder(){return this._source.config.workspaceFolder}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?vi(this._source.config.workspace.configuration):void 0}getTelemetryKind(){return this._source.customizes?"workspace>extension":"workspace"}fromObject(e){return new Sz(e._id,e._source,e._label,e.type,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}class Az extends GPe{constructor(e,t,i,n,r,o,a){super(e,i,n,o,a,t),this._source=t,this.configures=r}static is(e){return e instanceof Az}fromObject(e){return e}getDefinition(){return this.configures}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?vi(this._source.config.workspace.configuration):void 0}getWorkspaceFolder(){return this._source.config.workspaceFolder}getFolderId(){return this._source.kind===bA.User?krt:this._source.config.workspaceFolder?.uri.toString()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==bA.Workspace&&(t+=this._source.kind),JSON.stringify({type:Irt,folder:e,id:t})}}class oL extends GPe{constructor(e,t,i,n,r,o,a,c,l){super(e,i,n,c,l,t),this.defines=r,this.hasDefinedMatchers=a,this.command=o,this.icon=l.icon,this.hide=l.hide}clone(){return new oL(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 oL}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===hx.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 oL(e._id,e._source,e._label,e.type,e.defines,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}var Nie;(function(s){s[s.Process=1]="Process",s[s.Terminal=2]="Terminal"})(Nie||(Nie={}));(function(s){s._default=s.Terminal})(Nie||(Nie={}));var P3e;(function(s){s[s.V0_1_0=1]="V0_1_0",s[s.V2_0_0=2]="V2_0_0"})(P3e||(P3e={}));var w_;(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"})(w_||(w_={}));var Pie;(function(s){s.SingleRun="singleRun",s.Background="background"})(Pie||(Pie={}));var F3e;(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"})(F3e||(F3e={}));var O3e;(function(s){function e(c){return{taskId:c._id,taskName:c.configurationProperties.name,runType:c.configurationProperties.isBackground?Pie.Background:Pie.SingleRun,group:c.configurationProperties.group,__task:c}}function t(c,l,d){return{...e(c),kind:w_.Start,terminalId:l,resolvedVariables:d}}s.start=t;function i(c,l,d){return{...e(c),kind:w_.ProcessStarted,terminalId:l,processId:d}}s.processStarted=i;function n(c,l,d){return{...e(c),kind:w_.ProcessEnded,terminalId:l,exitCode:d}}s.processEnded=n;function r(c,l,d){return{...e(c),kind:w_.Terminated,exitReason:d,terminalId:l}}s.terminated=r;function o(c,l,d){return{...e(l),kind:c,terminalId:d}}s.general=o;function a(){return{kind:w_.Changed}}s.changed=a})(O3e||(O3e={}));var Fie;(function(s){function e(i){const n=Object.keys(i).sort();let r="";for(const o of n){let a=i[o];a instanceof Object?a=e(a):typeof a=="string"&&(a=a.replace(/,/g,",,")),r+=o+","+a+","}return r}function t(i){const r={_key:e(i),type:i.taskType};return Object.assign(r,i),r}s.create=t})(Fie||(Fie={}));var B3e;(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"})(B3e||(B3e={}));var W3e;(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"})(W3e||(W3e={}));var bDe;(function(s){function e(t,i){const n=eJt.get(t.type);if(n===void 0){const c=Ds(t);return delete c._key,Fie.create(c)}const r=Object.create(null);r.type=n.taskType;const o=new Set;n.required.forEach(c=>o.add(c));const a=n.properties;for(const c of Object.keys(a)){const l=t[c];if(l!=null)r[c]=l;else if(o.has(c)){const d=a[c];if(d.default!==void 0)r[c]=Ds(d.default);else switch(d.type){case"boolean":r[c]=!1;break;case"number":case"integer":r[c]=0;break;case"string":r[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 Fie.create(r)}s.createTaskIdentifier=e})(bDe||(bDe={}));var Oie;(function(s){function e(t){return{id:t.id,task:Mf.from(t.task)}}s.from=e})(Oie||(Oie={}));var wDe;(function(s){function e(t,i){return{id:t.id,processId:i}}s.from=e})(wDe||(wDe={}));var yDe;(function(s){function e(t,i){return{id:t.id,exitCode:i}}s.from=e})(yDe||(yDe={}));var Bie;(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 r=bDe.createTaskIdentifier(i,console);return r===void 0&&n&&(r={_key:ao(),type:"$executeOnly"}),r}s.to=t})(Bie||(Bie={}));var Wie;(function(s){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}s.from=e;function t(i){return i==null?Rie.defaults:Object.assign(Object.create(null),Rie.defaults,i)}s.to=t})(Wie||(Wie={}));var Hie;(function(s){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}s.from=e;function t(i){return i==null?Mie.defaults:Object.assign(Object.create(null),Mie.defaults,i)}s.to=t})(Hie||(Hie={}));var Uie;(function(s){function e(i){if(i!=null)return{cwd:i.cwd,env:i.env}}s.from=e;function t(i){return i==null?V$.defaults:{cwd:i.cwd||V$.defaults.cwd,env:i.env}}s.to=t})(Uie||(Uie={}));var Ez;(function(s){function e(n){const r=n;return r&&!!r.process}s.is=e;function t(n){const r=Rt(n.name)?n.name:n.name.value,o=n.args?n.args.map(c=>Rt(c)?c:c.value):[],a={process:r,args:o};return n.options&&(a.options=Uie.from(n.options)),a}s.from=t;function i(n){const r={runtime:dm.Process,name:n.process,args:n.args,presentation:void 0};return r.options=Uie.to(n.options),r}s.to=i})(Ez||(Ez={}));var Vie;(function(s){function e(i){if(i==null)return;const n={cwd:i.cwd||V$.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})(Vie||(Vie={}));var xz;(function(s){function e(n){const r=n;return r&&(!!r.commandLine||!!r.command)}s.is=e;function t(n){const r={};return n.name&&Rt(n.name)&&(n.args===void 0||n.args===null||n.args.length===0)?r.commandLine=n.name:(r.command=n.name,r.args=n.args),n.options&&(r.options=Vie.from(n.options)),r}s.from=t;function i(n){const r={runtime:dm.Shell,name:n.commandLine?n.commandLine:n.command,args:n.args,presentation:void 0};return n.options&&(r.options=Vie.to(n.options)),r}s.to=i})(xz||(xz={}));var q1;(function(s){function e(n){const r=n;return r&&r.customExecution==="customExecution"}s.is=e;function t(n){return{customExecution:"customExecution"}}s.from=t;function i(n){return{runtime:dm.CustomExecution,presentation:void 0}}s.to=i})(q1||(q1={}));var zie;(function(s){function e(i){const n={label:i.label};return i.kind===bA.Extension?(n.extensionId=i.extension,i.workspaceFolder?n.scope=i.workspaceFolder.uri:n.scope=i.scope):i.kind===bA.Workspace&&(n.extensionId="$core",n.scope=i.config.workspaceFolder?i.config.workspaceFolder.uri:hx.Global),n}s.from=e;function t(i,n){let r,o;return i.scope===void 0||typeof i.scope=="number"&&i.scope!==hx.Global?n.getWorkspace().folders.length===0?(r=hx.Global,o=void 0):(r=hx.Folder,o=n.getWorkspace().folders[0]):typeof i.scope=="number"?r=i.scope:(r=hx.Folder,o=n.getWorkspaceFolder(N.revive(i.scope))??void 0),{kind:bA.Extension,label:i.label,extension:i.extensionId,scope:r,workspaceFolder:o}}s.to=t})(zie||(zie={}));var $ie;(function(s){function e(t){const i=t;return i&&Rt(i.id)&&!!i.workspaceFolder}s.is=e})($ie||($ie={}));var Mf;(function(s){function e(i){if(i==null||!Sz.is(i)&&!oL.is(i)&&!Az.is(i))return;const n={_id:i._id,name:i.configurationProperties.name,definition:Bie.from(i.getDefinition(!0)),source:zie.from(i._source),execution:void 0,presentationOptions:!Az.is(i)&&i.command?Wie.from(i.command.presentation):void 0,isBackground:i.configurationProperties.isBackground,problemMatchers:[],hasDefinedMatchers:oL.is(i)?i.hasDefinedMatchers:!1,runOptions:Hie.from(i.runOptions)};if(n.group=CDe.from(i.configurationProperties.group),i.configurationProperties.detail&&(n.detail=i.configurationProperties.detail),!Az.is(i)&&i.command)switch(i.command.runtime){case dm.Process:n.execution=Ez.from(i.command);break;case dm.Shell:n.execution=xz.from(i.command);break;case dm.CustomExecution:n.execution=q1.from(i.command);break}if(i.configurationProperties.problemMatchers)for(const r of i.configurationProperties.problemMatchers)Rt(r)&&n.problemMatchers.push(r);return n}s.from=e;function t(i,n,r,o,a){if(!i||typeof i.name!="string")return;let c;if(i.execution&&(xz.is(i.execution)?c=xz.to(i.execution):Ez.is(i.execution)?c=Ez.to(i.execution):q1.is(i.execution)&&(c=q1.to(i.execution))),!c)return;c.presentation=Wie.to(i.presentationOptions);const l=zie.to(i.source,n),d=g(4875,"{0}: {1}",l.label,i.name),h=Bie.to(i.definition,r),u=q1.is(i.execution)&&i._id?i._id:`${i.source.extensionId}.${h._key}`;return new oL(u,l,d,h.type,h,c,i.hasDefinedMatchers,Hie.to(i.runOptions),{name:i.name,identifier:d,group:i.group,isBackground:!!i.isBackground,problemMatchers:i.problemMatchers.slice(),detail:i.detail,icon:o,hide:a})}s.to=t})(Mf||(Mf={}));var CDe;(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})(CDe||(CDe={}));var SDe;(function(s){function e(i){return i}s.from=e;function t(i){return i}s.to=t})(SDe||(SDe={}));let H3e=class extends V{constructor(e,t,i,n){super(),this._taskService=t,this._workspaceContextServer=i,this._configurationResolverService=n,this._proxy=e.getProxy(Je.ExtHostTask),this._providers=new Map,this._register(this._taskService.onDidStateChange(async r=>{if(r.kind===w_.Changed)return;const o=r.__task;if(r.kind===w_.Start){const a=Oie.from(o.getTaskExecution());let c=a.task.definition;if(a.task?.execution&&q1.is(a.task.execution)&&r.resolvedVariables){const l={};for(const[d,h]of r.resolvedVariables.entries())l[d]=h;c=await this._configurationResolverService.resolveAnyAsync(o.getWorkspaceFolder(),a.task.definition,l)}this._proxy.$onDidStartTask(a,r.terminalId,c)}else r.kind===w_.ProcessStarted?this._proxy.$onDidStartTaskProcess(wDe.from(o.getTaskExecution(),r.processId)):r.kind===w_.ProcessEnded?this._proxy.$onDidEndTaskProcess(yDe.from(o.getTaskExecution(),r.exitCode)):r.kind===w_.End&&this._proxy.$OnDidEndTask(Oie.from(o.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=Mf.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:r=>Promise.resolve(this._proxy.$provideTasks(e,r)).then(o=>{const a=[];for(const c of o.tasks){const l=Mf.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:o.extension}}),resolveTask:r=>{const o=Mf.from(r);return o?(o.name=o.name===void 0?"":o.name,Promise.resolve(this._proxy.$resolveTask(e,o)).then(a=>{if(a)return Mf.to(a,this._workspaceContextServer,!0,r.configurationProperties.icon,r.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(SDe.to(e)).then(t=>{const i=[];for(const n of t){const r=Mf.from(n);r&&i.push(r)}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($ie.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:Mf.from(i)};throw new Error("Task not found")}else throw new Error("No workspace folder")}else{const t=Mf.to(e,this._workspaceContextServer,!0);return{id:t._id,task:Mf.from(t)}}}$executeTask(e){return new Promise((t,i)=>{if($ie.is(e)){const n=this.getWorkspace(e.workspaceFolder);n?this._taskService.getTask(n,e.id,!0).then(r=>{if(!r)i(new Error("Task not found"));else{const o={id:e.id,task:Mf.from(r)};this._taskService.run(r).then(a=>{(a?.exitCode===void 0||a.exitCode!==0)&&this._proxy.$OnDidEndTask(o)},a=>{}),t(o)}},r=>{i(new Error("Task not found"))}):i(new Error("No workspace folder"))}else{const n=Mf.to(e,this._workspaceContextServer,!0);this._taskService.run(n).then(void 0,o=>{});const r={id:n._id,task:Mf.from(n)};t(r)}})}$customExecutionComplete(e,t){return new Promise((i,n)=>{this._taskService.getActiveTasks().then(r=>{for(const o of r)if(e===o._id){this._taskService.extensionCallbackTaskComplete(o,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 r of n)if(e===r._id){this._taskService.terminate(r).then(o=>{t(void 0)},o=>{i(void 0)});return}i(new Ma("Task to terminate not found"))})})}$registerTaskSystem(e,t){let i;switch(t.platform){case"Web":i=Qd.Web;break;case"win32":i=Qd.Windows;break;case"darwin":i=Qd.Mac;break;case"linux":i=Qd.Linux;break;default:i=eKe}this._taskService.registerTaskSystem(e,{platform:i,uriProvider:n=>N.from({scheme:t.scheme,authority:t.authority,path:n}),context:this._extHostContext,resolveVariables:(n,r,o)=>{const a=[];return r.variables.forEach(c=>a.push(c)),Promise.resolve(this._proxy.$resolveVariables(n.uri,{process:r.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,o).then(u=>{u||d(void 0);const f={process:void 0,variables:new Map};for(let p=0;p{h(u)})})})},findExecutable:(n,r,o)=>this._proxy.$findExecutable(n,r,o)})}async $registerSupportedExecutions(e,t,i){return this._taskService.registerSupportedExecutions(e,t,i)}};H3e=D([Ki(We.MainThreadTask),_(1,lZe),_(2,Ci),_(3,RMe)],H3e);let U3e=class extends V{constructor(e,t){super(),this._labelService=t,this._resourceLabelFormatters=this._register(new mr)}$registerResourceLabelFormatter(e,t){t.priority=!0;const i=this._labelService.registerCachedFormatter(t);this._resourceLabelFormatters.set(e,i)}$unregisterResourceLabelFormatter(e){this._resourceLabelFormatters.deleteAndDispose(e)}};U3e=D([Ki(We.MainThreadLabelService),_(1,Os)],U3e);var Fp;(function(s){s.Http="http",s.Https="https"})(Fp||(Fp={}));var FS;(function(s){s.ConstantPrivate="constantPrivate",s.Private="private",s.Public="public"})(FS||(FS={}));var zE;(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"})(zE||(zE={}));function tJt(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 K$=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];function q$(s){return K$.indexOf(s)>=0}const Gie=["0.0.0.0","0:0:0:0:0:0:0:0","::"];function Q$(s){return Gie.indexOf(s)>=0}class iJt{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 V3e=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 r of n){const o=await r.value;o&&typeof o!="string"&&e.push(o)}}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,r){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:i,privacy:n,protocol:r,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(Q$(e)||q$(e))&&(e=K$[0]);const i=this.getTunnelFromMap(e,t);if(i)return++i.refcount,i.value}openTunnel(e,t,i,n,r,o=!1,a,c){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${t}:${i} on local port ${r}.`);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,r,o,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 r=>{r&&typeof r!="string"&&(await r.dispose(!0),this._onTunnelClosed.fire({host:r.tunnelRemoteHost,port:r.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),r=n?await n.value:void 0;(!r||typeof r=="string")&&i.delete(t),i.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){const i=[e];q$(e)?(i.push(...K$),i.push(...Gie)):Q$(e)&&i.push(...Gie);const n=i.map(r=>this._tunnels.get(r));for(const r of n){const o=r?.get(t);if(o)return o}}canTunnel(e){return!!tJt(e)}createWithProvider(e,t,i,n,r,o,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:r?this.isPortPrivileged(l):!1},h={remoteAddress:{host:t,port:i},localAddressPort:n,privacy:o,public:o?o!==FS.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}};V3e=D([_(0,Ke),_(1,Te)],V3e);const bu=ae("IExtHostInitDataService"),Jr=ae("IExtHostRpcService");class nJt{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 sJt extends iJt{}var Kie;(function(s){function e(i){return{remoteAddress:i.remoteAddress,localAddress:i.localAddress,public:!!i.public,privacy:i.privacy??(i.public?FS.Public:FS.Private),protocol:i.protocol}}s.fromApiTunnel=e;function t(i){return{remoteAddress:{host:i.tunnelRemoteHost,port:i.tunnelRemotePort},localAddress:i.localAddress,public:i.privacy!==FS.ConstantPrivate&&i.privacy!==FS.ConstantPrivate,privacy:i.privacy,protocol:i.protocol}}s.fromServiceTunnel=t})(Kie||(Kie={}));const KPe=ae("IExtHostTunnelService");let ADe=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(We.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 sJt(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 js(()=>{this._portAttributesProviders.delete(i),this._proxy.$unregisterPortsAttributesProvider(i)})}async $providePortAttributes(e,t,i,n,r){const o=[];for(const c of e){const l=this._portAttributesProviders.get(c);if(!l)return[];o.push(...await Promise.all(t.map(async d=>{let h;try{h=await l.provider.providePortAttributes({port:d,pid:i,commandLine:n},r)}catch{h=await l.provider.providePortAttributes(d,i,n,r)}return{providedAttributes:h,port:d}})))}const a=o.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,r)=>await e.provideTunnel(n,r,Ue.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 r=e.tunnelFeatures?{elevation:!!e.tunnelFeatures?.elevation,public:!!e.tunnelFeatures?.public,privacyOptions:n,protocol:!0}:void 0;this._proxy.$setTunnelProvider(r)}}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 r=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:r}),Kie.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,r)=>t[r]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${e.map(n=>n.port).join(", ")} to ${i.map(n=>n.port).join(", ")}`),i}};ADe=D([_(0,Jr),_(1,bu),_(2,Ke)],ADe);const rJt=10*1e3,jK="remote.tunnels.toRestore",ige="remote.tunnels.toRestoreExpiration",oJt=1e3*60*60*24*14,z3e="onTunnel",Trt=new Q("forwardedPortsViewEnabled",!1,g(8676,"Whether the Ports view is enabled."));function aJt(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 aL;(function(s){s.Other="Other",s.User="User",s.AutoForwardEnd="AutoForwardEnd"})(aL||(aL={}));var pb;(function(s){s[s.User=0]="User",s[s.Auto=1]="Auto",s[s.Extension=2]="Extension"})(pb||(pb={}));const nge={source:pb.User,description:g(8677,"User Forwarded")};pb.Auto,g(8678,"Auto Forwarded");function $3e(s,e,t){const i=s.get(Rg(e,t));if(i)return i;if(q$(e))for(const n of K$){const r=Rg(n,t);if(s.has(r))return s.get(r)}else if(Q$(e))for(const n of Gie){const r=Rg(n,t);if(s.has(r))return s.get(r)}}function yg(s,e,t){const i=$3e(s,e,t);if(i)return i;const n=Q$(e)?"localhost":q$(e)?"0.0.0.0":void 0;if(n)return $3e(s,n,t)}function Rg(s,e){return s+":"+e}var $E;(function(s){s.Notify="notify",s.OpenBrowser="openBrowser",s.OpenBrowserOnce="openBrowserOnce",s.OpenPreview="openPreview",s.Silent="silent",s.Ignore="ignore"})($E||($E={}));function cJt(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 Su=class Su 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(Su.SETTING)||t.affectsConfiguration(Su.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 r={label:void 0,onAutoForward:void 0,elevateIfNeeded:void 0,requireLocalPort:void 0,protocol:void 0};for(;n>=0;){const o=this.portsAttributes[n];o.key===e?(r.onAutoForward=o.onAutoForward??r.onAutoForward,r.elevateIfNeeded=o.elevateIfNeeded!==void 0?o.elevateIfNeeded:r.elevateIfNeeded,r.label=o.label??r.label,r.requireLocalPort=o.requireLocalPort,r.protocol=o.protocol):(r.onAutoForward=r.onAutoForward??o.onAutoForward,r.elevateIfNeeded=r.elevateIfNeeded!==void 0?r.elevateIfNeeded:o.elevateIfNeeded,r.label=r.label??o.label,r.requireLocalPort=r.requireLocalPort!==void 0?r.requireLocalPort:void 0,r.protocol=r.protocol??o.protocol),n=this.findNextIndex(e,t,i,this.portsAttributes,n+1)}return r.onAutoForward!==void 0||r.elevateIfNeeded!==void 0||r.label!==void 0||r.requireLocalPort!==void 0||r.protocol!==void 0?r:this.getOtherAttributes()}hasStartEnd(e){return e.start!==void 0&&e.end!==void 0}hasHostAndPort(e){return e.host!==void 0&&e.port!==void 0&&Rt(e.host)&&dc(e.port)}findNextIndex(e,t,i,n,r){if(r>=n.length)return-1;const o=!q$(t)&&!Q$(t),c=n.slice(r).findIndex(l=>dc(l.key)?o?!1:l.key===e:this.hasStartEnd(l.key)?o?!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+r:-1}readSetting(){const e=this.configurationService.getValue(Su.SETTING);if(!e||!In(e))return[];const t=[];for(const n in e){if(n===void 0)continue;const r=e[n];let o;if(Number(n))o=Number(n);else if(Rt(n))if(Su.RANGE.test(n)){const a=n.match(Su.RANGE);o={start:Number(a[1]),end:Number(a[2])}}else if(Su.HOST_AND_PORT.test(n)){const a=n.match(Su.HOST_AND_PORT);o={host:a[1],port:Number(a[2])}}else{let a;try{a=RegExp(n)}catch{}a&&(o=a)}o&&t.push({key:o,elevateIfNeeded:r.elevateIfNeeded,onAutoForward:r.onAutoForward,label:r.label,requireLocalPort:r.requireLocalPort,protocol:r.protocol})}const i=this.configurationService.getValue(Su.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 dc(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 zE.Notify:return $E.Notify;case zE.OpenBrowser:return $E.OpenBrowser;case zE.OpenBrowserOnce:return $E.OpenBrowserOnce;case zE.OpenPreview:return $E.OpenPreview;case zE.Silent:return $E.Silent;case zE.Ignore:return $E.Ignore;default:return}}async addAttributes(e,t,i){const r=this.configurationService.inspect(Su.SETTING).userRemoteValue;let o;!r||!In(r)?o={}:o=Ds(r),o[`${e}`]||(o[`${e}`]={});for(const a in t)o[`${e}`][a]=t[a];return this.configurationService.updateValue(Su.SETTING,o,i)}};Su.SETTING="remote.portsAttributes",Su.DEFAULTS="remote.otherPortsAttributes",Su.RANGE=/^(\d+)\-(\d+)$/,Su.HOST_AND_PORT=/^([a-z0-9\-]+):(\d{1,5})$/;let qie=Su,j$=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this.tunnelService=e,this.storageService=t,this.configurationService=i,this.environmentService=n,this.remoteAuthorityResolverService=r,this.workspaceContextService=o,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 qie(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=Rg(f.tunnelRemoteHost,f.tunnelRemotePort),m=yg(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??Fp.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:nge}),this.remoteTunnels.set(p,f)}}),this.detected=new Map,this._register(this.tunnelService.onTunnelOpened(async h=>{const u=Rg(h.tunnelRemoteHost,h.tunnelRemotePort);if(!yg(this.forwarded,h.tunnelRemoteHost,h.tunnelRemotePort)&&!yg(this.detected,h.tunnelRemoteHost,h.tunnelRemotePort)&&!yg(this.inProgress,h.tunnelRemoteHost,h.tunnelRemotePort)&&h.localAddress){const f=yg(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??Fp.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:nge})}await this.storeForwarded(),this.remoteTunnels.set(u,h),this._onForwardPort.fire(this.forwarded.get(u))})),this._register(this.tunnelService.onTunnelClosed(h=>this.onTunnelClosed(h,aL.Other))),this.checkExtensionActivationEvents()}extensionHasActivationEvent(){return this.extensionService.extensions.find(e=>e.activationEvents?.includes(z3e))?(this.contextKeyService.createKey(Trt.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=Rg(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?Hc(t.configuration.path):t.folders.length>0?Hc(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(jK)}async getRestoreExpirationStorageKey(){return this.addStorageKeyPostfix(ige)}async getTunnelRestoreValue(){const e=this.storageService.get(jK,Ie.WORKSPACE);if(e)return this.storageService.remove(jK,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=yg(this.detected,i.remoteHost,i.remotePort);i.source.source!==pb.Extension&&!n||i.source.source===pb.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===pb.Extension&&!n&&this.unrestoredExtensionTunnels.set(Rg(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,cn.USER).filter(t=>t.startsWith(ige));for(const t of e){const i=this.storageService.getNumber(t,Ie.PROFILE);if(i&&i({remoteHost:o.remoteHost,remotePort:o.remotePort,localPort:o.localPort,name:o.name,localAddress:o.localAddress,localUri:o.localUri,protocol:o.protocol,source:o.source}));let i;e.length>0&&(i=JSON.stringify(t));const n=await this.getTunnelRestoreStorageKey(),r=await this.getRestoreExpirationStorageKey();!i&&n&&r?(this.storageService.remove(n,Ie.PROFILE),this.storageService.remove(r,Ie.PROFILE)):i!==this.knownPortsRestoreValue&&n&&r&&(this.storageService.store(n,i,Ie.PROFILE,cn.USER),this.storageService.store(r,Date.now()+oJt,Ie.PROFILE,cn.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()+rJt>n.getTime())return;this.mismatchCooldown=n;const r=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(r)}async forward(e,t){return!this.restoreComplete&&this.environmentService.remoteAuthority&&await M.toPromise(this.onRestoreComplete.event),this.doForward(e,t)}async doForward(e,t){await this.extensionService.activateByEvent(z3e);const i=yg(this.forwarded,e.remote.host,e.remote.port);t=t??(t!==null?(await this.getAttributes([e.remote]))?.get(e.remote.port):void 0);const n=e.local!==void 0?e.local:e.remote.port;let r;if(i)return this.mergeAttributesIntoExistingTunnel(i,e,t);{const o=this.environmentService.remoteAuthority,a=o?{getAddress:async()=>(await this.remoteAuthorityResolverService.resolveAuthority(o)).authority}:void 0,c=Rg(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")r=l;else if(l&&l.localAddress){const d=yg(this._candidates??new Map,e.remote.host,e.remote.port),h=l.protocol?l.protocol===Fp.Https?Fp.Https:Fp.Http:t?.protocol??Fp.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??nge,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 r}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 r;(function(a){a[a.None=0]="None",a[a.Fire=1]="Fire",a[a.Reopen=2]="Reopen"})(r||(r={}));let o=r.None;switch(n!==e.name&&(e.name=n,o=r.Fire),(i?.protocol||e.protocol!==Fp.Http)&&i?.protocol!==e.protocol&&(t.source=e.source,o=r.Reopen),t.privacy&&e.privacy!==t.privacy&&(o=r.Reopen),o){case r.Fire:{this._onForwardPort.fire();break}case r.Reopen:await this.close(e.remoteHost,e.remotePort,aL.User),await this.doForward(t,i)}return yg(this.remoteTunnels,t.remote.host,t.remote.port)}async name(e,t,i){const n=yg(this.forwarded,e,t),r=Rg(e,t);if(n){n.name=i,await this.storeForwarded(),this._onPortName.fire({host:e,port:t});return}else this.detected.has(r)&&(this.detected.get(r).name=i,this._onPortName.fire({host:e,port:t}))}async close(e,t,i){const n=Rg(e,t),r=this.forwarded.get(n);return i===aL.AutoForwardEnd&&r&&r.source.source===pb.Auto&&this.sessionCachedProperties.set(n,{local:r.localPort,name:r.name,privacy:r.privacy}),await this.tunnelService.closeTunnel(e,t),this.onTunnelClosed({host:e,port:t},i)}address(e,t){const i=Rg(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=yg(this._candidates??new Map,t.remoteAddress.host,t.remoteAddress.port),n=typeof t.localAddress=="string"?t.localAddress:Rg(t.localAddress.host,t.localAddress.port);this.detected.set(Rg(t.remoteAddress.host,t.remoteAddress.port),{remoteHost:t.remoteAddress.host,remotePort:t.remoteAddress.port,localAddress:n,protocol:Fp.Http,localUri:this.makeLocalUri(n),closeable:!1,runningProcess:i?.detail,hasRunningProcess:!!i,pid:i?.pid,privacy:FS.ConstantPrivate,source:{source:pb.Extension,description:g(8680,"Statically Forwarded")}}),this.tunnelService.setEnvironmentTunnel(t.remoteAddress.host,t.remoteAddress.port,n,FS.ConstantPrivate,Fp.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 r=Rg(n.host,n.port);i.set(r,{host:n.host,port:n.port,detail:n.detail,pid:n.pid}),t.has(r)&&t.delete(r);const o=yg(this.forwarded,n.host,n.port);o&&(o.runningProcess=n.detail,o.hasRunningProcess=!0,o.pid=n.pid)}),t.forEach((n,r)=>{const o=aJt(r);if(!o)return;const a=yg(this.forwarded,o.host,o.port);a&&(a.runningProcess=void 0,a.hasRunningProcess=!1,a.pid=void 0);const c=yg(this.detected,o.host,o.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!==Fp.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=yg(this._candidates??new Map,K$[0],l.port)??l;if(d){i.set(l.port,d);const h=cJt(d)?d.pid:void 0;n.has(h)||n.set(h,[]),n.get(h)?.push(l.port)}});const r=new Map;if(e.forEach(l=>{const d=this.configPortsAttributes.getAttributes(l.port,l.host,i.get(l.port)?.detail);d&&r.set(l.port,d)}),this.portAttributesProviders.length===0||!t)return r.size>0?r:void 0;const o=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,Ue.None)}))),a=new Map;if(o.forEach(l=>l.forEach(d=>{d&&a.set(d.port,d)})),!r&&!a)return;const c=new Map;return e.forEach(l=>{const d=r.get(l.port),h=a.get(l.port);c.set(l.port,{elevateIfNeeded:d?.elevateIfNeeded,label:d?.label,onAutoForward:d?.onAutoForward??qie.providedActionToAction(h?.autoForwardAction),requireLocalPort:d?.requireLocalPort,protocol:d?.protocol})}),c}addAttributesProvider(e){this.portAttributesProviders.push(e)}};j$.__decorator=D([fRe(1e3)],j$.prototype,"storeForwarded",null);j$=D([_(0,oce),_(1,Gi),_(2,Te),_(3,Xo),_(4,bC),_(5,Ci),_(6,Ke),_(7,ir),_(8,ps),_(9,Le)],j$);const G3e="remote.explorerType",K3e="remote.autoForwardPorts",q3e="remote.autoForwardPortsSource",Q3e="output",lJt="hybrid";var j3e;(function(s){s.Candidate="Candidate",s.Detected="Detected",s.Forwarded="Forwarded",s.Add="Add"})(j3e||(j3e={}));var Y3e;(function(s){s[s.None=0]="None",s[s.New=1]="New",s[s.Label=2]="Label",s[s.LocalPort=3]="LocalPort"})(Y3e||(Y3e={}));const dJt={type:"object",required:["id"],properties:{id:{description:g(3557,"The ID of a Get Started walkthrough to open."),type:"string"}}},hJt=ih.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"},dJt]},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 J3e=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(j$),hJt.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(G3e,this._targetType.toString(),Ie.WORKSPACE,cn.MACHINE),this.storageService.store(G3e,this._targetType.toString(),Ie.PROFILE,cn.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}};J3e=D([_(0,Gi),_(1,oce),_(2,we)],J3e);let X3e=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this.remoteExplorerService=t,this.tunnelService=i,this.notificationService=n,this.configurationService=r,this.logService=o,this.remoteAgentService=a,this.contextKeyService=c,this.elevateionRetry=!1,this.portsAttributesProviders=new Map,this._alreadyRegistered=!1,this._proxy=e.getProxy(Je.ExtHostTunnelService),this._register(i.onTunnelOpened(()=>this._proxy.$onDidTunnelsChange())),this._register(i.onTunnelClosed(()=>this._proxy.$onDidTunnelsChange()))}processFindingEnabled(){return(!!this.configurationService.getValue(K3e)||this.tunnelService.hasTunnelProvider)&&this.configurationService.getValue(q3e)!==Q3e}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(K3e)||t.affectsConfiguration(q3e))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 r=Array.from(this.portsAttributesProviders.entries()).filter(o=>{const a=o[1],c=typeof a.portRange=="number"?[a.portRange,a.portRange+1]:a.portRange,l=c?e.some(h=>c[0]<=h&&ho[0]);return r.length===0?[]:this._proxy.$providePortAttributes(r,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:pb.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),Kie.fromServiceTunnel(i)}async elevationPrompt(e,t,i){return this.notificationService.prompt(Ze.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},aL.Other),await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:pb.Extension,description:i},elevateIfNeeded:!0}),this.elevateionRetry=!1}}])}async $closeTunnel(e){return this.remoteExplorerService.close(e,aL.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(o=>{if(o){if(typeof o=="string")return o}else return;const a=o;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:Rg(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??Fp.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(Trt.key,!0)}async $setCandidateFilter(){this.remoteExplorerService.setCandidateFilter(e=>this._proxy.$applyCandidateFilter(e))}async $setCandidatePortSource(e){this.remoteAgentService.getEnvironment().then(()=>{switch(e){case iL.None:{je.as(Pn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPorts":!1}}]);break}case iL.Output:{je.as(Pn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":Q3e}}]);break}case iL.Hybrid:{je.as(Pn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":lJt}}]);break}}}).catch(()=>{})}};X3e=D([Ki(We.MainThreadTunnelService),_(1,vce),_(2,oce),_(3,wi),_(4,Te),_(5,Ke),_(6,fg),_(7,Le)],X3e);function Lrt(s){return`onAuthenticationRequest:${s}`}let Z3e=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 mr),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(Qu(e.id))throw new Error(g(2138,"An authentication contribution must specify an id."));if(Qu(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}))),xN(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 r of t)n.has(r.account.label)||(n.add(r.account.label),i.push(r.account));return i}async getSessions(e,t,i,n=!1){const r=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,n);if(r)return await r.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(Lrt(e),t?Bb.Immediate:Bb.Normal);let i=this._authenticationProviders.get(e);if(i)return i;const n=new Z,r=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.`)}))}),o=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([r,o]).finally(()=>n.dispose())}};Z3e=D([_(0,ps),_(1,fce),_(2,fv)],Z3e);class uJt extends V{constructor(e,t,i,n,r,o){super(),this._proxy=e,this.id=t,this.label=i,this.supportsMultipleAccounts=n,this.notificationService=r,this.onDidChangeSessions=o.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 e9e=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this.authenticationService=t,this.authenticationExtensionsService=i,this.authenticationAccessService=n,this.authenticationUsageService=r,this.dialogService=o,this.notificationService=a,this.extensionService=c,this.telemetryService=l,this.openerService=d,this._registrations=this._register(new mr),this._proxy=e.getProxy(Je.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 r=new uJt(this._proxy,e,t,i,this.notificationService,n);this.authenticationService.registerAuthenticationProvider(e,r)}$unregisterAuthenticationProvider(e){this._registrations.deleteAndDispose(e),this.authenticationService.unregisterAuthenticationProvider(e)}async $ensureProvider(e){if(!this.authenticationService.isAuthenticationProviderRegistered(e))return await this.extensionService.activateByEvent(Lrt(e),Bb.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 r;e.id.startsWith(lle)?r=g(4879,"The extension '{0}' wants to access the language models provided by {1}.",t,e.label):r=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 o=[{label:g(4882,"&&Allow"),run(){return!0}}];n?.learnMore&&o.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:Ze.Info,message:r,buttons:o,detail:n?.detail,cancelButton:!0});return a??!1}async doGetSession(e,t,i,n,r){const o=await this.authenticationService.getSessions(e,t,r.account,!0),a=this.authenticationService.getProvider(e);if(r.forceNewSession&&r.createIfNone)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, createIfNone");if(r.forceNewSession&&r.silent)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, silent");if(r.createIfNone&&r.silent)throw new Error("Invalid combination of options. Please remove one of the following: createIfNone, silent");if(r.clearSessionPreference&&this.authenticationExtensionsService.removeSessionPreference(e,i,t),!r.forceNewSession&&o.length){if(a.supportsMultipleAccounts){const l=this.authenticationExtensionsService.getSessionPreference(e,i,t);if(l){const d=o.find(h=>h.id===l);if(d&&this.authenticationAccessService.isAccessAllowed(e,d.account.label,i))return d}}else if(this.authenticationAccessService.isAccessAllowed(e,o[0].account.label,i))return o[0]}if(r.createIfNone||r.forceNewSession){let l;typeof r.forceNewSession=="object"&&(l=r.forceNewSession);const d=!!(r.forceNewSession&&o.length);if(!await this.loginPrompt(a,n,d,l))throw new Error("User did not consent to login.");let u;if(o?.length&&!r.forceNewSession)u=a.supportsMultipleAccounts&&!r.account?await this.authenticationExtensionsService.selectSession(e,i,n,t,o):o[0];else{let f=r.account;if(!f){const p=this.authenticationExtensionsService.getSessionPreference(e,i,t);f=p?o.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=o.find(l=>this.authenticationAccessService.isAccessAllowed(e,l.account.label,i));if(c)return c;r.silent||(o.length?this.authenticationExtensionsService.requestSessionAccess(e,i,n,t,o):await this.authenticationExtensionsService.requestNewSession(e,t,i,n))}async $getSession(e,t,i,n,r){const o=await this.doGetSession(e,t,i,n,r);return o&&(this.sendProviderUsageTelemetry(i,e),this.authenticationUsageService.addAccountUsage(e,o.account.label,i,n)),o}async $getAccounts(e){return await this.authenticationService.getAccounts(e)}sendProviderUsageTelemetry(e,t){this.telemetryService.publicLog2("authentication.providerUsage",{providerId:t,extensionId:e})}};e9e=D([Ki(We.MainThreadAuthentication),_(1,LMe),_(2,EZe),_(3,fce),_(4,AZe),_(5,ir),_(6,wi),_(7,ps),_(8,Ji),_(9,Ar)],e9e);let t9e=class{constructor(e,t,i){this.logService=t,this._timelineService=i,this._providerEmitters=new Map,this._proxy=e.getProxy(Je.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(r,o,a){return Mr(await t.$getTimeline(e.id,r,o,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(){}};t9e=D([Ki(We.MainThreadTimeline),_(1,Ke),_(2,wZe)],t9e);let Rrt=0;class gJt{constructor(e,t,i,n){this.result=e,this.fromTaskId=t,this.uriIdentityService=i,this.accessor=n,this.fileCoverage=new gi,this.didAddCoverage=_C(this),this.tree=new Wte,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,r=(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]})},o=[...this.treePathForUri(e.uri,!0)],a=[];this.tree.mutatePath(this.treePathForUri(e.uri,!1),c=>{if(a.push(c),a.length===o.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 i9e(e,n,this.accessor);this.fileCoverage.set(e.uri,l)}else if(c.value)r("statement",c.value),r("branch",c.value),r("declaration",c.value),c.value.didChange.trigger(t);else{const l=Ds(e);l.id=String(Rrt++),l.uri=this.treePathToUri(o.slice(0,a.length)),c.value=new Nrt(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 Wte;for(const i of this.tree.values())if(i instanceof i9e){if(!i.perTestData?.has(e.toString()))continue;const n=[...this.treePathForUri(i.uri,!0)],r=[];t.mutatePath(this.treePathForUri(i.uri,!1),o=>{r.push(o),o.value??=new pJt(this.treePathToUri(n.slice(0,r.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 fJt=(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 Mrt{get tpc(){return fJt(this.statement,this.branch,this.declaration)}constructor(e,t){this.fromResult=t,this.didChange=_C(this),this.id=e.id,this.uri=e.uri,this.statement=e.statement,this.branch=e.branch,this.declaration=e.declaration}}class Nrt extends Mrt{}class pJt extends Nrt{constructor(e,t){super({id:String(Rrt++),uri:e,statement:{covered:0,total:0}},t)}}class i9e extends Mrt{get hasSynchronousDetails(){return this._details instanceof Array||this.resolved}constructor(e,t,i){super(e,t),this.accessor=i}async detailsForTest(e,t=Ue.None){this._detailsForTest??=new Map;const i=e.toString(),n=this._detailsForTest.get(i);if(n)return n;const r=(async()=>{try{return await this.accessor.getCoverageDetails(this.id,i,t)}catch(o){throw this._detailsForTest?.delete(i),o}})();return this._detailsForTest.set(i,r),r}async details(e=Ue.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 L_={[Un.Running]:6,[Un.Errored]:5,[Un.Failed]:4,[Un.Queued]:3,[Un.Passed]:2,[Un.Unset]:0,[Un.Skipped]:1};Uat(L_,(s,e)=>({statusNode:!0,state:Number(e),priority:s}));const mJt=(s,e)=>L_[e]-L_[s],Prt=(...s)=>{switch(s.length){case 0:return Un.Unset;case 1:return s[0];case 2:return L_[s[0]]>L_[s[1]]?s[0]:s[1];default:{let e=s[0];for(let t=1;tNumber(s)).sort(mJt),n9e={[Un.Passed]:0,[Un.Skipped]:1,[Un.Failed]:2,[Un.Errored]:3},Frt=()=>new Uint32Array(_Jt.length),vJt=s=>"getOwnDuration"in s,EDe=(s,e,t=!1)=>{let i=s.getCurrentComputedState(e);if(i===void 0||t){i=s.getOwnState(e)??Un.Unset;let n=0;const r=Frt();for(const o of s.getChildren(e)){const a=EDe(s,o);n++,r[a]++,i=a===Un.Skipped&&i===Un.Unset?Un.Skipped:Prt(i,a)}n>bJt&&Brt.set(e,r),s.setComputedState(e,i)}return i},Ort=(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 r of s.getChildren(e)){const o=Ort(s,r);o!==void 0&&(i=(i||0)+o)}}s.setComputedDuration(e,i)}return i},bJt=64,Brt=new WeakMap,wJt=(s,e,t,i=!0)=>{const n=s.getCurrentComputedState(e),r=L_[n],o=EDe(s,e,!0),a=L_[o],c=new Set;if(a!==r){s.setComputedState(e,o),c.add(e);let l=n,d=o;for(const h of s.getParents(e)){const u=Brt.get(h);u&&(u[l]--,u[d]++);const f=s.getCurrentComputedState(h);if(a>r){if(f!==void 0&&L_[f]>=a||u&&u[d]>1)break;s.setComputedState(h,o),c.add(h)}else{if(f===void 0||L_[f]>r||u&&u[l]>0)break;d=EDe(s,h,!0),s.setComputedState(h,d),c.add(h)}l=f}}if(vJt(s)&&i)for(const l of ui.concat(ui.single(e),s.getParents(e))){const d=s.getCurrentComputedDuration(l),h=Ort(s,l,!0);if(d===h)break;s.setComputedDuration(l,h),c.add(l)}return c};M.None,Promise.resolve();class yJt{constructor(){this.writeDataEmitter=new I,this.endDeferred=new hc,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=Ge.alloc(t);let n=0;for(const r of this.getRangeIter(e,t))i.buffer.set(r.buffer,n),n+=r.byteLength;return n0;c--){const l=e.buffer[c-1];if(l!==r.CR&&l!==r.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 s9e=(s,e)=>`\x1B]633;SetMark;Id=${Ajt(s,e)};Hidden\x07`,CJt=(s,e,t)=>({controllerId:s,expand:Md.NotExpandable,item:{...e},children:[],tasks:[],ownComputedState:Un.Unset,computedState:Un.Unset});var d1;(function(s){s[s.ComputedStateChange=0]="ComputedStateChange",s[s.OwnStateChange=1]="OwnStateChange",s[s.NewMessage=2]="NewMessage"})(d1||(d1={}));let WF=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(jl)),this.counts=Frt(),this.computedStateAccessor={getOwnState:r=>r.ownComputedState,getCurrentComputedState:r=>r.computedState,setComputedState:(r,o)=>r.computedState=o,getChildren:r=>r.children,getParents:r=>{const{testById:o}=this;return function*(){const a=bn.fromString(r.item.extId).parentId;if(a)for(const c of a.idsToRoot())yield o.get(c.toString())}()}},this.doSerialize=new Ca(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(r=>({id:r.id,name:r.name,ctrlId:r.ctrlId})),name:this.name,request:this.request,items:[...this.testById.values()].map(zte.serializeWithoutMessages)})),this.doSerializeWithMessages=new Ca(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(r=>({id:r.id,name:r.name,ctrlId:r.ctrlId})),name:this.name,request:this.request,items:[...this.testById.values()].map(zte.serialize)}))}getStateById(e){return this.testById.get(e)}appendOutput(e,t,i,n){const r=e.byteLength>100?e.slice(0,100).toString()+"…":e.toString();let o;(n||i)&&(o=this.testMarkerCounter++);const a=this.mustGetTaskIndex(t),c=this.tasks[a],{offset:l,length:d}=c.output.append(e,o),h={location:i,message:r,offset:l,length:d,marker:o,type:H_.Output},u=n&&this.testById.get(n);u?(u.tasks[a].messages.push(h),this.changeEmitter.fire({item:u,result:this,reason:d1.NewMessage,message:h})):c.otherMessages.push(h)}addTask(e){this.tasks.push({...e,coverage:Yt(this,void 0),otherMessages:[],output:new yJt});for(const t of this.tests)t.tasks.push({duration:void 0,messages:[],state:Un.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===Un.Queued||n.state===Un.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[Un.Errored]+this.counts[Un.Failed],passes:this.counts[Un.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:d1.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 r of this.testById.values())i(r.tasks[n],r)&&this.fireUpdateAndRefresh(r,n,e)}fireUpdateAndRefresh(e,t,i,n){const r=e.ownComputedState,o=e.ownDuration,a={item:e,result:this,reason:d1.OwnStateChange,previousState:r,previousOwnDuration:o};e.tasks[t].state=i,n!==void 0&&(e.tasks[t].duration=n,e.ownDuration=Math.max(e.ownDuration||0,n));const c=Prt(...e.tasks.map(l=>l.state));if(c===r){n!==o&&this.changeEmitter.fire(a);return}e.ownComputedState=c,this.counts[r]--,this.counts[c]++,wJt(this.computedStateAccessor,e).forEach(l=>this.changeEmitter.fire(l===e?a:{item:l,result:this,reason:d1.ComputedStateChange}))}addTestToRun(e,t,i){const n=CJt(e,t);if(this.testById.set(t.extId,n),this.counts[Un.Unset]++,i&&this.testById.get(i)?.children.push(n),this.tasks.length)for(let r=0;ri.id===e);if(t===-1)throw new Error(`Unknown task ${e} in updateState`);return t}};WF=D([_(3,Ji)],WF);let r9e=class extends V{constructor(e,t,i,n,r){super(),this.uriIdentityService=t,this.testService=i,this.testProfiles=n,this.resultService=r,this.diffListener=this._register(new yn),this.testProviderRegistrations=new Map,this.proxy=e.getProxy(Je.ExtHostTesting),this._register(this.testService.registerExtHost({provideTestFollowups:(o,a)=>this.proxy.$provideTestFollowups(o,a),executeTestFollowup:o=>this.proxy.$executeTestFollowup(o),disposeTestFollowups:o=>this.proxy.$disposeTestFollowups(o),getTestsRelatedToCode:(o,a,c)=>this.proxy.$getTestsRelatedToCode(o,a,c)})),this._register(this.testService.onDidCancelTestRun(({runId:o})=>{this.proxy.$cancelExtensionTestRun(o)})),this._register(M.debounce(n.onDidChange,(o,a)=>a)(()=>{const o={};for(const a of[Qh.Run,Qh.Debug,Qh.Coverage])for(const c of this.testProfiles.getGroupDefaultProfiles(a))o[c.controllerId]??=[],o[c.controllerId].push(c.profileId);this.proxy.$setDefaultRunProfiles(o)})),this._register(r.onResultsChanged(o=>{if("completed"in o){const a=o.completed.toJSONWithMessages();a&&this.proxy.$publishTestResults([a])}else"removed"in o&&o.removed.forEach(a=>{a instanceof WF&&this.proxy.$disposeRun(a.id)})}))}$markTestRetired(e){let t;if(e){t=new Wte;for(const i of e)t.insert(bn.fromString(i).path,void 0)}for(const i of this.resultService.results)i instanceof WF&&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(r=>A$.deserialize(this.uriIdentityService,r))))}$appendCoverage(e,t,i){this.withLiveRun(e,n=>{const r=n.tasks.find(a=>a.id===t);if(!r)return;const o=XEe.deserialize(this.uriIdentityService,i);is(a=>{let c=r.coverage.read(void 0);c?c.append(o,a):(c=new gJt(n,t,this.uriIdentityService,{getCoverageDetails:(l,d,h)=>this.proxy.$getCoverageDetails(l,d,h).then(u=>u.map(ZEe.deserialize))}),c.append(o,a),r.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,r){this.withLiveRun(e,o=>o.updateState(i,t,n,r))}$appendOutputToRun(e,t,i,n,r){const o=n&&{uri:N.revive(n.uri),range:F.lift(n.range)};this.withLiveRun(e,a=>a.appendOutput(i,t,o,r))}$appendTestMessagesInRun(e,t,i,n){const r=this.resultService.getResult(e);if(r&&r instanceof WF)for(const o of n)r.appendMessage(i,t,S$.deserialize(this.uriIdentityService,o))}$registerTestController(e,t,i){const n=new Z,r=Yt(`${e}.label`,t),o=Yt(`${e}.cap`,i),a={id:e,label:r,capabilities:o,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:r,capabilities:o,disposable:n})}$updateController(e,t){const i=this.testProviderRegistrations.get(e);i&&is(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(HH.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=>HH.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 WF?t(i):void 0}};r9e=D([Ki(We.MainThreadTesting),_(1,Is),_(2,bZe),_(3,_Ze),_(4,vZe)],r9e);let o9e=class extends V{constructor(e,t,i,n){super(),this.secretStorageService=t,this.logService=i,this._sequencer=new Xdt,this._proxy=e.getProxy(Je.ExtHostSecretState),this._register(this.secretStorageService.onDidChangeSecret(r=>{try{const{extensionId:o,key:a}=this.parseKey(r);o&&a&&this._proxy.$onDidChangePassword({extensionId:o,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)}};o9e=D([Ki(We.MainThreadSecretState),_(1,PXe),_(2,Ke),_(3,fv)],o9e);let a9e=class{constructor(e,t){this.shareService=t,this.providers=new Map,this.providerDisposables=new Map,this.proxy=e.getProxy(Je.ExtHostShare)}$registerShareProvider(e,t,i,n,r){const o={id:i,label:n,selector:t,priority:r,provideShare:async c=>{const l=await this.proxy.$provideShare(e,c,Ue.None);return typeof l=="string"?l:N.revive(l)}};this.providers.set(e,o);const a=this.shareService.registerShareProvider(o);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(),wt(this.providerDisposables.values()),this.providerDisposables.clear()}};a9e=D([Ki(We.MainThreadShare),_(1,cZe)],a9e);let c9e=class extends V{constructor(e,t){super(),this.userDataProfileImportExportService=t,this.registeredHandlers=this._register(new mr),this.proxy=e.getProxy(Je.ExtHostProfileContentHandlers)}async $registerProfileContentHandler(e,t,i,n){this.registeredHandlers.set(e,this.userDataProfileImportExportService.registerProfileContentHandler(e,{name:t,description:i,extensionId:n,saveProfile:async(r,o,a)=>{const c=await this.proxy.$saveProfile(e,r,o,a);return c?Mr(c):null},readProfile:async(r,o)=>this.proxy.$readProfile(e,r,o)}))}async $unregisterProfileContentHandler(e){this.registeredHandlers.deleteAndDispose(e)}};c9e=D([Ki(We.MainThreadProfileContentHandlers),_(1,FZe)],c9e);let l9e=class extends V{constructor(e,t){super(),this._aiRelatedInformationService=t,this._registrations=this._register(new mr),this._proxy=e.getProxy(Je.ExtHostAiRelatedInformation)}$getAiRelatedInformation(e,t){return this._aiRelatedInformationService.getRelatedInformation(e,t,Ue.None)}$registerAiRelatedInformationProvider(e,t){const i={provideAiRelatedInformation:(n,r)=>this._proxy.$provideAiRelatedInformation(e,n,r)};this._registrations.set(e,this._aiRelatedInformationService.registerAiRelatedInformationProvider(t,i))}$unregisterAiRelatedInformationProvider(e){this._registrations.deleteAndDispose(e)}};l9e=D([Ki(We.MainThreadAiRelatedInformation),_(1,TMe)],l9e);let d9e=class extends V{constructor(e,t){super(),this._AiEmbeddingVectorService=t,this._registrations=this._register(new mr),this._proxy=e.getProxy(Je.ExtHostAiEmbeddingVector)}$registerAiEmbeddingVectorProvider(e,t){const i={provideAiEmbeddingVector:(n,r)=>this._proxy.$provideAiEmbeddingVector(t,n,r)};this._registrations.set(t,this._AiEmbeddingVectorService.registerAiEmbeddingVectorProvider(e,i))}$unregisterAiEmbeddingVectorProvider(e){this._registrations.deleteAndDispose(e)}};d9e=D([Ki(We.MainThreadAiEmbeddingVector),_(1,CZe)],d9e);let xDe=class extends Hee{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p){super(t,i,n,r,o,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()}};xDe=D([_(4,Ji),_(5,Ci),_(6,Os),_(7,Ke),_(8,pf),_(9,fv),_(10,km),_(11,xo),_(12,_u),_(13,Gi)],xDe);let DDe;function SJt(s){DDe=s}let kDe=class extends JAe{constructor(e,t,i,n,r,o,a,c,l){super(t,i,n,r,o,a,c,l),this.workerConfig=e}createExtensionHost(e,t,i){switch(t.kind){case 1:return DDe==null?null:this._instantiationService.createInstance(DDe,t,1,this._createLocalExtensionHostDataProvider(e,t,i));case 2:{if(this.workerConfig==null)return null;const n=i?2:1;return this._instantiationService.createInstance(xDe,this.workerConfig,t,n,this._createLocalExtensionHostDataProvider(e,t,i))}case 3:return super.createExtensionHost(e,t,i)}}};kDe=D([_(4,we),_(5,fg),_(6,bC),_(7,Fl),_(8,Ke)],kDe);let IDe=class extends XAe{constructor(e,t){super(t),this.allowedExtHostKinds=e}pickExtensionHostKind(e,t,i,n,r){const o=pQt(e.value);if(o!=null)return o;const a=super.pickExtensionHostKind(e,t,i,n,r);return a!=null&&!this.allowedExtHostKinds.includes(a)?this.allowedExtHostKinds[0]??null:a}};IDe=D([_(1,Ke)],IDe);let TDe=class extends YAe{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k){const P=t.createInstance(UAe),R=new kDe(e,P,async()=>this._scanWebExtensions(),()=>this._getExtensionRegistrySnapshotWhenReady(),t,m,w,o,p);super(P,R,new IDe(e!=null?[2,1,3]:[1,3],p),t,i,n,r,o,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 I0(e,t))}};TDe=D([_(1,we),_(2,wi),_(3,fv),_(4,Ji),_(5,Fl),_(6,Xt),_(7,xo),_(8,q6),_(9,Ci),_(10,Te),_(11,Rm),_(12,MMe),_(13,Ke),_(14,fg),_(15,sce),_(16,rg),_(17,bC),_(18,yce),_(19,pg),_(20,mC),_(21,vce),_(22,ir)],TDe);class AJt extends ZAe{async readExtensionResource(e){return e.scheme===Aee.extensionFile?(await this._fileService.readFile(e)).value.toString():super.readExtensionResource(e)}}H$t({"vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html":()=>W$t(new URL(""+new URL("webWorkerExtensionHostIframe-gIqsUtfW.html",import.meta.url).href,import.meta.url).href)});function EJt(s,e){return{[ps.toString()]:new yi(TDe,[void 0],!1),[Rm.toString()]:new yi(HAe,[],!0),[ice.toString()]:new yi(AJt,[],!0),[qU.toString()]:new yi(tEe,[],!0)}}const h9e=/^([^.]+\..+)[:=](.+)$/;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=>!h9e.test(t)):this.options.developmentOptions?.logLevel!==void 0?f3(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=h9e.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,f3(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 Ft(this.windowLogsPath,"window.log")}get userRoamingDataHome(){return N.file("/User").with({scheme:pe.vscodeUserData})}get argvResource(){return Ft(this.userRoamingDataHome,"argv.json")}get cacheHome(){return Ft(this.userRoamingDataHome,"caches")}get workspaceStorageHome(){return Ft(this.userRoamingDataHome,"workspaceStorage")}get localHistoryHome(){return Ft(this.userRoamingDataHome,"History")}get stateResource(){return Ft(this.userRoamingDataHome,"State","storage.json")}get userDataSyncHome(){return Ft(this.userRoamingDataHome,"sync",this.workspaceId)}get sync(){}get keyboardLayoutResource(){return Ft(this.userRoamingDataHome,"keyboardLayout.json")}get untitledWorkspacesHome(){return Ft(this.userRoamingDataHome,"Workspaces")}get serviceMachineIdResource(){return Ft(this.userRoamingDataHome,"machineid")}get extHostLogsPath(){return Ft(this.logsHome,"exthost")}get extHostTelemetryLogFile(){return Ft(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 Ft(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(r){bt(r)}}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=KKe(t.path);return[{fileUri:t.with({path:i.path}),options:{selection:Ja(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)}]}}}Jt.__decorator=D([ei],Jt.prototype,"remoteAuthority",null);Jt.__decorator=D([ei],Jt.prototype,"expectsResolverExtension",null);Jt.__decorator=D([ei],Jt.prototype,"isBuilt",null);Jt.__decorator=D([ei],Jt.prototype,"logLevel",null);Jt.__decorator=D([ei],Jt.prototype,"windowLogsPath",null);Jt.__decorator=D([ei],Jt.prototype,"logFile",null);Jt.__decorator=D([ei],Jt.prototype,"userRoamingDataHome",null);Jt.__decorator=D([ei],Jt.prototype,"argvResource",null);Jt.__decorator=D([ei],Jt.prototype,"cacheHome",null);Jt.__decorator=D([ei],Jt.prototype,"workspaceStorageHome",null);Jt.__decorator=D([ei],Jt.prototype,"localHistoryHome",null);Jt.__decorator=D([ei],Jt.prototype,"stateResource",null);Jt.__decorator=D([ei],Jt.prototype,"userDataSyncHome",null);Jt.__decorator=D([ei],Jt.prototype,"sync",null);Jt.__decorator=D([ei],Jt.prototype,"keyboardLayoutResource",null);Jt.__decorator=D([ei],Jt.prototype,"untitledWorkspacesHome",null);Jt.__decorator=D([ei],Jt.prototype,"serviceMachineIdResource",null);Jt.__decorator=D([ei],Jt.prototype,"extHostLogsPath",null);Jt.__decorator=D([ei],Jt.prototype,"extHostTelemetryLogFile",null);Jt.__decorator=D([ei],Jt.prototype,"debugExtensionHost",null);Jt.__decorator=D([ei],Jt.prototype,"isExtensionDevelopment",null);Jt.__decorator=D([ei],Jt.prototype,"extensionDevelopmentLocationURI",null);Jt.__decorator=D([ei],Jt.prototype,"extensionDevelopmentLocationKind",null);Jt.__decorator=D([ei],Jt.prototype,"extensionTestsLocationURI",null);Jt.__decorator=D([ei],Jt.prototype,"extensionEnabledProposedApi",null);Jt.__decorator=D([ei],Jt.prototype,"debugRenderer",null);Jt.__decorator=D([ei],Jt.prototype,"enableSmokeTestDriver",null);Jt.__decorator=D([ei],Jt.prototype,"disableExtensions",null);Jt.__decorator=D([ei],Jt.prototype,"enableExtensions",null);Jt.__decorator=D([ei],Jt.prototype,"webviewExternalEndpoint",null);Jt.__decorator=D([ei],Jt.prototype,"extensionTelemetryLogResource",null);Jt.__decorator=D([ei],Jt.prototype,"disableTelemetry",null);Jt.__decorator=D([ei],Jt.prototype,"verbose",null);Jt.__decorator=D([ei],Jt.prototype,"logExtensionHostCommunication",null);Jt.__decorator=D([ei],Jt.prototype,"skipReleaseNotes",null);Jt.__decorator=D([ei],Jt.prototype,"skipWelcome",null);Jt.__decorator=D([ei],Jt.prototype,"disableWorkspaceTrust",null);Jt.__decorator=D([ei],Jt.prototype,"lastActiveProfile",null);Jt.__decorator=D([ei],Jt.prototype,"filesToOpenOrCreate",null);Jt.__decorator=D([ei],Jt.prototype,"filesToDiff",null);Jt.__decorator=D([ei],Jt.prototype,"filesToMerge",null);let LDe=class extends Jt{constructor(e=HNe().id,t=NVt(),i){super(e,Lit,t,i)}};LDe=D([_(2,xo)],LDe);function xJt(s){return{[ec.toString()]:new yi(LDe,[void 0,s],!0)}}class Wrt extends V{constructor(e=MVt()){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=jn?"windows":mo?"linux":"mac",i=Oi(["monaco-workbench",t,"web",_Te?"chromium":tKe?"firefox":iKe?"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(Vu())}get containers(){const e=[];for(const{window:t}of P8())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(Pr),this.paneCompositeService=e.get(Mm),this.statusBarService=e.get(yMe),this.viewDescriptorService=e.get(Im),this.configurationService=e.get(Te),this.auxiliaryWindowService=e.get(xZe),this.hostService=e.get(Dc),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($K(this.configurationService.getValue("workbench.sideBar.location")??"left")),t.affectsConfiguration("workbench.panel.defaultLocation")&&this.setPanelPosition($K(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=$K(this.configurationService.getValue("workbench.sideBar.location")??"left"),this.panelPosition=$K(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),Yht(e)&&this._onDidLayoutActiveContainer.fire(t)}getActiveContainerId(){const e=this.activeContainer;return lt(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=TVt(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=ONe(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($1(e))}getPanelAlignment(){return"left"}setPanelAlignment(){}toggleZenMode(){}isEditorLayoutCentered(){return!1}centerEditorLayout(){}resizePart(){}isWindowMaximized(){return!1}updateWindowMaximizedState(){}getVisibleNeighborPart(){}getMaximumEditorDimensions(){return new wn(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&&Qht(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 r=this.paneCompositeService.getLastActivePaneCompositeId(i);(r==null||!this.hasViews(r))&&(r=this.viewDescriptorService.getViewContainersByLocation(i).find(o=>this.hasViews(o.id))?.id),r!=null&&this.paneCompositeService.openPaneComposite(r,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($1(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:K_(e)}layout(){this._mainContainerDimension=K_(window.document.body),this._onDidLayout.fire(this._mainContainerDimension)}get hasContainer(){return!0}focus(){const e=this.activeContainer;if(e===this.mainContainer){const t=kt.get(qt).getFocusedCodeEditor();t instanceof iI?t.focus():this.focusPart("workbench.parts.editor")}else this.editorGroupService.getPart(e).activeGroup.focus()}}Nit(s=>{const e=s.get(_u);e instanceof Wrt&&e.init(s)});function DJt(s){return{[_u.toString()]:new yi(Wrt,[s],!0)}}var jm;(function(s){s[s.Unknown=1]="Unknown",s[s.Keyboard=2]="Keyboard",s[s.Api=3]="Api"})(jm||(jm={}));let jA=class extends V{constructor(e,t,i,n,r,o,a,c,l,d,h,u){super(),this.layoutService=e,this.configurationService=t,this.fileService=i,this.labelService=n,this.environmentService=r,this.instantiationService=o,this.lifecycleService=a,this.logService=c,this.dialogService=l,this.contextService=d,this.userDataProfileService=h,this.userDataProfilesService=u,this.shutdownReason=jm.Unknown,r.options?.workspaceProvider?this.workspaceProvider=r.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(bb.getInstance().event(()=>this.updateShutdownReasonFromEvent()))}onBeforeShutdown(e){switch(this.shutdownReason){case jm.Unknown:case jm.Keyboard:{const t=this.configurationService.getValue("window.confirmBeforeClose");(t==="always"||t==="keyboardOnly"&&this.shutdownReason===jm.Keyboard)&&e.veto(!0,"veto.confirmBeforeClose");break}}this.shutdownReason=jm.Unknown}updateShutdownReasonFromEvent(){this.shutdownReason!==jm.Api&&(bb.getInstance().isModifierPressed?this.shutdownReason=jm.Keyboard:this.shutdownReason=jm.Unknown)}get onDidChangeFocus(){const e=this._register(new I);return this._register(M.runAndSubscribe(sm,({window:t,disposables:i})=>{const n=i.add(Ec(t)),r=i.add(new ni(t.document,"visibilitychange"));M.any(M.map(n.onDidFocus,()=>this.hasFocus,i),M.map(n.onDidBlur,()=>this.hasFocus,i),M.map(r.event,()=>this.hasFocus,i),M.map(this.onDidChangeActiveWindow,()=>this.hasFocus,i))(o=>e.fire(o))},{window:ri,disposables:this._store})),M.latch(e.event,void 0,this._store)}get hasFocus(){return Vu().hasFocus()}async hadLastFocus(){return!0}async focus(e){e.focus()}get onDidChangeActiveWindow(){const e=this._register(new I);return this._register(M.runAndSubscribe(sm,({window:t,disposables:i})=>{const n=z2(t),r=i.add(Ec(t));i.add(r.onDidFocus(()=>e.fire(n))),Adt(t)&&i.add(Bht(t,()=>{const o=t.document.hasFocus();return o&&e.fire(n),o},100,20))},{window:ri,disposables:this._store})),M.latch(e.event,void 0,this._store)}get onDidChangeFullScreen(){const e=this._register(new I);return this._register(M.runAndSubscribe(sm,({window:t,disposables:i})=>{const n=z2(t),r=gm&&t.visualViewport?t.visualViewport:t,o=()=>{const a=uut(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:o()})));i.add(Vht(r,ke.RESIZE,()=>e.fire({windowId:n,fullscreen:o()}),void 0,jt?2e3:800))},{window:ri,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=[],r=[];for(const o of e)o.label=o.label||this.getRecentLabel(o),TQ(o)?t?.addMode?r.push({uri:o.folderUri}):this.doOpen({folderUri:o.folderUri},{reuse:this.shouldReuse(t,!1),payload:i}):hCe(o)?this.doOpen({workspaceUri:o.workspaceUri},{reuse:this.shouldReuse(t,!1),payload:i}):IVt(o)&&n.push(o);r.length>0&&this.withServices(o=>{o.get(oC).addFolders(r)}),n.length>0&&this.withServices(async o=>{const a=o.get(ti);if(t?.mergeMode&&n.length===4){const l=Oi(await aue(n,this.fileService,this.logService));if(l.length!==4||!Jv(l[0])||!Jv(l[1])||!Jv(l[2])||!Jv(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=Oi(await aue(n,this.fileService,this.logService));if(l.length!==2||!Jv(l[0])||!Jv(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=KKe(l.fileUri.path);d=[{fileUri:l.fileUri.with({path:h.path}),options:{selection:Ja(h.line)?void 0:{startLineNumber:h.line,startColumn:h.column||1}}}]}else d=[l];a.openEditors(Oi(await aue(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=>Ozt(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(r=>r.name===i.newWindowProfile):void 0)??this.userDataProfileService.currentProfile;return n.isDefault||t.push(["lastActiveProfile",n.id]),t.length?t:void 0}getRecentLabel(e){return TQ(e)?this.labelService.getWorkspaceLabel(e.folderUri,{verbose:Hp.LONG}):hCe(e)?this.labelService.getWorkspaceLabel(BNe(e.workspaceUri),{verbose:Hp.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 r=(e.preferNewWindow||!!e.forceNewWindow)&&!e.forceReuseWindow;return!e.forceNewWindow&&!e.forceReuseWindow&&(n==="on"||n==="off")&&(r=n==="on"),!r}async doOpenEmptyWindow(e){return this.doOpen(void 0,{reuse:e?.forceReuseWindow,payload:this.preservePayload(!0)})}async doOpen(e,t){if(e&&TQ(e)&&e.folderUri.scheme===pe.file&&Wy(this.contextService.getWorkspace())){this.withServices(async n=>{await n.get(oC).updateFolders(0,this.contextService.getWorkspace().folders.length,[{uri:e.folderUri}])});return}if(t?.reuse&&await this.handleExpectedShutdown(pD.LOAD),!await this.workspaceProvider.open(e,t)){const{confirmed:n}=await this.dialogService.confirm({type:Ze.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(pD.RELOAD),ri.location.reload()}async close(){await this.handleExpectedShutdown(pD.CLOSE),ri.close()}async withExpectedShutdown(e){const t=this.shutdownReason;try{return this.shutdownReason=jm.Api,await e()}finally{this.shutdownReason=t}}async handleExpectedShutdown(e){return this.shutdownReason=jm.Api,this.lifecycleService.withExpectedShutdown(e)}getPathForFile(){}};jA.__decorator=D([ei],jA.prototype,"onDidChangeFocus",null);jA.__decorator=D([ei],jA.prototype,"onDidChangeActiveWindow",null);jA.__decorator=D([ei],jA.prototype,"onDidChangeFullScreen",null);jA=D([_(0,_u),_(1,Te),_(2,Xt),_(3,Os),_(4,fv),_(5,we),_(6,rg),_(7,Ke),_(8,ir),_(9,Ci),_(10,pg),_(11,km)],jA);class kJt extends V{constructor(){super(),this._onDidSchemeChangeEvent=this._register(new I),this.registerListeners()}registerListeners(){Jj(ri,"(prefers-color-scheme: dark)",()=>{this._onDidSchemeChangeEvent.fire()}),Jj(ri,"(forced-colors: active)",()=>{this._onDidSchemeChangeEvent.fire()})}get onDidChangeColorScheme(){return this._onDidSchemeChangeEvent.event}get dark(){return ri.matchMedia("(prefers-color-scheme: light)").matches?!1:!!ri.matchMedia("(prefers-color-scheme: dark)").matches}get highContrast(){return!!ri.matchMedia("(forced-colors: active)").matches}}function IJt(){return{[Dc.toString()]:new yi(jA,[],!0),[NZe.toString()]:new yi(kJt,[],!0)}}function TJt(s,e,t){let i,n,r,o,a;if(e){for(o=e.offset,a=o+e.length,r=o;r>0&&!Qie(s,r-1);)r--;let y=a;for(;yo&&s.substring(C,A)!==y&&v.push({offset:C,length:A-C,content:y})}let w=m();if(w!==pt.EOF){const y=u.getTokenOffset()+r,C=sge(h,i);b(C,r,y)}for(;w!==pt.EOF;){let y=u.getTokenOffset()+u.getTokenLength()+r,C=m(),A="";for(;!l&&(C===pt.LineCommentTrivia||C===pt.BlockCommentTrivia);){const k=u.getTokenOffset()+r;b(" ",y,k),y=u.getTokenOffset()+u.getTokenLength()+r,A=C===pt.LineCommentTrivia?p():"",C=m()}if(C===pt.CloseBraceToken)w!==pt.OpenBraceToken&&(d--,A=p());else if(C===pt.CloseBracketToken)w!==pt.OpenBracketToken&&(d--,A=p());else{switch(w){case pt.OpenBracketToken:case pt.OpenBraceToken:d++,A=p();break;case pt.CommaToken:case pt.LineCommentTrivia:A=p();break;case pt.BlockCommentTrivia:l?A=p():A=" ";break;case pt.ColonToken:A=" ";break;case pt.StringLiteral:if(C===pt.ColonToken){A="";break}case pt.NullKeyword:case pt.TrueKeyword:case pt.FalseKeyword:case pt.NumericLiteral:case pt.CloseBraceToken:case pt.CloseBracketToken:C===pt.LineCommentTrivia||C===pt.BlockCommentTrivia?A=" ":C!==pt.CommaToken&&C!==pt.EOF&&(f=!0);break;case pt.Unknown:f=!0;break}l&&(C===pt.LineCommentTrivia||C===pt.BlockCommentTrivia)&&(A=p())}const L=u.getTokenOffset()+r;b(A,y,L),w=C}return v}function sge(s,e){let t="";for(let i=0;i(await this.remoteAuthorityResolverService.resolveAuthority(o)).authority}:void 0,c=Rg(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")r=l;else if(l&&l.localAddress){const d=yg(this._candidates??new Map,e.remote.host,e.remote.port),h=l.protocol?l.protocol===Fp.Https?Fp.Https:Fp.Http:t?.protocol??Fp.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??nge,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 r}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 r;(function(a){a[a.None=0]="None",a[a.Fire=1]="Fire",a[a.Reopen=2]="Reopen"})(r||(r={}));let o=r.None;switch(n!==e.name&&(e.name=n,o=r.Fire),(i?.protocol||e.protocol!==Fp.Http)&&i?.protocol!==e.protocol&&(t.source=e.source,o=r.Reopen),t.privacy&&e.privacy!==t.privacy&&(o=r.Reopen),o){case r.Fire:{this._onForwardPort.fire();break}case r.Reopen:await this.close(e.remoteHost,e.remotePort,aL.User),await this.doForward(t,i)}return yg(this.remoteTunnels,t.remote.host,t.remote.port)}async name(e,t,i){const n=yg(this.forwarded,e,t),r=Rg(e,t);if(n){n.name=i,await this.storeForwarded(),this._onPortName.fire({host:e,port:t});return}else this.detected.has(r)&&(this.detected.get(r).name=i,this._onPortName.fire({host:e,port:t}))}async close(e,t,i){const n=Rg(e,t),r=this.forwarded.get(n);return i===aL.AutoForwardEnd&&r&&r.source.source===pb.Auto&&this.sessionCachedProperties.set(n,{local:r.localPort,name:r.name,privacy:r.privacy}),await this.tunnelService.closeTunnel(e,t),this.onTunnelClosed({host:e,port:t},i)}address(e,t){const i=Rg(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=yg(this._candidates??new Map,t.remoteAddress.host,t.remoteAddress.port),n=typeof t.localAddress=="string"?t.localAddress:Rg(t.localAddress.host,t.localAddress.port);this.detected.set(Rg(t.remoteAddress.host,t.remoteAddress.port),{remoteHost:t.remoteAddress.host,remotePort:t.remoteAddress.port,localAddress:n,protocol:Fp.Http,localUri:this.makeLocalUri(n),closeable:!1,runningProcess:i?.detail,hasRunningProcess:!!i,pid:i?.pid,privacy:FS.ConstantPrivate,source:{source:pb.Extension,description:g(8680,"Statically Forwarded")}}),this.tunnelService.setEnvironmentTunnel(t.remoteAddress.host,t.remoteAddress.port,n,FS.ConstantPrivate,Fp.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 r=Rg(n.host,n.port);i.set(r,{host:n.host,port:n.port,detail:n.detail,pid:n.pid}),t.has(r)&&t.delete(r);const o=yg(this.forwarded,n.host,n.port);o&&(o.runningProcess=n.detail,o.hasRunningProcess=!0,o.pid=n.pid)}),t.forEach((n,r)=>{const o=aJt(r);if(!o)return;const a=yg(this.forwarded,o.host,o.port);a&&(a.runningProcess=void 0,a.hasRunningProcess=!1,a.pid=void 0);const c=yg(this.detected,o.host,o.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!==Fp.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=yg(this._candidates??new Map,K$[0],l.port)??l;if(d){i.set(l.port,d);const h=cJt(d)?d.pid:void 0;n.has(h)||n.set(h,[]),n.get(h)?.push(l.port)}});const r=new Map;if(e.forEach(l=>{const d=this.configPortsAttributes.getAttributes(l.port,l.host,i.get(l.port)?.detail);d&&r.set(l.port,d)}),this.portAttributesProviders.length===0||!t)return r.size>0?r:void 0;const o=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,Ue.None)}))),a=new Map;if(o.forEach(l=>l.forEach(d=>{d&&a.set(d.port,d)})),!r&&!a)return;const c=new Map;return e.forEach(l=>{const d=r.get(l.port),h=a.get(l.port);c.set(l.port,{elevateIfNeeded:d?.elevateIfNeeded,label:d?.label,onAutoForward:d?.onAutoForward??qie.providedActionToAction(h?.autoForwardAction),requireLocalPort:d?.requireLocalPort,protocol:d?.protocol})}),c}addAttributesProvider(e){this.portAttributesProviders.push(e)}};j$.__decorator=D([fRe(1e3)],j$.prototype,"storeForwarded",null);j$=D([_(0,oce),_(1,Gi),_(2,Te),_(3,Xo),_(4,bC),_(5,Ci),_(6,Ke),_(7,ir),_(8,ps),_(9,Le)],j$);const G3e="remote.explorerType",K3e="remote.autoForwardPorts",q3e="remote.autoForwardPortsSource",Q3e="output",lJt="hybrid";var j3e;(function(s){s.Candidate="Candidate",s.Detected="Detected",s.Forwarded="Forwarded",s.Add="Add"})(j3e||(j3e={}));var Y3e;(function(s){s[s.None=0]="None",s[s.New=1]="New",s[s.Label=2]="Label",s[s.LocalPort=3]="LocalPort"})(Y3e||(Y3e={}));const dJt={type:"object",required:["id"],properties:{id:{description:g(3557,"The ID of a Get Started walkthrough to open."),type:"string"}}},hJt=ih.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"},dJt]},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 J3e=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(j$),hJt.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(G3e,this._targetType.toString(),Ie.WORKSPACE,cn.MACHINE),this.storageService.store(G3e,this._targetType.toString(),Ie.PROFILE,cn.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}};J3e=D([_(0,Gi),_(1,oce),_(2,we)],J3e);let X3e=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this.remoteExplorerService=t,this.tunnelService=i,this.notificationService=n,this.configurationService=r,this.logService=o,this.remoteAgentService=a,this.contextKeyService=c,this.elevateionRetry=!1,this.portsAttributesProviders=new Map,this._alreadyRegistered=!1,this._proxy=e.getProxy(Je.ExtHostTunnelService),this._register(i.onTunnelOpened(()=>this._proxy.$onDidTunnelsChange())),this._register(i.onTunnelClosed(()=>this._proxy.$onDidTunnelsChange()))}processFindingEnabled(){return(!!this.configurationService.getValue(K3e)||this.tunnelService.hasTunnelProvider)&&this.configurationService.getValue(q3e)!==Q3e}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(K3e)||t.affectsConfiguration(q3e))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 r=Array.from(this.portsAttributesProviders.entries()).filter(o=>{const a=o[1],c=typeof a.portRange=="number"?[a.portRange,a.portRange+1]:a.portRange,l=c?e.some(h=>c[0]<=h&&ho[0]);return r.length===0?[]:this._proxy.$providePortAttributes(r,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:pb.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),Kie.fromServiceTunnel(i)}async elevationPrompt(e,t,i){return this.notificationService.prompt(Ze.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},aL.Other),await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:pb.Extension,description:i},elevateIfNeeded:!0}),this.elevateionRetry=!1}}])}async $closeTunnel(e){return this.remoteExplorerService.close(e,aL.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(o=>{if(o){if(typeof o=="string")return o}else return;const a=o;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:Rg(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??Fp.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(Trt.key,!0)}async $setCandidateFilter(){this.remoteExplorerService.setCandidateFilter(e=>this._proxy.$applyCandidateFilter(e))}async $setCandidatePortSource(e){this.remoteAgentService.getEnvironment().then(()=>{switch(e){case iL.None:{je.as(Pn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPorts":!1}}]);break}case iL.Output:{je.as(Pn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":Q3e}}]);break}case iL.Hybrid:{je.as(Pn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":lJt}}]);break}}}).catch(()=>{})}};X3e=D([Ki(We.MainThreadTunnelService),_(1,vce),_(2,oce),_(3,wi),_(4,Te),_(5,Ke),_(6,fg),_(7,Le)],X3e);function Lrt(s){return`onAuthenticationRequest:${s}`}let Z3e=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 mr),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(Qu(e.id))throw new Error(g(2138,"An authentication contribution must specify an id."));if(Qu(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}))),xN(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 r of t)n.has(r.account.label)||(n.add(r.account.label),i.push(r.account));return i}async getSessions(e,t,i,n=!1){const r=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,n);if(r)return await r.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(Lrt(e),t?Bb.Immediate:Bb.Normal);let i=this._authenticationProviders.get(e);if(i)return i;const n=new Z,r=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.`)}))}),o=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([r,o]).finally(()=>n.dispose())}};Z3e=D([_(0,ps),_(1,fce),_(2,fv)],Z3e);class uJt extends V{constructor(e,t,i,n,r,o){super(),this._proxy=e,this.id=t,this.label=i,this.supportsMultipleAccounts=n,this.notificationService=r,this.onDidChangeSessions=o.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 e9e=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this.authenticationService=t,this.authenticationExtensionsService=i,this.authenticationAccessService=n,this.authenticationUsageService=r,this.dialogService=o,this.notificationService=a,this.extensionService=c,this.telemetryService=l,this.openerService=d,this._registrations=this._register(new mr),this._proxy=e.getProxy(Je.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 r=new uJt(this._proxy,e,t,i,this.notificationService,n);this.authenticationService.registerAuthenticationProvider(e,r)}$unregisterAuthenticationProvider(e){this._registrations.deleteAndDispose(e),this.authenticationService.unregisterAuthenticationProvider(e)}async $ensureProvider(e){if(!this.authenticationService.isAuthenticationProviderRegistered(e))return await this.extensionService.activateByEvent(Lrt(e),Bb.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 r;e.id.startsWith(lle)?r=g(4879,"The extension '{0}' wants to access the language models provided by {1}.",t,e.label):r=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 o=[{label:g(4882,"&&Allow"),run(){return!0}}];n?.learnMore&&o.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:Ze.Info,message:r,buttons:o,detail:n?.detail,cancelButton:!0});return a??!1}async doGetSession(e,t,i,n,r){const o=await this.authenticationService.getSessions(e,t,r.account,!0),a=this.authenticationService.getProvider(e);if(r.forceNewSession&&r.createIfNone)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, createIfNone");if(r.forceNewSession&&r.silent)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, silent");if(r.createIfNone&&r.silent)throw new Error("Invalid combination of options. Please remove one of the following: createIfNone, silent");if(r.clearSessionPreference&&this.authenticationExtensionsService.removeSessionPreference(e,i,t),!r.forceNewSession&&o.length){if(a.supportsMultipleAccounts){const l=this.authenticationExtensionsService.getSessionPreference(e,i,t);if(l){const d=o.find(h=>h.id===l);if(d&&this.authenticationAccessService.isAccessAllowed(e,d.account.label,i))return d}}else if(this.authenticationAccessService.isAccessAllowed(e,o[0].account.label,i))return o[0]}if(r.createIfNone||r.forceNewSession){let l;typeof r.forceNewSession=="object"&&(l=r.forceNewSession);const d=!!(r.forceNewSession&&o.length);if(!await this.loginPrompt(a,n,d,l))throw new Error("User did not consent to login.");let u;if(o?.length&&!r.forceNewSession)u=a.supportsMultipleAccounts&&!r.account?await this.authenticationExtensionsService.selectSession(e,i,n,t,o):o[0];else{let f=r.account;if(!f){const p=this.authenticationExtensionsService.getSessionPreference(e,i,t);f=p?o.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=o.find(l=>this.authenticationAccessService.isAccessAllowed(e,l.account.label,i));if(c)return c;r.silent||(o.length?this.authenticationExtensionsService.requestSessionAccess(e,i,n,t,o):await this.authenticationExtensionsService.requestNewSession(e,t,i,n))}async $getSession(e,t,i,n,r){const o=await this.doGetSession(e,t,i,n,r);return o&&(this.sendProviderUsageTelemetry(i,e),this.authenticationUsageService.addAccountUsage(e,o.account.label,i,n)),o}async $getAccounts(e){return await this.authenticationService.getAccounts(e)}sendProviderUsageTelemetry(e,t){this.telemetryService.publicLog2("authentication.providerUsage",{providerId:t,extensionId:e})}};e9e=D([Ki(We.MainThreadAuthentication),_(1,LMe),_(2,EZe),_(3,fce),_(4,AZe),_(5,ir),_(6,wi),_(7,ps),_(8,Ji),_(9,Ar)],e9e);let t9e=class{constructor(e,t,i){this.logService=t,this._timelineService=i,this._providerEmitters=new Map,this._proxy=e.getProxy(Je.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(r,o,a){return Mr(await t.$getTimeline(e.id,r,o,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(){}};t9e=D([Ki(We.MainThreadTimeline),_(1,Ke),_(2,wZe)],t9e);let Rrt=0;class gJt{constructor(e,t,i,n){this.result=e,this.fromTaskId=t,this.uriIdentityService=i,this.accessor=n,this.fileCoverage=new gi,this.didAddCoverage=_C(this),this.tree=new Wte,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,r=(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]})},o=[...this.treePathForUri(e.uri,!0)],a=[];this.tree.mutatePath(this.treePathForUri(e.uri,!1),c=>{if(a.push(c),a.length===o.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 i9e(e,n,this.accessor);this.fileCoverage.set(e.uri,l)}else if(c.value)r("statement",c.value),r("branch",c.value),r("declaration",c.value),c.value.didChange.trigger(t);else{const l=Ds(e);l.id=String(Rrt++),l.uri=this.treePathToUri(o.slice(0,a.length)),c.value=new Nrt(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 Wte;for(const i of this.tree.values())if(i instanceof i9e){if(!i.perTestData?.has(e.toString()))continue;const n=[...this.treePathForUri(i.uri,!0)],r=[];t.mutatePath(this.treePathForUri(i.uri,!1),o=>{r.push(o),o.value??=new pJt(this.treePathToUri(n.slice(0,r.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 fJt=(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 Mrt{get tpc(){return fJt(this.statement,this.branch,this.declaration)}constructor(e,t){this.fromResult=t,this.didChange=_C(this),this.id=e.id,this.uri=e.uri,this.statement=e.statement,this.branch=e.branch,this.declaration=e.declaration}}class Nrt extends Mrt{}class pJt extends Nrt{constructor(e,t){super({id:String(Rrt++),uri:e,statement:{covered:0,total:0}},t)}}class i9e extends Mrt{get hasSynchronousDetails(){return this._details instanceof Array||this.resolved}constructor(e,t,i){super(e,t),this.accessor=i}async detailsForTest(e,t=Ue.None){this._detailsForTest??=new Map;const i=e.toString(),n=this._detailsForTest.get(i);if(n)return n;const r=(async()=>{try{return await this.accessor.getCoverageDetails(this.id,i,t)}catch(o){throw this._detailsForTest?.delete(i),o}})();return this._detailsForTest.set(i,r),r}async details(e=Ue.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 L_={[Un.Running]:6,[Un.Errored]:5,[Un.Failed]:4,[Un.Queued]:3,[Un.Passed]:2,[Un.Unset]:0,[Un.Skipped]:1};Uat(L_,(s,e)=>({statusNode:!0,state:Number(e),priority:s}));const mJt=(s,e)=>L_[e]-L_[s],Prt=(...s)=>{switch(s.length){case 0:return Un.Unset;case 1:return s[0];case 2:return L_[s[0]]>L_[s[1]]?s[0]:s[1];default:{let e=s[0];for(let t=1;tNumber(s)).sort(mJt),n9e={[Un.Passed]:0,[Un.Skipped]:1,[Un.Failed]:2,[Un.Errored]:3},Frt=()=>new Uint32Array(_Jt.length),vJt=s=>"getOwnDuration"in s,EDe=(s,e,t=!1)=>{let i=s.getCurrentComputedState(e);if(i===void 0||t){i=s.getOwnState(e)??Un.Unset;let n=0;const r=Frt();for(const o of s.getChildren(e)){const a=EDe(s,o);n++,r[a]++,i=a===Un.Skipped&&i===Un.Unset?Un.Skipped:Prt(i,a)}n>bJt&&Brt.set(e,r),s.setComputedState(e,i)}return i},Ort=(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 r of s.getChildren(e)){const o=Ort(s,r);o!==void 0&&(i=(i||0)+o)}}s.setComputedDuration(e,i)}return i},bJt=64,Brt=new WeakMap,wJt=(s,e,t,i=!0)=>{const n=s.getCurrentComputedState(e),r=L_[n],o=EDe(s,e,!0),a=L_[o],c=new Set;if(a!==r){s.setComputedState(e,o),c.add(e);let l=n,d=o;for(const h of s.getParents(e)){const u=Brt.get(h);u&&(u[l]--,u[d]++);const f=s.getCurrentComputedState(h);if(a>r){if(f!==void 0&&L_[f]>=a||u&&u[d]>1)break;s.setComputedState(h,o),c.add(h)}else{if(f===void 0||L_[f]>r||u&&u[l]>0)break;d=EDe(s,h,!0),s.setComputedState(h,d),c.add(h)}l=f}}if(vJt(s)&&i)for(const l of ui.concat(ui.single(e),s.getParents(e))){const d=s.getCurrentComputedDuration(l),h=Ort(s,l,!0);if(d===h)break;s.setComputedDuration(l,h),c.add(l)}return c};M.None,Promise.resolve();class yJt{constructor(){this.writeDataEmitter=new I,this.endDeferred=new hc,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=Ge.alloc(t);let n=0;for(const r of this.getRangeIter(e,t))i.buffer.set(r.buffer,n),n+=r.byteLength;return n0;c--){const l=e.buffer[c-1];if(l!==r.CR&&l!==r.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 s9e=(s,e)=>`\x1B]633;SetMark;Id=${Ajt(s,e)};Hidden\x07`,CJt=(s,e,t)=>({controllerId:s,expand:Md.NotExpandable,item:{...e},children:[],tasks:[],ownComputedState:Un.Unset,computedState:Un.Unset});var d1;(function(s){s[s.ComputedStateChange=0]="ComputedStateChange",s[s.OwnStateChange=1]="OwnStateChange",s[s.NewMessage=2]="NewMessage"})(d1||(d1={}));let WF=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(jl)),this.counts=Frt(),this.computedStateAccessor={getOwnState:r=>r.ownComputedState,getCurrentComputedState:r=>r.computedState,setComputedState:(r,o)=>r.computedState=o,getChildren:r=>r.children,getParents:r=>{const{testById:o}=this;return function*(){const a=bn.fromString(r.item.extId).parentId;if(a)for(const c of a.idsToRoot())yield o.get(c.toString())}()}},this.doSerialize=new Ca(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(r=>({id:r.id,name:r.name,ctrlId:r.ctrlId})),name:this.name,request:this.request,items:[...this.testById.values()].map(zte.serializeWithoutMessages)})),this.doSerializeWithMessages=new Ca(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(r=>({id:r.id,name:r.name,ctrlId:r.ctrlId})),name:this.name,request:this.request,items:[...this.testById.values()].map(zte.serialize)}))}getStateById(e){return this.testById.get(e)}appendOutput(e,t,i,n){const r=e.byteLength>100?e.slice(0,100).toString()+"…":e.toString();let o;(n||i)&&(o=this.testMarkerCounter++);const a=this.mustGetTaskIndex(t),c=this.tasks[a],{offset:l,length:d}=c.output.append(e,o),h={location:i,message:r,offset:l,length:d,marker:o,type:H_.Output},u=n&&this.testById.get(n);u?(u.tasks[a].messages.push(h),this.changeEmitter.fire({item:u,result:this,reason:d1.NewMessage,message:h})):c.otherMessages.push(h)}addTask(e){this.tasks.push({...e,coverage:Yt(this,void 0),otherMessages:[],output:new yJt});for(const t of this.tests)t.tasks.push({duration:void 0,messages:[],state:Un.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===Un.Queued||n.state===Un.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[Un.Errored]+this.counts[Un.Failed],passes:this.counts[Un.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:d1.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 r of this.testById.values())i(r.tasks[n],r)&&this.fireUpdateAndRefresh(r,n,e)}fireUpdateAndRefresh(e,t,i,n){const r=e.ownComputedState,o=e.ownDuration,a={item:e,result:this,reason:d1.OwnStateChange,previousState:r,previousOwnDuration:o};e.tasks[t].state=i,n!==void 0&&(e.tasks[t].duration=n,e.ownDuration=Math.max(e.ownDuration||0,n));const c=Prt(...e.tasks.map(l=>l.state));if(c===r){n!==o&&this.changeEmitter.fire(a);return}e.ownComputedState=c,this.counts[r]--,this.counts[c]++,wJt(this.computedStateAccessor,e).forEach(l=>this.changeEmitter.fire(l===e?a:{item:l,result:this,reason:d1.ComputedStateChange}))}addTestToRun(e,t,i){const n=CJt(e,t);if(this.testById.set(t.extId,n),this.counts[Un.Unset]++,i&&this.testById.get(i)?.children.push(n),this.tasks.length)for(let r=0;ri.id===e);if(t===-1)throw new Error(`Unknown task ${e} in updateState`);return t}};WF=D([_(3,Ji)],WF);let r9e=class extends V{constructor(e,t,i,n,r){super(),this.uriIdentityService=t,this.testService=i,this.testProfiles=n,this.resultService=r,this.diffListener=this._register(new yn),this.testProviderRegistrations=new Map,this.proxy=e.getProxy(Je.ExtHostTesting),this._register(this.testService.registerExtHost({provideTestFollowups:(o,a)=>this.proxy.$provideTestFollowups(o,a),executeTestFollowup:o=>this.proxy.$executeTestFollowup(o),disposeTestFollowups:o=>this.proxy.$disposeTestFollowups(o),getTestsRelatedToCode:(o,a,c)=>this.proxy.$getTestsRelatedToCode(o,a,c)})),this._register(this.testService.onDidCancelTestRun(({runId:o})=>{this.proxy.$cancelExtensionTestRun(o)})),this._register(M.debounce(n.onDidChange,(o,a)=>a)(()=>{const o={};for(const a of[Qh.Run,Qh.Debug,Qh.Coverage])for(const c of this.testProfiles.getGroupDefaultProfiles(a))o[c.controllerId]??=[],o[c.controllerId].push(c.profileId);this.proxy.$setDefaultRunProfiles(o)})),this._register(r.onResultsChanged(o=>{if("completed"in o){const a=o.completed.toJSONWithMessages();a&&this.proxy.$publishTestResults([a])}else"removed"in o&&o.removed.forEach(a=>{a instanceof WF&&this.proxy.$disposeRun(a.id)})}))}$markTestRetired(e){let t;if(e){t=new Wte;for(const i of e)t.insert(bn.fromString(i).path,void 0)}for(const i of this.resultService.results)i instanceof WF&&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(r=>A$.deserialize(this.uriIdentityService,r))))}$appendCoverage(e,t,i){this.withLiveRun(e,n=>{const r=n.tasks.find(a=>a.id===t);if(!r)return;const o=XEe.deserialize(this.uriIdentityService,i);is(a=>{let c=r.coverage.read(void 0);c?c.append(o,a):(c=new gJt(n,t,this.uriIdentityService,{getCoverageDetails:(l,d,h)=>this.proxy.$getCoverageDetails(l,d,h).then(u=>u.map(ZEe.deserialize))}),c.append(o,a),r.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,r){this.withLiveRun(e,o=>o.updateState(i,t,n,r))}$appendOutputToRun(e,t,i,n,r){const o=n&&{uri:N.revive(n.uri),range:F.lift(n.range)};this.withLiveRun(e,a=>a.appendOutput(i,t,o,r))}$appendTestMessagesInRun(e,t,i,n){const r=this.resultService.getResult(e);if(r&&r instanceof WF)for(const o of n)r.appendMessage(i,t,S$.deserialize(this.uriIdentityService,o))}$registerTestController(e,t,i){const n=new Z,r=Yt(`${e}.label`,t),o=Yt(`${e}.cap`,i),a={id:e,label:r,capabilities:o,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:r,capabilities:o,disposable:n})}$updateController(e,t){const i=this.testProviderRegistrations.get(e);i&&is(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(HH.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=>HH.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 WF?t(i):void 0}};r9e=D([Ki(We.MainThreadTesting),_(1,Is),_(2,bZe),_(3,_Ze),_(4,vZe)],r9e);let o9e=class extends V{constructor(e,t,i,n){super(),this.secretStorageService=t,this.logService=i,this._sequencer=new Xdt,this._proxy=e.getProxy(Je.ExtHostSecretState),this._register(this.secretStorageService.onDidChangeSecret(r=>{try{const{extensionId:o,key:a}=this.parseKey(r);o&&a&&this._proxy.$onDidChangePassword({extensionId:o,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)}};o9e=D([Ki(We.MainThreadSecretState),_(1,PXe),_(2,Ke),_(3,fv)],o9e);let a9e=class{constructor(e,t){this.shareService=t,this.providers=new Map,this.providerDisposables=new Map,this.proxy=e.getProxy(Je.ExtHostShare)}$registerShareProvider(e,t,i,n,r){const o={id:i,label:n,selector:t,priority:r,provideShare:async c=>{const l=await this.proxy.$provideShare(e,c,Ue.None);return typeof l=="string"?l:N.revive(l)}};this.providers.set(e,o);const a=this.shareService.registerShareProvider(o);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(),wt(this.providerDisposables.values()),this.providerDisposables.clear()}};a9e=D([Ki(We.MainThreadShare),_(1,cZe)],a9e);let c9e=class extends V{constructor(e,t){super(),this.userDataProfileImportExportService=t,this.registeredHandlers=this._register(new mr),this.proxy=e.getProxy(Je.ExtHostProfileContentHandlers)}async $registerProfileContentHandler(e,t,i,n){this.registeredHandlers.set(e,this.userDataProfileImportExportService.registerProfileContentHandler(e,{name:t,description:i,extensionId:n,saveProfile:async(r,o,a)=>{const c=await this.proxy.$saveProfile(e,r,o,a);return c?Mr(c):null},readProfile:async(r,o)=>this.proxy.$readProfile(e,r,o)}))}async $unregisterProfileContentHandler(e){this.registeredHandlers.deleteAndDispose(e)}};c9e=D([Ki(We.MainThreadProfileContentHandlers),_(1,FZe)],c9e);let l9e=class extends V{constructor(e,t){super(),this._aiRelatedInformationService=t,this._registrations=this._register(new mr),this._proxy=e.getProxy(Je.ExtHostAiRelatedInformation)}$getAiRelatedInformation(e,t){return this._aiRelatedInformationService.getRelatedInformation(e,t,Ue.None)}$registerAiRelatedInformationProvider(e,t){const i={provideAiRelatedInformation:(n,r)=>this._proxy.$provideAiRelatedInformation(e,n,r)};this._registrations.set(e,this._aiRelatedInformationService.registerAiRelatedInformationProvider(t,i))}$unregisterAiRelatedInformationProvider(e){this._registrations.deleteAndDispose(e)}};l9e=D([Ki(We.MainThreadAiRelatedInformation),_(1,TMe)],l9e);let d9e=class extends V{constructor(e,t){super(),this._AiEmbeddingVectorService=t,this._registrations=this._register(new mr),this._proxy=e.getProxy(Je.ExtHostAiEmbeddingVector)}$registerAiEmbeddingVectorProvider(e,t){const i={provideAiEmbeddingVector:(n,r)=>this._proxy.$provideAiEmbeddingVector(t,n,r)};this._registrations.set(t,this._AiEmbeddingVectorService.registerAiEmbeddingVectorProvider(e,i))}$unregisterAiEmbeddingVectorProvider(e){this._registrations.deleteAndDispose(e)}};d9e=D([Ki(We.MainThreadAiEmbeddingVector),_(1,CZe)],d9e);let xDe=class extends Hee{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p){super(t,i,n,r,o,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()}};xDe=D([_(4,Ji),_(5,Ci),_(6,Os),_(7,Ke),_(8,pf),_(9,fv),_(10,km),_(11,xo),_(12,_u),_(13,Gi)],xDe);let DDe;function SJt(s){DDe=s}let kDe=class extends JAe{constructor(e,t,i,n,r,o,a,c,l){super(t,i,n,r,o,a,c,l),this.workerConfig=e}createExtensionHost(e,t,i){switch(t.kind){case 1:return DDe==null?null:this._instantiationService.createInstance(DDe,t,1,this._createLocalExtensionHostDataProvider(e,t,i));case 2:{if(this.workerConfig==null)return null;const n=i?2:1;return this._instantiationService.createInstance(xDe,this.workerConfig,t,n,this._createLocalExtensionHostDataProvider(e,t,i))}case 3:return super.createExtensionHost(e,t,i)}}};kDe=D([_(4,we),_(5,fg),_(6,bC),_(7,Ol),_(8,Ke)],kDe);let IDe=class extends XAe{constructor(e,t){super(t),this.allowedExtHostKinds=e}pickExtensionHostKind(e,t,i,n,r){const o=pQt(e.value);if(o!=null)return o;const a=super.pickExtensionHostKind(e,t,i,n,r);return a!=null&&!this.allowedExtHostKinds.includes(a)?this.allowedExtHostKinds[0]??null:a}};IDe=D([_(1,Ke)],IDe);let TDe=class extends YAe{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k){const P=t.createInstance(UAe),R=new kDe(e,P,async()=>this._scanWebExtensions(),()=>this._getExtensionRegistrySnapshotWhenReady(),t,m,w,o,p);super(P,R,new IDe(e!=null?[2,1,3]:[1,3],p),t,i,n,r,o,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 I0(e,t))}};TDe=D([_(1,we),_(2,wi),_(3,fv),_(4,Ji),_(5,Ol),_(6,Xt),_(7,xo),_(8,q6),_(9,Ci),_(10,Te),_(11,Rm),_(12,MMe),_(13,Ke),_(14,fg),_(15,sce),_(16,rg),_(17,bC),_(18,yce),_(19,pg),_(20,mC),_(21,vce),_(22,ir)],TDe);class AJt extends ZAe{async readExtensionResource(e){return e.scheme===Aee.extensionFile?(await this._fileService.readFile(e)).value.toString():super.readExtensionResource(e)}}H$t({"vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html":()=>W$t(new URL(""+new URL("webWorkerExtensionHostIframe-gIqsUtfW.html",import.meta.url).href,import.meta.url).href)});function EJt(s,e){return{[ps.toString()]:new yi(TDe,[void 0],!1),[Rm.toString()]:new yi(HAe,[],!0),[ice.toString()]:new yi(AJt,[],!0),[qU.toString()]:new yi(tEe,[],!0)}}const h9e=/^([^.]+\..+)[:=](.+)$/;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=>!h9e.test(t)):this.options.developmentOptions?.logLevel!==void 0?f3(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=h9e.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,f3(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 Ft(this.windowLogsPath,"window.log")}get userRoamingDataHome(){return N.file("/User").with({scheme:pe.vscodeUserData})}get argvResource(){return Ft(this.userRoamingDataHome,"argv.json")}get cacheHome(){return Ft(this.userRoamingDataHome,"caches")}get workspaceStorageHome(){return Ft(this.userRoamingDataHome,"workspaceStorage")}get localHistoryHome(){return Ft(this.userRoamingDataHome,"History")}get stateResource(){return Ft(this.userRoamingDataHome,"State","storage.json")}get userDataSyncHome(){return Ft(this.userRoamingDataHome,"sync",this.workspaceId)}get sync(){}get keyboardLayoutResource(){return Ft(this.userRoamingDataHome,"keyboardLayout.json")}get untitledWorkspacesHome(){return Ft(this.userRoamingDataHome,"Workspaces")}get serviceMachineIdResource(){return Ft(this.userRoamingDataHome,"machineid")}get extHostLogsPath(){return Ft(this.logsHome,"exthost")}get extHostTelemetryLogFile(){return Ft(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 Ft(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(r){bt(r)}}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=KKe(t.path);return[{fileUri:t.with({path:i.path}),options:{selection:Ja(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)}]}}}Jt.__decorator=D([ei],Jt.prototype,"remoteAuthority",null);Jt.__decorator=D([ei],Jt.prototype,"expectsResolverExtension",null);Jt.__decorator=D([ei],Jt.prototype,"isBuilt",null);Jt.__decorator=D([ei],Jt.prototype,"logLevel",null);Jt.__decorator=D([ei],Jt.prototype,"windowLogsPath",null);Jt.__decorator=D([ei],Jt.prototype,"logFile",null);Jt.__decorator=D([ei],Jt.prototype,"userRoamingDataHome",null);Jt.__decorator=D([ei],Jt.prototype,"argvResource",null);Jt.__decorator=D([ei],Jt.prototype,"cacheHome",null);Jt.__decorator=D([ei],Jt.prototype,"workspaceStorageHome",null);Jt.__decorator=D([ei],Jt.prototype,"localHistoryHome",null);Jt.__decorator=D([ei],Jt.prototype,"stateResource",null);Jt.__decorator=D([ei],Jt.prototype,"userDataSyncHome",null);Jt.__decorator=D([ei],Jt.prototype,"sync",null);Jt.__decorator=D([ei],Jt.prototype,"keyboardLayoutResource",null);Jt.__decorator=D([ei],Jt.prototype,"untitledWorkspacesHome",null);Jt.__decorator=D([ei],Jt.prototype,"serviceMachineIdResource",null);Jt.__decorator=D([ei],Jt.prototype,"extHostLogsPath",null);Jt.__decorator=D([ei],Jt.prototype,"extHostTelemetryLogFile",null);Jt.__decorator=D([ei],Jt.prototype,"debugExtensionHost",null);Jt.__decorator=D([ei],Jt.prototype,"isExtensionDevelopment",null);Jt.__decorator=D([ei],Jt.prototype,"extensionDevelopmentLocationURI",null);Jt.__decorator=D([ei],Jt.prototype,"extensionDevelopmentLocationKind",null);Jt.__decorator=D([ei],Jt.prototype,"extensionTestsLocationURI",null);Jt.__decorator=D([ei],Jt.prototype,"extensionEnabledProposedApi",null);Jt.__decorator=D([ei],Jt.prototype,"debugRenderer",null);Jt.__decorator=D([ei],Jt.prototype,"enableSmokeTestDriver",null);Jt.__decorator=D([ei],Jt.prototype,"disableExtensions",null);Jt.__decorator=D([ei],Jt.prototype,"enableExtensions",null);Jt.__decorator=D([ei],Jt.prototype,"webviewExternalEndpoint",null);Jt.__decorator=D([ei],Jt.prototype,"extensionTelemetryLogResource",null);Jt.__decorator=D([ei],Jt.prototype,"disableTelemetry",null);Jt.__decorator=D([ei],Jt.prototype,"verbose",null);Jt.__decorator=D([ei],Jt.prototype,"logExtensionHostCommunication",null);Jt.__decorator=D([ei],Jt.prototype,"skipReleaseNotes",null);Jt.__decorator=D([ei],Jt.prototype,"skipWelcome",null);Jt.__decorator=D([ei],Jt.prototype,"disableWorkspaceTrust",null);Jt.__decorator=D([ei],Jt.prototype,"lastActiveProfile",null);Jt.__decorator=D([ei],Jt.prototype,"filesToOpenOrCreate",null);Jt.__decorator=D([ei],Jt.prototype,"filesToDiff",null);Jt.__decorator=D([ei],Jt.prototype,"filesToMerge",null);let LDe=class extends Jt{constructor(e=HNe().id,t=NVt(),i){super(e,Lit,t,i)}};LDe=D([_(2,xo)],LDe);function xJt(s){return{[ec.toString()]:new yi(LDe,[void 0,s],!0)}}class Wrt extends V{constructor(e=MVt()){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=jn?"windows":mo?"linux":"mac",i=Oi(["monaco-workbench",t,"web",_Te?"chromium":tKe?"firefox":iKe?"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(Vu())}get containers(){const e=[];for(const{window:t}of P8())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(Pr),this.paneCompositeService=e.get(Mm),this.statusBarService=e.get(yMe),this.viewDescriptorService=e.get(Im),this.configurationService=e.get(Te),this.auxiliaryWindowService=e.get(xZe),this.hostService=e.get(Dc),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($K(this.configurationService.getValue("workbench.sideBar.location")??"left")),t.affectsConfiguration("workbench.panel.defaultLocation")&&this.setPanelPosition($K(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=$K(this.configurationService.getValue("workbench.sideBar.location")??"left"),this.panelPosition=$K(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),Yht(e)&&this._onDidLayoutActiveContainer.fire(t)}getActiveContainerId(){const e=this.activeContainer;return lt(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=TVt(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=ONe(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($1(e))}getPanelAlignment(){return"left"}setPanelAlignment(){}toggleZenMode(){}isEditorLayoutCentered(){return!1}centerEditorLayout(){}resizePart(){}isWindowMaximized(){return!1}updateWindowMaximizedState(){}getVisibleNeighborPart(){}getMaximumEditorDimensions(){return new wn(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&&Qht(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 r=this.paneCompositeService.getLastActivePaneCompositeId(i);(r==null||!this.hasViews(r))&&(r=this.viewDescriptorService.getViewContainersByLocation(i).find(o=>this.hasViews(o.id))?.id),r!=null&&this.paneCompositeService.openPaneComposite(r,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($1(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:K_(e)}layout(){this._mainContainerDimension=K_(window.document.body),this._onDidLayout.fire(this._mainContainerDimension)}get hasContainer(){return!0}focus(){const e=this.activeContainer;if(e===this.mainContainer){const t=kt.get(qt).getFocusedCodeEditor();t instanceof iI?t.focus():this.focusPart("workbench.parts.editor")}else this.editorGroupService.getPart(e).activeGroup.focus()}}Nit(s=>{const e=s.get(_u);e instanceof Wrt&&e.init(s)});function DJt(s){return{[_u.toString()]:new yi(Wrt,[s],!0)}}var jm;(function(s){s[s.Unknown=1]="Unknown",s[s.Keyboard=2]="Keyboard",s[s.Api=3]="Api"})(jm||(jm={}));let jA=class extends V{constructor(e,t,i,n,r,o,a,c,l,d,h,u){super(),this.layoutService=e,this.configurationService=t,this.fileService=i,this.labelService=n,this.environmentService=r,this.instantiationService=o,this.lifecycleService=a,this.logService=c,this.dialogService=l,this.contextService=d,this.userDataProfileService=h,this.userDataProfilesService=u,this.shutdownReason=jm.Unknown,r.options?.workspaceProvider?this.workspaceProvider=r.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(bb.getInstance().event(()=>this.updateShutdownReasonFromEvent()))}onBeforeShutdown(e){switch(this.shutdownReason){case jm.Unknown:case jm.Keyboard:{const t=this.configurationService.getValue("window.confirmBeforeClose");(t==="always"||t==="keyboardOnly"&&this.shutdownReason===jm.Keyboard)&&e.veto(!0,"veto.confirmBeforeClose");break}}this.shutdownReason=jm.Unknown}updateShutdownReasonFromEvent(){this.shutdownReason!==jm.Api&&(bb.getInstance().isModifierPressed?this.shutdownReason=jm.Keyboard:this.shutdownReason=jm.Unknown)}get onDidChangeFocus(){const e=this._register(new I);return this._register(M.runAndSubscribe(sm,({window:t,disposables:i})=>{const n=i.add(Ec(t)),r=i.add(new ni(t.document,"visibilitychange"));M.any(M.map(n.onDidFocus,()=>this.hasFocus,i),M.map(n.onDidBlur,()=>this.hasFocus,i),M.map(r.event,()=>this.hasFocus,i),M.map(this.onDidChangeActiveWindow,()=>this.hasFocus,i))(o=>e.fire(o))},{window:ri,disposables:this._store})),M.latch(e.event,void 0,this._store)}get hasFocus(){return Vu().hasFocus()}async hadLastFocus(){return!0}async focus(e){e.focus()}get onDidChangeActiveWindow(){const e=this._register(new I);return this._register(M.runAndSubscribe(sm,({window:t,disposables:i})=>{const n=z2(t),r=i.add(Ec(t));i.add(r.onDidFocus(()=>e.fire(n))),Adt(t)&&i.add(Bht(t,()=>{const o=t.document.hasFocus();return o&&e.fire(n),o},100,20))},{window:ri,disposables:this._store})),M.latch(e.event,void 0,this._store)}get onDidChangeFullScreen(){const e=this._register(new I);return this._register(M.runAndSubscribe(sm,({window:t,disposables:i})=>{const n=z2(t),r=gm&&t.visualViewport?t.visualViewport:t,o=()=>{const a=uut(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:o()})));i.add(Vht(r,ke.RESIZE,()=>e.fire({windowId:n,fullscreen:o()}),void 0,jt?2e3:800))},{window:ri,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=[],r=[];for(const o of e)o.label=o.label||this.getRecentLabel(o),TQ(o)?t?.addMode?r.push({uri:o.folderUri}):this.doOpen({folderUri:o.folderUri},{reuse:this.shouldReuse(t,!1),payload:i}):hCe(o)?this.doOpen({workspaceUri:o.workspaceUri},{reuse:this.shouldReuse(t,!1),payload:i}):IVt(o)&&n.push(o);r.length>0&&this.withServices(o=>{o.get(oC).addFolders(r)}),n.length>0&&this.withServices(async o=>{const a=o.get(ti);if(t?.mergeMode&&n.length===4){const l=Oi(await aue(n,this.fileService,this.logService));if(l.length!==4||!Jv(l[0])||!Jv(l[1])||!Jv(l[2])||!Jv(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=Oi(await aue(n,this.fileService,this.logService));if(l.length!==2||!Jv(l[0])||!Jv(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=KKe(l.fileUri.path);d=[{fileUri:l.fileUri.with({path:h.path}),options:{selection:Ja(h.line)?void 0:{startLineNumber:h.line,startColumn:h.column||1}}}]}else d=[l];a.openEditors(Oi(await aue(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=>Ozt(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(r=>r.name===i.newWindowProfile):void 0)??this.userDataProfileService.currentProfile;return n.isDefault||t.push(["lastActiveProfile",n.id]),t.length?t:void 0}getRecentLabel(e){return TQ(e)?this.labelService.getWorkspaceLabel(e.folderUri,{verbose:Hp.LONG}):hCe(e)?this.labelService.getWorkspaceLabel(BNe(e.workspaceUri),{verbose:Hp.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 r=(e.preferNewWindow||!!e.forceNewWindow)&&!e.forceReuseWindow;return!e.forceNewWindow&&!e.forceReuseWindow&&(n==="on"||n==="off")&&(r=n==="on"),!r}async doOpenEmptyWindow(e){return this.doOpen(void 0,{reuse:e?.forceReuseWindow,payload:this.preservePayload(!0)})}async doOpen(e,t){if(e&&TQ(e)&&e.folderUri.scheme===pe.file&&Wy(this.contextService.getWorkspace())){this.withServices(async n=>{await n.get(oC).updateFolders(0,this.contextService.getWorkspace().folders.length,[{uri:e.folderUri}])});return}if(t?.reuse&&await this.handleExpectedShutdown(pD.LOAD),!await this.workspaceProvider.open(e,t)){const{confirmed:n}=await this.dialogService.confirm({type:Ze.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(pD.RELOAD),ri.location.reload()}async close(){await this.handleExpectedShutdown(pD.CLOSE),ri.close()}async withExpectedShutdown(e){const t=this.shutdownReason;try{return this.shutdownReason=jm.Api,await e()}finally{this.shutdownReason=t}}async handleExpectedShutdown(e){return this.shutdownReason=jm.Api,this.lifecycleService.withExpectedShutdown(e)}getPathForFile(){}};jA.__decorator=D([ei],jA.prototype,"onDidChangeFocus",null);jA.__decorator=D([ei],jA.prototype,"onDidChangeActiveWindow",null);jA.__decorator=D([ei],jA.prototype,"onDidChangeFullScreen",null);jA=D([_(0,_u),_(1,Te),_(2,Xt),_(3,Os),_(4,fv),_(5,we),_(6,rg),_(7,Ke),_(8,ir),_(9,Ci),_(10,pg),_(11,km)],jA);class kJt extends V{constructor(){super(),this._onDidSchemeChangeEvent=this._register(new I),this.registerListeners()}registerListeners(){Jj(ri,"(prefers-color-scheme: dark)",()=>{this._onDidSchemeChangeEvent.fire()}),Jj(ri,"(forced-colors: active)",()=>{this._onDidSchemeChangeEvent.fire()})}get onDidChangeColorScheme(){return this._onDidSchemeChangeEvent.event}get dark(){return ri.matchMedia("(prefers-color-scheme: light)").matches?!1:!!ri.matchMedia("(prefers-color-scheme: dark)").matches}get highContrast(){return!!ri.matchMedia("(forced-colors: active)").matches}}function IJt(){return{[Dc.toString()]:new yi(jA,[],!0),[NZe.toString()]:new yi(kJt,[],!0)}}function TJt(s,e,t){let i,n,r,o,a;if(e){for(o=e.offset,a=o+e.length,r=o;r>0&&!Qie(s,r-1);)r--;let y=a;for(;yo&&s.substring(C,A)!==y&&v.push({offset:C,length:A-C,content:y})}let w=m();if(w!==pt.EOF){const y=u.getTokenOffset()+r,C=sge(h,i);b(C,r,y)}for(;w!==pt.EOF;){let y=u.getTokenOffset()+u.getTokenLength()+r,C=m(),A="";for(;!l&&(C===pt.LineCommentTrivia||C===pt.BlockCommentTrivia);){const k=u.getTokenOffset()+r;b(" ",y,k),y=u.getTokenOffset()+u.getTokenLength()+r,A=C===pt.LineCommentTrivia?p():"",C=m()}if(C===pt.CloseBraceToken)w!==pt.OpenBraceToken&&(d--,A=p());else if(C===pt.CloseBracketToken)w!==pt.OpenBracketToken&&(d--,A=p());else{switch(w){case pt.OpenBracketToken:case pt.OpenBraceToken:d++,A=p();break;case pt.CommaToken:case pt.LineCommentTrivia:A=p();break;case pt.BlockCommentTrivia:l?A=p():A=" ";break;case pt.ColonToken:A=" ";break;case pt.StringLiteral:if(C===pt.ColonToken){A="";break}case pt.NullKeyword:case pt.TrueKeyword:case pt.FalseKeyword:case pt.NumericLiteral:case pt.CloseBraceToken:case pt.CloseBracketToken:C===pt.LineCommentTrivia||C===pt.BlockCommentTrivia?A=" ":C!==pt.CommaToken&&C!==pt.EOF&&(f=!0);break;case pt.Unknown:f=!0;break}l&&(C===pt.LineCommentTrivia||C===pt.BlockCommentTrivia)&&(A=p())}const L=u.getTokenOffset()+r;b(A,y,L),w=C}return v}function sge(s,e){let t="";for(let i=0;i(h.weight||0)-(d.weight||0));const i=jie.keyOf(e);let n=this._decorationRules.get(i);n||(n=new jie(this._themeService,e,i),this._decorationRules.set(i,n),n.appendCSSRules(this._styleElement)),n.acquire();const r=n.itemColorClassName;let o=n.itemBadgeClassName;const a=n.iconBadgeClassName;let c=Ya(e.filter(d=>!Qu(d.tooltip)).map(d=>d.tooltip)).join(" • ");const l=e.some(d=>d.strikethrough);return t&&(o=n.bubbleBadgeClassName,c=g(857,"Contains emphasized items")),{labelClassName:r,badgeClassName:o,iconClassName:a,strikethrough:l,tooltip:c,dispose:()=>{n?.release()&&(this._decorationRules.delete(i),n.removeCSSRules(this._styleElement),n=void 0)}}}}class FJt{constructor(e){this._data=Ih.forUris(t=>!0),this._data.fill(!0,z_(e))}affectsResource(e){return this._data.hasElementOrSubtree(e)}}class YK{constructor(e,t){this.source=e,this.thenable=t}}function XI(s){return s?$e(s):"inherit"}let NDe=class{constructor(e,t){this._store=new Z,this._onDidChangeDecorationsDelayed=this._store.add(new $oe({merge:i=>i.flat()})),this._onDidChangeDecorations=this._store.add(new I),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._provider=new ul,this._decorationStyles=new PJt(t),this._data=Ih.forUris(i=>e.extUri.ignorePathCasing(i)),this._store.add(this._onDidChangeDecorationsDelayed.event(i=>{this._onDidChangeDecorations.fire(new FJt(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 r=[];for(const[o,a]of this._data)a.delete(e)&&r.push(o);r.length>0&&this._onDidChangeDecorationsDelayed.fire(r)},n=e.onDidChange(r=>{if(!r)i();else for(const o of r){const a=this._ensureEntry(o);this._fetchData(a,o,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 r=this._ensureEntry(e);for(const o of this._provider){let a=r.get(o);a===void 0&&(a=this._fetchData(r,e,o)),a&&!(a instanceof YK)&&i.push(a)}if(t){const o=this._data.findSuperstr(e);if(o)for(const a of o)for(const c of a[1].values())c&&!(c instanceof YK)&&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 YK&&(n.source.cancel(),e.delete(i));const r=new li,o=i.provideDecorations(t,r.token);if(Xy(o)){const a=new YK(r,Promise.resolve(o).then(c=>{e.get(i)===a&&this._keepItem(e,i,t,c)}).catch(c=>{!Oo(c)&&e.get(i)===a&&e.delete(i)}).finally(()=>{r.dispose()}));return e.set(i,a),null}else return r.dispose(),this._keepItem(e,i,t,o)}_keepItem(e,t,i,n){const r=n||null,o=e.get(t);return e.set(t,r),(r||o)&&this._onDidChangeDecorationsDelayed.fire(i),r}};NDe=D([_(0,Is),_(1,mn)],NDe);class OJt{constructor(e){this.channel=e}async request(e,t){const[i,n]=await this.channel.call("request",[e],t);return{res:i,stream:g6(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 BJt="Offline";class WJt extends Error{constructor(){super(BJt),this.name=this.message}}async function HJt(s,e){if(e.isCancellationRequested)throw Ty();const t=new AbortController,i=e.onCancellationRequested(()=>t.abort()),n=s.timeout?AbortSignal.any([t.signal,AbortSignal.timeout(s.timeout)]):t.signal;try{const r=await fetch(s.url||"",{method:s.type||"GET",headers:UJt(s),body:s.data,signal:n});return{res:{statusCode:r.status,headers:VJt(r)},stream:g6(Ge.wrap(new Uint8Array(await r.arrayBuffer())))}}catch(r){throw navigator.onLine?r?.name==="AbortError"?Ty():r?.name==="TimeoutError"?new Error(`Fetch timeout: ${s.timeout}ms`):r:new WJt}finally{i.dispose()}}function UJt(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 VJt(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 qVt{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,()=>HJt(e,t))}async resolveProxy(e){}async lookupAuthorization(e){}async lookupKerberosAuthorization(e){}async loadCertificates(){return[]}};PDe=D([_(0,Te),_(1,pf)],PDe);let FDe=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 OJt(n).request(t,i))}};FDe=D([_(0,fg),_(1,Te),_(2,pf)],FDe);vt.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 zJt extends V{constructor(){super(...arguments),this.handlers=new Set}open(e,t){const i=[...this.handlers.values()];return eae(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 $Jt{constructor(e,t){this.urlService=e,this.productService=t}async open(e,t){return t?.openExternal||!IA(e,this.productService.urlProtocol)?!1:(typeof e=="string"&&(e=N.parse(e)),this.urlService.open(e,{trusted:!0}))}}let ODe=class extends zJt{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 $Jt(this,i)))}create(e){return this.provider?this.provider.create(e):N.parse("unsupported://")}};ODe=D([_(0,fv),_(1,Ar),_(2,xo)],ODe);class GJt{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 BDe=class{constructor(e,t){this.requestService=e,this.fileService=t}async download(e,t,i=Ue.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)},r=await this.requestService.request(n,i);if(r.res.statusCode===200)await this.fileService.writeFile(t,r.stream);else{const o=await jVt(r);throw new Error(`Expected 200, got back ${r.res.statusCode} instead. ${o}`)}}};BDe=D([_(0,U6),_(1,Xt)],BDe);var WDe;let Yie=WDe=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||pr)(),this.resolveUserHome=(async()=>{const r=await this.remoteAgentService.getEnvironment();return this.maybeUnresolvedUserHome=r?.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?$dt(i??vi(e),t===ks.Windows):!0}get defaultUriScheme(){return WDe.findDefaultUriScheme(this.environmentService,this.contextService)}static findDefaultUriScheme(e,t){if(e.remoteAuthority)return pe.vscodeRemote;const i=nnt(t.getWorkspace());if(i)return i;const n=t.getWorkspace().folders[0];if(n)return n.uri.scheme;const r=t.getWorkspace().configuration;return r?r.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===ks.Windows?lc:zi)}async fileURI(e){let t="";if(await this.resolveOS===ks.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:""})}};Yie=WDe=D([_(1,fg),_(2,Xo),_(3,Ci)],Yie);function KJt(s,e){const t=e.getWorkspace(),i=um(t.folders);return i?i.uri:t.configuration?Ro(t.configuration):N.from({scheme:Yie.findDefaultUriScheme(s,e),authority:s.remoteAuthority,path:"/"})}class qJt{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 QJt=new qJt;let HDe=class extends V{constructor(e){super(),this.markInactive=this._register(new ln(()=>{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(U2(()=>QJt.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()})}};HDe=D([_(0,we)],HDe);let UDe=class extends V{constructor(e,t){super(),this.logService=e,this.configurationService=t,this.participants=new ul}addFileOperationParticipant(e){const t=this.participants.push(e);return Ee(()=>t())}async participate(e,t,i,n){const r=this.configurationService.getValue("files.participants.timeout");if(!(typeof r!="number"||r<=0))for(const o of this.participants)try{await o.participate(e,t,i,r,n)}catch(a){this.logService.warn(a)}}dispose(){this.participants.clear(),super.dispose()}};UDe=D([_(0,Ke),_(1,Te)],UDe);let VDe=class extends V{get length(){return this.saveParticipants.length}constructor(e){super(),this.logService=e,this.saveParticipants=[]}addSaveParticipant(e){const t=hTe(this.saveParticipants,e);return Ee(()=>t())}async participate(e,t,i,n){e.model?.pushStackElement();for(const r of this.saveParticipants){if(n.isCancellationRequested||e.isDisposed())break;try{const o=r.participate(e,t,i,n);await $_(o,n)}catch(o){this.logService.warn(o)}}e.model?.pushStackElement()}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};VDe=D([_(0,Ke)],VDe);let zDe=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 tD),this.onWillRunWorkingCopyFileOperation=this._onWillRunWorkingCopyFileOperation.event,this._onDidFailWorkingCopyFileOperation=this._register(new tD),this.onDidFailWorkingCopyFileOperation=this._onDidFailWorkingCopyFileOperation.event,this._onDidRunWorkingCopyFileOperation=this._register(new tD),this.onDidRunWorkingCopyFileOperation=this._onDidRunWorkingCopyFileOperation.event,this.correlationIds=0,this.fileOperationParticipants=this._register(this.instantiationService.createInstance(UDe)),this.saveParticipants=this._register(this.instantiationService.createInstance(VDe)),this.workingCopyProviders=[],this._register(this.registerWorkingCopyProvider(r=>this.workingCopyService.workingCopies.filter(o=>this.fileService.hasProvider(r)?this.uriIdentityService.extUri.isEqualOrParent(o.resource,r):this.uriIdentityService.extUri.isEqual(o.resource,r))))}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 er.settled(e.map(d=>this.fileService.canCreateFile(d.resource,{overwrite:d.overwrite})))).find(d=>d instanceof Error);if(l instanceof Error)throw l}const r=e.map(c=>({target:c.resource}));await this.runFileOperationParticipants(r,Ei.CREATE,n,i);const o={correlationId:this.correlationIds++,operation:Ei.CREATE,files:r};await this._onWillRunWorkingCopyFileOperation.fireAsync(o,Ue.None);let a;try{t?a=await er.settled(e.map(c=>this.fileService.createFile(c.resource,c.contents,{overwrite:c.overwrite}))):a=await er.settled(e.map(c=>this.fileService.createFolder(c.resource)))}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(o,Ue.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(o,Ue.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 r=[];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 o=e.map(c=>c.file);await this.runFileOperationParticipants(o,t?Ei.MOVE:Ei.COPY,n,i);const a={correlationId:this.correlationIds++,operation:t?Ei.MOVE:Ei.COPY,files:o};await this._onWillRunWorkingCopyFileOperation.fireAsync(a,Ue.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 er.settled(h.map(u=>u.revert({soft:!0})))}t?r.push(await this.fileService.move(c,l,d)):r.push(await this.fileService.copy(c,l,d))}}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(a,Ue.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(a,Ue.None),r}async delete(e,t,i){for(const o of e){const a=await this.fileService.canDelete(o.resource,{recursive:o.recursive,useTrash:o.useTrash});if(a instanceof Error)throw a}const n=e.map(o=>({target:o.resource}));await this.runFileOperationParticipants(n,Ei.DELETE,i,t);const r={correlationId:this.correlationIds++,operation:Ei.DELETE,files:n};await this._onWillRunWorkingCopyFileOperation.fireAsync(r,Ue.None);for(const o of e){const a=this.getDirty(o.resource);await er.settled(a.map(c=>c.revert({soft:!0})))}try{for(const o of e)await this.fileService.del(o.resource,{recursive:o.recursive,useTrash:o.useTrash})}catch(o){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(r,Ue.None),o}await this._onDidRunWorkingCopyFileOperation.fireAsync(r,Ue.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=hTe(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)}};zDe=D([_(0,Xt),_(1,Pm),_(2,we),_(3,Is)],zDe);const jJt=ih.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.")}}}}}}}),g9e=/\//g,YJt=/\$\{(scheme|authoritySuffix|authority|path|(query)\.(.+?))\}/g;function JJt(s){return!!(s&&s[2]===":")}let $De=class{constructor(e){this.formattersDisposables=new Map,jJt.setHandler((t,i)=>{for(const n of i.added)for(const r of n.value){const o={...r};typeof o.formatting.label!="string"&&(o.formatting.label="${authority}${path}"),typeof o.formatting.separator!="string"&&(o.formatting.separator=au),!hl(n.description,"contribLabelFormatterWorkspaceTooltip")&&o.formatting.workspaceTooltip&&(o.formatting.workspaceTooltip=void 0),this.formattersDisposables.set(o,e.registerFormatter(o))}for(const n of i.removed)for(const r of n.value)wt(this.formattersDisposables.get(r))})}};$De=D([_(0,Os)],$De);je.as(hf.Workbench).registerWorkbenchContribution($De,Ms.Restored);const f9e=50;let GDe=class extends V{constructor(e,t,i,n,r,o){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=pr,this.userHome=i.defaultUriScheme===pe.file?this.pathService.userHome({preferLocal:!0}):void 0;const a=this.storedFormattersMemento=new dI("cachedResourceLabelFormatters2",r);this.storedFormatters=a.getMemento(Ie.PROFILE,cn.MACHINE),this.formatters=this.storedFormatters?.formatters?.slice()||[],this.resolveRemoteEnvironment()}async resolveRemoteEnvironment(){const e=await this.remoteAgentService.getEnvironment();this.os=e?.os??pr,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;jO(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(g9e,t.separator):n}doGetUriLabel(e,t,i={}){if(!t)return ZNt(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 r=this.contextService.getWorkspace(),o=um(r.folders);o&&e.scheme!==o.uri.scheme&&e.path.startsWith(zi.sep)&&(n=this.contextService.getWorkspaceFolder(o.uri.with({path:e.path})))}if(n){const r=this.formatUri(n.uri,t,i.noPrefix);let o=this.formatUri(e,t,i.noPrefix),a=0;for(;o[a]&&o[a]===r[a];)a++;if(!o[a]||o[a]===t.separator?o=o.substring(1+a):a===r.length&&n.uri.path===zi.sep&&(o=o.substring(a)),this.contextService.getWorkspace().folders.length>1&&!i.noPrefix){const l=n?.name??TA(n.uri);o=o?`${l} • ${o}`:l}return o}}return this.formatUri(e,t,i.noPrefix)}getUriBasenameLabel(e){const t=this.findFormatting(e),i=this.doGetUriLabel(e,t);let n;return t?.separator===lc.sep?n=lc:t?.separator===zi.sep?n=zi:n=this.os===ks.Windows?lc:zi,n.basename(i)}getWorkspaceLabel(e,t){if(m_e(e)){const i=JO(e);return B_(i)||oA(i)?this.getWorkspaceLabel(i,t):""}return N.isUri(e)?this.doGetSingleFolderWorkspaceLabel(e,t):B_(e)?this.doGetSingleFolderWorkspaceLabel(e.uri,t):oA(e)?this.doGetWorkspaceLabel(e.configPath,t):""}doGetWorkspaceLabel(e,t){if(y3(e,this.environmentService))return g(867,"Untitled (Workspace)");if(Wy(e))return g(868,"Workspace");let i=vi(e);i.endsWith(Tb)&&(i=i.substr(0,i.length-Tb.length-1));let n;switch(t?.verbose){case Hp.SHORT:n=i;break;case Hp.LONG:n=g(869,"{0} (Workspace)",this.getUriLabel(Ft(Ro(e),i)));break;case Hp.MEDIUM:default:n=g(870,"{0} (Workspace)",i);break}return t?.verbose===Hp.SHORT?n:this.appendWorkspaceSuffix(n,e)}doGetSingleFolderWorkspaceLabel(e,t){let i;switch(t?.verbose){case Hp.LONG:i=this.getUriLabel(e);break;case Hp.SHORT:case Hp.MEDIUM:default:i=vi(e)||zi.sep;break}return t?.verbose===Hp.SHORT?i:this.appendWorkspaceSuffix(i,e)}getSeparator(e,t){return this.findFormatting(N.from({scheme:e,authority:t}))?.separator||zi.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>=f9e&&(i=f9e-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(YJt,(r,o,a,c)=>{switch(o){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&&JJt(n)&&(n=n.charAt(1).toUpperCase()+n.substr(2)),t.tildify&&!i&&this.userHome&&(n=pet(n,this.userHome.fsPath,this.os)),t.authorityPrefix&&e.authority&&(n=t.authorityPrefix+n),n.replace(g9e,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}};GDe=D([_(0,Xo),_(1,Ci),_(2,Cf),_(3,fg),_(4,Gi),_(5,rg)],GDe);let KDe=class extends Yie{constructor(e,t,i){super(PVt().userHome??KJt(t,i),e,t,i)}};KDe=D([_(0,fg),_(1,Xo),_(2,Ci)],KDe);function XJt(){return{[U6.toString()]:new yi(FDe,[],!0),[gMe.toString()]:new yi(BDe,[],!0),[aE.toString()]:new yi(NDe,[],!0),[MI.toString()]:new yi(MDe,[],!0),[ece.toString()]:new yi(uMe,[],!0),[ace.toString()]:new yi(ODe,[],!0),[mMe.toString()]:new yi(GJt,[],!1),[NMe.toString()]:new yi(HDe,[],!0),[qb.toString()]:new yi(zDe,[],!1),[Cf.toString()]:new yi(KDe,[],!0),[Sce.toString()]:new yi(_Ae,[],!0),[Os.toString()]:new yi(GDe,[],!0)}}var p9e;(function(s){s[s.NONE=0]="NONE",s[s.EDITS=1]="EDITS",s[s.NAVIGATION=2]="NAVIGATION"})(p9e||(p9e={}));var m9e;(function(s){s[s.DEFAULT=0]="DEFAULT",s[s.EDITOR_GROUP=1]="EDITOR_GROUP",s[s.EDITOR=2]="EDITOR"})(m9e||(m9e={}));async function ZJt(s,e=document.body,t={},i){Uit(),OVt(e,t,i);const n=kt.initialize({[xo.toString()]:mp({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??{}),...DJt(),...xJt(),...EJt(),...Xce(),...w3t(),...IJt(),...XJt(),...s});await HVt(n)}async function Hrt(s){return await Hit(),kt.get(s)}function Urt(s){if(UNe.isOpen())return kt.get(we).invokeFunction(s);const e=new Z,t=e.add(Pit.event(()=>{t.dispose(),e.add(kt.get(we).invokeFunction(s))}));return e}function qDe(s,e){const t=In(s.editor)?Ds(s.editor):Object.create(null);return Object.assign(t,Ds(e)),t}function _9e(s,e){const t=qDe(s);if(In(s.diffEditor)){const i=Ds(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,Ds(e)),t}function Vrt(s){let e=class extends s{constructor(i,n={},r,o){const{theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f,overflowWidgetsDomNode:p,dimension:m,...v}=n,b=qDe(o.getValue(n.model?.uri),v);super(r,i,{...b,overflowWidgetsDomNode:p,dimension:m,theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f}),this.textResourceConfigurationService=o,this.optionsOverrides={},this.lastAppliedEditorOptions=b,this.optionsOverrides=v,this._register(o.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=r.createChild(new Vc([Le,this._contextKeyService])),y=this._register(w.createInstance(U3));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 r=qDe(n,this.optionsOverrides);let o=r;this.lastAppliedEditorOptions!=null&&(o=g8(this.lastAppliedEditorOptions,o)),Object.keys(o).length>0&&(this.lastAppliedEditorOptions=r,super.updateOptions(o))}updateOptions(i){this.optionsOverrides??(this.optionsOverrides={}),gS.applyUpdate(this.optionsOverrides,i)&&this.updateEditorConfiguration()}};return e=D([_(2,we),_(3,xc)],e),e}const eXt=Vrt(hMe(iI)),tXt=Vrt(hMe(PM));let QDe=class extends hMe(zJ){constructor(e,t={},i,n){const{theme:r,autoDetectHighContrast:o,modifiedAriaLabel:a,originalAriaLabel:c,overflowWidgetsDomNode:l,dimension:d,...h}=t,u=_9e(n.getValue(void 0),h);super(i,e,{...u,overflowWidgetsDomNode:l,dimension:d,theme:r,autoDetectHighContrast:o,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=_9e(t,this.optionsOverrides);let n=i;this.lastAppliedEditorOptions!=null&&(n=g8(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(eXt,t,i)}};QDe=D([_(2,we),_(3,xc)],QDe);async function zrt(s,e){await(await Hrt(Xt)).writeFile(s,Ge.fromString(e))}async function iXt(s,e){return e!=null&&await zrt(s,e),await(await Hrt(pn)).createModelReference(s)}function nXt(s){return s.registerKeybindingProvider!=null}let jDe=class extends tI{constructor(e,t,i,n,r,o,a){super(t,i,n,r,o,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)}};jDe=D([_(1,Le),_(2,bi),_(3,Ji),_(4,wi),_(5,Ke),_(6,qt)],jDe);let rge=null;function $rt(s){if(rge==null){const e=new Vc;e.set(Tn,new yi(F3,[],!0));const t=s.get(Vt);!(t instanceof tI)&&nXt(t)&&e.set(Vt,new yi(jDe,[t],!0)),rge=s.get(we).createChild(e)}return rge}const sXt=(s,e,t)=>kt.initialize(t??{}).invokeFunction($rt).createInstance(tXt,s,e),rXt=(s,e,t)=>kt.initialize(t??{}).invokeFunction($rt).createInstance(QDe,s,e);var oXt='.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}';gt(oXt,{});var JH;(function(s){s[s.None=0]="None",s[s.Open=1]="Open",s[s.Close=-1]="Close"})(JH||(JH={}));function aXt(s){return Array.isArray(s)}function cXt(s){return!aXt(s)}function Grt(s){return typeof s=="string"}function v9e(s){return!Grt(s)}function h1(s){return!s}function wA(s,e){return s.ignoreCase&&e?e.toLowerCase():e}function b9e(s){return s.replace(/[&<>'"_]/g,"-")}function lXt(s,e){console.log(`${s.languageId}: ${e}`)}function to(s,e){return new Error(`${s.languageId}: ${e}`)}function ux(s,e,t,i,n){const r=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let o=null;return e.replace(r,function(a,c,l,d,h,u,f,p,m){return h1(l)?h1(d)?!h1(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 hXt(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 YDe;const Krt=5,woe=class woe{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 mB(e,t);let i=mB.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new mB(e,t),this._entries[i]=n,n)}};woe._INSTANCE=new woe(Krt);let J$=woe;class mB{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 mB._equals(this,e)}push(e){return J$.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return J$.create(this.parent,e)}}class HF{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 HF(this.languageId,this.state)}}const yoe=class yoe{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 Dz(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new Dz(e,t);const i=mB.getStackElementId(e);let n=this._entries[i];return n||(n=new Dz(e,null),this._entries[i]=n,n)}};yoe._INSTANCE=new yoe(Krt);let gx=yoe;class Dz{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:gx.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof Dz)||!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 uXt{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 E8(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const r=i.languageId,o=i.state,a=La.get(r);if(!a)return this.enterLanguage(r),this.emit(n,""),o;const c=a.tokenize(e,t,o);if(n!==0)for(const l of c.tokens)this._tokens.push(new E8(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 Jie{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=ST.Null,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|Ui.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,r=t.length,o=i!==null?i.length:0;if(n===0&&r===0&&o===0)return new Uint32Array(0);if(n===0&&r===0)return i;if(r===0&&o===0)return e;const a=new Uint32Array(n+r+o);e!==null&&a.set(e);for(let c=0;c{if(o)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=La.get(t);if(i){if(i instanceof YDe){const n=i.getLoadStatus();n.loaded===!1&&e.push(n.promise)}continue}La.isResolved(t)||e.push(La.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=J$.create(null,this._lexer.start);return gx.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return lQe(this._languageId,i);const n=new uXt,r=this._tokenize(e,t,i,n);return n.finalize(r)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return JTe(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new Jie(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),r=this._tokenize(e,t,i,n);return n.finalize(r)}_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=JK(this._lexer,t.stack.state),!i))throw to(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,r=!1;for(const o of i){if(!v9e(o.action)||o.action.nextEmbedded!=="@pop")continue;r=!0;let a=o.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&&o.matchOnlyAtLineStart||(n===-1||l0&&r.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,n);const c=e.substring(o);return this._myTokenize(c,t,i,n+o,r)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,r){r.enterLanguage(this._languageId);const o=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=JK(this._lexer,b),!R))throw to(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 to(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 to(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=ux(this._lexer,C.next,y,w,b);if(R[0]==="@"&&(R=R.substr(1)),JK(this._lexer,R))d=d.push(R);else throw to(this._lexer,"trying to set a next state '"+R+"' that is undefined in rule: "+this._safeRuleName(A))}}C.log&&typeof C.log=="string"&&lXt(this._lexer,this._lexer.languageId+": "+ux(this._lexer,C.log,y,w,b))}if(k===null)throw to(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 to(this._lexer,"groups cannot be nested: "+this._safeRuleName(A));if(w.length!==k.length+1)throw to(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 qPe{static colorizeElement(e,t,i,n){n=n||{};const r=n.theme||"vs",o=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!o)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(o)||o;e.setTheme(r);const c=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+r;const l=d=>{const h=fXt?.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 r=e.languageIdCodec;let o=4;n&&typeof n.tabSize=="number"&&(o=n.tabSize),DTe(t)&&(t=t.substr(1));const a=cv(t);if(!e.isRegisteredLanguageId(i))return w9e(a,o,r);const c=await La.getOrCreate(i);return c?pXt(a,o,c,r):w9e(a,o,r)}static colorizeLine(e,t,i,n,r=4){const o=_p.isBasicASCII(e,t),a=_p.containsRTL(e,o,i);return aae(new DI(!1,!0,e,!1,o,a,0,n,[],r,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 o=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}}function pXt(s,e,t,i){return new Promise((n,r)=>{const o=()=>{const a=mXt(s,e,t,i);if(t instanceof X$){const c=t.getLoadStatus();if(c.loaded===!1){c.promise.then(o,r);return}}n(a)};o()})}function w9e(s,e,t){let i=[];const n=(Vr.None<>>0,r=new Uint32Array(2);r[0]=0,r[1]=n;for(let o=0,a=s.length;o")}return i.join("")}function mXt(s,e,t,i){let n=[],r=t.getInitialState();for(let o=0,a=s.length;o"),r=l.endState}return n.join("")}function _Xt(s,e,t){return kt.initialize(t||{}).createInstance(PM,s,e)}function vXt(s){return kt.get(qt).onCodeEditorAdd(t=>{s(t)})}function bXt(s){return kt.get(qt).onDiffEditorAdd(t=>{s(t)})}function wXt(){return kt.get(qt).listCodeEditors()}function yXt(){return kt.get(qt).listDiffEditors()}function CXt(s,e,t){return kt.initialize(t||{}).createInstance(zJ,s,e)}function SXt(s,e){const t=kt.initialize(e||{});return new Vve(s,{},t)}function AXt(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return vt.registerCommand(s.id,s.run)}function EXt(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,...r)=>uc.runEditorCommand(n,r,e,(o,a,c)=>Promise.resolve(s.run(a,...c))),i=new Z;if(i.add(vt.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(Yn.appendMenuItem(_e.EditorContext,n))}if(Array.isArray(s.keybindings)){const n=kt.get(Vt);if(!(n instanceof tI))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const r=he.and(e,he.deserialize(s.keybindingContext));i.add(n.addDynamicKeybindings(s.keybindings.map(o=>({keybinding:o,command:s.id,when:r}))))}}return i}function xXt(s){return qrt([s])}function qrt(s){const e=kt.get(Vt);return e instanceof tI?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 DXt(s,e,t){const i=kt.get(Di),n=i.getLanguageIdByMimeType(e)||e;return hXe(kt.get(fi),i,s,n,t)}function kXt(s,e){const t=kt.get(Di),i=t.getLanguageIdByMimeType(e)||e||Sa;s.setLanguage(t.createById(i))}function IXt(s,e,t){s&&kt.get(Dm).changeOne(e,s.uri,t)}function TXt(s){kt.get(Dm).changeAll(s,[])}function LXt(s){return kt.get(Dm).read(s)}function RXt(s){return kt.get(Dm).onMarkerChanged(s)}function MXt(s){return kt.get(fi).getModel(s)}function NXt(){return kt.get(fi).getModels()}function PXt(s){return kt.get(fi).onModelAdded(s)}function FXt(s){return kt.get(fi).onModelRemoved(s)}function OXt(s){return kt.get(fi).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function BXt(s){return zft(kt.get(fi),kt.get(zs),s)}function WXt(s,e){const t=kt.get(Di),i=kt.get(hv);return qPe.colorizeElement(i,t,s,e).then(()=>{i.registerEditorContainer(s)})}function HXt(s,e,t){const i=kt.get(Di);return kt.get(hv).registerEditorContainer(ri.document.body),qPe.colorize(i,s,e,t)}function UXt(s,e,t=4){return kt.get(hv).registerEditorContainer(ri.document.body),qPe.colorizeModelLine(s,e,t)}function VXt(s){const e=La.get(s);return e||{getInitialState:()=>K8,tokenize:(t,i,n)=>lQe(s,n)}}function zXt(s,e){La.getOrCreate(e);const t=VXt(e),i=cv(s),n=[];let r=t.getInitialState();for(let o=0,a=i.length;o{if(!i)return null;const r=t.options?.selection;let o;return r&&typeof r.endLineNumber=="number"&&typeof r.endColumn=="number"?o=r:r&&(o={lineNumber:r.startLineNumber,column:r.startColumn}),await s.openCodeEditor(i,t.resource,o)?i:null})}function YXt(){return{create:_Xt,getEditors:wXt,getDiffEditors:yXt,onDidCreateEditor:vXt,onDidCreateDiffEditor:bXt,createDiffEditor:CXt,addCommand:AXt,addEditorAction:EXt,addKeybindingRule:xXt,addKeybindingRules:qrt,createModel:DXt,setModelLanguage:kXt,setModelMarkers:IXt,getModelMarkers:LXt,removeAllMarkers:TXt,onDidChangeMarkers:RXt,getModels:NXt,getModel:MXt,onDidCreateModel:PXt,onWillDisposeModel:FXt,onDidChangeModelLanguage:OXt,createWebWorker:BXt,colorizeElement:WXt,colorize:HXt,colorizeModelLine:UXt,tokenize:zXt,defineTheme:$Xt,setTheme:GXt,remeasureFonts:KXt,registerCommand:qXt,registerLinkOpener:QXt,registerEditorOpener:jXt,AccessibilitySupport:Mfe,ContentWidgetPositionPreference:Wfe,CursorChangeReason:Hfe,DefaultEndOfLine:Ufe,EditorAutoIndentStrategy:zfe,EditorOption:$fe,EndOfLinePreference:Gfe,EndOfLineSequence:Kfe,MinimapPosition:npe,MinimapSectionHeaderStyle:spe,MouseTargetType:rpe,OverlayWidgetPositionPreference:cpe,OverviewRulerLane:lpe,GlyphMarginLane:qfe,RenderLineNumbersType:upe,RenderMinimap:gpe,ScrollbarVisibility:ppe,ScrollType:fpe,TextEditorCursorBlinkingStyle:ype,TextEditorCursorStyle:Cpe,TrackedRangeStickiness:Spe,WrappingIndent:Ape,InjectedTextCursorStops:Yfe,PositionAffinity:hpe,ShowLightbulbIconMode:_pe,ConfigurationChangedEvent:AKe,BareFontInfo:xx,FontInfo:Tq,TextModelResolvedOptions:Mq,FindMatch:$8,ApplyUpdateResult:r5,EditorZoom:Jp,createMultiFileDiffEditor:SXt,EditorType:TU,EditorOptions:Ch}}function JXt(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function XK(s,e){return typeof s=="boolean"?s:e}function y9e(s,e){return typeof s=="string"?s:e}function XXt(s){const e={};for(const t of s)e[t]=!0;return e}function C9e(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=XXt(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 JDe(s,e,t){e=e.replace(/@@/g,"");let i=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(o,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?to(s,"language definition does not contain attribute '"+a+"', used at: "+e):to(s,"attribute reference '"+a+"' must be a string, used at: "+e);return h1(c)?"":"(?:"+c+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const r=(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(dXt(s,e,l),r)),c)}return new RegExp(e,r)}function ZXt(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=JH.Open;else if(t.bracket==="@close")i.bracket=JH.Close;else throw to(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw to(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&&!hXt(s,ux(s,n,"",[],""))))throw to(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,r=t.length;n0&&i[0]==="^",this.name=this.name+": "+i,this.regex=JDe(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=XDe(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function Qrt(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:s,includeLF:XK(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:XK(e.ignoreCase,!1),unicode:XK(e.unicode,!1),tokenPostfix:y9e(e.tokenPostfix,"."+s),defaultToken:y9e(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(o,a,c){for(const l of c){let d=l.include;if(d){if(typeof d!="string")throw to(t,"an 'include' attribute must be a string at: "+o);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw to(t,"include target '"+d+"' is not defined at: "+o);n(o+"."+d,a,e.tokenizer[d])}else{const h=new tZt(o);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 to(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: "+o);else h.setAction(i,l[1]);else{if(!l.regex)throw to(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+o);l.name&&typeof l.name=="string"&&(h.name=l.name),l.matchOnlyAtStart&&(h.matchOnlyAtLineStart=XK(l.matchOnlyAtLineStart,!1)),h.setRegex(i,l.regex),h.setAction(i,l.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw to(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const o in e.tokenizer)if(e.tokenizer.hasOwnProperty(o)){t.start||(t.start=o);const a=e.tokenizer[o];t.tokenizer[o]=new Array,n("tokenizer."+o,t.tokenizer[o],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw to(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 r=[];for(const o of e.brackets){let a=o;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw to(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` +`: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=JK(this._lexer,b),!R))throw to(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 to(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 to(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=ux(this._lexer,C.next,y,w,b);if(R[0]==="@"&&(R=R.substr(1)),JK(this._lexer,R))d=d.push(R);else throw to(this._lexer,"trying to set a next state '"+R+"' that is undefined in rule: "+this._safeRuleName(A))}}C.log&&typeof C.log=="string"&&lXt(this._lexer,this._lexer.languageId+": "+ux(this._lexer,C.log,y,w,b))}if(k===null)throw to(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 to(this._lexer,"groups cannot be nested: "+this._safeRuleName(A));if(w.length!==k.length+1)throw to(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 qPe{static colorizeElement(e,t,i,n){n=n||{};const r=n.theme||"vs",o=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!o)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(o)||o;e.setTheme(r);const c=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+r;const l=d=>{const h=fXt?.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 r=e.languageIdCodec;let o=4;n&&typeof n.tabSize=="number"&&(o=n.tabSize),DTe(t)&&(t=t.substr(1));const a=cv(t);if(!e.isRegisteredLanguageId(i))return w9e(a,o,r);const c=await La.getOrCreate(i);return c?pXt(a,o,c,r):w9e(a,o,r)}static colorizeLine(e,t,i,n,r=4){const o=_p.isBasicASCII(e,t),a=_p.containsRTL(e,o,i);return aae(new DI(!1,!0,e,!1,o,a,0,n,[],r,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 o=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}}function pXt(s,e,t,i){return new Promise((n,r)=>{const o=()=>{const a=mXt(s,e,t,i);if(t instanceof X$){const c=t.getLoadStatus();if(c.loaded===!1){c.promise.then(o,r);return}}n(a)};o()})}function w9e(s,e,t){let i=[];const n=(Vr.None<>>0,r=new Uint32Array(2);r[0]=0,r[1]=n;for(let o=0,a=s.length;o")}return i.join("")}function mXt(s,e,t,i){let n=[],r=t.getInitialState();for(let o=0,a=s.length;o"),r=l.endState}return n.join("")}function _Xt(s,e,t){return kt.initialize(t||{}).createInstance(PM,s,e)}function vXt(s){return kt.get(qt).onCodeEditorAdd(t=>{s(t)})}function bXt(s){return kt.get(qt).onDiffEditorAdd(t=>{s(t)})}function wXt(){return kt.get(qt).listCodeEditors()}function yXt(){return kt.get(qt).listDiffEditors()}function CXt(s,e,t){return kt.initialize(t||{}).createInstance(zJ,s,e)}function SXt(s,e){const t=kt.initialize(e||{});return new Vve(s,{},t)}function AXt(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return vt.registerCommand(s.id,s.run)}function EXt(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,...r)=>uc.runEditorCommand(n,r,e,(o,a,c)=>Promise.resolve(s.run(a,...c))),i=new Z;if(i.add(vt.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(Yn.appendMenuItem(_e.EditorContext,n))}if(Array.isArray(s.keybindings)){const n=kt.get(Vt);if(!(n instanceof tI))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const r=he.and(e,he.deserialize(s.keybindingContext));i.add(n.addDynamicKeybindings(s.keybindings.map(o=>({keybinding:o,command:s.id,when:r}))))}}return i}function xXt(s){return qrt([s])}function qrt(s){const e=kt.get(Vt);return e instanceof tI?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 DXt(s,e,t){const i=kt.get(Di),n=i.getLanguageIdByMimeType(e)||e;return hXe(kt.get(fi),i,s,n,t)}function kXt(s,e){const t=kt.get(Di),i=t.getLanguageIdByMimeType(e)||e||Sa;s.setLanguage(t.createById(i))}function IXt(s,e,t){s&&kt.get(Dm).changeOne(e,s.uri,t)}function TXt(s){kt.get(Dm).changeAll(s,[])}function LXt(s){return kt.get(Dm).read(s)}function RXt(s){return kt.get(Dm).onMarkerChanged(s)}function MXt(s){return kt.get(fi).getModel(s)}function NXt(){return kt.get(fi).getModels()}function PXt(s){return kt.get(fi).onModelAdded(s)}function FXt(s){return kt.get(fi).onModelRemoved(s)}function OXt(s){return kt.get(fi).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function BXt(s){return zft(kt.get(fi),kt.get(zs),s)}function WXt(s,e){const t=kt.get(Di),i=kt.get(hv);return qPe.colorizeElement(i,t,s,e).then(()=>{i.registerEditorContainer(s)})}function HXt(s,e,t){const i=kt.get(Di);return kt.get(hv).registerEditorContainer(ri.document.body),qPe.colorize(i,s,e,t)}function UXt(s,e,t=4){return kt.get(hv).registerEditorContainer(ri.document.body),qPe.colorizeModelLine(s,e,t)}function VXt(s){const e=La.get(s);return e||{getInitialState:()=>K8,tokenize:(t,i,n)=>lQe(s,n)}}function zXt(s,e){La.getOrCreate(e);const t=VXt(e),i=cv(s),n=[];let r=t.getInitialState();for(let o=0,a=i.length;o{if(!i)return null;const r=t.options?.selection;let o;return r&&typeof r.endLineNumber=="number"&&typeof r.endColumn=="number"?o=r:r&&(o={lineNumber:r.startLineNumber,column:r.startColumn}),await s.openCodeEditor(i,t.resource,o)?i:null})}function YXt(){return{create:_Xt,getEditors:wXt,getDiffEditors:yXt,onDidCreateEditor:vXt,onDidCreateDiffEditor:bXt,createDiffEditor:CXt,addCommand:AXt,addEditorAction:EXt,addKeybindingRule:xXt,addKeybindingRules:qrt,createModel:DXt,setModelLanguage:kXt,setModelMarkers:IXt,getModelMarkers:LXt,removeAllMarkers:TXt,onDidChangeMarkers:RXt,getModels:NXt,getModel:MXt,onDidCreateModel:PXt,onWillDisposeModel:FXt,onDidChangeModelLanguage:OXt,createWebWorker:BXt,colorizeElement:WXt,colorize:HXt,colorizeModelLine:UXt,tokenize:zXt,defineTheme:$Xt,setTheme:GXt,remeasureFonts:KXt,registerCommand:qXt,registerLinkOpener:QXt,registerEditorOpener:jXt,AccessibilitySupport:Mfe,ContentWidgetPositionPreference:Wfe,CursorChangeReason:Hfe,DefaultEndOfLine:Ufe,EditorAutoIndentStrategy:zfe,EditorOption:$fe,EndOfLinePreference:Gfe,EndOfLineSequence:Kfe,MinimapPosition:npe,MinimapSectionHeaderStyle:spe,MouseTargetType:rpe,OverlayWidgetPositionPreference:cpe,OverviewRulerLane:lpe,GlyphMarginLane:qfe,RenderLineNumbersType:upe,RenderMinimap:gpe,ScrollbarVisibility:ppe,ScrollType:fpe,TextEditorCursorBlinkingStyle:ype,TextEditorCursorStyle:Cpe,TrackedRangeStickiness:Spe,WrappingIndent:Ape,InjectedTextCursorStops:Yfe,PositionAffinity:hpe,ShowLightbulbIconMode:_pe,ConfigurationChangedEvent:AKe,BareFontInfo:xx,FontInfo:Tq,TextModelResolvedOptions:Mq,FindMatch:$8,ApplyUpdateResult:r5,EditorZoom:Jp,createMultiFileDiffEditor:SXt,EditorType:TU,EditorOptions:Ch}}function JXt(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function XK(s,e){return typeof s=="boolean"?s:e}function y9e(s,e){return typeof s=="string"?s:e}function XXt(s){const e={};for(const t of s)e[t]=!0;return e}function C9e(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=XXt(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 JDe(s,e,t){e=e.replace(/@@/g,"");let i=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(o,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?to(s,"language definition does not contain attribute '"+a+"', used at: "+e):to(s,"attribute reference '"+a+"' must be a string, used at: "+e);return h1(c)?"":"(?:"+c+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const r=(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(dXt(s,e,l),r)),c)}return new RegExp(e,r)}function ZXt(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=JH.Open;else if(t.bracket==="@close")i.bracket=JH.Close;else throw to(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw to(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&&!hXt(s,ux(s,n,"",[],""))))throw to(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,r=t.length;n0&&i[0]==="^",this.name=this.name+": "+i,this.regex=JDe(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=XDe(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function Qrt(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:s,includeLF:XK(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:XK(e.ignoreCase,!1),unicode:XK(e.unicode,!1),tokenPostfix:y9e(e.tokenPostfix,"."+s),defaultToken:y9e(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(o,a,c){for(const l of c){let d=l.include;if(d){if(typeof d!="string")throw to(t,"an 'include' attribute must be a string at: "+o);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw to(t,"include target '"+d+"' is not defined at: "+o);n(o+"."+d,a,e.tokenizer[d])}else{const h=new tZt(o);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 to(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: "+o);else h.setAction(i,l[1]);else{if(!l.regex)throw to(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+o);l.name&&typeof l.name=="string"&&(h.name=l.name),l.matchOnlyAtStart&&(h.matchOnlyAtLineStart=XK(l.matchOnlyAtLineStart,!1)),h.setRegex(i,l.regex),h.setAction(i,l.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw to(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const o in e.tokenizer)if(e.tokenizer.hasOwnProperty(o)){t.start||(t.start=o);const a=e.tokenizer[o];t.tokenizer[o]=new Array,n("tokenizer."+o,t.tokenizer[o],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw to(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 r=[];for(const o of e.brackets){let a=o;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw to(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")r.push({token:a.token+t.tokenPostfix,open:wA(t,a.open),close:wA(t,a.close)});else throw to(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=r,t.noThrow=!0,t}function iZt(s){xT.registerLanguage(s)}function nZt(){let s=[];return s=s.concat(xT.getLanguages()),s}function sZt(s){return kt.get(Di).languageIdCodec.encodeLanguageId(s)}function rZt(s,e){return kt.withServices(()=>{const i=kt.get(Di).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function oZt(s,e){return kt.withServices(()=>{const i=kt.get(Di).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function aZt(s,e){if(!kt.get(Di).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return kt.get(zs).register(s,e,100)}class cZt{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 Z$.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 Joe(n.tokens,n.endState)}}class Z${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 r=0,o=e.length;r0&&r[o-1]===u)continue;let f=h.startIndex;l===0?f=0:f{const i=await Promise.resolve(e.create());return i?lZt(i)?Yrt(s,i):new X$(kt.get(Di),kt.get(hv),s,Qrt(s,i),kt.get(Te)):null});return La.registerFactory(s,t)}function uZt(s,e){if(!kt.get(Di).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return jrt(e)?QPe(s,{create:()=>e}):La.register(s,Yrt(s,e))}function gZt(s,e){const t=i=>new X$(kt.get(Di),kt.get(hv),s,Qrt(s,i),kt.get(Te));return jrt(e)?QPe(s,{create:()=>e}):La.register(s,t(e))}function fZt(s,e){return kt.get(nt).referenceProvider.register(s,e)}function pZt(s,e){return kt.get(nt).renameProvider.register(s,e)}function mZt(s,e){return kt.get(nt).newSymbolNamesProvider.register(s,e)}function _Zt(s,e){return kt.get(nt).signatureHelpProvider.register(s,e)}function vZt(s,e){return kt.get(nt).hoverProvider.register(s,{provideHover:async(i,n,r,o)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,r,o)).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 bZt(s,e){return kt.get(nt).documentSymbolProvider.register(s,e)}function wZt(s,e){return kt.get(nt).documentHighlightProvider.register(s,e)}function yZt(s,e){return kt.get(nt).linkedEditingRangeProvider.register(s,e)}function CZt(s,e){return kt.get(nt).definitionProvider.register(s,e)}function SZt(s,e){return kt.get(nt).implementationProvider.register(s,e)}function AZt(s,e){return kt.get(nt).typeDefinitionProvider.register(s,e)}function EZt(s,e){return kt.get(nt).codeLensProvider.register(s,e)}function xZt(s,e,t){return kt.get(nt).codeActionProvider.register(s,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,r,o,a)=>{const l=kt.get(Dm).read({resource:n.uri}).filter(d=>F.areIntersectingOrTouching(d,r));return e.provideCodeActions(n,r,{markers:l,only:o.only,trigger:o.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function DZt(s,e){return kt.get(nt).documentFormattingEditProvider.register(s,e)}function kZt(s,e){return kt.get(nt).documentRangeFormattingEditProvider.register(s,e)}function IZt(s,e){return kt.get(nt).onTypeFormattingEditProvider.register(s,e)}function TZt(s,e){return kt.get(nt).linkProvider.register(s,e)}function LZt(s,e){return kt.get(nt).completionProvider.register(s,e)}function RZt(s,e){return kt.get(nt).colorProvider.register(s,e)}function MZt(s,e){return kt.get(nt).foldingRangeProvider.register(s,e)}function NZt(s,e){return kt.get(nt).declarationProvider.register(s,e)}function PZt(s,e){return kt.get(nt).selectionRangeProvider.register(s,e)}function FZt(s,e){return kt.get(nt).documentSemanticTokensProvider.register(s,e)}function OZt(s,e){return kt.get(nt).documentRangeSemanticTokensProvider.register(s,e)}function BZt(s,e){return kt.get(nt).inlineCompletionsProvider.register(s,e)}function WZt(s,e){return kt.get(nt).inlineEditProvider.register(s,e)}function HZt(s,e){return kt.get(nt).inlayHintsProvider.register(s,e)}function UZt(){return{register:iZt,getLanguages:nZt,onLanguage:rZt,onLanguageEncountered:oZt,getEncodedLanguageId:sZt,setLanguageConfiguration:aZt,setColorMap:hZt,registerTokensProviderFactory:QPe,setTokensProvider:uZt,setMonarchTokensProvider:gZt,registerReferenceProvider:fZt,registerRenameProvider:pZt,registerNewSymbolNameProvider:mZt,registerCompletionItemProvider:LZt,registerSignatureHelpProvider:_Zt,registerHoverProvider:vZt,registerDocumentSymbolProvider:bZt,registerDocumentHighlightProvider:wZt,registerLinkedEditingRangeProvider:yZt,registerDefinitionProvider:CZt,registerImplementationProvider:SZt,registerTypeDefinitionProvider:AZt,registerCodeLensProvider:EZt,registerCodeActionProvider:xZt,registerDocumentFormattingEditProvider:DZt,registerDocumentRangeFormattingEditProvider:kZt,registerOnTypeFormattingEditProvider:IZt,registerLinkProvider:TZt,registerColorProvider:RZt,registerFoldingRangeProvider:MZt,registerDeclarationProvider:NZt,registerSelectionRangeProvider:PZt,registerDocumentSemanticTokensProvider:FZt,registerDocumentRangeSemanticTokensProvider:OZt,registerInlineCompletionsProvider:BZt,registerInlineEditProvider:WZt,registerInlayHintsProvider:HZt,DocumentHighlightKind:Vfe,CompletionItemKind:Ffe,CompletionItemTag:Ofe,CompletionItemInsertTextRule:Pfe,SymbolKind:bpe,SymbolTag:wpe,IndentAction:jfe,CompletionTriggerKind:Bfe,SignatureHelpTriggerKind:vpe,InlayHintKind:Jfe,InlineCompletionTriggerKind:Xfe,InlineEditTriggerKind:Zfe,CodeActionTriggerType:Nfe,NewSymbolNameTag:ope,NewSymbolNameTriggerKind:ape,PartialAcceptTriggerKind:dpe,HoverVerbosityAction:Qfe,FoldingRangeKind:u_,SelectedSuggestionInfo:OKe}}Ch.wrappingIndent.defaultValue=Fu.None;Ch.glyphMargin.defaultValue=!1;Ch.autoIndent.defaultValue=dl.Advanced;Ch.overviewRulerLanes.defaultValue=2;wW.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const wu=WKe();wu.editor=YXt();wu.languages=UZt();wu.CancellationTokenSource;wu.Emitter;wu.KeyCode;wu.KeyMod;wu.Position;wu.Range;wu.Selection;wu.SelectionDirection;wu.MarkerSeverity;wu.MarkerTag;const Zv=wu.Uri;wu.Token;const yN=wu.editor,Jx=wu.languages,VZt=globalThis.MonacoEnvironment;(VZt?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=wu);const zZt=Jx.onLanguage;Jx.onLanguage=(s,e)=>Urt(()=>zZt(s,e));const $Zt=Jx.onLanguage;Jx.onLanguageEncountered=(s,e)=>Urt(()=>$Zt(s,e));yN.create=sXt;yN.createDiffEditor=rXt;yN.createModelReference=iXt;yN.writeFile=zrt;const GZt={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 ble(s,e,t="OK",i=()=>{},n=()=>{}){const r=document.createElement("dialog");r.classList.add("dialog"),r.classList.add("modal"),r.classList.add(s);const o=document.createElement("div");o.classList.add("titlebar");const a=document.createElement("i");a.classList.add("close_button"),a.classList.add("fa"),a.classList.add("fa-times"),a.onclick=()=>r.close(),o.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(),r.close()},h.appendChild(l),r.appendChild(o),r.appendChild(c),r.appendChild(h),document.body.appendChild(r),r.onclose=n,r.showModal()}function KZt(s){alert(s)}function S9e(...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 r=document.createElement("p");r.className="url_text",r.innerHTML=''+i+"";const o=document.createElement("button");o.classList.add("button"),o.classList.add("copy_url"),o.onclick=()=>navigator.clipboard.writeText(i);const a=document.createElement("i");a.classList.add("fa"),a.classList.add("fa-copy"),o.appendChild(a),n.appendChild(r),n.appendChild(o),t.push(n)}ble("report_export_url",t)}async function qZt(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),ble("gist_export_dialog",[e,t],"Export",()=>s(e.value,i.checked))}function QZt(){const s=document.createElement("div");s.innerHTML=`
@@ -991,18 +991,18 @@ ${o}`)}}};BDe=D([_(0,U6),_(1,Xt)],BDe);var WDe;let Yie=WDe=class{constructor(e,t 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 XZt(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=YPe();n!=null&&(i.Authorization="Bearer "+n);const o=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(o.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 _si(a);if(o.errors)return Promise.reject(`Failed to read gist: +`+h.statusText+u)}}async function XZt(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=YPe();n!=null&&(i.Authorization="Bearer "+n);const o=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(o.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 vsi(a);if(o.errors)return Promise.reject(`Failed to read gist: `+o.errors.join(` `));const u=o.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 ZZt(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 eei(s){try{const e=new URL(s);if(e.hostname==="gist.github.com")return XZt(e);if(e.hostname==="github.com")return ZZt(e)}catch{return Promise.reject("Failed to process URL")}return Promise.resolve([null,null,null])}var Pt;(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})(Pt||(Pt={}));function*B4(){}function eke(s,e){let t=0;for(const i of s)if(e(i,t++))return i}function tei(s,e){let t=0;for(const i of s)if(e(i,t++)===!1)return!1;return!0}function iei(s,e){let t=0;for(const i of s)if(e(i,t++))return!0;return!1}var A9e;(function(s){function e(t,i,n){return n===0?1/0:t>i&&n>0||t-1;e--)yield s[e]}function sei(s){let e=[],t=new Set,i=new Map;for(const o of s)n(o);for(const[o]of i)r(o);return e;function n(o){let[a,c]=o,l=i.get(c);l?l.push(a):i.set(c,[a])}function r(o){if(t.has(o))return;t.add(o);let a=i.get(o);if(a)for(const c of a)r(c);e.push(o)}}var e7;(function(s){function e(o,a,c=0){let l=new Array(a.length);for(let d=0,h=c,u=a.length;da?1:0}s.cmp=r})(e7||(e7={}));var Zc;(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?o(d,h):a(d,h)}s.deepEqual=n;function r(d){return e(d)?d:t(d)?c(d):l(d)}s.deepCopy=r;function o(d,h){if(d===h)return!0;if(d.length!==h.length)return!1;for(let u=0,f=d.length;u{if(u===o.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(!o.provides||l.length===0)return;const h=[o.id];if(l.some(d))throw new ReferenceError(`Cycle detected: ${h.join(" -> ")}.`)}s.ensureNoCycle=i;function n(o,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]===o);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=sei(h),p=f.findIndex(m=>m===o);return p===-1?[o]:f.slice(0,p+1)}s.findDependents=n;function r(o,a){const c=new Set;for(const l of o.keys())o.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=r})(E9e||(E9e={}));function oei(s){let e=0;for(let t=0,i=s.length;t>>0),s[t]=e&255,e>>>=8}var tke;(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)}:oei})()})(tke||(tke={}));function aei(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 ike;(function(s){s.uuid4=aei(tke.getRandomValues)})(ike||(ike={}));var x9e;(function(s){function e(t){const i=document.body,n=r=>{r.preventDefault(),r.stopPropagation(),r.clipboardData.setData("text",t),i.removeEventListener("copy",n,!0)};i.addEventListener("copy",n,!0),document.execCommand("copy")}s.copyText=e})(x9e||(x9e={}));var Oa;(function(s){function e(r){let o=window.getComputedStyle(r),a=parseFloat(o.borderTopWidth)||0,c=parseFloat(o.borderLeftWidth)||0,l=parseFloat(o.borderRightWidth)||0,d=parseFloat(o.borderBottomWidth)||0,h=parseFloat(o.paddingTop)||0,u=parseFloat(o.paddingLeft)||0,f=parseFloat(o.paddingRight)||0,p=parseFloat(o.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(r){let o=window.getComputedStyle(r),a=parseFloat(o.minWidth)||0,c=parseFloat(o.minHeight)||0,l=parseFloat(o.maxWidth)||1/0,d=parseFloat(o.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(r,o,a){let c=r.getBoundingClientRect();return o>=c.left&&o=c.top&&a=a.bottom)){if(c.topa.bottom&&c.height>=a.height){r.scrollTop-=a.top-c.top;return}if(c.topa.height){r.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(o)){f++;continue}if(p(a)){u++;continue}if(p(r)){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=/^\[[^\]]+\]/,r=/^[^\s\+>~#\.\[:]+/,o=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,a=/^:[^\s\+>~#\.\[:]+/,c=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g})(Fv||(Fv={}));class nke{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 WC.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 WC.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 WC.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new WC.LinkedListNode(this,e),n=t,r=n.prev;return i.next=n,i.prev=r,n.prev=i,r.next=i,this._size++,i}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof WC.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new WC.LinkedListNode(this,e),n=t,r=n.next;return i.next=r,i.prev=n,n.next=i,r.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 WC.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})(nke||(nke={}));var WC;(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})(WC||(WC={}));let zm=class{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}};class $V extends zm{get isConflatable(){return!0}conflate(e){return!0}}var $t;(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}tei(nei(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}iei(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 r(P,R){let z=u.get(P);z&&z.indexOf(R)!==-1||(z?z.push(R):u.set(P,[R]))}s.installMessageHook=r;function o(P,R){let z=u.get(P);if(!z)return;let G=z.indexOf(R);G!==-1&&(z[G]=null,C(z))}s.removeMessageHook=o;function a(P){let R=u.get(P);R&&R.length>0&&(Pt.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 nke,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){Pt.removeAllWhere(P,k)}function k(P){return P===null}})($t||($t={}));class ov{constructor(e){this._pid=Q1.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=Q1.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=Q1.ensureMap(e);this._pid in n?i=n[this._pid]:i=n[this._pid]=this._createValue(e);let r=this._coerceValue(e,t);this._maybeNotify(e,i,n[this._pid]=r)}coerce(e){let t,i=Q1.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){Q1.ownerData.delete(t)}s.clearData=e})(ov||(ov={}));var Q1;(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})(Q1||(Q1={}));class ja{constructor(e){this.sender=e}connect(e,t){return Vp.connect(this,e,t)}disconnect(e,t){return Vp.disconnect(this,e,t)}emit(e){Vp.emit(this,e)}}(function(s){function e(c,l){Vp.disconnectBetween(c,l)}s.disconnectBetween=e;function t(c){Vp.disconnectSender(c)}s.disconnectSender=t;function i(c){Vp.disconnectReceiver(c)}s.disconnectReceiver=i;function n(c){Vp.disconnectAll(c)}s.disconnectAll=n;function r(c){Vp.disconnectAll(c)}s.clearData=r;function o(){return Vp.exceptionHandler}s.getExceptionHandler=o;function a(c){let l=Vp.exceptionHandler;return Vp.exceptionHandler=c,l}s.setExceptionHandler=a})(ja||(ja={}));var Vp;(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 r(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=r;function o(w){n(w),r(w)}s.disconnectAll=o;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){Pt.removeAllWhere(w,b)}function b(w){return w.signal===null}})(Vp||(Vp={}));class ske{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class rke{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})(rke||(rke={}));class D9e extends rke{constructor(){super(...arguments),this._disposed=new ja(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),ja.clearData(this))}}(function(s){function e(t){let i=new s;for(const n of t)i.add(n);return i}s.from=e})(D9e||(D9e={}));class jh{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:i,distance:n}=this._scrollTarget,r=Eu.SCROLL_EDGE_SIZE-n,o=Math.pow(r/Eu.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(o*Eu.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});Eu.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"){Eu.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}let t=Eu.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=Eu.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,r=Eu.findElementBehindBackdrop(e,this.document);this._currentElement=r,r!==n&&r!==i&&Eu.dispatchDragExit(this,i,r,e),r!==n&&r!==i&&(i=Eu.dispatchDragEnter(this,r,i,e)),i!==t&&(this._currentTarget=i,Eu.dispatchDragLeave(this,t,i,e));let o=Eu.dispatchDragOver(this,i,e);this._setDropAction(o)}_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=Eu.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=jh.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=jh.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=jh.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=jh.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,r){super(r.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:r.related,screenX:n.screenX,screenY:n.screenY,shiftKey:n.shiftKey,view:window});const{drag:o}=r;this.dropAction="none",this.mimeData=o.mimeData,this.proposedAction=o.proposedAction,this.supportedActions=o.supportedActions,this.source=o.source}}s.Event=e;function t(i,n=document){return Eu.overrideCursor(i,n)}s.overrideCursor=t})(jh||(jh={}));var Eu;(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 r(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,Be=j-A,Ct=ne-L,Ne=Math.min(ge,De,Be,Ct);if(Ne>s.SCROLL_EDGE_SIZE)continue;let dt;switch(Ne){case Ct:dt="bottom";break;case De:dt="top";break;case Be:dt="right";break;case ge:dt="left";break;default:throw"unreachable"}let Dt=k.scrollWidth-k.clientWidth,Xi=k.scrollHeight-k.clientHeight,Ti;switch(dt){case"top":Ti=Xi>0&&k.scrollTop>0;break;case"left":Ti=Dt>0&&k.scrollLeft>0;break;case"right":Ti=Dt>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()})(Eu||(Eu={}));function Xie(){return oke.keyboardLayout}class XH{constructor(e,t,i=[]){this.name=e,this._codes=t,this._keys=XH.extractKeys(t),this._modifierKeys=XH.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 r in i)n[i[r]]=!0;return n}s.extractKeys=e;function t(i){let n=Object(null);for(let r=0,o=i.length;r{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=Zc.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=Zc.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=Zc.emptyObject){let i=this._commands.get(e);return i?i.mnemonic.call(void 0,t):-1}icon(e,t=Zc.emptyObject){var i;return(i=this._commands.get(e))===null||i===void 0?void 0:i.icon.call(void 0,t)}iconClass(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.iconClass.call(void 0,t):""}iconLabel(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.iconLabel.call(void 0,t):""}caption(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.caption.call(void 0,t):""}usage(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.usage.call(void 0,t):""}className(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.className.call(void 0,t):""}dataset(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.dataset.call(void 0,t):{}}isEnabled(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.isEnabled.call(void 0,t):!1}isToggled(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.isToggled.call(void 0,t):!1}isToggleable(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.isToggleable:!1}isVisible(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.isVisible.call(void 0,t):!1}execute(e,t=Zc.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(o){n=Promise.reject(o)}let r=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:t,result:r}),r}addKeyBinding(e){let t=Uv.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new ske(()=>{Pt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})})}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;const t=gC.keystrokeForKeydownEvent(e);if(!t){this._replayKeydownEvents(),this._clearPendingState();return}if(gC.isModifierKeyPressed(e)){let{exact:o}=Uv.matchKeyBinding(this._keyBindings,[t],e);o?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(o)):this._clearModifierTimer();return}this._keystrokes.push(t);const{exact:i,partial:n}=Uv.matchKeyBinding(this._keyBindings,this._keystrokes,e),r=n.length!==0;if(!i&&!r){this._replayKeydownEvents(),this._clearPendingState();return}if((i?.preventDefault||n.some(o=>o.preventDefault))&&(e.preventDefault(),e.stopPropagation()),this._keydownEvents.push(e),i&&!r){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)},Uv.modifierkeyTimeOut)}_clearModifierTimer(){this._timerModifierID!==0&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},Uv.CHORD_TIMEOUT)}_clearTimer(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(Uv.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(e){if(this._holdKeyBindingPromises.size!==0){const r=[...this._keydownEvents],o=(await Promise.race([Promise.all(r.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]),Uv.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!o)return}let{command:t,args:i}=e,n={_luminoEvent:{type:"keybinding",keys:e.keys},...i};if(!this.hasCommand(t)||!this.isEnabled(t,n)){let r=this.hasCommand(t)?"enabled":"registered",a=`Cannot execute key binding '${e.keys.join(", ")}':`,c=`command '${t}' is not ${r}.`;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"?Hu.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&&Hu.IS_MAC&&(c+="Cmd "),l.key?c+l.key:c.trim()}s.normalizeKeystroke=t;function i(a){let c;return Hu.IS_WIN?c=a.winKeys||a.keys:Hu.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=Hu.IS_MAC?" ":"+",u=e(l);return u.ctrl&&d.push("Ctrl"),u.alt&&d.push("Alt"),u.shift&&d.push("Shift"),Hu.IS_MAC&&u.cmd&&d.push("Cmd"),d.push(u.key),d.map(Uv.formatKey).join(h)}}s.formatKeystroke=n;function r(a){let c=Xie(),l=c.keyForKeydownEvent(a);return c.isModifierKey(l)}s.isModifierKeyPressed=r;function o(a){let c=Xie(),l=c.keyForKeydownEvent(a),d=[];return a.ctrlKey&&d.push("Ctrl"),a.altKey&&d.push("Alt"),a.shiftKey&&d.push("Shift"),a.metaKey&&Hu.IS_MAC&&d.push("Cmd"),c.isModifierKey(l)||d.push(l),d.join(" ")}s.keystrokeForKeydownEvent=o})(gC||(gC={}));var Uv;(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:gC.normalizeKeys(y),selector:m(y),command:y.command,args:y.args||Zc.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=OS.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 r(y){return Hu.IS_MAC?o.hasOwnProperty(y)?o[y]:y:a.hasOwnProperty(y)?a[y]:y}s.formatKey=r;const o={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(!OS.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(OS.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}})(Uv||(Uv={}));class ZK{constructor(e){this.type="text",this.content=e}}class oge{constructor(e,t,i,n){this.type="element",this.tag=e,this.attrs=t,this.children=i,this.renderer=n}}function va(s){let e={},t,i=[];for(let r=1,o=arguments.length;r=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"){Pt.insert(b,C,L),t(L,f,w);continue}if(!A.renderer!=!L.renderer){Pt.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&&(Pt.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){Pt.insert(b,C,L),t(L,f,w);continue}if(A.tag!==L.tag){Pt.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 r={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function o(f,p){for(let m in p)m in r||(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 r||v in m||(v.substr(0,2)==="on"?f[v]=null:f.removeAttribute(v));for(v in m)v in r||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}})(u1||(u1={}));class TD{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}var im;(function(s){function e(r,o){let a=r.length;if(a===0)return o;let c=0,l=0,d=0,h=0,u=0;for(let m=0;m0&&(h+=v.stretch,u++)}if(o===d)return 0;if(o<=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(r,o,a){r.length===0||a===0||(a>0?i(r,o,a):n(r,o,-a))}s.adjust=t;function i(r,o,a){let c=0;for(let u=0;u<=o;++u){let f=r[u];c+=f.maxSize-f.size}let l=0;for(let u=o+1,f=r.length;u=0&&d>0;--u){let f=r[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=o+1,f=r.length;u0;++u){let p=r[u],m=p.size-p.minSize;m>=h?(p.sizeHint=p.size-h,h=0):(p.sizeHint=p.size-m,h-=m)}}function n(r,o,a){let c=0;for(let u=o+1,f=r.length;u0;++u){let p=r[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=o;u>=0&&h>0;--u){let f=r[u],p=f.size-f.minSize;p>=h?(f.sizeHint=f.size-h,h=0):(f.sizeHint=f.size-p,h-=p)}}})(im||(im={}));class ake{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 ja(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,ja.clearData(this))}}class st{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new ja(this),this._hiddenMode=st.HiddenMode.Display,this.node=Zie.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(st.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&st.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),ja.clearData(this),$t.clearData(this),ov.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(st.Flag.IsDisposed)}get isAttached(){return this.testFlag(st.Flag.IsAttached)}get isHidden(){return this.testFlag(st.Flag.IsHidden)}get isVisible(){return this.testFlag(st.Flag.IsVisible)}get title(){return Zie.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==st.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 st.ChildMessage("child-removed",this);$t.sendMessage(this._parent,t)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let t=new st.ChildMessage("child-added",this);$t.sendMessage(this._parent,t)}this.isDisposed||$t.sendMessage(this,st.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(st.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(){$t.postMessage(this,st.Msg.UpdateRequest)}fit(){$t.postMessage(this,st.Msg.FitRequest)}activate(){$t.postMessage(this,st.Msg.ActivateRequest)}close(){$t.sendMessage(this,st.Msg.CloseRequest)}show(){if(this.testFlag(st.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&$t.sendMessage(this,st.Msg.BeforeShow),this.clearFlag(st.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&$t.sendMessage(this,st.Msg.AfterShow),this.parent)){let e=new st.ChildMessage("child-shown",this);$t.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(st.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&$t.sendMessage(this,st.Msg.BeforeHide),this.setFlag(st.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&$t.sendMessage(this,st.Msg.AfterHide),this.parent)){let e=new st.ChildMessage("child-hidden",this);$t.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(st.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(st.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(st.Flag.IsVisible),this.setFlag(st.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(st.Flag.IsVisible),this.clearFlag(st.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&&st.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 st.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case st.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case st.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case st.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case st.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case st.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}}}(function(s){(function(r){r[r.Display=0]="Display",r[r.Scale=1]="Scale",r[r.ContentVisibility=2]="ContentVisibility"})(s.HiddenMode||(s.HiddenMode={})),function(r){r[r.IsDisposed=1]="IsDisposed",r[r.IsAttached=2]="IsAttached",r[r.IsHidden=4]="IsHidden",r[r.IsVisible=8]="IsVisible",r[r.DisallowLayout=16]="DisallowLayout"}(s.Flag||(s.Flag={})),function(r){r.BeforeShow=new zm("before-show"),r.AfterShow=new zm("after-show"),r.BeforeHide=new zm("before-hide"),r.AfterHide=new zm("after-hide"),r.BeforeAttach=new zm("before-attach"),r.AfterAttach=new zm("after-attach"),r.BeforeDetach=new zm("before-detach"),r.AfterDetach=new zm("after-detach"),r.ParentChanged=new zm("parent-changed"),r.UpdateRequest=new $V("update-request"),r.FitRequest=new $V("fit-request"),r.ActivateRequest=new $V("activate-request"),r.CloseRequest=new $V("close-request")}(s.Msg||(s.Msg={}));class e extends zm{constructor(o,a){super(o),this.child=a}}s.ChildMessage=e;class t extends zm{constructor(o,a){super("resize"),this.width=o,this.height=a}}s.ResizeMessage=t,function(r){r.UnknownSize=new r(-1,-1)}(t=s.ResizeMessage||(s.ResizeMessage={}));function i(r,o,a=null){if(r.parent)throw new Error("Cannot attach a child widget.");if(r.isAttached||r.node.isConnected)throw new Error("Widget is already attached.");if(!o.isConnected)throw new Error("Host is not attached.");$t.sendMessage(r,s.Msg.BeforeAttach),o.insertBefore(r.node,a),$t.sendMessage(r,s.Msg.AfterAttach)}s.attach=i;function n(r){if(r.parent)throw new Error("Cannot detach a child widget.");if(!r.isAttached||!r.node.isConnected)throw new Error("Widget is not attached.");$t.sendMessage(r,s.Msg.BeforeDetach),r.node.parentNode.removeChild(r.node),$t.sendMessage(r,s.Msg.AfterDetach)}s.detach=n})(st||(st={}));var Zie;(function(s){s.titleProperty=new ov({name:"title",create:t=>new ake({owner:t})});function e(t){return t.node||document.createElement(t.tag||"div")}s.createNode=e})(Zie||(Zie={}));class CN{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,ja.clearData(this),ov.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)$t.sendMessage(t,st.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const t of this)$t.sendMessage(t,st.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)$t.sendMessage(t,e)}onAfterAttach(e){for(const t of this)$t.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)$t.sendMessage(t,e)}onAfterDetach(e){for(const t of this)$t.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||$t.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||$t.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||$t.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||$t.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}(function(s){function e(r){return UF.horizontalAlignmentProperty.get(r)}s.getHorizontalAlignment=e;function t(r,o){UF.horizontalAlignmentProperty.set(r,o)}s.setHorizontalAlignment=t;function i(r){return UF.verticalAlignmentProperty.get(r)}s.getVerticalAlignment=i;function n(r,o){UF.verticalAlignmentProperty.set(r,o)}s.setVerticalAlignment=n})(CN||(CN={}));class EG{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=Oa.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 r=Math.max(this._minWidth,Math.min(i,this._maxWidth)),o=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(r"center",changed:e}),s.verticalAlignmentProperty=new ov({name:"verticalAlignment",create:()=>"top",changed:e});function e(t){t.parent&&t.parent.layout&&t.parent.update()}})(UF||(UF={}));class wle extends CN{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){Pt.insert(this._widgets,n,t),this.parent&&this.attachWidget(n,t);return}n===this._widgets.length&&n--,i!==n&&(Pt.move(this._widgets,i,n),this.parent&&this.moveWidget(i,n,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=Pt.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&&$t.sendMessage(t,st.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,i),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterAttach)}moveWidget(e,t,i){this.parent.isAttached&&$t.sendMessage(i,st.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&$t.sendMessage(i,st.Msg.AfterDetach);let n=this.parent.node.children[t];this.parent.isAttached&&$t.sendMessage(i,st.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&$t.sendMessage(i,st.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterDetach)}}var t7;(function(s){function e(t){return Math.max(0,Math.floor(t))}s.clampDimension=e})(t7||(t7={}));var i7=t7;class YA extends wle{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=t7.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=t7.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 CS.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e,t=!0){let i=this._sizers.length,n=e.slice(0,i);for(;n.length0&&(r.sizeHint=r.size);im.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 EG(t),n=CS.createHandle(this.renderer),r=CS.averageSize(this._sizers),o=CS.createSizer(r);Pt.insert(this._items,e,i),Pt.insert(this._sizers,e,o),Pt.insert(this._handles,e,n),this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(n),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Pt.move(this._items,e,t),Pt.move(this._sizers,e,t),Pt.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let i=Pt.removeAt(this._items,e),n=Pt.removeAt(this._handles,e);Pt.removeAt(this._sizers,e),this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(n),this.parent.isAttached&&$t.sendMessage(t,st.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,r,o,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,r),i+=a,l.top=`${n}px`,l.left=`${i}px`,l.width=`${this._spacing}px`,l.height=`${r}px`):(n+=this.widgetOffset,c.update(i,n,o,a),n+=a,l.top=`${n}px`,l.left=`${i}px`,l.width=`${o}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=YA.getStretch(d.widget),i?(h.minSize=d.minWidth,h.maxSize=d.maxWidth,n+=d.minWidth,r=Math.max(r,d.minHeight)):(h.minSize=d.minHeight,h.maxSize=d.maxHeight,r+=d.minHeight,n=Math.max(n,d.minWidth))}let o=this._box=Oa.boxSizing(this.parent.node);n+=o.horizontalSum,r+=o.verticalSum;let a=this.parent.node.style;a.minWidth=`${n}px`,a.minHeight=`${r}px`,this._dirty=!0,this.parent.parent&&$t.sendMessage(this.parent.parent,st.Msg.FitRequest),this._dirty&&$t.sendMessage(this.parent,st.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,o-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=im.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:(o,a)=>Math.max(0,Math.floor(a)),changed:r});function e(o){let a=new TD;return a.sizeHint=Math.floor(o),a}s.createSizer=e;function t(o){let a=o.createHandle();return a.style.position="absolute",a.style.contain="style",a}s.createHandle=t;function i(o){return o.reduce((a,c)=>a+c.size,0)/o.length||0}s.averageSize=i;function n(o){let a=o.length;if(a===0)return[];let c=o.reduce((l,d)=>l+Math.abs(d),0);return c===0?o.map(l=>1/a):o.map(l=>l/c)}s.normalize=n;function r(o){o.parent&&o.parent.layout instanceof YA&&o.parent.fit()}})(CS||(CS={}));class lei extends YA{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=i7.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"),r=ene.createTitle(this.renderer,t.title,n);this._titles[e]=r,this.parent.node.replaceChild(r,i)}insertWidget(e,t){t.id||(t.id=`id-${ike.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const i=ene.createTitle(this.renderer,t.title);Pt.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){Pt.move(this._titles,e,t),super.moveWidget(e,t,i)}detachWidget(e,t){const i=Pt.removeAt(this._titles,e);this.parent.node.removeChild(i),super.detachWidget(e,t)}updateItemPosition(e,t,i,n,r,o,a){const c=this._titles[e].style;c.top=`${n}px`,c.left=`${i}px`,c.height=`${this.widgetOffset}px`,t?c.width=`${r}px`:c.width=`${o}px`,super.updateItemPosition(e,t,i,n,r,o,a)}}var ene;(function(s){function e(t,i,n=!0){const r=t.createSectionTitle(i);return r.style.position="absolute",r.style.contain="strict",r.setAttribute("aria-label",`${i.label} Section`),r.setAttribute("aria-expanded",n?"true":"false"),r.setAttribute("aria-controls",i.owner.id),n&&r.classList.add("lm-mod-expanded"),r}s.createTitle=e})(ene||(ene={}));class JPe extends st{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=cke.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}var cke;(function(s){function e(t){return t.layout||new wle}s.createLayout=e})(cke||(cke={}));class ZH extends JPe{constructor(e={}){super({layout:lke.createLayout(e)}),this._handleMoved=new ja(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=Pt.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,r=t.handles[i],o=r.getBoundingClientRect();t.orientation==="horizontal"?n=e.clientX-o.left:n=e.clientY-o.top;let a=window.getComputedStyle(r),c=jh.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 r=document.createElement("div");return r.className="lm-SplitPanel-handle",r}}s.Renderer=e,s.defaultRenderer=new e;function t(n){return YA.getStretch(n)}s.getStretch=t;function i(n,r){YA.setStretch(n,r)}s.setStretch=i})(ZH||(ZH={}));var lke;(function(s){function e(t){return t.layout||new YA({renderer:t.renderer||ZH.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}s.createLayout=e})(lke||(lke={}));class dke extends ZH{constructor(e={}){super({...e,layout:hke.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=Pt.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,r=t.absoluteSizes(),o=(n?-1:1)*this.spacing,a=r.reduce((l,d)=>l+d);let c=[...r];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]-=r[u]/a*(l-o))}):c[d]-=l-o}else{const l=r[e];this._widgetSizesCache.set(i,l),c[e]=0;const d=c.map(h=>h>0).lastIndexOf(!0);if(d===-1)return;c[d]=r[d]+l+o}return c.map(l=>l/(a+o))}_evtClick(e){const t=e.target;if(t){const i=Pt.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=Pt.findFirstIndex(this.titles,r=>r.contains(t));if(n>=0){const r=e.keyCode.toString();if(e.key.match(/Space|Enter/)||r.match(/13|32/))t.click(),i=!0;else if(this.orientation==="horizontal"?e.key.match(/ArrowLeft|ArrowRight/)||r.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||r.match(/38|40/)){const o=e.key.match(/ArrowLeft|ArrowUp/)||r.match(/37|38/)?-1:1,a=this.titles.length,c=(n+a+o)%a;this.titles[c].focus(),i=!0}else e.key==="End"||r==="35"?(this.titles[this.titles.length-1].focus(),i=!0):(e.key==="Home"||r==="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 ZH.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 r=n.appendChild(this.createCollapseIcon(i));r.className="lm-AccordionPanel-titleCollapser";const o=n.appendChild(document.createElement("span"));return o.className="lm-AccordionPanel-titleLabel",o.textContent=i.label,o.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})(dke||(dke={}));var hke;(function(s){function e(t){return t.layout||new lei({renderer:t.renderer||dke.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}s.createLayout=e})(hke||(hke={}));class nf extends wle{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=i7.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=i7.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){Pt.insert(this._items,e,new EG(t)),Pt.insert(this._sizers,e,new TD),this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Pt.move(this._items,e,t),Pt.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let i=Pt.removeAt(this._items,e);Pt.removeAt(this._sizers,e),this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&$t.sendMessage(t,st.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,r)=>Math.max(0,Math.floor(r)),changed:i}),s.sizeBasisProperty=new ov({name:"sizeBasis",create:()=>0,coerce:(n,r)=>Math.max(0,Math.floor(r)),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 nf&&n.parent.fit()}})(j1||(j1={}));class k9e extends JPe{constructor(e={}){super({layout:uke.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(r){return nf.getStretch(r)}s.getStretch=e;function t(r,o){nf.setStretch(r,o)}s.setStretch=t;function i(r){return nf.getSizeBasis(r)}s.getSizeBasis=i;function n(r,o){nf.setSizeBasis(r,o)}s.setSizeBasis=n})(k9e||(k9e={}));var uke;(function(s){function e(t){return t.layout||new nf(t)}s.createLayout=e})(uke||(uke={}));class tne extends st{constructor(e){super({node:HC.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(st.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||tne.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=HC.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map(i=>HC.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){Pt.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=HC.search(this._items,t),this._activeIndex=t?Pt.findFirstIndex(n,HC.canActivate):-1),!t&&n.length===0){ID.render(null,i);return}if(t&&n.length===0){let c=this.renderer.renderEmptyMessage({query:t});ID.render(c,i);return}let r=this.renderer,o=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[o];Oa.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=Pt.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&&Zc.deepEqual(m.args,p))||null}}})(HC||(HC={}));class V_ extends st{constructor(e){super({node:xg.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new ja(this),this._menuRequested=new ja(this),this.addClass("lm-Menu"),this.setFlag(st.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||V_.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&&!xg.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}})}ID.render(o,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 o=this.activeItem;o&&o.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(t===40){this.activateNextItem();return}let i=Xie().keyForKeydownEvent(e);if(!i)return;let n=this._activeIndex+1,r=xg.findMnemonic(this._items,i,n);r.index!==-1&&!r.multiple?(this.activeIndex=r.index,this.triggerActiveItem()):r.index!==-1?this.activeIndex=r.index:r.auto!==-1&&(this.activeIndex=r.auto)}_evtMouseUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=Pt.findFirstIndex(this.contentNode.children,n=>Oa.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(Oa.hitTest(this._childMenu.node,t,i)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(e){this._parentMenu||(xg.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;V_.saveWindowData(),this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,$t.sendMessage(this,st.Msg.UpdateRequest);let n=this.contentNode.children[this._activeIndex];xg.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()},xg.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},xg.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){xg.saveWindowData()}}(function(s){class e{renderItem(i){let n=this.createItemClass(i),r=this.createItemDataset(i),o=this.createItemARIA(i);return va.li({className:n,dataset:r,tabindex:"0",onfocus:i.onfocus,...o},this.renderIcon(i),this.renderLabel(i),this.renderShortcut(i),this.renderSubmenu(i))}renderIcon(i){let n=this.createIconClass(i);return va.div({className:n},i.item.icon,i.item.iconLabel)}renderLabel(i){let n=this.formatLabel(i);return va.div({className:"lm-Menu-itemLabel"},n)}renderShortcut(i){let n=this.formatShortcut(i);return va.div({className:"lm-Menu-itemShortcut"},n)}renderSubmenu(i){return va.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 r=i.item.className;return r&&(n+=` ${r}`),n}createItemDataset(i){let n,{type:r,command:o,dataset:a}=i.item;return r==="command"?n={...a,type:r,command:o}:n={...a,type:r},n}createIconClass(i){let n="lm-Menu-itemIcon",r=i.item.iconClass;return r?`${n} ${r}`: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:r}=i.item;if(r<0||r>=n.length)return n;let o=n.slice(0,r),a=n.slice(r+1),c=n[r],l=va.span({className:"lm-Menu-itemMnemonic"},c);return[o,l,a]}formatShortcut(i){let n=i.item.keyBinding;return n?gC.formatKeystroke(n.keys):null}}s.Renderer=e,s.defaultRenderer=new e})(V_||(V_={}));var xg;(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 r(){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=r;function o(m){return m.type!=="separator"&&m.isEnabled&&m.isVisible}s.canActivate=o;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(Oa.hitTest(w.node,v,b))return!0;return!1}s.hitTestMenus=c;function l(m){let v=new Array(m.length);Pt.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;$t.sendMessage(m,st.Msg.UpdateRequest);let L=A,k=m.node,P=k.style;P.opacity="0",P.maxHeight=`${L}px`,st.attach(m,document.body);let{width:R,height:z}=k.getBoundingClientRect(),G=Oa.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&&Zc.deepEqual(w.args,b))||null}return null}}})(xg||(xg={}));var I9e;(function(s){function e(o,a){let c=i(o.selector),l=o.rank!==void 0?o.rank:1/0;return{...o,selector:c,rank:l,id:a}}s.createItem=e;function t(o,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=o.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,r=this._titles[n]||null;this._currentIndex=n,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:i,currentIndex:n,currentTitle:r})}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=Ym.asTitle(t),n=this._titles.indexOf(i),r=Math.max(0,Math.min(e,this._titles.length));return n===-1?(Pt.insert(this._titles,r,i),i.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(r,i),i):(r===this._titles.length&&r--,n===r||(Pt.move(this._titles,n,r),this.update(),this._adjustCurrentForMove(n,r)),i)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=Pt.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,r=new Array(t.length);for(let o=0,a=t.length;oOa.hitTest(o,e.clientX,e.clientY));if(i===-1)return;let n=this.titles[i],r=t[i].querySelector(".lm-TabBar-tabLabel");if(r&&r.contains(e.target)){let o=n.label||"",a=r.innerHTML;r.innerHTML="";let c=document.createElement("input");c.classList.add("lm-TabBar-tabInput"),c.value=o,r.appendChild(c);let l=()=>{c.removeEventListener("blur",l),r.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(),r.children.length>0&&r.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=Pt.findFirstIndex(i,o=>Oa.hitTest(o,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 r=i[n].querySelector(this.renderer.closeIconSelector);r&&r.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&&!Ym.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=Ym.snapTabLayout(i,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=jh.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&Ym.detachExceeded(t,e)){t.detachRequested=!0;let n=t.index,r=e.clientX,o=e.clientY,a=i[n],c=this._titles[n];if(this._tabDetachRequested.emit({index:n,title:c,tab:a,clientX:r,clientY:o}),t.dragAborted)return}Ym.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 r=this.contentNode.children,o=Pt.findFirstIndex(r,l=>Oa.hitTest(l,e.clientX,e.clientY));if(o!==t.index)return;let a=this._titles[o];if(!a.closable)return;if(e.button===1){this._tabCloseRequested.emit({index:o,title:a});return}let c=r[o].querySelector(this.renderer.closeIconSelector);if(c&&c.contains(e.target)){this._tabCloseRequested.emit({index:o,title:a});return}return}if(e.button!==0)return;Ym.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let i=Ym.parseTransitionDuration(t.tab);setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,Ym.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let n=t.index,r=t.targetIndex;r===-1||n===r||(Pt.move(this._titles,n,r),this._adjustCurrentForMove(n,r),this._tabMoved.emit({fromIndex:n,toIndex:r,title:this._titles[r]}),$t.sendMessage(this,st.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&&(Ym.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,r=this.insertBehavior;if(r==="select-tab"||r==="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,r=this.createTabKey(i),o=r,a=this.createTabStyle(i),c=this.createTabClass(i),l=this.createTabDataset(i),d=this.createTabARIA(i);return i.title.closable?va.li({id:o,key:r,className:c,title:n,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i),this.renderCloseIcon(i)):va.li({id:o,key:r,className:c,title:n,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){const{title:n}=i;let r=this.createIconClass(i);return va.div({className:r},n.icon,n.iconLabel)}renderLabel(i){return va.div({className:"lm-TabBar-tabLabel"},i.title.label)}renderCloseIcon(i){return va.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",r=i.title.iconClass;return r?`${n} ${r}`:n}}e._nInstance=0,s.Renderer=e,s.defaultRenderer=new e,s.addButtonSelector=".lm-TabBar-addButton"})(SI||(SI={}));var Ym;(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 ake?d:new ake(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=r;function o(d,h){let u=d.contentRect;return h.clientX=u.right+s.DETACH_THRESHOLD||h.clientY=u.bottom+s.DETACH_THRESHOLD}s.detachExceeded=o;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})(Ym||(Ym={}));class dei extends CN{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=i7.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=e.hiddenMode!==void 0?e.hiddenMode:st.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=i7.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():B4()}widgets(){return this._root?this._root.iterUserWidgets():B4()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():B4()}tabBars(){return this._root?this._root.iterTabBars():B4()}handles(){return this._root?this._root.iterHandles():B4()}moveHandle(e,t,i){let n=e.classList.contains("lm-mod-hidden");if(!this._root||n)return;let r=this._root.findSplitNode(e);if(!r)return;let o;r.node.orientation==="horizontal"?o=t-e.offsetLeft:o=i-e.offsetTop,o!==0&&(r.node.holdSizes(),im.adjust(r.node.sizers,r.index,o),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=$l.normalizeAreaConfig(e.main,t):i=null;let n=this.widgets(),r=this.tabBars(),o=this.handles();this._root=null;for(const a of n)t.has(a)||(a.parent=null);for(const a of r)a.dispose();for(const a of o)a.parentNode&&a.parentNode.removeChild(a);for(const a of t)a.parent=this.parent;i?this._root=$l.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",r=null;if(this._root&&i&&(r=this._root.findTabNode(i)),i&&!r)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,n){case"tab-after":this._insertTab(e,i,r,!0);break;case"tab-before":this._insertTab(e,i,r,!1);break;case"split-top":this._insertSplit(e,i,r,"vertical",!1);break;case"split-left":this._insertSplit(e,i,r,"horizontal",!1);break;case"split-right":this._insertSplit(e,i,r,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,i,r,"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=Oa.boxSizing(this.parent.node));let i=this.parent.node.getBoundingClientRect(),n=e-i.left-this._box.borderLeft,r=t-i.top-this._box.borderTop,o=this._root.hitTestTabNodes(n,r);if(!o)return null;let{tabBar:a,top:c,left:l,width:d,height:h}=o,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:r,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 EG(e)),this.parent.isAttached&&$t.sendMessage(e,st.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&$t.sendMessage(e,st.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&$t.sendMessage(e,st.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&$t.sendMessage(e,st.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($l.removeAria(e),t.tabBar.titles.length>1){if(t.tabBar.removeTab(e.title),this._hiddenMode===st.HiddenMode.Scale&&t.tabBar.titles.length==1){const u=t.tabBar.titles[0].owner;u.hiddenMode=st.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=Pt.removeFirstOf(i.children,t),r=Pt.removeAt(i.handles,n);if(Pt.removeAt(i.sizers,n),r.parentNode&&r.parentNode.removeChild(r),i.children.length>1){i.syncHandles();return}let o=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=o,d=l.children.indexOf(i);if(a instanceof $l.TabLayoutNode){a.parent=l,l.children[d]=a;return}let h=Pt.removeAt(l.handles,d);Pt.removeAt(l.children,d),Pt.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(im.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 r{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}})($l||($l={}));class n7 extends st{constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new ja(this),this._addRequested=new ja(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||n7.defaultRenderer,this._edges=e.edges||jc.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 dei({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new n7.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(jc.createSingleDocumentConfig(this));break;default:throw"unreachable"}$t.postMessage(this,jc.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=eke(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),(Hu.IS_EDGE||Hu.IS_IE)&&$t.flush(),$t.postMessage(this,jc.LayoutModified)}addWidget(e,t={}){this._mode==="single-document"?this.layout.addWidget(e):this.layout.addWidget(e,t),$t.postMessage(this,jc.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){jc.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){jc.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),$t.postMessage(this,jc.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:r}=jc.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 st)){e.dropAction="none";return}if(c.contains(this)){e.dropAction="none";return}let l=r?jc.getDropRef(r.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(),$t.postMessage(this,jc.LayoutModified))}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=e.target,n=eke(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 r=n.getBoundingClientRect(),o=e.clientX-r.left,a=e.clientY-r.top,c=window.getComputedStyle(n),l=jh.overrideCursor(c.cursor,this._document);this._pressData={handle:n,deltaX:o,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(),$t.postMessage(this,jc.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}=jc.findDropTarget(this,e,t,this._edges);if(i==="invalid")return this.overlay.hide(100),i;let r,o,a,c,l=Oa.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(i){case"root-all":r=l.paddingTop,o=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"root-top":r=l.paddingTop,o=l.paddingLeft,a=l.paddingRight,c=d.height*jc.GOLDEN_RATIO;break;case"root-left":r=l.paddingTop,o=l.paddingLeft,a=d.width*jc.GOLDEN_RATIO,c=l.paddingBottom;break;case"root-right":r=l.paddingTop,o=d.width*jc.GOLDEN_RATIO,a=l.paddingRight,c=l.paddingBottom;break;case"root-bottom":r=d.height*jc.GOLDEN_RATIO,o=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"widget-all":r=n.top,o=n.left,a=n.right,c=n.bottom;break;case"widget-top":r=n.top,o=n.left,a=n.right,c=n.bottom+n.height/2;break;case"widget-left":r=n.top,o=n.left,a=n.right+n.width/2,c=n.bottom;break;case"widget-right":r=n.top,o=n.left+n.width/2,a=n.right,c=n.bottom;break;case"widget-bottom":r=n.top+n.height/2,o=n.left,a=n.right,c=n.bottom;break;case"widget-tab":{const h=n.tabBar.node.getBoundingClientRect().height;r=n.top,o=n.left,a=n.right,c=n.bottom+n.height-h;break}default:throw"unreachable"}return this.overlay.show({top:r,left:o,right:a,bottom:c}),i}_createTabBar(){let e=this._renderer.createTabBar(this._document);return jc.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(){$t.postMessage(this,jc.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:i,currentTitle:n}=t;i&&i.owner.hide(),n&&n.owner.show(),(Hu.IS_EDGE||Hu.IS_IE)&&$t.flush(),$t.postMessage(this,jc.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:r,clientY:o}=t,a=new rei,c=()=>i.owner;a.setData("application/vnd.lumino.widget-factory",c);let l=n.cloneNode(!0);this._drag=new jh({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(r,o).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 r=this.node.style;r.top=`${n.top}px`,r.left=`${n.left}px`,r.right=`${n.right}px`,r.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 r=new SI({document:n});return r.addClass("lm-DockPanel-tabBar"),r}createHandle(){let n=document.createElement("div");return n.className="lm-DockPanel-handle",n}}s.Renderer=t,s.defaultRenderer=new t})(n7||(n7={}));var jc;(function(s){s.GOLDEN_RATIO=.618,s.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},s.LayoutModified=new $V("layout-modified"),s.isGeneratedTabBarProperty=new ov({name:"isGeneratedTabBar",create:()=>!1});function e(n){if(n.isEmpty)return{main:null};let r=Array.from(n.widgets()),o=n.selectedWidgets().next().value,a=o?r.indexOf(o):-1;return{main:{type:"tab-area",widgets:r,currentIndex:a}}}s.createSingleDocumentConfig=e;function t(n,r,o,a){if(!Oa.hitTest(n.node,r,o))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=r-y.left+1,A=o-y.top+1,L=y.right-r,k=y.bottom-o;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})(jc||(jc={}));class cL extends CN{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new TD],this._columnSizers=[new TD],this._box=null,e.rowCount!==void 0&&Td.reallocSizers(this._rowSizers,e.rowCount),e.columnCount!==void 0&&Td.reallocSizers(this._columnSizers,e.columnCount),e.rowSpacing!==void 0&&(this._rowSpacing=Td.clampValue(e.rowSpacing)),e.columnSpacing!==void 0&&(this._columnSpacing=Td.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&&(Td.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(Td.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=Td.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=Td.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=Td.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=Td.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){Pt.findFirstIndex(this._items,i=>i.widget===e)===-1&&(this._items.push(new EG(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=Pt.findFirstIndex(this._items,n=>n.widget===e);if(t===-1)return;let i=Pt.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&&$t.sendMessage(e,st.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&$t.sendMessage(e,st.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&$t.sendMessage(e,st.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&$t.sendMessage(e,st.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 r(c,l){for(l=Math.max(1,Math.floor(l));c.lengthl&&(c.length=l)}s.reallocSizers=r;function o(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=o;function a(c){c.parent&&c.parent.layout instanceof cL&&c.parent.fit()}})(Td||(Td={}));class s7 extends st{constructor(e={}){super({node:ine.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(st.Flag.DisallowLayout),this.renderer=e.renderer||s7.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),r=Math.max(0,Math.min(e,this._menus.length));if(n===-1){Pt.insert(this._menus,r,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}r===this._menus.length&&r--,n!==r&&(Pt.move(this._menus,n,r),i&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let i=Pt.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,r=this._activeIndex,o=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 V_({commands:new gC}),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===r&&i[a].items.length!==0,tabbable:a===o,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===o,onfocus:()=>{this.activeIndex=a}}),a++}}this._overflowMenu.items.length===0&&(this.removeMenu(this._overflowMenu,!1),d.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}ID.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,r=e.length;if(this._menuItemSizes.length==0)for(let o=0;ot&&n===-1&&(n=o)}else for(let o=0;ot){n=o;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 o=this._activeIndex,a=this._menus.length;this.activeIndex=o===0?a-1:o-1;return}if(t===39){let o=this._activeIndex,a=this._menus.length;this.activeIndex=o===a-1?0:o+1;return}let i=Xie().keyForKeydownEvent(e);if(!i)return;let n=this._activeIndex+1,r=ine.findMnemonic(this._menus,i,n);r.index!==-1&&!r.multiple?(this.activeIndex=r.index,this.openActiveMenu()):r.index!==-1?this.activeIndex=r.index:r.auto!==-1&&(this.activeIndex=r.auto)}_evtMouseDown(e){if(!Oa.hitTest(this.node,e.clientX,e.clientY))return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();let t=Pt.findFirstIndex(this.contentNode.children,i=>Oa.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);V_.saveWindowData(),this.activeIndex=t,this._openChildMenu(i)}}_evtMouseMove(e){let t=Pt.findFirstIndex(this.contentNode.children,n=>Oa.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;V_.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),$t.sendMessage(this,st.Msg.UpdateRequest);let{left:n,top:r}=e;(typeof n>"u"||typeof r>"u")&&({left:n,top:r}=this._positionForMenu(this._activeIndex)),i||this.addClass("lm-mod-active"),t.items.length>0&&t.open(n,r,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),r=this.createItemDataset(i),o=this.createItemARIA(i);return va.li({className:n,dataset:r,tabindex:i.tabbable?"0":"-1",onfocus:i.onfocus,...o},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){let n=this.createIconClass(i);return va.div({className:n},i.title.icon,i.title.iconLabel)}renderLabel(i){let n=this.formatLabel(i);return va.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",r=i.title.iconClass;return r?`${n} ${r}`:n}formatLabel(i){let{label:n,mnemonic:r}=i.title;if(r<0||r>=n.length)return n;let o=n.slice(0,r),a=n.slice(r+1),c=n[r],l=va.span({className:"lm-MenuBar-itemMnemonic"},c);return[o,l,a]}}s.Renderer=e,s.defaultRenderer=new e})(s7||(s7={}));var ine;(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,r){let o=-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===st.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=st.HiddenMode.Scale),t.hiddenMode=st.HiddenMode.Scale):t.hiddenMode=st.HiddenMode.Display,Pt.insert(this._items,e,new EG(t)),this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Pt.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let i=Pt.removeAt(this._items,e);this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterDetach),i.widget.node.style.zIndex="",this._hiddenMode===st.HiddenMode.Scale&&(t.hiddenMode=st.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=st.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 r=0,o=this._items.length;rthis._onDidChangeConfiguration.fire(this.toResourceConfigurationChangeEvent(n))))}getValue(e,t,i){return typeof i=="string"?this._getValue(e,re.isIPosition(t)?t:null,i):this._getValue(e,null,typeof t=="string"?t:void 0)}updateValue(e,t,i,n){const r=this.getLanguage(e,null),o=this.configurationService.inspect(t,{resource:e,overrideIdentifier:r});n===void 0&&(n=this.deriveConfigurationTarget(o,r));const a=r&&o.overrideIdentifiers?.includes(r)?r: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 At.MEMORY;if(e.workspaceFolder?.override!==void 0)return At.WORKSPACE_FOLDER;if(e.workspace?.override!==void 0)return At.WORKSPACE;if(e.userRemote?.override!==void 0)return At.USER_REMOTE;if(e.userLocal?.override!==void 0)return At.USER_LOCAL}return e.memory?.value!==void 0?At.MEMORY:e.workspaceFolder?.value!==void 0?At.WORKSPACE_FOLDER:e.workspace?.value!==void 0?At.WORKSPACE:e.userRemote?.value!==void 0?At.USER_REMOTE:At.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})}}}};fke=D([_(0,Te),_(1,fi),_(2,Di)],fke);const yle=".vscode",nne="settings",fei=`${yle}/${nne}.json`,pei="vscode://schemas/settings/default",mei="vscode://schemas/settings/user",_ei="vscode://schemas/settings/profile",vei="vscode://schemas/settings/machine",Xrt="vscode://schemas/settings/workspace",bei="vscode://schemas/settings/folder",wei="vscode://schemas/launch",yei="vscode://schemas/tasks";ct.APPLICATION;const Cei=[ct.MACHINE,ct.WINDOW,ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE,ct.MACHINE_OVERRIDABLE],Zrt=[ct.WINDOW,ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE],Sei=[ct.APPLICATION,...Zrt],age=[ct.MACHINE,ct.WINDOW,ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE,ct.MACHINE_OVERRIDABLE],Ej=[ct.WINDOW,ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE,ct.MACHINE_OVERRIDABLE],eot=[ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE,ct.MACHINE_OVERRIDABLE],Hf="tasks",fx="launch",XPe=Object.create(null);XPe[Hf]=`${yle}/${Hf}.json`;XPe[fx]=`${yle}/${fx}.json`;const tot=Object.create(null);tot[Hf]=`${Hf}.json`;const Aei=`{ +`+i)}}return Promise.resolve([s.toString(),null,null])}async function ZZt(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 eei(s){try{const e=new URL(s);if(e.hostname==="gist.github.com")return XZt(e);if(e.hostname==="github.com")return ZZt(e)}catch{return Promise.reject("Failed to process URL")}return Promise.resolve([null,null,null])}var Pt;(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})(Pt||(Pt={}));function*B4(){}function eke(s,e){let t=0;for(const i of s)if(e(i,t++))return i}function tei(s,e){let t=0;for(const i of s)if(e(i,t++)===!1)return!1;return!0}function iei(s,e){let t=0;for(const i of s)if(e(i,t++))return!0;return!1}var A9e;(function(s){function e(t,i,n){return n===0?1/0:t>i&&n>0||t-1;e--)yield s[e]}function sei(s){let e=[],t=new Set,i=new Map;for(const o of s)n(o);for(const[o]of i)r(o);return e;function n(o){let[a,c]=o,l=i.get(c);l?l.push(a):i.set(c,[a])}function r(o){if(t.has(o))return;t.add(o);let a=i.get(o);if(a)for(const c of a)r(c);e.push(o)}}var e7;(function(s){function e(o,a,c=0){let l=new Array(a.length);for(let d=0,h=c,u=a.length;da?1:0}s.cmp=r})(e7||(e7={}));var Zc;(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?o(d,h):a(d,h)}s.deepEqual=n;function r(d){return e(d)?d:t(d)?c(d):l(d)}s.deepCopy=r;function o(d,h){if(d===h)return!0;if(d.length!==h.length)return!1;for(let u=0,f=d.length;u{if(u===o.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(!o.provides||l.length===0)return;const h=[o.id];if(l.some(d))throw new ReferenceError(`Cycle detected: ${h.join(" -> ")}.`)}s.ensureNoCycle=i;function n(o,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]===o);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=sei(h),p=f.findIndex(m=>m===o);return p===-1?[o]:f.slice(0,p+1)}s.findDependents=n;function r(o,a){const c=new Set;for(const l of o.keys())o.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=r})(E9e||(E9e={}));function oei(s){let e=0;for(let t=0,i=s.length;t>>0),s[t]=e&255,e>>>=8}var tke;(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)}:oei})()})(tke||(tke={}));function aei(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 ike;(function(s){s.uuid4=aei(tke.getRandomValues)})(ike||(ike={}));var x9e;(function(s){function e(t){const i=document.body,n=r=>{r.preventDefault(),r.stopPropagation(),r.clipboardData.setData("text",t),i.removeEventListener("copy",n,!0)};i.addEventListener("copy",n,!0),document.execCommand("copy")}s.copyText=e})(x9e||(x9e={}));var Ba;(function(s){function e(r){let o=window.getComputedStyle(r),a=parseFloat(o.borderTopWidth)||0,c=parseFloat(o.borderLeftWidth)||0,l=parseFloat(o.borderRightWidth)||0,d=parseFloat(o.borderBottomWidth)||0,h=parseFloat(o.paddingTop)||0,u=parseFloat(o.paddingLeft)||0,f=parseFloat(o.paddingRight)||0,p=parseFloat(o.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(r){let o=window.getComputedStyle(r),a=parseFloat(o.minWidth)||0,c=parseFloat(o.minHeight)||0,l=parseFloat(o.maxWidth)||1/0,d=parseFloat(o.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(r,o,a){let c=r.getBoundingClientRect();return o>=c.left&&o=c.top&&a=a.bottom)){if(c.topa.bottom&&c.height>=a.height){r.scrollTop-=a.top-c.top;return}if(c.topa.height){r.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(o)){f++;continue}if(p(a)){u++;continue}if(p(r)){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=/^\[[^\]]+\]/,r=/^[^\s\+>~#\.\[:]+/,o=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,a=/^:[^\s\+>~#\.\[:]+/,c=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g})(Fv||(Fv={}));class nke{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 WC.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 WC.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 WC.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new WC.LinkedListNode(this,e),n=t,r=n.prev;return i.next=n,i.prev=r,n.prev=i,r.next=i,this._size++,i}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof WC.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new WC.LinkedListNode(this,e),n=t,r=n.next;return i.next=r,i.prev=n,n.next=i,r.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 WC.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})(nke||(nke={}));var WC;(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})(WC||(WC={}));let zm=class{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}};class $V extends zm{get isConflatable(){return!0}conflate(e){return!0}}var $t;(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}tei(nei(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}iei(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 r(P,R){let z=u.get(P);z&&z.indexOf(R)!==-1||(z?z.push(R):u.set(P,[R]))}s.installMessageHook=r;function o(P,R){let z=u.get(P);if(!z)return;let G=z.indexOf(R);G!==-1&&(z[G]=null,C(z))}s.removeMessageHook=o;function a(P){let R=u.get(P);R&&R.length>0&&(Pt.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 nke,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){Pt.removeAllWhere(P,k)}function k(P){return P===null}})($t||($t={}));class ov{constructor(e){this._pid=Q1.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=Q1.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=Q1.ensureMap(e);this._pid in n?i=n[this._pid]:i=n[this._pid]=this._createValue(e);let r=this._coerceValue(e,t);this._maybeNotify(e,i,n[this._pid]=r)}coerce(e){let t,i=Q1.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){Q1.ownerData.delete(t)}s.clearData=e})(ov||(ov={}));var Q1;(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})(Q1||(Q1={}));class Ra{constructor(e){this.sender=e}connect(e,t){return Vp.connect(this,e,t)}disconnect(e,t){return Vp.disconnect(this,e,t)}emit(e){Vp.emit(this,e)}}(function(s){function e(c,l){Vp.disconnectBetween(c,l)}s.disconnectBetween=e;function t(c){Vp.disconnectSender(c)}s.disconnectSender=t;function i(c){Vp.disconnectReceiver(c)}s.disconnectReceiver=i;function n(c){Vp.disconnectAll(c)}s.disconnectAll=n;function r(c){Vp.disconnectAll(c)}s.clearData=r;function o(){return Vp.exceptionHandler}s.getExceptionHandler=o;function a(c){let l=Vp.exceptionHandler;return Vp.exceptionHandler=c,l}s.setExceptionHandler=a})(Ra||(Ra={}));var Vp;(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 r(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=r;function o(w){n(w),r(w)}s.disconnectAll=o;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){Pt.removeAllWhere(w,b)}function b(w){return w.signal===null}})(Vp||(Vp={}));class ske{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class rke{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})(rke||(rke={}));class D9e extends rke{constructor(){super(...arguments),this._disposed=new Ra(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),Ra.clearData(this))}}(function(s){function e(t){let i=new s;for(const n of t)i.add(n);return i}s.from=e})(D9e||(D9e={}));class jh{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:i,distance:n}=this._scrollTarget,r=Eu.SCROLL_EDGE_SIZE-n,o=Math.pow(r/Eu.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(o*Eu.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});Eu.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"){Eu.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}let t=Eu.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=Eu.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,r=Eu.findElementBehindBackdrop(e,this.document);this._currentElement=r,r!==n&&r!==i&&Eu.dispatchDragExit(this,i,r,e),r!==n&&r!==i&&(i=Eu.dispatchDragEnter(this,r,i,e)),i!==t&&(this._currentTarget=i,Eu.dispatchDragLeave(this,t,i,e));let o=Eu.dispatchDragOver(this,i,e);this._setDropAction(o)}_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=Eu.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=jh.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=jh.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=jh.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=jh.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,r){super(r.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:r.related,screenX:n.screenX,screenY:n.screenY,shiftKey:n.shiftKey,view:window});const{drag:o}=r;this.dropAction="none",this.mimeData=o.mimeData,this.proposedAction=o.proposedAction,this.supportedActions=o.supportedActions,this.source=o.source}}s.Event=e;function t(i,n=document){return Eu.overrideCursor(i,n)}s.overrideCursor=t})(jh||(jh={}));var Eu;(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 r(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,Be=j-A,Ct=ne-L,Ne=Math.min(ge,De,Be,Ct);if(Ne>s.SCROLL_EDGE_SIZE)continue;let dt;switch(Ne){case Ct:dt="bottom";break;case De:dt="top";break;case Be:dt="right";break;case ge:dt="left";break;default:throw"unreachable"}let Dt=k.scrollWidth-k.clientWidth,Xi=k.scrollHeight-k.clientHeight,Ti;switch(dt){case"top":Ti=Xi>0&&k.scrollTop>0;break;case"left":Ti=Dt>0&&k.scrollLeft>0;break;case"right":Ti=Dt>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()})(Eu||(Eu={}));function Xie(){return oke.keyboardLayout}class XH{constructor(e,t,i=[]){this.name=e,this._codes=t,this._keys=XH.extractKeys(t),this._modifierKeys=XH.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 r in i)n[i[r]]=!0;return n}s.extractKeys=e;function t(i){let n=Object(null);for(let r=0,o=i.length;r{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=Zc.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=Zc.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=Zc.emptyObject){let i=this._commands.get(e);return i?i.mnemonic.call(void 0,t):-1}icon(e,t=Zc.emptyObject){var i;return(i=this._commands.get(e))===null||i===void 0?void 0:i.icon.call(void 0,t)}iconClass(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.iconClass.call(void 0,t):""}iconLabel(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.iconLabel.call(void 0,t):""}caption(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.caption.call(void 0,t):""}usage(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.usage.call(void 0,t):""}className(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.className.call(void 0,t):""}dataset(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.dataset.call(void 0,t):{}}isEnabled(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.isEnabled.call(void 0,t):!1}isToggled(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.isToggled.call(void 0,t):!1}isToggleable(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.isToggleable:!1}isVisible(e,t=Zc.emptyObject){let i=this._commands.get(e);return i?i.isVisible.call(void 0,t):!1}execute(e,t=Zc.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(o){n=Promise.reject(o)}let r=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:t,result:r}),r}addKeyBinding(e){let t=Uv.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new ske(()=>{Pt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})})}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;const t=gC.keystrokeForKeydownEvent(e);if(!t){this._replayKeydownEvents(),this._clearPendingState();return}if(gC.isModifierKeyPressed(e)){let{exact:o}=Uv.matchKeyBinding(this._keyBindings,[t],e);o?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(o)):this._clearModifierTimer();return}this._keystrokes.push(t);const{exact:i,partial:n}=Uv.matchKeyBinding(this._keyBindings,this._keystrokes,e),r=n.length!==0;if(!i&&!r){this._replayKeydownEvents(),this._clearPendingState();return}if((i?.preventDefault||n.some(o=>o.preventDefault))&&(e.preventDefault(),e.stopPropagation()),this._keydownEvents.push(e),i&&!r){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)},Uv.modifierkeyTimeOut)}_clearModifierTimer(){this._timerModifierID!==0&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},Uv.CHORD_TIMEOUT)}_clearTimer(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(Uv.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(e){if(this._holdKeyBindingPromises.size!==0){const r=[...this._keydownEvents],o=(await Promise.race([Promise.all(r.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]),Uv.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!o)return}let{command:t,args:i}=e,n={_luminoEvent:{type:"keybinding",keys:e.keys},...i};if(!this.hasCommand(t)||!this.isEnabled(t,n)){let r=this.hasCommand(t)?"enabled":"registered",a=`Cannot execute key binding '${e.keys.join(", ")}':`,c=`command '${t}' is not ${r}.`;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"?Hu.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&&Hu.IS_MAC&&(c+="Cmd "),l.key?c+l.key:c.trim()}s.normalizeKeystroke=t;function i(a){let c;return Hu.IS_WIN?c=a.winKeys||a.keys:Hu.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=Hu.IS_MAC?" ":"+",u=e(l);return u.ctrl&&d.push("Ctrl"),u.alt&&d.push("Alt"),u.shift&&d.push("Shift"),Hu.IS_MAC&&u.cmd&&d.push("Cmd"),d.push(u.key),d.map(Uv.formatKey).join(h)}}s.formatKeystroke=n;function r(a){let c=Xie(),l=c.keyForKeydownEvent(a);return c.isModifierKey(l)}s.isModifierKeyPressed=r;function o(a){let c=Xie(),l=c.keyForKeydownEvent(a),d=[];return a.ctrlKey&&d.push("Ctrl"),a.altKey&&d.push("Alt"),a.shiftKey&&d.push("Shift"),a.metaKey&&Hu.IS_MAC&&d.push("Cmd"),c.isModifierKey(l)||d.push(l),d.join(" ")}s.keystrokeForKeydownEvent=o})(gC||(gC={}));var Uv;(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:gC.normalizeKeys(y),selector:m(y),command:y.command,args:y.args||Zc.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=OS.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 r(y){return Hu.IS_MAC?o.hasOwnProperty(y)?o[y]:y:a.hasOwnProperty(y)?a[y]:y}s.formatKey=r;const o={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(!OS.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(OS.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}})(Uv||(Uv={}));class ZK{constructor(e){this.type="text",this.content=e}}class oge{constructor(e,t,i,n){this.type="element",this.tag=e,this.attrs=t,this.children=i,this.renderer=n}}function va(s){let e={},t,i=[];for(let r=1,o=arguments.length;r=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"){Pt.insert(b,C,L),t(L,f,w);continue}if(!A.renderer!=!L.renderer){Pt.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&&(Pt.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){Pt.insert(b,C,L),t(L,f,w);continue}if(A.tag!==L.tag){Pt.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 r={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function o(f,p){for(let m in p)m in r||(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 r||v in m||(v.substr(0,2)==="on"?f[v]=null:f.removeAttribute(v));for(v in m)v in r||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}})(u1||(u1={}));class TD{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}var im;(function(s){function e(r,o){let a=r.length;if(a===0)return o;let c=0,l=0,d=0,h=0,u=0;for(let m=0;m0&&(h+=v.stretch,u++)}if(o===d)return 0;if(o<=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(r,o,a){r.length===0||a===0||(a>0?i(r,o,a):n(r,o,-a))}s.adjust=t;function i(r,o,a){let c=0;for(let u=0;u<=o;++u){let f=r[u];c+=f.maxSize-f.size}let l=0;for(let u=o+1,f=r.length;u=0&&d>0;--u){let f=r[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=o+1,f=r.length;u0;++u){let p=r[u],m=p.size-p.minSize;m>=h?(p.sizeHint=p.size-h,h=0):(p.sizeHint=p.size-m,h-=m)}}function n(r,o,a){let c=0;for(let u=o+1,f=r.length;u0;++u){let p=r[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=o;u>=0&&h>0;--u){let f=r[u],p=f.size-f.minSize;p>=h?(f.sizeHint=f.size-h,h=0):(f.sizeHint=f.size-p,h-=p)}}})(im||(im={}));class ake{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 Ra(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,Ra.clearData(this))}}class st{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new Ra(this),this._hiddenMode=st.HiddenMode.Display,this.node=Zie.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(st.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&st.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Ra.clearData(this),$t.clearData(this),ov.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(st.Flag.IsDisposed)}get isAttached(){return this.testFlag(st.Flag.IsAttached)}get isHidden(){return this.testFlag(st.Flag.IsHidden)}get isVisible(){return this.testFlag(st.Flag.IsVisible)}get title(){return Zie.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==st.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 st.ChildMessage("child-removed",this);$t.sendMessage(this._parent,t)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let t=new st.ChildMessage("child-added",this);$t.sendMessage(this._parent,t)}this.isDisposed||$t.sendMessage(this,st.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(st.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(){$t.postMessage(this,st.Msg.UpdateRequest)}fit(){$t.postMessage(this,st.Msg.FitRequest)}activate(){$t.postMessage(this,st.Msg.ActivateRequest)}close(){$t.sendMessage(this,st.Msg.CloseRequest)}show(){if(this.testFlag(st.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&$t.sendMessage(this,st.Msg.BeforeShow),this.clearFlag(st.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&$t.sendMessage(this,st.Msg.AfterShow),this.parent)){let e=new st.ChildMessage("child-shown",this);$t.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(st.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&$t.sendMessage(this,st.Msg.BeforeHide),this.setFlag(st.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&$t.sendMessage(this,st.Msg.AfterHide),this.parent)){let e=new st.ChildMessage("child-hidden",this);$t.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(st.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(st.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(st.Flag.IsVisible),this.setFlag(st.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(st.Flag.IsVisible),this.clearFlag(st.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&&st.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 st.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case st.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case st.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case st.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case st.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case st.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}}}(function(s){(function(r){r[r.Display=0]="Display",r[r.Scale=1]="Scale",r[r.ContentVisibility=2]="ContentVisibility"})(s.HiddenMode||(s.HiddenMode={})),function(r){r[r.IsDisposed=1]="IsDisposed",r[r.IsAttached=2]="IsAttached",r[r.IsHidden=4]="IsHidden",r[r.IsVisible=8]="IsVisible",r[r.DisallowLayout=16]="DisallowLayout"}(s.Flag||(s.Flag={})),function(r){r.BeforeShow=new zm("before-show"),r.AfterShow=new zm("after-show"),r.BeforeHide=new zm("before-hide"),r.AfterHide=new zm("after-hide"),r.BeforeAttach=new zm("before-attach"),r.AfterAttach=new zm("after-attach"),r.BeforeDetach=new zm("before-detach"),r.AfterDetach=new zm("after-detach"),r.ParentChanged=new zm("parent-changed"),r.UpdateRequest=new $V("update-request"),r.FitRequest=new $V("fit-request"),r.ActivateRequest=new $V("activate-request"),r.CloseRequest=new $V("close-request")}(s.Msg||(s.Msg={}));class e extends zm{constructor(o,a){super(o),this.child=a}}s.ChildMessage=e;class t extends zm{constructor(o,a){super("resize"),this.width=o,this.height=a}}s.ResizeMessage=t,function(r){r.UnknownSize=new r(-1,-1)}(t=s.ResizeMessage||(s.ResizeMessage={}));function i(r,o,a=null){if(r.parent)throw new Error("Cannot attach a child widget.");if(r.isAttached||r.node.isConnected)throw new Error("Widget is already attached.");if(!o.isConnected)throw new Error("Host is not attached.");$t.sendMessage(r,s.Msg.BeforeAttach),o.insertBefore(r.node,a),$t.sendMessage(r,s.Msg.AfterAttach)}s.attach=i;function n(r){if(r.parent)throw new Error("Cannot detach a child widget.");if(!r.isAttached||!r.node.isConnected)throw new Error("Widget is not attached.");$t.sendMessage(r,s.Msg.BeforeDetach),r.node.parentNode.removeChild(r.node),$t.sendMessage(r,s.Msg.AfterDetach)}s.detach=n})(st||(st={}));var Zie;(function(s){s.titleProperty=new ov({name:"title",create:t=>new ake({owner:t})});function e(t){return t.node||document.createElement(t.tag||"div")}s.createNode=e})(Zie||(Zie={}));class CN{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,Ra.clearData(this),ov.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)$t.sendMessage(t,st.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const t of this)$t.sendMessage(t,st.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)$t.sendMessage(t,e)}onAfterAttach(e){for(const t of this)$t.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)$t.sendMessage(t,e)}onAfterDetach(e){for(const t of this)$t.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||$t.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||$t.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||$t.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||$t.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}(function(s){function e(r){return UF.horizontalAlignmentProperty.get(r)}s.getHorizontalAlignment=e;function t(r,o){UF.horizontalAlignmentProperty.set(r,o)}s.setHorizontalAlignment=t;function i(r){return UF.verticalAlignmentProperty.get(r)}s.getVerticalAlignment=i;function n(r,o){UF.verticalAlignmentProperty.set(r,o)}s.setVerticalAlignment=n})(CN||(CN={}));class EG{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=Ba.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 r=Math.max(this._minWidth,Math.min(i,this._maxWidth)),o=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(r"center",changed:e}),s.verticalAlignmentProperty=new ov({name:"verticalAlignment",create:()=>"top",changed:e});function e(t){t.parent&&t.parent.layout&&t.parent.update()}})(UF||(UF={}));class wle extends CN{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){Pt.insert(this._widgets,n,t),this.parent&&this.attachWidget(n,t);return}n===this._widgets.length&&n--,i!==n&&(Pt.move(this._widgets,i,n),this.parent&&this.moveWidget(i,n,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=Pt.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&&$t.sendMessage(t,st.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,i),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterAttach)}moveWidget(e,t,i){this.parent.isAttached&&$t.sendMessage(i,st.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&$t.sendMessage(i,st.Msg.AfterDetach);let n=this.parent.node.children[t];this.parent.isAttached&&$t.sendMessage(i,st.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&$t.sendMessage(i,st.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterDetach)}}var t7;(function(s){function e(t){return Math.max(0,Math.floor(t))}s.clampDimension=e})(t7||(t7={}));var i7=t7;class YA extends wle{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=t7.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=t7.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 CS.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e,t=!0){let i=this._sizers.length,n=e.slice(0,i);for(;n.length0&&(r.sizeHint=r.size);im.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 EG(t),n=CS.createHandle(this.renderer),r=CS.averageSize(this._sizers),o=CS.createSizer(r);Pt.insert(this._items,e,i),Pt.insert(this._sizers,e,o),Pt.insert(this._handles,e,n),this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(n),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Pt.move(this._items,e,t),Pt.move(this._sizers,e,t),Pt.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let i=Pt.removeAt(this._items,e),n=Pt.removeAt(this._handles,e);Pt.removeAt(this._sizers,e),this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(n),this.parent.isAttached&&$t.sendMessage(t,st.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,r,o,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,r),i+=a,l.top=`${n}px`,l.left=`${i}px`,l.width=`${this._spacing}px`,l.height=`${r}px`):(n+=this.widgetOffset,c.update(i,n,o,a),n+=a,l.top=`${n}px`,l.left=`${i}px`,l.width=`${o}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=YA.getStretch(d.widget),i?(h.minSize=d.minWidth,h.maxSize=d.maxWidth,n+=d.minWidth,r=Math.max(r,d.minHeight)):(h.minSize=d.minHeight,h.maxSize=d.maxHeight,r+=d.minHeight,n=Math.max(n,d.minWidth))}let o=this._box=Ba.boxSizing(this.parent.node);n+=o.horizontalSum,r+=o.verticalSum;let a=this.parent.node.style;a.minWidth=`${n}px`,a.minHeight=`${r}px`,this._dirty=!0,this.parent.parent&&$t.sendMessage(this.parent.parent,st.Msg.FitRequest),this._dirty&&$t.sendMessage(this.parent,st.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,o-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=im.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:(o,a)=>Math.max(0,Math.floor(a)),changed:r});function e(o){let a=new TD;return a.sizeHint=Math.floor(o),a}s.createSizer=e;function t(o){let a=o.createHandle();return a.style.position="absolute",a.style.contain="style",a}s.createHandle=t;function i(o){return o.reduce((a,c)=>a+c.size,0)/o.length||0}s.averageSize=i;function n(o){let a=o.length;if(a===0)return[];let c=o.reduce((l,d)=>l+Math.abs(d),0);return c===0?o.map(l=>1/a):o.map(l=>l/c)}s.normalize=n;function r(o){o.parent&&o.parent.layout instanceof YA&&o.parent.fit()}})(CS||(CS={}));class lei extends YA{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=i7.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"),r=ene.createTitle(this.renderer,t.title,n);this._titles[e]=r,this.parent.node.replaceChild(r,i)}insertWidget(e,t){t.id||(t.id=`id-${ike.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const i=ene.createTitle(this.renderer,t.title);Pt.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){Pt.move(this._titles,e,t),super.moveWidget(e,t,i)}detachWidget(e,t){const i=Pt.removeAt(this._titles,e);this.parent.node.removeChild(i),super.detachWidget(e,t)}updateItemPosition(e,t,i,n,r,o,a){const c=this._titles[e].style;c.top=`${n}px`,c.left=`${i}px`,c.height=`${this.widgetOffset}px`,t?c.width=`${r}px`:c.width=`${o}px`,super.updateItemPosition(e,t,i,n,r,o,a)}}var ene;(function(s){function e(t,i,n=!0){const r=t.createSectionTitle(i);return r.style.position="absolute",r.style.contain="strict",r.setAttribute("aria-label",`${i.label} Section`),r.setAttribute("aria-expanded",n?"true":"false"),r.setAttribute("aria-controls",i.owner.id),n&&r.classList.add("lm-mod-expanded"),r}s.createTitle=e})(ene||(ene={}));class JPe extends st{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=cke.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}var cke;(function(s){function e(t){return t.layout||new wle}s.createLayout=e})(cke||(cke={}));class ZH extends JPe{constructor(e={}){super({layout:lke.createLayout(e)}),this._handleMoved=new Ra(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=Pt.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,r=t.handles[i],o=r.getBoundingClientRect();t.orientation==="horizontal"?n=e.clientX-o.left:n=e.clientY-o.top;let a=window.getComputedStyle(r),c=jh.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 r=document.createElement("div");return r.className="lm-SplitPanel-handle",r}}s.Renderer=e,s.defaultRenderer=new e;function t(n){return YA.getStretch(n)}s.getStretch=t;function i(n,r){YA.setStretch(n,r)}s.setStretch=i})(ZH||(ZH={}));var lke;(function(s){function e(t){return t.layout||new YA({renderer:t.renderer||ZH.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}s.createLayout=e})(lke||(lke={}));class dke extends ZH{constructor(e={}){super({...e,layout:hke.createLayout(e)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new Ra(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=Pt.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,r=t.absoluteSizes(),o=(n?-1:1)*this.spacing,a=r.reduce((l,d)=>l+d);let c=[...r];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]-=r[u]/a*(l-o))}):c[d]-=l-o}else{const l=r[e];this._widgetSizesCache.set(i,l),c[e]=0;const d=c.map(h=>h>0).lastIndexOf(!0);if(d===-1)return;c[d]=r[d]+l+o}return c.map(l=>l/(a+o))}_evtClick(e){const t=e.target;if(t){const i=Pt.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=Pt.findFirstIndex(this.titles,r=>r.contains(t));if(n>=0){const r=e.keyCode.toString();if(e.key.match(/Space|Enter/)||r.match(/13|32/))t.click(),i=!0;else if(this.orientation==="horizontal"?e.key.match(/ArrowLeft|ArrowRight/)||r.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||r.match(/38|40/)){const o=e.key.match(/ArrowLeft|ArrowUp/)||r.match(/37|38/)?-1:1,a=this.titles.length,c=(n+a+o)%a;this.titles[c].focus(),i=!0}else e.key==="End"||r==="35"?(this.titles[this.titles.length-1].focus(),i=!0):(e.key==="Home"||r==="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()),this._expansionToggled.emit(e)}}(function(s){class e extends ZH.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 r=n.appendChild(this.createCollapseIcon(i));r.className="lm-AccordionPanel-titleCollapser";const o=n.appendChild(document.createElement("span"));return o.className="lm-AccordionPanel-titleLabel",o.textContent=i.label,o.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})(dke||(dke={}));var hke;(function(s){function e(t){return t.layout||new lei({renderer:t.renderer||dke.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}s.createLayout=e})(hke||(hke={}));class nf extends wle{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=i7.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=i7.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){Pt.insert(this._items,e,new EG(t)),Pt.insert(this._sizers,e,new TD),this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Pt.move(this._items,e,t),Pt.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let i=Pt.removeAt(this._items,e);Pt.removeAt(this._sizers,e),this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&$t.sendMessage(t,st.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,r)=>Math.max(0,Math.floor(r)),changed:i}),s.sizeBasisProperty=new ov({name:"sizeBasis",create:()=>0,coerce:(n,r)=>Math.max(0,Math.floor(r)),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 nf&&n.parent.fit()}})(j1||(j1={}));class k9e extends JPe{constructor(e={}){super({layout:uke.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(r){return nf.getStretch(r)}s.getStretch=e;function t(r,o){nf.setStretch(r,o)}s.setStretch=t;function i(r){return nf.getSizeBasis(r)}s.getSizeBasis=i;function n(r,o){nf.setSizeBasis(r,o)}s.setSizeBasis=n})(k9e||(k9e={}));var uke;(function(s){function e(t){return t.layout||new nf(t)}s.createLayout=e})(uke||(uke={}));class tne extends st{constructor(e){super({node:HC.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(st.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||tne.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=HC.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map(i=>HC.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){Pt.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=HC.search(this._items,t),this._activeIndex=t?Pt.findFirstIndex(n,HC.canActivate):-1),!t&&n.length===0){ID.render(null,i);return}if(t&&n.length===0){let c=this.renderer.renderEmptyMessage({query:t});ID.render(c,i);return}let r=this.renderer,o=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[o];Ba.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=Pt.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&&Zc.deepEqual(m.args,p))||null}}})(HC||(HC={}));class V_ extends st{constructor(e){super({node:xg.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new Ra(this),this._menuRequested=new Ra(this),this.addClass("lm-Menu"),this.setFlag(st.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||V_.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&&!xg.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}})}ID.render(o,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 o=this.activeItem;o&&o.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(t===40){this.activateNextItem();return}let i=Xie().keyForKeydownEvent(e);if(!i)return;let n=this._activeIndex+1,r=xg.findMnemonic(this._items,i,n);r.index!==-1&&!r.multiple?(this.activeIndex=r.index,this.triggerActiveItem()):r.index!==-1?this.activeIndex=r.index:r.auto!==-1&&(this.activeIndex=r.auto)}_evtMouseUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=Pt.findFirstIndex(this.contentNode.children,n=>Ba.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(Ba.hitTest(this._childMenu.node,t,i)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(e){this._parentMenu||(xg.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;V_.saveWindowData(),this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,$t.sendMessage(this,st.Msg.UpdateRequest);let n=this.contentNode.children[this._activeIndex];xg.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()},xg.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},xg.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){xg.saveWindowData()}}(function(s){class e{renderItem(i){let n=this.createItemClass(i),r=this.createItemDataset(i),o=this.createItemARIA(i);return va.li({className:n,dataset:r,tabindex:"0",onfocus:i.onfocus,...o},this.renderIcon(i),this.renderLabel(i),this.renderShortcut(i),this.renderSubmenu(i))}renderIcon(i){let n=this.createIconClass(i);return va.div({className:n},i.item.icon,i.item.iconLabel)}renderLabel(i){let n=this.formatLabel(i);return va.div({className:"lm-Menu-itemLabel"},n)}renderShortcut(i){let n=this.formatShortcut(i);return va.div({className:"lm-Menu-itemShortcut"},n)}renderSubmenu(i){return va.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 r=i.item.className;return r&&(n+=` ${r}`),n}createItemDataset(i){let n,{type:r,command:o,dataset:a}=i.item;return r==="command"?n={...a,type:r,command:o}:n={...a,type:r},n}createIconClass(i){let n="lm-Menu-itemIcon",r=i.item.iconClass;return r?`${n} ${r}`: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:r}=i.item;if(r<0||r>=n.length)return n;let o=n.slice(0,r),a=n.slice(r+1),c=n[r],l=va.span({className:"lm-Menu-itemMnemonic"},c);return[o,l,a]}formatShortcut(i){let n=i.item.keyBinding;return n?gC.formatKeystroke(n.keys):null}}s.Renderer=e,s.defaultRenderer=new e})(V_||(V_={}));var xg;(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 r(){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=r;function o(m){return m.type!=="separator"&&m.isEnabled&&m.isVisible}s.canActivate=o;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(Ba.hitTest(w.node,v,b))return!0;return!1}s.hitTestMenus=c;function l(m){let v=new Array(m.length);Pt.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(;++bk+R&&(v=k+R-ne),!y&&b+ge>P+z&&(b>P+z?b=P+z-ge:b=b-ge),j.transform=`translate(${Math.max(0,v)}px, ${Math.max(0,b)}px`,j.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;$t.sendMessage(m,st.Msg.UpdateRequest);let L=A,k=m.node,P=k.style;P.opacity="0",P.maxHeight=`${L}px`,st.attach(m,document.body);let{width:R,height:z}=k.getBoundingClientRect(),G=Ba.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&&Zc.deepEqual(w.args,b))||null}return null}}})(xg||(xg={}));var I9e;(function(s){function e(o,a){let c=i(o.selector),l=o.rank!==void 0?o.rank:1/0;return{...o,selector:c,rank:l,id:a}}s.createItem=e;function t(o,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=o.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,r=this._titles[n]||null;this._currentIndex=n,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:i,currentIndex:n,currentTitle:r})}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=Ym.asTitle(t),n=this._titles.indexOf(i),r=Math.max(0,Math.min(e,this._titles.length));return n===-1?(Pt.insert(this._titles,r,i),i.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(r,i),i):(r===this._titles.length&&r--,n===r||(Pt.move(this._titles,n,r),this.update(),this._adjustCurrentForMove(n,r)),i)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=Pt.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,n=this.renderer,r=this.currentTitle,o=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;cBa.hitTest(o,e.clientX,e.clientY));if(i===-1)return;let n=this.titles[i],r=t[i].querySelector(".lm-TabBar-tabLabel");if(r&&r.contains(e.target)){let o=n.label||"",a=r.innerHTML;r.innerHTML="";let c=document.createElement("input");c.classList.add("lm-TabBar-tabInput"),c.value=o,r.appendChild(c);let l=()=>{c.removeEventListener("blur",l),r.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!==""&&(n.label=n.caption=c.value),l()):d.key==="Escape"&&l()}),this.node.removeEventListener("keydown",this),c.select(),c.focus(),r.children.length>0&&r.children[0].focus()}}_evtKeyDownCapturing(e){e.eventPhase===Event.CAPTURING_PHASE&&(e.preventDefault(),e.stopPropagation(),e.key==="Escape"&&this._releaseMouse())}_evtKeyDown(e){var t,i,n;if(!(e.key==="Tab"||e.eventPhase===Event.CAPTURING_PHASE)){if(e.key==="Enter"||e.key==="Spacebar"||e.key===" "){const r=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(r))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{const o=Pt.findFirstIndex(this.contentNode.children,a=>a.contains(r));o>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=o)}}else if(dei.includes(e.key)){const r=[...this.contentNode.children];if(this.addButtonEnabled&&r.push(this.addButtonNode),r.length<=1)return;e.preventDefault(),e.stopPropagation();let o=r.indexOf(document.activeElement);o===-1&&(o=this._currentIndex);let a;e.key==="ArrowRight"&&this._orientation==="horizontal"||e.key==="ArrowDown"&&this._orientation==="vertical"?a=(t=r[o+1])!==null&&t!==void 0?t:r[0]:e.key==="ArrowLeft"&&this._orientation==="horizontal"||e.key==="ArrowUp"&&this._orientation==="vertical"?a=(i=r[o-1])!==null&&i!==void 0?i:r[r.length-1]:e.key==="Home"?a=r[0]:e.key==="End"&&(a=r[r.length-1]),a&&((n=r[o])===null||n===void 0||n.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,n=Pt.findFirstIndex(i,o=>Ba.hitTest(o,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 r=i[n].querySelector(this.renderer.closeIconSelector);r&&r.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&&!Ym.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.tabPressOffset={x:t.pressX-n.left,y:t.pressY-n.top},t.tabLayout=Ym.snapTabLayout(i,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=jh.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&Ym.detachExceeded(t,e)){t.detachRequested=!0;let n=t.index,r=e.clientX,o=e.clientY,a=i[n],c=this._titles[n];if(this._tabDetachRequested.emit({index:n,title:c,tab:a,clientX:r,clientY:o,offset:t.tabPressOffset}),t.dragAborted)return}Ym.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 r=this.contentNode.children,o=Pt.findFirstIndex(r,l=>Ba.hitTest(l,e.clientX,e.clientY));if(o!==t.index)return;let a=this._titles[o];if(!a.closable)return;if(e.button===1){this._tabCloseRequested.emit({index:o,title:a});return}let c=r[o].querySelector(this.renderer.closeIconSelector);if(c&&c.contains(e.target)){this._tabCloseRequested.emit({index:o,title:a});return}return}if(e.button!==0)return;Ym.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let i=Ym.parseTransitionDuration(t.tab);setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,Ym.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let n=t.index,r=t.targetIndex;r===-1||n===r||(Pt.move(this._titles,n,r),this._adjustCurrentForMove(n,r),this._tabMoved.emit({fromIndex:n,toIndex:r,title:this._titles[r]}),$t.sendMessage(this,st.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&&(Ym.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,r=this.insertBehavior;if(r==="select-tab"||r==="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,r=this.createTabKey(i),o=r,a=this.createTabStyle(i),c=this.createTabClass(i),l=this.createTabDataset(i),d=this.createTabARIA(i);return i.title.closable?va.li({id:o,key:r,className:c,title:n,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i),this.renderCloseIcon(i)):va.li({id:o,key:r,className:c,title:n,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){const{title:n}=i;let r=this.createIconClass(i);return va.div({className:r},n.icon,n.iconLabel)}renderLabel(i){return va.div({className:"lm-TabBar-tabLabel"},i.title.label)}renderCloseIcon(i){return va.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){var n;return{role:"tab","aria-selected":i.current.toString(),tabindex:`${(n=i.tabIndex)!==null&&n!==void 0?n:"-1"}`}}createIconClass(i){let n="lm-TabBar-tabIcon",r=i.title.iconClass;return r?`${n} ${r}`:n}}e._nInstance=0,s.Renderer=e,s.defaultRenderer=new e,s.addButtonSelector=".lm-TabBar-addButton"})(SI||(SI={}));var Ym;(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",u.setAttribute("tabindex","-1"),u.setAttribute("role","button"),d.appendChild(u),d}s.createNode=e;function t(d){return d instanceof ake?d:new ake(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=r;function o(d,h){let u=d.contentRect;return h.clientX=u.right+s.DETACH_THRESHOLD||h.clientY=u.bottom+s.DETACH_THRESHOLD}s.detachExceeded=o;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})(Ym||(Ym={}));class hei extends CN{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=i7.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=e.hiddenMode!==void 0?e.hiddenMode:st.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=i7.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():B4()}widgets(){return this._root?this._root.iterUserWidgets():B4()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():B4()}tabBars(){return this._root?this._root.iterTabBars():B4()}handles(){return this._root?this._root.iterHandles():B4()}moveHandle(e,t,i){let n=e.classList.contains("lm-mod-hidden");if(!this._root||n)return;let r=this._root.findSplitNode(e);if(!r)return;let o;r.node.orientation==="horizontal"?o=t-e.offsetLeft:o=i-e.offsetTop,o!==0&&(r.node.holdSizes(),im.adjust(r.node.sizers,r.index,o),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=wl.normalizeAreaConfig(e.main,t):i=null;let n=this.widgets(),r=this.tabBars(),o=this.handles();this._root=null;for(const a of n)t.has(a)||(a.parent=null);for(const a of r)a.dispose();for(const a of o)a.parentNode&&a.parentNode.removeChild(a);for(const a of t)a.parent=this.parent;i?this._root=wl.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",r=null;if(this._root&&i&&(r=this._root.findTabNode(i)),i&&!r)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,n){case"tab-after":this._insertTab(e,i,r,!0);break;case"tab-before":this._insertTab(e,i,r,!1);break;case"split-top":this._insertSplit(e,i,r,"vertical",!1);break;case"split-left":this._insertSplit(e,i,r,"horizontal",!1);break;case"split-right":this._insertSplit(e,i,r,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,i,r,"vertical",!0);break;case"merge-top":this._insertSplit(e,i,r,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,i,r,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,i,r,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,i,r,"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=Ba.boxSizing(this.parent.node));let i=this.parent.node.getBoundingClientRect(),n=e-i.left-this._box.borderLeft,r=t-i.top-this._box.borderTop,o=this._root.hitTestTabNodes(n,r);if(!o)return null;let{tabBar:a,top:c,left:l,width:d,height:h}=o,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:r,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 EG(e)),this.parent.isAttached&&$t.sendMessage(e,st.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&$t.sendMessage(e,st.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&$t.sendMessage(e,st.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&$t.sendMessage(e,st.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(wl.removeAria(e),t.tabBar.titles.length>1){if(t.tabBar.removeTab(e.title),this._hiddenMode===st.HiddenMode.Scale&&t.tabBar.titles.length==1){const u=t.tabBar.titles[0].owner;u.hiddenMode=st.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=Pt.removeFirstOf(i.children,t),r=Pt.removeAt(i.handles,n);if(Pt.removeAt(i.sizers,n),r.parentNode&&r.parentNode.removeChild(r),i.children.length>1){i.syncHandles();return}let o=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=o,d=l.children.indexOf(i);if(a instanceof wl.TabLayoutNode){a.parent=l,l.children[d]=a;return}let h=Pt.removeAt(l.handles,d);Pt.removeAt(l.children,d),Pt.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(im.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 r{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}})(wl||(wl={}));class n7 extends st{constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new Ra(this),this._addRequested=new Ra(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||n7.defaultRenderer,this._edges=e.edges||jc.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 hei({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new n7.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(jc.createSingleDocumentConfig(this));break;default:throw"unreachable"}$t.postMessage(this,jc.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=eke(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),(Hu.IS_EDGE||Hu.IS_IE)&&$t.flush(),$t.postMessage(this,jc.LayoutModified)}addWidget(e,t={}){this._mode==="single-document"?this.layout.addWidget(e):this.layout.addWidget(e,t),$t.postMessage(this,jc.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){jc.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){jc.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),$t.postMessage(this,jc.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:r}=jc.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 st)){e.dropAction="none";return}if(c.contains(this)){e.dropAction="none";return}let l=r?jc.getDropRef(r.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(),$t.postMessage(this,jc.LayoutModified))}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=e.target,n=eke(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 r=n.getBoundingClientRect(),o=e.clientX-r.left,a=e.clientY-r.top,c=window.getComputedStyle(n),l=jh.overrideCursor(c.cursor,this._document);this._pressData={handle:n,deltaX:o,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(),$t.postMessage(this,jc.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}=jc.findDropTarget(this,e,t,this._edges);if(i==="invalid")return this.overlay.hide(100),i;let r,o,a,c,l=Ba.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(i){case"root-all":r=l.paddingTop,o=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"root-top":r=l.paddingTop,o=l.paddingLeft,a=l.paddingRight,c=d.height*jc.GOLDEN_RATIO;break;case"root-left":r=l.paddingTop,o=l.paddingLeft,a=d.width*jc.GOLDEN_RATIO,c=l.paddingBottom;break;case"root-right":r=l.paddingTop,o=d.width*jc.GOLDEN_RATIO,a=l.paddingRight,c=l.paddingBottom;break;case"root-bottom":r=d.height*jc.GOLDEN_RATIO,o=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"widget-all":r=n.top,o=n.left,a=n.right,c=n.bottom;break;case"widget-top":r=n.top,o=n.left,a=n.right,c=n.bottom+n.height/2;break;case"widget-left":r=n.top,o=n.left,a=n.right+n.width/2,c=n.bottom;break;case"widget-right":r=n.top,o=n.left+n.width/2,a=n.right,c=n.bottom;break;case"widget-bottom":r=n.top+n.height/2,o=n.left,a=n.right,c=n.bottom;break;case"widget-tab":{const h=n.tabBar.node.getBoundingClientRect().height;r=n.top,o=n.left,a=n.right,c=n.bottom+n.height-h;break}default:throw"unreachable"}return this.overlay.show({top:r,left:o,right:a,bottom:c}),i}_createTabBar(){let e=this._renderer.createTabBar(this._document);return jc.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(){$t.postMessage(this,jc.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:i,currentTitle:n}=t;i&&i.owner.hide(),n&&n.owner.show(),(Hu.IS_EDGE||Hu.IS_IE)&&$t.flush(),$t.postMessage(this,jc.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:r,clientY:o,offset:a}=t,c=new rei,l=()=>i.owner;c.setData("application/vnd.lumino.widget-factory",l);let d=n.cloneNode(!0);a&&(d.style.top=`-${a.y}px`,d.style.left=`-${a.x}px`),this._drag=new jh({document:this._document,mimeData:c,dragImage:d,proposedAction:"move",supportedActions:"move",source:this}),n.classList.add("lm-mod-hidden");let h=()=>{this._drag=null,n.classList.remove("lm-mod-hidden")};this._drag.start(r,o).then(h)}}(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 r=this.node.style;r.top=`${n.top}px`,r.left=`${n.left}px`,r.right=`${n.right}px`,r.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 r=new SI({document:n});return r.addClass("lm-DockPanel-tabBar"),r}createHandle(){let n=document.createElement("div");return n.className="lm-DockPanel-handle",n}}s.Renderer=t,s.defaultRenderer=new t})(n7||(n7={}));var jc;(function(s){s.GOLDEN_RATIO=.618,s.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},s.LayoutModified=new $V("layout-modified"),s.isGeneratedTabBarProperty=new ov({name:"isGeneratedTabBar",create:()=>!1});function e(n){if(n.isEmpty)return{main:null};let r=Array.from(n.widgets()),o=n.selectedWidgets().next().value,a=o?r.indexOf(o):-1;return{main:{type:"tab-area",widgets:r,currentIndex:a}}}s.createSingleDocumentConfig=e;function t(n,r,o,a){if(!Ba.hitTest(n.node,r,o))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=r-y.left+1,A=o-y.top+1,L=y.right-r,k=y.bottom-o;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})(jc||(jc={}));class cL extends CN{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new TD],this._columnSizers=[new TD],this._box=null,e.rowCount!==void 0&&Td.reallocSizers(this._rowSizers,e.rowCount),e.columnCount!==void 0&&Td.reallocSizers(this._columnSizers,e.columnCount),e.rowSpacing!==void 0&&(this._rowSpacing=Td.clampValue(e.rowSpacing)),e.columnSpacing!==void 0&&(this._columnSpacing=Td.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&&(Td.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(Td.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=Td.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=Td.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=Td.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=Td.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){Pt.findFirstIndex(this._items,i=>i.widget===e)===-1&&(this._items.push(new EG(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=Pt.findFirstIndex(this._items,n=>n.widget===e);if(t===-1)return;let i=Pt.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&&$t.sendMessage(e,st.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&$t.sendMessage(e,st.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&$t.sendMessage(e,st.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&$t.sendMessage(e,st.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 r(c,l){for(l=Math.max(1,Math.floor(l));c.lengthl&&(c.length=l)}s.reallocSizers=r;function o(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=o;function a(c){c.parent&&c.parent.layout instanceof cL&&c.parent.fit()}})(Td||(Td={}));class s7 extends st{constructor(e={}){super({node:ine.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(st.Flag.DisallowLayout),this.renderer=e.renderer||s7.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 n=this._menus.indexOf(t),r=Math.max(0,Math.min(e,this._menus.length));if(n===-1){Pt.insert(this._menus,r,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}r===this._menus.length&&r--,n!==r&&(Pt.move(this._menus,n,r),i&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let i=Pt.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,n=this.renderer,r=this._activeIndex,o=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 V_({commands:new gC}),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===r&&i[a].items.length!==0,tabbable:a===o,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]=n.renderItem({title:v.title,active:!1,tabbable:a===o,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)}}ID.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,r=e.length;if(this._menuItemSizes.length==0)for(let o=0;ot&&n===-1&&(n=o)}else for(let o=0;ot){n=o;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){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 o=t===37?-1:1,a=this._tabFocusIndex+o,c=this._menus.length;for(let l=0;lBa.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);V_.saveWindowData(),this.activeIndex=t,this._openChildMenu(i)}}_evtMouseMove(e){let t=Pt.findFirstIndex(this.contentNode.children,n=>Ba.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;V_.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}}_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,$t.sendMessage(this,st.Msg.UpdateRequest);let{left:n,top:r}=e;(typeof n>"u"||typeof r>"u")&&({left:n,top:r}=this._positionForMenu(this._activeIndex)),i||this.addClass("lm-mod-active"),t.items.length>0&&t.open(n,r,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),r=this.createItemDataset(i),o=this.createItemARIA(i);return va.li({className:n,dataset:r,...i.disabled?{}:{tabindex:i.tabbable?"0":"-1"},onfocus:i.onfocus,...o},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){let n=this.createIconClass(i);return va.div({className:n},i.title.icon,i.title.iconLabel)}renderLabel(i){let n=this.formatLabel(i);return va.div({className:"lm-MenuBar-itemLabel"},n)}createItemClass(i){let n="lm-MenuBar-item";return i.title.className&&(n+=` ${i.title.className}`),i.active&&!i.disabled&&(n+=" lm-mod-active"),n}createItemDataset(i){return i.title.dataset}createItemARIA(i){return{role:"menuitem","aria-haspopup":"true","aria-disabled":i.disabled?"true":"false"}}createIconClass(i){let n="lm-MenuBar-itemIcon",r=i.title.iconClass;return r?`${n} ${r}`:n}formatLabel(i){let{label:n,mnemonic:r}=i.title;if(r<0||r>=n.length)return n;let o=n.slice(0,r),a=n.slice(r+1),c=n[r],l=va.span({className:"lm-MenuBar-itemMnemonic"},c);return[o,l,a]}}s.Renderer=e,s.defaultRenderer=new e})(s7||(s7={}));var ine;(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,r){let o=-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===st.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=st.HiddenMode.Scale),t.hiddenMode=st.HiddenMode.Scale):t.hiddenMode=st.HiddenMode.Display,Pt.insert(this._items,e,new EG(t)),this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Pt.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let i=Pt.removeAt(this._items,e);this.parent.isAttached&&$t.sendMessage(t,st.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&$t.sendMessage(t,st.Msg.AfterDetach),i.widget.node.style.zIndex="",this._hiddenMode===st.HiddenMode.Scale&&(t.hiddenMode=st.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=st.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 r=0,o=this._items.length;rthis._onDidChangeConfiguration.fire(this.toResourceConfigurationChangeEvent(n))))}getValue(e,t,i){return typeof i=="string"?this._getValue(e,re.isIPosition(t)?t:null,i):this._getValue(e,null,typeof t=="string"?t:void 0)}updateValue(e,t,i,n){const r=this.getLanguage(e,null),o=this.configurationService.inspect(t,{resource:e,overrideIdentifier:r});n===void 0&&(n=this.deriveConfigurationTarget(o,r));const a=r&&o.overrideIdentifiers?.includes(r)?r: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 At.MEMORY;if(e.workspaceFolder?.override!==void 0)return At.WORKSPACE_FOLDER;if(e.workspace?.override!==void 0)return At.WORKSPACE;if(e.userRemote?.override!==void 0)return At.USER_REMOTE;if(e.userLocal?.override!==void 0)return At.USER_LOCAL}return e.memory?.value!==void 0?At.MEMORY:e.workspaceFolder?.value!==void 0?At.WORKSPACE_FOLDER:e.workspace?.value!==void 0?At.WORKSPACE:e.userRemote?.value!==void 0?At.USER_REMOTE:At.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})}}}};fke=D([_(0,Te),_(1,fi),_(2,Di)],fke);const yle=".vscode",nne="settings",pei=`${yle}/${nne}.json`,mei="vscode://schemas/settings/default",_ei="vscode://schemas/settings/user",vei="vscode://schemas/settings/profile",bei="vscode://schemas/settings/machine",Xrt="vscode://schemas/settings/workspace",wei="vscode://schemas/settings/folder",yei="vscode://schemas/launch",Cei="vscode://schemas/tasks";ct.APPLICATION;const Sei=[ct.MACHINE,ct.WINDOW,ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE,ct.MACHINE_OVERRIDABLE],Zrt=[ct.WINDOW,ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE],Aei=[ct.APPLICATION,...Zrt],age=[ct.MACHINE,ct.WINDOW,ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE,ct.MACHINE_OVERRIDABLE],Ej=[ct.WINDOW,ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE,ct.MACHINE_OVERRIDABLE],eot=[ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE,ct.MACHINE_OVERRIDABLE],Hf="tasks",fx="launch",XPe=Object.create(null);XPe[Hf]=`${yle}/${Hf}.json`;XPe[fx]=`${yle}/${fx}.json`;const tot=Object.create(null);tot[Hf]=`${Hf}.json`;const Eei=`{ "version": "2.0.0", "tasks": [] -}`,UC="workbench.settings.applyToAllProfiles",Eei=je.as(tE.JSONContribution),xj=je.as(Pn.Configuration),L9e={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 zp;const iot=ih.registerExtensionPoint({extensionPoint:"configurationDefaults",jsonSchema:{$ref:Uqe}});iot.setHandler((s,{added:e,removed:t})=>{zp&&xj.deltaConfiguration(zp);const i=zp={};if(queueMicrotask(()=>{zp===i&&(xj.deltaConfiguration(zp),zp=void 0)}),t.length){const n=t.map(r=>({overrides:Ds(r.value),source:{id:r.description.identifier.value,displayName:r.description.displayName}}));zp.removedDefaults=n}if(e.length){const n=xj.getConfigurationProperties(),r=[ct.MACHINE_OVERRIDABLE,ct.WINDOW,ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE],o=e.map(a=>{const c=Ds(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(!rf.test(l)&&d?.scope&&!r.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}}});zp.addedDefaults=o}});const xei=ih.registerExtensionPoint({extensionPoint:"configuration",deps:[iot],jsonSchema:{description:g(3628,"Contributes configuration settings."),oneOf:[L9e,{type:"array",items:L9e}]}}),cge=new ba;xei.setHandler((s,{added:e,removed:t})=>{if(zp??={},t.length){const o=[];for(const a of t)o.push(...cge.get(a.description.identifier)||[]),cge.delete(a.description.identifier);zp.removedConfigurations=o}const i=new Set;function n(o,a){const c=Ds(o);return c.title&&typeof c.title!="string"&&a.collector.error(g(3629,"'configuration.title' must be a string")),r(c,a),c.id=o.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 r(o,a){const c=o.properties;if(c){typeof c!="object"&&(a.collector.error(g(3630,"'configuration.properties' must be an object")),o.properties={});for(const d in c){const h=c[d],u=Gqe(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(!In(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?Pgt(h.scope.toString()):ct.WINDOW}}const l=o.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)r(d,a)}}if(e.length){const o=[];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)),cge.set(a.description.identifier,c),o.push(...c)}zp.addedConfigurations=o}xj.deltaConfiguration(zp),zp=void 0});Eei.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:Xrt},launch:{type:"object",default:{configurations:[],compounds:[]},description:g(3639,"Workspace launch configurations"),$ref:wei},tasks:{type:"object",default:{version:"2.0.0",tasks:[]},description:g(3640,"Workspace task configurations"),$ref:yei},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 Dei 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=Kqe(t),n=i?Object.keys(i):[],r=[g(3645,"ID"),g(3646,"Description"),g(3647,"Default")],o=n.sort((a,c)=>a.localeCompare(c)).map(a=>[new Nt().appendMarkdown(`\`${a}\``),i[a].markdownDescription?new Nt(i[a].markdownDescription,!1):i[a].description??"",new Nt().appendCodeblock("json",JSON.stringify(Ja(i[a].default)?$qe(i[a].type):i[a].default,null,2))]);return{data:{headers:r,rows:o},dispose:()=>{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"configuration",label:g(3648,"Settings"),access:{canToggle:!1},renderer:new yi(Dei)});let pke=class extends V{constructor(e,t,i,n,r,o){super(),this.contextService=e,this.notificationService=t,this.fileService=i,this.quickInputService=n,this.hostService=r,this.storageService=o,this.findWorkspaces()}async findWorkspaces(){const e=this.contextService.getWorkspace().folders[0];if(!e||this.contextService.getWorkbenchState()!==Qi.FOLDER||snt(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(Fae);i.length>0&&this.doHandleWorkspaceFiles(e.uri,i)}}doHandleWorkspaceFiles(e,t){const i={id:"workspaces.dontPromptToOpen",scope:Kme.WORKSPACE,isSecondary:!0};if(t.length===1){const n=t[0];this.notificationService.prompt(Ze.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:Ft(e,n)}])}],{neverShowAgain:i,priority:this.storageService.isNew(Ie.WORKSPACE)?void 0:Z2.SILENT})}else t.length>1&&this.notificationService.prompt(Ze.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:Ft(e,n.label)}])})}}],{neverShowAgain:i,priority:this.storageService.isNew(Ie.WORKSPACE)?void 0:Z2.SILENT})}};pke=D([_(0,Ci),_(1,wi),_(2,Xt),_(3,Tn),_(4,Dc),_(5,Gi)],pke);je.as(hf.Workbench).registerWorkbenchContribution(pke,Ms.Eventually);Et(class extends di{constructor(){super({id:"workbench.action.openWorkspaceFromEditor",title:Pe(3650,"Open Workspace"),f1:!1,menu:{id:_e.EditorContent,when:he.and(U3.Extension.isEqualTo(BYe),TXe.isEqualTo(hnt),IXe.toNegated())}})}async run(s,e){const t=s.get(Dc),i=s.get(Ci),n=s.get(wi);if(i.getWorkbenchState()===Qi.WORKSPACE){const r=i.getWorkspace().configuration;if(r&&Yi(r,e)){n.info(g(3654,"This workspace is already open."));return}}return t.openWindow([{workspaceUri:e}])}});class sne extends RA{constructor(e,t){super(e,t),this._folders=[],this._transient=!1,this._settingsModelParser=new RA(e,t),this._launchModel=cs.createEmptyModel(t),this._tasksModel=cs.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=u8(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=H8(i,a=>console.error(`Conflict in settings file ${this._name}: ${a}`)),r=Object.create(null);r[t]=n;const o=Object.keys(i).map(a=>`${t}.${a}`);return new cs(r,o,[],void 0,this.logService)}return cs.createEmptyModel(this.logService)}}class not extends RA{constructor(e,t,i){super(e,i),this.scope=t}doParseRaw(e,t){const i=H8(e,o=>console.error(`Conflict in settings file ${this._name}: ${o}`)),n=Object.create(null);n[this.scope]=i;const r=Object.keys(e).map(o=>`${this.scope}.${o}`);return{contents:n,keys:r,overrides:[]}}}class R9e extends w3{constructor(e,t,i,n,r,o,a,c,l,d,h){super(e,t,i,n,r,o,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=(o,a,c)=>{const l=[];return l.push(...a.filter(d=>o.indexOf(d)===-1)),l.push(...o.filter(d=>a.indexOf(d)===-1)),l.push(...o.filter(d=>a.indexOf(d)===-1?!1:Js(this.getValue(d,{overrideIdentifier:c}),e.getValue(d,{overrideIdentifier:c}))?this._workspace&&this._workspace.folders.some(h=>!Js(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=[],r=Ya([...this.allOverrideIdentifiers(),...e.allOverrideIdentifiers()]);for(const o of r){const a=t(this.getAllKeysForOverrideIdentifier(o),e.getAllKeysForOverrideIdentifier(o),o);a.length&&n.push([o,a])}return{keys:i,overrides:n}}}function kei(s){return s.hasOwnProperty("workspace")}function Dj(s){return s.hasOwnProperty("folderUri")}function Iei(s){return s.hasOwnProperty("fileUri")}function sot(s){return rne(s)||rot(s)}function rne(s){const e=s;return typeof e?.path=="string"&&(!e.name||typeof e.name=="string")}function rot(s){const e=s;return typeof e?.uri=="string"&&(!e.name||typeof e.name=="string")}function ZPe(s,e,t,i,n){if(s.scheme!==i.scheme)return{name:t,uri:s.toString(!0)};let r=e?void 0:n.relativePath(i,s);if(r!==void 0)r.length===0?r=".":jn&&(r=M9e(r));else if(s.scheme===pe.file)r=s.fsPath,jn&&(r=M9e(r));else if(n.isEqualAuthority(s.authority,i.authority))r=s.path;else return{name:t,uri:s.toString(!0)};return{name:t,path:r}}function M9e(s){return s=Yw(s),Hdt(s)||(s=L8(s)),s}function lge(s,e,t){const i=[],n=new Set,r=t.dirname(e);for(const o of s){let a;if(rne(o))o.path&&(a=t.resolvePath(r,o.path));else if(rot(o))try{a=N.parse(o.uri),a.path[0]!==zi.sep&&(a=a.with({path:zi.sep+a.path}))}catch(c){console.warn(c)}if(a){const c=t.getComparisonKey(a);if(!n.has(c)){n.add(c);const l=o.name||t.basenameOrAuthority(a);i.push(new Pae({uri:a,name:l,index:i.length},o))}}}return i}function N9e(s,e,t,i,n){const r=Tei(e,s),o=n.dirname(e),a=n.dirname(i),c=[];for(const u of r.folders){const f=rne(u)?n.resolvePath(o,u.path):N.parse(u.uri);let p;t?p=!1:p=!rne(u)||yM(u.path),c.push(ZPe(f,p,u.name,a,n))}const l={insertSpaces:!1,tabSize:4,eol:mo||jt?` +}`,UC="workbench.settings.applyToAllProfiles",xei=je.as(tE.JSONContribution),xj=je.as(Pn.Configuration),L9e={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 zp;const iot=ih.registerExtensionPoint({extensionPoint:"configurationDefaults",jsonSchema:{$ref:Uqe}});iot.setHandler((s,{added:e,removed:t})=>{zp&&xj.deltaConfiguration(zp);const i=zp={};if(queueMicrotask(()=>{zp===i&&(xj.deltaConfiguration(zp),zp=void 0)}),t.length){const n=t.map(r=>({overrides:Ds(r.value),source:{id:r.description.identifier.value,displayName:r.description.displayName}}));zp.removedDefaults=n}if(e.length){const n=xj.getConfigurationProperties(),r=[ct.MACHINE_OVERRIDABLE,ct.WINDOW,ct.RESOURCE,ct.LANGUAGE_OVERRIDABLE],o=e.map(a=>{const c=Ds(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(!rf.test(l)&&d?.scope&&!r.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}}});zp.addedDefaults=o}});const Dei=ih.registerExtensionPoint({extensionPoint:"configuration",deps:[iot],jsonSchema:{description:g(3628,"Contributes configuration settings."),oneOf:[L9e,{type:"array",items:L9e}]}}),cge=new ba;Dei.setHandler((s,{added:e,removed:t})=>{if(zp??={},t.length){const o=[];for(const a of t)o.push(...cge.get(a.description.identifier)||[]),cge.delete(a.description.identifier);zp.removedConfigurations=o}const i=new Set;function n(o,a){const c=Ds(o);return c.title&&typeof c.title!="string"&&a.collector.error(g(3629,"'configuration.title' must be a string")),r(c,a),c.id=o.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 r(o,a){const c=o.properties;if(c){typeof c!="object"&&(a.collector.error(g(3630,"'configuration.properties' must be an object")),o.properties={});for(const d in c){const h=c[d],u=Gqe(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(!In(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?Pgt(h.scope.toString()):ct.WINDOW}}const l=o.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)r(d,a)}}if(e.length){const o=[];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)),cge.set(a.description.identifier,c),o.push(...c)}zp.addedConfigurations=o}xj.deltaConfiguration(zp),zp=void 0});xei.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:Xrt},launch:{type:"object",default:{configurations:[],compounds:[]},description:g(3639,"Workspace launch configurations"),$ref:yei},tasks:{type:"object",default:{version:"2.0.0",tasks:[]},description:g(3640,"Workspace task configurations"),$ref:Cei},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 kei 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=Kqe(t),n=i?Object.keys(i):[],r=[g(3645,"ID"),g(3646,"Description"),g(3647,"Default")],o=n.sort((a,c)=>a.localeCompare(c)).map(a=>[new Nt().appendMarkdown(`\`${a}\``),i[a].markdownDescription?new Nt(i[a].markdownDescription,!1):i[a].description??"",new Nt().appendCodeblock("json",JSON.stringify(Ja(i[a].default)?$qe(i[a].type):i[a].default,null,2))]);return{data:{headers:r,rows:o},dispose:()=>{}}}}je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"configuration",label:g(3648,"Settings"),access:{canToggle:!1},renderer:new yi(kei)});let pke=class extends V{constructor(e,t,i,n,r,o){super(),this.contextService=e,this.notificationService=t,this.fileService=i,this.quickInputService=n,this.hostService=r,this.storageService=o,this.findWorkspaces()}async findWorkspaces(){const e=this.contextService.getWorkspace().folders[0];if(!e||this.contextService.getWorkbenchState()!==Qi.FOLDER||snt(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(Fae);i.length>0&&this.doHandleWorkspaceFiles(e.uri,i)}}doHandleWorkspaceFiles(e,t){const i={id:"workspaces.dontPromptToOpen",scope:Kme.WORKSPACE,isSecondary:!0};if(t.length===1){const n=t[0];this.notificationService.prompt(Ze.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:Ft(e,n)}])}],{neverShowAgain:i,priority:this.storageService.isNew(Ie.WORKSPACE)?void 0:Z2.SILENT})}else t.length>1&&this.notificationService.prompt(Ze.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:Ft(e,n.label)}])})}}],{neverShowAgain:i,priority:this.storageService.isNew(Ie.WORKSPACE)?void 0:Z2.SILENT})}};pke=D([_(0,Ci),_(1,wi),_(2,Xt),_(3,Tn),_(4,Dc),_(5,Gi)],pke);je.as(hf.Workbench).registerWorkbenchContribution(pke,Ms.Eventually);Et(class extends di{constructor(){super({id:"workbench.action.openWorkspaceFromEditor",title:Pe(3650,"Open Workspace"),f1:!1,menu:{id:_e.EditorContent,when:he.and(U3.Extension.isEqualTo(BYe),TXe.isEqualTo(hnt),IXe.toNegated())}})}async run(s,e){const t=s.get(Dc),i=s.get(Ci),n=s.get(wi);if(i.getWorkbenchState()===Qi.WORKSPACE){const r=i.getWorkspace().configuration;if(r&&Yi(r,e)){n.info(g(3654,"This workspace is already open."));return}}return t.openWindow([{workspaceUri:e}])}});class sne extends RA{constructor(e,t){super(e,t),this._folders=[],this._transient=!1,this._settingsModelParser=new RA(e,t),this._launchModel=cs.createEmptyModel(t),this._tasksModel=cs.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=u8(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=H8(i,a=>console.error(`Conflict in settings file ${this._name}: ${a}`)),r=Object.create(null);r[t]=n;const o=Object.keys(i).map(a=>`${t}.${a}`);return new cs(r,o,[],void 0,this.logService)}return cs.createEmptyModel(this.logService)}}class not extends RA{constructor(e,t,i){super(e,i),this.scope=t}doParseRaw(e,t){const i=H8(e,o=>console.error(`Conflict in settings file ${this._name}: ${o}`)),n=Object.create(null);n[this.scope]=i;const r=Object.keys(e).map(o=>`${this.scope}.${o}`);return{contents:n,keys:r,overrides:[]}}}class R9e extends w3{constructor(e,t,i,n,r,o,a,c,l,d,h){super(e,t,i,n,r,o,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=(o,a,c)=>{const l=[];return l.push(...a.filter(d=>o.indexOf(d)===-1)),l.push(...o.filter(d=>a.indexOf(d)===-1)),l.push(...o.filter(d=>a.indexOf(d)===-1?!1:Js(this.getValue(d,{overrideIdentifier:c}),e.getValue(d,{overrideIdentifier:c}))?this._workspace&&this._workspace.folders.some(h=>!Js(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=[],r=Ya([...this.allOverrideIdentifiers(),...e.allOverrideIdentifiers()]);for(const o of r){const a=t(this.getAllKeysForOverrideIdentifier(o),e.getAllKeysForOverrideIdentifier(o),o);a.length&&n.push([o,a])}return{keys:i,overrides:n}}}function Iei(s){return s.hasOwnProperty("workspace")}function Dj(s){return s.hasOwnProperty("folderUri")}function Tei(s){return s.hasOwnProperty("fileUri")}function sot(s){return rne(s)||rot(s)}function rne(s){const e=s;return typeof e?.path=="string"&&(!e.name||typeof e.name=="string")}function rot(s){const e=s;return typeof e?.uri=="string"&&(!e.name||typeof e.name=="string")}function ZPe(s,e,t,i,n){if(s.scheme!==i.scheme)return{name:t,uri:s.toString(!0)};let r=e?void 0:n.relativePath(i,s);if(r!==void 0)r.length===0?r=".":jn&&(r=M9e(r));else if(s.scheme===pe.file)r=s.fsPath,jn&&(r=M9e(r));else if(n.isEqualAuthority(s.authority,i.authority))r=s.path;else return{name:t,uri:s.toString(!0)};return{name:t,path:r}}function M9e(s){return s=Yw(s),Hdt(s)||(s=L8(s)),s}function lge(s,e,t){const i=[],n=new Set,r=t.dirname(e);for(const o of s){let a;if(rne(o))o.path&&(a=t.resolvePath(r,o.path));else if(rot(o))try{a=N.parse(o.uri),a.path[0]!==zi.sep&&(a=a.with({path:zi.sep+a.path}))}catch(c){console.warn(c)}if(a){const c=t.getComparisonKey(a);if(!n.has(c)){n.add(c);const l=o.name||t.basenameOrAuthority(a);i.push(new Pae({uri:a,name:l,index:i.length},o))}}}return i}function N9e(s,e,t,i,n){const r=Lei(e,s),o=n.dirname(e),a=n.dirname(i),c=[];for(const u of r.folders){const f=rne(u)?n.resolvePath(o,u.path):N.parse(u.uri);let p;t?p=!1:p=!rne(u)||yM(u.path),c.push(ZPe(f,p,u.name,a,n))}const l={insertSpaces:!1,tabSize:4,eol:mo||jt?` `:`\r -`},d=vle(s,["folders"],c,l);let h=u9e(s,d);return W2(r.remoteAuthority,fXe(i))&&(h=u9e(h,MJt(h,["remoteAuthority"],l))),h}function Tei(s,e){const t=af(e);if(t&&Array.isArray(t.folders))t.folders=t.folders.filter(i=>sot(i));else throw new Error(`${s} looks like an invalid workspace file.`);return t}function Lei(s){return s.workspace&&typeof s.workspace=="object"&&typeof s.workspace.id=="string"&&typeof s.workspace.configPath=="string"}function Rei(s){return typeof s.folderUri=="string"}function Mei(s){return typeof s.fileUri=="string"}function Nei(s,e){const t={workspaces:[],files:[]};if(s){const i=function(r,o){for(let a=0;a{const o=r.label,a=r.remoteAuthority;Lei(r)?t.workspaces.push({label:o,remoteAuthority:a,workspace:{id:r.workspace.id,configPath:N.parse(r.workspace.configPath)}}):Rei(r)?t.workspaces.push({label:o,remoteAuthority:a,folderUri:N.parse(r.folderUri)}):Mei(r)&&t.files.push({label:o,remoteAuthority:a,fileUri:N.parse(r.fileUri)})})}return t}function Pei(s){const e={entries:[]};for(const t of s.workspaces)Dj(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 oot=Te;var po;(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"})(po||(po={}));class P9e extends Ra{constructor(e,t){super(e),this.code=t}}var En;(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"})(En||(En={}));let mke=class{constructor(e,t,i,n,r,o,a,c,l,d,h,u){this.remoteSettingsResource=e,this.configurationService=t,this.contextService=i,this.userDataProfileService=n,this.userDataProfilesService=r,this.fileService=o,this.textModelResolverService=a,this.textFileService=c,this.notificationService=l,this.preferencesService=d,this.editorService=h,this.uriIdentityService=u,this.queue=new EI}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(r){if(i.donotNotifyError)throw r;await this.onError(r,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 r=this.getFormattingOptions(n.object.textEditorModel);await this.updateConfiguration(e,n.object.textEditorModel,r,t)}finally{n.dispose()}}async updateConfiguration(e,t,i,n){if(this.hasParseErrors(t.getValue(),e))throw this.toConfigurationEditingError(po.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 r=this.getEdits(e,t.getValue(),i)[0];r&&this.applyEditsToBuffer(r,t)&&await this.save(t,e)}async save(e,t){try{await this.textFileService.save(e.uri,{ignoreErrorHandler:!0})}catch(i){throw i.fileOperationResult===ji.FILE_MODIFIED_SINCE?this.toConfigurationEditingError(po.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE,t.target,t):new P9e(g(8749,"Error while writing to {0}. {1}",this.stringifyTarget(t.target),i.message),po.ERROR_INTERNAL)}}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),n=t.getPositionAt(e.offset+e.length),r=new F(i.lineNumber,i.column,n.lineNumber,n.column),o=t.getValueInRange(r);if(e.content!==o){const a=o?es.replace(r,e.content):es.insert(i,e.content);return t.pushEditOperations([new ht(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits({value:e,jsonPath:t},i,n){return t.length?vle(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 po.ERROR_INVALID_CONFIGURATION:this.onInvalidConfigurationError(e,t);break;case po.ERROR_CONFIGURATION_FILE_DIRTY:this.onConfigurationFileDirtyError(e,t,i);break;case po.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===Hf?g(8750,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===fx?g(8751,"Open Launch Configuration"):null;i?this.notificationService.prompt(Ze.Error,e.message,[{label:i,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(Ze.Error,e.message,[{label:g(8752,"Open Settings"),run:()=>this.openSettings(t)}])}onConfigurationFileDirtyError(e,t,i){const n=t.workspaceStandAloneConfigurationKey===Hf?g(8750,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===fx?g(8751,"Open Launch Configuration"):null;n?this.notificationService.prompt(Ze.Error,e.message,[{label:g(8753,"Save and Retry"),run:()=>{const r=t.key?`${t.workspaceStandAloneConfigurationKey}.${t.key}`:t.workspaceStandAloneConfigurationKey;this.writeConfiguration(t.target,{key:r,value:t.value},{handleDirtyFile:"save",scopes:i})}},{label:n,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(Ze.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 En.USER_LOCAL:this.preferencesService.openUserSettings(t);break;case En.USER_REMOTE:this.preferencesService.openRemoteSettings(t);break;case En.WORKSPACE:this.preferencesService.openWorkspaceSettings(t);break;case En.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 P9e(n,e)}toErrorMessage(e,t,i){switch(e){case po.ERROR_POLICY_CONFIGURATION:return g(8754,"Unable to write {0} because it is configured in system policy.",i.key);case po.ERROR_UNKNOWN_KEY:return g(8755,"Unable to write to {0} because {1} is not a registered configuration.",this.stringifyTarget(t),i.key);case po.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 po.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 po.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 po.ERROR_INVALID_USER_TARGET:return g(8759,"Unable to write to User Settings because {0} does not support for global scope.",i.key);case po.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 po.ERROR_INVALID_FOLDER_TARGET:return g(8761,"Unable to write to Folder Settings because no resource is provided.");case po.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 po.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 po.ERROR_INVALID_CONFIGURATION:{if(i.workspaceStandAloneConfigurationKey===Hf)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===fx)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 En.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 En.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 En.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 En.WORKSPACE_FOLDER:{let n="<>";if(i.resource){const r=this.contextService.getWorkspaceFolder(i.resource);r&&(n=r.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 po.ERROR_CONFIGURATION_FILE_DIRTY:{if(i.workspaceStandAloneConfigurationKey===Hf)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===fx)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 En.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 En.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 En.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 En.WORKSPACE_FOLDER:{let n="<>";if(i.resource){const r=this.contextService.getWorkspaceFolder(i.resource);r&&(n=r.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 po.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:if(i.workspaceStandAloneConfigurationKey===Hf)return g(8776,"Unable to write into tasks configuration file because the content of the file is newer.");if(i.workspaceStandAloneConfigurationKey===fx)return g(8777,"Unable to write into launch configuration file because the content of the file is newer.");switch(t){case En.USER_LOCAL:return g(8778,"Unable to write into user settings because the content of the file is newer.");case En.USER_REMOTE:return g(8779,"Unable to write into remote user settings because the content of the file is newer.");case En.WORKSPACE:return g(8780,"Unable to write into workspace settings because the content of the file is newer.");case En.WORKSPACE_FOLDER:return g(8781,"Unable to write into folder settings because the content of the file is newer.")}case po.ERROR_INTERNAL:return g(8782,"Unable to write to {0} because of an internal error.",this.stringifyTarget(t))}}stringifyTarget(e){switch(e){case En.USER_LOCAL:return g(8783,"User Settings");case En.USER_REMOTE:return g(8784,"Remote User Settings");case En.WORKSPACE:return g(8785,"Workspace Settings");case En.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 Hf:return Aei;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 af(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(po.ERROR_POLICY_CONFIGURATION,e,t);const o=je.as(Pn.Configuration).getConfigurationProperties()[t.key]?.scope;if(!t.workspaceStandAloneConfigurationKey&&this.configurationService.keys().default.indexOf(t.key)<0&&!rf.test(t.key)&&t.value!==void 0)throw this.toConfigurationEditingError(po.ERROR_UNKNOWN_KEY,e,t);if(t.workspaceStandAloneConfigurationKey&&t.workspaceStandAloneConfigurationKey!==Hf&&(e===En.USER_LOCAL||e===En.USER_REMOTE))throw this.toConfigurationEditingError(po.ERROR_INVALID_USER_TARGET,e,t);if((e===En.WORKSPACE||e===En.WORKSPACE_FOLDER)&&this.contextService.getWorkbenchState()===Qi.EMPTY)throw this.toConfigurationEditingError(po.ERROR_NO_WORKSPACE_OPENED,e,t);if(e===En.WORKSPACE&&!t.workspaceStandAloneConfigurationKey&&!rf.test(t.key)){if(o===ct.APPLICATION)throw this.toConfigurationEditingError(po.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION,e,t);if(o===ct.MACHINE)throw this.toConfigurationEditingError(po.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE,e,t)}if(e===En.WORKSPACE_FOLDER){if(!t.resource)throw this.toConfigurationEditingError(po.ERROR_INVALID_FOLDER_TARGET,e,t);if(!t.workspaceStandAloneConfigurationKey&&!rf.test(t.key)&&o!==void 0&&!eot.includes(o))throw this.toConfigurationEditingError(po.ERROR_INVALID_FOLDER_CONFIGURATION,e,t)}if(n.overrideIdentifiers?.length&&o!==ct.LANGUAGE_OVERRIDABLE)throw this.toConfigurationEditingError(po.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION,e,t);if(!t.resource)throw this.toConfigurationEditingError(po.ERROR_INVALID_FOLDER_TARGET,e,t);if(i&&this.textFileService.isDirty(t.resource))throw this.toConfigurationEditingError(po.ERROR_CONFIGURATION_FILE_DIRTY,e,t)}getConfigurationEditOperation(e,t,i){if(t.key){const l=e===En.USER_LOCAL?tot:XPe,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,o=je.as(Pn.Configuration).getConfigurationProperties()[n]?.scope;let a=i.overrideIdentifiers?.length?[zqe(i.overrideIdentifiers),n]:[n];if(e===En.USER_LOCAL||e===En.USER_REMOTE)return{key:n,jsonPath:a,value:t.value,resource:this.getConfigurationFileResource(e,n,"",null,o)??void 0,target:e};const c=this.getConfigurationFileResource(e,n,fei,i.resource,o);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,r){if(e===En.USER_LOCAL)return t===Hf?this.userDataProfileService.currentProfile.tasksResource:!this.userDataProfileService.currentProfile.isDefault&&this.configurationService.isSettingAppliedForAllProfiles(t)?this.userDataProfilesService.defaultProfile.settingsResource:this.userDataProfileService.currentProfile.settingsResource;if(e===En.USER_REMOTE)return this.remoteSettingsResource;const o=this.contextService.getWorkbenchState();if(o!==Qi.EMPTY){const a=this.contextService.getWorkspace();if(e===En.WORKSPACE){if(o===Qi.WORKSPACE)return a.configuration??null;if(o===Qi.FOLDER)return a.folders[0].toResource(i)}if(e===En.WORKSPACE_FOLDER&&n){const c=this.contextService.getWorkspaceFolder(n);if(c)return c.toResource(i)}}return null}};mke=D([_(1,oot),_(2,Ci),_(3,pg),_(4,km),_(5,Xt),_(6,pn),_(7,Fr),_(8,wi),_(9,Y6),_(10,ti),_(11,Is)],mke);const DO=class DO extends eXe{constructor(e,t,i){super(i),this.configurationCache=e,this.configurationRegistry=je.as(Pn.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!DA(this.cachedConfigurationDefaultsOverrides)}initializeCachedConfigurationDefaultsOverrides(){return this.initiaizeCachedConfigurationDefaultsOverridesPromise||(this.initiaizeCachedConfigurationDefaultsOverridesPromise=(async()=>{try{if(localStorage.getItem(DO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY)){const e=await this.configurationCache.read(this.cacheKey);e&&(this.cachedConfigurationDefaultsOverrides=JSON.parse(e))}}catch{}this.cachedConfigurationDefaultsOverrides=In(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)!rf.test(i)&&n.value!==void 0&&(e[i]=n.value);try{Object.keys(e).length?(localStorage.setItem(DO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY,"yes"),await this.configurationCache.write(this.cacheKey,JSON.stringify(e))):(localStorage.removeItem(DO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY),await this.configurationCache.remove(this.cacheKey))}catch{}}};DO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY="DefaultOverridesCacheExists";let _ke=DO;class Fei extends TYe{constructor(e,t,i,n){super(e.defaultProfile.settingsResource,{scopes:[ct.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 ln(()=>this.loadConfiguration().then(r=>this._onDidChangeConfiguration.fire(r)),50))}async initialize(){return this.loadConfiguration()}async loadConfiguration(){const e=await super.loadConfiguration(),t=e.getValue(UC),i=Array.isArray(t)?t:[];return this.parseOptions.include||i.length?this.reparse({...this.parseOptions,include:i}):e}}class Oei extends V{get hasTasksLoaded(){return this.userConfiguration.value instanceof one}constructor(e,t,i,n,r,o){super(),this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.fileService=n,this.uriIdentityService=r,this.logService=o,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.userConfiguration=this._register(new yn),this.userConfigurationChangeDisposable=this._register(new yn),this.userConfiguration.value=new TYe(e,this.configurationParseOptions,r.extUri,this.fileService,o),this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule()),this.reloadConfigurationScheduler=this._register(new ln(()=>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?[[Hf,this.tasksResource]]:[],n=new one(t.toString(),this.settingsResource,i,this.configurationParseOptions,this.fileService,this.uriIdentityService,this.logService),r=await n.loadConfiguration(e);return this.userConfiguration.value=n,this.userConfigurationChangeDisposable.value&&(this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),r}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 one extends V{constructor(e,t,i,n,r,o,a){super(),this.settingsResource=t,this.standAloneConfigurationResources=i,this.fileService=r,this.uriIdentityService=o,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(Yo(...this.allResources.map(c=>Yo(this.fileService.watch(o.extUri.dirname(c)),this.fileService.watch(c))))),this._folderSettingsModelParser=new RA(e,a),this._folderSettingsParseOptions=n,this._standAloneConfigurations=[],this._cache=cs.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 r=>Promise.all(r.map(async o=>{try{return(await this.fileService.readFile(o,{atomic:!0})).value.toString()}catch(a){this.logService.trace(`Error while resolving configuration file '${o.toString()}': ${ou(a)}`),a.fileOperationResult!==ji.FILE_NOT_FOUND&&a.fileOperationResult!==ji.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(([,r])=>r))]);return[i,n.map((r,o)=>[this.standAloneConfigurationResources[o][0],r])]}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),Tr.DELETED)))}handleFileOperationEvent(e){return!!((e.isOperation(Ei.CREATE)||e.isOperation(Ei.COPY)||e.isOperation(Ei.DELETE)||e.isOperation(Ei.WRITE))&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,t))||e.isOperation(Ei.DELETE)&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,this.uriIdentityService.extUri.dirname(t))))}}class Bei extends V{constructor(e,t,i,n,r,o){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 Wei(e,t,{scopes:age},o),r.getEnvironment().then(async a=>{if(a){const c=this._register(new dge(a.settingsPath,{scopes:age},this._fileService,n,o));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 dge)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:age})}getRestrictedSettings(){return this._userConfiguration.getRestrictedSettings()}onDidUserConfigurationChange(e){this.updateCache(),this._onDidChangeConfiguration.fire(e)}async updateCache(){if(this._userConfiguration instanceof dge){let e;try{e=await this._userConfiguration.resolveContent()}catch(t){if(t.fileOperationResult!==ji.FILE_NOT_FOUND)return}await this._cachedConfiguration.updateConfiguration(e)}}}class dge extends V{constructor(e,t,i,n,r){super(),this.configurationResource=e,this.fileService=i,this.uriIdentityService=n,this.logService=r,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.fileWatcherDisposable=this._register(new yn),this.directoryWatcherDisposable=this._register(new yn),this.parser=new RA(this.configurationResource.toString(),r),this.parseOptions=t,this._register(i.onDidFilesChange(o=>this.handleFileChangesEvent(o))),this._register(i.onDidRunOperation(o=>this.handleFileOperationEvent(o))),this.reloadConfigurationScheduler=this._register(new ln(()=>this.reload().then(o=>this._onDidChangeConfiguration.fire(o)),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 cs.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,Tr.UPDATED);e.contains(this.configurationResource,Tr.ADDED)?(t=!0,this.onResourceExists(!0)):e.contains(this.configurationResource,Tr.DELETED)&&(t=!0,this.onResourceExists(!1)),t&&this.reloadConfigurationScheduler.schedule()}handleFileOperationEvent(e){(e.isOperation(Ei.CREATE)||e.isOperation(Ei.COPY)||e.isOperation(Ei.DELETE)||e.isOperation(Ei.WRITE))&&this.uriIdentityService.extUri.isEqual(e.resource,this.configurationResource)&&this.reloadConfigurationScheduler.schedule()}onResourceExists(e){e?(this.stopWatchingDirectory(),this.watchResource()):(this.stopWatchingResource(),this.watchDirectory())}}class Wei 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 RA("CachedRemoteUserConfiguration",n),this.parseOptions=i,this.configurationModel=cs.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 Hei 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 Uei(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 eq(this.fileService,this.uriIdentityService,this.logService))),await this.reload()}async reload(){this._workspaceIdentifier&&await this._workspaceConfiguration.load(this._workspaceIdentifier,{scopes:Ej,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:Ej,skipRestricted:this.isUntrusted()}),this.getConfiguration()}getRestrictedSettings(){return this._workspaceConfiguration.getRestrictedSettings()}async waitAndInitialize(e){if(await IYe(e.configPath,this.fileService),!(this._workspaceConfiguration instanceof eq)){const t=this._register(new eq(this.fileService,this.uriIdentityService,this.logService));await t.load(e,{scopes:Ej,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 eq){const e=await this._workspaceConfiguration.resolveContent(this._workspaceIdentifier);await this._cachedConfiguration.updateWorkspace(this._workspaceIdentifier,e)}}}class eq 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 sne("",i),this.workspaceSettings=cs.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(Ei.CREATE)||n.isOperation(Ei.COPY)||n.isOperation(Ei.DELETE)||n.isOperation(Ei.WRITE))&&t.extUri.isEqual(n.resource,this._workspaceIdentifier.configPath)))(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new ln(()=>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 sne(this._workspaceIdentifier.id,this.logService),wt(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 Uei{constructor(e,t){this.configurationCache=e,this.logService=t,this.onDidChange=M.None,this.workspaceConfigurationModelParser=new sne("",t),this.workspaceSettings=cs.createEmptyModel(t)}async load(e,t){try{const i=this.getKey(e),n=await this.configurationCache.read(i),r=JSON.parse(n);r.content&&(this.workspaceConfigurationModelParser=new sne(i.key,this.logService),this.workspaceConfigurationModelParser.parse(r.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 Vei{constructor(e,t,i,n,r){this.configurationCache=n,this.logService=r,this.onDidChange=M.None,this.key={type:"folder",key:Hc(Ft(e,t).toString()).toString(16)},this._folderSettingsModelParser=new RA("CachedFolderConfiguration",r),this._folderSettingsParseOptions=i,this._standAloneConfigurations=[],this.configurationModel=cs.createEmptyModel(r)}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===nne)this._folderSettingsModelParser.parse(t[i],this._folderSettingsParseOptions);else{const n=new not(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[nne]=e),t.forEach(([n,r])=>{r&&(i[n]=r)}),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 zei extends V{constructor(e,t,i,n,r,o,a,c,l){super(),this.workspaceFolder=t,this.workbenchState=n,this.workspaceTrusted=r,this.configurationCache=l,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.scopes=Qi.WORKSPACE===this.workbenchState?eot:Ej,this.configurationFolder=a.extUri.joinPath(t.uri,i),this.cachedFolderConfiguration=new Vei(t.uri,i,{scopes:this.scopes,skipRestricted:this.isUntrusted()},l,c),e&&this.configurationCache.needsCaching(t.uri)?(this.folderConfiguration=this.cachedFolderConfiguration,IYe(t.uri,o).then(()=>{this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(o,a,c)),this._register(this.folderConfiguration.onDidChange(d=>this.onDidFolderConfigurationChange())),this.onDidFolderConfigurationChange()})):(this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(o,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,`${nne}.json`),r=[Hf,fx].map(o=>[o,t.extUri.joinPath(this.configurationFolder,`${o}.json`)]);return new one(this.configurationFolder.toString(),n,r,{scopes:this.scopes,skipRestricted:this.isUntrusted()},e,t,i)}async updateCache(){if(this.configurationCache.needsCaching(this.configurationFolder)&&this.folderConfiguration instanceof one){const[e,t]=await this.folderConfiguration.resolveContents();this.cachedFolderConfiguration.updateConfiguration(e,t)}}}function F9e(s,e){return s.isDefault||s.useDefaultFlags?.settings?e?Sei:void 0:e?Zrt:Cei}class hge extends OYe{constructor(){super(...arguments),this.initialized=!1}}class $ei extends V{get restrictedSettings(){return this._restrictedSettings}constructor({remoteAuthority:e,configurationCache:t},i,n,r,o,a,c,l,d){if(super(),this.userDataProfileService=n,this.userDataProfilesService=r,this.fileService=o,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=je.as(Pn.Configuration),this.initRemoteUserConfigurationBarrier=new jd,this.completeWorkspaceBarrier=new jd,this.defaultConfiguration=this._register(new _ke(t,i,l)),this.policyConfiguration=d instanceof NXe?new l0t:this._register(new mve(this.defaultConfiguration,d,l)),this.configurationCache=t,this._configuration=new R9e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,cs.createEmptyModel(l),cs.createEmptyModel(l),cs.createEmptyModel(l),cs.createEmptyModel(l),new gi,cs.createEmptyModel(l),new gi,this.workspace,l),this.applicationConfigurationDisposables=this._register(new Z),this.createApplicationConfiguration(),this.localUserConfiguration=this._register(new Oei(n.currentProfile.settingsResource,n.currentProfile.tasksResource,{scopes:F9e(n.currentProfile,!!e)},o,c,l)),this.cachedFolderConfigs=new gi,this._register(this.localUserConfiguration.onDidChangeConfiguration(h=>this.onLocalUserConfigurationChanged(h))),e){const h=this.remoteUserConfiguration=this._register(new Bei(e,t,o,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 Hei(t,o,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 EI}createApplicationConfiguration(){this.applicationConfigurationDisposables.clear(),this.userDataProfileService.currentProfile.isDefault||this.userDataProfileService.currentProfile.useDefaultFlags?.settings?this.applicationConfiguration=null:(this.applicationConfiguration=this.applicationConfigurationDisposables.add(this._register(new Fei(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:B_(e)&&(t=e.uri),N.isUri(t)&&this.uriIdentityService.extUri.isEqual(t,this.workspace.folders[0].uri)}case Qi.WORKSPACE:return oA(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,r=this.getWorkspace().folders,o=r.map(a=>a.raw).filter((a,c)=>sot(a)?!this.contains(t,r[c].uri):!0);if(n=r.length!==o.length,e.length){const a=this.getWorkspace().configuration,c=this.uriIdentityService.extUri.dirname(a);r=lge(o,a,this.uriIdentityService.extUri);const l=r.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(ZPe(u,!1,h.name,c,this.uriIdentityService.extUri))}}d.length>0&&(n=!0,typeof i=="number"&&i>=0&&ithis.workspaceConfiguration.setFolders(e,t.get(MI))),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=the(e)?e:the(t)?t:void 0;return this._configuration.getValue(i,n)}async updateValue(e,t,i,n,r){const o=Sgt(i)?i:the(i)?{resource:i.resource,overrideIdentifiers:i.overrideIdentifier?[i.overrideIdentifier]:void 0}:void 0,a=o?n:i,c=a?[a]:[];if(o?.overrideIdentifiers&&(o.overrideIdentifiers=Ya(o.overrideIdentifiers),o.overrideIdentifiers=o.overrideIdentifiers.length?o.overrideIdentifiers:void 0),!c.length){if(o?.overrideIdentifiers&&o.overrideIdentifiers.length>1)throw new Error("Configuration Target is required while updating the value for multiple override identifiers");const l=this.inspect(e,{resource:o?.resource,overrideIdentifier:o?.overrideIdentifiers?o.overrideIdentifiers[0]:void 0});c.push(...this.deriveConfigurationTargets(e,t,l)),Js(t,l.defaultValue)&&c.length===1&&(c[0]===At.USER||c[0]===At.USER_LOCAL)&&(t=void 0)}await er.settled(c.map(l=>this.writeConfigurationValue(e,t,l,o,r)))}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(FYe(e)){await this.reloadWorkspaceFolderConfiguration(e);return}switch(e){case At.DEFAULT:this.reloadDefaultConfiguration();return;case At.USER:{const{local:t,remote:i}=await this.reloadUserConfiguration();await this.loadConfiguration(this._configuration.applicationConfiguration,t,i,!0);return}case At.USER_LOCAL:await this.reloadLocalUserConfiguration();return;case At.USER_REMOTE:await this.reloadRemoteUserConfiguration();return;case At.WORKSPACE:case At.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){ls("code/willInitWorkspaceService");const t=this.initialized;this.initialized=!1;const i=await this.createWorkspace(e);await this.updateWorkspaceAndInitializeConfiguration(i,t),this.checkAndMarkWorkspaceComplete(!1),ls("code/didInitWorkspaceService")}updateWorkspaceTrust(e){if(this.isWorkspaceTrusted!==e){this.isWorkspaceTrusted=e;const t=this._configuration.toData(),i=[];for(const r of this.workspace.folders){const o=this.cachedFolderConfigs.get(r.uri);let a;o&&(a=o.updateWorkspaceTrust(this.isWorkspaceTrusted),this._configuration.updateFolderConfiguration(r.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(r=>n.push(...r)),n=Ya(n),n.length&&this.triggerConfigurationChange({keys:n,overrides:[]},{data:t,workspace:this.workspace},At.WORKSPACE)}}acquireInstantiationService(e){this.instantiationService=e}isSettingAppliedForAllProfiles(e){if(this.configurationRegistry.getConfigurationProperties()[e]?.scope===ct.APPLICATION)return!0;const t=this.getValue(UC)??[];return Array.isArray(t)&&t.includes(e)}async createWorkspace(e){return oA(e)?this.createMultiFolderWorkspace(e):B_(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=lge(this.workspaceConfiguration.getFolders(),t,this.uriIdentityService.extUri),n=e.id,r=new hge(n,i,this.workspaceConfiguration.isTransient(),t,o=>this.uriIdentityService.extUri.ignorePathCasing(o));return r.initialized=this.workspaceConfiguration.initialized,r}createSingleFolderWorkspace(e){const t=new hge(e.id,[rJ(e.uri)],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,t}createEmptyWorkspace(e){const t=new hge(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,r,o=[];if(i?(n=this.getWorkbenchState(),r=this.workspace.configuration?this.workspace.configuration.fsPath:void 0,o=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;(r&&c!==r||a!==n)&&this._onDidChangeWorkspaceName.fire();const l=this.compareFolders(o,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(sF(ri,()=>this.reloadLocalUserConfiguration(!1,this._configuration.localUserConfiguration)))}compareFolders(e,t){const i={added:[],removed:[],changed:[]};i.added=t.filter(n=>!e.some(r=>n.uri.toString()===r.uri.toString()));for(let n=0;n{ls("code/willInitUserConfiguration");const c=await Promise.all([this.localUserConfiguration.initialize(),this.remoteUserConfiguration?this.remoteUserConfiguration.initialize():Promise.resolve(cs.createEmptyModel(this.logService))]);if(this.applicationConfiguration){const l=await i;c[0]=this.localUserConfiguration.reparse({exclude:l.getValue(UC)})}return ls("code/didInitUserConfiguration"),c},[,r,[o,a]]=await Promise.all([t,i,n()]);ls("code/willInitWorkspaceConfiguration"),await this.loadConfiguration(r,o,a,e),ls("code/didInitWorkspaceConfiguration")}reloadDefaultConfiguration(){this.onDefaultConfigurationChanged(this.defaultConfiguration.reload())}async reloadApplicationConfiguration(e){if(!this.applicationConfiguration)return cs.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 cs.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 gi;const r=this.workspace.folders,o=await this.loadFolderConfigurations(r),a=this.getWorkspaceConfigurationModel(o),c=new gi;o.forEach((d,h)=>c.set(r[h].uri,d));const l=this._configuration;if(this._configuration=new R9e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,e,t,i,a,c,cs.createEmptyModel(this.logService),new gi,this.workspace,this.logService),this.initialized=!0,n){const d=this._configuration.compare(l);this.triggerConfigurationChange(d,{data:l.toData(),workspace:this.workspace},At.WORKSPACE)}this.updateRestrictedSettings()}getWorkspaceConfigurationModel(e){switch(this.getWorkbenchState()){case Qi.FOLDER:return e[0];case Qi.WORKSPACE:return this.workspaceConfiguration.getConfiguration();default:return cs.createEmptyModel(this.logService)}}onUserDataProfileChanged(e){e.join((async()=>{const t=[];t.push(this.localUserConfiguration.reset(e.profile.settingsResource,e.profile.tasksResource,{scopes:F9e(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(UC)})),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 r=this.cachedFolderConfigs.get(this.workspace.folders[0].uri);r&&(this._configuration.updateWorkspaceConfiguration(r.reparse()),this._configuration.updateFolderConfiguration(this.workspace.folders[0].uri,r.reparse()))}else{this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.reparseWorkspaceSettings());for(const r of this.workspace.folders){const o=this.cachedFolderConfigs.get(r.uri);o&&this._configuration.updateFolderConfiguration(r.uri,o.reparse())}}this.triggerConfigurationChange(n,{data:i,workspace:this.workspace},At.DEFAULT),this.updateRestrictedSettings()}}onPolicyConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdatePolicyConfiguration(e);this.triggerConfigurationChange(i,t,At.DEFAULT)}onApplicationConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.applicationConfiguration.getValue(UC)??[],n=this._configuration.compareAndUpdateApplicationConfiguration(e),r=this.getValue(UC)??[],o=this.configurationRegistry.getConfigurationProperties(),a=[];for(const c of n.keys)if(o[c]?.scope===ct.APPLICATION){if(a.push(c),c===UC){for(const l of i)r.includes(l)||a.push(l);for(const l of r)i.includes(l)||a.push(l)}}else r.includes(c)&&a.push(c);n.keys=a,n.keys.includes(UC)&&this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse({exclude:r})),this.triggerConfigurationChange(n,t,At.USER)}onLocalUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateLocalUserConfiguration(e);this.triggerConfigurationChange(i,t,At.USER)}onRemoteUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateRemoteUserConfiguration(e);this.triggerConfigurationChange(i,t,At.USER)}async onWorkspaceConfigurationChanged(e){if(this.workspace&&this.workspace.configuration){let t=lge(this.workspaceConfiguration.getFolders(),this.workspace.configuration,this.uriIdentityService.extUri);if(this.workspace.initialized){const{added:i,removed:n,changed:r}=this.compareFolders(this.workspace.folders,t);i.length||n.length||r.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=s0(i,this._restrictedSettings.default,(p,m)=>p.localeCompare(m));e.push(...n.added,...n.removed);const r=(this.applicationConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),o=s0(r,this._restrictedSettings.application||[],(p,m)=>p.localeCompare(m));e.push(...o.added,...o.removed);const a=this.localUserConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)),c=s0(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=s0(l,this._restrictedSettings.userRemote||[],(p,m)=>p.localeCompare(m));e.push(...d.added,...d.removed);const h=new gi;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=s0(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=s0(u,this._restrictedSettings.workspace||[],(p,m)=>p.localeCompare(m));e.push(...f.added,...f.removed),e.length&&(this._restrictedSettings={default:i,application:r.length?r: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},r=this._configuration.compareAndUpdateWorkspaceConfiguration(t),o=this.compareFolders(this.workspace.folders,e);if(o.added.length||o.removed.length||o.changed.length){this.workspace.folders=e;const a=await this.onFoldersChanged();await this.handleWillChangeWorkspaceFolders(o,i),this.triggerConfigurationChange(a,n,At.WORKSPACE_FOLDER),this._onDidChangeWorkspaceFolders.fire(o)}else this.triggerConfigurationChange(r,n,At.WORKSPACE);this.updateRestrictedSettings()}async handleWillChangeWorkspaceFolders(e,t){const i=[];this._onWillChangeWorkspaceFolders.fire({join(n){i.push(n)},changes:e,fromCache:t});try{await er.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 r=this._configuration.compareAndUpdateWorkspaceConfiguration(t);this.triggerConfigurationChange(tWe(n,r),i,At.WORKSPACE)}else this.triggerConfigurationChange(n,i,At.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,r)=>{e.push(this._configuration.compareAndUpdateFolderConfiguration(t[r].uri,n))}),tWe(...e)}loadFolderConfigurations(e){return Promise.all([...e.map(t=>{let i=this.cachedFolderConfigs.get(t.uri);return i||(i=new zei(!this.initialized,t,yle,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()} - ${Po(n)}`)}t.push(i)}return t}async writeConfigurationValue(e,t,i,n,r){if(!this.instantiationService)throw new Error("Cannot write configuration because the configuration service is not yet ready to accept writes.");if(i===At.DEFAULT)throw new Error("Invalid configuration target");if(i===At.MEMORY){const a={data:this._configuration.toData(),workspace:this.workspace};this._configuration.updateValue(e,t,n),this.triggerConfigurationChange({keys:n?.overrideIdentifiers?.length?[zqe(n.overrideIdentifiers),e]:[e],overrides:n?.overrideIdentifiers?.length?n.overrideIdentifiers.map(c=>[c,[e]]):[]},a,i);return}const o=this.toEditableConfigurationTarget(i,e);if(!o)throw new Error("Invalid configuration target");if(o===En.USER_REMOTE&&!this.remoteUserConfiguration)throw new Error("Invalid configuration target");if(n?.overrideIdentifiers?.length&&n.overrideIdentifiers.length>1){const a=this.getConfigurationModelForEditableConfigurationTarget(o,n.resource);if(a){const c=n.overrideIdentifiers.sort(),l=a.overrides.find(d=>ns([...d.identifiers].sort(),c));l&&(n.overrideIdentifiers=l.identifiers)}}switch(this.configurationEditing=this.configurationEditing??this.createConfigurationEditingService(this.instantiationService),await(await this.configurationEditing).writeConfiguration(o,{key:e,value:t},{scopes:n,...r}),o){case En.USER_LOCAL:this.applicationConfiguration&&this.isSettingAppliedForAllProfiles(e)?await this.reloadApplicationConfiguration():await this.reloadLocalUserConfiguration();return;case En.USER_REMOTE:return this.reloadRemoteUserConfiguration().then(()=>{});case En.WORKSPACE:return this.reloadWorkspaceConfiguration();case En.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(mke,t)}getConfigurationModelForEditableConfigurationTarget(e,t){switch(e){case En.USER_LOCAL:return this._configuration.localUserConfiguration;case En.USER_REMOTE:return this._configuration.remoteUserConfiguration;case En.WORKSPACE:return this._configuration.workspaceConfiguration;case En.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0}}getConfigurationModel(e,t){switch(e){case At.USER_LOCAL:return this._configuration.localUserConfiguration;case At.USER_REMOTE:return this._configuration.remoteUserConfiguration;case At.WORKSPACE:return this._configuration.workspaceConfiguration;case At.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0;default:return}}deriveConfigurationTargets(e,t,i){if(Js(t,i.value))return[];const n=[];return i.workspaceFolderValue!==void 0&&n.push(At.WORKSPACE_FOLDER),i.workspaceValue!==void 0&&n.push(At.WORKSPACE),i.userRemoteValue!==void 0&&n.push(At.USER_REMOTE),i.userLocalValue!==void 0&&n.push(At.USER_LOCAL),i.applicationValue!==void 0&&n.push(At.APPLICATION),t===void 0?n:[n[0]||At.USER]}triggerConfigurationChange(e,t,i){if(e.keys.length){i!==At.DEFAULT&&this.logService.debug(`Configuration keys changed in ${Agt(i)} target`,...e.keys);const n=new cRe(e,t,this._configuration,this.workspace,this.logService);n.source=i,this._onDidChangeConfiguration.fire(n)}}toEditableConfigurationTarget(e,t){if(e===At.APPLICATION)return En.USER_LOCAL;if(e===At.USER){if(this.remoteUserConfiguration){const i=this.configurationRegistry.getConfigurationProperties()[t]?.scope;if(i===ct.MACHINE||i===ct.MACHINE_OVERRIDABLE||this.inspect(t).userRemoteValue!==void 0)return En.USER_REMOTE}return En.USER_LOCAL}return e===At.USER_LOCAL?En.USER_LOCAL:e===At.USER_REMOTE?En.USER_REMOTE:e===At.WORKSPACE?En.WORKSPACE:e===At.WORKSPACE_FOLDER?En.WORKSPACE_FOLDER:null}}let vke=class extends V{constructor(e,t,i,n,r){super(),this.workspaceContextService=e,this.environmentService=t,this.workspaceTrustManagementService=i,n.whenInstalledExtensionsRegistered().then(()=>{this.registerConfigurationSchemas();const o=je.as(Pn.Configuration),a=this._register(new Ph(50));this._register(M.any(o.onDidUpdateConfiguration,o.onDidSchemaChange,i.onDidChangeTrust)(()=>a.trigger(()=>this.registerConfigurationSchemas(),r.phase===Ms.Eventually?void 0:2500)))})}registerConfigurationSchemas(){const e={properties:Tg.properties,patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},t=this.environmentService.remoteAuthority?{properties:Object.assign({},oV.properties,uS.properties,Yv.properties),patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:e,i={properties:Object.assign({},oF.properties,hS.properties,uS.properties,Yv.properties),patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},n={properties:Object.assign({},oF.properties,hS.properties,uS.properties,Yv.properties),patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},r={properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(hS.properties),this.checkAndFilterPropertiesRequiringTrust(uS.properties),this.checkAndFilterPropertiesRequiringTrust(Yv.properties)),patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},o={properties:Object.keys(Tg.properties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Tg.properties[d]),l),{}),patternProperties:Object.keys(Tg.patternProperties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Tg.patternProperties[d]),l),{}),additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},a=Qi.WORKSPACE===this.workspaceContextService.getWorkbenchState()?{properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(hS.properties),this.checkAndFilterPropertiesRequiringTrust(Yv.properties)),patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:r,c={type:"object",description:g(3655,"Contribute defaults for configurations"),properties:Object.assign({},this.filterDefaultOverridableProperties(hS.properties),this.filterDefaultOverridableProperties(uS.properties),this.filterDefaultOverridableProperties(Yv.properties)),patternProperties:{[NE]:{type:"object",default:{},$ref:AE}},additionalProperties:!1};this.registerSchemas({defaultSettingsSchema:o,userSettingsSchema:t,profileSettingsSchema:i,machineSettingsSchema:n,workspaceSettingsSchema:r,folderSettingsSchema:a,configDefaultsSchema:c})}registerSchemas(e){const t=je.as(tE.JSONContribution);t.registerSchema(pei,e.defaultSettingsSchema),t.registerSchema(mei,e.userSettingsSchema),t.registerSchema(_ei,e.profileSettingsSchema),t.registerSchema(vei,e.machineSettingsSchema),t.registerSchema(Xrt,e.workspaceSettingsSchema),t.registerSchema(bei,e.folderSettingsSchema),t.registerSchema(Uqe,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}};vke=D([_(0,Ci),_(1,Xo),_(2,mC),_(3,ps),_(4,rg)],vke);let bke=class extends V{constructor(e,t){super(),e.hasCachedConfigurationDefaultsOverrides()&&t.whenInstalledExtensionsRegistered().then(()=>e.reloadConfiguration(At.DEFAULT))}};bke=D([_(0,Te),_(1,ps)],bke);var i2;let ane=(i2=class extends V{constructor(e){super(),this.workbenchAssignmentService=e,this.processedExperimentalSettings=new Set,this.configurationRegistry=je.as(Pn.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 r=i[n];if(r?.tags?.includes("experimental")&&!this.processedExperimentalSettings.has(n)){this.processedExperimentalSettings.add(n);try{const o=await this.workbenchAssignmentService.getTreatment(`config.${n}`);!Ja(o)&&!Js(o,r.default)&&(t[n]=o)}catch{}}}Object.keys(t).length&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t}])}},i2.ID="workbench.contrib.updateExperimentalSettingsDefaults",i2);ane=D([_(0,SZe)],ane);const aot=je.as(hf.Workbench);aot.registerWorkbenchContribution(vke,Ms.Restored);aot.registerWorkbenchContribution(bke,Ms.Eventually);Ju(ane.ID,ane,Cc.BlockRestore);const Gei=je.as(Pn.Configuration);Gei.registerConfiguration({...eG,properties:{[UC]:{type:"array",description:g(3656,"Configure settings to be applied for all profiles."),default:[],scope:ct.APPLICATION,additionalProperties:!0,uniqueItems:!0}}});class Kei{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 qei({type:e,key:t},this.cacheHome,this.fileService),this.cachedConfigurations.set(i,n)),n}}class qei{constructor({type:e,key:t},i,n){this.fileService=n,this.cachedConfigurationFolderResource=Ft(i,"CachedConfigurations",e,t),this.cachedConfigurationFileResource=Ft(this.cachedConfigurationFolderResource,e==="workspaces"?"workspace.json":"configuration.json"),this.queue=new EI}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,Ge.fromString(e))})}async remove(){try{await this.queue.queue(()=>this.fileService.del(this.cachedConfigurationFolderResource,{recursive:!0,useTrash:!1}))}catch(e){if(e.fileOperationResult!==ji.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 wke=class{constructor(e,t,i,n){this.configurationService=e,this.environmentService=i,this.storageService=n,this.remoteEnvironment=null,t.getEnvironment().then(r=>this.remoteEnvironment=r)}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===ks.Linux||n===ks.Macintosh?` +`},d=vle(s,["folders"],c,l);let h=u9e(s,d);return W2(r.remoteAuthority,fXe(i))&&(h=u9e(h,MJt(h,["remoteAuthority"],l))),h}function Lei(s,e){const t=af(e);if(t&&Array.isArray(t.folders))t.folders=t.folders.filter(i=>sot(i));else throw new Error(`${s} looks like an invalid workspace file.`);return t}function Rei(s){return s.workspace&&typeof s.workspace=="object"&&typeof s.workspace.id=="string"&&typeof s.workspace.configPath=="string"}function Mei(s){return typeof s.folderUri=="string"}function Nei(s){return typeof s.fileUri=="string"}function Pei(s,e){const t={workspaces:[],files:[]};if(s){const i=function(r,o){for(let a=0;a{const o=r.label,a=r.remoteAuthority;Rei(r)?t.workspaces.push({label:o,remoteAuthority:a,workspace:{id:r.workspace.id,configPath:N.parse(r.workspace.configPath)}}):Mei(r)?t.workspaces.push({label:o,remoteAuthority:a,folderUri:N.parse(r.folderUri)}):Nei(r)&&t.files.push({label:o,remoteAuthority:a,fileUri:N.parse(r.fileUri)})})}return t}function Fei(s){const e={entries:[]};for(const t of s.workspaces)Dj(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 oot=Te;var po;(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"})(po||(po={}));class P9e extends Ma{constructor(e,t){super(e),this.code=t}}var En;(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"})(En||(En={}));let mke=class{constructor(e,t,i,n,r,o,a,c,l,d,h,u){this.remoteSettingsResource=e,this.configurationService=t,this.contextService=i,this.userDataProfileService=n,this.userDataProfilesService=r,this.fileService=o,this.textModelResolverService=a,this.textFileService=c,this.notificationService=l,this.preferencesService=d,this.editorService=h,this.uriIdentityService=u,this.queue=new EI}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(r){if(i.donotNotifyError)throw r;await this.onError(r,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 r=this.getFormattingOptions(n.object.textEditorModel);await this.updateConfiguration(e,n.object.textEditorModel,r,t)}finally{n.dispose()}}async updateConfiguration(e,t,i,n){if(this.hasParseErrors(t.getValue(),e))throw this.toConfigurationEditingError(po.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 r=this.getEdits(e,t.getValue(),i)[0];r&&this.applyEditsToBuffer(r,t)&&await this.save(t,e)}async save(e,t){try{await this.textFileService.save(e.uri,{ignoreErrorHandler:!0})}catch(i){throw i.fileOperationResult===ji.FILE_MODIFIED_SINCE?this.toConfigurationEditingError(po.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE,t.target,t):new P9e(g(8749,"Error while writing to {0}. {1}",this.stringifyTarget(t.target),i.message),po.ERROR_INTERNAL)}}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),n=t.getPositionAt(e.offset+e.length),r=new F(i.lineNumber,i.column,n.lineNumber,n.column),o=t.getValueInRange(r);if(e.content!==o){const a=o?es.replace(r,e.content):es.insert(i,e.content);return t.pushEditOperations([new ht(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits({value:e,jsonPath:t},i,n){return t.length?vle(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 po.ERROR_INVALID_CONFIGURATION:this.onInvalidConfigurationError(e,t);break;case po.ERROR_CONFIGURATION_FILE_DIRTY:this.onConfigurationFileDirtyError(e,t,i);break;case po.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===Hf?g(8750,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===fx?g(8751,"Open Launch Configuration"):null;i?this.notificationService.prompt(Ze.Error,e.message,[{label:i,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(Ze.Error,e.message,[{label:g(8752,"Open Settings"),run:()=>this.openSettings(t)}])}onConfigurationFileDirtyError(e,t,i){const n=t.workspaceStandAloneConfigurationKey===Hf?g(8750,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===fx?g(8751,"Open Launch Configuration"):null;n?this.notificationService.prompt(Ze.Error,e.message,[{label:g(8753,"Save and Retry"),run:()=>{const r=t.key?`${t.workspaceStandAloneConfigurationKey}.${t.key}`:t.workspaceStandAloneConfigurationKey;this.writeConfiguration(t.target,{key:r,value:t.value},{handleDirtyFile:"save",scopes:i})}},{label:n,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(Ze.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 En.USER_LOCAL:this.preferencesService.openUserSettings(t);break;case En.USER_REMOTE:this.preferencesService.openRemoteSettings(t);break;case En.WORKSPACE:this.preferencesService.openWorkspaceSettings(t);break;case En.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 P9e(n,e)}toErrorMessage(e,t,i){switch(e){case po.ERROR_POLICY_CONFIGURATION:return g(8754,"Unable to write {0} because it is configured in system policy.",i.key);case po.ERROR_UNKNOWN_KEY:return g(8755,"Unable to write to {0} because {1} is not a registered configuration.",this.stringifyTarget(t),i.key);case po.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 po.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 po.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 po.ERROR_INVALID_USER_TARGET:return g(8759,"Unable to write to User Settings because {0} does not support for global scope.",i.key);case po.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 po.ERROR_INVALID_FOLDER_TARGET:return g(8761,"Unable to write to Folder Settings because no resource is provided.");case po.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 po.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 po.ERROR_INVALID_CONFIGURATION:{if(i.workspaceStandAloneConfigurationKey===Hf)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===fx)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 En.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 En.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 En.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 En.WORKSPACE_FOLDER:{let n="<>";if(i.resource){const r=this.contextService.getWorkspaceFolder(i.resource);r&&(n=r.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 po.ERROR_CONFIGURATION_FILE_DIRTY:{if(i.workspaceStandAloneConfigurationKey===Hf)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===fx)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 En.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 En.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 En.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 En.WORKSPACE_FOLDER:{let n="<>";if(i.resource){const r=this.contextService.getWorkspaceFolder(i.resource);r&&(n=r.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 po.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:if(i.workspaceStandAloneConfigurationKey===Hf)return g(8776,"Unable to write into tasks configuration file because the content of the file is newer.");if(i.workspaceStandAloneConfigurationKey===fx)return g(8777,"Unable to write into launch configuration file because the content of the file is newer.");switch(t){case En.USER_LOCAL:return g(8778,"Unable to write into user settings because the content of the file is newer.");case En.USER_REMOTE:return g(8779,"Unable to write into remote user settings because the content of the file is newer.");case En.WORKSPACE:return g(8780,"Unable to write into workspace settings because the content of the file is newer.");case En.WORKSPACE_FOLDER:return g(8781,"Unable to write into folder settings because the content of the file is newer.")}case po.ERROR_INTERNAL:return g(8782,"Unable to write to {0} because of an internal error.",this.stringifyTarget(t))}}stringifyTarget(e){switch(e){case En.USER_LOCAL:return g(8783,"User Settings");case En.USER_REMOTE:return g(8784,"Remote User Settings");case En.WORKSPACE:return g(8785,"Workspace Settings");case En.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 Hf:return Eei;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 af(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(po.ERROR_POLICY_CONFIGURATION,e,t);const o=je.as(Pn.Configuration).getConfigurationProperties()[t.key]?.scope;if(!t.workspaceStandAloneConfigurationKey&&this.configurationService.keys().default.indexOf(t.key)<0&&!rf.test(t.key)&&t.value!==void 0)throw this.toConfigurationEditingError(po.ERROR_UNKNOWN_KEY,e,t);if(t.workspaceStandAloneConfigurationKey&&t.workspaceStandAloneConfigurationKey!==Hf&&(e===En.USER_LOCAL||e===En.USER_REMOTE))throw this.toConfigurationEditingError(po.ERROR_INVALID_USER_TARGET,e,t);if((e===En.WORKSPACE||e===En.WORKSPACE_FOLDER)&&this.contextService.getWorkbenchState()===Qi.EMPTY)throw this.toConfigurationEditingError(po.ERROR_NO_WORKSPACE_OPENED,e,t);if(e===En.WORKSPACE&&!t.workspaceStandAloneConfigurationKey&&!rf.test(t.key)){if(o===ct.APPLICATION)throw this.toConfigurationEditingError(po.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION,e,t);if(o===ct.MACHINE)throw this.toConfigurationEditingError(po.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE,e,t)}if(e===En.WORKSPACE_FOLDER){if(!t.resource)throw this.toConfigurationEditingError(po.ERROR_INVALID_FOLDER_TARGET,e,t);if(!t.workspaceStandAloneConfigurationKey&&!rf.test(t.key)&&o!==void 0&&!eot.includes(o))throw this.toConfigurationEditingError(po.ERROR_INVALID_FOLDER_CONFIGURATION,e,t)}if(n.overrideIdentifiers?.length&&o!==ct.LANGUAGE_OVERRIDABLE)throw this.toConfigurationEditingError(po.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION,e,t);if(!t.resource)throw this.toConfigurationEditingError(po.ERROR_INVALID_FOLDER_TARGET,e,t);if(i&&this.textFileService.isDirty(t.resource))throw this.toConfigurationEditingError(po.ERROR_CONFIGURATION_FILE_DIRTY,e,t)}getConfigurationEditOperation(e,t,i){if(t.key){const l=e===En.USER_LOCAL?tot:XPe,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,o=je.as(Pn.Configuration).getConfigurationProperties()[n]?.scope;let a=i.overrideIdentifiers?.length?[zqe(i.overrideIdentifiers),n]:[n];if(e===En.USER_LOCAL||e===En.USER_REMOTE)return{key:n,jsonPath:a,value:t.value,resource:this.getConfigurationFileResource(e,n,"",null,o)??void 0,target:e};const c=this.getConfigurationFileResource(e,n,pei,i.resource,o);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,r){if(e===En.USER_LOCAL)return t===Hf?this.userDataProfileService.currentProfile.tasksResource:!this.userDataProfileService.currentProfile.isDefault&&this.configurationService.isSettingAppliedForAllProfiles(t)?this.userDataProfilesService.defaultProfile.settingsResource:this.userDataProfileService.currentProfile.settingsResource;if(e===En.USER_REMOTE)return this.remoteSettingsResource;const o=this.contextService.getWorkbenchState();if(o!==Qi.EMPTY){const a=this.contextService.getWorkspace();if(e===En.WORKSPACE){if(o===Qi.WORKSPACE)return a.configuration??null;if(o===Qi.FOLDER)return a.folders[0].toResource(i)}if(e===En.WORKSPACE_FOLDER&&n){const c=this.contextService.getWorkspaceFolder(n);if(c)return c.toResource(i)}}return null}};mke=D([_(1,oot),_(2,Ci),_(3,pg),_(4,km),_(5,Xt),_(6,pn),_(7,Fr),_(8,wi),_(9,Y6),_(10,ti),_(11,Is)],mke);const DO=class DO extends eXe{constructor(e,t,i){super(i),this.configurationCache=e,this.configurationRegistry=je.as(Pn.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!DA(this.cachedConfigurationDefaultsOverrides)}initializeCachedConfigurationDefaultsOverrides(){return this.initiaizeCachedConfigurationDefaultsOverridesPromise||(this.initiaizeCachedConfigurationDefaultsOverridesPromise=(async()=>{try{if(localStorage.getItem(DO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY)){const e=await this.configurationCache.read(this.cacheKey);e&&(this.cachedConfigurationDefaultsOverrides=JSON.parse(e))}}catch{}this.cachedConfigurationDefaultsOverrides=In(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)!rf.test(i)&&n.value!==void 0&&(e[i]=n.value);try{Object.keys(e).length?(localStorage.setItem(DO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY,"yes"),await this.configurationCache.write(this.cacheKey,JSON.stringify(e))):(localStorage.removeItem(DO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY),await this.configurationCache.remove(this.cacheKey))}catch{}}};DO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY="DefaultOverridesCacheExists";let _ke=DO;class Oei extends TYe{constructor(e,t,i,n){super(e.defaultProfile.settingsResource,{scopes:[ct.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 ln(()=>this.loadConfiguration().then(r=>this._onDidChangeConfiguration.fire(r)),50))}async initialize(){return this.loadConfiguration()}async loadConfiguration(){const e=await super.loadConfiguration(),t=e.getValue(UC),i=Array.isArray(t)?t:[];return this.parseOptions.include||i.length?this.reparse({...this.parseOptions,include:i}):e}}class Bei extends V{get hasTasksLoaded(){return this.userConfiguration.value instanceof one}constructor(e,t,i,n,r,o){super(),this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.fileService=n,this.uriIdentityService=r,this.logService=o,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.userConfiguration=this._register(new yn),this.userConfigurationChangeDisposable=this._register(new yn),this.userConfiguration.value=new TYe(e,this.configurationParseOptions,r.extUri,this.fileService,o),this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule()),this.reloadConfigurationScheduler=this._register(new ln(()=>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?[[Hf,this.tasksResource]]:[],n=new one(t.toString(),this.settingsResource,i,this.configurationParseOptions,this.fileService,this.uriIdentityService,this.logService),r=await n.loadConfiguration(e);return this.userConfiguration.value=n,this.userConfigurationChangeDisposable.value&&(this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),r}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 one extends V{constructor(e,t,i,n,r,o,a){super(),this.settingsResource=t,this.standAloneConfigurationResources=i,this.fileService=r,this.uriIdentityService=o,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(Yo(...this.allResources.map(c=>Yo(this.fileService.watch(o.extUri.dirname(c)),this.fileService.watch(c))))),this._folderSettingsModelParser=new RA(e,a),this._folderSettingsParseOptions=n,this._standAloneConfigurations=[],this._cache=cs.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 r=>Promise.all(r.map(async o=>{try{return(await this.fileService.readFile(o,{atomic:!0})).value.toString()}catch(a){this.logService.trace(`Error while resolving configuration file '${o.toString()}': ${ou(a)}`),a.fileOperationResult!==ji.FILE_NOT_FOUND&&a.fileOperationResult!==ji.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(([,r])=>r))]);return[i,n.map((r,o)=>[this.standAloneConfigurationResources[o][0],r])]}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),Tr.DELETED)))}handleFileOperationEvent(e){return!!((e.isOperation(Ei.CREATE)||e.isOperation(Ei.COPY)||e.isOperation(Ei.DELETE)||e.isOperation(Ei.WRITE))&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,t))||e.isOperation(Ei.DELETE)&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,this.uriIdentityService.extUri.dirname(t))))}}class Wei extends V{constructor(e,t,i,n,r,o){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 Hei(e,t,{scopes:age},o),r.getEnvironment().then(async a=>{if(a){const c=this._register(new dge(a.settingsPath,{scopes:age},this._fileService,n,o));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 dge)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:age})}getRestrictedSettings(){return this._userConfiguration.getRestrictedSettings()}onDidUserConfigurationChange(e){this.updateCache(),this._onDidChangeConfiguration.fire(e)}async updateCache(){if(this._userConfiguration instanceof dge){let e;try{e=await this._userConfiguration.resolveContent()}catch(t){if(t.fileOperationResult!==ji.FILE_NOT_FOUND)return}await this._cachedConfiguration.updateConfiguration(e)}}}class dge extends V{constructor(e,t,i,n,r){super(),this.configurationResource=e,this.fileService=i,this.uriIdentityService=n,this.logService=r,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.fileWatcherDisposable=this._register(new yn),this.directoryWatcherDisposable=this._register(new yn),this.parser=new RA(this.configurationResource.toString(),r),this.parseOptions=t,this._register(i.onDidFilesChange(o=>this.handleFileChangesEvent(o))),this._register(i.onDidRunOperation(o=>this.handleFileOperationEvent(o))),this.reloadConfigurationScheduler=this._register(new ln(()=>this.reload().then(o=>this._onDidChangeConfiguration.fire(o)),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 cs.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,Tr.UPDATED);e.contains(this.configurationResource,Tr.ADDED)?(t=!0,this.onResourceExists(!0)):e.contains(this.configurationResource,Tr.DELETED)&&(t=!0,this.onResourceExists(!1)),t&&this.reloadConfigurationScheduler.schedule()}handleFileOperationEvent(e){(e.isOperation(Ei.CREATE)||e.isOperation(Ei.COPY)||e.isOperation(Ei.DELETE)||e.isOperation(Ei.WRITE))&&this.uriIdentityService.extUri.isEqual(e.resource,this.configurationResource)&&this.reloadConfigurationScheduler.schedule()}onResourceExists(e){e?(this.stopWatchingDirectory(),this.watchResource()):(this.stopWatchingResource(),this.watchDirectory())}}class Hei 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 RA("CachedRemoteUserConfiguration",n),this.parseOptions=i,this.configurationModel=cs.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 Uei 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 Vei(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 eq(this.fileService,this.uriIdentityService,this.logService))),await this.reload()}async reload(){this._workspaceIdentifier&&await this._workspaceConfiguration.load(this._workspaceIdentifier,{scopes:Ej,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:Ej,skipRestricted:this.isUntrusted()}),this.getConfiguration()}getRestrictedSettings(){return this._workspaceConfiguration.getRestrictedSettings()}async waitAndInitialize(e){if(await IYe(e.configPath,this.fileService),!(this._workspaceConfiguration instanceof eq)){const t=this._register(new eq(this.fileService,this.uriIdentityService,this.logService));await t.load(e,{scopes:Ej,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 eq){const e=await this._workspaceConfiguration.resolveContent(this._workspaceIdentifier);await this._cachedConfiguration.updateWorkspace(this._workspaceIdentifier,e)}}}class eq 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 sne("",i),this.workspaceSettings=cs.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(Ei.CREATE)||n.isOperation(Ei.COPY)||n.isOperation(Ei.DELETE)||n.isOperation(Ei.WRITE))&&t.extUri.isEqual(n.resource,this._workspaceIdentifier.configPath)))(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new ln(()=>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 sne(this._workspaceIdentifier.id,this.logService),wt(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 Vei{constructor(e,t){this.configurationCache=e,this.logService=t,this.onDidChange=M.None,this.workspaceConfigurationModelParser=new sne("",t),this.workspaceSettings=cs.createEmptyModel(t)}async load(e,t){try{const i=this.getKey(e),n=await this.configurationCache.read(i),r=JSON.parse(n);r.content&&(this.workspaceConfigurationModelParser=new sne(i.key,this.logService),this.workspaceConfigurationModelParser.parse(r.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 zei{constructor(e,t,i,n,r){this.configurationCache=n,this.logService=r,this.onDidChange=M.None,this.key={type:"folder",key:Hc(Ft(e,t).toString()).toString(16)},this._folderSettingsModelParser=new RA("CachedFolderConfiguration",r),this._folderSettingsParseOptions=i,this._standAloneConfigurations=[],this.configurationModel=cs.createEmptyModel(r)}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===nne)this._folderSettingsModelParser.parse(t[i],this._folderSettingsParseOptions);else{const n=new not(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[nne]=e),t.forEach(([n,r])=>{r&&(i[n]=r)}),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 $ei extends V{constructor(e,t,i,n,r,o,a,c,l){super(),this.workspaceFolder=t,this.workbenchState=n,this.workspaceTrusted=r,this.configurationCache=l,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.scopes=Qi.WORKSPACE===this.workbenchState?eot:Ej,this.configurationFolder=a.extUri.joinPath(t.uri,i),this.cachedFolderConfiguration=new zei(t.uri,i,{scopes:this.scopes,skipRestricted:this.isUntrusted()},l,c),e&&this.configurationCache.needsCaching(t.uri)?(this.folderConfiguration=this.cachedFolderConfiguration,IYe(t.uri,o).then(()=>{this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(o,a,c)),this._register(this.folderConfiguration.onDidChange(d=>this.onDidFolderConfigurationChange())),this.onDidFolderConfigurationChange()})):(this.folderConfiguration=this._register(this.createFileServiceBasedConfiguration(o,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,`${nne}.json`),r=[Hf,fx].map(o=>[o,t.extUri.joinPath(this.configurationFolder,`${o}.json`)]);return new one(this.configurationFolder.toString(),n,r,{scopes:this.scopes,skipRestricted:this.isUntrusted()},e,t,i)}async updateCache(){if(this.configurationCache.needsCaching(this.configurationFolder)&&this.folderConfiguration instanceof one){const[e,t]=await this.folderConfiguration.resolveContents();this.cachedFolderConfiguration.updateConfiguration(e,t)}}}function F9e(s,e){return s.isDefault||s.useDefaultFlags?.settings?e?Aei:void 0:e?Zrt:Sei}class hge extends OYe{constructor(){super(...arguments),this.initialized=!1}}class Gei extends V{get restrictedSettings(){return this._restrictedSettings}constructor({remoteAuthority:e,configurationCache:t},i,n,r,o,a,c,l,d){if(super(),this.userDataProfileService=n,this.userDataProfilesService=r,this.fileService=o,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=je.as(Pn.Configuration),this.initRemoteUserConfigurationBarrier=new jd,this.completeWorkspaceBarrier=new jd,this.defaultConfiguration=this._register(new _ke(t,i,l)),this.policyConfiguration=d instanceof NXe?new l0t:this._register(new mve(this.defaultConfiguration,d,l)),this.configurationCache=t,this._configuration=new R9e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,cs.createEmptyModel(l),cs.createEmptyModel(l),cs.createEmptyModel(l),cs.createEmptyModel(l),new gi,cs.createEmptyModel(l),new gi,this.workspace,l),this.applicationConfigurationDisposables=this._register(new Z),this.createApplicationConfiguration(),this.localUserConfiguration=this._register(new Bei(n.currentProfile.settingsResource,n.currentProfile.tasksResource,{scopes:F9e(n.currentProfile,!!e)},o,c,l)),this.cachedFolderConfigs=new gi,this._register(this.localUserConfiguration.onDidChangeConfiguration(h=>this.onLocalUserConfigurationChanged(h))),e){const h=this.remoteUserConfiguration=this._register(new Wei(e,t,o,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 Uei(t,o,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 EI}createApplicationConfiguration(){this.applicationConfigurationDisposables.clear(),this.userDataProfileService.currentProfile.isDefault||this.userDataProfileService.currentProfile.useDefaultFlags?.settings?this.applicationConfiguration=null:(this.applicationConfiguration=this.applicationConfigurationDisposables.add(this._register(new Oei(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:B_(e)&&(t=e.uri),N.isUri(t)&&this.uriIdentityService.extUri.isEqual(t,this.workspace.folders[0].uri)}case Qi.WORKSPACE:return oA(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,r=this.getWorkspace().folders,o=r.map(a=>a.raw).filter((a,c)=>sot(a)?!this.contains(t,r[c].uri):!0);if(n=r.length!==o.length,e.length){const a=this.getWorkspace().configuration,c=this.uriIdentityService.extUri.dirname(a);r=lge(o,a,this.uriIdentityService.extUri);const l=r.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(ZPe(u,!1,h.name,c,this.uriIdentityService.extUri))}}d.length>0&&(n=!0,typeof i=="number"&&i>=0&&ithis.workspaceConfiguration.setFolders(e,t.get(MI))),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=the(e)?e:the(t)?t:void 0;return this._configuration.getValue(i,n)}async updateValue(e,t,i,n,r){const o=Sgt(i)?i:the(i)?{resource:i.resource,overrideIdentifiers:i.overrideIdentifier?[i.overrideIdentifier]:void 0}:void 0,a=o?n:i,c=a?[a]:[];if(o?.overrideIdentifiers&&(o.overrideIdentifiers=Ya(o.overrideIdentifiers),o.overrideIdentifiers=o.overrideIdentifiers.length?o.overrideIdentifiers:void 0),!c.length){if(o?.overrideIdentifiers&&o.overrideIdentifiers.length>1)throw new Error("Configuration Target is required while updating the value for multiple override identifiers");const l=this.inspect(e,{resource:o?.resource,overrideIdentifier:o?.overrideIdentifiers?o.overrideIdentifiers[0]:void 0});c.push(...this.deriveConfigurationTargets(e,t,l)),Js(t,l.defaultValue)&&c.length===1&&(c[0]===At.USER||c[0]===At.USER_LOCAL)&&(t=void 0)}await er.settled(c.map(l=>this.writeConfigurationValue(e,t,l,o,r)))}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(FYe(e)){await this.reloadWorkspaceFolderConfiguration(e);return}switch(e){case At.DEFAULT:this.reloadDefaultConfiguration();return;case At.USER:{const{local:t,remote:i}=await this.reloadUserConfiguration();await this.loadConfiguration(this._configuration.applicationConfiguration,t,i,!0);return}case At.USER_LOCAL:await this.reloadLocalUserConfiguration();return;case At.USER_REMOTE:await this.reloadRemoteUserConfiguration();return;case At.WORKSPACE:case At.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){ls("code/willInitWorkspaceService");const t=this.initialized;this.initialized=!1;const i=await this.createWorkspace(e);await this.updateWorkspaceAndInitializeConfiguration(i,t),this.checkAndMarkWorkspaceComplete(!1),ls("code/didInitWorkspaceService")}updateWorkspaceTrust(e){if(this.isWorkspaceTrusted!==e){this.isWorkspaceTrusted=e;const t=this._configuration.toData(),i=[];for(const r of this.workspace.folders){const o=this.cachedFolderConfigs.get(r.uri);let a;o&&(a=o.updateWorkspaceTrust(this.isWorkspaceTrusted),this._configuration.updateFolderConfiguration(r.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(r=>n.push(...r)),n=Ya(n),n.length&&this.triggerConfigurationChange({keys:n,overrides:[]},{data:t,workspace:this.workspace},At.WORKSPACE)}}acquireInstantiationService(e){this.instantiationService=e}isSettingAppliedForAllProfiles(e){if(this.configurationRegistry.getConfigurationProperties()[e]?.scope===ct.APPLICATION)return!0;const t=this.getValue(UC)??[];return Array.isArray(t)&&t.includes(e)}async createWorkspace(e){return oA(e)?this.createMultiFolderWorkspace(e):B_(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=lge(this.workspaceConfiguration.getFolders(),t,this.uriIdentityService.extUri),n=e.id,r=new hge(n,i,this.workspaceConfiguration.isTransient(),t,o=>this.uriIdentityService.extUri.ignorePathCasing(o));return r.initialized=this.workspaceConfiguration.initialized,r}createSingleFolderWorkspace(e){const t=new hge(e.id,[rJ(e.uri)],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,t}createEmptyWorkspace(e){const t=new hge(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,r,o=[];if(i?(n=this.getWorkbenchState(),r=this.workspace.configuration?this.workspace.configuration.fsPath:void 0,o=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;(r&&c!==r||a!==n)&&this._onDidChangeWorkspaceName.fire();const l=this.compareFolders(o,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(sF(ri,()=>this.reloadLocalUserConfiguration(!1,this._configuration.localUserConfiguration)))}compareFolders(e,t){const i={added:[],removed:[],changed:[]};i.added=t.filter(n=>!e.some(r=>n.uri.toString()===r.uri.toString()));for(let n=0;n{ls("code/willInitUserConfiguration");const c=await Promise.all([this.localUserConfiguration.initialize(),this.remoteUserConfiguration?this.remoteUserConfiguration.initialize():Promise.resolve(cs.createEmptyModel(this.logService))]);if(this.applicationConfiguration){const l=await i;c[0]=this.localUserConfiguration.reparse({exclude:l.getValue(UC)})}return ls("code/didInitUserConfiguration"),c},[,r,[o,a]]=await Promise.all([t,i,n()]);ls("code/willInitWorkspaceConfiguration"),await this.loadConfiguration(r,o,a,e),ls("code/didInitWorkspaceConfiguration")}reloadDefaultConfiguration(){this.onDefaultConfigurationChanged(this.defaultConfiguration.reload())}async reloadApplicationConfiguration(e){if(!this.applicationConfiguration)return cs.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 cs.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 gi;const r=this.workspace.folders,o=await this.loadFolderConfigurations(r),a=this.getWorkspaceConfigurationModel(o),c=new gi;o.forEach((d,h)=>c.set(r[h].uri,d));const l=this._configuration;if(this._configuration=new R9e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,e,t,i,a,c,cs.createEmptyModel(this.logService),new gi,this.workspace,this.logService),this.initialized=!0,n){const d=this._configuration.compare(l);this.triggerConfigurationChange(d,{data:l.toData(),workspace:this.workspace},At.WORKSPACE)}this.updateRestrictedSettings()}getWorkspaceConfigurationModel(e){switch(this.getWorkbenchState()){case Qi.FOLDER:return e[0];case Qi.WORKSPACE:return this.workspaceConfiguration.getConfiguration();default:return cs.createEmptyModel(this.logService)}}onUserDataProfileChanged(e){e.join((async()=>{const t=[];t.push(this.localUserConfiguration.reset(e.profile.settingsResource,e.profile.tasksResource,{scopes:F9e(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(UC)})),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 r=this.cachedFolderConfigs.get(this.workspace.folders[0].uri);r&&(this._configuration.updateWorkspaceConfiguration(r.reparse()),this._configuration.updateFolderConfiguration(this.workspace.folders[0].uri,r.reparse()))}else{this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.reparseWorkspaceSettings());for(const r of this.workspace.folders){const o=this.cachedFolderConfigs.get(r.uri);o&&this._configuration.updateFolderConfiguration(r.uri,o.reparse())}}this.triggerConfigurationChange(n,{data:i,workspace:this.workspace},At.DEFAULT),this.updateRestrictedSettings()}}onPolicyConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdatePolicyConfiguration(e);this.triggerConfigurationChange(i,t,At.DEFAULT)}onApplicationConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.applicationConfiguration.getValue(UC)??[],n=this._configuration.compareAndUpdateApplicationConfiguration(e),r=this.getValue(UC)??[],o=this.configurationRegistry.getConfigurationProperties(),a=[];for(const c of n.keys)if(o[c]?.scope===ct.APPLICATION){if(a.push(c),c===UC){for(const l of i)r.includes(l)||a.push(l);for(const l of r)i.includes(l)||a.push(l)}}else r.includes(c)&&a.push(c);n.keys=a,n.keys.includes(UC)&&this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse({exclude:r})),this.triggerConfigurationChange(n,t,At.USER)}onLocalUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateLocalUserConfiguration(e);this.triggerConfigurationChange(i,t,At.USER)}onRemoteUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateRemoteUserConfiguration(e);this.triggerConfigurationChange(i,t,At.USER)}async onWorkspaceConfigurationChanged(e){if(this.workspace&&this.workspace.configuration){let t=lge(this.workspaceConfiguration.getFolders(),this.workspace.configuration,this.uriIdentityService.extUri);if(this.workspace.initialized){const{added:i,removed:n,changed:r}=this.compareFolders(this.workspace.folders,t);i.length||n.length||r.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=s0(i,this._restrictedSettings.default,(p,m)=>p.localeCompare(m));e.push(...n.added,...n.removed);const r=(this.applicationConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),o=s0(r,this._restrictedSettings.application||[],(p,m)=>p.localeCompare(m));e.push(...o.added,...o.removed);const a=this.localUserConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)),c=s0(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=s0(l,this._restrictedSettings.userRemote||[],(p,m)=>p.localeCompare(m));e.push(...d.added,...d.removed);const h=new gi;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=s0(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=s0(u,this._restrictedSettings.workspace||[],(p,m)=>p.localeCompare(m));e.push(...f.added,...f.removed),e.length&&(this._restrictedSettings={default:i,application:r.length?r: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},r=this._configuration.compareAndUpdateWorkspaceConfiguration(t),o=this.compareFolders(this.workspace.folders,e);if(o.added.length||o.removed.length||o.changed.length){this.workspace.folders=e;const a=await this.onFoldersChanged();await this.handleWillChangeWorkspaceFolders(o,i),this.triggerConfigurationChange(a,n,At.WORKSPACE_FOLDER),this._onDidChangeWorkspaceFolders.fire(o)}else this.triggerConfigurationChange(r,n,At.WORKSPACE);this.updateRestrictedSettings()}async handleWillChangeWorkspaceFolders(e,t){const i=[];this._onWillChangeWorkspaceFolders.fire({join(n){i.push(n)},changes:e,fromCache:t});try{await er.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 r=this._configuration.compareAndUpdateWorkspaceConfiguration(t);this.triggerConfigurationChange(tWe(n,r),i,At.WORKSPACE)}else this.triggerConfigurationChange(n,i,At.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,r)=>{e.push(this._configuration.compareAndUpdateFolderConfiguration(t[r].uri,n))}),tWe(...e)}loadFolderConfigurations(e){return Promise.all([...e.map(t=>{let i=this.cachedFolderConfigs.get(t.uri);return i||(i=new $ei(!this.initialized,t,yle,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()} - ${Po(n)}`)}t.push(i)}return t}async writeConfigurationValue(e,t,i,n,r){if(!this.instantiationService)throw new Error("Cannot write configuration because the configuration service is not yet ready to accept writes.");if(i===At.DEFAULT)throw new Error("Invalid configuration target");if(i===At.MEMORY){const a={data:this._configuration.toData(),workspace:this.workspace};this._configuration.updateValue(e,t,n),this.triggerConfigurationChange({keys:n?.overrideIdentifiers?.length?[zqe(n.overrideIdentifiers),e]:[e],overrides:n?.overrideIdentifiers?.length?n.overrideIdentifiers.map(c=>[c,[e]]):[]},a,i);return}const o=this.toEditableConfigurationTarget(i,e);if(!o)throw new Error("Invalid configuration target");if(o===En.USER_REMOTE&&!this.remoteUserConfiguration)throw new Error("Invalid configuration target");if(n?.overrideIdentifiers?.length&&n.overrideIdentifiers.length>1){const a=this.getConfigurationModelForEditableConfigurationTarget(o,n.resource);if(a){const c=n.overrideIdentifiers.sort(),l=a.overrides.find(d=>ns([...d.identifiers].sort(),c));l&&(n.overrideIdentifiers=l.identifiers)}}switch(this.configurationEditing=this.configurationEditing??this.createConfigurationEditingService(this.instantiationService),await(await this.configurationEditing).writeConfiguration(o,{key:e,value:t},{scopes:n,...r}),o){case En.USER_LOCAL:this.applicationConfiguration&&this.isSettingAppliedForAllProfiles(e)?await this.reloadApplicationConfiguration():await this.reloadLocalUserConfiguration();return;case En.USER_REMOTE:return this.reloadRemoteUserConfiguration().then(()=>{});case En.WORKSPACE:return this.reloadWorkspaceConfiguration();case En.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(mke,t)}getConfigurationModelForEditableConfigurationTarget(e,t){switch(e){case En.USER_LOCAL:return this._configuration.localUserConfiguration;case En.USER_REMOTE:return this._configuration.remoteUserConfiguration;case En.WORKSPACE:return this._configuration.workspaceConfiguration;case En.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0}}getConfigurationModel(e,t){switch(e){case At.USER_LOCAL:return this._configuration.localUserConfiguration;case At.USER_REMOTE:return this._configuration.remoteUserConfiguration;case At.WORKSPACE:return this._configuration.workspaceConfiguration;case At.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0;default:return}}deriveConfigurationTargets(e,t,i){if(Js(t,i.value))return[];const n=[];return i.workspaceFolderValue!==void 0&&n.push(At.WORKSPACE_FOLDER),i.workspaceValue!==void 0&&n.push(At.WORKSPACE),i.userRemoteValue!==void 0&&n.push(At.USER_REMOTE),i.userLocalValue!==void 0&&n.push(At.USER_LOCAL),i.applicationValue!==void 0&&n.push(At.APPLICATION),t===void 0?n:[n[0]||At.USER]}triggerConfigurationChange(e,t,i){if(e.keys.length){i!==At.DEFAULT&&this.logService.debug(`Configuration keys changed in ${Agt(i)} target`,...e.keys);const n=new cRe(e,t,this._configuration,this.workspace,this.logService);n.source=i,this._onDidChangeConfiguration.fire(n)}}toEditableConfigurationTarget(e,t){if(e===At.APPLICATION)return En.USER_LOCAL;if(e===At.USER){if(this.remoteUserConfiguration){const i=this.configurationRegistry.getConfigurationProperties()[t]?.scope;if(i===ct.MACHINE||i===ct.MACHINE_OVERRIDABLE||this.inspect(t).userRemoteValue!==void 0)return En.USER_REMOTE}return En.USER_LOCAL}return e===At.USER_LOCAL?En.USER_LOCAL:e===At.USER_REMOTE?En.USER_REMOTE:e===At.WORKSPACE?En.WORKSPACE:e===At.WORKSPACE_FOLDER?En.WORKSPACE_FOLDER:null}}let vke=class extends V{constructor(e,t,i,n,r){super(),this.workspaceContextService=e,this.environmentService=t,this.workspaceTrustManagementService=i,n.whenInstalledExtensionsRegistered().then(()=>{this.registerConfigurationSchemas();const o=je.as(Pn.Configuration),a=this._register(new Ph(50));this._register(M.any(o.onDidUpdateConfiguration,o.onDidSchemaChange,i.onDidChangeTrust)(()=>a.trigger(()=>this.registerConfigurationSchemas(),r.phase===Ms.Eventually?void 0:2500)))})}registerConfigurationSchemas(){const e={properties:Tg.properties,patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},t=this.environmentService.remoteAuthority?{properties:Object.assign({},oV.properties,uS.properties,Yv.properties),patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:e,i={properties:Object.assign({},oF.properties,hS.properties,uS.properties,Yv.properties),patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},n={properties:Object.assign({},oF.properties,hS.properties,uS.properties,Yv.properties),patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},r={properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(hS.properties),this.checkAndFilterPropertiesRequiringTrust(uS.properties),this.checkAndFilterPropertiesRequiringTrust(Yv.properties)),patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},o={properties:Object.keys(Tg.properties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Tg.properties[d]),l),{}),patternProperties:Object.keys(Tg.patternProperties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Tg.patternProperties[d]),l),{}),additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},a=Qi.WORKSPACE===this.workspaceContextService.getWorkbenchState()?{properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(hS.properties),this.checkAndFilterPropertiesRequiringTrust(Yv.properties)),patternProperties:Tg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:r,c={type:"object",description:g(3655,"Contribute defaults for configurations"),properties:Object.assign({},this.filterDefaultOverridableProperties(hS.properties),this.filterDefaultOverridableProperties(uS.properties),this.filterDefaultOverridableProperties(Yv.properties)),patternProperties:{[NE]:{type:"object",default:{},$ref:AE}},additionalProperties:!1};this.registerSchemas({defaultSettingsSchema:o,userSettingsSchema:t,profileSettingsSchema:i,machineSettingsSchema:n,workspaceSettingsSchema:r,folderSettingsSchema:a,configDefaultsSchema:c})}registerSchemas(e){const t=je.as(tE.JSONContribution);t.registerSchema(mei,e.defaultSettingsSchema),t.registerSchema(_ei,e.userSettingsSchema),t.registerSchema(vei,e.profileSettingsSchema),t.registerSchema(bei,e.machineSettingsSchema),t.registerSchema(Xrt,e.workspaceSettingsSchema),t.registerSchema(wei,e.folderSettingsSchema),t.registerSchema(Uqe,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}};vke=D([_(0,Ci),_(1,Xo),_(2,mC),_(3,ps),_(4,rg)],vke);let bke=class extends V{constructor(e,t){super(),e.hasCachedConfigurationDefaultsOverrides()&&t.whenInstalledExtensionsRegistered().then(()=>e.reloadConfiguration(At.DEFAULT))}};bke=D([_(0,Te),_(1,ps)],bke);var i2;let ane=(i2=class extends V{constructor(e){super(),this.workbenchAssignmentService=e,this.processedExperimentalSettings=new Set,this.configurationRegistry=je.as(Pn.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 r=i[n];if(r?.tags?.includes("experimental")&&!this.processedExperimentalSettings.has(n)){this.processedExperimentalSettings.add(n);try{const o=await this.workbenchAssignmentService.getTreatment(`config.${n}`);!Ja(o)&&!Js(o,r.default)&&(t[n]=o)}catch{}}}Object.keys(t).length&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t}])}},i2.ID="workbench.contrib.updateExperimentalSettingsDefaults",i2);ane=D([_(0,SZe)],ane);const aot=je.as(hf.Workbench);aot.registerWorkbenchContribution(vke,Ms.Restored);aot.registerWorkbenchContribution(bke,Ms.Eventually);Ju(ane.ID,ane,Cc.BlockRestore);const Kei=je.as(Pn.Configuration);Kei.registerConfiguration({...eG,properties:{[UC]:{type:"array",description:g(3656,"Configure settings to be applied for all profiles."),default:[],scope:ct.APPLICATION,additionalProperties:!0,uniqueItems:!0}}});class qei{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 Qei({type:e,key:t},this.cacheHome,this.fileService),this.cachedConfigurations.set(i,n)),n}}class Qei{constructor({type:e,key:t},i,n){this.fileService=n,this.cachedConfigurationFolderResource=Ft(i,"CachedConfigurations",e,t),this.cachedConfigurationFileResource=Ft(this.cachedConfigurationFolderResource,e==="workspaces"?"workspace.json":"configuration.json"),this.queue=new EI}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,Ge.fromString(e))})}async remove(){try{await this.queue.queue(()=>this.fileService.del(this.cachedConfigurationFolderResource,{recursive:!0,useTrash:!1}))}catch(e){if(e.fileOperationResult!==ji.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 wke=class{constructor(e,t,i,n){this.configurationService=e,this.environmentService=i,this.storageService=n,this.remoteEnvironment=null,t.getEnvironment().then(r=>this.remoteEnvironment=r)}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===ks.Linux||n===ks.Macintosh?` `:`\r -`}getOS(e){let t=pr;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,pr),this.storageService.store(n,t,Ie.WORKSPACE,cn.MACHINE)}return t}};wke=D([_(0,Te),_(1,fg),_(2,Xo),_(3,Gi)],wke);let yke=class extends V{constructor(e,t,i,n,r,o,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=r,this.fileService=o,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:GMe(g(3657,"Save")),title:g(3658,"Save Workspace"),filters:xEt,defaultUri:Ft(await this.fileDialogService.defaultWorkspacePath(),this.getNewWorkspaceName()),availableFileSystems:e});if(t)return Fae(t)||(t=t.with({path:`${t.path}.${Tb}`})),t}getNewWorkspaceName(){const e=this.getCurrentWorkspaceIdentifier()?.configPath;if(e&&__e(e,this.environmentService))return vi(e);const t=um(this.contextService.getWorkspace().folders);return t?`${vi(t.uri)}.${Tb}`:`workspace.${Tb}`}async updateFolders(e,t,i,n){const r=this.contextService.getWorkspace().folders;let o=[];typeof t=="number"&&(o=r.slice(e,e+t).map(d=>d.uri));let a=[];Array.isArray(i)&&(a=i.map(d=>({uri:pOe(d.uri),name:d.name})));const c=o.length>0,l=a.length>0;if(!(!l&&!c))return l&&!c?this.doAddFolders(a,e,n):c&&!l?this.removeFolders(o):this.includesSingleFolderWorkspace(o)?this.createAndEnterWorkspace(a):this.contextService.getWorkbenchState()!==Qi.WORKSPACE?this.doAddFolders(a,e,n):this.doUpdateFolders(a,o,e,n)}async doUpdateFolders(e,t,i,n=!1){try{await this.contextService.updateFolders(e,t,i)}catch(r){if(n)throw r;this.handleWorkspaceConfigurationEditingError(r)}}addFolders(e,t=!1){const i=e.map(n=>({uri:pOe(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 r=this.contextService.getWorkspace().folders.map(o=>({uri:o.uri}));return r.splice(typeof t=="number"?t:r.length,0,...e),r=Ya(r,o=>this.uriIdentityService.extUri.getComparisonKey(o.uri)),n===Qi.EMPTY&&r.length===0||n===Qi.FOLDER&&r.length===1?void 0:this.createAndEnterWorkspace(r)}try{await this.contextService.addFolders(e,t)}catch(r){if(i)throw r;this.handleWorkspaceConfigurationEditingError(r)}}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(Yi(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(!y3(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 r=y3(i,this.environmentService),o=await this.fileService.readFile(i),a=N9e(o.value.toString(),i,r,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:Sn.EXPLICIT});return}if(await this.fileService.exists(t))return;const o=N9e(JSON.stringify({folders:[]},null," "),t,!1,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:o}])}handleWorkspaceConfigurationEditingError(e){switch(e.code){case Y$.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(Ze.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===ct.WINDOW)}copyWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e)}doCopyWorkspaceSettings(e,t){const i=je.as(Pn.Configuration).getConfigurationProperties(),n={};for(const r of this.configurationService.keys().workspace)if(i[r]){if(t&&!t(i[r]))continue;n[r]=this.configurationService.inspect(r).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=JO(this.contextService.getWorkspace());if(oA(e))return e}};yke=D([_(0,MI),_(1,Ci),_(2,oot),_(3,wi),_(4,bi),_(5,Xt),_(6,Fr),_(7,RI),_(8,Xo),_(9,dg),_(10,ir),_(11,Dc),_(12,Is),_(13,mC),_(14,km),_(15,pg)],yke);var ZP,lM;let Cke=(lM=class extends V{constructor(e,t,i,n,r,o){super(),this.storageService=e,this.contextService=t,this.logService=i,this.fileService=n,this.environmentService=r,this.uriIdentityService=o,this._onRecentlyOpenedChange=this._register(new I),this.onDidChangeRecentlyOpened=this._onRecentlyOpenedChange.event,this.addWorkspaceToRecentlyOpened(),this.registerListeners()}registerListeners(){this._register(this.storageService.onDidChangeValue(Ie.APPLICATION,ZP.RECENTLY_OPENED_KEY,this._register(new Z))(()=>this._onRecentlyOpenedChange.fire())),this._register(this.contextService.onDidChangeWorkspaceFolders(e=>this.onDidChangeWorkspaceFolders(e)))}onDidChangeWorkspaceFolders(e){if(Wy(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(ZP.RECENTLY_OPENED_KEY,Ie.APPLICATION);if(e){const t=Nei(JSON.parse(e),this.logService);return t.workspaces=t.workspaces.filter(i=>!(Dj(i)&&i.folderUri.scheme===pe.file&&!Wy(this.contextService.getWorkspace())||kei(i)&&Wy(i.workspace.configPath))),t}return{workspaces:[],files:[]}}async addRecentlyOpened(e){const t=await this.getRecentlyOpened();for(const i of e)Iei(i)?(this.doRemoveRecentlyOpened(t,[i.fileUri]),t.files.unshift(i)):Dj(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()===(Dj(i)?i.folderUri.toString():i.workspace.configPath.toString())))}async saveRecentlyOpened(e){return this.storageService.store(ZP.RECENTLY_OPENED_KEY,JSON.stringify(Pei(e)),Ie.APPLICATION,cn.USER)}async clearRecentlyOpened(){this.storageService.remove(ZP.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=Ft(this.environmentService.untitledWorkspacesHome,`Untitled-${i}.${Tb}`),r=[];if(e)for(const a of e)r.push(ZPe(a.uri,!0,a.name,this.environmentService.untitledWorkspacesHome,this.uriIdentityService.extUri));const o={folders:r,remoteAuthority:t};return await this.fileService.writeFile(n,Ge.fromString(JSON.stringify(o,null," "))),this.getWorkspaceIdentifier(n)}async deleteUntitledWorkspace(e){try{await this.fileService.del(e.configPath)}catch(t){if(t.fileOperationResult!==ji.FILE_NOT_FOUND)throw t}}async getWorkspaceIdentifier(e){return BNe(e)}async getDirtyWorkspaces(){return[]}},ZP=lM,lM.RECENTLY_OPENED_KEY="recently.opened",lM);Cke=ZP=D([_(0,Gi),_(1,Ci),_(2,Ke),_(3,Xt),_(4,Xo),_(5,Is)],Cke);var Vo;(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="/"})(Vo||(Vo={}));class Cg extends Error{constructor(e,t){super(t),this.variable=e}}const x1=class x1{constructor(e,t,i,n){this._contributedVariables=new Map,this._context=e,this._labelService=t,this._userHomePromise=i,n&&(this._envVariablesPromise=n.then(r=>this.prepareEnv(r)))}prepareEnv(e){if(jn){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 r=Ds(t);jn&&r.windows?Object.keys(r.windows).forEach(a=>r[a]=r.windows[a]):jt&&r.osx?Object.keys(r.osx).forEach(a=>r[a]=r.osx[a]):mo&&r.linux&&Object.keys(r.linux).forEach(a=>r[a]=r.linux[a]),delete r.windows,delete r.osx,delete r.linux;const o={env:await this._envVariablesPromise,userHome:await this._userHomePromise};return this.recursiveResolve(o,e?e.uri:void 0,r,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,r){if(Rt(i))return this.resolveString(e,t,i,n,r);if(Array.isArray(i))return Promise.all(i.map(o=>this.recursiveResolve(e,t,o,n,r)));if(In(i)){const o=Object.create(null),a=await Promise.all(Object.keys(i).map(async c=>[await this.resolveString(e,t,c,n,r),await this.recursiveResolve(e,t,i[c],n,r)]));for(const[c,l]of a)o[c]=l;return o}return i}resolveString(e,t,i,n,r){return Nct(i,x1.VARIABLE_REGEXP,async(o,a)=>{if(a.includes(x1.VARIABLE_LHS))return o;let c=await this.evaluateSingleVariable(e,o,a,t,n);return r?.set(a,c),c!==o&&Rt(c)&&c.match(x1.VARIABLE_REGEXP)&&(c=await this.resolveString(e,t,c,n,r)),c})}fsPath(e){return this._labelService?this._labelService.getUriLabel(e,{noPrefix:!0}):e.fsPath}async evaluateSingleVariable(e,t,i,n,r){let o;const a=i.split(":");a.length>1&&(i=a[0],o=a[1]);const c=h=>{const u=this._context.getFilePath();if(u)return Yw(u);throw new Cg(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 Yw(f)}throw new Cg(h,g(4049,"Variable {0}: can not find workspace folder of '{1}'.",t,Kr(u)))},d=h=>{if(o){const u=this._context.getFolderUri(o);if(u)return u;throw new Cg(h,g(4050,"Variable {0} can not be resolved. No such folder '{1}'.",t,o))}if(n)return n;throw this._context.getWorkspaceFolderCount()>1?new Cg(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 Cg(h,g(4052,"Variable {0} can not be resolved. Please open a folder.",t))};switch(i){case"env":if(o){if(e.env){const h=e.env[jn?o.toLowerCase():o];if(Rt(h))return h}return""}throw new Cg(Vo.Env,g(4053,"Variable {0} can not be resolved because no environment variable name is given.",t));case"config":if(o){const h=this._context.getConfigurationValue(n,o);if(aa(h))throw new Cg(Vo.Config,g(4054,"Variable {0} can not be resolved because setting '{1}' not found.",t,o));if(In(h))throw new Cg(Vo.Config,g(4055,"Variable {0} can not be resolved because '{1}' is a structured value.",t,o));return h}throw new Cg(Vo.Config,g(4056,"Variable {0} can not be resolved because no settings name is given.",t));case"command":return this.resolveFromMap(Vo.Command,t,o,r,"command");case"input":return this.resolveFromMap(Vo.Input,t,o,r,"input");case"extensionInstallFolder":if(o){const h=await this._context.getExtension(o);if(!h)throw new Cg(Vo.ExtensionInstallFolder,g(4057,"Variable {0} can not be resolved because the extension {1} is not installed.",t,o));return this.fsPath(h.extensionLocation)}throw new Cg(Vo.ExtensionInstallFolder,g(4058,"Variable {0} can not be resolved because no extension name is given.",t));default:switch(i){case"workspaceRoot":case"workspaceFolder":return Yw(this.fsPath(d(Vo.WorkspaceFolder)));case"cwd":return n||o?Yw(this.fsPath(d(Vo.Cwd))):M2();case"workspaceRootFolderName":case"workspaceFolderBasename":return Yw(Kr(this.fsPath(d(Vo.WorkspaceFolderBasename))));case"userHome":{if(e.userHome)return e.userHome;throw new Cg(Vo.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 Cg(Vo.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 Cg(Vo.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(Vo.File);case"fileWorkspaceFolder":return l(Vo.FileWorkspaceFolder);case"fileWorkspaceFolderBasename":return Kr(l(Vo.FileWorkspaceFolderBasename));case"relativeFile":return n||o?P2(this.fsPath(d(Vo.RelativeFile)),c(Vo.RelativeFile)):c(Vo.RelativeFile);case"relativeFileDirname":{const h=xb(c(Vo.RelativeFileDirname));if(n||o){const u=P2(this.fsPath(d(Vo.RelativeFileDirname)),h);return u.length===0?".":u}return h}case"fileDirname":return xb(c(Vo.FileDirname));case"fileExtname":return jy(c(Vo.FileExtname));case"fileBasename":return Kr(c(Vo.FileBasename));case"fileBasenameNoExtension":{const h=Kr(c(Vo.FileBasenameNoExtension));return h.slice(0,h.length-jy(h).length)}case"fileDirnameBasename":return Kr(xb(c(Vo.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 au;default:try{const h=o?`${i}:${o}`:i;return this.resolveFromMap(Vo.Unknown,t,h,r,void 0)}catch{return t}}}}resolveFromMap(e,t,i,n,r){if(i&&n){const o=r===void 0?n[i]:n[r+":"+i];if(typeof o=="string")return o;throw new Cg(e,g(4062,"Variable {0} can not be resolved because the command has no value.",t))}return t}};x1.VARIABLE_LHS="${",x1.VARIABLE_REGEXP=/\$\{(.*?)\}/g;let cne=x1;const Coe=class Coe extends cne{constructor(e,t,i,n,r,o,a,c,l,d){super({getFolderUri:h=>{const u=o.getWorkspace().folders.filter(f=>f.name===h).pop();return u?u.uri:void 0},getWorkspaceFolderCount:()=>o.getWorkspace().folders.length,getConfigurationValue:(h,u)=>n.getValue(u,h?{resource:h}:{}),getAppRoot:()=>e.getAppRoot(),getExecPath:()=>e.getExecPath(),getFilePath:()=>{const h=Pa.getOriginalUri(i.activeEditor,{supportSideBySide:Us.PRIMARY,filterByScheme:[pe.file,pe.vscodeUserData,this.pathService.defaultUriScheme]});if(h)return this.labelService.getUriLabel(h,{noPrefix:!0})},getWorkspaceFolderPathForFile:()=>{const h=Pa.getOriginalUri(i.activeEditor,{supportSideBySide:Us.PRIMARY,filterByScheme:[pe.file,pe.vscodeUserData,this.pathService.defaultUriScheme]});if(!h)return;const u=o.getWorkspaceFolder(h);if(u)return this.labelService.getUriLabel(u.uri,{noPrefix:!0})},getSelectedText:()=>{const h=i.activeTextEditorControl;let u=null;if(jo(h))u=h;else if(rm(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(jo(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=r,this.workspaceContextService=o,this.quickInputService=a,this.labelService=c,this.pathService=l,this.userInputAccessQueue=new EI}async resolveWithInteractionReplace(e,t,i,n,r){return t=await this.resolveAnyAsync(e,t),this.resolveWithInteraction(e,t,i,n,r).then(o=>o?o.size>0?this.resolveAnyAsync(e,t,Object.fromEntries(o)):t:null)}async resolveWithInteraction(e,t,i,n,r){const o=await this.resolveAnyMap(e,t);t=o.newConfig;const a=o.resolvedVariables;return this.resolveWithInputAndCommands(e,t,n,i,r).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,r){if(!t)return Promise.resolve(void 0);let o=[];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(r){case At.USER:o=d.userValue?.inputs;break;case At.WORKSPACE:o=d.workspaceValue?.inputs;break;default:o=d.workspaceFolderValue?.inputs}else{const h=this.configurationService.getValue(n,l);h&&(o=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,o);break;case"command":{const f=(i?i[h]:void 0)||h;if(u=await this.commandService.executeCommand(f,t),typeof u!="string"&&!aa(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=Coe.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=r=>{throw new Error(g(8789,"Input variable '{0}' is of type '{1}' and must include '{2}'.",e,i.type,r))};switch(i.type){case"promptString":{Rt(i.description)||n("description");const r={prompt:i.description,ignoreFocusLost:!0};return i.default&&(r.value=i.default),i.password&&(r.password=i.password),this.userInputAccessQueue.queue(()=>this.quickInputService.input(r)).then(o=>o)}case"pickString":{if(Rt(i.description)||n("description"),Array.isArray(i.options))for(const a of i.options)!Rt(a)&&!Rt(a.value)&&n("value");else n("options");const r=new Array;for(const a of i.options){const c=Rt(a)?a:a.value,l=Rt(a)?void 0:a.label,d={label:l?`${l}: ${c}`:c,value:c};c===i.default?(d.description=g(8790,"(Default)"),r.unshift(d)):r.push(d)}const o={placeHolder:i.description,matchOnDetail:!0,ignoreFocusLost:!0};return this.userInputAccessQueue.queue(()=>this.quickInputService.pick(r,o,void 0)).then(a=>{if(a)return a.value})}case"command":return Rt(i.command)||n("command"),this.userInputAccessQueue.queue(()=>this.commandService.executeCommand(i.command,i.args)).then(r=>{if(typeof r=="string"||aa(r))return r;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)))}};Coe.INPUT_OR_COMMAND_VARIABLES_PATTERN=/\${((input|command):(.*?))}/g;let Ske=Coe,Ake=class extends Ske{constructor(e,t,i,n,r,o,a,c){super({getAppRoot:()=>{},getExecPath:()=>{}},Promise.resolve(Object.create(null)),e,t,i,n,r,o,a,c)}};Ake=D([_(0,ti),_(1,Te),_(2,bi),_(3,Ci),_(4,Tn),_(5,Os),_(6,Cf),_(7,ps)],Ake);function Qei(){throw new Error("unsupported")}function jei(s){let e=null;return(...t)=>(e==null&&(e=s(...t)),e)}function Yei(s){return new Proxy(s,{construct:jei((e,t)=>Reflect.construct(s,t))})}N.from({scheme:pe.vscodeUserData,path:"/User/settings.json"});je.as(Pn.Configuration);let Eke=class extends $ei{constructor(e,t,i,n,r,o,a,c){const l=new Kei([pe.file,pe.vscodeUserData,pe.tmp],e,n);super({configurationCache:l},e,t,i,n,r,o,a,c)}};Eke=D([_(0,Xo),_(1,pg),_(2,km),_(3,Xt),_(4,fg),_(5,Is),_(6,Ke),_(7,KRe)],Eke);class Jei extends yke{constructor(){super(...arguments),this.enterWorkspace=Qei}}let cot;VNe(async s=>{const e=s.get(Ci);e.acquireInstantiationService(s.get(we));const t=cot??HNe();if(N.isUri(t)){const i=t.with({path:"/workspace.code-workspace"});try{const n=s.get(Xt);await n.createFolder(t),await n.writeFile(i,Ge.fromString(JSON.stringify({folders:[{path:t.path}]})))}catch{}await e.initialize({id:ao(),configPath:i})}else await e.initialize(t)});const O9e=Yei(Eke);function Xei(s){return cot=s,{...Xce(),[Te.toString()]:new yi(O9e,[],!0),[Ci.toString()]:new yi(O9e,[],!0),[xc.toString()]:new yi(fke,[],!0),[oC.toString()]:new yi(Jei,[],!0),[RI.toString()]:new yi(Cke,[],!0),[jTe.toString()]:new yi(wke,[],!0),[RMe.toString()]:new yi(Ake,[],!0)}}let xke=class extends WY{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(jo(e))return e;if(rm(e))return e.getModifiedEditor();const t=this.editorService.activeEditorPane?.getControl();return K2(t)&&jo(t.activeCodeEditor)?t.activeCodeEditor:null}async doOpenCodeEditorFromDiff(e,t,i){const n=this.editorService.activeTextEditorControl;if(!i&&rm(n)&&e.options&&e.resource&&t===n.getModifiedEditor()&&n.getModel()&&Yi(e.resource,n.getModel()?.modified.uri)){const r=n.getModifiedEditor();return $Z(e.options,r,_t.Smooth),r}return null}async doOpenCodeEditor(e,t,i){if(!this.configurationService.getValue().workbench?.editor?.enablePreviewFromCodeNavigation&&t&&!e.options?.pinned&&!i&&!Yi(t.getModel()?.uri,e.resource)){for(const o of this.editorService.visibleEditorPanes)if(m6(o.getControl())===t){o.group.pinEditor();break}}const r=await this.editorService.openEditor(e,i?nv:pA);if(r){const o=r.getControl();if(jo(o))return o;if(K2(o)&&jo(o.activeCodeEditor))return o.activeCodeEditor}return null}};xke=D([_(0,ti),_(1,mn),_(2,Te)],xke);let Dke=class extends V{constructor(e,t,i,n,r){super(),this.untitledTextEditorService=e,this.instantiationService=t,this.uriIdentityService=i,this.fileService=n,this.editorResolverService=r,this.editorInputCache=new gi,this.fileEditorFactory=je.as(rC.EditorFactory).getFileEditorFactory(),this.registerDefaultEditor()}registerDefaultEditor(){this._register(this.editorResolverService.registerEditor("*",{id:lm.id,label:lm.displayName,detail:lm.providerDisplayName,priority:C$.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(Ab(e))return this.createTextEditor(e.result);if(k_(e)){const n=this.createTextEditor(e.original),r=this.createTextEditor(e.modified);return this.instantiationService.createInstance(Yg,e.label,e.description,n,r,void 0)}if(RS(e)){const n=this.createTextEditor(e.primary),r=this.createTextEditor(e.secondary);return this.instantiationService.createInstance(cp,e.label,e.description,r,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 r;return t.resource?.scheme===pe.untitled?r=this.untitledTextEditorService.create({untitledResource:t.resource,...n}):r=this.untitledTextEditorService.create({associatedResource:t.resource,...n}),this.createOrGetCached(r.resource,()=>this.instantiationService.createInstance(L9,r))}const i=e;if(i.resource instanceof N){const n=i.label||vi(i.resource),r=i.resource,o=this.uriIdentityService.asCanonicalUri(r);return this.createOrGetCached(o,()=>i.forceFile||this.fileService.hasProvider(o)?this.fileEditorFactory.createFileEditor(o,r,i.label,i.description,i.encoding,i.languageId,i.contents,this.instantiationService):this.instantiationService.createInstance(WT,o,i.label,i.description,i.languageId,i.contents),a=>{a instanceof L9||(a instanceof WT?(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(r),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)}};Dke=D([_(0,J6),_(1,we),_(2,Is),_(3,Xt),_(4,KU)],Dke);var GV,dM;let kke=(dM=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 sKe,this.editorsPerResourceCounter=new gi,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(tu.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 Dr.GROUP_ACTIVE:{this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1);break}case Dr.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)(()=>wt(t))}onDidChangeEditorPartOptions(e){if(!Js(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 r=this.ensureKey(e,t),o=this.mostRecentEditorsMap.first;i||!o?this.mostRecentEditorsMap.set(r,r,o?ql.AsOld:void 0):(this.mostRecentEditorsMap.set(r,r,ql.AsOld),this.mostRecentEditorsMap.set(o,o,ql.AsOld)),n&&this.updateEditorResourcesMap(t,!0),this._onDidMostRecentlyActiveEditorsChange.fire()}updateEditorResourcesMap(e,t){let i,n,r;if(e instanceof cp?(i=e.primary.resource,n=e.primary.typeId,r=e.primary.editorId):(i=e.resource,n=e.typeId,r=e.editorId),!i)return;const o=this.toIdentifier(n,r);if(t){let a=this.editorsPerResourceCounter.get(i);a||(a=new Map,this.editorsPerResourceCounter.set(i,a)),a.set(o,(a.get(o)??0)+1)}else{const a=this.editorsPerResourceCounter.get(i);if(a){const c=a.get(o)??0;c>1?a.set(o,c-1):(a.delete(o),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(tu.MOST_RECENTLY_ACTIVE).map(r=>({editor:r,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(xi.Scratchpad))):n=t,e>=n.length)return;const r=n.reverse().filter(({editor:c,groupId:l})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(xi.Scratchpad)||i&&c===i.editor&&l===i.groupId||this.editorGroupsContainer.getGroup(l)?.isSticky(c)));let o=n.length-e;const a=new Map;for(const{groupId:c,editor:l}of r){let d=a.get(c);if(d||(d=[],a.set(c,d)),d.push(l),o--,o===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(GV.STORAGE_KEY,Ie.WORKSPACE):this.storageService.store(GV.STORAGE_KEY,JSON.stringify(this.serialize()),Ie.WORKSPACE,cn.MACHINE))}serialize(){const e=je.as(rC.EditorFactory),t=[...this.mostRecentEditorsMap.values()],i=new Map;return{entries:Oi(t.map(({editor:n,groupId:r})=>{const o=this.editorGroupsContainer.getGroup(r);if(!o)return;let a=i.get(o);a||(a=o.getEditors(tu.SEQUENTIAL).filter(l=>e.getEditorSerializer(l)?.canSerialize(l)),i.set(o,a));const c=a.indexOf(n);if(c!==-1)return{groupId:r,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(GV.STORAGE_KEY,Ie.WORKSPACE);t&&(e=!0,this.deserialize(JSON.parse(t)))}if(!e){const t=this.editorGroupsContainer.getGroups(gu.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--){const n=t[i],r=n.getEditors(tu.MOST_RECENTLY_ACTIVE);for(let o=r.length-1;o>=0;o--)this.addMostRecentEditor(n,r[o],!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 r=this.editorGroupsContainer.getGroup(i);if(!r)continue;const o=r.getEditorByIndex(n);if(!o)continue;const a=this.ensureKey(r,o);t.push([a,a]),this.updateEditorResourcesMap(o,!0)}this.mostRecentEditorsMap.fromJSON(t)}},GV=dM,dM.STORAGE_KEY="editors.mru",dM);kke=GV=D([_(1,Pr),_(2,Gi)],kke);function B9e(s,e,t){const i=s.get(Pr),n=s.get(Te),r=Zei(e,t,i,n);return r instanceof Promise?r.then(o=>W9e(o,e,t,i)):W9e(r,e,t,i)}function W9e(s,e,t,i){let n;return i.activeGroup!==s&&e.options&&!e.options.inactive&&e.options.preserveFocus&&typeof e.options.activation!="number"&&t!==nv&&(n=Jk.ACTIVATE),[s,n]}function Zei(s,e,t,i){let n;const r=H5(s)?s.editor:s,o=s.options;if(e&&typeof e!="number")n=e;else if(typeof e=="number"&&e>=0)n=t.getGroup(e);else if(e===nv){const a=QW(i);let c=t.findGroup({direction:a});(!c||tq(c,r))&&(c=t.addGroup(t.activeGroup,a)),n=c}else if(e===u5t)n=t.createAuxiliaryEditorPart().then(a=>a.activeGroup);else if(!o||typeof o.index!="number"){const a=t.getGroups(gu.MOST_RECENTLY_ACTIVE);if(o?.revealIfVisible){for(const c of a)if(eti(c,r)){n=c;break}}if(!n&&(o?.revealIfOpened||i.getValue("workbench.editor.revealIfOpen")||ya(r)&&r.hasCapability(xi.Singleton))){let c,l;for(const d of a)if(lot(d,r)&&(l||(l=d),!c&&d.isActive(r)&&(c=d)),l&&c)break;n=c||l}}if(!n){let a=t.activeGroup;if(tq(a,r)){for(const c of t.getGroups(gu.MOST_RECENTLY_ACTIVE))if(!tq(c,r)){a=c;break}tq(a,r)?n=t.addGroup(a,QW(i)):n=a}else n=a}return n}function tq(s,e){return!(!s.isLocked||lot(s,e))}function eti(s,e){return s.activeEditor?s.activeEditor.matches(e):!1}function lot(s,e){for(const t of s.editors)if(t.matches(e))return!0;return!1}var Ike;let Tke=Ike=class extends V{constructor(e,t,i,n,r,o,a,c,l,d,h){super(),this.editorGroupService=t,this.instantiationService=i,this.fileService=n,this.configurationService=r,this.contextService=o,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 gi,this.closeOnFileDelete=!1,this.editorGroupsContainer=e??t,this.editorsObserver=this._register(this.instantiationService.createInstance(kke,this.editorGroupsContainer)),this.onConfigurationUpdated(),this.registerListeners()}createScoped(e,t){return t.add(new Ike(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)(()=>{wt(t)})}handleVisibleEditorsChange(){const e=new Mk;for(const t of this.visibleEditors){const i=Ya(Oi([Pa.getCanonicalUri(t,{supportSideBySide:Us.PRIMARY}),Pa.getCanonicalUri(t,{supportSideBySide:Us.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)||(wt(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(Ei.MOVE)&&this.handleMovedFile(e.resource,e.target.resource),(e.isOperation(Ei.DELETE)||e.isOperation(Ei.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 r of i.editors){const o=r.resource;if(!o||!this.uriIdentityService.extUri.isEqualOrParent(o,e))continue;let a;if(this.uriIdentityService.extUri.isEqual(e,o))a=t;else{const d=GKe(o.path,e.path,this.uriIdentityService.extUri.ignorePathCasing(o));a=Ft(t,o.path.substr(d+e.path.length+1))}const c=await r.rename(i.id,a);if(!c)return;const l={preserveFocus:!0,pinned:i.isPinned(r),sticky:i.isSticky(r),index:i.getIndexOfEditor(r),inactive:!i.isActive(r)};ya(c.editor)?n.push({editor:r,replacement:c.editor,options:{...c.options,...l}}):n.push({editor:r,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 r=n.resource;if(r&&(this.closeOnFileDelete||!t)){if(i&&this.uriIdentityService.extUri.isEqualOrParent(r,i))return;let o=!1;if(e instanceof iJ?o=e.contains(r,Tr.DELETED):o=this.uriIdentityService.extUri.isEqualOrParent(r,e),!o)return;let a=!1;t&&this.fileService.hasProvider(r)&&(await Ao(100),a=await this.fileService.exists(r)),!a&&!n.isDisposed()&&n.dispose()}})()}getAllNonDirtyEditors(e){const t=[];function i(n){n.hasCapability(xi.Untitled)&&!e.includeUntitled||n.isDirty()||t.push(n)}for(const n of this.editors)e.supportSideBySide&&n instanceof cp?(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(jo(t)||rm(t))return t;if(K2(t)&&jo(t.activeCodeEditor))return t.activeCodeEditor}}get activeTextEditorLanguageId(){let e;const t=this.activeTextEditorControl;return rm(t)?e=t.getModifiedEditor():e=t,e?.getModel()?.getLanguageId()}get count(){return this.editorsObserver.count}get editors(){return this.getEditors(tu.SEQUENTIAL).map(({editor:e})=>e)}getEditors(e,t){switch(e){case tu.MOST_RECENTLY_ACTIVE:return t?.excludeSticky?this.editorsObserver.editors.filter(({groupId:i,editor:n})=>!this.editorGroupsContainer.getGroup(i)?.isSticky(n)):this.editorsObserver.editors;case tu.SEQUENTIAL:{const i=[];for(const n of this.editorGroupsContainer.getGroups(gu.GRID_APPEARANCE))i.push(...n.getEditors(tu.SEQUENTIAL,t).map(r=>({editor:r,groupId:n.id})));return i}}}get activeEditor(){const e=this.editorGroupsContainer.activeGroup;return e?e.activeEditor??void 0:void 0}get visibleEditorPanes(){return Oi(this.editorGroupsContainer.groups.map(e=>e.activeEditorPane))}get visibleTextEditorControls(){const e=[];for(const t of this.visibleEditorPanes){const i=[];t instanceof vSe?(i.push(t.getPrimaryEditorPane()?.getControl()),i.push(t.getSecondaryEditorPane()?.getControl())):i.push(t.getControl());for(const n of i)(jo(n)||rm(n))&&e.push(n)}return e}get visibleEditors(){return Oi(this.editorGroupsContainer.groups.map(e=>e.activeEditor))}async openEditor(e,t,i){let n,r=ya(e)?t:e.options,o;if(Jit(t)&&(i=t),!ya(e)){const a=await this.editorResolverService.resolveEditor(e,i);if(a===pz.ABORT)return;oue(a)&&(n=a.editor,r=a.options,o=a.group)}if(n||(n=ya(e)?e:await this.textEditorService.resolveTextEditor(e)),!o){let a;const c=this.instantiationService.invokeFunction(B9e,{editor:n,options:r},i);c instanceof Promise?[o,a]=await c:[o,a]=c,a&&(r={...r,activation:a})}return o.openEditor(n,r)}async openEditors(e,t,i){if(i?.validateTrust&&!await this.handleWorkspaceTrust(e))return[];const n=new Map;for(const o of e){let a,c;if(!H5(o)){const d=await this.editorResolverService.resolveEditor(o,t);if(d===pz.ABORT)continue;oue(d)&&(a=d,c=d.group)}if(a||(a=H5(o)?o:{editor:await this.textEditorService.resolveTextEditor(o),options:o.options}),!c){const d=this.instantiationService.invokeFunction(B9e,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 r=[];for(const[o,a]of n)r.push(o.openEditors(a));return Oi(await er.settled(r))}async handleWorkspaceTrust(e){const{resources:t,diffMode:i,mergeMode:n}=this.extractEditorResources(e);switch(await this.workspaceTrustRequestService.requestOpenFilesTrust(t)){case Up.Open:return!0;case Up.OpenInNewWindow:return await this.hostService.openWindow(t.map(o=>({fileUri:o})),{forceNewWindow:!0,diffMode:i,mergeMode:n}),!1;case Up.Cancel:return!1}}extractEditorResources(e){const t=new Mk;let i=!1,n=!1;for(const r of e)if(H5(r)){const o=Pa.getOriginalUri(r.editor,{supportSideBySide:Us.BOTH});N.isUri(o)?t.add(o):o&&(o.primary&&t.add(o.primary),o.secondary&&t.add(o.secondary),i=r.editor instanceof Yg)}else Ab(r)&&(N.isUri(r.input1)&&t.add(r.input1.resource),N.isUri(r.input2)&&t.add(r.input2.resource),N.isUri(r.base)&&t.add(r.base.resource),N.isUri(r.result)&&t.add(r.result.resource),n=!0),k_(r)?(N.isUri(r.original.resource)&&t.add(r.original.resource),N.isUri(r.modified.resource)&&t.add(r.modified.resource),i=!0):Jv(r)&&t.add(r.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:r}of e){const o=this.editorGroupsContainer.getGroup(r);if(!o)continue;let a=i.get(o);a||(a=[],i.set(o,a)),a.push(n)}for(const[n,r]of i)await n.closeEditors(r,t)}findEditors(e,t,i){const n=N.isUri(e)?e:e.resource,r=N.isUri(e)?void 0:e.typeId;if(t?.supportSideBySide!==Us.ANY&&t?.supportSideBySide!==Us.SECONDARY&&!this.editorsObserver.hasEditors(n))return N.isUri(e)||Ja(i)?[]:void 0;if(Ja(i)){const o=[];for(const a of this.editorGroupsContainer.getGroups(gu.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)}o.push(...c.map(l=>({editor:l,groupId:a.id})))}return o}else{const o=typeof i=="number"?this.editorGroupsContainer.getGroup(i):i;if(N.isUri(e))return o?o.findEditors(n,t):[];{if(!o)return;const a=o.findEditors(n,t);for(const c of a)if(c.typeId===r)return c;return}}}async replaceEditors(e,t){const i=typeof t=="number"?this.editorGroupsContainer.getGroup(t):t,n=[];for(const r of e){let o;if(!ya(r.replacement)){const a=await this.editorResolverService.resolveEditor(r.replacement,i);if(a===pz.ABORT)continue;oue(a)&&(o={editor:r.editor,replacement:a.editor,options:a.options,forceReplaceDirty:r.forceReplaceDirty})}o||(o={editor:r.editor,replacement:G4e(r)?r.replacement:await this.textEditorService.resolveTextEditor(r.replacement),options:G4e(r)?r.options:r.replacement.options,forceReplaceDirty:r.forceReplaceDirty}),n.push(o)}return i?.replaceEditors(n)}async save(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e),n=[],r=[];if(t?.saveAs)r.push(...i);else for(const{groupId:a,editor:c}of i)c.hasCapability(xi.Untitled)?r.push({groupId:a,editor:c}):n.push({groupId:a,editor:c});const o=await er.settled(n.map(({groupId:a,editor:c})=>(t?.reason===Sn.EXPLICIT&&this.editorGroupsContainer.getGroup(a)?.pinEditor(c),c.save(a,t))));for(const{groupId:a,editor:c}of r){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(o.push(h),!h)break;if(!c.matches(h)){const u=c.hasCapability(xi.Untitled)?this.editorGroupsContainer.groups.map(f=>f.id):[a];for(const f of u)h instanceof Ub?await this.replaceEditors([{editor:c,replacement:h,options:d}],f):await this.replaceEditors([{editor:c,replacement:{...h,options:d}}],f)}}return{success:o.every(a=>!!a),editors:Oi(o)}}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 er.settled(i.map(async({groupId:n,editor:r})=>(this.editorGroupsContainer.getGroup(n)?.pinEditor(r),r.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(gu.MOST_RECENTLY_ACTIVE))for(const n of i.getEditors(tu.MOST_RECENTLY_ACTIVE))n.isModified()&&((typeof e?.includeUntitled=="boolean"||!e?.includeUntitled?.includeScratchpad)&&n.hasCapability(xi.Scratchpad)||!e?.includeUntitled&&n.hasCapability(xi.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(r=>r.editor.matches(i))||t.push({editor:i,groupId:n});return t}dispose(){super.dispose(),this.activeOutOfWorkspaceWatchers.forEach(e=>wt(e)),this.activeOutOfWorkspaceWatchers.clear()}};Tke=Ike=D([_(1,Pr),_(2,we),_(3,Xt),_(4,Te),_(5,Ci),_(6,Is),_(7,KU),_(8,Bae),_(9,Dc),_(10,wce)],Tke);function It(){throw new Error("unsupported")}var Lke;class tti{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=It,this.isTransient=()=>!1,this.windowId=ri.vscodeWindowId,this.createEditorActions=It,this.onDidFocus=M.None,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=It,this.notifyIndexChanged=It,this.relayout=It,this.dispose=It,this.toJSON=It,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=M.None,this.layout=It,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=It,this.openEditor=It,this.openEditors=It,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=It,this.moveEditors=It,this.copyEditor=It,this.copyEditors=It,this.closeEditor=It,this.closeEditors=It,this.closeAllEditors=It,this.replaceEditors=It,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=It,this.isLast=It}get groupsView(){return It()}notifyLabelChanged(){}get titleHeight(){return It()}get element(){return It()}get scopedContextKeyService(){return kt.get(Le)}focus(){}}const r7=new tti;class iti{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=r7,this.scopedContextKeyService=void 0,this.getViewState=It,this.isVisible=It,this.hasFocus=It,this.getId=It,this.getTitle=It,this.focus=It}get minimumWidth(){return Bx.width}get maximumWidth(){return JJ.width}get minimumHeight(){return Bx.height}get maximumHeight(){return JJ.height}getControl(){return this.editor}}function nti(s,e,t){async function i(n,r,o){const a=ya(n)?r:n.options;Jit(r)&&(o=r);const c=Jv(n)||ya(n)?n.resource:void 0;if(c==null||!s.canHandleResource(c))return e(n,r,o);let l;if(l=kt.get(qt).listCodeEditors().find(h=>h instanceof PM&&h.getModel()!=null&&h.getModel().uri.toString()===c.toString()),l==null){const h=await e(n,r,o);if(h!=null)return h;const u=await s.createModelReference(c);if(l=await t?.(u,a,o===nv),l==null){u.dispose();return}}return a!=null&&$Z(a,l,1),(a?.preserveFocus??!1)||(l.focus(),l.getContainerDomNode().scrollIntoView()),new iti(l)}return i}let Rke=class extends Tke{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(void 0,i,n,r,o,a,c,l,d,h,u),this._isEditorPartVisible=t,this.openEditor=nti(f,this.openEditor.bind(this),e)}get activeTextEditorControl(){const e=kt.get(qt).getFocusedCodeEditor();return e!=null&&e instanceof iI?e:super.activeTextEditorControl}async openEditor(e,t,i){if(this._isEditorPartVisible())return super.openEditor(e,t,i)}};Rke=D([_(2,Pr),_(3,we),_(4,Xt),_(5,Te),_(6,Ci),_(7,Is),_(8,KU),_(9,Bae),_(10,Dc),_(11,wce),_(12,pn)],Rke);class H9e{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 lne=Lke=class extends V{constructor(e,t,i){super(),this.editor=e,this.scopedContextKeyService=i,this.active=!1,this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=It,this.isTransient=()=>!1,this.windowId=ri.vscodeWindowId,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.notifyIndexChanged=It,this.relayout=It,this.toJSON=It,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=--Lke.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 WT&&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=It,this.moveEditors=It,this.copyEditor=It,this.copyEditors=It,this.closeEditor=It,this.closeEditors=It,this.closeAllEditors=It,this.replaceEditors=It,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=It,this.isLast=It;const n=a=>{const c=t.createInstance(WT,a,void 0,void 0,void 0,void 0);this._onWillOpenEditor.fire({editor:c,groupId:this.id}),this.pane=new H9e(e,c,this),this._onDidModelChange.fire({kind:5,editor:c,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:c})},r=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:uA.UNKNOWN,editor:c.input,groupId:this.id,index:0,sticky:!1})}};e.onDidChangeModel(a=>{a.oldModelUrl!=null&&r(a.oldModelUrl),a.newModelUrl!=null&&n(a.newModelUrl)}),this._register({dispose:()=>{const a=e.getModel();a!=null&&r(a.uri)}});const o=e.getModel();if(o!=null){const a=t.createInstance(WT,o.uri,void 0,void 0,void 0,void 0);this.pane=new H9e(e,a,this)}}get groupsView(){return It()}notifyLabelChanged(){}createEditorActions(){return{actions:{primary:[],secondary:[]},onDidChange:M.None}}get titleHeight(){return It()}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()}};lne.idCounter=0;lne=Lke=D([_(1,we),_(2,Le)],lne);let Mke=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(r=>r.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=kt.get(qt),r=a=>{if(a instanceof PM){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(lne,a);this.additionalGroups.push(f),this._onDidAddGroup.fire(f)}},o=a=>{if(a instanceof PM){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(r)),this._register(n.onCodeEditorRemove(o)),n.listCodeEditors().forEach(r)})}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}};Mke=D([_(2,we)],Mke);var n2;let dne=(n2=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this.filesConfigurationService=e,this.hostService=t,this.editorService=i,this.editorGroupService=n,this.workingCopyService=r,this.logService=o,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 gi(l=>this.uriIdentityService.extUri.getComparisonKey(l)),this.waitingOnConditionAutoSaveEditors=new gi(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,Ug.ERRORS))),this._register(this.filesConfigurationService.onDidChangeAutoSaveDisabled(e=>this.onConditionChanged([e],Ug.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!==ac.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 r=this.waitingOnConditionAutoSaveEditors.get(i);r?.condition===t&&!r.editor.editor.isDisposed()&&r.editor.editor.isDirty()&&this.filesConfigurationService.getAutoSaveMode(r.editor.editor,r.reason).mode!==ac.OFF&&(this.waitingOnConditionAutoSaveEditors.delete(i),this.logService.info(`[editor auto save] running auto save from condition change event with reason ${r.reason}`),this.editorService.save(r.editor,{reason:r.reason}))}}}onWindowFocusChange(e){e||this.maybeTriggerAutoSave(Sn.WINDOW_CHANGE)}onActiveWindowChange(){this.maybeTriggerAutoSave(Sn.WINDOW_CHANGE)}onDidActiveEditorChange(){this.lastActiveEditor&&typeof this.lastActiveGroupId=="number"&&this.maybeTriggerAutoSave(Sn.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(Sn.FOCUS_CHANGE,{groupId:e.id,editor:t})}))}maybeTriggerAutoSave(e,t){if(t){if(!t.editor.isDirty()||t.editor.isReadonly()||t.editor.hasCapability(xi.Untitled))return;const i=this.filesConfigurationService.getAutoSaveMode(t.editor,e);i.mode!==ac.OFF?(e===Sn.WINDOW_CHANGE&&(i.mode===ac.ON_FOCUS_CHANGE||i.mode===ac.ON_WINDOW_CHANGE)||e===Sn.FOCUS_CHANGE&&i.mode===ac.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===Ug.ERRORS||i.reason===Ug.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 ac.ON_FOCUS_CHANGE:e=Sn.FOCUS_CHANGE;break;case ac.ON_WINDOW_CHANGE:e=Sn.WINDOW_CHANGE;break;case ac.AFTER_SHORT_DELAY:case ac.AFTER_LONG_DELAY:e=Sn.AUTO;break}e&&this.saveAllDirtyAutoSaveables(e)}saveAllDirtyAutoSaveables(e){for(const t of this.workingCopyService.dirtyWorkingCopies){if(t.capabilities&hC.Untitled)continue;const i=this.filesConfigurationService.getAutoSaveMode(t.resource,e);i.mode!==ac.OFF?t.save({reason:e}):(i.reason===Ug.ERRORS||i.reason===Ug.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&hC.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=Sn.AUTO,r=this.filesConfigurationService.getAutoSaveMode(e.resource,n);r.mode!==ac.OFF?(this.logService.trace("[editor auto save] running auto save",e.resource.toString(),e.typeId),e.save({reason:n})):(r.reason===Ug.ERRORS||r.reason===Ug.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(e.resource,{workingCopy:e,reason:n,condition:r.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){wt(this.scheduledAutoSavesAfterDelay.get(e)),this.scheduledAutoSavesAfterDelay.delete(e),this.waitingOnConditionAutoSaveWorkingCopies.delete(e.resource),this.waitingOnConditionAutoSaveEditors.delete(e.resource)}},n2.ID="workbench.contrib.editorAutoSave",n2);dne=D([_(0,bd),_(1,Dc),_(2,ti),_(3,Pr),_(4,Pm),_(5,Ke),_(6,Dm),_(7,Is)],dne);Ju(dne.ID,dne,Cc.BlockRestore);let Nke=class extends BI{constructor(e,t,i){super(),this.resource=e,this.name=t,this.fileService=i,this.mime=Vs.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()}};Nke=D([_(2,Xt)],Nke);var Pke,GE;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Binary=2]="Binary"})(GE||(GE={}));let hne=Pke=class extends gb{get typeId(){return unt}get editorId(){return lm.id}get capabilities(){let e=xi.CanSplitInGroup;return this.model?this.model.isReadonly()&&(e|=xi.Readonly):this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=xi.Readonly):e|=xi.Untitled,e&xi.Readonly||(e|=xi.CanDropIntoEditor),e}constructor(e,t,i,n,r,o,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=GE.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),r&&this.setPreferredEncoding(r),o&&this.setPreferredLanguageId(o),typeof a=="string"&&this.setPreferredContents(a),this._register(this.textFileService.files.onDidCreate(w=>this.onDidCreateTextFileModel(w))),this.model&&this.registerModelListeners(this.model)}onDidCreateTextFileModel(e){Yi(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=GE.Text}setForceOpenAsBinary(){this.forceOpenAs=GE.Binary}isDirty(){return!!this.model?.isDirty()}isSaving(){return this.model?.hasState(ph.SAVED)||this.model?.hasState(ph.CONFLICT)||this.model?.hasState(ph.ERROR)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)?!0:super.isSaving()}prefersEditorPane(e){return this.forceOpenAs===GE.Binary?e.find(t=>t.typeId===bzt):e.find(t=>t.typeId===hnt)}resolve(e){return this.forceOpenAs===GE.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"?Eae(t):void 0,reload:{async:!0},allowBinary:this.forceOpenAs===GE.Text,reason:o9.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===RW.FILE_IS_BINARY)return this.doResolveAsBinary();throw t}}async doResolveAsBinary(){const e=this.instantiationService.createInstance(Nke,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:iB(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:iB(this,e.preserveViewState,this.editorService)}),t}matches(e){return this===e?!0:e instanceof Pke?Yi(e.resource,this.resource):Jv(e)?super.matches(e):!1}dispose(){this.model=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){wt(this.cachedTextFileModelReference),this.cachedTextFileModelReference=void 0}};hne=Pke=D([_(7,we),_(8,Fr),_(9,pn),_(10,Os),_(11,Xt),_(12,bd),_(13,ti),_(14,Cf),_(15,xc),_(16,cE)],hne);je.as(rC.EditorFactory).registerFileEditorFactory({typeId:unt,createFileEditor:(s,e,t,i,n,r,o,a)=>a.createInstance(hne,s,e,t,i,n,r,o),isFileEditor:s=>s instanceof hne});function dot(s){const e=s.get(ug).lastFocusedList,t=e?.getHTMLElement();if(t&&dv(t)&&e instanceof Za){const i=Oi(e.getSelectedElements().filter(a=>a instanceof WZ)),n=e.getFocusedElements(),r=n.length?n[0]:void 0;let o;return r instanceof WZ&&(o=r),i.some(a=>a===o)?i:o?[o]:void 0}}async function eFe(s,e){const t=s.get(Pr),i=s.get(qt),n=s.get(Fr);let r=dot(s);if(!r){const a=t.activeGroup;a.activeEditor&&(r=[],a.activeEditor instanceof cp&&!e?.saveAs&&!(a.activeEditor.primary.hasCapability(xi.Untitled)||a.activeEditor.secondary.hasCapability(xi.Untitled))&&a.activeEditor.secondary.isModified()?(r.push({groupId:a.id,editor:a.activeEditor.primary}),r.push({groupId:a.id,editor:a.activeEditor.secondary})):r.push({groupId:a.id,editor:a.activeEditor}))}if(!r||r.length===0)return;await tFe(s,r,e);const o=i.getFocusedCodeEditor();if(o instanceof uf&&!o.isSimpleWidget){const a=o.getModel()?.uri;a&&!r.some(({editor:c})=>Yi(Pa.getCanonicalUri(c,{supportSideBySide:Us.PRIMARY}),a))&&(n.files.get(a)?.isReadonly()||await n.save(a,e))}}function hot(s,e,t){const i=[];for(const n of e)for(const r of n.getEditors(tu.MOST_RECENTLY_ACTIVE))r.isDirty()&&i.push({groupId:n.id,editor:r});return tFe(s,i,t)}async function tFe(s,e,t){const i=s.get(ti),n=s.get(wi),r=s.get(we);try{await i.save(e,t)}catch(o){Oo(o)||n.notify({id:e.map(({editor:a})=>Hc(a.resource?.toString())).join(),severity:Ze.Error,message:g(3756,"Failed to save '{0}': {1}",e.map(({editor:a})=>a.getName()).join(", "),Po(o,!1)),actions:{primary:[al({id:"workbench.action.files.saveEditors",label:g(3757,"Retry"),run:()=>r.invokeFunction(a=>tFe(a,e,t))}),al({id:"workbench.action.files.revertEditors",label:g(3758,"Discard"),run:()=>i.revert(e)})]}})}}Sr.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.KeyS,id:$Ot,handler:s=>eFe(s,{reason:Sn.EXPLICIT,force:!0})});Sr.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:oo(U.CtrlCmd|S.KeyK,S.KeyS),win:{primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|U.Shift|S.KeyS)},id:GOt,handler:s=>eFe(s,{reason:Sn.EXPLICIT,force:!0,skipSaveParticipants:!0})});Sr.registerCommandAndKeybindingRule({id:zOt,weight:Ae.WorkbenchContrib,when:void 0,primary:U.CtrlCmd|U.Shift|S.KeyS,handler:s=>eFe(s,{reason:Sn.EXPLICIT,saveAs:!0})});Sr.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:void 0,mac:{primary:U.CtrlCmd|U.Alt|S.KeyS},win:{primary:oo(U.CtrlCmd|S.KeyK,S.KeyS)},id:KOt,handler:s=>hot(s,s.get(Pr).getGroups(gu.MOST_RECENTLY_ACTIVE),{reason:Sn.EXPLICIT})});vt.registerCommand({id:ytt,handler:(s,e,t)=>{const i=s.get(Pr),n=Hzt([t],s.get(ti),i,s.get(ug));let r;return n.groupedEditors.length?r=n.groupedEditors.map(({group:o})=>o):r=i.getGroups(gu.MOST_RECENTLY_ACTIVE),hot(s,r,{reason:Sn.EXPLICIT})}});vt.registerCommand({id:qOt,handler:async s=>(await s.get(ti).saveAll({includeUntitled:!1,reason:Sn.EXPLICIT})).success});vt.registerCommand({id:VOt,handler:async s=>{const e=s.get(Pr),t=s.get(ti);let i=dot(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(xi.Untitled)),{force:!0})}catch(n){s.get(wi).error(g(3759,"Failed to revert '{0}': {1}",i.map(({editor:o})=>o.getName()).join(", "),Po(n,!1)))}}});class sti{constructor(){this.hasMaximizedGroup=()=>!1,this.windowId=ri.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=It,this.isLayoutCentered=It,this.enforcePartOptions=It,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=r7,this.groups=[r7],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=It,this.getSize=It,this.setSize=It,this.arrangeGroups=It,this.toggleMaximizeGroup=It,this.toggleExpandGroup=It,this.applyLayout=It,this.getLayout=It,this.setGroupOrientation=It,this.findGroup=()=>{},this.addGroup=It,this.removeGroup=It,this.moveGroup=It,this.mergeGroup=It,this.mergeAllGroups=It,this.copyGroup=It,this.partOptions=cce,this.onDidChangeEditorPartOptions=M.None,this.createEditorDropTarget=It}get contentDimension(){return It()}get sideGroup(){return It()}}class rti{constructor(){this.registerContextKeyProvider=It,this.saveWorkingSet=It,this.getWorkingSets=It,this.applyWorkingSet=It,this.deleteWorkingSet=It,this.onDidCreateAuxiliaryEditorPart=M.None,this.mainPart=new sti,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=It,this.createAuxiliaryEditorPart=It,this.onDidChangeGroupMaximized=M.None,this.toggleMaximizeGroup=It,this.toggleExpandGroup=It,this.partOptions=cce,this.createEditorDropTarget=It,this._serviceBrand=void 0,this.getLayout=It,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=r7,this.groups=[r7],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=It,this.getSize=It,this.setSize=It,this.arrangeGroups=It,this.applyLayout=It,this.centerLayout=It,this.isLayoutCentered=()=>!1,this.setGroupOrientation=It,this.findGroup=()=>{},this.addGroup=It,this.removeGroup=It,this.moveGroup=It,this.mergeGroup=It,this.mergeAllGroups=It,this.copyGroup=It,this.onDidChangeEditorPartOptions=M.None,this.enforcePartOptions=It}get contentDimension(){return It()}get sideGroup(){return It()}}let Fke=class extends Mke{constructor(e){super(e.createInstance(rti),!0,e)}};Fke=D([_(0,we)],Fke);function oti(s){return{[qt.toString()]:new yi(xke,void 0,!0),[ti.toString()]:new yi(Rke,[s,()=>!1],!0),[wce.toString()]:new yi(Dke,[],!1),[Pr.toString()]:new yi(Fke)}}class o7{static _readModifiers(e){e=e.toLowerCase().trim();let t=!1,i=!1,n=!1,r=!1,o;do o=!1,/^ctrl(\+|\-)/.test(e)&&(t=!0,e=e.substr(5),o=!0),/^shift(\+|\-)/.test(e)&&(i=!0,e=e.substr(6),o=!0),/^alt(\+|\-)/.test(e)&&(n=!0,e=e.substr(4),o=!0),/^meta(\+|\-)/.test(e)&&(r=!0,e=e.substr(5),o=!0),/^win(\+|\-)/.test(e)&&(r=!0,e=e.substr(4),o=!0),/^cmd(\+|\-)/.test(e)&&(r=!0,e=e.substr(4),o=!0);while(o);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:r,key:a}}static parseChord(e){const t=this._readModifiers(e),i=t.key.match(/^\[([^\]]+)\]$/);if(i){const r=i[1],o=Gp.lowerCaseToEnum(r);return[new _y(t.ctrl,t.shift,t.alt,t.meta,o),t.remains]}const n=Ta.fromUserSettings(t.key);return[new Lh(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 PO(t):null}}const uot=[{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 JA;(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 r(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=r;const o={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:dTe(uot,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?o:{oneOf:[o,a]}})),additionalProperties:{description:"Submenu",type:"array",items:{oneOf:[o,a]}}},s.submenusContribution={description:g(8633,"Contributes submenu items to the editor"),type:"array",items:c};function l(f,p){return f?Qu(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"&&Qu(f)?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`",m)),!1):typeof f!="string"&&(Qu(f.original)||Qu(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}]}})(JA||(JA={}));const U9e=new Z,got=ih.registerExtensionPoint({extensionPoint:"commands",jsonSchema:JA.commandsContribution,activationEventsGenerator:(s,e)=>{for(const t of s)t.command&&e.push(`onCommand:${t.command}`)}});got.setHandler(s=>{function e(t,i){if(!JA.isValidCommand(t,i.collector))return;const{icon:n,enablement:r,category:o,title:a,shortTitle:c,command:l}=t;let d;n&&(typeof n=="string"?d=He.fromString(n)??{dark:Ft(i.description.extensionLocation,n),light:Ft(i.description.extensionLocation,n)}:d={dark:Ft(i.description.extensionLocation,n.dark),light:Ft(i.description.extensionLocation,n.light)});const h=Yn.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))),U9e.add(Yn.addCommand({id:l,title:a,source:{id:i.description.identifier.value,title:i.description.displayName??i.description.name},shortTitle:c,tooltip:a,category:o,precondition:he.deserialize(r),icon:d}))}U9e.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 kz=new Map,fot=ih.registerExtensionPoint({extensionPoint:"submenus",jsonSchema:JA.submenusContribution});fot.setHandler(s=>{kz.clear();for(const e of s){const{value:t,collector:i}=e;for(const[,n]of Object.entries(t)){if(!JA.isValidSubmenu(n,i))continue;if(!n.id){i.warn(g(8649,"`{0}` is not a valid submenu identifier",n.id));continue}if(kz.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 r;n.icon&&(typeof n.icon=="string"?r=He.fromString(n.icon)||{dark:Ft(e.description.extensionLocation,n.icon)}:r={dark:Ft(e.description.extensionLocation,n.icon.dark),light:Ft(e.description.extensionLocation,n.icon.light)});const o={id:_e.for(`api:${n.id}`),label:n.label,icon:r};kz.set(n.id,o)}}});const ati=new Map(uot.map(s=>[s.key,s])),V9e=new Z,uge=new Map,cti=ih.registerExtensionPoint({extensionPoint:"menus",jsonSchema:JA.menusContribution,deps:[fot]});cti.setHandler(s=>{V9e.clear(),uge.clear();for(const e of s){const{value:t,collector:i}=e;for(const n of Object.entries(t)){if(!JA.isValidItems(n[1],i))continue;let r=ati.get(n[0]);if(!r){const o=kz.get(n[0]);o&&(r={key:n[0],id:o.id,description:""})}if(r){if(r.proposed&&!hl(e.description,r.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],r.proposed,e.description.identifier.value));continue}for(const o of n[1]){let a;if(JA.isMenuItem(o)){const c=Yn.getCommand(o.command),l=o.alt&&Yn.getCommand(o.alt)||void 0;if(!c){i.error(g(8653,"Menu item references a command `{0}` which is not defined in the 'commands' section.",o.command));continue}o.alt&&!l&&i.warn(g(8654,"Menu item references an alt-command `{0}` which is not defined in the 'commands' section.",o.alt)),o.command===o.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(r.supportsSubmenus===!1){i.error(g(8656,"Menu item references a submenu for a menu which doesn't have submenu support."));continue}const c=kz.get(o.submenu);if(!c){i.error(g(8657,"Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",o.submenu));continue}let l=uge.get(r.id.id);if(l||(l=new Set,uge.set(r.id.id,l)),l.has(c.id.id)){i.warn(g(8658,"The `{0}` submenu was already contributed to the `{1}` menu.",o.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(o.group){const c=o.group.lastIndexOf("@");c>0?(a.group=o.group.substr(0,c),a.order=Number(o.group.substr(c+1))||void 0):a.group=o.group}a.when=he.deserialize(o.when),V9e.add(Yn.appendMenuItem(r.id,a))}}}}});let Oke=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=dTe(i,l=>l.id),r=e.contributes?.menus||{};for(const l in r)for(const d of r[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 Nt().appendMarkdown(`\`${l.id}\``),typeof l.title=="string"?l.title:l.title.value,l.keybindings,new Nt().appendMarkdown(`${l.menus.map(d=>`\`${d}\``).join(" ")}`)]);return{data:{headers:a,rows:c},dispose:()=>{}}}resolveKeybinding(e){let t;switch(TKe){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]}};Oke=D([_(0,Vt)],Oke);je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"commands",label:g(8663,"Commands"),access:{canToggle:!1},renderer:new yi(Oke)});class pot{static writeKeybindingItem(e,t){if(!t.resolvedKeybinding)return;const i=JSON.stringify(t.resolvedKeybinding.getUserSettingsLabel());e.write(`{ "key": ${lti(i+",",25)} "command": `);const n=t.when?JSON.stringify(t.when.serialize()):"",r=JSON.stringify(t.command);n.length>0?(e.write(`${r},`),e.writeLine(),e.write(` "when": ${n}`)):e.write(`${r}`),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"?o7.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,r="args"in e&&typeof e.args<"u"?e.args:void 0;return{keybinding:t,command:n,commandArgs:r,when:i,_sourceKey:"key"in e&&typeof e.key=="string"?e.key:void 0}}}function lti(s,e){return s.length{this._keyboardMapper=this.keyboardLayoutService.getKeyboardMapper(),this.updateResolver()})),this._keybindingHoldMode=null,this._cachedResolver=null,this.userKeybindings=this._register(new gti(r,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);Sr.setExtensionKeybindings(f),this.updateResolver()}),this.updateKeybindingsJsonSchema(),this._register(a.onDidRegisterExtensions(()=>this.updateKeybindingsJsonSchema())),this._register(M.runAndSubscribe(sm,({window:u,disposables:f})=>f.add(this._registerKeyListeners(u)),{window:ri,disposables:this._store})),this._register(HKe(u=>{if(u!==ri.vscodeWindowId)return;const f=navigator.keyboard;NO.keyboard!==rD.None&&(xpe(ri)?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 xn(i);this._log(`/ Received keydown event - ${Mdt(i)}`),this._log(`| Converted keydown event - ${Ndt(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 xn(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 lRe.toLabel(pr,e.chords,t=>t instanceof Lh?Ta.toString(t.keyCode):Gp.toString(t.scanCode))||"[null]"}_printResolvedKeybinding(e){return e.getDispatchChords().map(t=>t||"[null]").join(" ")}_printResolvedKeybindings(e,t,i){const r=`${t.padStart(35," ")} => `;if(i.length===0){e.push(`${r}${"[NO BINDING]".padStart(35," ")}`);return}for(const o of i)e.push(`${r}${this._printResolvedKeybinding(o).padStart(35," ")}`)}_dumpResolveKeybindingDebugInfo(){const e=new Set,t=[];t.push("Default Resolved Keybindings (unique only):");for(const i of Sr.getDefaultKeybindings()){if(!i.keybinding)continue;const n=this._printKeybinding(i.keybinding);if(e.has(n))continue;e.add(n);const r=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,n,r)}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 r=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,n,r)}return t.join(` +`}getOS(e){let t=pr;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,pr),this.storageService.store(n,t,Ie.WORKSPACE,cn.MACHINE)}return t}};wke=D([_(0,Te),_(1,fg),_(2,Xo),_(3,Gi)],wke);let yke=class extends V{constructor(e,t,i,n,r,o,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=r,this.fileService=o,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:GMe(g(3657,"Save")),title:g(3658,"Save Workspace"),filters:xEt,defaultUri:Ft(await this.fileDialogService.defaultWorkspacePath(),this.getNewWorkspaceName()),availableFileSystems:e});if(t)return Fae(t)||(t=t.with({path:`${t.path}.${Tb}`})),t}getNewWorkspaceName(){const e=this.getCurrentWorkspaceIdentifier()?.configPath;if(e&&__e(e,this.environmentService))return vi(e);const t=um(this.contextService.getWorkspace().folders);return t?`${vi(t.uri)}.${Tb}`:`workspace.${Tb}`}async updateFolders(e,t,i,n){const r=this.contextService.getWorkspace().folders;let o=[];typeof t=="number"&&(o=r.slice(e,e+t).map(d=>d.uri));let a=[];Array.isArray(i)&&(a=i.map(d=>({uri:pOe(d.uri),name:d.name})));const c=o.length>0,l=a.length>0;if(!(!l&&!c))return l&&!c?this.doAddFolders(a,e,n):c&&!l?this.removeFolders(o):this.includesSingleFolderWorkspace(o)?this.createAndEnterWorkspace(a):this.contextService.getWorkbenchState()!==Qi.WORKSPACE?this.doAddFolders(a,e,n):this.doUpdateFolders(a,o,e,n)}async doUpdateFolders(e,t,i,n=!1){try{await this.contextService.updateFolders(e,t,i)}catch(r){if(n)throw r;this.handleWorkspaceConfigurationEditingError(r)}}addFolders(e,t=!1){const i=e.map(n=>({uri:pOe(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 r=this.contextService.getWorkspace().folders.map(o=>({uri:o.uri}));return r.splice(typeof t=="number"?t:r.length,0,...e),r=Ya(r,o=>this.uriIdentityService.extUri.getComparisonKey(o.uri)),n===Qi.EMPTY&&r.length===0||n===Qi.FOLDER&&r.length===1?void 0:this.createAndEnterWorkspace(r)}try{await this.contextService.addFolders(e,t)}catch(r){if(i)throw r;this.handleWorkspaceConfigurationEditingError(r)}}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(Yi(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(!y3(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 r=y3(i,this.environmentService),o=await this.fileService.readFile(i),a=N9e(o.value.toString(),i,r,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:Sn.EXPLICIT});return}if(await this.fileService.exists(t))return;const o=N9e(JSON.stringify({folders:[]},null," "),t,!1,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:o}])}handleWorkspaceConfigurationEditingError(e){switch(e.code){case Y$.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(Ze.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===ct.WINDOW)}copyWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e)}doCopyWorkspaceSettings(e,t){const i=je.as(Pn.Configuration).getConfigurationProperties(),n={};for(const r of this.configurationService.keys().workspace)if(i[r]){if(t&&!t(i[r]))continue;n[r]=this.configurationService.inspect(r).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=JO(this.contextService.getWorkspace());if(oA(e))return e}};yke=D([_(0,MI),_(1,Ci),_(2,oot),_(3,wi),_(4,bi),_(5,Xt),_(6,Fr),_(7,RI),_(8,Xo),_(9,dg),_(10,ir),_(11,Dc),_(12,Is),_(13,mC),_(14,km),_(15,pg)],yke);var ZP,lM;let Cke=(lM=class extends V{constructor(e,t,i,n,r,o){super(),this.storageService=e,this.contextService=t,this.logService=i,this.fileService=n,this.environmentService=r,this.uriIdentityService=o,this._onRecentlyOpenedChange=this._register(new I),this.onDidChangeRecentlyOpened=this._onRecentlyOpenedChange.event,this.addWorkspaceToRecentlyOpened(),this.registerListeners()}registerListeners(){this._register(this.storageService.onDidChangeValue(Ie.APPLICATION,ZP.RECENTLY_OPENED_KEY,this._register(new Z))(()=>this._onRecentlyOpenedChange.fire())),this._register(this.contextService.onDidChangeWorkspaceFolders(e=>this.onDidChangeWorkspaceFolders(e)))}onDidChangeWorkspaceFolders(e){if(Wy(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(ZP.RECENTLY_OPENED_KEY,Ie.APPLICATION);if(e){const t=Pei(JSON.parse(e),this.logService);return t.workspaces=t.workspaces.filter(i=>!(Dj(i)&&i.folderUri.scheme===pe.file&&!Wy(this.contextService.getWorkspace())||Iei(i)&&Wy(i.workspace.configPath))),t}return{workspaces:[],files:[]}}async addRecentlyOpened(e){const t=await this.getRecentlyOpened();for(const i of e)Tei(i)?(this.doRemoveRecentlyOpened(t,[i.fileUri]),t.files.unshift(i)):Dj(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()===(Dj(i)?i.folderUri.toString():i.workspace.configPath.toString())))}async saveRecentlyOpened(e){return this.storageService.store(ZP.RECENTLY_OPENED_KEY,JSON.stringify(Fei(e)),Ie.APPLICATION,cn.USER)}async clearRecentlyOpened(){this.storageService.remove(ZP.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=Ft(this.environmentService.untitledWorkspacesHome,`Untitled-${i}.${Tb}`),r=[];if(e)for(const a of e)r.push(ZPe(a.uri,!0,a.name,this.environmentService.untitledWorkspacesHome,this.uriIdentityService.extUri));const o={folders:r,remoteAuthority:t};return await this.fileService.writeFile(n,Ge.fromString(JSON.stringify(o,null," "))),this.getWorkspaceIdentifier(n)}async deleteUntitledWorkspace(e){try{await this.fileService.del(e.configPath)}catch(t){if(t.fileOperationResult!==ji.FILE_NOT_FOUND)throw t}}async getWorkspaceIdentifier(e){return BNe(e)}async getDirtyWorkspaces(){return[]}},ZP=lM,lM.RECENTLY_OPENED_KEY="recently.opened",lM);Cke=ZP=D([_(0,Gi),_(1,Ci),_(2,Ke),_(3,Xt),_(4,Xo),_(5,Is)],Cke);var Vo;(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="/"})(Vo||(Vo={}));class Cg extends Error{constructor(e,t){super(t),this.variable=e}}const x1=class x1{constructor(e,t,i,n){this._contributedVariables=new Map,this._context=e,this._labelService=t,this._userHomePromise=i,n&&(this._envVariablesPromise=n.then(r=>this.prepareEnv(r)))}prepareEnv(e){if(jn){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 r=Ds(t);jn&&r.windows?Object.keys(r.windows).forEach(a=>r[a]=r.windows[a]):jt&&r.osx?Object.keys(r.osx).forEach(a=>r[a]=r.osx[a]):mo&&r.linux&&Object.keys(r.linux).forEach(a=>r[a]=r.linux[a]),delete r.windows,delete r.osx,delete r.linux;const o={env:await this._envVariablesPromise,userHome:await this._userHomePromise};return this.recursiveResolve(o,e?e.uri:void 0,r,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,r){if(Rt(i))return this.resolveString(e,t,i,n,r);if(Array.isArray(i))return Promise.all(i.map(o=>this.recursiveResolve(e,t,o,n,r)));if(In(i)){const o=Object.create(null),a=await Promise.all(Object.keys(i).map(async c=>[await this.resolveString(e,t,c,n,r),await this.recursiveResolve(e,t,i[c],n,r)]));for(const[c,l]of a)o[c]=l;return o}return i}resolveString(e,t,i,n,r){return Nct(i,x1.VARIABLE_REGEXP,async(o,a)=>{if(a.includes(x1.VARIABLE_LHS))return o;let c=await this.evaluateSingleVariable(e,o,a,t,n);return r?.set(a,c),c!==o&&Rt(c)&&c.match(x1.VARIABLE_REGEXP)&&(c=await this.resolveString(e,t,c,n,r)),c})}fsPath(e){return this._labelService?this._labelService.getUriLabel(e,{noPrefix:!0}):e.fsPath}async evaluateSingleVariable(e,t,i,n,r){let o;const a=i.split(":");a.length>1&&(i=a[0],o=a[1]);const c=h=>{const u=this._context.getFilePath();if(u)return Yw(u);throw new Cg(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 Yw(f)}throw new Cg(h,g(4049,"Variable {0}: can not find workspace folder of '{1}'.",t,Kr(u)))},d=h=>{if(o){const u=this._context.getFolderUri(o);if(u)return u;throw new Cg(h,g(4050,"Variable {0} can not be resolved. No such folder '{1}'.",t,o))}if(n)return n;throw this._context.getWorkspaceFolderCount()>1?new Cg(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 Cg(h,g(4052,"Variable {0} can not be resolved. Please open a folder.",t))};switch(i){case"env":if(o){if(e.env){const h=e.env[jn?o.toLowerCase():o];if(Rt(h))return h}return""}throw new Cg(Vo.Env,g(4053,"Variable {0} can not be resolved because no environment variable name is given.",t));case"config":if(o){const h=this._context.getConfigurationValue(n,o);if(aa(h))throw new Cg(Vo.Config,g(4054,"Variable {0} can not be resolved because setting '{1}' not found.",t,o));if(In(h))throw new Cg(Vo.Config,g(4055,"Variable {0} can not be resolved because '{1}' is a structured value.",t,o));return h}throw new Cg(Vo.Config,g(4056,"Variable {0} can not be resolved because no settings name is given.",t));case"command":return this.resolveFromMap(Vo.Command,t,o,r,"command");case"input":return this.resolveFromMap(Vo.Input,t,o,r,"input");case"extensionInstallFolder":if(o){const h=await this._context.getExtension(o);if(!h)throw new Cg(Vo.ExtensionInstallFolder,g(4057,"Variable {0} can not be resolved because the extension {1} is not installed.",t,o));return this.fsPath(h.extensionLocation)}throw new Cg(Vo.ExtensionInstallFolder,g(4058,"Variable {0} can not be resolved because no extension name is given.",t));default:switch(i){case"workspaceRoot":case"workspaceFolder":return Yw(this.fsPath(d(Vo.WorkspaceFolder)));case"cwd":return n||o?Yw(this.fsPath(d(Vo.Cwd))):M2();case"workspaceRootFolderName":case"workspaceFolderBasename":return Yw(Kr(this.fsPath(d(Vo.WorkspaceFolderBasename))));case"userHome":{if(e.userHome)return e.userHome;throw new Cg(Vo.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 Cg(Vo.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 Cg(Vo.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(Vo.File);case"fileWorkspaceFolder":return l(Vo.FileWorkspaceFolder);case"fileWorkspaceFolderBasename":return Kr(l(Vo.FileWorkspaceFolderBasename));case"relativeFile":return n||o?P2(this.fsPath(d(Vo.RelativeFile)),c(Vo.RelativeFile)):c(Vo.RelativeFile);case"relativeFileDirname":{const h=xb(c(Vo.RelativeFileDirname));if(n||o){const u=P2(this.fsPath(d(Vo.RelativeFileDirname)),h);return u.length===0?".":u}return h}case"fileDirname":return xb(c(Vo.FileDirname));case"fileExtname":return jy(c(Vo.FileExtname));case"fileBasename":return Kr(c(Vo.FileBasename));case"fileBasenameNoExtension":{const h=Kr(c(Vo.FileBasenameNoExtension));return h.slice(0,h.length-jy(h).length)}case"fileDirnameBasename":return Kr(xb(c(Vo.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 au;default:try{const h=o?`${i}:${o}`:i;return this.resolveFromMap(Vo.Unknown,t,h,r,void 0)}catch{return t}}}}resolveFromMap(e,t,i,n,r){if(i&&n){const o=r===void 0?n[i]:n[r+":"+i];if(typeof o=="string")return o;throw new Cg(e,g(4062,"Variable {0} can not be resolved because the command has no value.",t))}return t}};x1.VARIABLE_LHS="${",x1.VARIABLE_REGEXP=/\$\{(.*?)\}/g;let cne=x1;const Coe=class Coe extends cne{constructor(e,t,i,n,r,o,a,c,l,d){super({getFolderUri:h=>{const u=o.getWorkspace().folders.filter(f=>f.name===h).pop();return u?u.uri:void 0},getWorkspaceFolderCount:()=>o.getWorkspace().folders.length,getConfigurationValue:(h,u)=>n.getValue(u,h?{resource:h}:{}),getAppRoot:()=>e.getAppRoot(),getExecPath:()=>e.getExecPath(),getFilePath:()=>{const h=Fa.getOriginalUri(i.activeEditor,{supportSideBySide:Us.PRIMARY,filterByScheme:[pe.file,pe.vscodeUserData,this.pathService.defaultUriScheme]});if(h)return this.labelService.getUriLabel(h,{noPrefix:!0})},getWorkspaceFolderPathForFile:()=>{const h=Fa.getOriginalUri(i.activeEditor,{supportSideBySide:Us.PRIMARY,filterByScheme:[pe.file,pe.vscodeUserData,this.pathService.defaultUriScheme]});if(!h)return;const u=o.getWorkspaceFolder(h);if(u)return this.labelService.getUriLabel(u.uri,{noPrefix:!0})},getSelectedText:()=>{const h=i.activeTextEditorControl;let u=null;if(jo(h))u=h;else if(rm(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(jo(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=r,this.workspaceContextService=o,this.quickInputService=a,this.labelService=c,this.pathService=l,this.userInputAccessQueue=new EI}async resolveWithInteractionReplace(e,t,i,n,r){return t=await this.resolveAnyAsync(e,t),this.resolveWithInteraction(e,t,i,n,r).then(o=>o?o.size>0?this.resolveAnyAsync(e,t,Object.fromEntries(o)):t:null)}async resolveWithInteraction(e,t,i,n,r){const o=await this.resolveAnyMap(e,t);t=o.newConfig;const a=o.resolvedVariables;return this.resolveWithInputAndCommands(e,t,n,i,r).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,r){if(!t)return Promise.resolve(void 0);let o=[];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(r){case At.USER:o=d.userValue?.inputs;break;case At.WORKSPACE:o=d.workspaceValue?.inputs;break;default:o=d.workspaceFolderValue?.inputs}else{const h=this.configurationService.getValue(n,l);h&&(o=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,o);break;case"command":{const f=(i?i[h]:void 0)||h;if(u=await this.commandService.executeCommand(f,t),typeof u!="string"&&!aa(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=Coe.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=r=>{throw new Error(g(8789,"Input variable '{0}' is of type '{1}' and must include '{2}'.",e,i.type,r))};switch(i.type){case"promptString":{Rt(i.description)||n("description");const r={prompt:i.description,ignoreFocusLost:!0};return i.default&&(r.value=i.default),i.password&&(r.password=i.password),this.userInputAccessQueue.queue(()=>this.quickInputService.input(r)).then(o=>o)}case"pickString":{if(Rt(i.description)||n("description"),Array.isArray(i.options))for(const a of i.options)!Rt(a)&&!Rt(a.value)&&n("value");else n("options");const r=new Array;for(const a of i.options){const c=Rt(a)?a:a.value,l=Rt(a)?void 0:a.label,d={label:l?`${l}: ${c}`:c,value:c};c===i.default?(d.description=g(8790,"(Default)"),r.unshift(d)):r.push(d)}const o={placeHolder:i.description,matchOnDetail:!0,ignoreFocusLost:!0};return this.userInputAccessQueue.queue(()=>this.quickInputService.pick(r,o,void 0)).then(a=>{if(a)return a.value})}case"command":return Rt(i.command)||n("command"),this.userInputAccessQueue.queue(()=>this.commandService.executeCommand(i.command,i.args)).then(r=>{if(typeof r=="string"||aa(r))return r;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)))}};Coe.INPUT_OR_COMMAND_VARIABLES_PATTERN=/\${((input|command):(.*?))}/g;let Ske=Coe,Ake=class extends Ske{constructor(e,t,i,n,r,o,a,c){super({getAppRoot:()=>{},getExecPath:()=>{}},Promise.resolve(Object.create(null)),e,t,i,n,r,o,a,c)}};Ake=D([_(0,ti),_(1,Te),_(2,bi),_(3,Ci),_(4,Tn),_(5,Os),_(6,Cf),_(7,ps)],Ake);function jei(){throw new Error("unsupported")}function Yei(s){let e=null;return(...t)=>(e==null&&(e=s(...t)),e)}function Jei(s){return new Proxy(s,{construct:Yei((e,t)=>Reflect.construct(s,t))})}N.from({scheme:pe.vscodeUserData,path:"/User/settings.json"});je.as(Pn.Configuration);let Eke=class extends Gei{constructor(e,t,i,n,r,o,a,c){const l=new qei([pe.file,pe.vscodeUserData,pe.tmp],e,n);super({configurationCache:l},e,t,i,n,r,o,a,c)}};Eke=D([_(0,Xo),_(1,pg),_(2,km),_(3,Xt),_(4,fg),_(5,Is),_(6,Ke),_(7,KRe)],Eke);class Xei extends yke{constructor(){super(...arguments),this.enterWorkspace=jei}}let cot;VNe(async s=>{const e=s.get(Ci);e.acquireInstantiationService(s.get(we));const t=cot??HNe();if(N.isUri(t)){const i=t.with({path:"/workspace.code-workspace"});try{const n=s.get(Xt);await n.createFolder(t),await n.writeFile(i,Ge.fromString(JSON.stringify({folders:[{path:t.path}]})))}catch{}await e.initialize({id:ao(),configPath:i})}else await e.initialize(t)});const O9e=Jei(Eke);function Zei(s){return cot=s,{...Xce(),[Te.toString()]:new yi(O9e,[],!0),[Ci.toString()]:new yi(O9e,[],!0),[xc.toString()]:new yi(fke,[],!0),[oC.toString()]:new yi(Xei,[],!0),[RI.toString()]:new yi(Cke,[],!0),[jTe.toString()]:new yi(wke,[],!0),[RMe.toString()]:new yi(Ake,[],!0)}}let xke=class extends WY{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(jo(e))return e;if(rm(e))return e.getModifiedEditor();const t=this.editorService.activeEditorPane?.getControl();return K2(t)&&jo(t.activeCodeEditor)?t.activeCodeEditor:null}async doOpenCodeEditorFromDiff(e,t,i){const n=this.editorService.activeTextEditorControl;if(!i&&rm(n)&&e.options&&e.resource&&t===n.getModifiedEditor()&&n.getModel()&&Yi(e.resource,n.getModel()?.modified.uri)){const r=n.getModifiedEditor();return $Z(e.options,r,_t.Smooth),r}return null}async doOpenCodeEditor(e,t,i){if(!this.configurationService.getValue().workbench?.editor?.enablePreviewFromCodeNavigation&&t&&!e.options?.pinned&&!i&&!Yi(t.getModel()?.uri,e.resource)){for(const o of this.editorService.visibleEditorPanes)if(m6(o.getControl())===t){o.group.pinEditor();break}}const r=await this.editorService.openEditor(e,i?nv:pA);if(r){const o=r.getControl();if(jo(o))return o;if(K2(o)&&jo(o.activeCodeEditor))return o.activeCodeEditor}return null}};xke=D([_(0,ti),_(1,mn),_(2,Te)],xke);let Dke=class extends V{constructor(e,t,i,n,r){super(),this.untitledTextEditorService=e,this.instantiationService=t,this.uriIdentityService=i,this.fileService=n,this.editorResolverService=r,this.editorInputCache=new gi,this.fileEditorFactory=je.as(rC.EditorFactory).getFileEditorFactory(),this.registerDefaultEditor()}registerDefaultEditor(){this._register(this.editorResolverService.registerEditor("*",{id:lm.id,label:lm.displayName,detail:lm.providerDisplayName,priority:C$.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(Ab(e))return this.createTextEditor(e.result);if(k_(e)){const n=this.createTextEditor(e.original),r=this.createTextEditor(e.modified);return this.instantiationService.createInstance(Yg,e.label,e.description,n,r,void 0)}if(RS(e)){const n=this.createTextEditor(e.primary),r=this.createTextEditor(e.secondary);return this.instantiationService.createInstance(cp,e.label,e.description,r,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 r;return t.resource?.scheme===pe.untitled?r=this.untitledTextEditorService.create({untitledResource:t.resource,...n}):r=this.untitledTextEditorService.create({associatedResource:t.resource,...n}),this.createOrGetCached(r.resource,()=>this.instantiationService.createInstance(L9,r))}const i=e;if(i.resource instanceof N){const n=i.label||vi(i.resource),r=i.resource,o=this.uriIdentityService.asCanonicalUri(r);return this.createOrGetCached(o,()=>i.forceFile||this.fileService.hasProvider(o)?this.fileEditorFactory.createFileEditor(o,r,i.label,i.description,i.encoding,i.languageId,i.contents,this.instantiationService):this.instantiationService.createInstance(WT,o,i.label,i.description,i.languageId,i.contents),a=>{a instanceof L9||(a instanceof WT?(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(r),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)}};Dke=D([_(0,J6),_(1,we),_(2,Is),_(3,Xt),_(4,KU)],Dke);var GV,dM;let kke=(dM=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 sKe,this.editorsPerResourceCounter=new gi,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(tu.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 Dr.GROUP_ACTIVE:{this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1);break}case Dr.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)(()=>wt(t))}onDidChangeEditorPartOptions(e){if(!Js(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 r=this.ensureKey(e,t),o=this.mostRecentEditorsMap.first;i||!o?this.mostRecentEditorsMap.set(r,r,o?ql.AsOld:void 0):(this.mostRecentEditorsMap.set(r,r,ql.AsOld),this.mostRecentEditorsMap.set(o,o,ql.AsOld)),n&&this.updateEditorResourcesMap(t,!0),this._onDidMostRecentlyActiveEditorsChange.fire()}updateEditorResourcesMap(e,t){let i,n,r;if(e instanceof cp?(i=e.primary.resource,n=e.primary.typeId,r=e.primary.editorId):(i=e.resource,n=e.typeId,r=e.editorId),!i)return;const o=this.toIdentifier(n,r);if(t){let a=this.editorsPerResourceCounter.get(i);a||(a=new Map,this.editorsPerResourceCounter.set(i,a)),a.set(o,(a.get(o)??0)+1)}else{const a=this.editorsPerResourceCounter.get(i);if(a){const c=a.get(o)??0;c>1?a.set(o,c-1):(a.delete(o),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(tu.MOST_RECENTLY_ACTIVE).map(r=>({editor:r,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(xi.Scratchpad))):n=t,e>=n.length)return;const r=n.reverse().filter(({editor:c,groupId:l})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(xi.Scratchpad)||i&&c===i.editor&&l===i.groupId||this.editorGroupsContainer.getGroup(l)?.isSticky(c)));let o=n.length-e;const a=new Map;for(const{groupId:c,editor:l}of r){let d=a.get(c);if(d||(d=[],a.set(c,d)),d.push(l),o--,o===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(GV.STORAGE_KEY,Ie.WORKSPACE):this.storageService.store(GV.STORAGE_KEY,JSON.stringify(this.serialize()),Ie.WORKSPACE,cn.MACHINE))}serialize(){const e=je.as(rC.EditorFactory),t=[...this.mostRecentEditorsMap.values()],i=new Map;return{entries:Oi(t.map(({editor:n,groupId:r})=>{const o=this.editorGroupsContainer.getGroup(r);if(!o)return;let a=i.get(o);a||(a=o.getEditors(tu.SEQUENTIAL).filter(l=>e.getEditorSerializer(l)?.canSerialize(l)),i.set(o,a));const c=a.indexOf(n);if(c!==-1)return{groupId:r,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(GV.STORAGE_KEY,Ie.WORKSPACE);t&&(e=!0,this.deserialize(JSON.parse(t)))}if(!e){const t=this.editorGroupsContainer.getGroups(gu.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--){const n=t[i],r=n.getEditors(tu.MOST_RECENTLY_ACTIVE);for(let o=r.length-1;o>=0;o--)this.addMostRecentEditor(n,r[o],!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 r=this.editorGroupsContainer.getGroup(i);if(!r)continue;const o=r.getEditorByIndex(n);if(!o)continue;const a=this.ensureKey(r,o);t.push([a,a]),this.updateEditorResourcesMap(o,!0)}this.mostRecentEditorsMap.fromJSON(t)}},GV=dM,dM.STORAGE_KEY="editors.mru",dM);kke=GV=D([_(1,Pr),_(2,Gi)],kke);function B9e(s,e,t){const i=s.get(Pr),n=s.get(Te),r=eti(e,t,i,n);return r instanceof Promise?r.then(o=>W9e(o,e,t,i)):W9e(r,e,t,i)}function W9e(s,e,t,i){let n;return i.activeGroup!==s&&e.options&&!e.options.inactive&&e.options.preserveFocus&&typeof e.options.activation!="number"&&t!==nv&&(n=Jk.ACTIVATE),[s,n]}function eti(s,e,t,i){let n;const r=H5(s)?s.editor:s,o=s.options;if(e&&typeof e!="number")n=e;else if(typeof e=="number"&&e>=0)n=t.getGroup(e);else if(e===nv){const a=QW(i);let c=t.findGroup({direction:a});(!c||tq(c,r))&&(c=t.addGroup(t.activeGroup,a)),n=c}else if(e===u5t)n=t.createAuxiliaryEditorPart().then(a=>a.activeGroup);else if(!o||typeof o.index!="number"){const a=t.getGroups(gu.MOST_RECENTLY_ACTIVE);if(o?.revealIfVisible){for(const c of a)if(tti(c,r)){n=c;break}}if(!n&&(o?.revealIfOpened||i.getValue("workbench.editor.revealIfOpen")||ya(r)&&r.hasCapability(xi.Singleton))){let c,l;for(const d of a)if(lot(d,r)&&(l||(l=d),!c&&d.isActive(r)&&(c=d)),l&&c)break;n=c||l}}if(!n){let a=t.activeGroup;if(tq(a,r)){for(const c of t.getGroups(gu.MOST_RECENTLY_ACTIVE))if(!tq(c,r)){a=c;break}tq(a,r)?n=t.addGroup(a,QW(i)):n=a}else n=a}return n}function tq(s,e){return!(!s.isLocked||lot(s,e))}function tti(s,e){return s.activeEditor?s.activeEditor.matches(e):!1}function lot(s,e){for(const t of s.editors)if(t.matches(e))return!0;return!1}var Ike;let Tke=Ike=class extends V{constructor(e,t,i,n,r,o,a,c,l,d,h){super(),this.editorGroupService=t,this.instantiationService=i,this.fileService=n,this.configurationService=r,this.contextService=o,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 gi,this.closeOnFileDelete=!1,this.editorGroupsContainer=e??t,this.editorsObserver=this._register(this.instantiationService.createInstance(kke,this.editorGroupsContainer)),this.onConfigurationUpdated(),this.registerListeners()}createScoped(e,t){return t.add(new Ike(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)(()=>{wt(t)})}handleVisibleEditorsChange(){const e=new Mk;for(const t of this.visibleEditors){const i=Ya(Oi([Fa.getCanonicalUri(t,{supportSideBySide:Us.PRIMARY}),Fa.getCanonicalUri(t,{supportSideBySide:Us.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)||(wt(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(Ei.MOVE)&&this.handleMovedFile(e.resource,e.target.resource),(e.isOperation(Ei.DELETE)||e.isOperation(Ei.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 r of i.editors){const o=r.resource;if(!o||!this.uriIdentityService.extUri.isEqualOrParent(o,e))continue;let a;if(this.uriIdentityService.extUri.isEqual(e,o))a=t;else{const d=GKe(o.path,e.path,this.uriIdentityService.extUri.ignorePathCasing(o));a=Ft(t,o.path.substr(d+e.path.length+1))}const c=await r.rename(i.id,a);if(!c)return;const l={preserveFocus:!0,pinned:i.isPinned(r),sticky:i.isSticky(r),index:i.getIndexOfEditor(r),inactive:!i.isActive(r)};ya(c.editor)?n.push({editor:r,replacement:c.editor,options:{...c.options,...l}}):n.push({editor:r,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 r=n.resource;if(r&&(this.closeOnFileDelete||!t)){if(i&&this.uriIdentityService.extUri.isEqualOrParent(r,i))return;let o=!1;if(e instanceof iJ?o=e.contains(r,Tr.DELETED):o=this.uriIdentityService.extUri.isEqualOrParent(r,e),!o)return;let a=!1;t&&this.fileService.hasProvider(r)&&(await Ao(100),a=await this.fileService.exists(r)),!a&&!n.isDisposed()&&n.dispose()}})()}getAllNonDirtyEditors(e){const t=[];function i(n){n.hasCapability(xi.Untitled)&&!e.includeUntitled||n.isDirty()||t.push(n)}for(const n of this.editors)e.supportSideBySide&&n instanceof cp?(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(jo(t)||rm(t))return t;if(K2(t)&&jo(t.activeCodeEditor))return t.activeCodeEditor}}get activeTextEditorLanguageId(){let e;const t=this.activeTextEditorControl;return rm(t)?e=t.getModifiedEditor():e=t,e?.getModel()?.getLanguageId()}get count(){return this.editorsObserver.count}get editors(){return this.getEditors(tu.SEQUENTIAL).map(({editor:e})=>e)}getEditors(e,t){switch(e){case tu.MOST_RECENTLY_ACTIVE:return t?.excludeSticky?this.editorsObserver.editors.filter(({groupId:i,editor:n})=>!this.editorGroupsContainer.getGroup(i)?.isSticky(n)):this.editorsObserver.editors;case tu.SEQUENTIAL:{const i=[];for(const n of this.editorGroupsContainer.getGroups(gu.GRID_APPEARANCE))i.push(...n.getEditors(tu.SEQUENTIAL,t).map(r=>({editor:r,groupId:n.id})));return i}}}get activeEditor(){const e=this.editorGroupsContainer.activeGroup;return e?e.activeEditor??void 0:void 0}get visibleEditorPanes(){return Oi(this.editorGroupsContainer.groups.map(e=>e.activeEditorPane))}get visibleTextEditorControls(){const e=[];for(const t of this.visibleEditorPanes){const i=[];t instanceof vSe?(i.push(t.getPrimaryEditorPane()?.getControl()),i.push(t.getSecondaryEditorPane()?.getControl())):i.push(t.getControl());for(const n of i)(jo(n)||rm(n))&&e.push(n)}return e}get visibleEditors(){return Oi(this.editorGroupsContainer.groups.map(e=>e.activeEditor))}async openEditor(e,t,i){let n,r=ya(e)?t:e.options,o;if(Jit(t)&&(i=t),!ya(e)){const a=await this.editorResolverService.resolveEditor(e,i);if(a===pz.ABORT)return;oue(a)&&(n=a.editor,r=a.options,o=a.group)}if(n||(n=ya(e)?e:await this.textEditorService.resolveTextEditor(e)),!o){let a;const c=this.instantiationService.invokeFunction(B9e,{editor:n,options:r},i);c instanceof Promise?[o,a]=await c:[o,a]=c,a&&(r={...r,activation:a})}return o.openEditor(n,r)}async openEditors(e,t,i){if(i?.validateTrust&&!await this.handleWorkspaceTrust(e))return[];const n=new Map;for(const o of e){let a,c;if(!H5(o)){const d=await this.editorResolverService.resolveEditor(o,t);if(d===pz.ABORT)continue;oue(d)&&(a=d,c=d.group)}if(a||(a=H5(o)?o:{editor:await this.textEditorService.resolveTextEditor(o),options:o.options}),!c){const d=this.instantiationService.invokeFunction(B9e,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 r=[];for(const[o,a]of n)r.push(o.openEditors(a));return Oi(await er.settled(r))}async handleWorkspaceTrust(e){const{resources:t,diffMode:i,mergeMode:n}=this.extractEditorResources(e);switch(await this.workspaceTrustRequestService.requestOpenFilesTrust(t)){case Up.Open:return!0;case Up.OpenInNewWindow:return await this.hostService.openWindow(t.map(o=>({fileUri:o})),{forceNewWindow:!0,diffMode:i,mergeMode:n}),!1;case Up.Cancel:return!1}}extractEditorResources(e){const t=new Mk;let i=!1,n=!1;for(const r of e)if(H5(r)){const o=Fa.getOriginalUri(r.editor,{supportSideBySide:Us.BOTH});N.isUri(o)?t.add(o):o&&(o.primary&&t.add(o.primary),o.secondary&&t.add(o.secondary),i=r.editor instanceof Yg)}else Ab(r)&&(N.isUri(r.input1)&&t.add(r.input1.resource),N.isUri(r.input2)&&t.add(r.input2.resource),N.isUri(r.base)&&t.add(r.base.resource),N.isUri(r.result)&&t.add(r.result.resource),n=!0),k_(r)?(N.isUri(r.original.resource)&&t.add(r.original.resource),N.isUri(r.modified.resource)&&t.add(r.modified.resource),i=!0):Jv(r)&&t.add(r.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:r}of e){const o=this.editorGroupsContainer.getGroup(r);if(!o)continue;let a=i.get(o);a||(a=[],i.set(o,a)),a.push(n)}for(const[n,r]of i)await n.closeEditors(r,t)}findEditors(e,t,i){const n=N.isUri(e)?e:e.resource,r=N.isUri(e)?void 0:e.typeId;if(t?.supportSideBySide!==Us.ANY&&t?.supportSideBySide!==Us.SECONDARY&&!this.editorsObserver.hasEditors(n))return N.isUri(e)||Ja(i)?[]:void 0;if(Ja(i)){const o=[];for(const a of this.editorGroupsContainer.getGroups(gu.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)}o.push(...c.map(l=>({editor:l,groupId:a.id})))}return o}else{const o=typeof i=="number"?this.editorGroupsContainer.getGroup(i):i;if(N.isUri(e))return o?o.findEditors(n,t):[];{if(!o)return;const a=o.findEditors(n,t);for(const c of a)if(c.typeId===r)return c;return}}}async replaceEditors(e,t){const i=typeof t=="number"?this.editorGroupsContainer.getGroup(t):t,n=[];for(const r of e){let o;if(!ya(r.replacement)){const a=await this.editorResolverService.resolveEditor(r.replacement,i);if(a===pz.ABORT)continue;oue(a)&&(o={editor:r.editor,replacement:a.editor,options:a.options,forceReplaceDirty:r.forceReplaceDirty})}o||(o={editor:r.editor,replacement:G4e(r)?r.replacement:await this.textEditorService.resolveTextEditor(r.replacement),options:G4e(r)?r.options:r.replacement.options,forceReplaceDirty:r.forceReplaceDirty}),n.push(o)}return i?.replaceEditors(n)}async save(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e),n=[],r=[];if(t?.saveAs)r.push(...i);else for(const{groupId:a,editor:c}of i)c.hasCapability(xi.Untitled)?r.push({groupId:a,editor:c}):n.push({groupId:a,editor:c});const o=await er.settled(n.map(({groupId:a,editor:c})=>(t?.reason===Sn.EXPLICIT&&this.editorGroupsContainer.getGroup(a)?.pinEditor(c),c.save(a,t))));for(const{groupId:a,editor:c}of r){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(o.push(h),!h)break;if(!c.matches(h)){const u=c.hasCapability(xi.Untitled)?this.editorGroupsContainer.groups.map(f=>f.id):[a];for(const f of u)h instanceof Ub?await this.replaceEditors([{editor:c,replacement:h,options:d}],f):await this.replaceEditors([{editor:c,replacement:{...h,options:d}}],f)}}return{success:o.every(a=>!!a),editors:Oi(o)}}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 er.settled(i.map(async({groupId:n,editor:r})=>(this.editorGroupsContainer.getGroup(n)?.pinEditor(r),r.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(gu.MOST_RECENTLY_ACTIVE))for(const n of i.getEditors(tu.MOST_RECENTLY_ACTIVE))n.isModified()&&((typeof e?.includeUntitled=="boolean"||!e?.includeUntitled?.includeScratchpad)&&n.hasCapability(xi.Scratchpad)||!e?.includeUntitled&&n.hasCapability(xi.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(r=>r.editor.matches(i))||t.push({editor:i,groupId:n});return t}dispose(){super.dispose(),this.activeOutOfWorkspaceWatchers.forEach(e=>wt(e)),this.activeOutOfWorkspaceWatchers.clear()}};Tke=Ike=D([_(1,Pr),_(2,we),_(3,Xt),_(4,Te),_(5,Ci),_(6,Is),_(7,KU),_(8,Bae),_(9,Dc),_(10,wce)],Tke);function It(){throw new Error("unsupported")}var Lke;class iti{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=It,this.isTransient=()=>!1,this.windowId=ri.vscodeWindowId,this.createEditorActions=It,this.onDidFocus=M.None,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=It,this.notifyIndexChanged=It,this.relayout=It,this.dispose=It,this.toJSON=It,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=M.None,this.layout=It,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=It,this.openEditor=It,this.openEditors=It,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=It,this.moveEditors=It,this.copyEditor=It,this.copyEditors=It,this.closeEditor=It,this.closeEditors=It,this.closeAllEditors=It,this.replaceEditors=It,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=It,this.isLast=It}get groupsView(){return It()}notifyLabelChanged(){}get titleHeight(){return It()}get element(){return It()}get scopedContextKeyService(){return kt.get(Le)}focus(){}}const r7=new iti;class nti{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=r7,this.scopedContextKeyService=void 0,this.getViewState=It,this.isVisible=It,this.hasFocus=It,this.getId=It,this.getTitle=It,this.focus=It}get minimumWidth(){return Bx.width}get maximumWidth(){return JJ.width}get minimumHeight(){return Bx.height}get maximumHeight(){return JJ.height}getControl(){return this.editor}}function sti(s,e,t){async function i(n,r,o){const a=ya(n)?r:n.options;Jit(r)&&(o=r);const c=Jv(n)||ya(n)?n.resource:void 0;if(c==null||!s.canHandleResource(c))return e(n,r,o);let l;if(l=kt.get(qt).listCodeEditors().find(h=>h instanceof PM&&h.getModel()!=null&&h.getModel().uri.toString()===c.toString()),l==null){const h=await e(n,r,o);if(h!=null)return h;const u=await s.createModelReference(c);if(l=await t?.(u,a,o===nv),l==null){u.dispose();return}}return a!=null&&$Z(a,l,1),(a?.preserveFocus??!1)||(l.focus(),l.getContainerDomNode().scrollIntoView()),new nti(l)}return i}let Rke=class extends Tke{constructor(e,t,i,n,r,o,a,c,l,d,h,u,f){super(void 0,i,n,r,o,a,c,l,d,h,u),this._isEditorPartVisible=t,this.openEditor=sti(f,this.openEditor.bind(this),e)}get activeTextEditorControl(){const e=kt.get(qt).getFocusedCodeEditor();return e!=null&&e instanceof iI?e:super.activeTextEditorControl}async openEditor(e,t,i){if(this._isEditorPartVisible())return super.openEditor(e,t,i)}};Rke=D([_(2,Pr),_(3,we),_(4,Xt),_(5,Te),_(6,Ci),_(7,Is),_(8,KU),_(9,Bae),_(10,Dc),_(11,wce),_(12,pn)],Rke);class H9e{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 lne=Lke=class extends V{constructor(e,t,i){super(),this.editor=e,this.scopedContextKeyService=i,this.active=!1,this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=It,this.isTransient=()=>!1,this.windowId=ri.vscodeWindowId,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.notifyIndexChanged=It,this.relayout=It,this.toJSON=It,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=--Lke.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 WT&&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=It,this.moveEditors=It,this.copyEditor=It,this.copyEditors=It,this.closeEditor=It,this.closeEditors=It,this.closeAllEditors=It,this.replaceEditors=It,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=It,this.isLast=It;const n=a=>{const c=t.createInstance(WT,a,void 0,void 0,void 0,void 0);this._onWillOpenEditor.fire({editor:c,groupId:this.id}),this.pane=new H9e(e,c,this),this._onDidModelChange.fire({kind:5,editor:c,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:c})},r=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:uA.UNKNOWN,editor:c.input,groupId:this.id,index:0,sticky:!1})}};e.onDidChangeModel(a=>{a.oldModelUrl!=null&&r(a.oldModelUrl),a.newModelUrl!=null&&n(a.newModelUrl)}),this._register({dispose:()=>{const a=e.getModel();a!=null&&r(a.uri)}});const o=e.getModel();if(o!=null){const a=t.createInstance(WT,o.uri,void 0,void 0,void 0,void 0);this.pane=new H9e(e,a,this)}}get groupsView(){return It()}notifyLabelChanged(){}createEditorActions(){return{actions:{primary:[],secondary:[]},onDidChange:M.None}}get titleHeight(){return It()}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()}};lne.idCounter=0;lne=Lke=D([_(1,we),_(2,Le)],lne);let Mke=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(r=>r.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=kt.get(qt),r=a=>{if(a instanceof PM){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(lne,a);this.additionalGroups.push(f),this._onDidAddGroup.fire(f)}},o=a=>{if(a instanceof PM){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(r)),this._register(n.onCodeEditorRemove(o)),n.listCodeEditors().forEach(r)})}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}};Mke=D([_(2,we)],Mke);var n2;let dne=(n2=class extends V{constructor(e,t,i,n,r,o,a,c){super(),this.filesConfigurationService=e,this.hostService=t,this.editorService=i,this.editorGroupService=n,this.workingCopyService=r,this.logService=o,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 gi(l=>this.uriIdentityService.extUri.getComparisonKey(l)),this.waitingOnConditionAutoSaveEditors=new gi(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,Ug.ERRORS))),this._register(this.filesConfigurationService.onDidChangeAutoSaveDisabled(e=>this.onConditionChanged([e],Ug.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!==ac.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 r=this.waitingOnConditionAutoSaveEditors.get(i);r?.condition===t&&!r.editor.editor.isDisposed()&&r.editor.editor.isDirty()&&this.filesConfigurationService.getAutoSaveMode(r.editor.editor,r.reason).mode!==ac.OFF&&(this.waitingOnConditionAutoSaveEditors.delete(i),this.logService.info(`[editor auto save] running auto save from condition change event with reason ${r.reason}`),this.editorService.save(r.editor,{reason:r.reason}))}}}onWindowFocusChange(e){e||this.maybeTriggerAutoSave(Sn.WINDOW_CHANGE)}onActiveWindowChange(){this.maybeTriggerAutoSave(Sn.WINDOW_CHANGE)}onDidActiveEditorChange(){this.lastActiveEditor&&typeof this.lastActiveGroupId=="number"&&this.maybeTriggerAutoSave(Sn.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(Sn.FOCUS_CHANGE,{groupId:e.id,editor:t})}))}maybeTriggerAutoSave(e,t){if(t){if(!t.editor.isDirty()||t.editor.isReadonly()||t.editor.hasCapability(xi.Untitled))return;const i=this.filesConfigurationService.getAutoSaveMode(t.editor,e);i.mode!==ac.OFF?(e===Sn.WINDOW_CHANGE&&(i.mode===ac.ON_FOCUS_CHANGE||i.mode===ac.ON_WINDOW_CHANGE)||e===Sn.FOCUS_CHANGE&&i.mode===ac.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===Ug.ERRORS||i.reason===Ug.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 ac.ON_FOCUS_CHANGE:e=Sn.FOCUS_CHANGE;break;case ac.ON_WINDOW_CHANGE:e=Sn.WINDOW_CHANGE;break;case ac.AFTER_SHORT_DELAY:case ac.AFTER_LONG_DELAY:e=Sn.AUTO;break}e&&this.saveAllDirtyAutoSaveables(e)}saveAllDirtyAutoSaveables(e){for(const t of this.workingCopyService.dirtyWorkingCopies){if(t.capabilities&hC.Untitled)continue;const i=this.filesConfigurationService.getAutoSaveMode(t.resource,e);i.mode!==ac.OFF?t.save({reason:e}):(i.reason===Ug.ERRORS||i.reason===Ug.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&hC.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=Sn.AUTO,r=this.filesConfigurationService.getAutoSaveMode(e.resource,n);r.mode!==ac.OFF?(this.logService.trace("[editor auto save] running auto save",e.resource.toString(),e.typeId),e.save({reason:n})):(r.reason===Ug.ERRORS||r.reason===Ug.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(e.resource,{workingCopy:e,reason:n,condition:r.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){wt(this.scheduledAutoSavesAfterDelay.get(e)),this.scheduledAutoSavesAfterDelay.delete(e),this.waitingOnConditionAutoSaveWorkingCopies.delete(e.resource),this.waitingOnConditionAutoSaveEditors.delete(e.resource)}},n2.ID="workbench.contrib.editorAutoSave",n2);dne=D([_(0,bd),_(1,Dc),_(2,ti),_(3,Pr),_(4,Pm),_(5,Ke),_(6,Dm),_(7,Is)],dne);Ju(dne.ID,dne,Cc.BlockRestore);let Nke=class extends BI{constructor(e,t,i){super(),this.resource=e,this.name=t,this.fileService=i,this.mime=Vs.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()}};Nke=D([_(2,Xt)],Nke);var Pke,GE;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Binary=2]="Binary"})(GE||(GE={}));let hne=Pke=class extends gb{get typeId(){return unt}get editorId(){return lm.id}get capabilities(){let e=xi.CanSplitInGroup;return this.model?this.model.isReadonly()&&(e|=xi.Readonly):this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=xi.Readonly):e|=xi.Untitled,e&xi.Readonly||(e|=xi.CanDropIntoEditor),e}constructor(e,t,i,n,r,o,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=GE.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),r&&this.setPreferredEncoding(r),o&&this.setPreferredLanguageId(o),typeof a=="string"&&this.setPreferredContents(a),this._register(this.textFileService.files.onDidCreate(w=>this.onDidCreateTextFileModel(w))),this.model&&this.registerModelListeners(this.model)}onDidCreateTextFileModel(e){Yi(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=GE.Text}setForceOpenAsBinary(){this.forceOpenAs=GE.Binary}isDirty(){return!!this.model?.isDirty()}isSaving(){return this.model?.hasState(ph.SAVED)||this.model?.hasState(ph.CONFLICT)||this.model?.hasState(ph.ERROR)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)?!0:super.isSaving()}prefersEditorPane(e){return this.forceOpenAs===GE.Binary?e.find(t=>t.typeId===bzt):e.find(t=>t.typeId===hnt)}resolve(e){return this.forceOpenAs===GE.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"?Eae(t):void 0,reload:{async:!0},allowBinary:this.forceOpenAs===GE.Text,reason:o9.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===RW.FILE_IS_BINARY)return this.doResolveAsBinary();throw t}}async doResolveAsBinary(){const e=this.instantiationService.createInstance(Nke,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:iB(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:iB(this,e.preserveViewState,this.editorService)}),t}matches(e){return this===e?!0:e instanceof Pke?Yi(e.resource,this.resource):Jv(e)?super.matches(e):!1}dispose(){this.model=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){wt(this.cachedTextFileModelReference),this.cachedTextFileModelReference=void 0}};hne=Pke=D([_(7,we),_(8,Fr),_(9,pn),_(10,Os),_(11,Xt),_(12,bd),_(13,ti),_(14,Cf),_(15,xc),_(16,cE)],hne);je.as(rC.EditorFactory).registerFileEditorFactory({typeId:unt,createFileEditor:(s,e,t,i,n,r,o,a)=>a.createInstance(hne,s,e,t,i,n,r,o),isFileEditor:s=>s instanceof hne});function dot(s){const e=s.get(ug).lastFocusedList,t=e?.getHTMLElement();if(t&&dv(t)&&e instanceof Za){const i=Oi(e.getSelectedElements().filter(a=>a instanceof WZ)),n=e.getFocusedElements(),r=n.length?n[0]:void 0;let o;return r instanceof WZ&&(o=r),i.some(a=>a===o)?i:o?[o]:void 0}}async function eFe(s,e){const t=s.get(Pr),i=s.get(qt),n=s.get(Fr);let r=dot(s);if(!r){const a=t.activeGroup;a.activeEditor&&(r=[],a.activeEditor instanceof cp&&!e?.saveAs&&!(a.activeEditor.primary.hasCapability(xi.Untitled)||a.activeEditor.secondary.hasCapability(xi.Untitled))&&a.activeEditor.secondary.isModified()?(r.push({groupId:a.id,editor:a.activeEditor.primary}),r.push({groupId:a.id,editor:a.activeEditor.secondary})):r.push({groupId:a.id,editor:a.activeEditor}))}if(!r||r.length===0)return;await tFe(s,r,e);const o=i.getFocusedCodeEditor();if(o instanceof uf&&!o.isSimpleWidget){const a=o.getModel()?.uri;a&&!r.some(({editor:c})=>Yi(Fa.getCanonicalUri(c,{supportSideBySide:Us.PRIMARY}),a))&&(n.files.get(a)?.isReadonly()||await n.save(a,e))}}function hot(s,e,t){const i=[];for(const n of e)for(const r of n.getEditors(tu.MOST_RECENTLY_ACTIVE))r.isDirty()&&i.push({groupId:n.id,editor:r});return tFe(s,i,t)}async function tFe(s,e,t){const i=s.get(ti),n=s.get(wi),r=s.get(we);try{await i.save(e,t)}catch(o){Oo(o)||n.notify({id:e.map(({editor:a})=>Hc(a.resource?.toString())).join(),severity:Ze.Error,message:g(3756,"Failed to save '{0}': {1}",e.map(({editor:a})=>a.getName()).join(", "),Po(o,!1)),actions:{primary:[al({id:"workbench.action.files.saveEditors",label:g(3757,"Retry"),run:()=>r.invokeFunction(a=>tFe(a,e,t))}),al({id:"workbench.action.files.revertEditors",label:g(3758,"Discard"),run:()=>i.revert(e)})]}})}}Sr.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.KeyS,id:$Ot,handler:s=>eFe(s,{reason:Sn.EXPLICIT,force:!0})});Sr.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:oo(U.CtrlCmd|S.KeyK,S.KeyS),win:{primary:oo(U.CtrlCmd|S.KeyK,U.CtrlCmd|U.Shift|S.KeyS)},id:GOt,handler:s=>eFe(s,{reason:Sn.EXPLICIT,force:!0,skipSaveParticipants:!0})});Sr.registerCommandAndKeybindingRule({id:zOt,weight:Ae.WorkbenchContrib,when:void 0,primary:U.CtrlCmd|U.Shift|S.KeyS,handler:s=>eFe(s,{reason:Sn.EXPLICIT,saveAs:!0})});Sr.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:void 0,mac:{primary:U.CtrlCmd|U.Alt|S.KeyS},win:{primary:oo(U.CtrlCmd|S.KeyK,S.KeyS)},id:KOt,handler:s=>hot(s,s.get(Pr).getGroups(gu.MOST_RECENTLY_ACTIVE),{reason:Sn.EXPLICIT})});vt.registerCommand({id:ytt,handler:(s,e,t)=>{const i=s.get(Pr),n=Hzt([t],s.get(ti),i,s.get(ug));let r;return n.groupedEditors.length?r=n.groupedEditors.map(({group:o})=>o):r=i.getGroups(gu.MOST_RECENTLY_ACTIVE),hot(s,r,{reason:Sn.EXPLICIT})}});vt.registerCommand({id:qOt,handler:async s=>(await s.get(ti).saveAll({includeUntitled:!1,reason:Sn.EXPLICIT})).success});vt.registerCommand({id:VOt,handler:async s=>{const e=s.get(Pr),t=s.get(ti);let i=dot(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(xi.Untitled)),{force:!0})}catch(n){s.get(wi).error(g(3759,"Failed to revert '{0}': {1}",i.map(({editor:o})=>o.getName()).join(", "),Po(n,!1)))}}});class rti{constructor(){this.hasMaximizedGroup=()=>!1,this.windowId=ri.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=It,this.isLayoutCentered=It,this.enforcePartOptions=It,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=r7,this.groups=[r7],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=It,this.getSize=It,this.setSize=It,this.arrangeGroups=It,this.toggleMaximizeGroup=It,this.toggleExpandGroup=It,this.applyLayout=It,this.getLayout=It,this.setGroupOrientation=It,this.findGroup=()=>{},this.addGroup=It,this.removeGroup=It,this.moveGroup=It,this.mergeGroup=It,this.mergeAllGroups=It,this.copyGroup=It,this.partOptions=cce,this.onDidChangeEditorPartOptions=M.None,this.createEditorDropTarget=It}get contentDimension(){return It()}get sideGroup(){return It()}}class oti{constructor(){this.registerContextKeyProvider=It,this.saveWorkingSet=It,this.getWorkingSets=It,this.applyWorkingSet=It,this.deleteWorkingSet=It,this.onDidCreateAuxiliaryEditorPart=M.None,this.mainPart=new rti,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=It,this.createAuxiliaryEditorPart=It,this.onDidChangeGroupMaximized=M.None,this.toggleMaximizeGroup=It,this.toggleExpandGroup=It,this.partOptions=cce,this.createEditorDropTarget=It,this._serviceBrand=void 0,this.getLayout=It,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=r7,this.groups=[r7],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=It,this.getSize=It,this.setSize=It,this.arrangeGroups=It,this.applyLayout=It,this.centerLayout=It,this.isLayoutCentered=()=>!1,this.setGroupOrientation=It,this.findGroup=()=>{},this.addGroup=It,this.removeGroup=It,this.moveGroup=It,this.mergeGroup=It,this.mergeAllGroups=It,this.copyGroup=It,this.onDidChangeEditorPartOptions=M.None,this.enforcePartOptions=It}get contentDimension(){return It()}get sideGroup(){return It()}}let Fke=class extends Mke{constructor(e){super(e.createInstance(oti),!0,e)}};Fke=D([_(0,we)],Fke);function ati(s){return{[qt.toString()]:new yi(xke,void 0,!0),[ti.toString()]:new yi(Rke,[s,()=>!1],!0),[wce.toString()]:new yi(Dke,[],!1),[Pr.toString()]:new yi(Fke)}}class o7{static _readModifiers(e){e=e.toLowerCase().trim();let t=!1,i=!1,n=!1,r=!1,o;do o=!1,/^ctrl(\+|\-)/.test(e)&&(t=!0,e=e.substr(5),o=!0),/^shift(\+|\-)/.test(e)&&(i=!0,e=e.substr(6),o=!0),/^alt(\+|\-)/.test(e)&&(n=!0,e=e.substr(4),o=!0),/^meta(\+|\-)/.test(e)&&(r=!0,e=e.substr(5),o=!0),/^win(\+|\-)/.test(e)&&(r=!0,e=e.substr(4),o=!0),/^cmd(\+|\-)/.test(e)&&(r=!0,e=e.substr(4),o=!0);while(o);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:r,key:a}}static parseChord(e){const t=this._readModifiers(e),i=t.key.match(/^\[([^\]]+)\]$/);if(i){const r=i[1],o=Gp.lowerCaseToEnum(r);return[new _y(t.ctrl,t.shift,t.alt,t.meta,o),t.remains]}const n=Ta.fromUserSettings(t.key);return[new Lh(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 PO(t):null}}const uot=[{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 JA;(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 r(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=r;const o={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:dTe(uot,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?o:{oneOf:[o,a]}})),additionalProperties:{description:"Submenu",type:"array",items:{oneOf:[o,a]}}},s.submenusContribution={description:g(8633,"Contributes submenu items to the editor"),type:"array",items:c};function l(f,p){return f?Qu(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"&&Qu(f)?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`",m)),!1):typeof f!="string"&&(Qu(f.original)||Qu(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}]}})(JA||(JA={}));const U9e=new Z,got=ih.registerExtensionPoint({extensionPoint:"commands",jsonSchema:JA.commandsContribution,activationEventsGenerator:(s,e)=>{for(const t of s)t.command&&e.push(`onCommand:${t.command}`)}});got.setHandler(s=>{function e(t,i){if(!JA.isValidCommand(t,i.collector))return;const{icon:n,enablement:r,category:o,title:a,shortTitle:c,command:l}=t;let d;n&&(typeof n=="string"?d=He.fromString(n)??{dark:Ft(i.description.extensionLocation,n),light:Ft(i.description.extensionLocation,n)}:d={dark:Ft(i.description.extensionLocation,n.dark),light:Ft(i.description.extensionLocation,n.light)});const h=Yn.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))),U9e.add(Yn.addCommand({id:l,title:a,source:{id:i.description.identifier.value,title:i.description.displayName??i.description.name},shortTitle:c,tooltip:a,category:o,precondition:he.deserialize(r),icon:d}))}U9e.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 kz=new Map,fot=ih.registerExtensionPoint({extensionPoint:"submenus",jsonSchema:JA.submenusContribution});fot.setHandler(s=>{kz.clear();for(const e of s){const{value:t,collector:i}=e;for(const[,n]of Object.entries(t)){if(!JA.isValidSubmenu(n,i))continue;if(!n.id){i.warn(g(8649,"`{0}` is not a valid submenu identifier",n.id));continue}if(kz.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 r;n.icon&&(typeof n.icon=="string"?r=He.fromString(n.icon)||{dark:Ft(e.description.extensionLocation,n.icon)}:r={dark:Ft(e.description.extensionLocation,n.icon.dark),light:Ft(e.description.extensionLocation,n.icon.light)});const o={id:_e.for(`api:${n.id}`),label:n.label,icon:r};kz.set(n.id,o)}}});const cti=new Map(uot.map(s=>[s.key,s])),V9e=new Z,uge=new Map,lti=ih.registerExtensionPoint({extensionPoint:"menus",jsonSchema:JA.menusContribution,deps:[fot]});lti.setHandler(s=>{V9e.clear(),uge.clear();for(const e of s){const{value:t,collector:i}=e;for(const n of Object.entries(t)){if(!JA.isValidItems(n[1],i))continue;let r=cti.get(n[0]);if(!r){const o=kz.get(n[0]);o&&(r={key:n[0],id:o.id,description:""})}if(r){if(r.proposed&&!hl(e.description,r.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],r.proposed,e.description.identifier.value));continue}for(const o of n[1]){let a;if(JA.isMenuItem(o)){const c=Yn.getCommand(o.command),l=o.alt&&Yn.getCommand(o.alt)||void 0;if(!c){i.error(g(8653,"Menu item references a command `{0}` which is not defined in the 'commands' section.",o.command));continue}o.alt&&!l&&i.warn(g(8654,"Menu item references an alt-command `{0}` which is not defined in the 'commands' section.",o.alt)),o.command===o.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(r.supportsSubmenus===!1){i.error(g(8656,"Menu item references a submenu for a menu which doesn't have submenu support."));continue}const c=kz.get(o.submenu);if(!c){i.error(g(8657,"Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",o.submenu));continue}let l=uge.get(r.id.id);if(l||(l=new Set,uge.set(r.id.id,l)),l.has(c.id.id)){i.warn(g(8658,"The `{0}` submenu was already contributed to the `{1}` menu.",o.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(o.group){const c=o.group.lastIndexOf("@");c>0?(a.group=o.group.substr(0,c),a.order=Number(o.group.substr(c+1))||void 0):a.group=o.group}a.when=he.deserialize(o.when),V9e.add(Yn.appendMenuItem(r.id,a))}}}}});let Oke=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=dTe(i,l=>l.id),r=e.contributes?.menus||{};for(const l in r)for(const d of r[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 Nt().appendMarkdown(`\`${l.id}\``),typeof l.title=="string"?l.title:l.title.value,l.keybindings,new Nt().appendMarkdown(`${l.menus.map(d=>`\`${d}\``).join(" ")}`)]);return{data:{headers:a,rows:c},dispose:()=>{}}}resolveKeybinding(e){let t;switch(TKe){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]}};Oke=D([_(0,Vt)],Oke);je.as(ev.ExtensionFeaturesRegistry).registerExtensionFeature({id:"commands",label:g(8663,"Commands"),access:{canToggle:!1},renderer:new yi(Oke)});class pot{static writeKeybindingItem(e,t){if(!t.resolvedKeybinding)return;const i=JSON.stringify(t.resolvedKeybinding.getUserSettingsLabel());e.write(`{ "key": ${dti(i+",",25)} "command": `);const n=t.when?JSON.stringify(t.when.serialize()):"",r=JSON.stringify(t.command);n.length>0?(e.write(`${r},`),e.writeLine(),e.write(` "when": ${n}`)):e.write(`${r}`),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"?o7.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,r="args"in e&&typeof e.args<"u"?e.args:void 0;return{keybinding:t,command:n,commandArgs:r,when:i,_sourceKey:"key"in e&&typeof e.key=="string"?e.key:void 0}}}function dti(s,e){return s.length{this._keyboardMapper=this.keyboardLayoutService.getKeyboardMapper(),this.updateResolver()})),this._keybindingHoldMode=null,this._cachedResolver=null,this.userKeybindings=this._register(new fti(r,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);Sr.setExtensionKeybindings(f),this.updateResolver()}),this.updateKeybindingsJsonSchema(),this._register(a.onDidRegisterExtensions(()=>this.updateKeybindingsJsonSchema())),this._register(M.runAndSubscribe(sm,({window:u,disposables:f})=>f.add(this._registerKeyListeners(u)),{window:ri,disposables:this._store})),this._register(HKe(u=>{if(u!==ri.vscodeWindowId)return;const f=navigator.keyboard;NO.keyboard!==rD.None&&(xpe(ri)?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 xn(i);this._log(`/ Received keydown event - ${Mdt(i)}`),this._log(`| Converted keydown event - ${Ndt(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 xn(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 lRe.toLabel(pr,e.chords,t=>t instanceof Lh?Ta.toString(t.keyCode):Gp.toString(t.scanCode))||"[null]"}_printResolvedKeybinding(e){return e.getDispatchChords().map(t=>t||"[null]").join(" ")}_printResolvedKeybindings(e,t,i){const r=`${t.padStart(35," ")} => `;if(i.length===0){e.push(`${r}${"[NO BINDING]".padStart(35," ")}`);return}for(const o of i)e.push(`${r}${this._printResolvedKeybinding(o).padStart(35," ")}`)}_dumpResolveKeybindingDebugInfo(){const e=new Set,t=[];t.push("Default Resolved Keybindings (unique only):");for(const i of Sr.getDefaultKeybindings()){if(!i.keybinding)continue;const n=this._printKeybinding(i.keybinding);if(e.has(n))continue;e.add(n);const r=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,n,r)}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 r=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,n,r)}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} @@ -1011,33 +1011,33 @@ ${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 hc;const t=Ec(lt(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(Sr.getDefaultKeybindings(),!0),t=this.getUserKeybindingItems();this._cachedResolver=new YO(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return this.hostService.hasFocus}_resolveKeybindingItems(e,t){const i=[];let n=0;for(const r of e){const o=r.when||void 0,a=r.keybinding;if(!a)i[n++]=new Mx(void 0,r.command,r.commandArgs,o,t,r.extensionId,r.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 Mx(d,r.command,r.commandArgs,o,t,r.extensionId,r.isBuiltinExtension)}}}return i}_resolveUserKeybindingItems(e,t){const i=[];let n=0;for(const r of e){const o=r.when||void 0;if(!r.keybinding)i[n++]=new Mx(void 0,r.command,r.commandArgs,o,t,null,!1);else{const a=this._keyboardMapper.resolveKeybinding(r.keybinding);for(const c of a)i[n++]=new Mx(c,r.command,r.commandArgs,o,t,null,!1)}}return i}_assertBrowserConflicts(e){if(NO.keyboard===rD.Always||NO.keyboard===rD.FullScreen&&xpe(ri))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&&pr===ks.Macintosh&&(n|=U.WinCtrl),(n&i)===(U.CtrlCmd|U.Alt)&&(t instanceof _y&&(t.scanCode===X.ArrowLeft||t.scanCode===X.ArrowRight)||t instanceof Lh&&(t.keyCode===S.LeftArrow||t.keyCode===S.RightArrow))||(n&i)===U.CtrlCmd&&(t instanceof _y&&t.scanCode>=X.Digit1&&t.scanCode<=X.Digit0||t instanceof Lh&&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=o7.parseKeybinding(e);return t?this._keyboardMapper.resolveKeybinding(t):[]}_handleKeybindingsExtensionPointUser(e,t,i,n,r){if(Array.isArray(i))for(let o=0,a=i.length;o0&&r.error(g(3514,"Invalid `contributes.{0}`: {1}",$9e.name,a.join(` +${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 hc;const t=Ec(lt(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(Sr.getDefaultKeybindings(),!0),t=this.getUserKeybindingItems();this._cachedResolver=new YO(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return this.hostService.hasFocus}_resolveKeybindingItems(e,t){const i=[];let n=0;for(const r of e){const o=r.when||void 0,a=r.keybinding;if(!a)i[n++]=new Mx(void 0,r.command,r.commandArgs,o,t,r.extensionId,r.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 Mx(d,r.command,r.commandArgs,o,t,r.extensionId,r.isBuiltinExtension)}}}return i}_resolveUserKeybindingItems(e,t){const i=[];let n=0;for(const r of e){const o=r.when||void 0;if(!r.keybinding)i[n++]=new Mx(void 0,r.command,r.commandArgs,o,t,null,!1);else{const a=this._keyboardMapper.resolveKeybinding(r.keybinding);for(const c of a)i[n++]=new Mx(c,r.command,r.commandArgs,o,t,null,!1)}}return i}_assertBrowserConflicts(e){if(NO.keyboard===rD.Always||NO.keyboard===rD.FullScreen&&xpe(ri))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&&pr===ks.Macintosh&&(n|=U.WinCtrl),(n&i)===(U.CtrlCmd|U.Alt)&&(t instanceof _y&&(t.scanCode===X.ArrowLeft||t.scanCode===X.ArrowRight)||t instanceof Lh&&(t.keyCode===S.LeftArrow||t.keyCode===S.RightArrow))||(n&i)===U.CtrlCmd&&(t instanceof _y&&t.scanCode>=X.Digit1&&t.scanCode<=X.Digit0||t instanceof Lh&&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=o7.parseKeybinding(e);return t?this._keyboardMapper.resolveKeybinding(t):[]}_handleKeybindingsExtensionPointUser(e,t,i,n,r){if(Array.isArray(i))for(let o=0,a=i.length;o0&&r.error(g(3514,"Invalid `contributes.{0}`: {1}",$9e.name,a.join(` `)))}static bindToCurrentPlatform(e,t,i,n){if(pr===ks.Windows&&n){if(n)return n}else if(pr===ks.Macintosh){if(t)return t}else if(i)return i;return e}_asCommandRule(e,t,i,n){const{command:r,args:o,when:a,key:c,mac:l,linux:d,win:h}=n,u=KV.bindToCurrentPlatform(c,l,d,h);if(!u)return;let f;t?f=Ae.BuiltinExtension+i:f=Ae.ExternalExtension+i;const p=Yn.getCommand(r),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:r,args:o,when:v,weight:f,keybinding:o7.parseKeybinding(u),extensionId:e.value,isBuiltinExtension:t}}getDefaultKeybindingsContent(){const e=this._getResolver(),t=e.getDefaultKeybindings(),i=e.getDefaultBoundCommands();return KV._getDefaultKeybindings(t)+` -`+KV._getAllCommandsAsComment(i)}static _getDefaultKeybindings(e){const t=new dti;t.writeLine("[");const i=e.length-1;return e.forEach((n,r)=>{pot.writeKeybindingItem(t,n),r!==i?t.writeLine(","):t.writeLine()}),t.writeLine("]"),t.toString()}static _getAllCommandsAsComment(e){const i=Dnt(e).sort().join(` +`+KV._getAllCommandsAsComment(i)}static _getDefaultKeybindings(e){const t=new hti;t.writeLine("[");const i=e.length-1;return e.forEach((n,r)=>{pot.writeKeybindingItem(t,n),r!==i?t.writeLine(","):t.writeLine()}),t.writeLine("]"),t.toString()}static _getAllCommandsAsComment(e){const i=Dnt(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=Gp.toEnum(e.code);if(uti.indexOf(t)!==-1)return!!(e.keyCode===Gg[t]||jt&&e.keyCode===jb.get(t));if(Gg[t]!==-1)return!1;const n=this.keyboardLayoutService.getRawKeyboardMapping();if(!n)return!1;const r=n[e.code];return!(!r||!r.value||/\s/.test(r.value))}};Bke=KV=D([_(0,Le),_(1,bi),_(2,Ji),_(3,wi),_(4,pg),_(5,Dc),_(6,ps),_(7,Xt),_(8,Is),_(9,Ke),_(10,nce)],Bke);class gti 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 ln(()=>this.reload().then(r=>{r&&this._onDidChange.fire()}),50)),this._register(M.filter(this.fileService.onDidFilesChange,r=>r.contains(this.userDataProfileService.currentProfile.keybindingsResource))(()=>{n.debug("Keybindings file changed"),this.reloadConfigurationScheduler.schedule()})),this._register(this.fileService.onDidRunOperation(r=>{r.operation===Ei.WRITE&&r.resource.toString()===this.userDataProfileService.currentProfile.keybindingsResource.toString()&&(n.debug("Keybindings file written"),this.reloadConfigurationScheduler.schedule())})),this._register(e.onDidChangeCurrentProfile(r=>{this.uriIdentityService.extUri.isEqual(r.previous.keybindingsResource,r.profile.keybindingsResource)||r.join(this.whenCurrentProfileChanged())}))}async whenCurrentProfileChanged(){this.watch(),this.reloadConfigurationScheduler.schedule()}watch(){this.watchDisposables.clear(),this.watchDisposables.add(this.fileService.watch(Ro(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 Js(this._rawKeybindings,e)?!1:(this._rawKeybindings=e,this._keybindings=this._rawKeybindings.map(t=>pot.readUserKeybindingItem(t)),!0)}async readUserKeybindings(){try{const e=await this.fileService.readFile(this.userDataProfileService.currentProfile.keybindingsResource),t=af(e.value.toString());return Array.isArray(t)?t.filter(i=>i&&typeof i=="object"):[]}catch{return[]}}}const kO=class kO{constructor(){this.commandsSchemas=[],this.commandsEnum=[],this.removalCommandsEnum=[],this.commandsEnumDescriptions=[],this.schema={id:kO.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=je.as(tE.JSONContribution),this.schemaRegistry.registerSchema(kO.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=(o,a)=>{/^_/.test(o)||t.has(o)||(t.add(o),this.commandsEnum.push(o),this.commandsEnumDescriptions.push(vRe(a)?a.value:a),this.removalCommandsEnum.push(`-${o}`))},n=vt.getCommands();for(const[o,a]of n){const c=a.metadata;if(i(o,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:o}}},then:{required:[].concat(d?["args"]:[]),properties:{args:l}}};this.commandsSchemas.push(h)}const r=Yn.getCommands();for(const o of r.keys())i(o);this.commandsSchemas.push(...e),this.schemaRegistry.notifySchemaChanged(kO.schemaId)}};kO.schemaId="vscode://schemas/keybindings";let Wke=kO;function une(s){return s.name?s.name:s.id?s.id:s.layout}function fti(s){const e=s,t={};for(const i in e){const n=e[i];if(n.length){const r=n[0],o=n[1],a=n[2],c=n[3],l=Number(n[4]),d=n.length===6?n[5]:void 0;t[i]={value:r,vkey:d,withShift:o,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 Cle{constructor(e,t,i,n){this.layout=e,this.secondaryLayouts=t,this.mapping=fti(i),this.isUserKeyboardLayout=!!n,this.layout.isUserKeyboardLayout=!!n}static createKeyboardLayoutFromDebugInfo(e,t,i){const n=new Cle(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(jn&&(i==="Backslash"||i==="KeyQ")||mo&&(i==="Backspace"||i==="Escape"))continue;const n=this.mapping[i];n===void 0&&(t-=1);const r=e[i];n&&r&&n.value!==r.value&&(t-=1)}return t}equal(e){return this.isUserKeyboardLayout!==e.isUserKeyboardLayout||une(this.layout)!==une(e.layout)?!1:this.fuzzyEqual(e.mapping)}fuzzyEqual(e){for(const t in e){if(jn&&(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 a7;(function(s){s[s.Code=0]="Code",s[s.KeyCode=1]="KeyCode"})(a7||(a7={}));function pti(s){const e=s.getValue("keyboard"),t=e?.dispatch==="keyCode"?a7.KeyCode:a7.Code,i=!!e?.mapAltGrToCtrlAlt;return{dispatch:t,mapAltGrToCtrlAlt:i}}const mti=je.as(Pn.Configuration),_ti={id:"keyboard",order:15,type:"object",title:g(8664,"Keyboard"),properties:{"keyboard.dispatch":{scope:ct.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:pr===ks.Macintosh||pr===ks.Linux},"keyboard.mapAltGrToCtrlAlt":{scope:ct.APPLICATION,type:"boolean",default:!1,markdownDescription:g(8666,"Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+."),included:pr===ks.Windows}}};mti.registerConfiguration(_ti);class vti{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 qV extends dRe{constructor(e,t){super(ks.Windows,t),this._mapper=e}_getLabel(e){return e.isDuplicateModifierCase()?"":this._mapper.getUILabelForKeyCode(e.keyCode)}_getUSLabelForKeybinding(e){return e.isDuplicateModifierCase()?"":Ta.toString(e.keyCode)}getUSLabel(){return D6.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+=Ta.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 bti{constructor(e,t,i){this._isUSStandard=e,this._mapAltGrToCtrlAlt=i,this._keyCodeToLabel=[],this._scanCodeToKeyCode=[],this._keyCodeToLabel=[],this._keyCodeExists=[],this._keyCodeToLabel[S.Unknown]=Ta.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,r=!0,this._keyCodeToLabel[m]=String.fromCharCode(B.A+(b-B.a))}else b>=B.A&&b<=B.Z?(n[b]=!0,r=!0,this._keyCodeToLabel[m]=h):this._keyCodeToLabel[m]=h}}const o=(a,c)=>{n[a]||(this._keyCodeToLabel[c]=String.fromCharCode(a))};if(o(B.A,S.KeyA),o(B.B,S.KeyB),o(B.C,S.KeyC),o(B.D,S.KeyD),o(B.E,S.KeyE),o(B.F,S.KeyF),o(B.G,S.KeyG),o(B.H,S.KeyH),o(B.I,S.KeyI),o(B.J,S.KeyJ),o(B.K,S.KeyK),o(B.L,S.KeyL),o(B.M,S.KeyM),o(B.N,S.KeyN),o(B.O,S.KeyO),o(B.P,S.KeyP),o(B.Q,S.KeyQ),o(B.R,S.KeyR),o(B.S,S.KeyS),o(B.T,S.KeyT),o(B.U,S.KeyU),o(B.V,S.KeyV),o(B.W,S.KeyW),o(B.X,S.KeyX),o(B.Y,S.KeyY),o(B.Z,S.KeyZ),!r){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 qV(this,t)]:[]}}const Iz=[];class G9e extends dRe{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||Gg[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 Tz{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+":""}${Gp.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=r_.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 Hke{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+":""}${Ta.toString(this.keyCode)}`}}class wti{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,r=i.length;n>>3===e){for(let h=a+1;h=S.Digit0&&t.keyCode<=S.Digit9,o=t.keyCode>=S.KeyA&&t.keyCode<=S.KeyZ,a=this._scanCodeToKeyCode[i];if(r||o){if(a){for(let c=0,l=a.length;c>>3;n[r]=new Tz(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 r=0,o=i.length;r>>3;n[r]=new Hke(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 Tz(!1,!1,!1,e)),i=this.lookupScanCodeCombo(new Tz(!1,!0,!1,e));if(t.length===1&&i.length===1){const n=t[0].shiftKey,r=t[0].keyCode,o=i[0].shiftKey,a=i[0].keyCode;if(r===a&&n!==o)return r}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 r_{constructor(e,t,i,n){this._isUSStandard=e,this._mapAltGrToCtrlAlt=i,this._OS=n,this._scanCodeToLabel=[],this._scanCodeToDispatch=[],this._codeInfo=[],this._scanCodeKeyCodeMapper=new wti,this._scanCodeToLabel=[],this._scanCodeToDispatch=[];const r=(d,h,u,f,p,m,v,b)=>{this._scanCodeKeyCodeMapper.registerIfUnknown(new Tz(!!d,!!h,!!u,f),new Hke(!!p,!!m,!!v,b))},o=(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++)r(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[Gp.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=Gp.toEnum(d);if(h===X.None||Gg[h]!==S.DependsOnKbLayout)continue;this._codeInfo[h]=t[d];const u=a[d]||t[d],f=r_.getCharCode(u.value),p=r_.getCharCode(u.withShift),m=r_.getCharCode(u.withAltGr),v=r_.getCharCode(u.withShiftAltGr),b={scanCode:h,value:f,withShift:p,withAltGr:m,withShiftAltGr:v};if(c[l++]=b,this._scanCodeToDispatch[h]=`[${Gp.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=r_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?r(1,1,1,u,0,1,0,v):r(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=r_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?r(1,0,1,u,0,1,0,v):r(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=r_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?(r(0,1,0,u,0,1,0,v),r(0,1,1,u,0,1,1,v),r(1,1,0,u,1,1,0,v),r(1,1,1,u,1,1,1,v)):(r(0,1,0,u,0,0,0,v),r(0,1,0,u,0,1,0,v),r(0,1,1,u,0,0,1,v),r(0,1,1,u,0,1,1,v),r(1,1,0,u,1,0,0,v),r(1,1,0,u,1,1,0,v),r(1,1,1,u,1,0,1,v),r(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=r_._charCodeToKb(h.value);if(!f)continue;const p=f.shiftKey,m=f.keyCode;p?(r(0,0,0,u,0,1,0,m),r(0,0,1,u,0,1,1,m),r(1,0,0,u,1,1,0,m),r(1,0,1,u,1,1,1,m)):(r(0,0,0,u,0,0,0,m),r(0,0,1,u,0,0,1,m),r(0,1,0,u,0,1,0,m),r(0,1,1,u,0,1,1,m),r(1,0,0,u,1,0,0,m),r(1,0,1,u,1,0,1,m),r(1,1,0,u,1,1,0,m),r(1,1,1,u,1,1,1,m))}o(0,0,0,X.Digit1,S.Digit1),o(0,0,0,X.Digit2,S.Digit2),o(0,0,0,X.Digit3,S.Digit3),o(0,0,0,X.Digit4,S.Digit4),o(0,0,0,X.Digit5,S.Digit5),o(0,0,0,X.Digit6,S.Digit6),o(0,0,0,X.Digit7,S.Digit7),o(0,0,0,X.Digit8,S.Digit8),o(0,0,0,X.Digit9,S.Digit9),o(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=A8[i];a!==X.DependsOnKbLayout&&(t=a)}const n=e.ctrlKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,r=e.altKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,o=new _y(n,e.shiftKey,r,e.metaKey,t);return new G9e(this,this._OS,[o])}_resolveChord(e){return e?e instanceof _y?[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 VT(()=>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 VT(()=>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 Cti 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 r=0;ri){if(o===0)return{result:this._mru[r],score:0};i=o,n=this._mru[r]}}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=pti(this._configurationService);return e.dispatch===a7.KeyCode||!this._initialized||!this._activeKeymapInfo?new Xve(e.mapAltGrToCtrlAlt,pr):(this._keyboardMapper||(this._keyboardMapper=new vti(mot._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=>une(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 pr===ks.Windows?new bti(n,i,t):Object.keys(i).length===0?new Xve(t,pr):new r_(n,i,t,pr)}_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 r=t.altKey&&t.shiftKey?n.withShiftAltGr:t.altKey?n.withAltGr:t.shiftKey?n.withShift:n.value,o=t.altKey&&t.shiftKey&&n.withShiftAltGrIsDeadKey||t.altKey&&n.withAltGrIsDeadKey||t.shiftKey&&n.withShiftIsDeadKey||n.valueIsDeadKey;return!(o&&t.browserEvent.key!=="Dead"||!o&&t.browserEvent.key!==r)}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 mot extends Cti{constructor(e,t,i,n){super(e),yti("./keyboardLayouts/layout.contribution."+(jn?"win":jt?"darwin":"linux")+".js").then(o=>{const a=o.KeyboardLayoutContribution.INSTANCE.layoutInfos;this._keymapInfos.push(...a.map(c=>new Cle(c.layout,c.secondaryLayouts,c.mapping,c.isUserKeyboardLayout))),this._mru=this._keymapInfos,this._initialized=!0,this.setLayoutFromBrowserAPI()})}}class Sti 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 ln(()=>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=af(t.value.toString());if(dD(i)==="object"){const n=i.layout,r=i.rawMapping;this._keyboardLayout=Cle.createKeyboardLayoutFromDebugInfo(n,r,!0)}else this._keyboardLayout=null}catch{this._keyboardLayout=null}return e?!Js(e,this._keyboardLayout):!0}}let Uke=class extends V{constructor(e,t,i,n,r,o){super(),this.configurationService=o,this._onDidChangeKeyboardLayout=new I,this.onDidChangeKeyboardLayout=this._onDidChangeKeyboardLayout.event;const c=o.getValue("keyboard").layout;this._keyboardLayoutMode=c??"autodetect",this._factory=new mot(o,i,n,r),this._register(this._factory.onDidChangeKeyboardMapper(()=>{this._onDidChangeKeyboardLayout.fire()})),c&&c!=="autodetect"&&this._factory.setKeyboardLayout(c),this._register(o.onDidChangeConfiguration(l=>{if(l.affectsConfiguration("keyboard.layout")){const h=o.getValue("keyboard").layout;this._keyboardLayoutMode=h,h==="autodetect"?this._factory.setLayoutFromBrowserAPI():this._factory.setKeyboardLayout(h)}})),this._userKeyboardLayout=new Sti(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&&une(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)}};Uke=D([_(0,ec),_(1,Xt),_(2,wi),_(3,Gi),_(4,bi),_(5,Te)],Uke);const Ati=je.as(Pn.Configuration),Eti={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.")}}};Ati.registerConfiguration(Eti);let Vke=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("*"),Ao(3e4)])),this._starActivation}async executeCommand(e,...t){this._logService.trace("CommandService#executeCommand",e);const i=`onCommand:${e}`;return vt.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(vt.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))}_tryExecuteCommand(e,t){const i=vt.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)}}};Vke=D([_(0,we),_(1,ps),_(2,Ke)],Vke);let zke=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this.contextKeyService=e,this.contextService=t,this.configurationService=i,this.environmentService=n,this.productService=r,this.editorGroupService=o,this.editorService=a,this.layoutService=c,this.paneCompositeService=l,this.workingCopyService=d,zkt.bindTo(this.contextKeyService),$kt.bindTo(this.contextKeyService),P6.bindTo(this.contextKeyService),IRe.bindTo(this.contextKeyService),Gkt.bindTo(this.contextKeyService),Kkt.bindTo(this.contextKeyService),qkt.bindTo(this.contextKeyService),ATt.bindTo(this.contextKeyService).set(W6(this.environmentService.remoteAuthority)||""),this.virtualWorkspaceContext=ETt.bindTo(this.contextKeyService),this.temporaryWorkspaceContext=IXe.bindTo(this.contextKeyService),this.updateWorkspaceContextKeys(),kTt.bindTo(this.contextKeyService).set(Zp.supported(ri));const h=!this.environmentService.isBuilt||this.environmentService.isExtensionDevelopment;IWe.bindTo(this.contextKeyService).set(h),qct(IWe.key,h),Qkt.bindTo(this.contextKeyService).set(this.productService.quality||""),ITt.bindTo(this.contextKeyService).set(r.embedderIdentifier),this.activeEditorGroupEmpty=LTt.bindTo(this.contextKeyService),this.activeEditorGroupIndex=RTt.bindTo(this.contextKeyService),this.activeEditorGroupLast=MTt.bindTo(this.contextKeyService),this.activeEditorGroupLocked=NTt.bindTo(this.contextKeyService),this.multipleEditorGroupsContext=PTt.bindTo(this.contextKeyService),this.editorsVisibleContext=FTt.bindTo(this.contextKeyService),this.dirtyWorkingCopiesContext=STt.bindTo(this.contextKeyService),this.dirtyWorkingCopiesContext.set(this.workingCopyService.hasDirty),this.inputFocusedContext=TRe.bindTo(this.contextKeyService),this.workbenchStateContext=bTt.bindTo(this.contextKeyService),this.updateWorkbenchStateContextKey(),this.workspaceFolderCountContext=wTt.bindTo(this.contextKeyService),this.updateWorkspaceFolderCountContextKey(),this.openFolderWorkspaceSupportContext=yTt.bindTo(this.contextKeyService),this.openFolderWorkspaceSupportContext.set(ld||typeof this.environmentService.remoteAuthority=="string"),this.emptyWorkspaceSupportContext=kXe.bindTo(this.contextKeyService),this.emptyWorkspaceSupportContext.set(ld||typeof this.environmentService.remoteAuthority=="string"),this.enterMultiRootWorkspaceSupportContext=CTt.bindTo(this.contextKeyService),this.enterMultiRootWorkspaceSupportContext.set(ld||typeof this.environmentService.remoteAuthority=="string"),this.splitEditorsVerticallyContext=WTt.bindTo(this.contextKeyService),this.updateSplitEditorsVerticallyContext(),this.isMainWindowFullscreenContext=xTt.bindTo(this.contextKeyService),this.isAuxiliaryWindowFocusedContext=DTt.bindTo(this.contextKeyService),this.inZenModeContext=OTt.bindTo(this.contextKeyService),this.isMainEditorCenteredLayoutContext=BTt.bindTo(this.contextKeyService),this.mainEditorAreaVisibleContext=HTt.bindTo(this.contextKeyService),this.editorTabsVisibleContext=UTt.bindTo(this.contextKeyService),this.sideBarVisibleContext=VTt.bindTo(this.contextKeyService),this.titleAreaVisibleContext=$Tt.bindTo(this.contextKeyService),this.titleBarStyleContext=zTt.bindTo(this.contextKeyService),this.updateTitleBarContextKeys(),this.panelPositionContext=KTt.bindTo(this.contextKeyService),this.panelPositionContext.set($1(this.layoutService.getPanelPosition())),this.panelVisibleContext=QTt.bindTo(this.contextKeyService),this.panelVisibleContext.set(this.layoutService.isVisible(qv.PANEL_PART)),this.panelMaximizedContext=jTt.bindTo(this.contextKeyService),this.panelMaximizedContext.set(this.layoutService.isPanelMaximized()),this.panelAlignmentContext=qTt.bindTo(this.contextKeyService),this.panelAlignmentContext.set(this.layoutService.getPanelAlignment()),this.auxiliaryBarVisibleContext=GTt.bindTo(this.contextKeyService),this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(qv.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(sm,({window:e,disposables:t})=>t.add(ue(e,ke.FOCUS_IN,()=>this.updateInputContextKeys(e.document),!0)),{window:ri,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(HKe(e=>{e===ri.vscodeWindowId&&this.isMainWindowFullscreenContext.set(xpe(ri))})),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(qv.EDITOR_PART,ri)),this.panelVisibleContext.set(this.layoutService.isVisible(qv.PANEL_PART)),this.panelMaximizedContext.set(this.layoutService.isPanelMaximized()),this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(qv.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=Ec(e.activeElement);M.once(n.onDidBlur)(()=>{Ry().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=QW(this.configurationService);this.splitEditorsVerticallyContext.set(e===qW.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(qv.SIDEBAR_PART))}updateTitleBarContextKeys(){this.titleAreaVisibleContext.set(this.layoutService.isVisible(qv.TITLEBAR_PART,ri)),this.titleBarStyleContext.set(ONe(this.configurationService))}updateWorkspaceContextKeys(){this.virtualWorkspaceContext.set(nnt(this.contextService.getWorkspace())||""),this.temporaryWorkspaceContext.set(Wy(this.contextService.getWorkspace()))}};zke=D([_(0,Le),_(1,Ci),_(2,Te),_(3,Xo),_(4,xo),_(5,Pr),_(6,ti),_(7,NI),_(8,Mm),_(9,Pm)],zke);class xti extends di{constructor(){super({id:"workbench.action.toggleKeybindingsLog",title:Pe(3525,"Toggle Keyboard Shortcuts Troubleshooting"),category:la.Developer,f1:!0})}run(e){e.get(Vt).toggleLogging()&&e.get(bi).executeCommand(Ptt)}}Et(xti);class Dti{static hasOpenBrace(e){for(;e.scan()!==pt.EOF;)if(e.getToken()===pt.OpenBraceToken)return!0;return!1}static offsetToPosition(e,t){let i=0;const n=e.getEOL().length,r=e.getLineCount();for(let o=1;o<=r;o++){const a=e.getLineLength(o)+n,c=i+a;if(c>t)return new re(o,t-i+1);i=c}return new re(r,e.getLineMaxColumn(r))}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 r=n.INVALID,o=-1,a=n.INVALID;const c=sRe(e.getValue());let l=0,d=0;const h=(f,p)=>{p!==n.INVALID&&l===1&&d===0?(r=p,o=f,a=p):r!==n.INVALID&&(r=n.INVALID,o=c.getTokenOffset())};for(;c.scan()!==pt.EOF;){const f=c.getPosition(),p=c.getToken();let m=!1;switch(p){case pt.OpenBracketToken:m=!0,l++,h(f,n.BEFORE_OBJECT);break;case pt.CloseBracketToken:m=!0,l--,h(f,n.INVALID);break;case pt.CommaToken:m=!0,h(f,n.BEFORE_OBJECT);break;case pt.OpenBraceToken:m=!0,d++,h(f,n.INVALID);break;case pt.CloseBraceToken:m=!0,d--,h(f,n.AFTER_OBJECT);break;case pt.Trivia:case pt.LineBreakTrivia:m=!0}if(f>=i&&(r!==n.INVALID||o!==-1)){let v,b;return r!==n.INVALID?(v=m?f:c.getTokenOffset(),b=r):(v=o,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 re(u,e.getLineMaxColumn(u)),prepend:` -[`,append:"]"}}}var kti=".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}";gt(kti,{});const Iti=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 $ke=class extends Kf{constructor(e,t,i,n){super(null,e),this.contextService=t,this.contextMenuService=i,this.hoverService=n,this._folderSettingCounts=new Map;const r=this.contextService.getWorkspace();this._folder=r.folders.length===1?r.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"+He.asCSSSelector(Iti)),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(Fo("mouse"),this.anchorElement,"")),this._register(ue(this.anchorElement,ke.MOUSE_DOWN,t=>tn.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))),oe(this.container,this.anchorElement),this.update()}onKeyUp(e){switch(new xn(e).keyCode){case S.Enter:case S.Space:this.onClick(e);return}}onClick(e){tn.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=>Yi(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 r=this._folderSettingCounts.get(i.uri.toString());return{id:"folderSettingsTarget"+n,label:this.labelWithCount(i.name,r),tooltip:this.labelWithCount(i.name,r),checked:!!this.folder&&Yi(this.folder.uri,i.uri),enabled:!0,class:void 0,run:()=>this._action.run(i)}})),e}labelWithCount(e,t){return t&&(e+=` (${t})`),e}};$ke=D([_(1,Ci),_(2,lo),_(3,tc)],$ke);let K9e=class extends _d{constructor(e,t,i,n,r,o,a){super(),this.contextService=i,this.instantiationService=n,this.environmentService=r,this.labelService=o,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=oe(e,fe(".settings-tabs-widget"));this.settingsSwitcherBar=this._register(new gd(t,{orientation:W_.HORIZONTAL,focusOnlyEnabledItems:!0,ariaLabel:g(10335,"Settings Switcher"),ariaRole:"tablist",actionViewItemProvider:(r,o)=>r.id==="folderSettings"?this.folderSettings:void 0})),this.userLocalSettings=new an("userSettings","",".settings-tab",!0,()=>this.updateTarget(At.USER_LOCAL)),this.userLocalSettings.tooltip=g(10331,"User"),this.userRemoteSettings=new an("userSettingsRemote","",".settings-tab",!0,()=>this.updateTarget(At.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 an("workspaceSettings","",".settings-tab",!1,()=>this.updateTarget(At.WORKSPACE)),this.folderSettingsAction=new an("folderSettings","",".settings-tab",!1,async r=>{this.updateTarget(FYe(r)?r.uri:At.USER_LOCAL)}),this.folderSettings=this.instantiationService.createInstance($ke,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=At.USER_LOCAL===this.settingsTarget,this.userRemoteSettings.checked=At.USER_REMOTE===this.settingsTarget,this.workspaceSettings.checked=At.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===At.WORKSPACE){let i=g(10333,"Workspace");t&&(i+=` (${t})`),this.workspaceSettings.label=i}else if(e===At.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===At.WORKSPACE&&this.contextService.getWorkbenchState()===Qi.WORKSPACE&&this.updateTarget(At.USER_LOCAL)}updateTarget(e){return this.settingsTarget===e||e instanceof N&&this.settingsTarget instanceof N&&Yi(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")}};K9e=D([_(2,Ci),_(3,we),_(4,Xo),_(5,Os),_(6,Di)],K9e);let Gke=class extends _d{constructor(e,t,i,n,r,o){super(),this.options=t,this.contextViewService=i,this.instantiationService=n,this.contextKeyService=r,this.keybindingService=o,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=oe(e,fe("div.settings-header-widget")),this.createSearchContainer(oe(this.domNode,fe("div.settings-search-container"))),this.controlsDiv=oe(this.domNode,fe("div.settings-search-controls")),this.options.showResultCount&&(this.countElement=oe(this.controlsDiv,fe(".settings-count-widget")),this.countElement.style.backgroundColor=$e(DT),this.countElement.style.color=$e(dae),this.countElement.style.border=`1px solid ${$e(yt)}`),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(Ec(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=oe(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=()=>iZ(this.keybindingService);return this._register(new pX(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?Od(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()}};Gke=D([_(2,bf),_(3,we),_(4,Le),_(5,Vt)],Gke);var eF,Kke;let qke=class extends Gke{constructor(e,t,i,n,r,o){super(e,t,i,n,r,o),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 xn(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 o=this._chords.map(a=>a.getUserSettingsLabel()||"").join(" ");this.setInputValue(n.quoteRecordedKeys?`"${o}"`:o),this.inputBox.inputElement.title=i,this._onKeybinding.fire(this._chords)}};qke=D([_(2,bf),_(3,we),_(4,Le),_(5,Vt)],qke);var kk;let Qke=(kk=class extends _d{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=ds(document.createElement("div")),this._domNode.setDisplay("none"),this._domNode.setClassName("defineKeybindingWidget"),this._domNode.setWidth(eF.WIDTH),this._domNode.setHeight(eF.HEIGHT);const i=g(8667,"Press desired key combination and then press ENTER.");oe(this._domNode.domNode,fe(".message",void 0,i)),this._domNode.domNode.style.backgroundColor=$e(kh),this._domNode.domNode.style.color=$e(PN),this._domNode.domNode.style.boxShadow=`0 2px 8px ${$e(kI)}`,this._keybindingInputWidget=this._register(this.instantiationService.createInstance(qke,this._domNode.domNode,{ariaLabel:i,history:[],inputBoxStyles:LM})),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=oe(this._domNode.domNode,fe(".output")),this._showExistingKeybindingsNode=oe(this._domNode.domNode,fe(".existing")),e&&oe(e,this._domNode.domNode)}get domNode(){return this._domNode.domNode}define(){return this._keybindingInputWidget.clear(),er.withAsyncBody(async e=>{this._isVisible||(this._isVisible=!0,this._domNode.setDisplay("block"),this._chords=null,this._keybindingInputWidget.setInputValue(""),Ns(this._outputNode),Ns(this._showExistingKeybindingsNode),await Ao(0),this._keybindingInputWidget.focus());const t=this._onHide.event(()=>{e(this.getUserSettingsLabel()),t.dispose()})})}layout(e){const t=Math.round((e.height-eF.HEIGHT)/2);this._domNode.setTop(t);const i=Math.round((e.width-eF.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);oe(t,document.createTextNode(i)),No(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,Ns(this._outputNode),Ns(this._showExistingKeybindingsNode),this._keybindingDisposables.add(new Zk(this._outputNode,pr,I_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(),Ns(this._outputNode),Ns(this._showExistingKeybindingsNode))}hide(){this._domNode.setDisplay("none"),this._isVisible=!1,this._onHide.fire()}},eF=kk,kk.WIDTH=400,kk.HEIGHT=110,kk);Qke=eF=D([_(1,we)],Qke);var hM;let jke=(hM=class extends V{constructor(e,t){super(),this._editor=e,this._widget=this._register(t.createInstance(Qke,null)),this._editor.addOverlayWidget(this)}getId(){return Kke.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(),_t.Smooth);const e=this._editor.getLayoutInfo();return this._widget.layout(new wn(e.width,e.height)),this._widget.define()}},Kke=hM,hM.ID="editor.contrib.defineKeybindingWidget",hM);jke=Kke=D([_(1,we)],jke);var Yke;const Tti=g(3526,"You won't be able to produce this key combination under your current keyboard layout.");let Jke=class extends V{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._userDataProfileService=i,this._keybindingDecorationRenderer=this._register(new yn),this._defineWidget=this._register(this._instantiationService.createInstance(jke,this._editor)),this._register(this._editor.onDidChangeModel(n=>this._update())),this._update()}_update(){this._keybindingDecorationRenderer.value=q9e(this._editor,this._userDataProfileService)?this._instantiationService.createInstance(Xke,this._editor):void 0}showDefineKeybindingWidget(){q9e(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 r=Dti.insertSnippet(this._editor.getModel(),this._editor.getPosition());n=r.prepend+n+r.append,this._editor.setPosition(r.position),pc.get(this._editor)?.insert(n,{overwriteBefore:0,overwriteAfter:0})}}};Jke=D([_(1,we),_(2,pg)],Jke);let Xke=Yke=class extends V{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._dec=this._editor.createDecorationsCollection(),this._updateDecorations=this._register(new ln(()=>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=rRe(e.getValue());if(i&&Array.isArray(i.children))for(let n=0,r=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())]}};Zke=D([_(1,Le),_(2,bi),_(3,Ji),_(4,wi),_(5,pg),_(6,Dc),_(7,ps),_(8,Xt),_(9,Is),_(10,Ke),_(11,nce)],Zke);Nit(s=>{s.get(we).createInstance(zke)});function Rti({shouldUseGlobalKeybindings:s=()=>!1}={}){return{...Xce(),[Vt.toString()]:new yi(Zke,[s],!1),[nce.toString()]:new yi(Uke,[],!0),[bi.toString()]:new yi(Vke,[],!0)}}class Mti{constructor(){this._provider=new or,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=mm(t.source,i.source)),n===0&&(n=mm(t.id,i.id)),n})}}var eIe;function _ot(s){if(!Array.isArray(s))return!1;for(let e=0,t=s.length;e{this._extensionService.whenInstalledExtensionsRegistered().then(()=>{this._loadConfigurationsForMode(r)})})),this._register(this._languageService.onDidChange(()=>{for(const[r]of this._done)this._loadConfigurationsForMode(r)}))}async _loadConfigurationsForMode(e){const t=this._languageService.getConfigurationFiles(e),i=Hc(t.map(r=>r.toString()));if(this._done.get(e)===i)return;this._done.set(e,i);const n=await Promise.all(t.map(r=>this._readConfigFile(r)));for(const r of n)this._handleConfig(e,r)}async _readConfigFile(e){try{const t=await this._extensionResourceLoaderService.readExtensionResource(e),i=[];let n=af(t,i);return i.length&&console.error(g(2492,"Errors parsing {0}: {1}",e.toString(),i.map(r=>`[${r.offset}, ${r.length}] ${Uee(r.error)}`).join(` -`))),dD(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(!In(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"&&(W4(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 r=0,o=i.length;r"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`autoClosingPairs\` to be an array.`);return}let n;for(let r=0,o=i.length;r"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`surroundingPairs\` to be an array.`);return}let n;for(let r=0,o=i.length;r"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`colorizedBracketPairs\` to be an array.`);return}const n=[];for(let r=0,o=i.length;r"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`onEnterRules\` to be an array.`);return}let n;for(let r=0,o=i.length;r +// - `+i}mightProducePrintableCharacter(e){if(e.ctrlKey||e.metaKey||e.altKey)return!1;const t=Gp.toEnum(e.code);if(gti.indexOf(t)!==-1)return!!(e.keyCode===Gg[t]||jt&&e.keyCode===jb.get(t));if(Gg[t]!==-1)return!1;const n=this.keyboardLayoutService.getRawKeyboardMapping();if(!n)return!1;const r=n[e.code];return!(!r||!r.value||/\s/.test(r.value))}};Bke=KV=D([_(0,Le),_(1,bi),_(2,Ji),_(3,wi),_(4,pg),_(5,Dc),_(6,ps),_(7,Xt),_(8,Is),_(9,Ke),_(10,nce)],Bke);class fti 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 ln(()=>this.reload().then(r=>{r&&this._onDidChange.fire()}),50)),this._register(M.filter(this.fileService.onDidFilesChange,r=>r.contains(this.userDataProfileService.currentProfile.keybindingsResource))(()=>{n.debug("Keybindings file changed"),this.reloadConfigurationScheduler.schedule()})),this._register(this.fileService.onDidRunOperation(r=>{r.operation===Ei.WRITE&&r.resource.toString()===this.userDataProfileService.currentProfile.keybindingsResource.toString()&&(n.debug("Keybindings file written"),this.reloadConfigurationScheduler.schedule())})),this._register(e.onDidChangeCurrentProfile(r=>{this.uriIdentityService.extUri.isEqual(r.previous.keybindingsResource,r.profile.keybindingsResource)||r.join(this.whenCurrentProfileChanged())}))}async whenCurrentProfileChanged(){this.watch(),this.reloadConfigurationScheduler.schedule()}watch(){this.watchDisposables.clear(),this.watchDisposables.add(this.fileService.watch(Ro(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 Js(this._rawKeybindings,e)?!1:(this._rawKeybindings=e,this._keybindings=this._rawKeybindings.map(t=>pot.readUserKeybindingItem(t)),!0)}async readUserKeybindings(){try{const e=await this.fileService.readFile(this.userDataProfileService.currentProfile.keybindingsResource),t=af(e.value.toString());return Array.isArray(t)?t.filter(i=>i&&typeof i=="object"):[]}catch{return[]}}}const kO=class kO{constructor(){this.commandsSchemas=[],this.commandsEnum=[],this.removalCommandsEnum=[],this.commandsEnumDescriptions=[],this.schema={id:kO.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=je.as(tE.JSONContribution),this.schemaRegistry.registerSchema(kO.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=(o,a)=>{/^_/.test(o)||t.has(o)||(t.add(o),this.commandsEnum.push(o),this.commandsEnumDescriptions.push(vRe(a)?a.value:a),this.removalCommandsEnum.push(`-${o}`))},n=vt.getCommands();for(const[o,a]of n){const c=a.metadata;if(i(o,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:o}}},then:{required:[].concat(d?["args"]:[]),properties:{args:l}}};this.commandsSchemas.push(h)}const r=Yn.getCommands();for(const o of r.keys())i(o);this.commandsSchemas.push(...e),this.schemaRegistry.notifySchemaChanged(kO.schemaId)}};kO.schemaId="vscode://schemas/keybindings";let Wke=kO;function une(s){return s.name?s.name:s.id?s.id:s.layout}function pti(s){const e=s,t={};for(const i in e){const n=e[i];if(n.length){const r=n[0],o=n[1],a=n[2],c=n[3],l=Number(n[4]),d=n.length===6?n[5]:void 0;t[i]={value:r,vkey:d,withShift:o,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 Cle{constructor(e,t,i,n){this.layout=e,this.secondaryLayouts=t,this.mapping=pti(i),this.isUserKeyboardLayout=!!n,this.layout.isUserKeyboardLayout=!!n}static createKeyboardLayoutFromDebugInfo(e,t,i){const n=new Cle(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(jn&&(i==="Backslash"||i==="KeyQ")||mo&&(i==="Backspace"||i==="Escape"))continue;const n=this.mapping[i];n===void 0&&(t-=1);const r=e[i];n&&r&&n.value!==r.value&&(t-=1)}return t}equal(e){return this.isUserKeyboardLayout!==e.isUserKeyboardLayout||une(this.layout)!==une(e.layout)?!1:this.fuzzyEqual(e.mapping)}fuzzyEqual(e){for(const t in e){if(jn&&(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 a7;(function(s){s[s.Code=0]="Code",s[s.KeyCode=1]="KeyCode"})(a7||(a7={}));function mti(s){const e=s.getValue("keyboard"),t=e?.dispatch==="keyCode"?a7.KeyCode:a7.Code,i=!!e?.mapAltGrToCtrlAlt;return{dispatch:t,mapAltGrToCtrlAlt:i}}const _ti=je.as(Pn.Configuration),vti={id:"keyboard",order:15,type:"object",title:g(8664,"Keyboard"),properties:{"keyboard.dispatch":{scope:ct.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:pr===ks.Macintosh||pr===ks.Linux},"keyboard.mapAltGrToCtrlAlt":{scope:ct.APPLICATION,type:"boolean",default:!1,markdownDescription:g(8666,"Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+."),included:pr===ks.Windows}}};_ti.registerConfiguration(vti);class bti{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 qV extends dRe{constructor(e,t){super(ks.Windows,t),this._mapper=e}_getLabel(e){return e.isDuplicateModifierCase()?"":this._mapper.getUILabelForKeyCode(e.keyCode)}_getUSLabelForKeybinding(e){return e.isDuplicateModifierCase()?"":Ta.toString(e.keyCode)}getUSLabel(){return D6.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+=Ta.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 wti{constructor(e,t,i){this._isUSStandard=e,this._mapAltGrToCtrlAlt=i,this._keyCodeToLabel=[],this._scanCodeToKeyCode=[],this._keyCodeToLabel=[],this._keyCodeExists=[],this._keyCodeToLabel[S.Unknown]=Ta.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,r=!0,this._keyCodeToLabel[m]=String.fromCharCode(B.A+(b-B.a))}else b>=B.A&&b<=B.Z?(n[b]=!0,r=!0,this._keyCodeToLabel[m]=h):this._keyCodeToLabel[m]=h}}const o=(a,c)=>{n[a]||(this._keyCodeToLabel[c]=String.fromCharCode(a))};if(o(B.A,S.KeyA),o(B.B,S.KeyB),o(B.C,S.KeyC),o(B.D,S.KeyD),o(B.E,S.KeyE),o(B.F,S.KeyF),o(B.G,S.KeyG),o(B.H,S.KeyH),o(B.I,S.KeyI),o(B.J,S.KeyJ),o(B.K,S.KeyK),o(B.L,S.KeyL),o(B.M,S.KeyM),o(B.N,S.KeyN),o(B.O,S.KeyO),o(B.P,S.KeyP),o(B.Q,S.KeyQ),o(B.R,S.KeyR),o(B.S,S.KeyS),o(B.T,S.KeyT),o(B.U,S.KeyU),o(B.V,S.KeyV),o(B.W,S.KeyW),o(B.X,S.KeyX),o(B.Y,S.KeyY),o(B.Z,S.KeyZ),!r){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 qV(this,t)]:[]}}const Iz=[];class G9e extends dRe{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||Gg[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 Tz{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+":""}${Gp.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=r_.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 Hke{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+":""}${Ta.toString(this.keyCode)}`}}class yti{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,r=i.length;n>>3===e){for(let h=a+1;h=S.Digit0&&t.keyCode<=S.Digit9,o=t.keyCode>=S.KeyA&&t.keyCode<=S.KeyZ,a=this._scanCodeToKeyCode[i];if(r||o){if(a){for(let c=0,l=a.length;c>>3;n[r]=new Tz(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 r=0,o=i.length;r>>3;n[r]=new Hke(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 Tz(!1,!1,!1,e)),i=this.lookupScanCodeCombo(new Tz(!1,!0,!1,e));if(t.length===1&&i.length===1){const n=t[0].shiftKey,r=t[0].keyCode,o=i[0].shiftKey,a=i[0].keyCode;if(r===a&&n!==o)return r}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 r_{constructor(e,t,i,n){this._isUSStandard=e,this._mapAltGrToCtrlAlt=i,this._OS=n,this._scanCodeToLabel=[],this._scanCodeToDispatch=[],this._codeInfo=[],this._scanCodeKeyCodeMapper=new yti,this._scanCodeToLabel=[],this._scanCodeToDispatch=[];const r=(d,h,u,f,p,m,v,b)=>{this._scanCodeKeyCodeMapper.registerIfUnknown(new Tz(!!d,!!h,!!u,f),new Hke(!!p,!!m,!!v,b))},o=(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++)r(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[Gp.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=Gp.toEnum(d);if(h===X.None||Gg[h]!==S.DependsOnKbLayout)continue;this._codeInfo[h]=t[d];const u=a[d]||t[d],f=r_.getCharCode(u.value),p=r_.getCharCode(u.withShift),m=r_.getCharCode(u.withAltGr),v=r_.getCharCode(u.withShiftAltGr),b={scanCode:h,value:f,withShift:p,withAltGr:m,withShiftAltGr:v};if(c[l++]=b,this._scanCodeToDispatch[h]=`[${Gp.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=r_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?r(1,1,1,u,0,1,0,v):r(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=r_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?r(1,0,1,u,0,1,0,v):r(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=r_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?(r(0,1,0,u,0,1,0,v),r(0,1,1,u,0,1,1,v),r(1,1,0,u,1,1,0,v),r(1,1,1,u,1,1,1,v)):(r(0,1,0,u,0,0,0,v),r(0,1,0,u,0,1,0,v),r(0,1,1,u,0,0,1,v),r(0,1,1,u,0,1,1,v),r(1,1,0,u,1,0,0,v),r(1,1,0,u,1,1,0,v),r(1,1,1,u,1,0,1,v),r(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=r_._charCodeToKb(h.value);if(!f)continue;const p=f.shiftKey,m=f.keyCode;p?(r(0,0,0,u,0,1,0,m),r(0,0,1,u,0,1,1,m),r(1,0,0,u,1,1,0,m),r(1,0,1,u,1,1,1,m)):(r(0,0,0,u,0,0,0,m),r(0,0,1,u,0,0,1,m),r(0,1,0,u,0,1,0,m),r(0,1,1,u,0,1,1,m),r(1,0,0,u,1,0,0,m),r(1,0,1,u,1,0,1,m),r(1,1,0,u,1,1,0,m),r(1,1,1,u,1,1,1,m))}o(0,0,0,X.Digit1,S.Digit1),o(0,0,0,X.Digit2,S.Digit2),o(0,0,0,X.Digit3,S.Digit3),o(0,0,0,X.Digit4,S.Digit4),o(0,0,0,X.Digit5,S.Digit5),o(0,0,0,X.Digit6,S.Digit6),o(0,0,0,X.Digit7,S.Digit7),o(0,0,0,X.Digit8,S.Digit8),o(0,0,0,X.Digit9,S.Digit9),o(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=A8[i];a!==X.DependsOnKbLayout&&(t=a)}const n=e.ctrlKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,r=e.altKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,o=new _y(n,e.shiftKey,r,e.metaKey,t);return new G9e(this,this._OS,[o])}_resolveChord(e){return e?e instanceof _y?[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 VT(()=>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 VT(()=>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 Sti 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 r=0;ri){if(o===0)return{result:this._mru[r],score:0};i=o,n=this._mru[r]}}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=mti(this._configurationService);return e.dispatch===a7.KeyCode||!this._initialized||!this._activeKeymapInfo?new Xve(e.mapAltGrToCtrlAlt,pr):(this._keyboardMapper||(this._keyboardMapper=new bti(mot._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=>une(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 pr===ks.Windows?new wti(n,i,t):Object.keys(i).length===0?new Xve(t,pr):new r_(n,i,t,pr)}_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 r=t.altKey&&t.shiftKey?n.withShiftAltGr:t.altKey?n.withAltGr:t.shiftKey?n.withShift:n.value,o=t.altKey&&t.shiftKey&&n.withShiftAltGrIsDeadKey||t.altKey&&n.withAltGrIsDeadKey||t.shiftKey&&n.withShiftIsDeadKey||n.valueIsDeadKey;return!(o&&t.browserEvent.key!=="Dead"||!o&&t.browserEvent.key!==r)}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 mot extends Sti{constructor(e,t,i,n){super(e),Cti("./keyboardLayouts/layout.contribution."+(jn?"win":jt?"darwin":"linux")+".js").then(o=>{const a=o.KeyboardLayoutContribution.INSTANCE.layoutInfos;this._keymapInfos.push(...a.map(c=>new Cle(c.layout,c.secondaryLayouts,c.mapping,c.isUserKeyboardLayout))),this._mru=this._keymapInfos,this._initialized=!0,this.setLayoutFromBrowserAPI()})}}class Ati 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 ln(()=>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=af(t.value.toString());if(dD(i)==="object"){const n=i.layout,r=i.rawMapping;this._keyboardLayout=Cle.createKeyboardLayoutFromDebugInfo(n,r,!0)}else this._keyboardLayout=null}catch{this._keyboardLayout=null}return e?!Js(e,this._keyboardLayout):!0}}let Uke=class extends V{constructor(e,t,i,n,r,o){super(),this.configurationService=o,this._onDidChangeKeyboardLayout=new I,this.onDidChangeKeyboardLayout=this._onDidChangeKeyboardLayout.event;const c=o.getValue("keyboard").layout;this._keyboardLayoutMode=c??"autodetect",this._factory=new mot(o,i,n,r),this._register(this._factory.onDidChangeKeyboardMapper(()=>{this._onDidChangeKeyboardLayout.fire()})),c&&c!=="autodetect"&&this._factory.setKeyboardLayout(c),this._register(o.onDidChangeConfiguration(l=>{if(l.affectsConfiguration("keyboard.layout")){const h=o.getValue("keyboard").layout;this._keyboardLayoutMode=h,h==="autodetect"?this._factory.setLayoutFromBrowserAPI():this._factory.setKeyboardLayout(h)}})),this._userKeyboardLayout=new Ati(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&&une(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)}};Uke=D([_(0,ec),_(1,Xt),_(2,wi),_(3,Gi),_(4,bi),_(5,Te)],Uke);const Eti=je.as(Pn.Configuration),xti={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.")}}};Eti.registerConfiguration(xti);let Vke=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("*"),Ao(3e4)])),this._starActivation}async executeCommand(e,...t){this._logService.trace("CommandService#executeCommand",e);const i=`onCommand:${e}`;return vt.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(vt.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))}_tryExecuteCommand(e,t){const i=vt.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)}}};Vke=D([_(0,we),_(1,ps),_(2,Ke)],Vke);let zke=class extends V{constructor(e,t,i,n,r,o,a,c,l,d){super(),this.contextKeyService=e,this.contextService=t,this.configurationService=i,this.environmentService=n,this.productService=r,this.editorGroupService=o,this.editorService=a,this.layoutService=c,this.paneCompositeService=l,this.workingCopyService=d,zkt.bindTo(this.contextKeyService),$kt.bindTo(this.contextKeyService),P6.bindTo(this.contextKeyService),IRe.bindTo(this.contextKeyService),Gkt.bindTo(this.contextKeyService),Kkt.bindTo(this.contextKeyService),qkt.bindTo(this.contextKeyService),ATt.bindTo(this.contextKeyService).set(W6(this.environmentService.remoteAuthority)||""),this.virtualWorkspaceContext=ETt.bindTo(this.contextKeyService),this.temporaryWorkspaceContext=IXe.bindTo(this.contextKeyService),this.updateWorkspaceContextKeys(),kTt.bindTo(this.contextKeyService).set(Zp.supported(ri));const h=!this.environmentService.isBuilt||this.environmentService.isExtensionDevelopment;IWe.bindTo(this.contextKeyService).set(h),qct(IWe.key,h),Qkt.bindTo(this.contextKeyService).set(this.productService.quality||""),ITt.bindTo(this.contextKeyService).set(r.embedderIdentifier),this.activeEditorGroupEmpty=LTt.bindTo(this.contextKeyService),this.activeEditorGroupIndex=RTt.bindTo(this.contextKeyService),this.activeEditorGroupLast=MTt.bindTo(this.contextKeyService),this.activeEditorGroupLocked=NTt.bindTo(this.contextKeyService),this.multipleEditorGroupsContext=PTt.bindTo(this.contextKeyService),this.editorsVisibleContext=FTt.bindTo(this.contextKeyService),this.dirtyWorkingCopiesContext=STt.bindTo(this.contextKeyService),this.dirtyWorkingCopiesContext.set(this.workingCopyService.hasDirty),this.inputFocusedContext=TRe.bindTo(this.contextKeyService),this.workbenchStateContext=bTt.bindTo(this.contextKeyService),this.updateWorkbenchStateContextKey(),this.workspaceFolderCountContext=wTt.bindTo(this.contextKeyService),this.updateWorkspaceFolderCountContextKey(),this.openFolderWorkspaceSupportContext=yTt.bindTo(this.contextKeyService),this.openFolderWorkspaceSupportContext.set(ld||typeof this.environmentService.remoteAuthority=="string"),this.emptyWorkspaceSupportContext=kXe.bindTo(this.contextKeyService),this.emptyWorkspaceSupportContext.set(ld||typeof this.environmentService.remoteAuthority=="string"),this.enterMultiRootWorkspaceSupportContext=CTt.bindTo(this.contextKeyService),this.enterMultiRootWorkspaceSupportContext.set(ld||typeof this.environmentService.remoteAuthority=="string"),this.splitEditorsVerticallyContext=WTt.bindTo(this.contextKeyService),this.updateSplitEditorsVerticallyContext(),this.isMainWindowFullscreenContext=xTt.bindTo(this.contextKeyService),this.isAuxiliaryWindowFocusedContext=DTt.bindTo(this.contextKeyService),this.inZenModeContext=OTt.bindTo(this.contextKeyService),this.isMainEditorCenteredLayoutContext=BTt.bindTo(this.contextKeyService),this.mainEditorAreaVisibleContext=HTt.bindTo(this.contextKeyService),this.editorTabsVisibleContext=UTt.bindTo(this.contextKeyService),this.sideBarVisibleContext=VTt.bindTo(this.contextKeyService),this.titleAreaVisibleContext=$Tt.bindTo(this.contextKeyService),this.titleBarStyleContext=zTt.bindTo(this.contextKeyService),this.updateTitleBarContextKeys(),this.panelPositionContext=KTt.bindTo(this.contextKeyService),this.panelPositionContext.set($1(this.layoutService.getPanelPosition())),this.panelVisibleContext=QTt.bindTo(this.contextKeyService),this.panelVisibleContext.set(this.layoutService.isVisible(qv.PANEL_PART)),this.panelMaximizedContext=jTt.bindTo(this.contextKeyService),this.panelMaximizedContext.set(this.layoutService.isPanelMaximized()),this.panelAlignmentContext=qTt.bindTo(this.contextKeyService),this.panelAlignmentContext.set(this.layoutService.getPanelAlignment()),this.auxiliaryBarVisibleContext=GTt.bindTo(this.contextKeyService),this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(qv.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(sm,({window:e,disposables:t})=>t.add(ue(e,ke.FOCUS_IN,()=>this.updateInputContextKeys(e.document),!0)),{window:ri,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(HKe(e=>{e===ri.vscodeWindowId&&this.isMainWindowFullscreenContext.set(xpe(ri))})),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(qv.EDITOR_PART,ri)),this.panelVisibleContext.set(this.layoutService.isVisible(qv.PANEL_PART)),this.panelMaximizedContext.set(this.layoutService.isPanelMaximized()),this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(qv.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=Ec(e.activeElement);M.once(n.onDidBlur)(()=>{Ry().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=QW(this.configurationService);this.splitEditorsVerticallyContext.set(e===qW.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(qv.SIDEBAR_PART))}updateTitleBarContextKeys(){this.titleAreaVisibleContext.set(this.layoutService.isVisible(qv.TITLEBAR_PART,ri)),this.titleBarStyleContext.set(ONe(this.configurationService))}updateWorkspaceContextKeys(){this.virtualWorkspaceContext.set(nnt(this.contextService.getWorkspace())||""),this.temporaryWorkspaceContext.set(Wy(this.contextService.getWorkspace()))}};zke=D([_(0,Le),_(1,Ci),_(2,Te),_(3,Xo),_(4,xo),_(5,Pr),_(6,ti),_(7,NI),_(8,Mm),_(9,Pm)],zke);class Dti extends di{constructor(){super({id:"workbench.action.toggleKeybindingsLog",title:Pe(3525,"Toggle Keyboard Shortcuts Troubleshooting"),category:la.Developer,f1:!0})}run(e){e.get(Vt).toggleLogging()&&e.get(bi).executeCommand(Ptt)}}Et(Dti);class kti{static hasOpenBrace(e){for(;e.scan()!==pt.EOF;)if(e.getToken()===pt.OpenBraceToken)return!0;return!1}static offsetToPosition(e,t){let i=0;const n=e.getEOL().length,r=e.getLineCount();for(let o=1;o<=r;o++){const a=e.getLineLength(o)+n,c=i+a;if(c>t)return new re(o,t-i+1);i=c}return new re(r,e.getLineMaxColumn(r))}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 r=n.INVALID,o=-1,a=n.INVALID;const c=sRe(e.getValue());let l=0,d=0;const h=(f,p)=>{p!==n.INVALID&&l===1&&d===0?(r=p,o=f,a=p):r!==n.INVALID&&(r=n.INVALID,o=c.getTokenOffset())};for(;c.scan()!==pt.EOF;){const f=c.getPosition(),p=c.getToken();let m=!1;switch(p){case pt.OpenBracketToken:m=!0,l++,h(f,n.BEFORE_OBJECT);break;case pt.CloseBracketToken:m=!0,l--,h(f,n.INVALID);break;case pt.CommaToken:m=!0,h(f,n.BEFORE_OBJECT);break;case pt.OpenBraceToken:m=!0,d++,h(f,n.INVALID);break;case pt.CloseBraceToken:m=!0,d--,h(f,n.AFTER_OBJECT);break;case pt.Trivia:case pt.LineBreakTrivia:m=!0}if(f>=i&&(r!==n.INVALID||o!==-1)){let v,b;return r!==n.INVALID?(v=m?f:c.getTokenOffset(),b=r):(v=o,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 re(u,e.getLineMaxColumn(u)),prepend:` +[`,append:"]"}}}var Iti=".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}";gt(Iti,{});const Tti=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 $ke=class extends Kf{constructor(e,t,i,n){super(null,e),this.contextService=t,this.contextMenuService=i,this.hoverService=n,this._folderSettingCounts=new Map;const r=this.contextService.getWorkspace();this._folder=r.folders.length===1?r.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"+He.asCSSSelector(Tti)),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(Fo("mouse"),this.anchorElement,"")),this._register(ue(this.anchorElement,ke.MOUSE_DOWN,t=>tn.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))),oe(this.container,this.anchorElement),this.update()}onKeyUp(e){switch(new xn(e).keyCode){case S.Enter:case S.Space:this.onClick(e);return}}onClick(e){tn.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=>Yi(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 r=this._folderSettingCounts.get(i.uri.toString());return{id:"folderSettingsTarget"+n,label:this.labelWithCount(i.name,r),tooltip:this.labelWithCount(i.name,r),checked:!!this.folder&&Yi(this.folder.uri,i.uri),enabled:!0,class:void 0,run:()=>this._action.run(i)}})),e}labelWithCount(e,t){return t&&(e+=` (${t})`),e}};$ke=D([_(1,Ci),_(2,lo),_(3,tc)],$ke);let K9e=class extends _d{constructor(e,t,i,n,r,o,a){super(),this.contextService=i,this.instantiationService=n,this.environmentService=r,this.labelService=o,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=oe(e,fe(".settings-tabs-widget"));this.settingsSwitcherBar=this._register(new gd(t,{orientation:W_.HORIZONTAL,focusOnlyEnabledItems:!0,ariaLabel:g(10335,"Settings Switcher"),ariaRole:"tablist",actionViewItemProvider:(r,o)=>r.id==="folderSettings"?this.folderSettings:void 0})),this.userLocalSettings=new an("userSettings","",".settings-tab",!0,()=>this.updateTarget(At.USER_LOCAL)),this.userLocalSettings.tooltip=g(10331,"User"),this.userRemoteSettings=new an("userSettingsRemote","",".settings-tab",!0,()=>this.updateTarget(At.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 an("workspaceSettings","",".settings-tab",!1,()=>this.updateTarget(At.WORKSPACE)),this.folderSettingsAction=new an("folderSettings","",".settings-tab",!1,async r=>{this.updateTarget(FYe(r)?r.uri:At.USER_LOCAL)}),this.folderSettings=this.instantiationService.createInstance($ke,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=At.USER_LOCAL===this.settingsTarget,this.userRemoteSettings.checked=At.USER_REMOTE===this.settingsTarget,this.workspaceSettings.checked=At.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===At.WORKSPACE){let i=g(10333,"Workspace");t&&(i+=` (${t})`),this.workspaceSettings.label=i}else if(e===At.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===At.WORKSPACE&&this.contextService.getWorkbenchState()===Qi.WORKSPACE&&this.updateTarget(At.USER_LOCAL)}updateTarget(e){return this.settingsTarget===e||e instanceof N&&this.settingsTarget instanceof N&&Yi(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")}};K9e=D([_(2,Ci),_(3,we),_(4,Xo),_(5,Os),_(6,Di)],K9e);let Gke=class extends _d{constructor(e,t,i,n,r,o){super(),this.options=t,this.contextViewService=i,this.instantiationService=n,this.contextKeyService=r,this.keybindingService=o,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=oe(e,fe("div.settings-header-widget")),this.createSearchContainer(oe(this.domNode,fe("div.settings-search-container"))),this.controlsDiv=oe(this.domNode,fe("div.settings-search-controls")),this.options.showResultCount&&(this.countElement=oe(this.controlsDiv,fe(".settings-count-widget")),this.countElement.style.backgroundColor=$e(DT),this.countElement.style.color=$e(dae),this.countElement.style.border=`1px solid ${$e(yt)}`),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(Ec(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=oe(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=()=>iZ(this.keybindingService);return this._register(new pX(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?Od(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()}};Gke=D([_(2,bf),_(3,we),_(4,Le),_(5,Vt)],Gke);var eF,Kke;let qke=class extends Gke{constructor(e,t,i,n,r,o){super(e,t,i,n,r,o),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 xn(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 o=this._chords.map(a=>a.getUserSettingsLabel()||"").join(" ");this.setInputValue(n.quoteRecordedKeys?`"${o}"`:o),this.inputBox.inputElement.title=i,this._onKeybinding.fire(this._chords)}};qke=D([_(2,bf),_(3,we),_(4,Le),_(5,Vt)],qke);var kk;let Qke=(kk=class extends _d{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=ds(document.createElement("div")),this._domNode.setDisplay("none"),this._domNode.setClassName("defineKeybindingWidget"),this._domNode.setWidth(eF.WIDTH),this._domNode.setHeight(eF.HEIGHT);const i=g(8667,"Press desired key combination and then press ENTER.");oe(this._domNode.domNode,fe(".message",void 0,i)),this._domNode.domNode.style.backgroundColor=$e(kh),this._domNode.domNode.style.color=$e(PN),this._domNode.domNode.style.boxShadow=`0 2px 8px ${$e(kI)}`,this._keybindingInputWidget=this._register(this.instantiationService.createInstance(qke,this._domNode.domNode,{ariaLabel:i,history:[],inputBoxStyles:LM})),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=oe(this._domNode.domNode,fe(".output")),this._showExistingKeybindingsNode=oe(this._domNode.domNode,fe(".existing")),e&&oe(e,this._domNode.domNode)}get domNode(){return this._domNode.domNode}define(){return this._keybindingInputWidget.clear(),er.withAsyncBody(async e=>{this._isVisible||(this._isVisible=!0,this._domNode.setDisplay("block"),this._chords=null,this._keybindingInputWidget.setInputValue(""),Ns(this._outputNode),Ns(this._showExistingKeybindingsNode),await Ao(0),this._keybindingInputWidget.focus());const t=this._onHide.event(()=>{e(this.getUserSettingsLabel()),t.dispose()})})}layout(e){const t=Math.round((e.height-eF.HEIGHT)/2);this._domNode.setTop(t);const i=Math.round((e.width-eF.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);oe(t,document.createTextNode(i)),No(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,Ns(this._outputNode),Ns(this._showExistingKeybindingsNode),this._keybindingDisposables.add(new Zk(this._outputNode,pr,I_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(),Ns(this._outputNode),Ns(this._showExistingKeybindingsNode))}hide(){this._domNode.setDisplay("none"),this._isVisible=!1,this._onHide.fire()}},eF=kk,kk.WIDTH=400,kk.HEIGHT=110,kk);Qke=eF=D([_(1,we)],Qke);var hM;let jke=(hM=class extends V{constructor(e,t){super(),this._editor=e,this._widget=this._register(t.createInstance(Qke,null)),this._editor.addOverlayWidget(this)}getId(){return Kke.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(),_t.Smooth);const e=this._editor.getLayoutInfo();return this._widget.layout(new wn(e.width,e.height)),this._widget.define()}},Kke=hM,hM.ID="editor.contrib.defineKeybindingWidget",hM);jke=Kke=D([_(1,we)],jke);var Yke;const Lti=g(3526,"You won't be able to produce this key combination under your current keyboard layout.");let Jke=class extends V{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._userDataProfileService=i,this._keybindingDecorationRenderer=this._register(new yn),this._defineWidget=this._register(this._instantiationService.createInstance(jke,this._editor)),this._register(this._editor.onDidChangeModel(n=>this._update())),this._update()}_update(){this._keybindingDecorationRenderer.value=q9e(this._editor,this._userDataProfileService)?this._instantiationService.createInstance(Xke,this._editor):void 0}showDefineKeybindingWidget(){q9e(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 r=kti.insertSnippet(this._editor.getModel(),this._editor.getPosition());n=r.prepend+n+r.append,this._editor.setPosition(r.position),pc.get(this._editor)?.insert(n,{overwriteBefore:0,overwriteAfter:0})}}};Jke=D([_(1,we),_(2,pg)],Jke);let Xke=Yke=class extends V{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._dec=this._editor.createDecorationsCollection(),this._updateDecorations=this._register(new ln(()=>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=rRe(e.getValue());if(i&&Array.isArray(i.children))for(let n=0,r=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())]}};Zke=D([_(1,Le),_(2,bi),_(3,Ji),_(4,wi),_(5,pg),_(6,Dc),_(7,ps),_(8,Xt),_(9,Is),_(10,Ke),_(11,nce)],Zke);Nit(s=>{s.get(we).createInstance(zke)});function Mti({shouldUseGlobalKeybindings:s=()=>!1}={}){return{...Xce(),[Vt.toString()]:new yi(Zke,[s],!1),[nce.toString()]:new yi(Uke,[],!0),[bi.toString()]:new yi(Vke,[],!0)}}class Nti{constructor(){this._provider=new or,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=mm(t.source,i.source)),n===0&&(n=mm(t.id,i.id)),n})}}var eIe;function _ot(s){if(!Array.isArray(s))return!1;for(let e=0,t=s.length;e{this._extensionService.whenInstalledExtensionsRegistered().then(()=>{this._loadConfigurationsForMode(r)})})),this._register(this._languageService.onDidChange(()=>{for(const[r]of this._done)this._loadConfigurationsForMode(r)}))}async _loadConfigurationsForMode(e){const t=this._languageService.getConfigurationFiles(e),i=Hc(t.map(r=>r.toString()));if(this._done.get(e)===i)return;this._done.set(e,i);const n=await Promise.all(t.map(r=>this._readConfigFile(r)));for(const r of n)this._handleConfig(e,r)}async _readConfigFile(e){try{const t=await this._extensionResourceLoaderService.readExtensionResource(e),i=[];let n=af(t,i);return i.length&&console.error(g(2492,"Errors parsing {0}: {1}",e.toString(),i.map(r=>`[${r.offset}, ${r.length}] ${Uee(r.error)}`).join(` +`))),dD(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(!In(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"&&(W4(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 r=0,o=i.length;r"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`autoClosingPairs\` to be an array.`);return}let n;for(let r=0,o=i.length;r"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`surroundingPairs\` to be an array.`);return}let n;for(let r=0,o=i.length;r"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`colorizedBracketPairs\` to be an array.`);return}const n=[];for(let r=0,o=i.length;r"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`onEnterRules\` to be an array.`);return}let n;for(let r=0,o=i.length;r `,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}}}}}}}},Fti=je.as(tE.JSONContribution);Fti.registerSchema(Nti,Pti);var s2;let gne=(s2=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(tIe)}},s2.ID="workbench.contrib.languageConfigurationExtensionPoint",s2);gne=D([_(0,we)],gne);Ju(gne.ID,gne,Cc.BlockStartup);function Oti(){return{...Xce(),[Di.toString()]:new yi(Hbe,[],!1),[mce.toString()]:new yi(Mti,[],!0)}}let iIe=class extends V{constructor(e,t,i){super(),this._modelService=e,this._textModelService=t,this._undoRedoService=i,this._register(this._modelService.onModelRemoved(n=>{const r=this._undoRedoService.getElements(n.uri);if(!(r.past.length===0&&r.future.length===0)){for(const o of r.past)o instanceof Fme&&o.setDelegate(this);for(const o of r.future)o instanceof Fme&&o.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:()=>wt(n)}))}};iIe=D([_(0,fi),_(1,pn),_(2,iE)],iIe);let nIe=class extends oct{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 r=this.instantiationService.createInstance(T9,i);if(this.ensureResolvedModel(r,e))return r}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:o9.REFERENCE});if(this.ensureResolvedModel(n,e))return n}if(this.providers.has(i.scheme)){await this.resolveTextModelContent(e);const n=this.instantiationService.createInstance(T9,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(Eut(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 See?await this.textFileService.files.canDispose(n):n instanceof Cee&&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 r=n.indexOf(t);r!==-1&&(n.splice(r,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 r=await n.provideTextContent(t);if(r)return r}throw new Error(`Unable to resolve text model content for resource ${e}`)}};nIe=D([_(0,we),_(1,Fr),_(2,Xt),_(3,fi)],nIe);let sIe=class extends V{get resourceModelCollection(){return this._resourceModelCollection||(this._resourceModelCollection=this.instantiationService.createInstance(nIe)),this._resourceModelCollection}get asyncModelCollection(){return this._asyncModelCollection||(this._asyncModelCollection=new act(this.resourceModelCollection)),this._asyncModelCollection}constructor(e,t,i,n,r){super(),this.instantiationService=e,this.fileService=t,this.undoRedoService=i,this.modelService=n,this.uriIdentityService=r,this._resourceModelCollection=void 0,this._asyncModelCollection=void 0,this._register(new iIe(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)}};sIe=D([_(0,we),_(1,Xt),_(2,iE),_(3,fi),_(4,Is)],sIe);function Bti(){return{[pn.toString()]:new yi(sIe,[],!0)}}var rIe,uM;let oIe=(uM=class extends rW{get hasPendingUpdate(){return!!(this.applicationStorageDatabase?.hasPendingUpdate||this.profileStorageDatabase?.hasPendingUpdate||this.workspaceStorageDatabase?.hasPendingUpdate)}constructor(e,t,i){super({flushInterval:rIe.BROWSER_DEFAULT_FLUSH_INTERVAL}),this.workspace=e,this.userDataProfileService=t,this.logService=i,this.applicationStoragePromise=new hc,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 er.settled([this.createApplicationStorage(),this.createProfileStorage(this.profileStorageProfile),this.createWorkspaceStorage()])}async createApplicationStorage(){const e=await Lz.createApplicationStorage(this.logService);this.applicationStorageDatabase=this._register(e),this.applicationStorage=this._register(new lA(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,k_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 Lz.createProfileStorage(this.profileStorageProfile,this.logService);this.profileStorageDatabase=this.profileStorageDisposables.add(t),this.profileStorage=this.profileStorageDisposables.add(new lA(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 Lz.createWorkspaceStorage(this.workspace.id,this.logService);this.workspaceStorageDatabase=this.workspaceStorageDisposables.add(e),this.workspaceStorage=this.workspaceStorageDisposables.add(new lA(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(Xq);t===void 0?e.set(Xq,!0):t&&e.set(Xq,!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 Ry().document.hasFocus()&&!this.hasPendingUpdate}close(){Yy&&(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[cn.USER,cn.MACHINE])for(const i of this.keys(e,t))this.remove(i,e);await this.getStorage(e)?.whenFlushed()}await er.settled([this.applicationStorageDatabase?.clear()??Promise.resolve(),this.profileStorageDatabase?.clear()??Promise.resolve(),this.workspaceStorageDatabase?.clear()??Promise.resolve()])}hasScope(e){return aJe(e)?this.profileStorageProfile.id===e.id:this.workspace.id===e.id}},rIe=uM,uM.BROWSER_DEFAULT_FLUSH_INTERVAL=5*1e3,uM);oIe=rIe=D([_(2,Ke)],oIe);class Wti extends Jq{constructor(){super(...arguments),this.hasPendingUpdate=!1,this.name="in-memory-indexedb-storage"}async clear(){(await this.getItems()).clear()}dispose(){}}const Pp=class Pp extends V{static async createApplicationStorage(e){return Pp.create({id:"global",broadcastChanges:!0},e)}static async createProfileStorage(e,t){return Pp.create({id:`global-${e.id}`,broadcastChanges:!0},t)}static async createWorkspaceStorage(e,t){return Pp.create({id:e},t)}static async create(e,t){try{const i=new Pp(e,t);return await i.whenConnected,i}catch(i){return t.error(`[IndexedDB Storage ${e.id}] create(): ${Po(i,!0)}`),new Wti}}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=`${Pp.STORAGE_DATABASE_PREFIX}${e.id}`,this.broadcastChannel=e.broadcastChanges?this._register(new iPe(this.name)):void 0,this.whenConnected=this.connect(),this.registerListeners()}registerListeners(){this.broadcastChannel&&this._register(this.broadcastChannel.onDidReceiveData(e=>{Vxt(e)&&this._onDidChangeItemsExternal.fire(e)}))}async connect(){try{return await r1.create(this.name,void 0,[Pp.STORAGE_OBJECT_STORE])}catch(e){throw this.logService.error(`[IndexedDB Storage ${this.name}] connect() error: ${Po(e)}`),e}}async getItems(){const e=await this.whenConnected;function t(i){return typeof i=="string"}return e.getKeyValues(Pp.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(Pp.STORAGE_OBJECT_STORE,"readwrite",r=>{const o=[];if(t)for(const[a,c]of t)o.push(r.put(c,a));if(i)for(const a of i)o.push(r.delete(a));return o}),!0)}async optimize(){}async close(){const e=await this.whenConnected;return await this.pendingUpdate,e.close()}async clear(){await(await this.whenConnected).runInTransaction(Pp.STORAGE_OBJECT_STORE,"readwrite",t=>t.clear())}};Pp.STORAGE_DATABASE_PREFIX="vscode-web-state-db-",Pp.STORAGE_OBJECT_STORE="ItemTable";let Lz=Pp;var dw;const Hti=/^extensionKeys\/([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;var gM;let fne=(gM=class extends V{static toKey(e){return`extensionKeys/${XJ(e.id)}@${e.version}`}static fromKey(e){const t=Hti.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[r,o]of dw.readAllExtensionsWithKeysForSync(t)){const a=i.find(c=>Ma(c.identifier,{id:r}))?.manifest.version;for(const c of o)a!==c&&n.push(dw.toKey({id:r,version:c}))}for(const r of n)t.remove(r,Ie.PROFILE)}static readAllExtensionsWithKeysForSync(e){const t=new Map,i=e.keys(Ie.PROFILE,cn.MACHINE);for(const n of i){const r=dw.fromKey(n);if(r){let o=t.get(r.id.toLowerCase());o||t.set(r.id.toLowerCase(),o=[]),o.push(r.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=dw.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=dw.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(Rt(e))return e;const t=e.manifest?e.manifest.publisher:e.publisher,i=e.manifest?e.manifest.name:e.name;return OM(t,i)}getExtensionState(e,t){const i=this.getExtensionId(e),n=this.getExtensionStateRaw(e,t);if(n)try{return JSON.parse(n)}catch(r){this.logService.error(`[mainThreadStorage] unexpected error parsing storage contents (extensionId: ${i}, global: ${t}): ${r}`)}}getExtensionStateRaw(e,t){const i=this.getExtensionId(e),n=this.storageService.get(i,t?Ie.PROFILE:Ie.WORKSPACE);return n&&n?.length>dw.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,cn.MACHINE)}setKeysForSync(e,t){this.storageService.store(dw.toKey(e),JSON.stringify(t),Ie.PROFILE,cn.MACHINE)}getKeysForSync(e){const t=this.productService.extensionSyncedKeys?.[e.id.toLowerCase()],i=this.storageService.get(dw.toKey(e),Ie.PROFILE),n=i?JSON.parse(i):void 0;return n&&t?Ya([...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,cn.MACHINE):this.storageService.remove("extensionStorage.migrationList",Ie.APPLICATION)}},dw=gM,gM.LARGE_STATE_WARNING_THRESHOLD=512*1024,gM);fne=dw=D([_(0,Gi),_(1,xo),_(2,Ke)],fne);var Rz;(function(s){s[s.APPLICATION=-1]="APPLICATION",s[s.PROFILE=0]="PROFILE",s[s.WORKSPACE=1]="WORKSPACE"})(Rz||(Rz={}));class gge extends lA{constructor(e,t){const i=t.read(e);if(super(new Uti(e,t,i)),i!=null)for(const[n,r]of i)this.items.set(n,r)}}class Uti{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 Vti extends rW{constructor(e,t){super({flushInterval:5e3}),this.provider=e,this.fallbackOverride=t,this.applicationStorage=this._register(new gge(Rz.APPLICATION,this.provider)),this.profileStorage=this._register(new gge(Rz.PROFILE,this.provider)),this.workspaceStorage=this._register(new gge(Rz.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)}}VNe(async s=>{const e=s.get(Gi);e instanceof rW&&await e.initialize()});BVt(async s=>{const e=s.get(Dc),t=s.get(Gi);e.onDidChangeFocus(i=>{i||t.flush()})});let aIe=class extends oIe{constructor(e,t,i){super(HNe(),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)}};aIe=D([_(1,pg),_(2,Ke)],aIe);function zti({customProvider:s,fallbackOverride:e}={}){return s!=null?{[Gi.toString()]:new yi(Vti,[s,e],!0),[V3.toString()]:new yi(fne,[],!0)}:{[Gi.toString()]:new yi(aIe,[e],!0),[V3.toString()]:new yi(fne,[],!0)}}class $ti{constructor(){this._systemSchemes=new Set(Object.keys(pe)),this._providerInfo=new Map,this.extUri=new RN(e=>{const t=this._providerInfo.get(e.scheme);return!(t===void 0||t&zn.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 n4=ae("IExtHostFileSystemInfo");var hw;let cIe=hw=class{constructor(e,t){this._fileSystemProvider=new Map,this._writeQueue=new LTe,this._proxy=e.getProxy(We.MainThreadFileSystem);const i=this;this.value=Object.freeze({async stat(n){try{let r;const o=i._fileSystemProvider.get(n.scheme);return o?(await i._proxy.$ensureActivation(n.scheme),r=await o.impl.stat(n)):r=await i._proxy.$stat(n),{type:r.type,ctime:r.ctime,mtime:r.mtime,size:r.size,permissions:r.permissions===up.Readonly?1:void 0}}catch(r){hw._handleError(r)}},async readDirectory(n){try{const r=i._fileSystemProvider.get(n.scheme);return r?(await i._proxy.$ensureActivation(n.scheme),(await r.impl.readDirectory(n)).slice()):await i._proxy.$readdir(n)}catch(r){return hw._handleError(r)}},async createDirectory(n){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,n)):await i._proxy.$mkdir(n)}catch(r){return hw._handleError(r)}},async readFile(n){try{const r=i._fileSystemProvider.get(n.scheme);return r?(await i._proxy.$ensureActivation(n.scheme),(await r.impl.readFile(n)).slice()):(await i._proxy.$readFile(n)).buffer}catch(r){return hw._handleError(r)}},async writeFile(n,r){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,o.extUri.dirname(n)),await i._writeQueue.queueFor(n,()=>Promise.resolve(o.impl.writeFile(n,r,{create:!0,overwrite:!0})))):await i._proxy.$writeFile(n,Ge.wrap(r))}catch(o){return hw._handleError(o)}},async delete(n,r){try{const o=i._fileSystemProvider.get(n.scheme);return o&&!o.isReadonly&&!r?.useTrash?(await i._proxy.$ensureActivation(n.scheme),await o.impl.delete(n,{recursive:!1,...r})):await i._proxy.$delete(n,{recursive:!1,useTrash:!1,atomic:!1,...r})}catch(o){return hw._handleError(o)}},async rename(n,r,o){try{return await i._proxy.$rename(n,r,{overwrite:!1,...o})}catch(a){return hw._handleError(a)}},async copy(n,r,o){try{return await i._proxy.$copy(n,r,{overwrite:!1,...o})}catch(a){return hw._handleError(a)}},isWritableFileSystem(n){const r=t.getCapabilities(n);if(typeof r=="number")return!(r&zn.Readonly)}})}async mkdirp(e,t,i){const n=[];for(;!t.isEqual(i,t.dirname(i));)try{if(!((await e.stat(i)).type&rn.Directory))throw Xc.FileExists(`Unable to create folder '${i.scheme===pe.file?i.fsPath:i.toString(!0)}' that already exists but is not a directory`);break}catch(r){if(Qk(r)!==ot.FileNotFound)throw r;n.push(t.basename(i)),i=t.dirname(i)}for(let r=n.length-1;r>=0;r--){i=t.joinPath(i,n[r]);try{await e.createDirectory(i)}catch(o){if(Qk(o)!==ot.FileExists)throw o}}}static _handleError(e){if(e instanceof Xc)throw e;if(e instanceof LA)switch(e.code){case ot.FileExists:throw Xc.FileExists(e.message);case ot.FileNotFound:throw Xc.FileNotFound(e.message);case ot.FileNotADirectory:throw Xc.FileNotADirectory(e.message);case ot.FileIsADirectory:throw Xc.FileIsADirectory(e.message);case ot.NoPermissions:throw Xc.NoPermissions(e.message);case ot.Unavailable:throw Xc.Unavailable(e.message);default:throw new Xc(e.message,e.name)}if(!(e instanceof Error))throw new Xc(String(e));if(e.name==="ENOPRO"||e.message.includes("ENOPRO"))throw Xc.Unavailable(e.message);switch(e.name){case ot.FileExists:throw Xc.FileExists(e.message);case ot.FileNotFound:throw Xc.FileNotFound(e.message);case ot.FileNotADirectory:throw Xc.FileNotADirectory(e.message);case ot.FileIsADirectory:throw Xc.FileIsADirectory(e.message);case ot.NoPermissions:throw Xc.NoPermissions(e.message);case ot.Unavailable:throw Xc.Unavailable(e.message);default:throw new Xc(e.message,e.name)}}addFileSystemProvider(e,t,i){return this._fileSystemProvider.set(e,{impl:t,extUri:i?.isCaseSensitive?Dn:Xoe,isReadonly:!!i?.isReadonly}),Ee(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??Dn}};cIe=hw=D([_(0,Jr),_(1,n4)],cIe);const Sle=ae("IExtHostConsumerFileSystem");class vot extends xae{get disposed(){return this._disposed}constructor(e,t,i,n,r){super(),this.id=e,this.name=t,this.logger=i,this.proxy=n,this.extension=r,this.offset=0,this._disposed=!1,this.visible=!1,this.setLevel(i.getLevel()),this._register(i.onDidChangeLogLevel(o=>this.setLevel(o)))}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,pB.Clear,e)}replace(e){const t=this.offset;this.info(e),this.proxy.$update(this.id,pB.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+=Ge.fromString(t).byteLength,$Y(this.logger,e,t),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,pB.Append))}dispose(){super.dispose(),this._disposed||(this.proxy.$dispose(this.id),this._disposed=!0)}}class Gti extends vot{appendLine(e){this.append(e)}}let lIe=class{constructor(e,t,i,n,r,o){this.initData=t,this.extHostFileSystem=i,this.extHostFileSystemInfo=n,this.loggerService=r,this.logService=o,this.extensionLogDirectoryPromise=new Map,this.namePool=1,this.channels=new Map,this.visibleChannelId=null,this.proxy=e.getProxy(We.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${xit(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,r=Rt(t)?t:void 0;if(Rt(r)&&!r.trim())throw new Error("illegal argument `languageId`. must not be empty");let o;const a=this.initData.environment.extensionLogLevel?.find(([l])=>An.equals(i.identifier,l))?.[1];a&&(o=Uje(a));const c=n?this.doCreateLogOutputChannel(e,o,i):this.doCreateOutputChannel(e,r,i);return c.then(l=>{this.channels.set(l.id,l),l.visible=l.id===this.visibleChannelId}),n?this.createExtHostLogOutputChannel(e,o??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,r=this.extHostFileSystemInfo.extUri.joinPath(n,`${this.namePool++}-${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`),o=this.loggerService.createLogger(r,{logLevel:"always",donotRotate:!0,donotUseFormatters:!0,hidden:!0}),a=await this.proxy.$register(e,r,t,i.identifier.value);return new vot(a,e,o,this.proxy,i)}async doCreateLogOutputChannel(e,t,i){const n=await this.createExtensionLogDirectory(i),r=e.replace(/[\\/:\*\?"<>\|]/g,""),o=this.extHostFileSystemInfo.extUri.joinPath(n,`${r}.log`),a=`${i.identifier.value}.${r}`,c=this.loggerService.createLogger(o,{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(n){if(Qk(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(r){n(),t.then(o=>o.append(r))},appendLine(r){n(),t.then(o=>o.appendLine(r))},clear(){n(),t.then(r=>r.clear())},replace(r){n(),t.then(o=>o.replace(r))},show(r,o){n(),t.then(a=>a.show(r,o))},hide(){n(),t.then(r=>r.hide())},dispose(){i=!0,t.then(r=>r.dispose())}}}createExtHostLogOutputChannel(e,t,i){const n=new Z,r=()=>{if(n.isDisposed)throw new Error("Channel has been closed")},o=n.add(new I);function a(c){t=c,o.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:o.event,trace(c,...l){r(),i.then(d=>d.trace(c,...l))},debug(c,...l){r(),i.then(d=>d.debug(c,...l))},info(c,...l){r(),i.then(d=>d.info(c,...l))},warn(c,...l){r(),i.then(d=>d.warn(c,...l))},error(c,...l){r(),i.then(d=>d.error(c,...l))},dispose(){n.dispose()}}}};lIe=D([_(0,Jr),_(1,bu),_(2,Sle),_(3,n4),_(4,pf),_(5,Ke)],lIe);const bot=ae("IExtHostOutputService"),Ale=ae("IURITransformerService");class Kti{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 c7(s,e,t){return new RN(i=>iFe(i,t)).isEqual(s,e)}function qti(s,e,t){return c7(s.uri,e.uri,t)?0:mm(s.uri.toString(),e.uri.toString())}function Qti(s,e,t){return s.index!==e.index?s.indext(o,a,i)),r=e.slice(0).sort((o,a)=>t(o,a,i));return s0(n,r,(o,a)=>t(o,a,i))}function iFe(s,e){const t=e.getCapabilities(s.scheme);return!(t&&t&zn.PathCaseSensitive)}class _B extends OYe{static toExtHostWorkspace(e,t,i,n){if(!e)return{workspace:null,added:[],removed:[]};const{id:r,name:o,folders:a,configuration:c,transient:l,isUntitled:d}=e,h=[],u=t;t?a.forEach((v,b)=>{const w=N.revive(v.uri),y=_B._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.indexiFe(v,n)),{added:p,removed:m}=wot(u?u.workspaceFolders:[],f.workspaceFolders,qti,n);return{workspace:f,added:p,removed:m}}static _findFolder(e,t,i){for(let n=0;nnew Pae(c)),n,r,a),this._name=t,this._isUntitled=o,this._workspaceFolders=[],this._structure=Ih.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=Ro(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let dIe=class{constructor(e,t,i,n,r){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 tD,this._canonicalUriProviders=new Map,this._logService=n,this._extHostFileSystemInfo=i,this._uriTransformerService=r,this._requestIdProvider=new Iht,this._barrier=new jd,this._proxy=e.getProxy(We.MainThreadWorkspace),this._messageService=e.getProxy(We.MainThreadMessageService);const o=t.workspace;this._confirmedWorkspace=o?new _B(o.id,o.name,[],!!o.transient,o.configuration?N.revive(o.configuration):null,!!o.isUntitled,a=>iFe(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:vi(Ro(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 r=[];if(Array.isArray(n)&&n.forEach(d=>{N.isUri(d.uri)&&!r.some(h=>c7(h.uri,d.uri,this._extHostFileSystemInfo))&&r.push({uri:d.uri,name:d.name||TA(d.uri)})}),this._unconfirmedWorkspace||[t,i].some(d=>typeof d!="number"||d<0)||i===0&&r.length===0)return!1;const o=this._actualWorkspace?this._actualWorkspace.workspaceFolders:[];if(t+i>o.length)return!1;const a=o.slice(0);a.splice(t,i,...r.map(d=>({uri:d.uri,name:d.name||TA(d.uri),index:void 0})));for(let d=0;df!==d&&c7(h.uri,u.uri,this._extHostFileSystemInfo)))return!1}a.forEach((d,h)=>d.index=h);const{added:c,removed:l}=wot(o,a,Qti,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,r).then(void 0,h=>{this._unconfirmedWorkspace=void 0;const u={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(Ze.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 r=this.getWorkspaceFolder(i,!0);if(!r)return n;typeof t>"u"&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let o=MN(r.uri,i);return t&&r.name&&(o=`${r.name}/${o}`),o}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=_B.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}=_B.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,r=Ue.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${n.value}, entryPoint: findFiles`);let o="",a=!0;return t===null?a=!1:t!==void 0&&(typeof t=="string"?o=t:o=t.pattern),this._findFilesImpl(e,void 0,{exclude:o,maxResults:i,useDefaultExcludes:a,useDefaultSearchExcludes:!1,useIgnoreFiles:!1},r)}findFiles2(e,t={},i,n=Ue.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=Ue.None){if(n&&n.isCancellationRequested)return Promise.resolve([]);const r=typeof i.exclude=="string"?i.exclude:i.exclude?i.exclude.pattern:void 0,o={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:r,shouldGlobSearch:typeof i.fuzzy=="boolean"?!i.fuzzy:!0,_reason:"startFileSearch"};let a;if(e){const{includePattern:c,folder:l}=fge(Qf.from(e));a=l,o.includePattern=c}else{const{includePattern:c,folder:l}=fge(Qf.from(t));a=l,o.filePattern=c}return this._proxy.$startFileSearch(a??null,o,n).then(c=>Array.isArray(c)?c.map(l=>N.revive(l)):[])}async findTextInFiles(e,t,i,n,r=Ue.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${n.value}, entryPoint: findTextInFiles`);const o=this._requestIdProvider.getNext(),a=typeof t.previewOptions>"u"?{matchLines:100,charsPerLine:1e4}:t.previewOptions,{includePattern:c,folder:l}=fge(Qf.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[o]=u=>{const f=N.revive(u.resource);u.results.forEach(p=>{const m=Mr(p);L9t(m)?i({uri:f,preview:{text:m.preview.text,matches:h8(m.preview.matches,v=>new Xn(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))},ranges:h8(m.ranges,v=>new Xn(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))}):i({uri:f,text:m.text,lineNumber:m.lineNumber})})},r.isCancellationRequested)return{};try{const u=await this._proxy.$startTextSearch(e,l??null,h,o,r);return delete this._activeSearchCallbacks[o],u||{}}catch(u){throw delete this._activeSearchCallbacks[o],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 r=await n.provideEditSessionIdentity(i,t);if(this._logService.info("Provider returned edit session identifier: ",r),!!r)return r}async $provideEditSessionIdentityMatch(e,t,i,n){this._logService.info("Getting edit session identifier for workspaceFolder",e);const r=await this.resolveWorkspaceFolder(N.revive(e));if(!r){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",r);const o=this._editSessionIdentityProviders.get(r.uri.scheme);if(this._logService.info(`Provider for scheme ${r.uri.scheme} is defined: `,!!o),!o)return;const a=await o.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 r=function(a){t.call(i,a)};return r.extension=e,this._onWillCreateEditSessionIdentityEvent.event(r,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(r,o)=>{const a=Date.now();await Promise.resolve(r),Date.now()-a>i&&this._logService.warn("SLOW edit session create-participant",o.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 r=await n.provideCanonicalUri?.(N.revive(e),t,i);if(r)return r}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(N.revive(e),{targetScheme:t},i)}};dIe=D([_(0,Jr),_(1,bu),_(2,n4),_(3,Ke),_(4,Ale)],dIe);const dE=ae("IExtHostWorkspace");function fge(s){let e,t;return s&&(typeof s=="string"?e=s:(e=s.pattern,t=N.revive(s.baseUri))),{includePattern:e,folder:t}}var QV,Ik;let hIe=(Ik=class{constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(We.MainThreadDecorations)}registerFileDecorationProvider(e,t){const i=QV._handlePool++;this._provider.set(i,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(i,t.identifier.value);const n=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(r=>{if(!r){this._proxy.$onDidChange(i,null);return}const o=z_(r);if(o.length<=QV._maxEventSize){this._proxy.$onDidChange(i,o);return}this._logService.warn("[Decorations] CAPPING events from decorations provider",t.identifier.value,o.length);const a=o.map(d=>({uri:d,rank:Tct(d.path,"/")})),c=d8(a,(d,h)=>d.rank-h.rank||mm(d.uri.path,h.uri.path)),l=[];e:for(const d of c){let h;for(const u of d){const f=xb(u.uri.path);if(h!==f&&(h=f,l.push(u.uri)>=QV._maxEventSize))break e}}this._proxy.$onDidChange(i,l)});return new js(()=>{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:r,extensionDescription:o}=this._provider.get(e);return await Promise.all(t.map(async a=>{try{const{uri:c,id:l}=a,d=await Promise.resolve(r.provideFileDecoration(N.revive(c),i));if(!d)return;try{l$.validate(d),d.badge&&typeof d.badge!="string"&&ze(o,"codiconDecoration"),n[l]=[d.propagate,d.tooltip,d.badge,d.color]}catch(h){this._logService.warn(`INVALID decoration from extension '${o.identifier.value}': ${h}`)}}catch(c){this._logService.error(c)}})),n}},QV=Ik,Ik._handlePool=0,Ik._maxEventSize=250,Ik);hIe=QV=D([_(0,Jr),_(1,Ke)],hIe);const yot=ae("IExtHostDecorations");function H4(s,e){if(e){const t=e.split(".");let i=s;for(let n=0;i&&nthis._actual)}$initializeConfiguration(e){this._actual=new Zti(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(i=>i.$acceptConfigurationChanged(e,t))}};uIe=D([_(0,Jr),_(1,dE),_(2,Ke)],uIe);class Zti{constructor(e,t,i,n){this._onDidChangeConfiguration=new I,this._proxy=e,this._logService=n,this._extHostWorkspace=t,this._configuration=w3.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=w3.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,i))}getConfiguration(e,t,i){const n=Q9e(t)||{},r=this._toReadonlyValue(e?H4(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 o(c){if(c==null)return null;if(typeof c=="boolean")return c?At.USER:At.WORKSPACE;switch(c){case YT.Global:return At.USER;case YT.Workspace:return At.WORKSPACE;case YT.WorkspaceFolder:return At.WORKSPACE_FOLDER}}const a={has(c){return typeof H4(r,c)<"u"},get:(c,l)=>{this._validateConfigurationAccess(e?`${e}.${c}`:c,n,i?.identifier);let d=H4(r,c);if(typeof d>"u")d=l;else{let h;const u=(f,p)=>{if(In(f)){let m;const v=()=>{h=h||Ds(r),m=m||H4(h,p)};return new Proxy(f,{get:(b,w)=>{if(typeof w=="string"&&w.toLowerCase()==="tojson")return v(),()=>m;if(h)return m=m||H4(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)?Ds(f):f};d=u(d,c)}return d},update:(c,l,d,h)=>{c=e?`${e}.${c}`:c;const u=o(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:Ds(l.policy?.value??l.default?.value),globalValue:Ds(l.user?.value??l.application?.value),workspaceValue:Ds(l.workspace?.value),workspaceFolderValue:Ds(l.workspaceFolder?.value),defaultLanguageValue:Ds(l.default?.override),globalLanguageValue:Ds(l.user?.override??l.application?.override),workspaceLanguageValue:Ds(l.workspace?.override),workspaceFolderLanguageValue:Ds(l.workspaceFolder?.override),languageIds:Ds(l.overrideIdentifiers)}}};return typeof r=="object"&&mp(a,r,!1),Object.freeze(a)}_toReadonlyValue(e){const t=i=>In(i)?new Proxy(i,{get:(n,r)=>t(n[r]),set:(n,r,o)=>{throw new Error(`TypeError: Cannot assign to read only property '${String(r)}' of object`)},deleteProperty:(n,r)=>{throw new Error(`TypeError: Cannot delete read only property '${String(r)}' of object`)},defineProperty:(n,r)=>{throw new Error(`TypeError: Cannot define property '${String(r)}' 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=rf.test(e)?ct.RESOURCE:this._configurationScopes.get(e),r=i?`[${i.value}] `:"";if(ct.RESOURCE===n){typeof t?.resource>"u"&&this._logService.warn(`${r}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(ct.WINDOW===n){t?.resource&&this._logService.warn(`${r}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 cRe(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(n,r)=>i.affectsConfiguration(n,Q9e(r))})}_toMap(e){return e.reduce((t,i)=>(t.set(i[0],i[1]),t),new Map)}}const hE=ae("IExtHostConfiguration"),ZI=(s,e,t,i)=>{let n=e;return{enumerable:!0,configurable:!1,get(){return n},set(r){if(!t(n,r)){const o=n;n=r,s.listener?.(i(r,o))}}}},kP=(s,e)=>s===e,wE={range:(s,e)=>s===e?!0:!s||!e?!1:s.isEqual(e),label:kP,description:kP,sortText:kP,busy:kP,error:kP,canResolveChildren:kP,tags:(s,e)=>!(s.length!==e.length||s.some(t=>!e.find(i=>t.id===i.id)))},IP=s=>e=>({op:Vd.SetProp,update:s(e)}),eii=(s,e)=>({range:(()=>{let t;const i=IP(n=>({range:F.lift(tt.from(n))}));return{enumerable:!0,configurable:!1,get(){return t},set(n){s.listener?.({op:Vd.DocumentSynced}),wE.range(t,n)||(t=n,s.listener?.(i(n)))}}})(),label:ZI(s,e,wE.label,IP(t=>({label:t}))),description:ZI(s,void 0,wE.description,IP(t=>({description:t}))),sortText:ZI(s,void 0,wE.sortText,IP(t=>({sortText:t}))),canResolveChildren:ZI(s,!1,wE.canResolveChildren,t=>({op:Vd.UpdateCanResolveChildren,state:t})),busy:ZI(s,!1,wE.busy,IP(t=>({busy:t}))),error:ZI(s,void 0,wE.error,IP(t=>({error:Fs.fromStrict(t)||null}))),tags:ZI(s,[],wE.tags,(t,i)=>({op:Vd.SetTags,new:t.map($b.from),old:i.map($b.from)}))}),tii=s=>{const e=bn.fromString(s.extId),t=new tP(e.controllerId,e.localId,s.label,N.revive(s.uri)||void 0);return t.range=tt.to(s.range||void 0),t.description=s.description||void 0,t.sortText=s.sortText||void 0,t.tags=s.tags.map(i=>$b.to({id:art(i).tagId})),t},j9e=s=>{let e;for(const t of s.tests){const i=tii(t.item);gle(i).parent=e,e=i}return e};class tP{constructor(e,t,i,n){if(t.includes(s_.Delimiter))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);const r=Mjt(this,e);Object.defineProperties(this,{id:{value:t,enumerable:!0,writable:!1},uri:{value:n,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return r.parent instanceof nFe?void 0:r.parent}},children:{value:Rjt(r,gle,tP),enumerable:!0,writable:!1},...eii(r,i)})}}class nFe extends tP{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}}class iii extends Ijt{constructor(e,t,i){super({controllerId:e,getDocumentVersion:n=>n&&i.getDocument(n)?.version,getApiFor:gle,getChildren:n=>n.children,root:new nFe(e,t),toITestItem:CI.from})}}let gIe=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=jg.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:aLt,name:g(576,"Extension Telemetry{0}",this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0}),this._register(this._outputLogger),this._register(t.onDidChangeLogLevel(i=>{Bje(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()===Kn.Trace)}getTelemetryConfiguration(){return this._level===jg.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=jg.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=jg.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=jg.USAGE:!1}}instantiateLogger(e,t,i){const n=this.getTelemetryDetails(),r=new Cot(t,i,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:n.isUsageEnabled,isErrorsEnabled:n.isErrorsEnabled}),o=this._telemetryLoggers.get(e.identifier.value)??[];return this._telemetryLoggers.set(e.identifier.value,[...o,r]),r.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"]=Sot(this.initData.telemetryInfo.firstSessionDate),t["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case sv.Web:t["common.uikind"]="web";break;case sv.Desktop:t["common.uikind"]="desktop";break;default:t["common.uikind"]="unknown"}return t["common.remotename"]=W6(dLt(this.initData.remote.authority)),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;const t=this.getTelemetryDetails();this._telemetryLoggers.forEach((i,n)=>{const r=i.filter(o=>!o.isDisposed);r.length===0?this._telemetryLoggers.delete(n):this._telemetryLoggers.set(n,r)}),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(o=>!o.isDisposed);if(!n)return this._telemetryLoggers.delete(e.value),!1;let r=!1;for(const o of n)o.ignoreUnhandledExtHostErrors||(o.logError(t),r=!0);return r}};gIe=D([_(0,bu),_(1,pf)],gIe);class Cot{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,r,o,a){this._extension=i,this._logger=n,this._inLoggingOnlyMode=r,this._commonProperties=o,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=wHe(t,[]),this._additionalCommonProperties&&(t=mp(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=mp(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=wHe(i,[]),r=new Error(n.message,{cause:n.cause});r.stack=n.stack,r.name=n.name,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(r,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 Sot(s){const e=Date.now()-new Date(s).getTime();return isNaN(e)?!1:e<1e3*60*60*24}const Ele=ae("IExtHostTelemetry");var sS,D7,k7,WGe;let fIe=(WGe=class{constructor(e,t,i){Ht(this,sS);Ht(this,D7);Ht(this,k7);this._commands=new Map,this._apiCommands=new Map,St(this,sS,e.getProxy(We.MainThreadCommands)),this._logService=t,St(this,k7,i),St(this,D7,e.getProxy(We.MainThreadTelemetry)),this.converter=new nii(this,n=>{const r=this._apiCommands.get(n);return r?.result===sn.Void?r:void 0},t),this._argumentProcessors=[{processArgument(n){return Mr(n)}},{processArgument(n){return T2(n,function(r){if(F.isIRange(r))return tt.to(r);if(re.isIPosition(r))return Yr.to(r);if(F.isIRange(r.range)&&N.isUri(r.uri))return ff.to(r);if(r instanceof Ge)return r.buffer.buffer;if(!Array.isArray(r))return r})}}]}registerArgumentProcessor(e){this._argumentProcessors.push(e)}registerApiCommand(e){const t=this.registerCommand(!1,e.id,async(...i)=>{const n=e.args.map((o,a)=>{if(!o.validate(i[a]))throw new Error(`Invalid argument '${o.name}' when running '${e.id}', received: ${typeof i[a]=="object"?JSON.stringify(i[a],null," "):i[a]} `);return o.convert(i[a])}),r=await this.executeCommand(e.internalId,...n);return e.result.convert(r,i,this.converter)},void 0,{description:e.description,args:e.args,returns:e.result.description});return this._apiCommands.set(e.id,e),new js(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,i,n,r,o){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:r,extension:o}),e&&Ce(this,sS).$registerCommand(t),new js(()=>{this._commands.delete(t)&&e&&Ce(this,sS).$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,sS).$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let n=!1;const r=T2(t,function(o){if(o instanceof ws)return Yr.from(o);if(o instanceof Xn)return tt.from(o);if(o instanceof Ap)return ff.from(o);if(Dy.isNotebookRange(o))return zy.from(o);if(o instanceof ArrayBuffer)return n=!0,Ge.wrap(new Uint8Array(o));if(o instanceof Uint8Array)return n=!0,Ge.wrap(o);if(o instanceof Ge)return n=!0,o;if(!Array.isArray(o))return o});try{const o=await Ce(this,sS).$executeCommand(e,n?new Jd(r):r,i);return Mr(o)}catch(o){if(o instanceof Error&&o.message==="$executeCommand:retry")return this._doExecuteCommand(e,t,!1);throw o}}}async _executeContributedCommand(e,t,i){const n=this._commands.get(e);if(!n)throw new Error("Unknown command");const{callback:r,thisArg:o,metadata:a}=n;if(a?.args)for(let l=0;lthis._argumentProcessors.reduce((r,o)=>o.processArgument(r,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,sS).$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)}},sS=new WeakMap,D7=new WeakMap,k7=new WeakMap,WGe);fIe=D([_(0,Jr),_(1,Ke),_(2,Ele)],fIe);const iP=ae("IExtHostCommands");class nii{constructor(e,t,i){this._commands=e,this._lookupApiCommand=t,this._logService=i,this.delegatingCommandId=`__vsc${ao()}`,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((r,o)=>r.convert(e.arguments&&e.arguments[o]));else if(tr(e.arguments)){const r=`${e.command} /${++this._cachIdPool}`;this._cache.set(r,e),t.add(Ee(()=>{this._cache.delete(r),this._logService.trace("CommandsConverter#DISPOSE",r)})),i.$ident=r,i.id=this.delegatingCommandId,i.arguments=[r],this._logService.trace("CommandsConverter#CREATE",e.command,r)}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 Ka=class Ka{static Arr(e){return new Ka(`${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 Ka(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 Ka(e??this.name,t??this.description,this.validate,this.convert)}};Ka.Uri=new Ka("uri","Uri of a text document",e=>N.isUri(e),e=>e),Ka.Position=new Ka("position","A position in a text document",e=>ws.isPosition(e),Yr.from),Ka.Range=new Ka("range","A range in a text document",e=>Xn.isRange(e),tt.from),Ka.Selection=new Ka("selection","A selection in a text document",e=>uC.isSelection(e),zb.from),Ka.Number=new Ka("number","",e=>typeof e=="number",e=>e),Ka.String=new Ka("string","",e=>typeof e=="string",e=>e),Ka.StringArray=Ka.Arr(Ka.String),Ka.CallHierarchyItem=new Ka("item","A call hierarchy item",e=>e instanceof tle,bN.from),Ka.TypeHierarchyItem=new Ka("item","A type hierarchy item",e=>e instanceof nle,rL.from),Ka.TestItem=new Ka("testItem","A VS Code TestItem",e=>e instanceof tP,CI.from);let ut=Ka;const Soe=class Soe{constructor(e,t){this.description=e,this.convert=t}};Soe.Void=new Soe("no result",e=>e);let sn=Soe;class fn{constructor(e,t,i,n,r){this.id=e,this.internalId=t,this.description=i,this.args=n,this.result=r}}const pIe=new Map;function sii(s,e){e?pIe.set(s,e):pIe.delete(s)}function rii(s){return pIe.get(s)}class oii extends Xqe{constructor(e,t,i,n,r,o,a){super(t,i,n,r),this._proxy=e,this._languageId=o,this._isDirty=a,this._isDisposed=!1}dispose(){Zf(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return ns(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===` -`?T_.LF:T_.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){Zf(!this._isDisposed),this._languageId=e}_acceptIsDirty(e){Zf(!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,r=t.end.line,o=[];o.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 aii(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 ws(t.index,Math.min(t.remainder,i))}_validateRange(e){if(!(e instanceof Xn))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 Xn(t.line,t.character,i.line,i.character)}_validatePosition(e){if(!(e instanceof ws))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 r=this._lines[t].length;i<0?(i=0,n=!0):i>r&&(i=r,n=!0)}return n?new ws(t,i):e}_getWordRangeAtPosition(e,t){const i=this._validatePosition(e);if(!t)t=rii(this._languageId);else if(ATe(t))throw new Error(`[getWordRangeAtPosition]: ignoring custom regexp '${t.source}' because it matches the empty string.`);const n=Pk(i.character+1,j7(t),this._lines[i.line],0);if(n)return new Xn(i.line,n.startColumn-1,i.line,n.endColumn-1)}}class aii{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 Xn(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Xn(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 Aoe=class Aoe{constructor(e,t,i){const n=Aoe._Keys.nextId();e.$registerTextEditorDecorationType(t.identifier,n,ixe.from(i)),this.value=Object.freeze({key:n,dispose(){e.$removeTextEditorDecorationType(n)}})}};Aoe._Keys=new PU("TextEditorDecorationType");let mIe=Aoe;class cii{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 ws)i=new Xn(e,e);else if(e instanceof Xn)i=e;else throw new Error("Unrecognized location");this._pushEdit(i,t,!1)}insert(e,t){this._throwIfFinalized(),this._pushEdit(new Xn(e,e),t,!0)}delete(e){this._throwIfFinalized();let t=null;if(e instanceof Xn)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!==T_.LF&&e!==T_.CRLF)throw Fi("endOfLine");this._setEndOfLine=e}}class lii{constructor(e,t,i,n){this._proxy=e,this._id=t,this._accept(i),this._logService=n;const r=this;this.value={get tabSize(){return r._tabSize},set tabSize(o){r._setTabSize(o)},get indentSize(){return r._indentSize},set indentSize(o){r._setIndentSize(o)},get insertSpaces(){return r._insertSpaces},set insertSpaces(o){r._setInsertSpaces(o)},get cursorStyle(){return r._cursorStyle},set cursorStyle(o){r._setCursorStyle(o)},get lineNumbers(){return r._lineNumbers},set lineNumbers(o){r._setLineNumbers(o)}}}_accept(e){this._tabSize=e.tabSize,this._indentSize=e.indentSize,this._originalIndentSize=e.originalIndentSize,this._insertSpaces=e.insertSpaces,this._cursorStyle=e.cursorStyle,this._lineNumbers=gB.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:gB.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=gB.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 dii{constructor(e,t,i,n,r,o,a,c){this.id=e,this._proxy=t,this._logService=i,this._disposed=!1,this._hasDecorationsForKey=new Set,this._selections=r,this._options=new lii(this._proxy,this.id,o,i),this._visibleRanges=a,this._viewColumn=c;const l=this;this.value=Object.freeze({get document(){return n.value},set document(d){throw new T1("document")},get selection(){return l._selections&&l._selections[0]},set selection(d){if(!(d instanceof uC))throw Fi("selection");l._selections=[d],l._trySetSelection()},get selections(){return l._selections},set selections(d){if(!Array.isArray(d)||d.some(h=>!(h instanceof uC)))throw Fi("selections");l._selections=d,l._trySetSelection()},get visibleRanges(){return l._visibleRanges},set visibleRanges(d){throw new T1("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 T1("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 cii(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=>tt.from(p));else if(h instanceof ws){const{lineNumber:p,column:m}=Yr.from(h);f=[{startLineNumber:p,startColumn:m,endLineNumber:p,endColumn:m}]}else if(h instanceof Xn)f=[tt.from(h)];else{f=[];for(const p of h)if(p instanceof Xn)f.push(tt.from(p));else{const{lineNumber:m,column:v}=Yr.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(lrt(h))return t.$trySetDecorations(e,d.key,Fjt(h));{const f=new Array(4*h.length);for(let p=0,m=h.length;pt.$tryRevealRange(e,tt.from(d),h||q9.Default))},show(d){t.$tryShowEditor(e,Dl.from(d))},hide(){t.$tryHideEditor(e)},[Symbol.for("debug.description")](){return`TextEditor(${this.document.uri.toString()})`}})}dispose(){Zf(!this._disposed),this._disposed=!0}_acceptOptions(e){Zf(!this._disposed),this._options._accept(e)}_acceptVisibleRanges(e){Zf(!this._disposed),this._visibleRanges=e}_acceptViewColumn(e){Zf(!this._disposed),this._viewColumn=e}_acceptSelections(e){Zf(!this._disposed),this._selections=e}async _trySetSelection(){const e=this._selections.map(zb.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(r=>r.range);i.sort((r,o)=>r.end.line===o.end.line?r.end.character===o.end.character?r.start.line===o.start.line?r.start.character-o.start.character:r.start.line-o.start.line:r.end.character-o.end.character:r.end.line-o.end.line);for(let r=0,o=i.length-1;r({range:tt.from(r.range),text:r.text,forceMoveMarkers:r.forceMoveMarkers}));return this._proxy.$tryApplyEdits(this.id,t.documentVersionId,n,{setEndOfLine:typeof t.setEndOfLine=="number"?KH.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 hii{constructor(e){this.value=e,this._count=0}ref(){this._count++}unref(){return--this._count===0}}let _Ie=class{constructor(e,t){this._extHostRpc=e,this._logService=t,this._activeEditorId=null,this._editors=new Map,this._documents=new gi,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 r of e.removedDocuments){const o=N.revive(r),a=this._documents.get(o);a?.unref()&&(this._documents.delete(o),t.push(a.value))}if(e.addedDocuments)for(const r of e.addedDocuments){const o=N.revive(r.uri);let a=this._documents.get(o);if(a&&o.scheme!==pe.vscodeNotebookCell&&o.scheme!==pe.vscodeInteractiveInput)throw new Error(`document '${o} already exists!'`);a||(a=new hii(new oii(this._extHostRpc.getProxy(We.MainThreadDocuments),o,r.lines,r.EOL,r.versionId,r.languageId,r.isDirty)),this._documents.set(o,a),i.push(a.value)),a.ref()}if(e.removedEditors)for(const r of e.removedEditors){const o=this._editors.get(r);this._editors.delete(r),o&&n.push(o)}if(e.addedEditors)for(const r of e.addedEditors){const o=N.revive(r.documentUri);Zf(this._documents.has(o),`document '${o}' does not exist`),Zf(!this._editors.has(r.id),`editor '${r.id}' already exists!`);const a=this._documents.get(o).value,c=new dii(r.id,this._extHostRpc.getProxy(We.MainThreadTextEditors),this._logService,new Ca(()=>a.document),r.selections.map(zb.to),r.options,r.visibleRanges.map(l=>tt.to(l)),typeof r.editorPosition=="number"?Dl.to(r.editorPosition):void 0);this._editors.set(r.id,c)}e.newActiveEditor!==void 0&&(Zf(e.newActiveEditor===null||this._editors.has(e.newActiveEditor),`active editor '${e.newActiveEditor}' does not exist`),this._activeEditorId=e.newActiveEditor),wt(t),wt(n),e.removedDocuments&&this._onDidRemoveDocuments.fire(t),e.addedDocuments&&this._onDidAddDocuments.fire(i),(e.removedEditors||e.addedEditors)&&this._onDidChangeVisibleTextEditors.fire(this.allEditors().map(r=>r.value)),e.newActiveEditor!==void 0&&this._onDidChangeActiveTextEditor.fire(this.activeEditor())}getDocument(e){return this._documents.get(e)?.value}allDocuments(){return ui.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()]}};_Ie=D([_(0,Jr),_(1,Ke)],_Ie);const s4=ae("IExtHostDocumentsAndEditors"),r4=ae("IExtHostTerminalService");class Y9e 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(o=>this._pidPromiseComplete=o);const r=this;this.value={get name(){return r._name||""},get processId(){return r._pidPromise},get creationOptions(){return r._creationOptions},get exitStatus(){return r._exitStatus},get state(){return r._state},get selection(){return r._selection},get shellIntegration(){return r.shellIntegration},sendText(o,a=!0){r._checkDisposed(),r._proxy.$sendText(r._id,o,a)},show(o){r._checkDisposed(),r._proxy.$show(r._id,o)},hide(){r._checkDisposed(),r._proxy.$hide(r._id)},dispose(){r._disposed||(r._disposed=!0,r._proxy.$dispose(r._id))},get dimensions(){if(!(r._cols===void 0||r._rows===void 0))return{columns:r._cols,rows:r._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:Aot(e.iconPath)??void 0,color:$2.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,r){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:$2.isThemeColor(r)?r.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:Dl.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 pge{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:Hg.OverrideDimensions,value:{cols:t.columns,rows:t.rows}})}),this._pty.onDidChangeName?.(t=>{this._onDidChangeProperty.fire({type:Hg.Title,value:t})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:"",windowsPty:void 0})}}let uii=1,vIe=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 yn),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(We.MainThreadTerminalService),this._bufferer=new mrt(this._proxy.$sendProcessData),this._proxy.$registerProcessSupport(e),this._extHostCommands.registerArgumentProcessor({processArgument:n=>{const r=o=>{const a=o;return this.getTerminalById(a.instanceId)?.value};switch(n?.$mid){case ys.TerminalContext:return r(n);default:{if(Array.isArray(n))for(let o=0;o{for(const[n,r]of this._terminalProcesses)r.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 Y9e(this._proxy,ao(),e,e.name),n=new pge(e.pty);return i.createExtensionTerminal(e.location,t,this._serializeParentTerminal(e,t).resolvedExtHostIdentifier,Aot(e.iconPath),fii(e.color)).then(r=>{const o=this._setupExtHostProcessListeners(r,n);this._terminalProcessDisposables[r]=o}),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(r=>r.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 pge(t),r=this._setupExtHostProcessListeners(e,n);this._terminalProcessDisposables[e]=r}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 r=this._terminals.splice(n,1)[0];r.setExitStatus(t,i),this._onDidCloseTerminal.fire(r.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 r={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},o=new Y9e(this._proxy,e,r,i);this._terminals.push(o),this._onDidOpenTerminal.fire(o.value),o.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(r=>{const o=this.onDidOpenTerminal(async a=>{a===i.value&&(o.dispose(),r())})});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(r=>this._proxy.$sendProcessReady(e,r.pid,r.cwd,r.windowsPty))),i.add(t.onDidChangeProperty(r=>this._proxy.$sendProcessProperty(e,r))),this._bufferer.startBuffering(e,t.onProcessData),i.add(t.onProcessExit(r=>this._onProcessExit(e,r))),this._terminalProcesses.set(e,t);const n=this._extensionTerminalAwaitingStart[e];return n&&t instanceof pge&&(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:Hg.InitialCwd,value:t}))}$acceptProcessRequestCwd(e){this._terminalProcesses.get(e)?.getCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:Hg.Cwd,value:t}))}$acceptProcessRequestLatency(e){return Promise.resolve(e)}registerLinkProvider(e){return this._linkProviders.add(e),this._linkProviders.size===1&&this._proxy.$startLinkProvider(),new js(()=>{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 js(()=>{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 js(()=>{this._quickFixProviders.delete(e),this._proxy.$unregisterQuickFixProvider(e)})}async $provideTerminalQuickFixes(e,t){const i=new li().token;if(i.isCancellationRequested)return;const n=this._quickFixProviders.get(e);if(!n)return;const r=await n.provideTerminalQuickFixes(t,i);if(r===null||Array.isArray(r)&&r.length===0)return;const o=new Z;if(this._lastQuickFixCommands.value=o,!Array.isArray(r))return r?Sie.from(r,this._extHostCommands.converter,o):void 0;const a=[];for(const c of r){const l=Sie.from(c,this._extHostCommands.converter,o);l&&a.push(l)}return a}async $createContributedProfileTerminal(e,t){const i=new li().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 r=new li;this._terminalLinkCancellationSource.set(e,r);const o=[],a={terminal:i.value,line:t},c=[];for(const h of this._linkProviders)c.push(er.withAsyncBody(async u=>{r.token.onCancellationRequested(()=>u({provider:h,links:[]}));const f=await h.provideTerminalLinks(a,r.token)||[];r.token.isCancellationRequested||u({provider:h,links:f})}));const l=await Promise.all(c);if(r.token.isCancellationRequested)return[];const d=new Map;for(const h of l)h&&h.links.length>0&&o.push(...h.links.map(u=>{const f={id:uii++,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),o}$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 J9e),this._setEnvironmentVariableCollection(e.identifier.value,t)),t.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(e,t){const i=_rt(t.map),n=eYt(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 J9e(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)}))}};vIe=D([_(1,iP),_(2,Jr)],vIe);class J9e 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 gii(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:KT.Replace,options:i??{applyAtProcessCreation:!0},scope:n})}append(e,t,i,n){this._setIfDiffers(e,{value:t,type:KT.Append,options:i??{applyAtProcessCreation:!0},scope:n})}prepend(e,t,i,n){this._setIfDiffers(e,{value:t,type:KT.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),r=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!==r.applyAtProcessCreation||n.options?.applyAtShellIntegration!==r.applyAtShellIntegration||n.scope?.workspaceFolder?.index!==t.scope?.workspaceFolder?.index){const o=this.getKey(e,t.scope),a={variable:e,...t,options:r};this.map.set(o,a),this._onDidChangeCollection.fire()}}get(e,t){const i=this.getKey(e,t),n=this.map.get(i);return n?X9e(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,X9e(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 r;typeof e=="string"?r=e:r=e?.value.split(` + - 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}}}}}}}},Oti=je.as(tE.JSONContribution);Oti.registerSchema(Pti,Fti);var s2;let gne=(s2=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(tIe)}},s2.ID="workbench.contrib.languageConfigurationExtensionPoint",s2);gne=D([_(0,we)],gne);Ju(gne.ID,gne,Cc.BlockStartup);function Bti(){return{...Xce(),[Di.toString()]:new yi(Hbe,[],!1),[mce.toString()]:new yi(Nti,[],!0)}}let iIe=class extends V{constructor(e,t,i){super(),this._modelService=e,this._textModelService=t,this._undoRedoService=i,this._register(this._modelService.onModelRemoved(n=>{const r=this._undoRedoService.getElements(n.uri);if(!(r.past.length===0&&r.future.length===0)){for(const o of r.past)o instanceof Fme&&o.setDelegate(this);for(const o of r.future)o instanceof Fme&&o.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:()=>wt(n)}))}};iIe=D([_(0,fi),_(1,pn),_(2,iE)],iIe);let nIe=class extends oct{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 r=this.instantiationService.createInstance(T9,i);if(this.ensureResolvedModel(r,e))return r}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:o9.REFERENCE});if(this.ensureResolvedModel(n,e))return n}if(this.providers.has(i.scheme)){await this.resolveTextModelContent(e);const n=this.instantiationService.createInstance(T9,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(Eut(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 See?await this.textFileService.files.canDispose(n):n instanceof Cee&&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 r=n.indexOf(t);r!==-1&&(n.splice(r,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 r=await n.provideTextContent(t);if(r)return r}throw new Error(`Unable to resolve text model content for resource ${e}`)}};nIe=D([_(0,we),_(1,Fr),_(2,Xt),_(3,fi)],nIe);let sIe=class extends V{get resourceModelCollection(){return this._resourceModelCollection||(this._resourceModelCollection=this.instantiationService.createInstance(nIe)),this._resourceModelCollection}get asyncModelCollection(){return this._asyncModelCollection||(this._asyncModelCollection=new act(this.resourceModelCollection)),this._asyncModelCollection}constructor(e,t,i,n,r){super(),this.instantiationService=e,this.fileService=t,this.undoRedoService=i,this.modelService=n,this.uriIdentityService=r,this._resourceModelCollection=void 0,this._asyncModelCollection=void 0,this._register(new iIe(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)}};sIe=D([_(0,we),_(1,Xt),_(2,iE),_(3,fi),_(4,Is)],sIe);function Wti(){return{[pn.toString()]:new yi(sIe,[],!0)}}var rIe,uM;let oIe=(uM=class extends rW{get hasPendingUpdate(){return!!(this.applicationStorageDatabase?.hasPendingUpdate||this.profileStorageDatabase?.hasPendingUpdate||this.workspaceStorageDatabase?.hasPendingUpdate)}constructor(e,t,i){super({flushInterval:rIe.BROWSER_DEFAULT_FLUSH_INTERVAL}),this.workspace=e,this.userDataProfileService=t,this.logService=i,this.applicationStoragePromise=new hc,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 er.settled([this.createApplicationStorage(),this.createProfileStorage(this.profileStorageProfile),this.createWorkspaceStorage()])}async createApplicationStorage(){const e=await Lz.createApplicationStorage(this.logService);this.applicationStorageDatabase=this._register(e),this.applicationStorage=this._register(new lA(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,k_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 Lz.createProfileStorage(this.profileStorageProfile,this.logService);this.profileStorageDatabase=this.profileStorageDisposables.add(t),this.profileStorage=this.profileStorageDisposables.add(new lA(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 Lz.createWorkspaceStorage(this.workspace.id,this.logService);this.workspaceStorageDatabase=this.workspaceStorageDisposables.add(e),this.workspaceStorage=this.workspaceStorageDisposables.add(new lA(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(Xq);t===void 0?e.set(Xq,!0):t&&e.set(Xq,!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 Ry().document.hasFocus()&&!this.hasPendingUpdate}close(){Yy&&(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[cn.USER,cn.MACHINE])for(const i of this.keys(e,t))this.remove(i,e);await this.getStorage(e)?.whenFlushed()}await er.settled([this.applicationStorageDatabase?.clear()??Promise.resolve(),this.profileStorageDatabase?.clear()??Promise.resolve(),this.workspaceStorageDatabase?.clear()??Promise.resolve()])}hasScope(e){return aJe(e)?this.profileStorageProfile.id===e.id:this.workspace.id===e.id}},rIe=uM,uM.BROWSER_DEFAULT_FLUSH_INTERVAL=5*1e3,uM);oIe=rIe=D([_(2,Ke)],oIe);class Hti extends Jq{constructor(){super(...arguments),this.hasPendingUpdate=!1,this.name="in-memory-indexedb-storage"}async clear(){(await this.getItems()).clear()}dispose(){}}const Pp=class Pp extends V{static async createApplicationStorage(e){return Pp.create({id:"global",broadcastChanges:!0},e)}static async createProfileStorage(e,t){return Pp.create({id:`global-${e.id}`,broadcastChanges:!0},t)}static async createWorkspaceStorage(e,t){return Pp.create({id:e},t)}static async create(e,t){try{const i=new Pp(e,t);return await i.whenConnected,i}catch(i){return t.error(`[IndexedDB Storage ${e.id}] create(): ${Po(i,!0)}`),new Hti}}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=`${Pp.STORAGE_DATABASE_PREFIX}${e.id}`,this.broadcastChannel=e.broadcastChanges?this._register(new iPe(this.name)):void 0,this.whenConnected=this.connect(),this.registerListeners()}registerListeners(){this.broadcastChannel&&this._register(this.broadcastChannel.onDidReceiveData(e=>{Vxt(e)&&this._onDidChangeItemsExternal.fire(e)}))}async connect(){try{return await r1.create(this.name,void 0,[Pp.STORAGE_OBJECT_STORE])}catch(e){throw this.logService.error(`[IndexedDB Storage ${this.name}] connect() error: ${Po(e)}`),e}}async getItems(){const e=await this.whenConnected;function t(i){return typeof i=="string"}return e.getKeyValues(Pp.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(Pp.STORAGE_OBJECT_STORE,"readwrite",r=>{const o=[];if(t)for(const[a,c]of t)o.push(r.put(c,a));if(i)for(const a of i)o.push(r.delete(a));return o}),!0)}async optimize(){}async close(){const e=await this.whenConnected;return await this.pendingUpdate,e.close()}async clear(){await(await this.whenConnected).runInTransaction(Pp.STORAGE_OBJECT_STORE,"readwrite",t=>t.clear())}};Pp.STORAGE_DATABASE_PREFIX="vscode-web-state-db-",Pp.STORAGE_OBJECT_STORE="ItemTable";let Lz=Pp;var dw;const Uti=/^extensionKeys\/([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;var gM;let fne=(gM=class extends V{static toKey(e){return`extensionKeys/${XJ(e.id)}@${e.version}`}static fromKey(e){const t=Uti.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[r,o]of dw.readAllExtensionsWithKeysForSync(t)){const a=i.find(c=>Na(c.identifier,{id:r}))?.manifest.version;for(const c of o)a!==c&&n.push(dw.toKey({id:r,version:c}))}for(const r of n)t.remove(r,Ie.PROFILE)}static readAllExtensionsWithKeysForSync(e){const t=new Map,i=e.keys(Ie.PROFILE,cn.MACHINE);for(const n of i){const r=dw.fromKey(n);if(r){let o=t.get(r.id.toLowerCase());o||t.set(r.id.toLowerCase(),o=[]),o.push(r.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=dw.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=dw.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(Rt(e))return e;const t=e.manifest?e.manifest.publisher:e.publisher,i=e.manifest?e.manifest.name:e.name;return OM(t,i)}getExtensionState(e,t){const i=this.getExtensionId(e),n=this.getExtensionStateRaw(e,t);if(n)try{return JSON.parse(n)}catch(r){this.logService.error(`[mainThreadStorage] unexpected error parsing storage contents (extensionId: ${i}, global: ${t}): ${r}`)}}getExtensionStateRaw(e,t){const i=this.getExtensionId(e),n=this.storageService.get(i,t?Ie.PROFILE:Ie.WORKSPACE);return n&&n?.length>dw.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,cn.MACHINE)}setKeysForSync(e,t){this.storageService.store(dw.toKey(e),JSON.stringify(t),Ie.PROFILE,cn.MACHINE)}getKeysForSync(e){const t=this.productService.extensionSyncedKeys?.[e.id.toLowerCase()],i=this.storageService.get(dw.toKey(e),Ie.PROFILE),n=i?JSON.parse(i):void 0;return n&&t?Ya([...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,cn.MACHINE):this.storageService.remove("extensionStorage.migrationList",Ie.APPLICATION)}},dw=gM,gM.LARGE_STATE_WARNING_THRESHOLD=512*1024,gM);fne=dw=D([_(0,Gi),_(1,xo),_(2,Ke)],fne);var Rz;(function(s){s[s.APPLICATION=-1]="APPLICATION",s[s.PROFILE=0]="PROFILE",s[s.WORKSPACE=1]="WORKSPACE"})(Rz||(Rz={}));class gge extends lA{constructor(e,t){const i=t.read(e);if(super(new Vti(e,t,i)),i!=null)for(const[n,r]of i)this.items.set(n,r)}}class Vti{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 zti extends rW{constructor(e,t){super({flushInterval:5e3}),this.provider=e,this.fallbackOverride=t,this.applicationStorage=this._register(new gge(Rz.APPLICATION,this.provider)),this.profileStorage=this._register(new gge(Rz.PROFILE,this.provider)),this.workspaceStorage=this._register(new gge(Rz.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)}}VNe(async s=>{const e=s.get(Gi);e instanceof rW&&await e.initialize()});BVt(async s=>{const e=s.get(Dc),t=s.get(Gi);e.onDidChangeFocus(i=>{i||t.flush()})});let aIe=class extends oIe{constructor(e,t,i){super(HNe(),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)}};aIe=D([_(1,pg),_(2,Ke)],aIe);function $ti({customProvider:s,fallbackOverride:e}={}){return s!=null?{[Gi.toString()]:new yi(zti,[s,e],!0),[V3.toString()]:new yi(fne,[],!0)}:{[Gi.toString()]:new yi(aIe,[e],!0),[V3.toString()]:new yi(fne,[],!0)}}class Gti{constructor(){this._systemSchemes=new Set(Object.keys(pe)),this._providerInfo=new Map,this.extUri=new RN(e=>{const t=this._providerInfo.get(e.scheme);return!(t===void 0||t&zn.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 n4=ae("IExtHostFileSystemInfo");var hw;let cIe=hw=class{constructor(e,t){this._fileSystemProvider=new Map,this._writeQueue=new LTe,this._proxy=e.getProxy(We.MainThreadFileSystem);const i=this;this.value=Object.freeze({async stat(n){try{let r;const o=i._fileSystemProvider.get(n.scheme);return o?(await i._proxy.$ensureActivation(n.scheme),r=await o.impl.stat(n)):r=await i._proxy.$stat(n),{type:r.type,ctime:r.ctime,mtime:r.mtime,size:r.size,permissions:r.permissions===up.Readonly?1:void 0}}catch(r){hw._handleError(r)}},async readDirectory(n){try{const r=i._fileSystemProvider.get(n.scheme);return r?(await i._proxy.$ensureActivation(n.scheme),(await r.impl.readDirectory(n)).slice()):await i._proxy.$readdir(n)}catch(r){return hw._handleError(r)}},async createDirectory(n){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,n)):await i._proxy.$mkdir(n)}catch(r){return hw._handleError(r)}},async readFile(n){try{const r=i._fileSystemProvider.get(n.scheme);return r?(await i._proxy.$ensureActivation(n.scheme),(await r.impl.readFile(n)).slice()):(await i._proxy.$readFile(n)).buffer}catch(r){return hw._handleError(r)}},async writeFile(n,r){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,o.extUri.dirname(n)),await i._writeQueue.queueFor(n,()=>Promise.resolve(o.impl.writeFile(n,r,{create:!0,overwrite:!0})))):await i._proxy.$writeFile(n,Ge.wrap(r))}catch(o){return hw._handleError(o)}},async delete(n,r){try{const o=i._fileSystemProvider.get(n.scheme);return o&&!o.isReadonly&&!r?.useTrash?(await i._proxy.$ensureActivation(n.scheme),await o.impl.delete(n,{recursive:!1,...r})):await i._proxy.$delete(n,{recursive:!1,useTrash:!1,atomic:!1,...r})}catch(o){return hw._handleError(o)}},async rename(n,r,o){try{return await i._proxy.$rename(n,r,{overwrite:!1,...o})}catch(a){return hw._handleError(a)}},async copy(n,r,o){try{return await i._proxy.$copy(n,r,{overwrite:!1,...o})}catch(a){return hw._handleError(a)}},isWritableFileSystem(n){const r=t.getCapabilities(n);if(typeof r=="number")return!(r&zn.Readonly)}})}async mkdirp(e,t,i){const n=[];for(;!t.isEqual(i,t.dirname(i));)try{if(!((await e.stat(i)).type&rn.Directory))throw Xc.FileExists(`Unable to create folder '${i.scheme===pe.file?i.fsPath:i.toString(!0)}' that already exists but is not a directory`);break}catch(r){if(Qk(r)!==ot.FileNotFound)throw r;n.push(t.basename(i)),i=t.dirname(i)}for(let r=n.length-1;r>=0;r--){i=t.joinPath(i,n[r]);try{await e.createDirectory(i)}catch(o){if(Qk(o)!==ot.FileExists)throw o}}}static _handleError(e){if(e instanceof Xc)throw e;if(e instanceof LA)switch(e.code){case ot.FileExists:throw Xc.FileExists(e.message);case ot.FileNotFound:throw Xc.FileNotFound(e.message);case ot.FileNotADirectory:throw Xc.FileNotADirectory(e.message);case ot.FileIsADirectory:throw Xc.FileIsADirectory(e.message);case ot.NoPermissions:throw Xc.NoPermissions(e.message);case ot.Unavailable:throw Xc.Unavailable(e.message);default:throw new Xc(e.message,e.name)}if(!(e instanceof Error))throw new Xc(String(e));if(e.name==="ENOPRO"||e.message.includes("ENOPRO"))throw Xc.Unavailable(e.message);switch(e.name){case ot.FileExists:throw Xc.FileExists(e.message);case ot.FileNotFound:throw Xc.FileNotFound(e.message);case ot.FileNotADirectory:throw Xc.FileNotADirectory(e.message);case ot.FileIsADirectory:throw Xc.FileIsADirectory(e.message);case ot.NoPermissions:throw Xc.NoPermissions(e.message);case ot.Unavailable:throw Xc.Unavailable(e.message);default:throw new Xc(e.message,e.name)}}addFileSystemProvider(e,t,i){return this._fileSystemProvider.set(e,{impl:t,extUri:i?.isCaseSensitive?Dn:Xoe,isReadonly:!!i?.isReadonly}),Ee(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??Dn}};cIe=hw=D([_(0,Jr),_(1,n4)],cIe);const Sle=ae("IExtHostConsumerFileSystem");class vot extends xae{get disposed(){return this._disposed}constructor(e,t,i,n,r){super(),this.id=e,this.name=t,this.logger=i,this.proxy=n,this.extension=r,this.offset=0,this._disposed=!1,this.visible=!1,this.setLevel(i.getLevel()),this._register(i.onDidChangeLogLevel(o=>this.setLevel(o)))}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,pB.Clear,e)}replace(e){const t=this.offset;this.info(e),this.proxy.$update(this.id,pB.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+=Ge.fromString(t).byteLength,$Y(this.logger,e,t),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,pB.Append))}dispose(){super.dispose(),this._disposed||(this.proxy.$dispose(this.id),this._disposed=!0)}}class Kti extends vot{appendLine(e){this.append(e)}}let lIe=class{constructor(e,t,i,n,r,o){this.initData=t,this.extHostFileSystem=i,this.extHostFileSystemInfo=n,this.loggerService=r,this.logService=o,this.extensionLogDirectoryPromise=new Map,this.namePool=1,this.channels=new Map,this.visibleChannelId=null,this.proxy=e.getProxy(We.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${xit(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,r=Rt(t)?t:void 0;if(Rt(r)&&!r.trim())throw new Error("illegal argument `languageId`. must not be empty");let o;const a=this.initData.environment.extensionLogLevel?.find(([l])=>An.equals(i.identifier,l))?.[1];a&&(o=Uje(a));const c=n?this.doCreateLogOutputChannel(e,o,i):this.doCreateOutputChannel(e,r,i);return c.then(l=>{this.channels.set(l.id,l),l.visible=l.id===this.visibleChannelId}),n?this.createExtHostLogOutputChannel(e,o??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,r=this.extHostFileSystemInfo.extUri.joinPath(n,`${this.namePool++}-${e.replace(/[\\/:\*\?"<>\|]/g,"")}.log`),o=this.loggerService.createLogger(r,{logLevel:"always",donotRotate:!0,donotUseFormatters:!0,hidden:!0}),a=await this.proxy.$register(e,r,t,i.identifier.value);return new vot(a,e,o,this.proxy,i)}async doCreateLogOutputChannel(e,t,i){const n=await this.createExtensionLogDirectory(i),r=e.replace(/[\\/:\*\?"<>\|]/g,""),o=this.extHostFileSystemInfo.extUri.joinPath(n,`${r}.log`),a=`${i.identifier.value}.${r}`,c=this.loggerService.createLogger(o,{id:a,name:e,logLevel:t,extensionId:i.identifier.value});return new Kti(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(Qk(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(r){n(),t.then(o=>o.append(r))},appendLine(r){n(),t.then(o=>o.appendLine(r))},clear(){n(),t.then(r=>r.clear())},replace(r){n(),t.then(o=>o.replace(r))},show(r,o){n(),t.then(a=>a.show(r,o))},hide(){n(),t.then(r=>r.hide())},dispose(){i=!0,t.then(r=>r.dispose())}}}createExtHostLogOutputChannel(e,t,i){const n=new Z,r=()=>{if(n.isDisposed)throw new Error("Channel has been closed")},o=n.add(new I);function a(c){t=c,o.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:o.event,trace(c,...l){r(),i.then(d=>d.trace(c,...l))},debug(c,...l){r(),i.then(d=>d.debug(c,...l))},info(c,...l){r(),i.then(d=>d.info(c,...l))},warn(c,...l){r(),i.then(d=>d.warn(c,...l))},error(c,...l){r(),i.then(d=>d.error(c,...l))},dispose(){n.dispose()}}}};lIe=D([_(0,Jr),_(1,bu),_(2,Sle),_(3,n4),_(4,pf),_(5,Ke)],lIe);const bot=ae("IExtHostOutputService"),Ale=ae("IURITransformerService");class qti{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 c7(s,e,t){return new RN(i=>iFe(i,t)).isEqual(s,e)}function Qti(s,e,t){return c7(s.uri,e.uri,t)?0:mm(s.uri.toString(),e.uri.toString())}function jti(s,e,t){return s.index!==e.index?s.indext(o,a,i)),r=e.slice(0).sort((o,a)=>t(o,a,i));return s0(n,r,(o,a)=>t(o,a,i))}function iFe(s,e){const t=e.getCapabilities(s.scheme);return!(t&&t&zn.PathCaseSensitive)}class _B extends OYe{static toExtHostWorkspace(e,t,i,n){if(!e)return{workspace:null,added:[],removed:[]};const{id:r,name:o,folders:a,configuration:c,transient:l,isUntitled:d}=e,h=[],u=t;t?a.forEach((v,b)=>{const w=N.revive(v.uri),y=_B._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.indexiFe(v,n)),{added:p,removed:m}=wot(u?u.workspaceFolders:[],f.workspaceFolders,Qti,n);return{workspace:f,added:p,removed:m}}static _findFolder(e,t,i){for(let n=0;nnew Pae(c)),n,r,a),this._name=t,this._isUntitled=o,this._workspaceFolders=[],this._structure=Ih.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=Ro(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let dIe=class{constructor(e,t,i,n,r){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 tD,this._canonicalUriProviders=new Map,this._logService=n,this._extHostFileSystemInfo=i,this._uriTransformerService=r,this._requestIdProvider=new Iht,this._barrier=new jd,this._proxy=e.getProxy(We.MainThreadWorkspace),this._messageService=e.getProxy(We.MainThreadMessageService);const o=t.workspace;this._confirmedWorkspace=o?new _B(o.id,o.name,[],!!o.transient,o.configuration?N.revive(o.configuration):null,!!o.isUntitled,a=>iFe(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:vi(Ro(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 r=[];if(Array.isArray(n)&&n.forEach(d=>{N.isUri(d.uri)&&!r.some(h=>c7(h.uri,d.uri,this._extHostFileSystemInfo))&&r.push({uri:d.uri,name:d.name||TA(d.uri)})}),this._unconfirmedWorkspace||[t,i].some(d=>typeof d!="number"||d<0)||i===0&&r.length===0)return!1;const o=this._actualWorkspace?this._actualWorkspace.workspaceFolders:[];if(t+i>o.length)return!1;const a=o.slice(0);a.splice(t,i,...r.map(d=>({uri:d.uri,name:d.name||TA(d.uri),index:void 0})));for(let d=0;df!==d&&c7(h.uri,u.uri,this._extHostFileSystemInfo)))return!1}a.forEach((d,h)=>d.index=h);const{added:c,removed:l}=wot(o,a,jti,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,r).then(void 0,h=>{this._unconfirmedWorkspace=void 0;const u={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(Ze.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 r=this.getWorkspaceFolder(i,!0);if(!r)return n;typeof t>"u"&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let o=MN(r.uri,i);return t&&r.name&&(o=`${r.name}/${o}`),o}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=_B.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}=_B.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,r=Ue.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${n.value}, entryPoint: findFiles`);let o="",a=!0;return t===null?a=!1:t!==void 0&&(typeof t=="string"?o=t:o=t.pattern),this._findFilesImpl(e,void 0,{exclude:o,maxResults:i,useDefaultExcludes:a,useDefaultSearchExcludes:!1,useIgnoreFiles:!1},r)}findFiles2(e,t={},i,n=Ue.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=Ue.None){if(n&&n.isCancellationRequested)return Promise.resolve([]);const r=typeof i.exclude=="string"?i.exclude:i.exclude?i.exclude.pattern:void 0,o={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:r,shouldGlobSearch:typeof i.fuzzy=="boolean"?!i.fuzzy:!0,_reason:"startFileSearch"};let a;if(e){const{includePattern:c,folder:l}=fge(Qf.from(e));a=l,o.includePattern=c}else{const{includePattern:c,folder:l}=fge(Qf.from(t));a=l,o.filePattern=c}return this._proxy.$startFileSearch(a??null,o,n).then(c=>Array.isArray(c)?c.map(l=>N.revive(l)):[])}async findTextInFiles(e,t,i,n,r=Ue.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${n.value}, entryPoint: findTextInFiles`);const o=this._requestIdProvider.getNext(),a=typeof t.previewOptions>"u"?{matchLines:100,charsPerLine:1e4}:t.previewOptions,{includePattern:c,folder:l}=fge(Qf.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[o]=u=>{const f=N.revive(u.resource);u.results.forEach(p=>{const m=Mr(p);L9t(m)?i({uri:f,preview:{text:m.preview.text,matches:h8(m.preview.matches,v=>new Xn(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))},ranges:h8(m.ranges,v=>new Xn(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))}):i({uri:f,text:m.text,lineNumber:m.lineNumber})})},r.isCancellationRequested)return{};try{const u=await this._proxy.$startTextSearch(e,l??null,h,o,r);return delete this._activeSearchCallbacks[o],u||{}}catch(u){throw delete this._activeSearchCallbacks[o],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 r=await n.provideEditSessionIdentity(i,t);if(this._logService.info("Provider returned edit session identifier: ",r),!!r)return r}async $provideEditSessionIdentityMatch(e,t,i,n){this._logService.info("Getting edit session identifier for workspaceFolder",e);const r=await this.resolveWorkspaceFolder(N.revive(e));if(!r){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",r);const o=this._editSessionIdentityProviders.get(r.uri.scheme);if(this._logService.info(`Provider for scheme ${r.uri.scheme} is defined: `,!!o),!o)return;const a=await o.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 r=function(a){t.call(i,a)};return r.extension=e,this._onWillCreateEditSessionIdentityEvent.event(r,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(r,o)=>{const a=Date.now();await Promise.resolve(r),Date.now()-a>i&&this._logService.warn("SLOW edit session create-participant",o.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 r=await n.provideCanonicalUri?.(N.revive(e),t,i);if(r)return r}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(N.revive(e),{targetScheme:t},i)}};dIe=D([_(0,Jr),_(1,bu),_(2,n4),_(3,Ke),_(4,Ale)],dIe);const dE=ae("IExtHostWorkspace");function fge(s){let e,t;return s&&(typeof s=="string"?e=s:(e=s.pattern,t=N.revive(s.baseUri))),{includePattern:e,folder:t}}var QV,Ik;let hIe=(Ik=class{constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(We.MainThreadDecorations)}registerFileDecorationProvider(e,t){const i=QV._handlePool++;this._provider.set(i,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(i,t.identifier.value);const n=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(r=>{if(!r){this._proxy.$onDidChange(i,null);return}const o=z_(r);if(o.length<=QV._maxEventSize){this._proxy.$onDidChange(i,o);return}this._logService.warn("[Decorations] CAPPING events from decorations provider",t.identifier.value,o.length);const a=o.map(d=>({uri:d,rank:Tct(d.path,"/")})),c=d8(a,(d,h)=>d.rank-h.rank||mm(d.uri.path,h.uri.path)),l=[];e:for(const d of c){let h;for(const u of d){const f=xb(u.uri.path);if(h!==f&&(h=f,l.push(u.uri)>=QV._maxEventSize))break e}}this._proxy.$onDidChange(i,l)});return new js(()=>{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:r,extensionDescription:o}=this._provider.get(e);return await Promise.all(t.map(async a=>{try{const{uri:c,id:l}=a,d=await Promise.resolve(r.provideFileDecoration(N.revive(c),i));if(!d)return;try{l$.validate(d),d.badge&&typeof d.badge!="string"&&ze(o,"codiconDecoration"),n[l]=[d.propagate,d.tooltip,d.badge,d.color]}catch(h){this._logService.warn(`INVALID decoration from extension '${o.identifier.value}': ${h}`)}}catch(c){this._logService.error(c)}})),n}},QV=Ik,Ik._handlePool=0,Ik._maxEventSize=250,Ik);hIe=QV=D([_(0,Jr),_(1,Ke)],hIe);const yot=ae("IExtHostDecorations");function H4(s,e){if(e){const t=e.split(".");let i=s;for(let n=0;i&&nthis._actual)}$initializeConfiguration(e){this._actual=new eii(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(i=>i.$acceptConfigurationChanged(e,t))}};uIe=D([_(0,Jr),_(1,dE),_(2,Ke)],uIe);class eii{constructor(e,t,i,n){this._onDidChangeConfiguration=new I,this._proxy=e,this._logService=n,this._extHostWorkspace=t,this._configuration=w3.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=w3.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,i))}getConfiguration(e,t,i){const n=Q9e(t)||{},r=this._toReadonlyValue(e?H4(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 o(c){if(c==null)return null;if(typeof c=="boolean")return c?At.USER:At.WORKSPACE;switch(c){case YT.Global:return At.USER;case YT.Workspace:return At.WORKSPACE;case YT.WorkspaceFolder:return At.WORKSPACE_FOLDER}}const a={has(c){return typeof H4(r,c)<"u"},get:(c,l)=>{this._validateConfigurationAccess(e?`${e}.${c}`:c,n,i?.identifier);let d=H4(r,c);if(typeof d>"u")d=l;else{let h;const u=(f,p)=>{if(In(f)){let m;const v=()=>{h=h||Ds(r),m=m||H4(h,p)};return new Proxy(f,{get:(b,w)=>{if(typeof w=="string"&&w.toLowerCase()==="tojson")return v(),()=>m;if(h)return m=m||H4(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)?Ds(f):f};d=u(d,c)}return d},update:(c,l,d,h)=>{c=e?`${e}.${c}`:c;const u=o(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:Ds(l.policy?.value??l.default?.value),globalValue:Ds(l.user?.value??l.application?.value),workspaceValue:Ds(l.workspace?.value),workspaceFolderValue:Ds(l.workspaceFolder?.value),defaultLanguageValue:Ds(l.default?.override),globalLanguageValue:Ds(l.user?.override??l.application?.override),workspaceLanguageValue:Ds(l.workspace?.override),workspaceFolderLanguageValue:Ds(l.workspaceFolder?.override),languageIds:Ds(l.overrideIdentifiers)}}};return typeof r=="object"&&mp(a,r,!1),Object.freeze(a)}_toReadonlyValue(e){const t=i=>In(i)?new Proxy(i,{get:(n,r)=>t(n[r]),set:(n,r,o)=>{throw new Error(`TypeError: Cannot assign to read only property '${String(r)}' of object`)},deleteProperty:(n,r)=>{throw new Error(`TypeError: Cannot delete read only property '${String(r)}' of object`)},defineProperty:(n,r)=>{throw new Error(`TypeError: Cannot define property '${String(r)}' 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=rf.test(e)?ct.RESOURCE:this._configurationScopes.get(e),r=i?`[${i.value}] `:"";if(ct.RESOURCE===n){typeof t?.resource>"u"&&this._logService.warn(`${r}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(ct.WINDOW===n){t?.resource&&this._logService.warn(`${r}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 cRe(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(n,r)=>i.affectsConfiguration(n,Q9e(r))})}_toMap(e){return e.reduce((t,i)=>(t.set(i[0],i[1]),t),new Map)}}const hE=ae("IExtHostConfiguration"),ZI=(s,e,t,i)=>{let n=e;return{enumerable:!0,configurable:!1,get(){return n},set(r){if(!t(n,r)){const o=n;n=r,s.listener?.(i(r,o))}}}},kP=(s,e)=>s===e,wE={range:(s,e)=>s===e?!0:!s||!e?!1:s.isEqual(e),label:kP,description:kP,sortText:kP,busy:kP,error:kP,canResolveChildren:kP,tags:(s,e)=>!(s.length!==e.length||s.some(t=>!e.find(i=>t.id===i.id)))},IP=s=>e=>({op:Vd.SetProp,update:s(e)}),tii=(s,e)=>({range:(()=>{let t;const i=IP(n=>({range:F.lift(tt.from(n))}));return{enumerable:!0,configurable:!1,get(){return t},set(n){s.listener?.({op:Vd.DocumentSynced}),wE.range(t,n)||(t=n,s.listener?.(i(n)))}}})(),label:ZI(s,e,wE.label,IP(t=>({label:t}))),description:ZI(s,void 0,wE.description,IP(t=>({description:t}))),sortText:ZI(s,void 0,wE.sortText,IP(t=>({sortText:t}))),canResolveChildren:ZI(s,!1,wE.canResolveChildren,t=>({op:Vd.UpdateCanResolveChildren,state:t})),busy:ZI(s,!1,wE.busy,IP(t=>({busy:t}))),error:ZI(s,void 0,wE.error,IP(t=>({error:Fs.fromStrict(t)||null}))),tags:ZI(s,[],wE.tags,(t,i)=>({op:Vd.SetTags,new:t.map($b.from),old:i.map($b.from)}))}),iii=s=>{const e=bn.fromString(s.extId),t=new tP(e.controllerId,e.localId,s.label,N.revive(s.uri)||void 0);return t.range=tt.to(s.range||void 0),t.description=s.description||void 0,t.sortText=s.sortText||void 0,t.tags=s.tags.map(i=>$b.to({id:art(i).tagId})),t},j9e=s=>{let e;for(const t of s.tests){const i=iii(t.item);gle(i).parent=e,e=i}return e};class tP{constructor(e,t,i,n){if(t.includes(s_.Delimiter))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);const r=Mjt(this,e);Object.defineProperties(this,{id:{value:t,enumerable:!0,writable:!1},uri:{value:n,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return r.parent instanceof nFe?void 0:r.parent}},children:{value:Rjt(r,gle,tP),enumerable:!0,writable:!1},...tii(r,i)})}}class nFe extends tP{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}}class nii extends Ijt{constructor(e,t,i){super({controllerId:e,getDocumentVersion:n=>n&&i.getDocument(n)?.version,getApiFor:gle,getChildren:n=>n.children,root:new nFe(e,t),toITestItem:CI.from})}}let gIe=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=jg.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:aLt,name:g(576,"Extension Telemetry{0}",this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0}),this._register(this._outputLogger),this._register(t.onDidChangeLogLevel(i=>{Bje(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()===Kn.Trace)}getTelemetryConfiguration(){return this._level===jg.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=jg.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=jg.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=jg.USAGE:!1}}instantiateLogger(e,t,i){const n=this.getTelemetryDetails(),r=new Cot(t,i,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:n.isUsageEnabled,isErrorsEnabled:n.isErrorsEnabled}),o=this._telemetryLoggers.get(e.identifier.value)??[];return this._telemetryLoggers.set(e.identifier.value,[...o,r]),r.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"]=Sot(this.initData.telemetryInfo.firstSessionDate),t["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case sv.Web:t["common.uikind"]="web";break;case sv.Desktop:t["common.uikind"]="desktop";break;default:t["common.uikind"]="unknown"}return t["common.remotename"]=W6(dLt(this.initData.remote.authority)),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;const t=this.getTelemetryDetails();this._telemetryLoggers.forEach((i,n)=>{const r=i.filter(o=>!o.isDisposed);r.length===0?this._telemetryLoggers.delete(n):this._telemetryLoggers.set(n,r)}),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(o=>!o.isDisposed);if(!n)return this._telemetryLoggers.delete(e.value),!1;let r=!1;for(const o of n)o.ignoreUnhandledExtHostErrors||(o.logError(t),r=!0);return r}};gIe=D([_(0,bu),_(1,pf)],gIe);class Cot{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,r,o,a){this._extension=i,this._logger=n,this._inLoggingOnlyMode=r,this._commonProperties=o,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=wHe(t,[]),this._additionalCommonProperties&&(t=mp(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=mp(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=wHe(i,[]),r=new Error(n.message,{cause:n.cause});r.stack=n.stack,r.name=n.name,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(r,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 Sot(s){const e=Date.now()-new Date(s).getTime();return isNaN(e)?!1:e<1e3*60*60*24}const Ele=ae("IExtHostTelemetry");var sS,D7,k7,WGe;let fIe=(WGe=class{constructor(e,t,i){Ht(this,sS);Ht(this,D7);Ht(this,k7);this._commands=new Map,this._apiCommands=new Map,St(this,sS,e.getProxy(We.MainThreadCommands)),this._logService=t,St(this,k7,i),St(this,D7,e.getProxy(We.MainThreadTelemetry)),this.converter=new sii(this,n=>{const r=this._apiCommands.get(n);return r?.result===sn.Void?r:void 0},t),this._argumentProcessors=[{processArgument(n){return Mr(n)}},{processArgument(n){return T2(n,function(r){if(F.isIRange(r))return tt.to(r);if(re.isIPosition(r))return Yr.to(r);if(F.isIRange(r.range)&&N.isUri(r.uri))return ff.to(r);if(r instanceof Ge)return r.buffer.buffer;if(!Array.isArray(r))return r})}}]}registerArgumentProcessor(e){this._argumentProcessors.push(e)}registerApiCommand(e){const t=this.registerCommand(!1,e.id,async(...i)=>{const n=e.args.map((o,a)=>{if(!o.validate(i[a]))throw new Error(`Invalid argument '${o.name}' when running '${e.id}', received: ${typeof i[a]=="object"?JSON.stringify(i[a],null," "):i[a]} `);return o.convert(i[a])}),r=await this.executeCommand(e.internalId,...n);return e.result.convert(r,i,this.converter)},void 0,{description:e.description,args:e.args,returns:e.result.description});return this._apiCommands.set(e.id,e),new js(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,i,n,r,o){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:r,extension:o}),e&&Ce(this,sS).$registerCommand(t),new js(()=>{this._commands.delete(t)&&e&&Ce(this,sS).$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,sS).$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let n=!1;const r=T2(t,function(o){if(o instanceof ws)return Yr.from(o);if(o instanceof Xn)return tt.from(o);if(o instanceof Ap)return ff.from(o);if(Dy.isNotebookRange(o))return zy.from(o);if(o instanceof ArrayBuffer)return n=!0,Ge.wrap(new Uint8Array(o));if(o instanceof Uint8Array)return n=!0,Ge.wrap(o);if(o instanceof Ge)return n=!0,o;if(!Array.isArray(o))return o});try{const o=await Ce(this,sS).$executeCommand(e,n?new Jd(r):r,i);return Mr(o)}catch(o){if(o instanceof Error&&o.message==="$executeCommand:retry")return this._doExecuteCommand(e,t,!1);throw o}}}async _executeContributedCommand(e,t,i){const n=this._commands.get(e);if(!n)throw new Error("Unknown command");const{callback:r,thisArg:o,metadata:a}=n;if(a?.args)for(let l=0;lthis._argumentProcessors.reduce((r,o)=>o.processArgument(r,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,sS).$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)}},sS=new WeakMap,D7=new WeakMap,k7=new WeakMap,WGe);fIe=D([_(0,Jr),_(1,Ke),_(2,Ele)],fIe);const iP=ae("IExtHostCommands");class sii{constructor(e,t,i){this._commands=e,this._lookupApiCommand=t,this._logService=i,this.delegatingCommandId=`__vsc${ao()}`,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((r,o)=>r.convert(e.arguments&&e.arguments[o]));else if(tr(e.arguments)){const r=`${e.command} /${++this._cachIdPool}`;this._cache.set(r,e),t.add(Ee(()=>{this._cache.delete(r),this._logService.trace("CommandsConverter#DISPOSE",r)})),i.$ident=r,i.id=this.delegatingCommandId,i.arguments=[r],this._logService.trace("CommandsConverter#CREATE",e.command,r)}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 qa=class qa{static Arr(e){return new qa(`${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 qa(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 qa(e??this.name,t??this.description,this.validate,this.convert)}};qa.Uri=new qa("uri","Uri of a text document",e=>N.isUri(e),e=>e),qa.Position=new qa("position","A position in a text document",e=>ws.isPosition(e),Yr.from),qa.Range=new qa("range","A range in a text document",e=>Xn.isRange(e),tt.from),qa.Selection=new qa("selection","A selection in a text document",e=>uC.isSelection(e),zb.from),qa.Number=new qa("number","",e=>typeof e=="number",e=>e),qa.String=new qa("string","",e=>typeof e=="string",e=>e),qa.StringArray=qa.Arr(qa.String),qa.CallHierarchyItem=new qa("item","A call hierarchy item",e=>e instanceof tle,bN.from),qa.TypeHierarchyItem=new qa("item","A type hierarchy item",e=>e instanceof nle,rL.from),qa.TestItem=new qa("testItem","A VS Code TestItem",e=>e instanceof tP,CI.from);let ut=qa;const Soe=class Soe{constructor(e,t){this.description=e,this.convert=t}};Soe.Void=new Soe("no result",e=>e);let sn=Soe;class fn{constructor(e,t,i,n,r){this.id=e,this.internalId=t,this.description=i,this.args=n,this.result=r}}const pIe=new Map;function rii(s,e){e?pIe.set(s,e):pIe.delete(s)}function oii(s){return pIe.get(s)}class aii extends Xqe{constructor(e,t,i,n,r,o,a){super(t,i,n,r),this._proxy=e,this._languageId=o,this._isDirty=a,this._isDisposed=!1}dispose(){Zf(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return ns(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===` +`?T_.LF:T_.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){Zf(!this._isDisposed),this._languageId=e}_acceptIsDirty(e){Zf(!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,r=t.end.line,o=[];o.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 cii(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 ws(t.index,Math.min(t.remainder,i))}_validateRange(e){if(!(e instanceof Xn))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 Xn(t.line,t.character,i.line,i.character)}_validatePosition(e){if(!(e instanceof ws))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 r=this._lines[t].length;i<0?(i=0,n=!0):i>r&&(i=r,n=!0)}return n?new ws(t,i):e}_getWordRangeAtPosition(e,t){const i=this._validatePosition(e);if(!t)t=oii(this._languageId);else if(ATe(t))throw new Error(`[getWordRangeAtPosition]: ignoring custom regexp '${t.source}' because it matches the empty string.`);const n=Pk(i.character+1,j7(t),this._lines[i.line],0);if(n)return new Xn(i.line,n.startColumn-1,i.line,n.endColumn-1)}}class cii{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 Xn(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Xn(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 Aoe=class Aoe{constructor(e,t,i){const n=Aoe._Keys.nextId();e.$registerTextEditorDecorationType(t.identifier,n,ixe.from(i)),this.value=Object.freeze({key:n,dispose(){e.$removeTextEditorDecorationType(n)}})}};Aoe._Keys=new PU("TextEditorDecorationType");let mIe=Aoe;class lii{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 ws)i=new Xn(e,e);else if(e instanceof Xn)i=e;else throw new Error("Unrecognized location");this._pushEdit(i,t,!1)}insert(e,t){this._throwIfFinalized(),this._pushEdit(new Xn(e,e),t,!0)}delete(e){this._throwIfFinalized();let t=null;if(e instanceof Xn)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!==T_.LF&&e!==T_.CRLF)throw Fi("endOfLine");this._setEndOfLine=e}}class dii{constructor(e,t,i,n){this._proxy=e,this._id=t,this._accept(i),this._logService=n;const r=this;this.value={get tabSize(){return r._tabSize},set tabSize(o){r._setTabSize(o)},get indentSize(){return r._indentSize},set indentSize(o){r._setIndentSize(o)},get insertSpaces(){return r._insertSpaces},set insertSpaces(o){r._setInsertSpaces(o)},get cursorStyle(){return r._cursorStyle},set cursorStyle(o){r._setCursorStyle(o)},get lineNumbers(){return r._lineNumbers},set lineNumbers(o){r._setLineNumbers(o)}}}_accept(e){this._tabSize=e.tabSize,this._indentSize=e.indentSize,this._originalIndentSize=e.originalIndentSize,this._insertSpaces=e.insertSpaces,this._cursorStyle=e.cursorStyle,this._lineNumbers=gB.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:gB.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=gB.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 hii{constructor(e,t,i,n,r,o,a,c){this.id=e,this._proxy=t,this._logService=i,this._disposed=!1,this._hasDecorationsForKey=new Set,this._selections=r,this._options=new dii(this._proxy,this.id,o,i),this._visibleRanges=a,this._viewColumn=c;const l=this;this.value=Object.freeze({get document(){return n.value},set document(d){throw new T1("document")},get selection(){return l._selections&&l._selections[0]},set selection(d){if(!(d instanceof uC))throw Fi("selection");l._selections=[d],l._trySetSelection()},get selections(){return l._selections},set selections(d){if(!Array.isArray(d)||d.some(h=>!(h instanceof uC)))throw Fi("selections");l._selections=d,l._trySetSelection()},get visibleRanges(){return l._visibleRanges},set visibleRanges(d){throw new T1("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 T1("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 lii(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=>tt.from(p));else if(h instanceof ws){const{lineNumber:p,column:m}=Yr.from(h);f=[{startLineNumber:p,startColumn:m,endLineNumber:p,endColumn:m}]}else if(h instanceof Xn)f=[tt.from(h)];else{f=[];for(const p of h)if(p instanceof Xn)f.push(tt.from(p));else{const{lineNumber:m,column:v}=Yr.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(lrt(h))return t.$trySetDecorations(e,d.key,Fjt(h));{const f=new Array(4*h.length);for(let p=0,m=h.length;pt.$tryRevealRange(e,tt.from(d),h||q9.Default))},show(d){t.$tryShowEditor(e,kl.from(d))},hide(){t.$tryHideEditor(e)},[Symbol.for("debug.description")](){return`TextEditor(${this.document.uri.toString()})`}})}dispose(){Zf(!this._disposed),this._disposed=!0}_acceptOptions(e){Zf(!this._disposed),this._options._accept(e)}_acceptVisibleRanges(e){Zf(!this._disposed),this._visibleRanges=e}_acceptViewColumn(e){Zf(!this._disposed),this._viewColumn=e}_acceptSelections(e){Zf(!this._disposed),this._selections=e}async _trySetSelection(){const e=this._selections.map(zb.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(r=>r.range);i.sort((r,o)=>r.end.line===o.end.line?r.end.character===o.end.character?r.start.line===o.start.line?r.start.character-o.start.character:r.start.line-o.start.line:r.end.character-o.end.character:r.end.line-o.end.line);for(let r=0,o=i.length-1;r({range:tt.from(r.range),text:r.text,forceMoveMarkers:r.forceMoveMarkers}));return this._proxy.$tryApplyEdits(this.id,t.documentVersionId,n,{setEndOfLine:typeof t.setEndOfLine=="number"?KH.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 uii{constructor(e){this.value=e,this._count=0}ref(){this._count++}unref(){return--this._count===0}}let _Ie=class{constructor(e,t){this._extHostRpc=e,this._logService=t,this._activeEditorId=null,this._editors=new Map,this._documents=new gi,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 r of e.removedDocuments){const o=N.revive(r),a=this._documents.get(o);a?.unref()&&(this._documents.delete(o),t.push(a.value))}if(e.addedDocuments)for(const r of e.addedDocuments){const o=N.revive(r.uri);let a=this._documents.get(o);if(a&&o.scheme!==pe.vscodeNotebookCell&&o.scheme!==pe.vscodeInteractiveInput)throw new Error(`document '${o} already exists!'`);a||(a=new uii(new aii(this._extHostRpc.getProxy(We.MainThreadDocuments),o,r.lines,r.EOL,r.versionId,r.languageId,r.isDirty)),this._documents.set(o,a),i.push(a.value)),a.ref()}if(e.removedEditors)for(const r of e.removedEditors){const o=this._editors.get(r);this._editors.delete(r),o&&n.push(o)}if(e.addedEditors)for(const r of e.addedEditors){const o=N.revive(r.documentUri);Zf(this._documents.has(o),`document '${o}' does not exist`),Zf(!this._editors.has(r.id),`editor '${r.id}' already exists!`);const a=this._documents.get(o).value,c=new hii(r.id,this._extHostRpc.getProxy(We.MainThreadTextEditors),this._logService,new Ca(()=>a.document),r.selections.map(zb.to),r.options,r.visibleRanges.map(l=>tt.to(l)),typeof r.editorPosition=="number"?kl.to(r.editorPosition):void 0);this._editors.set(r.id,c)}e.newActiveEditor!==void 0&&(Zf(e.newActiveEditor===null||this._editors.has(e.newActiveEditor),`active editor '${e.newActiveEditor}' does not exist`),this._activeEditorId=e.newActiveEditor),wt(t),wt(n),e.removedDocuments&&this._onDidRemoveDocuments.fire(t),e.addedDocuments&&this._onDidAddDocuments.fire(i),(e.removedEditors||e.addedEditors)&&this._onDidChangeVisibleTextEditors.fire(this.allEditors().map(r=>r.value)),e.newActiveEditor!==void 0&&this._onDidChangeActiveTextEditor.fire(this.activeEditor())}getDocument(e){return this._documents.get(e)?.value}allDocuments(){return ui.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()]}};_Ie=D([_(0,Jr),_(1,Ke)],_Ie);const s4=ae("IExtHostDocumentsAndEditors"),r4=ae("IExtHostTerminalService");class Y9e 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(o=>this._pidPromiseComplete=o);const r=this;this.value={get name(){return r._name||""},get processId(){return r._pidPromise},get creationOptions(){return r._creationOptions},get exitStatus(){return r._exitStatus},get state(){return r._state},get selection(){return r._selection},get shellIntegration(){return r.shellIntegration},sendText(o,a=!0){r._checkDisposed(),r._proxy.$sendText(r._id,o,a)},show(o){r._checkDisposed(),r._proxy.$show(r._id,o)},hide(){r._checkDisposed(),r._proxy.$hide(r._id)},dispose(){r._disposed||(r._disposed=!0,r._proxy.$dispose(r._id))},get dimensions(){if(!(r._cols===void 0||r._rows===void 0))return{columns:r._cols,rows:r._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:Aot(e.iconPath)??void 0,color:$2.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,r){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:$2.isThemeColor(r)?r.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:kl.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 pge{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:Hg.OverrideDimensions,value:{cols:t.columns,rows:t.rows}})}),this._pty.onDidChangeName?.(t=>{this._onDidChangeProperty.fire({type:Hg.Title,value:t})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:"",windowsPty:void 0})}}let gii=1,vIe=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 yn),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(We.MainThreadTerminalService),this._bufferer=new mrt(this._proxy.$sendProcessData),this._proxy.$registerProcessSupport(e),this._extHostCommands.registerArgumentProcessor({processArgument:n=>{const r=o=>{const a=o;return this.getTerminalById(a.instanceId)?.value};switch(n?.$mid){case ys.TerminalContext:return r(n);default:{if(Array.isArray(n))for(let o=0;o{for(const[n,r]of this._terminalProcesses)r.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 Y9e(this._proxy,ao(),e,e.name),n=new pge(e.pty);return i.createExtensionTerminal(e.location,t,this._serializeParentTerminal(e,t).resolvedExtHostIdentifier,Aot(e.iconPath),pii(e.color)).then(r=>{const o=this._setupExtHostProcessListeners(r,n);this._terminalProcessDisposables[r]=o}),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(r=>r.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 pge(t),r=this._setupExtHostProcessListeners(e,n);this._terminalProcessDisposables[e]=r}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 r=this._terminals.splice(n,1)[0];r.setExitStatus(t,i),this._onDidCloseTerminal.fire(r.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 r={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},o=new Y9e(this._proxy,e,r,i);this._terminals.push(o),this._onDidOpenTerminal.fire(o.value),o.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(r=>{const o=this.onDidOpenTerminal(async a=>{a===i.value&&(o.dispose(),r())})});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(r=>this._proxy.$sendProcessReady(e,r.pid,r.cwd,r.windowsPty))),i.add(t.onDidChangeProperty(r=>this._proxy.$sendProcessProperty(e,r))),this._bufferer.startBuffering(e,t.onProcessData),i.add(t.onProcessExit(r=>this._onProcessExit(e,r))),this._terminalProcesses.set(e,t);const n=this._extensionTerminalAwaitingStart[e];return n&&t instanceof pge&&(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:Hg.InitialCwd,value:t}))}$acceptProcessRequestCwd(e){this._terminalProcesses.get(e)?.getCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:Hg.Cwd,value:t}))}$acceptProcessRequestLatency(e){return Promise.resolve(e)}registerLinkProvider(e){return this._linkProviders.add(e),this._linkProviders.size===1&&this._proxy.$startLinkProvider(),new js(()=>{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 js(()=>{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 js(()=>{this._quickFixProviders.delete(e),this._proxy.$unregisterQuickFixProvider(e)})}async $provideTerminalQuickFixes(e,t){const i=new li().token;if(i.isCancellationRequested)return;const n=this._quickFixProviders.get(e);if(!n)return;const r=await n.provideTerminalQuickFixes(t,i);if(r===null||Array.isArray(r)&&r.length===0)return;const o=new Z;if(this._lastQuickFixCommands.value=o,!Array.isArray(r))return r?Sie.from(r,this._extHostCommands.converter,o):void 0;const a=[];for(const c of r){const l=Sie.from(c,this._extHostCommands.converter,o);l&&a.push(l)}return a}async $createContributedProfileTerminal(e,t){const i=new li().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 r=new li;this._terminalLinkCancellationSource.set(e,r);const o=[],a={terminal:i.value,line:t},c=[];for(const h of this._linkProviders)c.push(er.withAsyncBody(async u=>{r.token.onCancellationRequested(()=>u({provider:h,links:[]}));const f=await h.provideTerminalLinks(a,r.token)||[];r.token.isCancellationRequested||u({provider:h,links:f})}));const l=await Promise.all(c);if(r.token.isCancellationRequested)return[];const d=new Map;for(const h of l)h&&h.links.length>0&&o.push(...h.links.map(u=>{const f={id:gii++,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),o}$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 J9e),this._setEnvironmentVariableCollection(e.identifier.value,t)),t.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(e,t){const i=_rt(t.map),n=eYt(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 J9e(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)}))}};vIe=D([_(1,iP),_(2,Jr)],vIe);class J9e 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 fii(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:KT.Replace,options:i??{applyAtProcessCreation:!0},scope:n})}append(e,t,i,n){this._setIfDiffers(e,{value:t,type:KT.Append,options:i??{applyAtProcessCreation:!0},scope:n})}prepend(e,t,i,n){this._setIfDiffers(e,{value:t,type:KT.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),r=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!==r.applyAtProcessCreation||n.options?.applyAtShellIntegration!==r.applyAtShellIntegration||n.scope?.workspaceFolder?.index!==t.scope?.workspaceFolder?.index){const o=this.getKey(e,t.scope),a={variable:e,...t,options:r};this.map.set(o,a),this._onDidChangeCollection.fire()}}get(e,t){const i=this.getKey(e,t),n=this.map.get(i);return n?X9e(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,X9e(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 r;typeof e=="string"?r=e:r=e?.value.split(` -`)[0];const o={description:r,scope:t};this.descriptionMap.set(i,o),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 gii{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 bIe=class extends vIe{constructor(e,t){super(!1,e,t)}createTerminal(e,t,i){throw new dS}createTerminalFromOptions(e,t){throw new dS}};bIe=D([_(0,iP),_(1,Jr)],bIe);function Aot(s){if(!(!s||typeof s=="string"))return"id"in s?{id:s.id,color:s.color}:s}function fii(s){return $2.isThemeColor(s)?s:void 0}function X9e(s){const e={...s};return delete e.scope,e.options=e.options??void 0,delete e.variable,e}const xle=ae("IExtHostApiDeprecationService");let wIe=class{constructor(e,t){this._extHostLogService=t,this._reportedUsages=new Set,this._telemetryShape=e.getProxy(We.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}`}};wIe=D([_(0,Jr),_(1,Ke)],wIe);var pne;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(pne||(pne={}));var mne;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(mne||(mne={}));var yIe;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(yIe||(yIe={}));var Mz;(function(s){function e(n){if(n){const r=n;return r&&!!r.process}else return!1}s.is=e;function t(n){if(n==null)return;const r={process:n.process,args:n.args};return n.options&&(r.options=yIe.from(n.options)),r}s.from=t;function i(n){if(n!=null)return new hN(n.process,n.args,n.options)}s.to=i})(Mz||(Mz={}));var CIe;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(CIe||(CIe={}));var Nz;(function(s){function e(n){if(n){const r=n;return r&&(!!r.commandLine||!!r.command)}else return!1}s.is=e;function t(n){if(n==null)return;const r={};return n.commandLine!==void 0?r.commandLine=n.commandLine:(r.command=n.command,r.args=n.args),n.options&&(r.options=CIe.from(n.options)),r}s.from=t;function i(n){if(!(n==null||n.command===void 0&&n.commandLine===void 0))return n.commandLine?new bI(n.commandLine,n.options):new bI(n.command,n.args?n.args:[],n.options)}s.to=i})(Nz||(Nz={}));var yA;(function(s){function e(n){if(n){const r=n;return r&&r.customExecution==="customExecution"}else return!1}s.is=e;function t(n){return{customExecution:"customExecution"}}s.from=t;function i(n,r){return r.get(n)}s.to=i})(yA||(yA={}));var SIe;(function(s){function e(t){if(t!=null)return{_id:t.id,isDefault:t.isDefault}}s.from=e})(SIe||(SIe={}));var Xx;(function(s){function e(n,r){if(n==null)return[];const o=[];for(const a of n){const c=t(a,r);c&&o.push(c)}return o}s.fromMany=e;function t(n,r){if(n==null)return;let o;n.execution instanceof hN?o=Mz.from(n.execution):n.execution instanceof bI?o=Nz.from(n.execution):n.execution&&n.execution instanceof ile&&(o=yA.from(n.execution));const a=pne.from(n.definition);let c;return n.scope?typeof n.scope=="number"?c=n.scope:c=n.scope.uri:c=wI.Workspace,!a||!c?void 0:{_id:n._id,definition:a,name:n.name,source:{extensionId:r.identifier.value,label:n.source,scope:c},execution:o,isBackground:n.isBackground,group:SIe.from(n.group),presentationOptions:mne.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,r,o){if(n==null)return;let a;Mz.is(n.execution)?a=Mz.to(n.execution):Nz.is(n.execution)?a=Nz.to(n.execution):yA.is(n.execution)&&(a=yA.to(n._id,o));const c=pne.to(n.definition);let l;if(n.source&&(n.source.scope!==void 0?typeof n.source.scope=="number"?l=n.source.scope:l=await r.resolveWorkspaceFolder(N.revive(n.source.scope)):l=wI.Workspace),!c||!l)return;const d=new J9(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=pH.from(n.group._id),d.group&&n.group.isDefault&&(d.group=new pH(d.group.id,d.group.label),n.group.isDefault===!0&&(d.group.isDefault=n.group.isDefault))),n.presentationOptions&&(d.presentationOptions=mne.to(n.presentationOptions)),n._id&&(d._id=n._id),n.detail&&(d.detail=n.detail),d}s.to=i})(Xx||(Xx={}));var AIe;(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})(AIe||(AIe={}));var I7;class mge{constructor(e,t,i){Ht(this,I7);this._id=t,this._task=i,St(this,I7,e)}get task(){return this._task}terminate(){Ce(this,I7).terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}}I7=new WeakMap;let EIe=class{constructor(e,t,i,n,r,o,a,c){this._onDidExecuteTask=new I,this._onDidTerminateTask=new I,this._onDidTaskProcessStarted=new I,this._onDidTaskProcessEnded=new I,this._proxy=e.getProxy(We.MainThreadTask),this._workspaceProvider=i,this._editorService=n,this._configurationService=r,this._terminalService=o,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 js(()=>{});const n=this.nextHandle();return this._handlers.set(n,{type:t,provider:i,extension:e}),this._proxy.$registerTaskProvider(n,t),new js(()=>{this._handlers.delete(n),this._proxy.$unregisterTaskProvider(n)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(AIe.from(e)).then(async t=>{const i=[];for(const n of t){const r=await Xx.to(n,this._workspaceProvider,this._providedCustomExecutions2);r&&i.push(r)}return i})}get taskExecutions(){const e=[];return this._taskExecutions.forEach(t=>e.push(t)),e}terminateTask(e){if(!(e instanceof mge))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=[],r=Jh(()=>i.provider.provideTasks(Ue.None)).then(o=>this.provideTasksInternal(t,n,i,o));return new Promise(o=>{r.then(a=>{Promise.all(n).then(()=>{o(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 Xx.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!n)throw new Error("Unexpected: Task cannot be resolved.");const r=await i.provider.resolveTask(n,Ue.None);if(!r)return;this.checkDeprecation(r,i);const o=Xx.from(r,i.extension);if(!o)throw new Error("Unexpected: Task cannot be resolved.");if(r.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 yA.is(o.execution)&&await this.addCustomExecution(o,r,!0),await this.resolveTaskInternal(o)}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 r=this._taskExecutionPromises.get(e);if(!r)throw new Ra("Unexpected: The specified task is missing an execution");return r}const i=this._taskExecutionPromises.get(e.id);if(i)return i;let n;return t?n=Promise.resolve(new mge(this,e.id,t)):n=Xx.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(r=>{if(!r)throw new Ra("Unexpected: Task does not exist.");return new mge(this,e.id,r)}),this._taskExecutionPromises.set(e.id,n),n.then(r=>(this._taskExecutions.set(e.id,r),r))}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()}};EIe=D([_(0,Jr),_(1,bu),_(2,dE),_(3,s4),_(4,hE),_(5,r4),_(6,Ke),_(7,xle)],EIe);let xIe=class extends EIe{constructor(e,t,i,n,r,o,a,c){super(e,t,i,n,r,o,a,c),this.registerTaskSystem(pe.vscodeRemote,{scheme:pe.vscodeRemote,authority:"",platform:Gat(Qd.Web)})}async executeTask(e,t){if(!t.execution)throw new Error("Tasks to execute must include an execution");const i=Xx.from(t,e);if(i===void 0)throw new Error("Task is not valid");if(yA.is(i.execution))await this.addCustomExecution(i,t,!1);else throw new dS;const n=await this.getTaskExecution(await this._proxy.$getTaskExecution(i),t);return this._proxy.$executeTask(i).catch(r=>{throw new Error(r)}),n}provideTasksInternal(e,t,i,n){const r=[];if(n)for(const o of n){if(this.checkDeprecation(o,i),!o.definition||!e[o.definition.type]){const c=o.source?o.source:"No task source";this._logService.warn(`The task [${c}, ${o.name}] uses an undefined task type. The task will be ignored in the future.`)}const a=Xx.from(o,i.extension);a&&yA.is(a.execution)?(r.push(a),t.push(this.addCustomExecution(a,o,!0))):this._logService.warn("Only custom execution tasks supported.")}return{tasks:r,extension:i.extension}}async resolveTaskInternal(e){if(yA.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){}};xIe=D([_(0,Jr),_(1,bu),_(2,dE),_(3,s4),_(4,hE),_(5,r4),_(6,Ke),_(7,xle)],xIe);const Eot=ae("IExtHostTask"),xG=ae("IExtHostEditorTabs");class Z9e{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 ua.TextInput:return new sle(N.revive(this._dto.input.uri));case ua.TextDiffInput:return new m$(N.revive(this._dto.input.original),N.revive(this._dto.input.modified));case ua.TextMergeInput:return new CPe(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 ua.CustomEditorInput:return new rle(N.revive(this._dto.input.uri),this._dto.input.viewType);case ua.WebviewEditorInput:return new SPe(this._dto.input.viewType);case ua.NotebookInput:return new ole(N.revive(this._dto.input.uri),this._dto.input.notebookType);case ua.NotebookDiffInput:return new ale(N.revive(this._dto.input.original),N.revive(this._dto.input.modified),this._dto.input.notebookType);case ua.TerminalEditorInput:return new APe;case ua.InteractiveEditorInput:return new EPe(N.revive(this._dto.input.uri),N.revive(this._dto.input.inputBoxUri));case ua.ChatEditorInput:return new xPe;case ua.MultiDiffEditorInput:return new DPe(this._dto.input.diffEditors.map(e=>new m$(N.revive(e.original),N.revive(e.modified))));default:return}}}class pii{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 Z9e(i,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return Dl.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===mh.TAB_OPEN){const i=new Z9e(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===mh.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===mh.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 DIe=class{constructor(e){this._onDidChangeTabs=new I,this._onDidChangeTabGroups=new I,this._extHostTabGroups=[],this._proxy=e.getProxy(We.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(r=>r.groupId===i)?.apiObject)},close:async(i,n)=>{const r=Array.isArray(i)?i:[i];return r.length?mii(r[0])?this._closeGroups(r,n):this._closeTabs(r,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=zoe(t,i),r=this._extHostTabGroups.filter(l=>n.removed.includes(l.groupId)).map(l=>l.apiObject),o=[],a=[];this._extHostTabGroups=e.map(l=>{const d=new pii(l,()=>this._activeGroupId);return n.added.includes(d.groupId)?o.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:o,closed:r,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 mh.TAB_OPEN:this._onDidChangeTabs.fire(Object.freeze({opened:[i.apiObject],closed:[],changed:[]}));return;case mh.TAB_CLOSE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[i.apiObject],changed:[]}));return;case mh.TAB_MOVE:case mh.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 r=this._findExtHostTabFromApi(n);if(!r)throw new Error("Tab close: Invalid tab not found!");i.push(r.tabId)}return this._proxy.$closeTab(i,t)}async _closeGroups(e,t){const i=[];for(const n of e){const r=this._findExtHostTabGroupFromApi(n);if(!r)throw new Error("Group close: Invalid group not found!");i.push(r.groupId)}return this._proxy.$closeGroup(i,t)}};DIe=D([_(0,Jr)],DIe);function mii(s){return s.tabs!==void 0}const Eoe=class Eoe{constructor(e,t,i,n){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=i,this.activateResolvedTime=n}};Eoe.NONE=new Eoe(!1,-1,-1,-1);let eU=Eoe;class e$e{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 eU(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 Dle{constructor(e,t,i,n,r,o){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=i,this.module=n,this.exports=r,this.disposable=o}}class _ii extends Dle{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,V.None)}}class vii extends Dle{constructor(){super(!1,null,eU.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}class _ne extends Dle{constructor(e){super(!0,e,eU.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}let kIe=class{constructor(e,t,i,n){this._logService=n,this._registry=e,this._globalRegistry=t,this._host=i,this._operations=new ba,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 r=new Error(`Cannot activate unknown extension '${e.id.value}'`),o=this._createAndSaveOperation(e,null,[],new _ne(r));return this._host.onExtensionActivationError(e.id,r,new GHe(e.id.value)),o}const i=[],n=typeof t.extensionDependencies>"u"?[]:t.extensionDependencies;for(const r of n){if(this._isResolvedExtension(r))continue;const o=this._operations.get(r);if(o){i.push(o);continue}if(this._isHostExtension(r)){i.push(this._handleActivationRequest({id:this._globalRegistry.getExtensionDescription(r).identifier,reason:e.reason}));continue}const a=this._registry.getExtensionDescription(r);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 '${r}'`),d=this._createAndSaveOperation(e,t.displayName,[],new _ne(l));return this._host.onExtensionActivationError(t.identifier,l,new GHe(r)),d}return this._createAndSaveOperation(e,t.displayName,i,null)}_createAndSaveOperation(e,t,i,n){const r=new IIe(e.id,t,e.reason,i,n,this._host,this._logService);return this._operations.set(e.id,r),r}_isHostExtension(e){return yD.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){const t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};kIe=D([_(3,Ke)],kIe);let IIe=class{get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}constructor(e,t,i,n,r,o,a){this._id=e,this._displayName=t,this._reason=i,this._deps=n,this._value=r,this._host=o,this._logService=a,this._barrier=new jd,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 _ne(t),this._isDisposed&&Oo(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)}}};IIe=D([_(6,Ke)],IIe);class xot{constructor(e,t){this._logService=t,this._onDidChangeStorage=new I,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(We.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,i){const n=await this._proxy.$initializeExtensionStorage(e,t);let r;return n&&(r=this.safeParseValue(e,t,n)),r||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 sFe=ae("IExtHostStorage");class Dot{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 ln(()=>{const n=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(const r of n.values())r.complete()}catch(r){for(const o of n.values())o.error(r)}})()},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 hc;return this._deferredPromises.set(e,n),this._scheduler.isScheduled()||this._scheduler.schedule(),n.p}dispose(){this._storageListener.dispose()}}class bii extends Dot{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 rFe=ae("IExtensionStoragePaths");let TIe=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(){}};TIe=D([_(0,bu),_(1,Ke),_(2,Sle)],TIe);const oFe=ae("IExtHostAuthentication");let LIe=class{constructor(e){this._authenticationProviders=new Map,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event,this._getSessionTaskSingler=new wii,this._proxy=e.getProxy(We.MainThreadAuthentication)}async getSession(e,t,i,n={}){const r=An.toKey(e.identifier),o=[...i].sort().join(" ");return await this._getSessionTaskSingler.getOrCreate(`${r} ${t} ${o}`,async()=>{await this._proxy.$ensureProvider(t);const a=e.displayName||e.name;return this._proxy.$getSession(t,i,r,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 r=i.onDidChangeSessions(o=>this._proxy.$sendDidChangeSessions(e,o));return this._proxy.$registerAuthenticationProvider(e,t,n?.supportsMultipleAccounts??!1),new js(()=>{r.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(lle)||this._onDidChangeSessions.fire({provider:{id:e,label:t}}),Promise.resolve()}};LIe=D([_(0,Jr)],LIe);class wii{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 RIe;const aFe=ae("IExtHostLanguageModels");class t$e{constructor(e,t){this.option=e,this.stream=new V2,this.stream=t??new V2}}class yii{constructor(){this._responseStreams=new Map,this._defaultStream=new V2,this._isDone=!1;const e=this;this.apiObject={get stream(){return e._defaultStream.asyncIterable},get text(){return Yd.map(e._defaultStream.asyncIterable,t=>{if(t instanceof PH)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 t$e(e.index,this._defaultStream):t=new t$e(e.index),this._responseStreams.set(e.index,t));let i;e.part.type==="text"?i=new PH(e.part.value):i=new cle(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 fM;let MIe=(fM=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 ba,this._pendingRequest=new Map,this._languageAccessInformationExtensions=new Set,this._proxy=e.getProxy(We.MainThreadLanguageModels)}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose()}registerLanguageModel(e,t,i,n){const r=RIe._idPool++;this._languageModels.set(r,{extension:e.identifier,provider:i,languageModelId:t});let o;n.auth&&(o={providerLabel:e.displayName||e.name,accountLabel:typeof n.auth=="object"?n.auth.label:void 0}),this._proxy.$registerLanguageModelProvider(r,`${An.toKey(e.identifier)}/${r}/${t}`,{extension:e.identifier,id:t,vendor:n.vendor??An.toKey(e.identifier),name:n.name??"",family:n.family??"",version:n.version,maxInputTokens:n.maxInputTokens,maxOutputTokens:n.maxOutputTokens,auth:o,targetExtensions:n.extensions});const a=i.onDidReceiveLanguageModelResponse2?.(({extensionId:c,participant:l,tokenCount:d})=>{this._proxy.$whenLanguageModelChatRequestMade(t,new An(c),l,d)});return Ee(()=>{this._languageModels.delete(r),this._proxy.$unregisterProvider(r),a?.dispose()})}async $startChatRequest(e,t,i,n,r,o){const a=this._languageModels.get(e);if(!a)throw new Error("Provider not found");const c=new hu(async d=>{if(o.isCancellationRequested){this._logService.warn(`[CHAT](${a.extension.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}let h;if(d.part instanceof cle?h={type:"function_use",name:d.part.name,parameters:d.part.parameters}:d.part instanceof PH&&(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(PF.to),r,An.toKey(i),c,o));else{const d=new hu(async h=>{c.report({index:h.index,part:new PH(h.part)})});l=Promise.resolve(a.provider.provideLanguageModelResponse(n.map(PF.to),r?.modelOptions??{},An.toKey(i),d,o))}l.then(()=>{this._proxy.$reportResponseDone(t,void 0)},d=>{this._proxy.$reportResponseDone(t,kA(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 ba});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 Na),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=[],r=this;for(const o of i){const a=this._allLanguageModelData.get(o);if(!a)continue;this._isUsingAuth(e.identifier,a.metadata)&&await this._fakeAuthPopulate(a.metadata);let c=a.apiObjects.get(e.identifier);c||(c={id:o,vendor:a.metadata.vendor,family:a.metadata.family,version:a.metadata.version,name:a.metadata.name,maxInputTokens:a.metadata.maxInputTokens,countTokens(l,d){if(!r._allLanguageModelData.has(o))throw Ow.NotFound(o);return r._computeTokenLength(o,l,d??Ue.None)},sendRequest(l,d,h){if(!r._allLanguageModelData.has(o))throw Ow.NotFound(o);return r._sendChatRequest(e,o,l,d??{},h??Ue.None)}},a.apiObjects.set(e.identifier,c)),n.push(c)}return n}async _sendChatRequest(e,t,i,n,r){const o=this._convertMessages(e,i),a=e.identifier,c=this._allLanguageModelData.get(t)?.metadata;if(!c||!this._allLanguageModelData.has(t))throw Ow.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 Ow.NoPermissions(`Language model '${t}' cannot be used by '${a.value}'.`);try{const l=Math.random()*1e6|0,d=new yii;this._pendingRequest.set(l,{languageModelId:t,res:d});try{await this._proxy.$tryStartChatRequest(a,t,l,o,n,r)}catch(h){throw this._pendingRequest.delete(l),h}return d.apiObject}catch(l){throw l.name===Ow.name?l:new Ow(`Language model '${t}' errored: ${Po(l)}`,"Unknown",l)}}_convertMessages(e,t){const i=[];for(const n of t)n.role===jp.System&&ze(e,"languageModelSystem"),n.content2 instanceof b$&&ze(e,"lmTools"),i.push(PF.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(_8(t)):i.res.resolve())}async _getAuthAccess(e,t,i,n){const r=lle+t.identifier.value;if(await this._extHostAuthentication.getSession(e,r,[],{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,r,[],{forceNewSession:{detail:a}}),this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0}catch{return!1}}_isUsingAuth(e,t){return!!t.auth&&!An.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 Ow.NotFound(`Language model '${e}' is unknown.`);const r=ui.find(this._languageModels.values(),o=>o.languageModelId===e);return r?r.provider.provideTokenCount(t,i):this._proxy.$countTokens(e,typeof t=="string"?t:PF.from(t),i)}$updateModelAccesslist(e){const t=new Array;for(const{from:i,to:n,enabled:r}of e){const o=this._modelAccessList.get(i)??new D_;if(o.has(n)!==r){r?o.add(n):o.delete(n),this._modelAccessList.set(i,o);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,r=>An.equals(r.from,e.identifier))),n=M.signal(this._onDidChangeProviders.event);return{get onDidChange(){return M.any(i,n)},canSendRequest(r){let o;e:for(const[c,l]of t._allLanguageModelData)for(const d of l.apiObjects.values())if(d===r){o=l.metadata;break e}if(!o)return;if(!t._isUsingAuth(e.identifier,o))return!0;const a=t._modelAccessList.get(e.identifier);if(a)return a.has(o.extension)}}}},RIe=fM,fM._idPool=1,fM);MIe=RIe=D([_(0,Jr),_(1,Ke),_(2,oFe)],MIe);class kot{constructor(e){this._onDidChangePassword=new I,this.onDidChangePassword=this._onDidChangePassword.event,this._proxy=e.getProxy(We.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 cFe=ae("IExtHostSecretState");var px;class Cii{constructor(e,t){Ht(this,px);this.disposables=new Z,this._id=An.toKey(e.identifier),St(this,px,t),this.onDidChange=M.map(M.filter(Ce(this,px).onDidChangePassword,i=>i.extensionId===this._id),i=>({key:i.key}),this.disposables)}dispose(){this.disposables.dispose()}get(e){return Ce(this,px).get(this._id,e)}store(e,t){return Ce(this,px).store(this._id,e,t)}delete(e){return Ce(this,px).delete(this._id,e)}}px=new WeakMap;let NIe=class{constructor(e,t,i){this.logService=i,this.bundleCache=new Map,this._proxy=t.getProxy(We.MainThreadLocalization),this.currentLanguage=e.environment.appLanguage,this.isDefaultLanguage=this.currentLanguage===I1}getMessage(e,t){const{message:i,args:n,comment:r}=t;if(this.isDefaultLanguage)return wfe(i,n??{});let o=i;r&&r.length>0&&(o+=`/${Array.isArray(r)?r.join(""):r}`);const a=this.bundleCache.get(e)?.contents[o];return a||this.logService.warn(`Using default string since no string found in i18n bundle that has the key: ${o}`),wfe(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),r=JSON.parse(n);t=e.isBuiltin?r.contents?.bundle:r}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}};NIe=D([_(0,bu),_(1,Jr),_(2,Ke)],NIe);const lFe=ae("IExtHostLocalizationService"),dFe=ae("IExtHostManagedSockets");let PIe=class{constructor(e){this._remoteSocketIdCounter=0,this._factory=null,this._managedRemoteSockets=new Map,this._proxy=e.getProxy(We.MainThreadManagedSockets)}setFactory(e,t){for(const i of this._managedRemoteSockets.values())i.dispose();this._factory&&this._proxy.$unregisterSocketFactory(this._factory.socketFactoryId),this._factory=new Sii(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 Aii(t,i,n)),n.add(Ee(()=>this._managedRemoteSockets.delete(t))),n.add(i.onDidEnd(()=>{this._proxy.$onDidManagedSocketEnd(t),n.dispose()})),n.add(i.onDidClose(r=>{this._proxy.$onDidManagedSocketClose(t,r?.stack??r?.message),n.dispose()})),n.add(i.onDidReceiveMessage(r=>this._proxy.$onDidManagedSocketHaveData(t,Ge.wrap(r)))),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,Jr)],PIe);class Sii{constructor(e,t){this.socketFactoryId=e,this.makeConnection=t}}class Aii extends V{constructor(e,t,i){super(),this.socketId=e,this.actual=t,this._register(i)}}var FIe;const Iot=ae("IHostUtils");let OIe=FIe=class extends V{constructor(e,t,i,n,r,o,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=r,this._logService=o,this._extHostTunnelService=l,this._extHostTerminalService=d,this._extHostLocalizationService=h,this._mainThreadWorkspaceProxy=this._extHostContext.getProxy(We.MainThreadWorkspace),this._mainThreadTelemetryProxy=this._extHostContext.getProxy(We.MainThreadTelemetry),this._mainThreadExtensionsProxy=this._extHostContext.getProxy(We.MainThreadExtensionService),this._almostReadyToRunExtensions=new jd,this._readyToStartExtensionHost=new jd,this._readyToRunExtensions=new jd,this._eagerExtensionsActivated=new jd,this._activationEventsReader=new xii(this._initData.extensions.activationEvents),this._globalRegistry=new yD(this._activationEventsReader,this._initData.extensions.allExtensions);const p=new D_(this._initData.extensions.myExtensions);this._myRegistry=new yD(this._activationEventsReader,Tot(this._globalRegistry,p)),Uh&&(this._logService.info(`Creating extension host with the following global extensions: ${TP(this._globalRegistry)}`),this._logService.info(`Creating extension host with the following local extensions: ${TP(this._myRegistry)}`)),this._storage=new xot(this._extHostContext,this._logService),this._secretState=new kot(this._extHostContext),this._storagePath=c,this._instaService=this._store.add(e.createChild(new Vc([sFe,this._storage],[cFe,this._secretState]))),this._activator=this._register(new kIe(this._myRegistry,this._globalRegistry,{onExtensionActivationError:(m,v,b)=>{this._mainThreadExtensionsProxy.$onExtensionActivationError(m,kA(v),b)},actualActivateExtension:async(m,v)=>{if(yD.isHostExtension(m,this._myRegistry,this._globalRegistry))return await this._mainThreadExtensionsProxy.$activateExtension(m,v),new vii;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(),ls("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(r=>r.identifier).filter(r=>this.isActivated(r)).map(r=>this._deactivate(r))}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(),m8&&gfe(n=>{this._logService.error(n)}),this._extHostContext.dispose();const i=this._deactivateAll();Promise.race([Ao(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 An(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 Eii(e))),this._extensionPathIndex}async _createExtensionPathIndex(e){const t=Ih.forUris(i=>qKe.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 r=n$e(e,t);this._mainThreadTelemetryProxy.$publicLog2("extensionActivationTimes",{...r,...n||{},outcome:i})}_doActivateExtension(e,t){const i=n$e(e,t);this._mainThreadTelemetryProxy.$publicLog2("activatePlugin",i);const n=this._getEntryPoint(e);if(!n)return Promise.resolve(new _ii(eU.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 r=new Z,o=new e$e(t.startup);return Promise.all([this._loadCommonJSModule(e,Ft(e.extensionLocation,n),o),this._loadExtensionContext(e,r)]).then(a=>(ls(`code/extHost/willActivateExtension/${e.identifier.value}`),FIe._callActivate(this._logService,e.identifier,a[0],a[1],r,o))).then(a=>(ls(`code/extHost/didActivateExtension/${e.identifier.value}`),a))}_loadExtensionContext(e,t){const i=this._extHostLanguageModels.createLanguageModelAccessInformation(e),n=t.add(new bii(e,this._storage)),r=t.add(new Dot(e.identifier.value,!1,this._storage)),o=t.add(new Cii(e,this._secretState)),a=e.isUnderDevelopment?this._initData.environment.extensionTestsLocationURI?eL.Test:eL.Development:eL.Production,c=this._initData.remote.isRemote?ED.Workspace:ED.UI;return this._logService.trace(`ExtensionService#loadExtensionContext ${e.identifier.value}`),Promise.all([n.whenReady,r.whenReady,this._storagePath.whenReady]).then(()=>{const l=this;let d,h;const u=hl(e,"ipc")?this._initData.messagePorts?.get(An.toKey(e.identifier)):void 0;return Object.freeze({globalState:n,workspaceState:r,secrets:o,subscriptions:[],get languageModelAccessInformation(){return i},get extensionUri(){return e.extensionLocation},get extensionPath(){return e.extensionLocation.fsPath},asAbsolutePath(f){return kfe(e.extensionLocation.fsPath,f)},get storagePath(){return l._storagePath.workspaceValue(e)?.fsPath},get globalStoragePath(){return l._storagePath.globalValue(e).fsPath},get logPath(){return kfe(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 jV(l,e.identifier,e,c,!1)),d},get extensionRuntime(){return ze(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,r,o){return i=i||{activate:void 0,deactivate:void 0},this._callActivateOptional(e,t,i,n,o).then(a=>new Dle(!1,null,o.build(),i,a,Ee(()=>{r.dispose(),wt(n.subscriptions)})))}static _callActivateOptional(e,t,i,n,r){if(typeof i.activate=="function")try{r.activateCallStart(),e.trace(`ExtensionService#_callActivateOptional ${t.value}`);const o=typeof global=="object"?global:self,a=i.activate.apply(o,[n]);return r.activateCallStop(),r.activateResolveStart(),Promise.resolve(a).then(c=>(r.activateResolveStop(),c))}catch(o){return Promise.reject(o)}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();pTe(()=>{for(let r=t;r50){this._activateAllStartupFinishedDeferred(e,r);break}else this._activateOneStartupFinished(o,a)}})}_activateAllStartupFinished(){this._mainThreadExtensionsProxy.$setPerformanceMarks(Uxt()),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 r of n.activationEvents)r==="onStartupFinished"&&this._activateOneStartupFinished(n,r)})}_handleEagerExtensions(){const e=this._activateByEvent("*",!0).then(void 0,o=>{this._logService.error(o)});this._register(this._extHostWorkspace.onDidChangeWorkspace(o=>this._handleWorkspaceContainsEagerExtensions(o.added)));const t=this._extHostWorkspace.workspace?this._extHostWorkspace.workspace.folders:[],i=this._handleWorkspaceContainsEagerExtensions(t),n=this._handleRemoteResolverEagerExtensions(),r=Promise.all([n,e,i]).then(()=>{});return Promise.race([r,Ao(1e4)]).then(()=>{this._activateAllStartupFinished()}),r}_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(o=>o.uri),forceUsingSearch:i||!this._hostUtils.fsExists,exists:o=>this._hostUtils.fsExists(o.fsPath),checkExists:(o,a,c)=>this._mainThreadWorkspaceProxy.$checkExists(o,a,c)},r=await ost(n,t);if(r)return this._activateById(t.identifier,{startup:!0,extensionId:t.identifier,activationEvent:r.activationEvent}).then(void 0,o=>this._logService.error(o))}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 e$e(!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,r)=>{const o=(l,d)=>{l?(Uh&&this._logService.error("Test runner called back with error",l),r(l)):(Uh&&(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=i_(t),c=i.run(a,o);c&&c.then&&c.then(()=>{Uh&&this._logService.info("Test runner finished successfully."),n(0)}).catch(l=>{Uh&&this._logService.error("Test runner finished with error",l),r(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(),Ao(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 a1("Not an authority that can be resolved!",id.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=Ys.create(!1),n=()=>`[resolveAuthority(${Eee(e)},${t})][${i.elapsed()}ms] `,r=w=>this._logService.info(`${n()}${w}`),o=w=>this._logService.warn(`${n()}${w}`),a=(w,y=void 0)=>this._logService.error(`${n()}${w}`,y),c=w=>{if(w instanceof a1)return{type:"error",error:{code:w._code,message:w._message,detail:w._detail}};throw w},l=async w=>{r(`activating resolver for ${w}...`);const{resolver:y,authorityPrefix:C}=await this._activateAndGetResolver(w);if(!y)throw a(`no resolver for ${C}`),new a1(`No remote extension installed to resolve ${C}.`,id.NoResolverFound);return{resolver:y,authorityPrefix:C,remoteAuthority:w}},d=e.split(/@|%40/g).reverse();r(`activating remote resolvers ${d.join(" -> ")}`);let h;try{h=await Promise.all(d.map(l)).catch(async w=>{if(!(w instanceof a1)||w._code!==id.InvalidAuthority)throw w;return o(`resolving nested authorities failed: ${w.message}`),[await l(e)]})}catch(w){return c(w)}const u=new l6;u.cancelAndSet(()=>r("waiting..."),1e3);let f,p;for(const[w,{authorityPrefix:y,resolver:C,remoteAuthority:A}]of h.entries())try{if(w===h.length-1)r("invoking final resolve()..."),ls(`code/extHost/willResolveAuthority/${y}`),f=await C.resolve(A,{resolveAttempt:t,execServer:p}),ls(`code/extHost/didResolveAuthorityOK/${y}`),r("setting tunnel factory..."),this._register(await this._extHostTunnelService.setTunnelFactory(C,uz.isManagedResolvedAuthority(f)?f:void 0));else{if(r(`invoking resolveExecServer() for ${A}`),ls(`code/extHost/willResolveExecServer/${y}`),p=await C.resolveExecServer?.(A,{resolveAttempt:t,execServer:p}),!p)throw new a1(`Exec server was not available for ${A}`,id.NoResolverFound);ls(`code/extHost/didResolveExecServerOK/${y}`)}}catch(L){return ls(`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};r(`returned ${uz.isManagedResolvedAuthority(f)?"managed authority":`${f.host}:${f.port}`}`);let b;if(uz.isManagedResolvedAuthority(f)){const w=t;this._extHostManagedSockets.setFactory(w,f.makeConnection),b={authority:e,connectTo:new Qnt(w),connectionToken:f.connectionToken}}else b={authority:e,connectTo:new jnt(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 (${Eee(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 r=await Jh(()=>i.getCanonicalURI(n));return r||n}async $startExtensionHost(e){e.toAdd.forEach(o=>o.extensionLocation=N.revive(o.extensionLocation));const{globalRegistry:t,myExtensions:i}=i$e(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),Uh&&(this._logService.info(`$startExtensionHost: global extensions: ${TP(this._globalRegistry)}`),this._logService.info(`$startExtensionHost: local extensions: ${TP(this._myRegistry)}`)),this._startExtensionHost()}$activateByEvent(e,t){return t===Bb.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(o=>o.extensionLocation=N.revive(o.extensionLocation));const{globalRegistry:t,myExtensions:i}=i$e(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),Uh&&(this._logService.info(`$deltaExtensions: global extensions: ${TP(this._globalRegistry)}`),this._logService.info(`$deltaExtensions: local extensions: ${TP(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=Ge.alloc(e),i=Math.random()%256;for(let n=0;na.identifier));for(const a of i.myToRemove)r.delete(a);for(const a of i.myToAdd)r.add(a);const o=Tot(n,r);return{globalRegistry:n,myExtensions:o}}function n$e(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 TP(s){return s.getAllExtensionDescriptions().map(e=>e.identifier.value).join(",")}const WI=ae("IExtHostExtensionService");var eT,T7,tT;class jV{constructor(e,t,i,n,r){Ht(this,eT);Ht(this,T7);Ht(this,tT);St(this,eT,e),St(this,T7,t),St(this,tT,i.identifier),this.id=i.identifier.value,this.extensionUri=i.extensionLocation,this.extensionPath=Bk(i_(i.extensionLocation)),this.packageJSON=i,this.extensionKind=n,this.isFromDifferentExtensionHost=r}get isActive(){return Ce(this,eT).isActivated(Ce(this,tT))}get exports(){if(!(this.packageJSON.api==="none"||this.isFromDifferentExtensionHost))return Ce(this,eT).getExtensionExports(Ce(this,tT))}async activate(){if(this.isFromDifferentExtensionHost)throw new Error("Cannot activate foreign extension");return await Ce(this,eT).activateByIdWithErrors(Ce(this,tT),{startup:!1,extensionId:Ce(this,T7),activationEvent:"api"}),this.exports}}eT=new WeakMap,T7=new WeakMap,tT=new WeakMap;function Tot(s,e){return s.getAllExtensionDescriptions().filter(t=>e.has(t.identifier))}class Eii{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 xii{constructor(e){this._map=new ba,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 hFe=ae("IExtHostVariableResolverProvider");class Dii extends cne{constructor(e,t,i,n,r,o,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 m$||d.input instanceof ale)return d.input.modified;if(d.input instanceof sle||d.input instanceof ole||d.input instanceof rle)return d.input.uri}}}super({getFolderUri:l=>{const d=o.folders.filter(h=>h.name===l);if(d&&d.length>0)return d[0].uri},getWorkspaceFolderCount:()=>o.folders.length,getConfigurationValue:(l,d)=>r.getConfiguration(void 0,l).get(d),getAppRoot:()=>M2(),getExecPath:()=>N2.VSCODE_EXEC_PATH,getFilePath:()=>{const l=c();if(l)return Bk(l.fsPath)},getWorkspaceFolderPathForFile:()=>{if(t){const l=c();if(l){const d=t.getWorkspaceFolder(l);if(d)return Bk(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(N2))}}let BIe=class extends V{constructor(e,t,i,n,r){super(),this.extensionService=e,this.workspaceService=t,this.editorService=i,this.configurationService=n,this.editorTabs=r,this._resolver=new Ca(async()=>{const o=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 Dii(this.extensionService,this.workspaceService,this.editorService,this.editorTabs,o,c,this.homeDir())})}getResolver(){return this._resolver.value}homeDir(){}};BIe=D([_(0,WI),_(1,dE),_(2,s4),_(3,hE),_(4,xG)],BIe);var s$e;(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"})(s$e||(s$e={}));var r$e;(function(s){s.List="list",s.Tree="true"})(r$e||(r$e={}));var o$e;(function(s){s.ByLocation="location",s.ByStatus="status",s.ByDuration="duration"})(o$e||(o$e={}));Un.Errored+"",g(4063,"Errored"),Un.Failed+"",g(4064,"Failed"),Un.Passed+"",g(4065,"Passed"),Un.Queued+"",g(4066,"Queued"),Un.Running+"",g(4067,"Running"),Un.Skipped+"",g(4068,"Skipped"),Un.Unset+"",g(4069,"Not yet run");Qh.Debug+"",g(4071,"Debug"),Qh.Run+"",g(4072,"Run"),Qh.Coverage+"",g(4073,"Coverage");var WIe;(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"})(WIe||(WIe={}));let kii=0;const a$e=new WeakMap,kle=ae("IExtHostTesting");let HIe=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(We.MainThreadTesting),this.observer=new Nii(this.proxy),this.runTracker=new Lii(this.proxy,t),i.registerArgumentProcessor({processArgument:r=>{switch(r?.$mid){case ys.TestItemContext:{const o=r,a=o.tests[o.tests.length-1].item.extId;return this.controllers.get(bn.root(a))?.collection.tree.get(a)?.actual??j9e(r)}case ys.TestMessageMenuArgs:{const{test:o,message:a}=r,c=o.item.extId;return{test:this.controllers.get(bn.root(c))?.collection.tree.get(c)?.actual??j9e({$mid:ys.TestItemContext,tests:[o]}),message:jH.to(a)}}default:return r}}}),i.registerCommand(!1,"testing.getExplorerSelection",async()=>{const r=await i.executeCommand(WIe.GetExplorerSelection),o=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:r?.include.map(o).filter(Oc)||[],exclude:r?.exclude.map(o).filter(Oc)||[]}})}createTestController(e,t,i,n){if(this.controllers.has(t))throw new Error(`Attempt to insert a duplicate controller with ID "${t}"`);const r=new Z,o=r.add(new iii(t,i,this.editors));o.root.label=i;const a=new Map,c=new Set,l=this.proxy,d=()=>{let f=0;n&&(f|=mz.Refresh);const p=u.relatedCodeProvider;return p&&(p?.provideRelatedTests&&(f|=mz.TestRelatedToCode),p?.provideRelatedCode&&(f|=mz.CodeRelatedToTest)),f},h={items:o.root.children,get label(){return i},set label(f){i=f,o.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){ze(e,"testRelatedCode"),u.relatedCodeProvider=f,l.$updateController(t,{capabilities:d()})},createRunProfile:(f,p,m,v,b,w)=>{let y=Hc(f);for(;a.has(y);)y++;return new Rot(this.proxy,a,c,this.defaultProfilesChangedEmitter.event,t,y,f,p,m,v,b,w)},createTestItem(f,p,m){return new tP(t,f,p,m)},createTestRun:(f,p,m=!0)=>this.runTracker.createTestRun(e,t,o,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=>bn.fromExtHostTestItem(m,t).toString()))}},set resolveHandler(f){o.resolveHandler=f},get resolveHandler(){return o.resolveHandler},dispose:()=>{r.dispose()}},u={controller:h,collection:o,profiles:a,extension:e,activeProfiles:c};return l.$registerTestController(t,i,d()),r.add(Ee(()=>l.$unregisterTestController(t))),this.controllers.set(t,u),r.add(Ee(()=>this.controllers.delete(t))),r.add(o.onDidGenerateDiff(f=>l.$publishDiff(t,f.map(HH.serialize)))),h}createTestObserver(){return this.observer.checkout()}async runTests(e,t=Ue.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:uFe[i.kind],targets:[{testIds:e.include?.map(r=>bn.fromExtHostTestItem(r,n.collection.root.id).toString())??[n.collection.root.id],profileId:i.profileId,controllerId:i.controllerId}],exclude:e.exclude?.map(r=>r.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 r=Yr.to(t),o=[];return await Promise.all([...this.controllers.values()].map(async a=>{let c;try{c=await a.relatedCodeProvider?.provideRelatedTests?.(n.document,r,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)o.push(bn.fromExtHostTestItem(l,a.controller.id).toString());a.collection.flushDiff()}})),o}async $getCodeRelatedToTest(e,t){const i=this.controllers.get(bn.root(e));if(!i)return[];const n=i.collection.tree.get(e);return n?(await i.relatedCodeProvider?.provideRelatedCode?.(n.actual,t))?.map(ff.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(uie.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 r=this.controllers.get(i);if(!r)continue;const o=new Map,a=n.filter(l=>!r.activeProfiles.has(l)),c=[...r.activeProfiles].filter(l=>!n.includes(l));for(const l of a)o.set(l,!0),r.activeProfiles.add(l);for(const l of c)o.set(l,!1),r.activeProfiles.delete(l);o.size&&t.set(i,o)}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=wxe.to(t);return a$e.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=>HH.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 li(t),n=await Promise.all(e.map(r=>this.runControllerTestRequest(r,!0,i.token)));return!t.isCancellationRequested&&!n.some(r=>r.error)&&await new Promise(r=>t.onCancellationRequested(r)),i.dispose(!0),n}async $provideTestFollowups(e,t){const i=this.results.find(o=>a$e.get(o)===e.resultId),n=i&&Pii(bn.fromString(e.extId),i?.results);if(!n)return[];let r=[];return await Promise.all([...this.followupProviders].map(async o=>{try{const a=await o.provideFollowup(i,n,e.taskIndex,e.messageIndex,t);a&&(r=r.concat(a))}catch(a){this.logService.error("Error thrown while providing followup for test message",a)}})),t.isCancellationRequested?[]:r.map(o=>{const a=kii++;return this.testFollowups.set(a,o),{title:o.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:r,profiles:o,extension:a}=n,c=o.get(e.profileId);if(!c)return{};const l=e.testIds.map(f=>r.tree.get(f)).filter(Oc),d=e.excludeExtIds.map(f=>n.collection.tree.get(f)).filter(Oc).filter(f=>l.some(p=>p.fullId.compare(f.fullId)===Hv.IsChild));if(!l.length)return{};const h=new p$(l.some(f=>f.actual instanceof nFe)?void 0:l.map(f=>f.actual),d.map(f=>f.actual),c,t),u=Sjt(e)&&this.runTracker.prepareForMainThreadTestRun(a,h,l7.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)}}};HIe=D([_(0,Jr),_(1,Ke),_(2,iP),_(3,s4)],HIe);const Iii=1e4;var KE;(function(s){s[s.Running=0]="Running",s[s.Cancelling=1]="Cancelling",s[s.Ended=2]="Ended"})(KE||(KE={}));class Tii extends V{get hasRunningTasks(){return this.running>0}get id(){return this.dto.id}constructor(e,t,i,n,r,o){super(),this.dto=e,this.proxy=t,this.logService=i,this.profile=n,this.extension=r,this.state=KE.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 li(o));const a=this._register(new ln(()=>this.forciblyEndTasks(),Iii));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===KE.Running?(this.cts.cancel(),this.state=KE.Cancelling):this.state===KE.Cancelling&&this.forciblyEndTasks()}async getCoverageDetails(e,t,i){const[,n]=bn.fromString(e).path,r=this.publishedCoverage.get(e);if(!r)return[];const{report:o,extIds:a}=r,c=this.tasks.get(n);if(!c)throw new Error("unreachable: run task was not found");let l;if(t&&o instanceof mN){const h=a.indexOf(t);if(h===-1)return[];l=o.fromTests[h]}return await(l?this.profile?.loadDetailedCoverageForTest?.(c.run,o,l,i):this.profile?.loadDetailedCoverage?.(c.run,o,i))??[]}createRun(e){const t=this.dto.id,i=this.dto.controllerId,n=ao(),r=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)},o=(l,d)=>{const h=d instanceof Array?d.map(jH.from):[jH.from(d)];if(l.uri&&l.range){const u={range:tt.from(l.range),uri:l.uri};for(const f of h)f.location=f.location||u}this.proxy.$appendTestMessagesInRun(t,n,bn.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 mN?l.fromTests:[];if(d.length){ze(this.extension,"attributableCoverage");for(const f of d)this.ensureTestIsKnown(f)}const h=l.uri.toString(),u=new bn([t,n,h]).toString();this.publishedCoverage.set(u,{report:l,extIds:d.map(f=>bn.fromExtHostTestItem(f,i).toString())}),this.proxy.$appendCoverage(t,n,uie.fromFile(i,u,l))},enqueued:r(l=>{this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,i).toString(),Un.Queued)}),skipped:r(l=>{this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,i).toString(),Un.Skipped)}),started:r(l=>{this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,i).toString(),Un.Running)}),errored:r((l,d,h)=>{o(l,d),this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,i).toString(),Un.Errored,h)}),failed:r((l,d,h)=>{o(l,d),this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,i).toString(),Un.Failed,h)}),passed:r((l,d)=>{this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,this.dto.controllerId).toString(),Un.Passed,d)}),appendOutput:(l,d,h)=>{a||(h&&this.ensureTestIsKnown(h),this.proxy.$appendOutputToRun(t,n,Ge.fromString(l),d&&ff.from(d),h&&bn.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!==KE.Ended&&(this.state=KE.Ended,this.endEmitter.fire())}ensureTestIsKnown(e){if(!(e instanceof tP))throw new qte(e.id);if(this.sharedTestIds.has(bn.fromExtHostTestItem(e,this.dto.controllerId).toString()))return;const t=[],i=this.dto.colllection.root;for(;;){const n=CI.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 Lii{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=bn.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,r){return this.getTracker(t,i,n,e,r)}cancelRunById(e){this.trackedById.get(e)?.cancel()}cancelAllRuns(){for(const e of this.tracked.values())e.cancel()}createTestRun(e,t,i,n,r,o){const a=this.tracked.get(n);if(a)return a.createRun(r);const c=l7.fromPublic(t,i,n,o),l=Lot(n);this.proxy.$startedExtensionTestRun({controllerId:t,continuous:!!n.continuous,profile:l&&{group:uFe[l.kind],id:l.profileId},exclude:n.exclude?.map(h=>bn.fromExtHostTestItem(h,i.root.id).toString())??[],id:c.id,include:n.include?.map(h=>bn.fromExtHostTestItem(h,i.root.id).toString())??[i.root.id],preserveFocus:n.preserveFocus??!0,persist:o});const d=this.getTracker(n,c,n.profile,e);return M.once(d.onEnd)(()=>{this.proxy.$finishedExtensionTestRun(c.id)}),d.createRun(r)}getTracker(e,t,i,n,r){const o=new Tii(t,this.proxy,this.logService,i,n,r);return this.tracked.set(e,o),this.trackedById.set(o.id,o),o}}const Lot=s=>{if(s.profile){if(!(s.profile instanceof Rot))throw new Error("TestRunRequest.profile is not an instance created from TestController.createRunProfile");return s.profile}};class l7{static fromPublic(e,t,i,n){return new l7(e,ao(),n,t)}static fromInternal(e,t){return new l7(e.controllerId,e.runId,!0,t)}constructor(e,t,i,n){this.controllerId=e,this.id=t,this.isPersisted=i,this.colllection=n}}class Rii{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,CI.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(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 Mii extends Ejt{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:CI.toPlain(e.item),depth:t?t.depth+1:0,children:new Set}}createChangeCollector(){return new Rii(this.changeEmitter)}}class Nii{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:fm(()=>{--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 Mii({asCanonicalUri:t=>t});return this.proxy.$subscribeToDiffs(),{observers:0,tests:e}}}const U4=(s,e,t,i)=>{t?Object.assign(t,i):e.$updateTestRunConfig(s.controllerId,s.profileId,i)};var zv,iT,L7,Op,r2;class Rot{constructor(e,t,i,n,r,o,a,c,l,d=!1,h=void 0,u=!1){Ht(this,zv);Ht(this,iT);Ht(this,L7);Ht(this,Op);Ht(this,r2);this.controllerId=r,this.profileId=o,this._label=a,this.kind=c,this.runHandler=l,this._tag=h,this._supportsContinuousRun=u,St(this,zv,e),St(this,r2,t),St(this,iT,i),St(this,L7,n),t.set(o,this);const f=uFe[c];if(typeof f!="number")throw new Error(`Unknown TestRunProfile.group ${c}`);d&&i.add(o),St(this,Op,{profileId:o,controllerId:r,tag:h?$b.namespace(this.controllerId,h.id):null,label:a,group:f,isDefault:d,hasConfigurationHandler:!1,supportsContinuousRun:u}),queueMicrotask(()=>{Ce(this,Op)&&(Ce(this,zv).$publishTestRunProfile(Ce(this,Op)),St(this,Op,void 0))})}get label(){return this._label}set label(e){e!==this._label&&(this._label=e,U4(this,Ce(this,zv),Ce(this,Op),{label:e}))}get supportsContinuousRun(){return this._supportsContinuousRun}set supportsContinuousRun(e){e!==this._supportsContinuousRun&&(this._supportsContinuousRun=e,U4(this,Ce(this,zv),Ce(this,Op),{supportsContinuousRun:e}))}get isDefault(){return Ce(this,iT).has(this.profileId)}set isDefault(e){e!==this.isDefault&&(e?Ce(this,iT).add(this.profileId):Ce(this,iT).delete(this.profileId),U4(this,Ce(this,zv),Ce(this,Op),{isDefault:e}))}get tag(){return this._tag}set tag(e){e?.id!==this._tag?.id&&(this._tag=e,U4(this,Ce(this,zv),Ce(this,Op),{tag:e?$b.namespace(this.controllerId,e.id):null}))}get configureHandler(){return this._configureHandler}set configureHandler(e){e!==this._configureHandler&&(this._configureHandler=e,U4(this,Ce(this,zv),Ce(this,Op),{hasConfigurationHandler:!!e}))}get onDidChangeDefault(){return M.chain(Ce(this,L7),e=>e.map(t=>t.get(this.controllerId)?.get(this.profileId)).filter(Oc))}dispose(){Ce(this,r2)?.delete(this.profileId)&&(St(this,r2,void 0),Ce(this,zv).$removeTestProfile(this.controllerId,this.profileId)),St(this,Op,void 0)}}zv=new WeakMap,iT=new WeakMap,L7=new WeakMap,Op=new WeakMap,r2=new WeakMap;const uFe={[tL.Coverage]:Qh.Coverage,[tL.Debug]:Qh.Debug,[tL.Run]:Qh.Run};function Pii(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 Mot=ae("IExtHostDebugService");let UIe=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,r,o,a,c){super(),this._workspaceService=t,this._extensionService=i,this._configurationService=n,this._editorTabs=r,this._variableResolver=o,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(We.MainThreadDebugService),this._onDidChangeBreakpoints=this._register(new I),this._onDidChangeActiveStackItem=this._register(new I),this._activeDebugConsole=new Oii(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=An.toKey(e.identifier),r=this.extensionVisKey(n,t);if(this._debugVisualizationProviders.has(r))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationTrees.set(r,i),this._debugServiceProxy.$registerDebugVisualizerTree(r,!!i.editItem),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizerTree(r),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(r=>this.convertVisualizerTreeItem(e,r))||[]:[]}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 r of n)i.push(this._debugVisualizationElements.get(r)?.children),this._debugVisualizationElements.delete(r)}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})),Ixe.from(t,i)}asDebugSourceUri(e,t){const i=e;if(typeof i.sourceReference=="number"&&i.sourceReference>0){let n=`debug:${encodeURIComponent(i.path||"")}`,r="?";return t&&(n+=`${r}session=${encodeURIComponent(t.id)}`,r="&"),n+=`${r}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 r of n)NQt(r)&&t.push(r.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:r,extensionId:o}=i;if(n.visualization||(n=await r.resolveDebugVisualization?.(n,t)||n,i.v=n),!n.visualization)throw new Error(`No visualization returned from resolveDebugVisualization in '${r}'`);return this.serializeVisualization(o,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 r=this.hydrateVisualizationContext(i),o=this.extensionVisKey(e,t),a=this._debugVisualizationProviders.get(o);if(!r||!a)return[];const c=await a.provideDebugVisualization(r,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(o=>o.id===t))throw new Error(`Extensions may only call registerDebugVisualizationProvider() for renderers they contribute (got ${t})`);const n=An.toKey(e.identifier),r=this.extensionVisKey(n,t);if(this._debugVisualizationProviders.has(r))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationProviders.set(r,i),this._debugServiceProxy.$registerDebugVisualizer(n,t),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizer(n,t),this._debugVisualizationProviders.delete(t)})}addBreakpoints(e){const t=e.filter(r=>{const o=r.id;return this._breakpoints.has(o)?!1:(this._breakpoints.set(o,r),!0)});this.fireBreakpointChanges(t,[],[]);const i=[],n=new Map;for(const r of t)if(r instanceof qx){let o=n.get(r.location.uri.toString());o||(o={type:"sourceMulti",uri:r.location.uri,lines:[]},n.set(r.location.uri.toString(),o),i.push(o)),o.lines.push({id:r.id,enabled:r.enabled,condition:r.condition,hitCondition:r.hitCondition,logMessage:r.logMessage,line:r.location.range.start.line,character:r.location.range.start.character,mode:r.mode})}else r instanceof Qx&&i.push({type:"function",id:r.id,enabled:r.enabled,hitCondition:r.hitCondition,logMessage:r.logMessage,condition:r.condition,functionName:r.functionName,mode:r.mode});return this._debugServiceProxy.$registerBreakpoints(i)}removeBreakpoints(e){const t=e.filter(o=>this._breakpoints.delete(o.id));this.fireBreakpointChanges([],t,[]);const i=t.filter(o=>o instanceof qx).map(o=>o.id),n=t.filter(o=>o instanceof Qx).map(o=>o.id),r=t.filter(o=>o instanceof hte).map(o=>o.id);return this._debugServiceProxy.$unregisterBreakpoints(i,n,r)}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===c$.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 js(()=>{});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 js(()=>{this._configProviders=this._configProviders.filter(r=>r.provider!==t),this._debugServiceProxy.$unregisterDebugConfigurationProvider(n)})}registerDebugAdapterDescriptorFactory(e,t,i){if(!i)return new js(()=>{});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 js(()=>{this._adapterFactories=this._adapterFactories.filter(r=>r.factory!==i),this._debugServiceProxy.$unregisterDebugAdapterDescriptorFactory(n)})}registerDebugAdapterTrackerFactory(e,t){if(!t)return new js(()=>{});const i=this._trackerFactoryHandleCounter++;return this._trackerFactories.push({type:e,handle:i,factory:t}),new js(()=>{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 Wii(e.implementation)}createSignService(){}async $startDASession(e,t){const i=this,n=await this.getSession(t);return this.getAdapterDescriptor(this.getAdapterDescriptorFactoryByType(n.type),n).then(r=>{if(!r)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${n.type}' (extension might have failed to activate)`);const o=this.convertToDto(r),a=this.createDebugAdapter(o,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=irt(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=trt(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 r of e.added){const o=r.id;if(o&&!this._breakpoints.has(o)){let a;if(r.type==="function")a=new Qx(r.functionName,r.enabled,r.condition,r.hitCondition,r.logMessage,r.mode);else if(r.type==="data")a=new hte(r.label,r.dataId,r.canPersist,r.enabled,r.hitCondition,r.condition,r.logMessage,r.mode);else{const c=N.revive(r.uri);a=new qx(new Ap(c,new ws(r.line,r.character)),r.enabled,r.condition,r.hitCondition,r.logMessage,r.mode)}p7t(a,o),this._breakpoints.set(o,a),t.push(a)}}if(e.removed)for(const r of e.removed){const o=this._breakpoints.get(r);o&&(this._breakpoints.delete(r),i.push(o))}if(e.changed){for(const r of e.changed)if(r.id){const o=this._breakpoints.get(r.id);if(o){if(o instanceof Qx&&r.type==="function"){const a=o;a.enabled=r.enabled,a.condition=r.condition,a.hitCondition=r.hitCondition,a.logMessage=r.logMessage,a.functionName=r.functionName}else if(o instanceof qx&&r.type==="source"){const a=o;a.enabled=r.enabled,a.condition=r.condition,a.hitCondition=r.hitCondition,a.logMessage=r.logMessage,a.location=new Ap(N.revive(r.uri),new ws(r.line,r.character))}n.push(o)}}}this.fireBreakpointChanges(t,i,n)}async $acceptStackFrameFocus(e){let t;if(e){const i=await this.getSession(e.sessionId);e.kind==="thread"?t=new _Pe(i.api,e.threadId):t=new mPe(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 r=await this.getFolder(t);return n.provideDebugConfigurations(r,i)}).then(n=>{if(!n)throw new Error("nothing returned from DebugConfigurationProvider.provideDebugConfigurations");return n})}$resolveDebugConfiguration(e,t,i,n){return Jh(async()=>{const r=this.getConfigProviderByHandle(e);if(!r)throw new Error("no DebugConfigurationProvider found");if(!r.resolveDebugConfiguration)throw new Error("DebugConfigurationProvider has no method resolveDebugConfiguration");const o=await this.getFolder(t);return r.resolveDebugConfiguration(o,i,n)})}$resolveDebugConfigurationWithSubstitutedVariables(e,t,i,n){return Jh(async()=>{const r=this.getConfigProviderByHandle(e);if(!r)throw new Error("no DebugConfigurationProvider found");if(!r.resolveDebugConfigurationWithSubstitutedVariables)throw new Error("DebugConfigurationProvider has no method resolveDebugConfigurationWithSubstitutedVariables");const o=await this.getFolder(t);return r.resolveDebugConfigurationWithSubstitutedVariables(o,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(r=>{if(!r)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${n.type}'`);return this.convertToDto(r)})}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 t$)return{type:"executable",command:e.command,args:e.args,options:e.options};if(e instanceof vH)return{type:"server",port:e.port,host:e.host};if(e instanceof i$)return{type:"pipeServer",path:e.path};if(e instanceof n$)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(r=>r.type===i||r.type==="*").map(r=>Jh(()=>r.factory.createDebugAdapterTracker(e.api)).then(o=>o,o=>null));return Promise.race([Promise.all(n).then(r=>{const o=Oi(r);if(o.length>0)return new Bii(o)}),new Promise(r=>setTimeout(()=>r(void 0),1e3))]).catch(r=>{})}async getAdapterDescriptor(e,t){const i=t.configuration.debugServer;if(typeof i=="number")return Promise.resolve(new vH(i));if(e){const r=await this._extensionService.getExtensionRegistry();return Jh(()=>e.createDebugAdapterDescriptor(t.api,this.daExecutableFromPackage(t,r))).then(o=>{if(o)return o})}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 Fii(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:gee.Command};if("treeId"in t)return{type:gee.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=He.asClassName(t):i=t,{iconPath:i,iconClass:n}}getIconUris(e){if(e instanceof fu)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}}};UIe=D([_(0,Jr),_(1,dE),_(2,WI),_(3,hE),_(4,xG),_(5,hFe),_(6,iP),_(7,kle)],UIe);class Fii{constructor(e,t,i,n,r,o,a){this._debugServiceProxy=e,this._id=t,this._type=i,this._name=n,this._workspaceFolder=r,this._configuration=o,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 Oii{constructor(e){this.value=Object.freeze({append(t){e.$appendDebugConsole(t)},appendLine(t){this.append(t+` -`)}})}}class Bii{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 Wii extends Yst{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 VIe=class extends UIe{constructor(e,t,i,n,r,o,a,c){super(e,t,i,n,r,o,a,c)}};VIe=D([_(0,Jr),_(1,dE),_(2,WI),_(3,hE),_(4,xG),_(5,hFe),_(6,iP),_(7,kle)],VIe);class Hii{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&&X_(e.includePattern),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&X_(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 r=o=>{this.resultCount++,e(o)};if(this.isCanceled)return i({limitHit:this.isLimitHit});this.config.extraFileResources&&this.config.extraFileResources.forEach(o=>{const a=o.toString(),c=Kr(a);this.globalExcludePattern&&this.globalExcludePattern(a,c)||this.matchFile(r,{base:o,basename:c})}),Promise.all(t.map(o=>this.searchInFolder(o,r))).then(o=>{i({limitHit:this.isLimitHit,stats:o[0]||void 0})},o=>{n(new Error(Po(o)))})})}async searchInFolder(e,t){const i=new li,n=this.getSearchOptionsForFolder(e),r=this.initDirectoryTree(),o=new sst(this.config,e),a=!o.hasSiblingExcludeClauses();let c;try{this.activeCancellationTokens.add(i),c=Ys.create();const l=await this.provider.provideFileSearchResults({pattern:this.config.filePattern||""},n,i.token),d=c.elapsed(),h=Ys.create();return this.isCanceled&&!this.isLimitHit||(l&&l.forEach(u=>{const f=zi.relative(e.folder.path,u.path);if(a){const p=Kr(u.path);this.matchFile(t,{base:e.folder,relativePath:f,basename:p});return}this.addDirectoryEntries(r,e.folder,f,t)}),this.isCanceled&&!this.isLimitHit)?null:(this.matchDirectoryTree(r,o,t),{providerTime:d,postProcessTime:h.elapsed()})}finally{i.dispose(),this.activeCancellationTokens.delete(i)}}getSearchOptionsForFolder(e){const t=Pee(this.config.includePattern,e.includePattern),i=Pee(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 o=Kr(this.filePattern);this.matchFile(n,{base:t,relativePath:this.filePattern,basename:o})}function r(o){const a=Kr(o),c=xb(o);let l=e[c];l||(l=e[c]=[],r(c)),l.push({base:t,relativePath:o,basename:a})}r(i)}matchDirectoryTree({rootEntries:e,pathToEntries:t},i,n){const r=this,o=this.filePattern;function a(c){const l=B9t(()=>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 xoe=class xoe{constructor(){this.sessions=new Map}fileSearch(e,t,i,n){const r=this.getSessionTokenSource(e.cacheKey),o=new Hii(e,t,r&&r.token);let a=0;const c=l=>{a+=l.length,i(l.map(d=>this.rawMatchToSearchItem(d)))};return this.doSearch(o,xoe.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 li),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:Ft(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,i,n){const r=n.onCancellationRequested(()=>{e.cancel()}),o=c=>{c&&(a.push(c),t>0&&a.length>=t&&(i(a),a=[]))};let a=[];return e.search(o).then(c=>(a.length&&i(a),r.dispose(),c),c=>(a.length&&i(a),r.dispose(),Promise.reject(c)))}};xoe.BATCH_SIZE=512;let zIe=xoe;class c$e{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 li(t);return new Promise((r,o)=>{this.collector=new Vii(e);let a=!1;const c=(l,d)=>{if(!a&&!this.isLimitHit){const h=this.resultSize(l);YV(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||!YV(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);r({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=Po(l);o(new Error(d))})})}resultSize(e){return YV(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 sst(this.query,e),r=[],o={report:l=>{if(!this.validateProviderResult(l))return;const d=e.folder.scheme===pe.file?O9t(()=>this.fileUtils.readdir(Ro(l.uri))):void 0,h=MN(e.folder,l.uri);if(h){const u=n.includedInQuery(h,Kr(h),d);Xy(u)?r.push(u.then(f=>{f&&t(l)})):u&&t(l)}}},a=this.getSearchOptionsForFolder(e);let c;return this.queryProviderPair.query.type===fI.aiText?c=await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,a,o,i):c=await this.queryProviderPair.provider.provideTextSearchResults(Uii(this.queryProviderPair.query.contentPattern),a,o,i),r.length&&await Promise.all(r),c}validateProviderResult(e){if(YV(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=Pee(this.query.includePattern,e.includePattern),i=Pee(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??I9t,previewOptions:this.query.previewOptions,afterContext:this.query.afterContext,beforeContext:this.query.beforeContext};return"usePCRE2"in this.query&&(n.usePCRE2=this.query.usePCRE2),n}}function Uii(s){return{isCaseSensitive:s.isCaseSensitive||!1,isRegExp:s.isRegExp||!1,isWordMatch:s.isWordMatch||!1,isMultiline:s.isMultiline||!1,pattern:s.pattern}}class Vii{constructor(e){this._onResult=e,this._currentFolderIdx=-1,this._currentFileMatch=null,this._batchedCollector=new $Ie(512,t=>this.sendItems(t))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!Yi(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||(this._currentFolderIdx=t,this._currentFileMatch={resource:e.uri,results:[]}),this._currentFileMatch.results.push(zii(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 zii(s){return YV(s)?{preview:{matches:h8(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:h8(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 YV(s){return!!s.preview}const IO=class IO{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()},IO.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))}};IO.TIMEOUT=4e3,IO.START_BATCH_AFTER_COUNT=50;let $Ie=IO;const Not=ae("IExtHostSearch");let GIe=class{constructor(e,t,i){this.extHostRpc=e,this._uriTransformer=t,this._logService=i,this._proxy=this.extHostRpc.getProxy(We.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 zIe}_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 r=_ge(i),o=this._fileSearchProvider.get(e);if(o)return this._fileSearchManager.fileSearch(r,o,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 r=this._textSearchProvider.get(e);if(!r||!r.provideTextSearchResults)throw new Error(`Unknown Text Search Provider ${e}`);const o=_ge(i);return this.createTextSearchManager(o,r).search(c=>this._proxy.$handleTextMatch(e,t,c),n)}$provideAITextSearchResults(e,t,i,n){const r=this._aiTextSearchProvider.get(e);if(!r||!r.provideAITextSearchResults)throw new Error(`Unknown AI Text Search Provider ${e}`);const o=_ge(i);return this.createAITextSearchManager(o,r).search(c=>this._proxy.$handleTextMatch(e,t,c),n)}$enableExtensionHostSearch(){}createTextSearchManager(e,t){return new c$e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"textSearchProvider")}createAITextSearchManager(e,t){return new c$e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"aiTextSearchProvider")}};GIe=D([_(0,Jr),_(1,Ale),_(2,Ke)],GIe);function _ge(s){return{...s,folderQueries:s.folderQueries&&s.folderQueries.map($ii),extraFileResources:s.extraFileResources&&s.extraFileResources.map(e=>N.revive(e))}}function $ii(s){return{...s,folder:N.revive(s.folder)}}var KIe,pM;let qIe=(pM=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=KIe.InitialState,this._proxy=e.getProxy(We.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 Qu(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(Qu(e.scheme))return Promise.reject("Invalid scheme - cannot be empty");const i=await this._proxy.$asExternalUri(e,t);return N.from(i)}},KIe=pM,pM.InitialState={focused:!0,active:!0},pM);qIe=KIe=D([_(0,Jr)],qIe);const Pot=ae("IExtHostWindow");let vne=class extends Wje{constructor(e,t){super(t.logLevel,t.logsLocation,t.loggers.map(i=>Mr(i))),this._proxy=e.getProxy(We.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 Gii(this._proxy,e,t,i)}};vne=D([_(0,Jr),_(1,bu)],vne);class Gii extends xae{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 QIe=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(We.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 Kii(t.value,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(e,n),n.store.add(t.onWillDispose(()=>this._activeShellIntegrations.get(e)?.dispose())),n.store.add(n.onDidRequestShellExecution(r=>this._proxy.$executeCommand(e,r))),n.store.add(n.onDidRequestEndExecution(r=>this._onDidEndTerminalShellExecution.fire(r))),n.store.add(n.onDidRequestChangeShellIntegration(r=>this._onDidChangeTerminalShellIntegration.fire(r))),t.shellIntegration=n.value),this._onDidChangeTerminalShellIntegration.fire({terminal:i,shellIntegration:n.value})}$shellExecutionStart(e,t,i,n,r){this._activeShellIntegrations.has(e)||this.$shellIntegrationChange(e);const o={value:t,confidence:i,isTrusted:n};this._activeShellIntegrations.get(e)?.startShellExecution(o,N.revive(r))}$shellExecutionEnd(e,t,i,n,r){const o={value:t,confidence:i,isTrusted:n};this._activeShellIntegrations.get(e)?.endShellExecution(o,r)}$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)}};QIe=D([_(0,Jr),_(1,r4)],QIe);class Kii 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,r){let o=n;r&&(o+=` "${r.map(l=>`${l.replaceAll('"','\\"')}`).join('" "')}"`),i._onDidRequestShellExecution.fire(o);const a={value:o,confidence:CD.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 qii(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 qii{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 Yd.EMPTY;this._dataStream=new Qii}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 Qii extends V{constructor(){super(...arguments),this._emitters=[]}createIterable(){this._barrier||(this._barrier=new jd);const e=this._barrier;return new Yd(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(lFe,NIe,Qt.Delayed);ce(pf,vne,Qt.Delayed);ce(xle,wIe,Qt.Delayed);ce(iP,fIe,Qt.Eager);ce(oFe,LIe,Qt.Eager);ce(aFe,MIe,Qt.Eager);ce(hE,uIe,Qt.Eager);ce(Sle,cIe,Qt.Eager);ce(kle,HIe,Qt.Eager);ce(Mot,VIe,Qt.Eager);ce(yot,hIe,Qt.Eager);ce(s4,_Ie,Qt.Eager);ce(dFe,PIe,Qt.Eager);ce(n4,$ti,Qt.Eager);ce(bot,lIe,Qt.Delayed);ce(Not,GIe,Qt.Eager);ce(sFe,xot,Qt.Eager);ce(Eot,xIe,Qt.Eager);ce(r4,bIe,Qt.Eager);ce(Fot,QIe,Qt.Eager);ce(KPe,ADe,Qt.Eager);ce(Pot,qIe,Qt.Eager);ce(dE,dIe,Qt.Eager);ce(cFe,kot,Qt.Eager);ce(Ele,gIe,Qt.Eager);ce(xG,DIe,Qt.Eager);ce(hFe,BIe,Qt.Eager);let jIe=class extends tXe{constructor(e,t,i){const n=i.remote.isRemote?"remoteexthost":e?"workerexthost":"exthost",r=i.remote.isRemote?g(578,"Extension Host (Remote)"):e?g(579,"Extension Host (Worker)"):g(580,"Extension Host");super(t.createLogger(n,{name:r}))}};jIe=D([_(1,pf),_(2,bu)],jIe);class l$e{static async installEarlyHandler(e){Error.stackTraceLimit=100;const t=e.get(Ke),n=e.get(Jr).getProxy(We.MainThreadErrors);gfe(r=>{t.error(r);const o=kA(r);n.$onUnexpectedError(o)})}static async installFullHandler(e){const t=e.get(Ke),i=e.get(Jr),n=e.get(WI),r=e.get(Ele),o=i.getProxy(We.MainThreadExtensionService),a=i.getProxy(We.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})}}),gfe(f=>{t.error(f);const p=kA(f),m=l.get(f);if(!m?.extensionIdentifier){a.$onUnexpectedError(p);return}o.$onExtensionRuntimeError(m.extensionIdentifier,p);const v=r.onExtensionError(m.extensionIdentifier,f);t.trace("forwarded error to extension?",v,m)})}}class gFe{constructor(e,t,i,n,r){this._hostUtils=i,this._rpcProtocol=new kee(e,null,n),t=gFe._transform(t,this._rpcProtocol);const o=new Vc(...zpe());o.set(bu,{_serviceBrand:void 0,...t,messagePorts:r}),o.set(Jr,new nJt(this._rpcProtocol)),o.set(Ale,new Kti(n)),o.set(Iot,i),o.set(Ke,new yi(jIe,[!0],!0)),o.set(pf,new yi(vne,[],!0));const a=new B3(o,!0);m8&&a.invokeFunction(l$e.installEarlyHandler),this._logService=a.invokeFunction(c=>c.get(Ke)),ls("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(WI)),this._extensionService.initialize(),m8&&a.invokeFunction(l$e.installFullHandler)}async asBrowserUri(e){const t=this._rpcProtocol.getProxy(We.MainThreadExtensionService);return N.revive(await t.$asBrowserUri(e))}async getAllStaticBrowserUris(){return(await this._rpcProtocol.getProxy(We.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 jii{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(We.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 js(()=>{this._proxy.$unregisterAiRelatedInformationProvider(n),this._relatedInformationProviders.delete(n)})}}const Yii=[new fn("vscode.executeDocumentHighlights","_executeDocumentHighlights","Execute document highlight provider.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of DocumentHighlight-instances.",_v($H.to))),new fn("vscode.executeDocumentSymbolProvider","_executeDocumentSymbolProvider","Execute document symbol provider.",[ut.Uri],new sn("A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.",(s,e)=>{if(wU(s))return;class t extends cH{static to(n){const r=new t(n.name,rv.to(n.kind),n.containerName||"",new Ap(e[0],tt.to(n.range)));return r.detail=n.detail,r.range=r.location.range,r.selectionRange=tt.to(n.selectionRange),r.children=n.children?n.children.map(t.to):[],r}}return s.map(t.to)})),new fn("vscode.executeFormatDocumentProvider","_executeFormatDocumentProvider","Execute document format provider.",[ut.Uri,new ut("options","Formatting options",s=>!0,s=>s)],new sn("A promise that resolves to an array of TextEdits.",_v(ad.to))),new fn("vscode.executeFormatRangeProvider","_executeFormatRangeProvider","Execute range format provider.",[ut.Uri,ut.Range,new ut("options","Formatting options",s=>!0,s=>s)],new sn("A promise that resolves to an array of TextEdits.",_v(ad.to))),new fn("vscode.executeFormatOnTypeProvider","_executeFormatOnTypeProvider","Execute format on type provider.",[ut.Uri,ut.Position,new ut("ch","Trigger character",s=>typeof s=="string",s=>s),new ut("options","Formatting options",s=>!0,s=>s)],new sn("A promise that resolves to an array of TextEdits.",_v(ad.to))),new fn("vscode.executeDefinitionProvider","_executeDefinitionProvider","Execute all definition providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.experimental.executeDefinitionProvider_recursive","_executeDefinitionProvider_recursive","Execute all definition providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.executeTypeDefinitionProvider","_executeTypeDefinitionProvider","Execute all type definition providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.experimental.executeTypeDefinitionProvider_recursive","_executeTypeDefinitionProvider_recursive","Execute all type definition providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.executeDeclarationProvider","_executeDeclarationProvider","Execute all declaration providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.experimental.executeDeclarationProvider_recursive","_executeDeclarationProvider_recursive","Execute all declaration providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.executeImplementationProvider","_executeImplementationProvider","Execute all implementation providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.experimental.executeImplementationProvider_recursive","_executeImplementationProvider_recursive","Execute all implementation providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.executeReferenceProvider","_executeReferenceProvider","Execute all reference providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location-instances.",_v(ff.to))),new fn("vscode.experimental.executeReferenceProvider","_executeReferenceProvider_recursive","Execute all reference providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location-instances.",_v(ff.to))),new fn("vscode.executeHoverProvider","_executeHoverProvider","Execute all hover providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Hover-instances.",_v(k$.to))),new fn("vscode.experimental.executeHoverProvider_recursive","_executeHoverProvider_recursive","Execute all hover providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Hover-instances.",_v(k$.to))),new fn("vscode.executeSelectionRangeProvider","_executeSelectionRangeProvider","Execute selection range provider.",[ut.Uri,new ut("position","A position in a text document",s=>Array.isArray(s)&&s.every(e=>ws.isPosition(e)),s=>s.map(Yr.from))],new sn("A promise that resolves to an array of ranges.",s=>s.map(e=>{let t;for(const i of e.reverse())t=new hH(tt.to(i),t);return t}))),new fn("vscode.executeWorkspaceSymbolProvider","_executeWorkspaceSymbolProvider","Execute all workspace symbol providers.",[ut.String.with("query","Search string")],new sn("A promise that resolves to an array of SymbolInformation-instances.",s=>s.map(x$.to))),new fn("vscode.prepareCallHierarchy","_executePrepareCallHierarchy","Prepare call hierarchy at a position inside a document",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of CallHierarchyItem-instances",s=>s.map(bN.to))),new fn("vscode.provideIncomingCalls","_executeProvideIncomingCalls","Compute incoming calls for an item",[ut.CallHierarchyItem],new sn("A promise that resolves to an array of CallHierarchyIncomingCall-instances",s=>s.map(sxe.to))),new fn("vscode.provideOutgoingCalls","_executeProvideOutgoingCalls","Compute outgoing calls for an item",[ut.CallHierarchyItem],new sn("A promise that resolves to an array of CallHierarchyOutgoingCall-instances",s=>s.map(rxe.to))),new fn("vscode.prepareRename","_executePrepareRename","Execute the prepareRename of rename provider.",[ut.Uri,ut.Position],new sn("A promise that resolves to a range and placeholder text.",s=>{if(s)return{range:tt.to(s.range),placeholder:s.text}})),new fn("vscode.executeDocumentRenameProvider","_executeDocumentRenameProvider","Execute rename provider.",[ut.Uri,ut.Position,ut.String.with("newName","The new symbol name")],new sn("A promise that resolves to a WorkspaceEdit.",s=>{if(s){if(s.rejectReason)throw new Error(s.rejectReason);return Zu.to(s)}})),new fn("vscode.executeLinkProvider","_executeLinkProvider","Execute document link provider.",[ut.Uri,ut.Number.with("linkResolveCount","Number of links that should be resolved, only when links are unresolved.").optional()],new sn("A promise that resolves to an array of DocumentLink-instances.",s=>s.map(sL.to))),new fn("vscode.provideDocumentSemanticTokensLegend","_provideDocumentSemanticTokensLegend","Provide semantic tokens legend for a document",[ut.Uri],new sn("A promise that resolves to SemanticTokensLegend.",s=>{if(s)return new mte(s.tokenTypes,s.tokenModifiers)})),new fn("vscode.provideDocumentSemanticTokens","_provideDocumentSemanticTokens","Provide semantic tokens for a document",[ut.Uri],new sn("A promise that resolves to SemanticTokens.",s=>{if(!s)return;const e=pZ(s);if(e.type==="full")return new gN(e.data,void 0)})),new fn("vscode.provideDocumentRangeSemanticTokensLegend","_provideDocumentRangeSemanticTokensLegend","Provide semantic tokens legend for a document range",[ut.Uri,ut.Range.optional()],new sn("A promise that resolves to SemanticTokensLegend.",s=>{if(s)return new mte(s.tokenTypes,s.tokenModifiers)})),new fn("vscode.provideDocumentRangeSemanticTokens","_provideDocumentRangeSemanticTokens","Provide semantic tokens for a document range",[ut.Uri,ut.Range],new sn("A promise that resolves to SemanticTokens.",s=>{if(!s)return;const e=pZ(s);if(e.type==="full")return new gN(e.data,void 0)})),new fn("vscode.executeCompletionItemProvider","_executeCompletionItemProvider","Execute completion item provider.",[ut.Uri,ut.Position,ut.String.with("triggerCharacter","Trigger completion when the user types the character, like `,` or `(`").optional(),ut.Number.with("itemResolveCount","Number of completions to resolve (too large numbers slow down completions)").optional()],new sn("A promise that resolves to a CompletionList-instance.",(s,e,t)=>{if(!s)return new aN([]);const i=s.suggestions.map(n=>dxe.to(n,t));return new aN(i,s.incomplete)})),new fn("vscode.executeSignatureHelpProvider","_executeSignatureHelpProvider","Execute signature help provider.",[ut.Uri,ut.Position,ut.String.with("triggerCharacter","Trigger signature help when the user types the character, like `,` or `(`").optional()],new sn("A promise that resolves to SignatureHelp.",s=>{if(s)return I$.to(s)})),new fn("vscode.executeCodeLensProvider","_executeCodeLensProvider","Execute code lens provider.",[ut.Uri,ut.Number.with("itemResolveCount","Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)").optional()],new sn("A promise that resolves to an array of CodeLens-instances.",(s,e,t)=>_v(i=>new z9(tt.to(i.range),i.command&&t.fromInternal(i.command)))(s))),new fn("vscode.executeCodeActionProvider","_executeCodeActionProvider","Execute code action provider.",[ut.Uri,new ut("rangeOrSelection","Range in a text document. Some refactoring provider requires Selection object.",s=>Xn.isRange(s),s=>uC.isSelection(s)?zb.from(s):tt.from(s)),ut.String.with("kind","Code action kind to return code actions for").optional(),ut.Number.with("itemResolveCount","Number of code actions to resolve (too large numbers slow down code actions)").optional()],new sn("A promise that resolves to an array of Command-instances.",(s,e,t)=>_v(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 V9(i.title,i.kind?new Aa(i.kind):void 0);return i.edit&&(n.edit=Zu.to(i.edit)),i.command&&(n.command=t.fromInternal(i.command)),n.isPreferred=i.isPreferred,n}})(s))),new fn("vscode.executeDocumentColorProvider","_executeDocumentColorProvider","Execute document color provider.",[ut.Uri],new sn("A promise that resolves to an array of ColorInformation objects.",s=>s?s.map(e=>new j9(tt.to(e.range),GH.to(e.color))):[])),new fn("vscode.executeColorPresentationProvider","_executeColorPresentationProvider","Execute color presentation provider.",[new ut("color","The color to show and insert",s=>s instanceof dN,GH.from),new ut("context","Context object with uri and range",s=>!0,s=>({uri:s.uri,range:tt.from(s.range)}))],new sn("A promise that resolves to an array of ColorPresentation objects.",s=>s?s.map(rie.to):[])),new fn("vscode.executeInlayHintProvider","_executeInlayHintProvider","Execute inlay hints provider",[ut.Uri,ut.Range],new sn("A promise that resolves to an array of Inlay objects",(s,e,t)=>s.map(hxe.to.bind(void 0,t)))),new fn("vscode.executeFoldingRangeProvider","_executeFoldingRangeProvider","Execute folding range provider",[ut.Uri],new sn("A promise that resolves to an array of FoldingRange objects",(s,e)=>{if(s)return s.map(aie.to)})),new fn("vscode.resolveNotebookContentProviders","_resolveNotebookContentProvider","Resolve Notebook Content Providers",[],new sn("A promise that resolves to an array of NotebookContentProvider static info objects.",_v(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=>die.to(e))})))),new fn("vscode.executeInlineValueProvider","_executeInlineValueProvider","Execute inline value provider",[ut.Uri,ut.Range,new ut("context","An InlineValueContext",s=>s&&typeof s.frameId=="number"&&s.stoppedLocation instanceof Xn,s=>Zte.from(s))],new sn("A promise that resolves to an array of InlineValue objects",s=>s.map(Xte.to))),new fn("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 ut("uriOrString","Uri-instance or string (only http/https)",s=>N.isUri(s)||typeof s=="string"&&R8(s,pe.http,pe.https),s=>s),new ut("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"?[Dl.from(s),void 0]:[Dl.from(s.viewColumn),vz.from(s)])).optional(),ut.String.with("label","").optional()],sn.Void),new fn("vscode.openWith","_workbench.openWith","Opens the provided resource with a specific editor.",[ut.Uri.with("resource","Resource to open"),ut.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 ut("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"?[Dl.from(s),void 0]:[Dl.from(s.viewColumn),vz.from(s)])).optional()],sn.Void),new fn("vscode.diff","_workbench.diff","Opens the provided resources in the diff editor to compare their contents.",[ut.Uri.with("left","Left-hand side resource of the diff editor"),ut.Uri.with("right","Right-hand side resource of the diff editor"),ut.String.with("title","Human readable title for the diff editor").optional(),new ut("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",s=>s===void 0||typeof s=="object",s=>s&&[Dl.from(s.viewColumn),vz.from(s)]).optional()],sn.Void),new fn("vscode.changes","_workbench.changes","Opens a list of resources in the changes editor to compare their contents.",[ut.String.with("title","Human readable title for the changes editor"),new ut("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)],sn.Void),new fn("vscode.prepareTypeHierarchy","_executePrepareTypeHierarchy","Prepare type hierarchy at a position inside a document",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(rL.to))),new fn("vscode.provideSupertypes","_executeProvideSupertypes","Compute supertypes for an item",[ut.TypeHierarchyItem],new sn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(rL.to))),new fn("vscode.provideSubtypes","_executeProvideSubtypes","Compute subtypes for an item",[ut.TypeHierarchyItem],new sn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(rL.to))),new fn("vscode.revealTestInExplorer","_revealTestInExplorer","Reveals a test instance in the explorer",[ut.TestItem],sn.Void),new fn("vscode.experimental.editSession.continue","_workbench.editSessions.actions.continueEditSession","Continue the current edit session in a different workspace",[ut.Uri.with("workspaceUri","The target workspace to continue the current edit session in")],sn.Void),new fn("setContext","_setContext","Set a custom context key value that can be used in when clauses.",[ut.String.with("name","The context key name"),new ut("value","The context key value",()=>!0,s=>s)],sn.Void),new fn("vscode.executeMappedEditsProvider","_executeMappedEditsProvider","Execute Mapped Edits Provider",[ut.Uri,ut.StringArray,new ut("MappedEditsContext","Mapped Edits Context",s=>lie.is(s),s=>lie.from(s))],new sn("A promise that resolves to a workspace edit or null",s=>s?Zu.to(s):null)),new fn("vscode.editorChat.start","inlineChat.start","Invoke a new editor chat session",[new ut("Run arguments","",s=>!0,s=>{if(s)return{initialRange:s.initialRange?tt.from(s.initialRange):void 0,initialSelection:uC.isSelection(s.initialSelection)?zb.from(s.initialSelection):void 0,message:s.message,autoSend:s.autoSend,position:s.position?Yr.from(s.position):void 0}})],sn.Void)];class Jii{static register(e){Yii.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,"_validateWhenClauses",nlt)}}function _v(s){return e=>{if(Array.isArray(e))return e.map(s)}}function yE(s){if(!Array.isArray(s))return;const e=[];for(const t of s)BKe(t)?e.push(D$.to(t)):e.push(ff.to(t));return e}let YIe=class{constructor(e,t){this._proxy=e.getProxy(We.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:i=>t.getDocument(i)?.version,getNotebookDocumentVersion:()=>{}}}applyWorkspaceEdit(e,t,i){const n=new Jd(Zu.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(n,void 0,i?.isRefactoring??!1)}};YIe=D([_(0,Jr)],YIe);class Xii{constructor(e,t,i,n,r){this._extension=e,this._request=t,this._proxy=i,this._commandsConverter=n,this._sessionDisposables=r,this._stopWatch=Ys.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 r=new Error("Response stream has been closed");throw Error.captureStackTrace(r,n),r}};const e=this;this._stopWatch.reset();const i=(n,r)=>{if(typeof this._firstProgress>"u"&&"content"in n&&(this._firstProgress=this._stopWatch.elapsed()),r){const o=this._proxy.$handleProgressChunk(this._request.requestId,n),a={report:c=>{o?.then(l=>{l&&(gf.isMarkdownString(c.value)?this._proxy.$handleProgressChunk(this._request.requestId,F$.from(c),l):this._proxy.$handleProgressChunk(this._request.requestId,vA.from(c),l))})}};Promise.all([o,r?.(a)]).then(([c,l])=>{c!==void 0&&l!==void 0&&this._proxy.$handleProgressChunk(this._request.requestId,Sxe.from(l),c)})}else this._proxy.$handleProgressChunk(this._request.requestId,n)};this._apiObject={markdown(n){t(this.markdown);const r=new bG(n),o=M$.from(r);return i(o),this},markdownWithVulnerabilities(n,r){t(this.markdown),r&&ze(e._extension,"chatParticipantAdditions");const o=new TH(n,r),a=mie.from(o);return i(a),this},filetree(n,r){t(this.filetree);const o=new wG(n,r),a=N$.from(o);return i(a),this},anchor(n,r){t(this.anchor);const o=new yG(n,r),a=P$.from(o);return i(a),this},button(n){t(this.anchor);const r=new CG(n),o=O$.from(r,e._commandsConverter,e._sessionDisposables);return i(o),this},progress(n,r){t(this.progress);const o=new kPe(n,r),a=r?Cxe.from(o):YH.from(o);return i(a,r),this},warning(n){t(this.progress),ze(e._extension,"chatParticipantAdditions");const r=new MH(n),o=F$.from(r);return i(o),this},reference(n,r){return this.reference2(n,r)},reference2(n,r,o){if(t(this.reference),"variableName"in n&&ze(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 Rb(n,r,o);c=[vA.from(l)]}return c.forEach(l=>i(l)),this}}else{const a=new Rb(n,r,o),c=vA.from(a);i(c)}return this},codeCitation(n,r,o){t(this.codeCitation),ze(e._extension,"chatParticipantAdditions");const a=new v$(n,r,o),c=wie.from(a);i(c)},textEdit(n,r){t(this.textEdit),ze(e._extension,"chatParticipantAdditions");const o=new NH(n,r),a=bie.from(o);return i(a),this},detectedParticipant(n,r){t(this.detectedParticipant),ze(e._extension,"chatParticipantAdditions");const o=new LH(n,r),a=_ie.from(o);return i(a),this},confirmation(n,r,o,a){t(this.confirmation),ze(e._extension,"chatParticipantAdditions");const c=new _$(n,r,o,a),l=vie.from(c);return i(l),this},push(n){if(t(this.push),(n instanceof NH||n instanceof TH||n instanceof LH||n instanceof MH||n instanceof _$||n instanceof v$)&&ze(e._extension,"chatParticipantAdditions"),n instanceof Rb)this.reference2(n.value,n.iconPath,n.options);else{const r=yie.from(n,e._commandsConverter,e._sessionDisposables);i(r)}return this}}}return this._apiObject}}const c8=class c8 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 mr),this._completionDisposables=this._register(new mr),this._proxy=e.getProxy(We.MainThreadChatAgents2)}transferActiveChat(e){this._proxy.$transferActiveChatSession(e)}createChatAgent(e,t,i){const n=c8._idPool++,r=new d$e(e,t,this._proxy,n,i);return this._agents.set(n,r),this._proxy.$registerAgent(n,e.identifier,t,{},void 0),r.apiAgent}createDynamicChatAgent(e,t,i,n){const r=c8._idPool++,o=new d$e(e,t,this._proxy,r,n);return this._agents.set(r,o),this._proxy.$registerAgent(r,e.identifier,t,{isSticky:!0},i),o.apiAgent}async $invokeAgent(e,t,i,n){const r=this._agents.get(e);if(!r)throw new Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);const o=Mr(t);let a=this._sessionDisposables.get(o.sessionId);a||(a=new Z,this._sessionDisposables.set(o.sessionId,a));const c=new Xii(r.extension,o,this._proxy,this._commands.converter,a);try{const l=await this.prepareHistoryTurns(o.agentId,i);let d;if(o.locationData?.type===To.Editor){const u=this._documents.getDocument(o.locationData.document);d=new LPe(u,zb.to(o.locationData.selection),tt.to(o.locationData.wholeRange))}else if(o.locationData?.type===To.Notebook){const u=this._documents.getDocument(o.locationData.sessionInputUri);d=new RPe(u)}else o.locationData?.type,To.Terminal;const h=r.invoke(Axe.to(o,d),{history:l},c.apiObject,n);return await $_(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(`[${r.extension.identifier.value}] [@${r.id}] ${m}`,r.extension),{errorDetails:{message:m},timings:c.timings}}let f;return u?.errorDetails&&(f={...u.errorDetails,responseIsIncomplete:!0}),f?.responseIsRedacted&&ze(r.extension,"chatParticipantPrivate"),{errorDetails:f,timings:c.timings,metadata:u?.metadata}}),n)}catch(l){return this._logService.error(l,r.extension),l instanceof Ow&&l.cause&&(l=l.cause),{errorDetails:{message:Po(l),responseIsIncomplete:!0}}}finally{c.close()}}async prepareHistoryTurns(e,t){const i=[];for(const n of t.history){const r=fB.to(n.result),o=e===n.request.agentId?r:{...r,metadata:void 0},a=n.request.variables.variables.filter(l=>!l.isTool).map(Cie.to);i.push(new IPe(n.request.message,n.request.command,a,n.request.agentId));const c=Oi(n.response.map(l=>yie.toContent(l,this._commands.converter)));i.push(new TPe(c,o,n.request.agentId,n.request.command))}return i}$releaseSession(e){this._sessionDisposables.deleteAndDispose(e)}async $provideFollowups(e,t,i,n,r){const o=this._agents.get(t);if(!o)return Promise.resolve([]);const a=Mr(e),c=await this.prepareHistoryTurns(o.id,n),l=fB.to(i);return(await o.provideFollowups(l,{history:c},r)).filter(d=>{const h=!d.participant||ui.some(this._agents.values(),u=>u.id===d.participant&&An.equals(u.extension.identifier,o.extension.identifier));return h||this._logService.warn(`[@${o.id}] ChatFollowup refers to an unknown participant: ${d.participant}`),h}).map(d=>R$.from(d,a))}$acceptFeedback(e,t,i,n){const r=this._agents.get(e);if(!r)return;const o=fB.to(t);let a;switch(i){case KW.Down:a=IH.Unhelpful;break;case KW.Up:a=IH.Helpful;break}r.acceptFeedback(Object.freeze(n?{result:o,kind:a,reportIssue:n}:{result:o,kind:a}))}$acceptAction(e,t,i){const n=this._agents.get(e);if(!n||i.action.kind==="vote")return;const r=xxe.to(t,i,this._commands.converter);r&&n.acceptAction(Object.freeze(r))}async $invokeCompletionProvider(e,t,i){const n=this._agents.get(e);if(!n)return[];let r=this._completionDisposables.get(e);return r?r.clear():(r=new Z,this._completionDisposables.set(e,r)),(await n.invokeCompletionProvider(t,i)).map(a=>Exe.from(a,this._commands.converter,r))}async $provideWelcomeMessage(e,t,i){const n=this._agents.get(e);if(n)return await n.provideWelcomeMessage(B$.to(t),i)}async $provideSampleQuestions(e,t,i){const n=this._agents.get(e);if(n)return(await n.provideSampleQuestions(B$.to(t),i)).map(r=>R$.from(r,void 0))}};c8._idPool=0;let JIe=c8;class d$e{constructor(e,t,i,n,r){this.extension=e,this.id=t,this._proxy=i,this._handle=n,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)??[]:[]}async provideFollowups(e,t,i){if(!this._followupProvider)return[];const n=await this._followupProvider.provideFollowups(e,t,i);return n?n.filter(r=>!(r&&"commandId"in r)).filter(r=>!(r&&"message"in r)):[]}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:Fs.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 fu?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,isSecondary:this._isSecondary,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix=="string"?this._helpTextPrefix:Fs.from(this._helpTextPrefix),helpTextVariablesPrefix:!this._helpTextVariablesPrefix||typeof this._helpTextVariablesPrefix=="string"?this._helpTextVariablesPrefix:Fs.from(this._helpTextVariablesPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix=="string"?this._helpTextPostfix:Fs.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(r){n._iconPath=r,i()},get requestHandler(){return n._requestHandler},set requestHandler(r){Lt(typeof r=="function","Invalid request handler"),n._requestHandler=r},get followupProvider(){return n._followupProvider},set followupProvider(r){n._followupProvider=r,i()},get isDefault(){return ze(n.extension,"defaultChatParticipant"),n._isDefault},set isDefault(r){ze(n.extension,"defaultChatParticipant"),n._isDefault=r,i()},get helpTextPrefix(){return ze(n.extension,"defaultChatParticipant"),n._helpTextPrefix},set helpTextPrefix(r){ze(n.extension,"defaultChatParticipant"),n._helpTextPrefix=r,i()},get helpTextVariablesPrefix(){return ze(n.extension,"defaultChatParticipant"),n._helpTextVariablesPrefix},set helpTextVariablesPrefix(r){ze(n.extension,"defaultChatParticipant"),n._helpTextVariablesPrefix=r,i()},get helpTextPostfix(){return ze(n.extension,"defaultChatParticipant"),n._helpTextPostfix},set helpTextPostfix(r){ze(n.extension,"defaultChatParticipant"),n._helpTextPostfix=r,i()},get isSecondary(){return ze(n.extension,"defaultChatParticipant"),n._isSecondary},set isSecondary(r){ze(n.extension,"defaultChatParticipant"),n._isSecondary=r,i()},get supportIssueReporting(){return ze(n.extension,"chatParticipantPrivate"),n._supportIssueReporting},set supportIssueReporting(r){ze(n.extension,"chatParticipantPrivate"),n._supportIssueReporting=r,i()},get onDidReceiveFeedback(){return n._onDidReceiveFeedback.event},set participantVariableProvider(r){if(ze(n.extension,"chatParticipantAdditions"),n._agentVariableProvider=r,r){if(!r.triggerCharacters.length)throw new Error("triggerCharacters are required");n._proxy.$registerAgentCompletionsProvider(n._handle,n.id,r.triggerCharacters)}else n._proxy.$unregisterAgentCompletionsProvider(n._handle,n.id)},get participantVariableProvider(){return ze(n.extension,"chatParticipantAdditions"),n._agentVariableProvider},set welcomeMessageProvider(r){ze(n.extension,"defaultChatParticipant"),n._welcomeMessageProvider=r,i()},get welcomeMessageProvider(){return ze(n.extension,"defaultChatParticipant"),n._welcomeMessageProvider},onDidPerformAction:hl(this.extension,"chatParticipantAdditions")?this._onDidPerformAction.event:void 0,set requester(r){n._requester=r,i()},get requester(){return n._requester},set supportsSlowReferences(r){ze(n.extension,"chatParticipantPrivate"),n._supportsSlowReferences=r,i()},get supportsSlowReferences(){return ze(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 Doe=class Doe{constructor(e){this._resolver=new Map,this._proxy=e.getProxy(We.MainThreadChatVariables)}async $resolveVariable(e,t,i,n){const r=this._resolver.get(e);if(r)try{if(r.resolver.resolve2){ze(r.extension,"chatParticipantAdditions");const o=new Zii(t,this._proxy),a=await r.resolver.resolve2(r.data.name,{prompt:i},o.apiObject,n);if(a&&a[0])return a[0].value}else{const o=await r.resolver.resolve(r.data.name,{prompt:i},n);if(o&&o[0])return o[0].value}}catch(o){Nr(o)}}registerVariableResolver(e,t,i,n,r,o,a,c,l){const d=Doe._idPool++,h=l?He.fromId(l):void 0;return this._resolver.set(d,{extension:e,data:{id:t,name:i,description:n,modelDescription:r,icon:h},resolver:a}),this._proxy.$registerVariable(d,{id:t,name:i,description:n,modelDescription:r,isSlow:o,fullName:c,icon:h}),Ee(()=>{this._resolver.delete(d),this._proxy.$unregisterVariable(d)})}};Doe._idPool=0;let XIe=Doe;class Zii{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 r=new Error("Response stream has been closed");throw Error.captureStackTrace(r,n),r}};const e=this,i=n=>{this._proxy.$handleProgressChunk(this._requestId,n)};this._apiObject={progress(n){t(this.progress);const r=new RH(n),o=YH.from(r);return i(o),this},reference(n){t(this.reference);const r=new Rb(n),o=vA.from(r);return i(o),this},push(n){return t(this.push),n instanceof Rb?i(vA.from(n)):n instanceof RH&&i(YH.from(n)),this}}}return this._apiObject}}class eni{constructor(e){const t=e.getProxy(We.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(i){return t.$writeText(i)}})}}const Oot="vscode-cdn.net",tni=`vscode-resource.${Oot}`,ZIe=`'self' https://*.${Oot}`;function Pz(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}+${ini(s.authority)}.${tni}`,path:s.path,fragment:s.fragment,query:s.query}))}function ini(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 nni{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 r of this._insets.values())n.indexOf(r.editor)<0&&r.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,i,n,r){let o;for(const f of this._editors.getVisibleTextEditors(!0))if(f.value===e){o=f;break}if(!o)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 Pz(f,a._remoteInfo)}get cspSource(){return ZIe}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,o.id,o.value.document.uri,t+1,i,n||{},r.identifier,r.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 sni(s,e,t){const i=s.getProxy(We.MainThreadComments),f=class f{constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new ba,e.registerArgumentProcessor({processArgument:v=>{if(v&&v.$mid===ys.CommentController){const b=this._commentControllers.get(v.handle);return b?b.value:v}else if(v&&v.$mid===ys.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===ys.CommentThreadReply||v.$mid===ys.CommentThreadInstance)){const b=this._commentControllers.get(v.thread.commentControlHandle);if(!b)return v;const w=b.getCommentThread(v.thread.commentThreadHandle);return w?v.$mid===ys.CommentThreadInstance?w.value:{thread:w.value,text:v.text}:v}else if(v&&v.$mid===ys.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===ys.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 gf(y),A):v}return v}})}createCommentController(v,b,w){const y=f.handlePool++,C=new o(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=>tt.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"?(ze(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 yn,this._acceptInputDisposables.value=new Z,this._id===void 0&&(this._id=`${v}.${this.handle}`),i.$createCommentThread(b,this.handle,this._id,this._uri,tt.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=tt.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){ze(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===AH.Reply?(A=!0,C=!1):b?.focus===AH.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 r=p;class o{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&&ze(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 ze(this._extension,"activeComment"),this._activeComment}get activeCommentThread(){return ze(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&&ze(this._extension,"fileComments");const y=new r(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 r(this.id,this.handle,void 0,N.revive(v),tt.to(b),[],this._extension,!0,w);return y.collapsibleState=Rc.Expanded,this._threads.set(y.handle,y),y}$updateCommentThreadTemplate(v,b){const w=this._threads.get(v);w&&(w.range=tt.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&&ze(w,"commentsDraftState"),v.reactions?.some(C=>C.reactors!==void 0)&&ze(w,"commentReactor"),{mode:v.mode,contextValue:v.contextValue,uniqueIdInThread:y,body:typeof v.body=="string"?v.body:Fs.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?fle(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 yH.Expanded:return Rc.Expanded;case yH.Collapsed:return Rc.Collapsed}return Rc.Collapsed}function h(m){let v;if(typeof m=="object"?v=m.resolved:v=m,v!==void 0)switch(v){case CH.Unresolved:return cu.Unresolved;case CH.Resolved:return cu.Resolved}return cu.Unresolved}function u(m){let v;if(typeof m=="object"&&(v=m.applicability),v!==void 0)switch(v){case SH.Current:return sD.Current;case SH.Outdated:return sD.Outdated}return sD.Current}return new n}var nT,sT,R7,M7,N7,Ww,rT,oT,aT,cT,P7,o2,lT;class rni{constructor(e,t,i,n,r,o,a){Ht(this,nT);Ht(this,sT);Ht(this,R7);Ht(this,M7);Ht(this,N7);Ht(this,Ww);Ht(this,rT);Ht(this,oT);Ht(this,aT);Ht(this,cT);Ht(this,P7);Ht(this,o2);Ht(this,lT);St(this,rT,""),St(this,aT,!1),St(this,cT,!1),this._onMessageEmitter=new I,this.onDidReceiveMessage=this._onMessageEmitter.event,St(this,lT,new I),this._onDidDispose=Ce(this,lT).event,St(this,nT,e),St(this,sT,t),St(this,oT,i),St(this,M7,n),St(this,N7,r),St(this,Ww,o),St(this,P7,tU(o)),St(this,o2,oni(o)),St(this,R7,a)}dispose(){St(this,aT,!0),Ce(this,lT).fire(),Ce(this,lT).dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return St(this,cT,!0),Pz(e,Ce(this,M7))}get cspSource(){const e=Ce(this,Ww).extensionLocation;if(e.scheme===pe.https||e.scheme===pe.http){let t=e.toString();return t.endsWith("/")||(t+="/"),t+" "+ZIe}return ZIe}get html(){return this.assertNotDisposed(),Ce(this,rT)}set html(e){this.assertNotDisposed(),Ce(this,rT)!==e&&(St(this,rT,e),Ce(this,o2)&&!Ce(this,cT)&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(St(this,cT,!0),Ce(this,R7).report("Webview vscode-resource: uris",Ce(this,Ww),"Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri")),Ce(this,sT).$setHtml(Ce(this,nT),this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),Ce(this,oT)}set options(e){this.assertNotDisposed(),Js(Ce(this,oT),e)||Ce(this,sT).$setOptions(Ce(this,nT),Bot(Ce(this,Ww),Ce(this,N7),e)),St(this,oT,e)}async postMessage(e){if(Ce(this,aT))return!1;const t=Qst(e,{serializeBuffersForPostMessage:Ce(this,P7)});return Ce(this,sT).$postMessage(Ce(this,nT),t.message,...t.buffers)}assertNotDisposed(){if(Ce(this,aT))throw new Error("Webview is disposed")}rewriteOldResourceUrlsIfNeeded(e){if(!Ce(this,o2))return e;const t=Ce(this,Ww).extensionLocation?.scheme===pe.vscodeRemote,i=Ce(this,Ww).extensionLocation.scheme===pe.vscodeRemote?Ce(this,Ww).extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(n,r,o,a,c,l)=>{const d=N.from({scheme:a||"file",path:decodeURIComponent(c)}),h=Pz(d,{isRemote:t,authority:i}).toString();return`${r}${h}${l}`}).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(n,r,o,a,c,l)=>{const d=N.from({scheme:a||"file",path:decodeURIComponent(c)}),h=Pz(d,{isRemote:t,authority:i}).toString();return`${r}${h}${l}`})}}nT=new WeakMap,sT=new WeakMap,R7=new WeakMap,M7=new WeakMap,N7=new WeakMap,Ww=new WeakMap,rT=new WeakMap,oT=new WeakMap,aT=new WeakMap,cT=new WeakMap,P7=new WeakMap,o2=new WeakMap,lT=new WeakMap;function tU(s){try{const e=P9(N9(s.engines.vscode));return!!e&&e.majorBase>=1&&e.minorBase>=57}catch{return!1}}function oni(s){try{const e=P9(N9(s.engines.vscode));return e?e.majorBase<1||e.majorBase===1&&e.minorBase<60:!1}catch{return!1}}class ani extends V{constructor(e,t,i,n,r){super(),this.remoteInfo=t,this.workspace=i,this._logService=n,this._deprecationService=r,this._webviews=new Map,this._webviewProxy=e.getProxy(We.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:r}=jst(t,i.value);n._onMessageEmitter.fire(r)}}$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 rni(e,this._webviewProxy,cni(t),this.remoteInfo,this.workspace,i,this._deprecationService);this._webviews.set(e,n);const r=n._onDidDispose(()=>{r.dispose(),this.deleteWebview(e)});return n}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}}function bne(s){return{id:s.identifier,location:s.extensionLocation}}function Bot(s,e,t){return{enableCommandUris:t.enableCommandUris,enableScripts:t.enableScripts,enableForms:t.enableForms,portMapping:t.portMapping,localResourceRoots:t.localResourceRoots||lni(s,e)}}function cni(s){return{enableCommandUris:s.enableCommandUris,enableScripts:s.enableScripts,enableForms:s.enableForms,portMapping:s.portMapping,localResourceRoots:s.localResourceRoots?.map(e=>N.from(e))}}function lni(s,e){return[...(e?.getWorkspaceFolders()||[]).map(t=>t.uri),s.extensionLocation]}const koe=class koe{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(){koe.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}};koe.enableDebugLogging=!1;let Am=koe;class dni{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new Am("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=mni(this.document.uri)+this._backupCounter++;return Ft(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 hni{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 r=new dni(t,i);return this._documents.set(n,r),r}delete(e,t){const i=this.key(e,t.uri);this._documents.delete(i)}key(e,t){return`${e}@@@${t}`}}var Zx;(function(s){s[s.Text=0]="Text",s[s.Custom=1]="Custom"})(Zx||(Zx={}));class uni{constructor(){this._providers=new Map}addTextProvider(e,t,i){return this.add(e,{type:Zx.Text,extension:t,provider:i})}addCustomProvider(e,t,i){return this.add(e,{type:Zx.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 js(()=>this._providers.delete(e))}}class gni{constructor(e,t,i,n,r){this._extHostDocuments=t,this._extensionStoragePaths=i,this._extHostWebview=n,this._extHostWebviewPanels=r,this._editorProviders=new uni,this._documents=new hni,this._proxy=e.getProxy(We.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,i,n){const r=new Z;return fni(i)?(r.add(this._editorProviders.addTextProvider(t,e,i)),this._proxy.$registerTextEditorProvider(bne(e),t,n.webviewOptions||{},{supportsMove:!!i.moveCustomTextEditor},tU(e))):(r.add(this._editorProviders.addCustomProvider(t,e,i)),iq(i)&&r.add(i.onDidChangeCustomDocument(o=>{const a=this.getCustomDocumentEntry(t,o.document.uri);if(pni(o)){const c=a.addEdit(o);this._proxy.$onDidEdit(o.document.uri,t,c,o.label)}else this._proxy.$onContentChange(o.document.uri,t)})),this._proxy.$registerCustomEditorProvider(bne(e),t,n.webviewOptions||{},!!n.supportsMultipleEditorsPerDocument,tU(e))),js.from(r,new js(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,i,n,r){const o=this._editorProviders.get(t);if(!o)throw new Error(`No provider found for '${t}'`);if(o.type!==Zx.Custom)throw new Error(`Invalid provide type for '${t}'`);const a=N.revive(e),c=await o.provider.openCustomDocument(a,{backupId:i,untitledDocumentData:n?.buffer},r);let l;return iq(o.provider)&&this._extensionStoragePaths&&(l=this._extensionStoragePaths.workspaceValue(o.extension)??this._extensionStoragePaths.globalValue(o.extension)),this._documents.add(t,c,l),{editable:iq(o.provider)}}async $disposeCustomDocument(e,t){const i=this._editorProviders.get(t);if(!i)throw new Error(`No provider found for '${t}'`);if(i.type!==Zx.Custom)throw new Error(`Invalid provider type for '${t}'`);const n=N.revive(e),{document:r}=this.getCustomDocumentEntry(t,n);this._documents.delete(t,r),r.dispose()}async $resolveCustomEditor(e,t,i,n,r,o){const a=this._editorProviders.get(i);if(!a)throw new Error(`No provider found for '${i}'`);const c=Dl.to(r),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 Zx.Custom:{const{document:u}=this.getCustomDocumentEntry(i,h);return a.provider.resolveCustomEditor(u,d,o)}case Zx.Text:{const u=this._extHostDocuments.getDocument(h);return a.provider.resolveCustomTextEditor(u,d,o)}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 r=this._extHostWebviewPanels.getWebviewPanel(e);if(!r)throw new Error("No webview found");const o=N.revive(t),a=this._extHostDocuments.getDocument(o);await n.provider.moveCustomTextEditor(a,r,Ue.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 r=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(r.document,N.revive(i),n)}async $backup(e,t,i){const n=this.getCustomDocumentEntry(t,e),o=await this.getCustomEditorProvider(t).backupCustomDocument(n.document,{destination:n.getNewBackupUri()},i);return n.updateBackup(o),o.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||!iq(i))throw new Error("Custom document is not editable");return i}}function iq(s){return!!s.onDidChangeCustomDocument}function fni(s){return typeof s.resolveCustomTextEditor=="function"}function pni(s){return typeof s.undo=="function"&&typeof s.redo=="function"}function mni(s){const e=s.scheme===pe.file||s.scheme===pe.untitled?s.fsPath:s.toString();return Hc(e)+""}var P0,rS,mx,Dd;const BFe=class BFe{constructor(e,t,i,n,r,o,a,c){Ht(this,rS);Ht(this,mx);Ht(this,Dd);this._name=e,this._owner=t,this._maxDiagnosticsTotal=i,this._maxDiagnosticsPerFile=n,this._modelVersionIdProvider=r,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(n,i),St(this,Dd,new gi(l=>o.getComparisonKey(l))),St(this,rS,a),St(this,mx,c)}dispose(){this._isDisposed||(Ce(this,mx).fire([...Ce(this,Dd).keys()]),Ce(this,rS)?.$clear(this._owner),Ce(this,Dd).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,Dd).set(e,t.slice()),i=[e]}else if(Array.isArray(e)){i=[];let o;e=[...e].sort(BFe._compareIndexedTuplesByUri);for(const a of e){const[c,l]=a;if((!o||c.toString()!==o.toString())&&(o&&Ce(this,Dd).get(o).length===0&&Ce(this,Dd).delete(o),o=c,i.push(c),Ce(this,Dd).set(c,[])),l)Ce(this,Dd).get(c)?.push(...l);else{const d=Ce(this,Dd).get(c);d&&(d.length=0)}}}if(Ce(this,mx).fire(i),!Ce(this,rS))return;const n=[];let r=0;for(const o of i){let a=[];const c=Ce(this,Dd).get(o);if(c)if(c.length>this._maxDiagnosticsPerFile){a=[];const l=[Hd.Error,Hd.Warning,Hd.Information,Hd.Hint];e:for(let d=0;d<4;d++)for(const h of c)if(h.severity===l[d]&&a.push({...VH.from(h),modelVersionId:this._modelVersionIdProvider(o)})===this._maxDiagnosticsPerFile)break e;a.push({severity:Hs.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=>({...VH.from(l),modelVersionId:this._modelVersionIdProvider(o)}));if(n.push([o,a]),r+=a.length,r>this._maxDiagnosticsTotal)break}Ce(this,rS).$changeMany(this._owner,n)}delete(e){this._checkDisposed(),Ce(this,mx).fire([e]),Ce(this,Dd).delete(e),Ce(this,rS)?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),Ce(this,mx).fire([...Ce(this,Dd).keys()]),Ce(this,Dd).clear(),Ce(this,rS)?.$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,Dd).keys())yield[e,this.get(e)]}get(e){this._checkDisposed();const t=Ce(this,Dd).get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(Ce(this,Dd).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}};rS=new WeakMap,mx=new WeakMap,Dd=new WeakMap;let wne=BFe;var my;let e0e=(my=class{static _mapper(e){const t=new gi;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 $oe({merge:r=>r.flat(),delay:50}),this.onDidChangeDiagnostics=M.map(this._onDidChangeDiagnostics.event,P0._mapper),this._proxy=e.getProxy(We.MainThreadDiagnostics)}createDiagnosticCollection(e,t){const{_collections:i,_proxy:n,_onDidChangeDiagnostics:r,_logService:o,_fileSystemInfoService:a,_extHostDocumentsAndEditors:c}=this,l=new class{$changeMany(u,f){n.$changeMany(u,f),o.trace("[DiagnosticCollection] change many (extension, owner, uris)",e.value,u,f.length===0?"CLEARING":f)}$clear(u){n.$clear(u),o.trace("[DiagnosticCollection] remove all (extension, owner)",e.value,u)}dispose(){n.dispose()}};let d;if(!t)t="_generated_diagnostic_collection_name_#"+P0._idPool++,d=t;else if(!i.has(t))d=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do d=t+P0._idPool++;while(i.has(d))}return new class extends wne{constructor(){super(t,d,P0._maxDiagnosticsTotal,P0._maxDiagnosticsPerFile,u=>c.getDocument(u)?.version,a.extUri,l,r),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((r,o)=>{let a=t.get(r.toString());typeof a>"u"&&(a=i.length,t.set(r.toString(),a),i.push([r,[]])),i[a][1]=i[a][1].concat(...o)});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 wne(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(VH.to))}},P0=my,my._idPool=0,my._maxDiagnosticsPerFile=1e3,my._maxDiagnosticsTotal=1.1*my._maxDiagnosticsPerFile,my);e0e=P0=D([_(1,Ke),_(2,n4)],e0e);class _ni{constructor(e){this._proxy=e.getProxy(We.MainThreadDialogs)}showOpenDialog(e,t){return t?.allowUIResources&&ze(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 Ioe=class Ioe{constructor(e,t,i){this._documentsAndEditors=t,this._logService=i,this._documentContentProviders=new Map,this._proxy=e.getProxy(We.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(e,t){if(Object.keys(pe).indexOf(e)>=0)throw new Error(`scheme '${e}' already registered`);const i=Ioe._handlePool++;this._documentContentProviders.set(i,t),this._proxy.$registerTextContentProvider(i,e);let n;if(typeof t.onDidChange=="function"){let r;n=t.onDidChange(async o=>{if(o.scheme!==e){this._logService.warn(`Provider for scheme '${e}' is firing event for schema '${o.scheme}' which will be IGNORED`);return}if(!this._documentsAndEditors.getDocument(o))return;r&&await r;const a=this.$provideTextDocumentContent(i,o).then(async c=>{if(!c&&typeof c!="string")return;const l=this._documentsAndEditors.getDocument(o);if(!l)return;const d=cv(c);if(!l.equalLines(d))return this._proxy.$onVirtualDocumentChange(o,c)}).catch(bt).finally(()=>{r===a&&(r=void 0)});r=a})}return new js(()=>{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),Ue.None)):Promise.reject(new Error(`unsupported uri-scheme: ${t.scheme}`))}};Ioe._handlePool=0;let t0e=Ioe;class vni{constructor(e,t,i,n={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=i,this._thresholds=n,this._callbacks=new ul,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,i,n)=>{const o={dispose:this._callbacks.push([t,i,e])};return Array.isArray(n)&&n.push(o),o}}async $participateInSave(e,t){const i=N.revive(e);let n=!1;const r=setTimeout(()=>n=!0,this._thresholds.timeout),o=[];try{for(const a of[...this._callbacks]){if(n)break;const c=this._documents.getDocument(i),l=await this._deliverEventAsyncAndBlameBadListeners(a,{document:c,reason:oie.to(t)});o.push(l)}}finally{clearTimeout(r)}return o}_deliverEventAsyncAndBlameBadListeners([e,t,i],n){const r=this._badListeners.get(e);return typeof r=="number"&&r>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(i,e,t,n).then(()=>!0,o=>{if(this._logService.error(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' threw ERROR`),this._logService.error(o),!(o instanceof Error)||o.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 r=[],o=Date.now(),{document:a,reason:c}=n,{version:l}=a,d=Object.freeze({document:a,reason:c,waitUntil(h){if(Object.isFrozen(r))throw Voe("waitUntil can not be called async");r.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(r).then(p=>{this._logService.debug(`onWillSaveTextDocument-listener from extension '${e.identifier.value}' finished after ${Date.now()-o}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 qA))for(const{newText:p,newEol:m,range:v}of f)u.edits.push({resource:a.uri,versionId:void 0,textEdit:{range:v&&tt.from(v),text:p,eol:m&&KH.from(m)}});if(u.edits.length!==0)return l===a.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new Jd(u)):Promise.reject(new Error("concurrent_edits"))})}}class bni{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(We.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 r=N.revive(n);return Qn(this._documentsAndEditors.getDocument(r))},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),r=this._documentsAndEditors.getDocument(n);if(!r)throw new Error("unknown document");r._acceptIsDirty(i),r.onEvents(t);let o;t.isUndoing?o=fH.Undo:t.isRedoing&&(o=fH.Redo),this._onDidChangeDocument.fire(QGe({document:r.document,contentChanges:t.changes.map(a=>({range:tt.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:o}))}setWordDefinitionFor(e,t){sii(e,t)}}class wni{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(We.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??=Ue.None;let n=!1;typeof t=="string"&&(t=[t],n=!0);const r=await this._proxy.$computeEmbeddings(e,t,i);if(r.length!==t.length)throw new Error;if(n){if(r.length!==1)throw new Error;return r[0]}return r}async $provideEmbeddings(e,t,i){const n=this._provider.get(e);if(!n)return[];const r=await n.provider.provideEmbeddings(t,i);return r||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}}class yni{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(We.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 r=await n.provideEmbeddingVector(t,i);if(!r)throw new Error("Embedding vector provider returned undefined");return r}registerEmbeddingVectorProvider(e,t,i){const n=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(n,i),this._proxy.$registerAiEmbeddingVectorProvider(t,n),new js(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(n),this._AiEmbeddingVectorProviders.delete(n)})}}class Cni{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,r=Mi.LastKnownState,o=Mi.LastKnownState;for(const a of e){let c=i?Qy(i,a):0;for(c===0?n=Mi.Start:n=o;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 XT.Changed:p=Tr.UPDATED;break;case XT.Created:p=Tr.ADDED;break;case XT.Deleted:p=Tr.DELETED;break;default:throw new Error("Unknown FileChangeType")}d.push({resource:u,type:p})}this._proxy.$onFileSystemChange(r,d)});return Ee(()=>{c.dispose(),this._linkProvider.delete(t),this._registeredSchemes.delete(t),this._fsProvider.delete(r),this._proxy.$unregisterProvider(r)})}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:r,permissions:o}=e;return{type:t,ctime:i,mtime:n,size:r,permissions:o}}$stat(e,t){return Promise.resolve(this._getFsProvider(e).stat(N.revive(t))).then(i=>yne._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=>Ge.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 r=this._getFsProvider(e);if(!r.copy)throw new Error('FileSystemProvider does not implement "copy"');return Promise.resolve(r.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 r=this._getFsProvider(e).watch(N.revive(i),n);this._watches.set(t,r)}$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 r=this._getFsProvider(e);if(!r.read)throw new Error('FileSystemProvider does not implement "read"');const o=Ge.alloc(n);return Promise.resolve(r.read(t,i,o.buffer,0,n)).then(a=>o.slice(0,a))}$write(e,t,i,n){const r=this._getFsProvider(e);if(!r.write)throw new Error('FileSystemProvider does not implement "write"');return Promise.resolve(r.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 Sni{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,i,n,r,o){this.session=Math.random(),this._onDidCreate=new I,this._onDidChange=new I,this._onDidDelete=new I,this._config=0,o?.ignoreCreateEvents&&(this._config+=1),o?.ignoreChangeEvents&&(this._config+=2),o?.ignoreDeleteEvents&&(this._config+=4);const a=X_(r),c=typeof r=="string",l=o?.correlate,d=n(h=>{if(!(typeof h.session=="number"&&h.session!==this.session)&&!(l&&typeof h.session>"u")){if(!o?.ignoreCreateEvents)for(const u of h.created){const f=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidCreate.fire(f)}if(!o?.ignoreChangeEvents)for(const u of h.changed){const f=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidChange.fire(f)}if(!o?.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=js.from(this.ensureWatching(e,i,r,o,o?.correlate),this._onDidCreate,this._onDidChange,this._onDidDelete,d)}ensureWatching(e,t,i,n,r){const o=js.from();if(typeof i=="string"||n?.ignoreChangeEvents&&n?.ignoreCreateEvents&&n?.ignoreDeleteEvents)return o;const a=e.getProxy(We.MainThreadFileSystemEventService);let c=!1;(i.pattern.includes(P1)||i.pattern.includes(e_e))&&(c=!0);let l;return r&&(n?.ignoreChangeEvents||n?.ignoreCreateEvents||n?.ignoreDeleteEvents)&&(l=FE.UPDATED|FE.ADDED|FE.DELETED,n?.ignoreChangeEvents&&(l&=~FE.UPDATED),n?.ignoreCreateEvents&&(l&=~FE.ADDED),n?.ignoreDeleteEvents&&(l&=~FE.DELETED)),a.$watch(t.identifier.value,this.session,i.baseUri,{recursive:c,excludes:n?.excludes??[],filter:l},!!r),js.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 Ani{constructor(e){this._events=e,this.session=this._events.session,this._created=new Ca(()=>this._events.created.map(N.revive)),this._changed=new Ca(()=>this._events.changed.map(N.revive)),this._deleted=new Ca(()=>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 Eni{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 tD,this._onWillCreateFile=new tD,this._onWillDeleteFile=new tD,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,i,n){return new Sni(this._mainContext,e,t,this._onFileSystemEvent.event,Qf.from(i),n)}$onFileEvent(e){this._onFileSystemEvent.fire(new Ani(e))}$onDidRunFileOperation(e,t){switch(e){case Ei.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(i=>({oldUri:N.revive(i.source),newUri:N.revive(i.target)}))}));break;case Ei.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(i=>N.revive(i.target))}));break;case Ei.CREATE:case Ei.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,r)=>{const o=function(c){i.call(n,c)};return o.extension=e,t.event(o,void 0,r)}}async $onWillRunFileOperation(e,t,i,n){switch(e){case Ei.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(r=>({oldUri:N.revive(r.source),newUri:N.revive(r.target)}))},i,n);case Ei.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(r=>N.revive(r.target))},i,n);case Ei.CREATE:case Ei.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(r=>N.revive(r.target))},i,n)}}async _fireWillEvent(e,t,i,n){const r=new Set,o=[];if(await e.fireAsync(t,n,async(c,l)=>{const d=Date.now(),h=await Promise.resolve(c);h instanceof _I&&(o.push([l.extension,h]),r.add(l.extension.displayName??l.extension.identifier.value)),Date.now()-d>i&&this._logService.warn("SLOW file-participant",l.extension.identifier)}),n.isCancellationRequested||o.length===0)return;const a={edits:[]};for(const[,c]of o){const{edits:l}=Zu.from(c,{getTextDocumentVersion:d=>this._extHostDocumentsAndEditors.getDocument(d)?.version,getNotebookDocumentVersion:()=>{}});a.edits=a.edits.concat(l)}return{edit:a,extensionNames:Array.from(r)}}}class xni{constructor(e,t,i,n,r){this._extHostNotebooks=t,this._textDocumentsAndEditors=i,this._commands=n;const o=new fn("interactive.open","_interactive.open","Open interactive window and return notebook editor and input URI",[new ut("showOptions","Show Options",a=>!0,a=>a),new ut("resource","Interactive resource Uri",a=>!0,a=>a),new ut("controllerId","Notebook controller Id",a=>!0,a=>a),new ut("title","Interactive editor title",a=>!0,a=>a)],new sn("Notebook and input URI",a=>{if(r.debug("[ExtHostInteractive] open iw with notebook editor id",a.notebookEditorId),a.notebookEditorId!==void 0){const c=this._extHostNotebooks.getEditorById(a.notebookEditorId);return r.debug("[ExtHostInteractive] notebook editor found",c.id),{notebookUri:N.revive(a.notebookUri),inputUri:N.revive(a.inputUri),notebookEditor:c.apiEditor}}return r.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(o)}$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 Dni{constructor(e){this._handlePool=0,this._proxy=e.getProxy(We.MainThreadLabelService)}$registerResourceLabelFormatter(e){const t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),Ee(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}}class Cne{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(!wU(n))return n[0]instanceof lH?n.map(nxe.from):Cne._asDocumentSymbolTree(n)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((n,r)=>{let o=n.location.range.start.compareTo(r.location.range.start);return o===0&&(o=r.location.range.end.compareTo(n.location.range.end)),o});const t=[],i=[];for(const n of e){const r={name:n.name||"!!MISSING: name!!",kind:rv.from(n.kind),tags:n.tags?.map(QA.from)||[],detail:"",containerName:n.containerName,range:tt.from(n.location.range),selectionRange:tt.from(n.location.range),children:[]};for(;;){if(i.length===0){i.push(r),t.push(r);break}const o=i[i.length-1];if(F.containsRange(o.range,r.range)&&!F.equalsRange(o.range,r.range)){o.children?.push(r),i.push(r);break}i.pop()}}return t}}class nq{constructor(e,t,i,n,r,o){this._documents=e,this._commands=t,this._provider=i,this._extension=n,this._extTelemetry=r,this._logService=o,this._cache=new Am("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 r=this._cache.add(n),o=new Z;this._disposables.set(r,o);const a={cacheId:r,lenses:[]};for(let c=0;cXte.from(a))}}class _$e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,i){const n=this._documents.getDocument(e),r=Yr.to(t),o=await this._provider.provideDocumentHighlights(n,r,i);if(Array.isArray(o))return o.map($H.from)}}class v$e{constructor(e,t){this._documents=e,this._provider=t}async provideMultiDocumentHighlights(e,t,i,n){const r=this._documents.getDocument(e),o=i.map(l=>this._documents.getDocument(l)),a=Yr.to(t),c=await this._provider.provideMultiDocumentHighlights(r,a,o,n);if(Array.isArray(c))return c.map(axe.from)}}class b$e{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,i){const n=this._documents.getDocument(e),r=Yr.to(t),o=await this._provider.provideLinkedEditingRanges(n,r,i);if(o&&Array.isArray(o.ranges))return{ranges:Oi(o.ranges.map(tt.from)),wordPattern:o.wordPattern}}}class w$e{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,i,n){const r=this._documents.getDocument(e),o=Yr.to(t),a=await this._provider.provideReferences(r,o,i,n);if(Array.isArray(a))return a.map(ff.from)}}const TO=class TO{constructor(e,t,i,n,r,o,a){this._documents=e,this._commands=t,this._diagnostics=i,this._provider=n,this._logService=r,this._extension=o,this._apiDeprecation=a,this._cache=new Am("CodeAction"),this._disposables=new Map}async provideCodeActions(e,t,i,n){const r=this._documents.getDocument(e),o=ht.isISelection(t)?zb.to(t):tt.to(t),a=[];for(const f of this._diagnostics.getDiagnostics(e))if(o.intersection(f.range)&&a.push(f)>TO._maxCodeActionsPerFile)break;const c={diagnostics:a,only:i.only?new Aa(i.only):void 0,triggerKind:yxe.to(i.trigger)},l=await this._provider.provideCodeActions(r,o,c,n);if(!tr(l)||n.isCancellationRequested)return;const d=this._cache.add(l),h=new Z;this._disposables.set(d,h);const u=[];for(let f=0;ftt.to(l)),a=U_.toDataTransfer(i,()=>{throw new Jat});if(await this._provider.prepareDocumentPaste(r,o,a,n),n.isCancellationRequested)return;const c=Array.from(a).filter(([,l])=>!(l instanceof cte));return U_.from(c)}async providePasteEdits(e,t,i,n,r,o){if(!this._provider.provideDocumentPasteEdits)return[];const a=this._documents.getDocument(t),c=i.map(u=>tt.to(u)),l=U_.toDataTransfer(n,async u=>(await this._proxy.$resolvePasteFileData(this._handle,e,u)).buffer),d=await this._provider.provideDocumentPasteEdits(a,c,l,{only:r.only?new e$(r.only):void 0,triggerKind:r.triggerKind},o);if(!d||o.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?Zu.from(u.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){const[i,n]=e,r=this._cache.get(i,n);if(!r||!this._provider.resolveDocumentPasteEdit)return{};const o=await this._provider.resolveDocumentPasteEdit(r,t)??r;return{additionalEdit:o.additionalEdit?Zu.from(o.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._cache.delete(e)}}class y$e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,i){const n=this._documents.getDocument(e),r=await this._provider.provideDocumentFormattingEdits(n,t,i);if(Array.isArray(r))return r.map(ad.from)}}class vge{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,i,n){const r=this._documents.getDocument(e),o=tt.to(t),a=await this._provider.provideDocumentRangeFormattingEdits(r,o,i,n);if(Array.isArray(a))return a.map(ad.from)}async provideDocumentRangesFormattingEdits(e,t,i,n){Lt(typeof this._provider.provideDocumentRangesFormattingEdits=="function","INVALID invocation of `provideDocumentRangesFormattingEdits`");const r=this._documents.getDocument(e),o=t.map(tt.to),a=await this._provider.provideDocumentRangesFormattingEdits(r,o,i,n);if(Array.isArray(a))return a.map(ad.from)}}class C$e{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,i,n,r){const o=this._documents.getDocument(e),a=Yr.to(t),c=await this._provider.provideOnTypeFormattingEdits(o,a,i,n,r);if(Array.isArray(c))return c.map(ad.from)}}class sq{constructor(e,t){this._provider=e,this._logService=t,this._cache=new Am("WorkspaceSymbols")}async provideWorkspaceSymbols(e,t){const i=await this._provider.provideWorkspaceSymbols(e,t);if(!tr(i))return{symbols:[]};const n=this._cache.add(i),r={cacheId:n,symbols:[]};for(let o=0;or.line||a.end.linetypeof l=="string"?{newSymbolName:l}:{newSymbolName:l.newSymbolName,tags:l.tags}):void 0}catch(a){this._logService.error(l8._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}};l8.languageTriggerKindToVSCodeTriggerKind={[CM.Invoke]:wH.Invoke,[CM.Automatic]:wH.Automatic};let Oz=l8;class bge{constructor(e,t){this.resultId=e,this.tokens=t}}class Nf{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),r=t!==0?this._previousResults.get(t):null;let o=typeof r?.resultId=="string"&&typeof this._provider.provideDocumentSemanticTokensEdits=="function"?await this._provider.provideDocumentSemanticTokensEdits(n,r.resultId,i):await this._provider.provideDocumentSemanticTokens(n,i);return r&&this._previousResults.delete(t),o?(o=Nf._fixProvidedSemanticTokens(o),this._send(Nf._convertToEdits(r,o),o)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(e){return Nf._isSemanticTokens(e)?Nf._isCorrectSemanticTokens(e)?e:new gN(new Uint32Array(e.data),e.resultId):Nf._isSemanticTokensEdits(e)?Nf._isCorrectSemanticTokensEdits(e)?e:new gz(e.edits.map(t=>new vPe(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(!Nf._isSemanticTokens(t)||!e||!e.tokens)return t;const i=e.tokens,n=i.length,r=t.data,o=r.length;let a=0;const c=Math.min(n,o);for(;a({start:n.start,deleteCount:n.deleteCount,data:n.data}))})}return null}}class S$e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,i){const n=this._documents.getDocument(e),r=await this._provider.provideDocumentRangeSemanticTokens(n,tt.to(t),i);return r?this._send(r):null}_send(e){return v9({id:0,type:"full",data:e.data})}}class g1{static supportsResolving(e){return typeof e.resolveCompletionItem=="function"}constructor(e,t,i,n,r){this._documents=e,this._commands=t,this._provider=i,this._apiDeprecation=n,this._extension=r,this._cache=new Am("CompletionItem"),this._disposables=new Map}async provideCompletionItems(e,t,i,n){const r=this._documents.getDocument(e),o=Yr.to(t),a=r.getWordRangeAtPosition(o)||new Xn(o,o),c=a.with({end:o}),l=new Ys,d=await this._provider.provideCompletionItems(r,o,n,lxe.to(i));if(!d||n.isCancellationRequested)return;const h=Array.isArray(d)?new aN(d):d,u=g1.supportsResolving(this._provider)?this._cache.add(h.items):this._cache.add([]),f=new Z;this._disposables.set(u,f);const p=[],m={x:u,[ky.completions]:p,[ky.defaultRanges]:{replace:tt.from(a),insert:tt.from(c)},[ky.isIncomplete]:h.isIncomplete||void 0,[ky.duration]:l.elapsed()};for(let v=0;v"u"?void 0:Fs.fromStrict(e.documentation),[Ri.sortText]:e.sortText!==e.label?e.sortText:void 0,[Ri.filterText]:e.filterText!==e.label?e.filterText:void 0,[Ri.preselect]:e.preselect||void 0,[Ri.insertTextRules]:e.keepWhitespace?Zg.KeepWhitespace:Zg.None,[Ri.commitCharacters]:e.commitCharacters?.join(""),[Ri.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(ad.from),[Ri.commandIdent]:o?.$ident,[Ri.commandId]:o?.id,[Ri.commandArguments]:o?.$ident?void 0:o?.arguments};e.textEdit?(this._apiDeprecation.report("CompletionItem.textEdit",this._extension,"Use 'CompletionItem.insertText' and 'CompletionItem.range' instead."),a[Ri.insertText]=e.textEdit.newText):typeof e.insertText=="string"?a[Ri.insertText]=e.insertText:e.insertText instanceof vI&&(a[Ri.insertText]=e.insertText.value,a[Ri.insertTextRules]|=Zg.InsertAsSnippet);let c;return e.textEdit?c=e.textEdit.range:e.range&&(c=e.range),Xn.isRange(c)?a[Ri.range]=tt.from(c):c&&(!i?.isEqual(c.inserting)||!n?.isEqual(c.replacing))&&(a[Ri.range]={insert:tt.from(c.inserting),replace:tt.from(c.replacing)}),a}}class tF{async provideInlineCompletions(e,t,i,n){}async provideInlineEdits(e,t,i,n){}disposeCompletions(e){}handleDidShowCompletionItem(e,t,i){}handlePartialAccept(e,t,i,n){}}class kni extends tF{constructor(e,t,i,n){super(),this._extension=e,this._documents=t,this._provider=i,this._commands=n,this._references=new Wot,this._isAdditionsProposedApiEnabled=hl(this._extension,"inlineCompletionsAdditions"),this.languageTriggerKindToVSCodeTriggerKind={[nm.Automatic]:bH.Automatic,[nm.Explicit]:bH.Invoke}}get supportsHandleEvents(){return hl(this._extension,"inlineCompletionsAdditions")&&(typeof this._provider.handleDidShowCompletionItem=="function"||typeof this._provider.handleDidPartiallyAcceptCompletionItem=="function")}async provideInlineCompletions(e,t,i,n){const r=this._documents.getDocument(e),o=Yr.to(t),a=await this._provider.provideInlineCompletionItems(r,o,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:tt.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?tt.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;ze(this._extension,"inlineCompletionsAdditions");const r=this._documents.getDocument(e),o=tt.to(t),a=await this._provider.provideInlineEdits(r,o,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:tt.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?tt.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 r=this._references.get(e)?.items[t];r&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(r,i),this._provider.handleDidPartiallyAcceptCompletionItem(r,Dxe.to(n)))}}class wge{async provideInlineEdits(e,t,i){const n=this._documents.getDocument(e),r=await this._provider.provideInlineEdit(n,{triggerKind:this.languageTriggerKindToVSCodeTriggerKind[t.triggerKind]},i);if(!r||i.isCancellationRequested)return;let o;const a=this._references.createReferenceId({dispose(){o?.dispose()},item:r});let c;r.accepted&&(o||(o=new Z),c=this._commands.toInternal(r.accepted,o));let l;return r.rejected&&(o||(o=new Z),l=this._commands.toInternal(r.rejected,o)),{pid:a,text:r.text,range:tt.from(r.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 Wot,this.languageTriggerKindToVSCodeTriggerKind={[B2.Automatic]:FH.Automatic,[B2.Invoke]:FH.Invoke}}}class Wot{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 yge{constructor(e,t){this._documents=e,this._provider=t,this._cache=new Am("SignatureHelp")}async provideSignatureHelp(e,t,i,n){const r=this._documents.getDocument(e),o=Yr.to(t),a=this.reviveContext(i),c=await this._provider.provideSignatureHelp(r,o,n,a);if(c){const l=this._cache.add([c]);return{...I$.from(c),id:l}}}reviveContext(e){let t;if(e.activeSignatureHelp){const i=I$.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 rq{constructor(e,t,i,n,r){this._documents=e,this._commands=t,this._provider=i,this._logService=n,this._extension=r,this._cache=new Am("InlayHints"),this._disposables=new Map}async provideInlayHints(e,t,i){const n=this._documents.getDocument(e),r=tt.to(t),o=await this._provider.provideInlayHints(n,r,i);if(!Array.isArray(o)||o.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(o);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:Fs.fromStrict(e.tooltip),position:Yr.from(e.position),textEdits:e.textEdits&&e.textEdits.map(ad.from),kind:e.kind&&sie.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label=="string")n.label=e.label;else{const r=[];n.label=r;for(const o of e.label){if(!o.value){console.warn("INVALID inlay hint, empty label part",this._extension.identifier.value);continue}const a={label:o.value,tooltip:Fs.fromStrict(o.tooltip)};Ap.isLocation(o.location)&&(a.location=ff.from(o.location)),o.command&&(a.command=this._commands.toInternal(o.command,i)),r.push(a)}}return n}}class eD{constructor(e,t){this._documents=e,this._provider=t,this._cache=new Am("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(eD._validateLink).map(sL.from)};{const r=this._cache.add(n),o={links:[],cacheId:r};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||!eD._validateLink(n)))return sL.from(n)}releaseLinks(e){this._cache.delete(e)}}class Cge{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(o=>({color:GH.from(o.color),range:tt.from(o.range)})):[]}async provideColorPresentations(e,t,i){const n=this._documents.getDocument(e),r=tt.to(t.range),o=GH.to(t.color),a=await this._provider.provideColorPresentations(o,{document:n,range:r},i);if(Array.isArray(a))return a.map(rie.from)}}class A$e{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,i){const n=this._documents.getDocument(e),r=await this._provider.provideFoldingRanges(n,t,i);if(Array.isArray(r))return r.map(aie.from)}}class E$e{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideSelectionRanges(e,t,i){const n=this._documents.getDocument(e),r=t.map(Yr.to),o=await this._provider.provideSelectionRanges(n,r,i);if(!tr(o))return[];if(o.length!==r.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,o)]}async provideCallsTo(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing call hierarchy item");const r=await this._provider.provideCallHierarchyIncomingCalls(n,i);if(r)return r.map(o=>({from:this._cacheAndConvertItem(e,o.from),fromRanges:o.fromRanges.map(a=>tt.from(a))}))}async provideCallsFrom(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing call hierarchy item");const r=await this._provider.provideCallHierarchyOutgoingCalls(n,i);if(r)return r.map(o=>({to:this._cacheAndConvertItem(e,o.to),fromRanges:o.fromRanges.map(a=>tt.from(a))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),n=bN.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 $4{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new PU(""),this._cache=new Map}async prepareSession(e,t,i){const n=this._documents.getDocument(e),r=Yr.to(t),o=await this._provider.prepareTypeHierarchy(n,r,i);if(!o)return;const a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(o)?o.map(c=>this._cacheAndConvertItem(a,c)):[this._cacheAndConvertItem(a,o)]}async provideSupertypes(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing type hierarchy item");const r=await this._provider.provideTypeHierarchySupertypes(n,i);if(r)return r.map(o=>this._cacheAndConvertItem(e,o))}async provideSubtypes(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing type hierarchy item");const r=await this._provider.provideTypeHierarchySubtypes(n,i);if(r)return r.map(o=>this._cacheAndConvertItem(e,o))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),n=rL.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 oq{constructor(e,t,i,n,r){this._proxy=e,this._documents=t,this._provider=i,this._handle=n,this._extension=r,this._cache=new Am("DocumentDropEdit")}async provideDocumentOnDropEdits(e,t,i,n,r){const o=this._documents.getDocument(t),a=Yr.to(i),c=U_.toDataTransfer(n,async u=>(await this._proxy.$resolveDocumentOnDropFileData(this._handle,e,u)).buffer),l=await this._provider.provideDocumentDropEdits(o,a,c,r);if(!l)return;const d=z_(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?Zu.from(u.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){const[i,n]=e,r=this._cache.get(i,n);if(!r||!this._provider.resolveDocumentDropEdit)return{};const o=await this._provider.resolveDocumentDropEdit(r,t)??r;return{additionalEdit:o.additionalEdit?Zu.from(o.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}}class x$e{constructor(e,t){this._documents=e,this._provider=t}async provideMappedEdits(e,t,i,n){const r=N.revive(e),o=this._documents.getDocument(r),a=i.documents.map(d=>d.map(h=>({uri:N.revive(h.uri),version:h.version,ranges:h.ranges.map(u=>tt.to(u))}))),c={documents:a,selections:a[0]?.[0]?.ranges??[]},l=await this._provider.provideMappedEdits(o,t,c,n);return l?Zu.from(l):null}}class G4{constructor(e,t){this.adapter=e,this.extension=t}}const Jc=class Jc{constructor(e,t,i,n,r,o,a,c){this._uriTransformer=t,this._documents=i,this._commands=n,this._diagnostics=r,this._logService=o,this._apiDeprecation=a,this._extensionTelemetry=c,this._adapter=new Map,this._proxy=e.getProxy(We.MainThreadLanguageFeatures)}_transformDocumentSelector(e,t){return UH.from(e,this._uriTransformer,t)}_createDisposable(e){return new js(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return Jc._handlePool++}async _withAdapter(e,t,i,n,r,o=!1){const a=this._adapter.get(e);if(!a||!(a.adapter instanceof t))return n;const c=Date.now();o||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=>{Oo(d)||(this._logService.error(`[${a.extension.identifier.value}] provider FAILED`),this._logService.error(d),this._extensionTelemetry.onExtensionError(a.extension.identifier,d))}).finally(()=>{o||this._logService.trace(`[${a.extension.identifier.value}] provider DONE after ${Date.now()-c}ms`)}),Ue.isCancellationToken(r)?Zoe(l,r):l}_addNewAdapter(e,t){const i=this._nextHandle();return this._adapter.set(i,new G4(e,t)),i}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(e,t,i,n){const r=this._addNewAdapter(new Cne(this._documents,i),e),o=n&&n.label||Jc._extLabel(e);return this._proxy.$registerDocumentSymbolProvider(r,this._transformDocumentSelector(t,e),o),this._createDisposable(r)}$provideDocumentSymbols(e,t,i){return this._withAdapter(e,Cne,n=>n.provideDocumentSymbols(N.revive(t),i),void 0,i)}registerCodeLensProvider(e,t,i){const n=this._nextHandle(),r=typeof i.onDidChangeCodeLenses=="function"?this._nextHandle():void 0;this._adapter.set(n,new G4(new nq(this._documents,this._commands.converter,i,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(n,this._transformDocumentSelector(t,e),r);let o=this._createDisposable(n);if(r!==void 0){const a=i.onDidChangeCodeLenses(c=>this._proxy.$emitCodeLensEvent(r));o=js.from(o,a)}return o}$provideCodeLenses(e,t,i){return this._withAdapter(e,nq,n=>n.provideCodeLenses(N.revive(t),i),void 0,i)}$resolveCodeLens(e,t,i){return this._withAdapter(e,nq,n=>n.resolveCodeLens(t,i),void 0,void 0)}$releaseCodeLenses(e,t){this._withAdapter(e,nq,i=>Promise.resolve(i.releaseCodeLenses(t)),void 0,void 0)}registerDefinitionProvider(e,t,i){const n=this._addNewAdapter(new h$e(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,h$e,r=>r.provideDefinition(N.revive(t),i,n),[],n)}registerDeclarationProvider(e,t,i){const n=this._addNewAdapter(new u$e(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,u$e,r=>r.provideDeclaration(N.revive(t),i,n),[],n)}registerImplementationProvider(e,t,i){const n=this._addNewAdapter(new g$e(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,g$e,r=>r.provideImplementation(N.revive(t),i,n),[],n)}registerTypeDefinitionProvider(e,t,i){const n=this._addNewAdapter(new f$e(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,f$e,r=>r.provideTypeDefinition(N.revive(t),i,n),[],n)}registerHoverProvider(e,t,i,n){const r=this._addNewAdapter(new Fz(this._documents,i),e);return this._proxy.$registerHoverProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideHover(e,t,i,n,r){return this._withAdapter(e,Fz,o=>o.provideHover(N.revive(t),i,n,r),void 0,r)}$releaseHover(e,t){this._withAdapter(e,Fz,i=>Promise.resolve(i.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,i,n){const r=this._addNewAdapter(new p$e(this._documents,i),e);return this._proxy.$registerEvaluatableExpressionProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideEvaluatableExpression(e,t,i,n){return this._withAdapter(e,p$e,r=>r.provideEvaluatableExpression(N.revive(t),i,n),void 0,n)}registerInlineValuesProvider(e,t,i,n){const r=typeof i.onDidChangeInlineValues=="function"?this._nextHandle():void 0,o=this._addNewAdapter(new m$e(this._documents,i),e);this._proxy.$registerInlineValuesProvider(o,this._transformDocumentSelector(t,e),r);let a=this._createDisposable(o);if(r!==void 0){const c=i.onDidChangeInlineValues(l=>this._proxy.$emitInlineValuesEvent(r));a=js.from(a,c)}return a}$provideInlineValues(e,t,i,n,r){return this._withAdapter(e,m$e,o=>o.provideInlineValues(N.revive(t),i,n,r),void 0,r)}registerDocumentHighlightProvider(e,t,i){const n=this._addNewAdapter(new _$e(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 v$e(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,_$e,r=>r.provideDocumentHighlights(N.revive(t),i,n),void 0,n)}$provideMultiDocumentHighlights(e,t,i,n,r){return this._withAdapter(e,v$e,o=>o.provideMultiDocumentHighlights(N.revive(t),i,n.map(a=>N.revive(a)),r),void 0,r)}registerLinkedEditingRangeProvider(e,t,i){const n=this._addNewAdapter(new b$e(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,b$e,async r=>{const o=await r.provideLinkedEditingRanges(N.revive(t),i,n);if(o)return{ranges:o.ranges,wordPattern:o.wordPattern?Jc._serializeRegExp(o.wordPattern):void 0}},void 0,n)}registerReferenceProvider(e,t,i){const n=this._addNewAdapter(new w$e(this._documents,i),e);return this._proxy.$registerReferenceSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideReferences(e,t,i,n,r){return this._withAdapter(e,w$e,o=>o.provideReferences(N.revive(t),i,n,r),void 0,r)}registerCodeActionProvider(e,t,i,n){const r=new Z,o=this._addNewAdapter(new zF(this._documents,this._commands.converter,this._diagnostics,i,this._logService,e,this._apiDeprecation),e);return this._proxy.$registerCodeActionSupport(o,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,r)}))},Jc._extLabel(e),Jc._extId(e),!!i.resolveCodeAction),r.add(this._createDisposable(o)),r}$provideCodeActions(e,t,i,n,r){return this._withAdapter(e,zF,o=>o.provideCodeActions(N.revive(t),i,n,r),void 0,r)}$resolveCodeAction(e,t,i){return this._withAdapter(e,zF,n=>n.resolveCodeAction(t,i),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,zF,i=>Promise.resolve(i.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,i){const n=this._addNewAdapter(new y$e(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,y$e,r=>r.provideDocumentFormattingEdits(N.revive(t),i,n),void 0,n)}registerDocumentRangeFormattingEditProvider(e,t,i){const n=typeof i.provideDocumentRangesFormattingEdits=="function",r=this._addNewAdapter(new vge(this._documents,i),e);return this._proxy.$registerRangeFormattingSupport(r,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,n),this._createDisposable(r)}$provideDocumentRangeFormattingEdits(e,t,i,n,r){return this._withAdapter(e,vge,o=>o.provideDocumentRangeFormattingEdits(N.revive(t),i,n,r),void 0,r)}$provideDocumentRangesFormattingEdits(e,t,i,n,r){return this._withAdapter(e,vge,o=>o.provideDocumentRangesFormattingEdits(N.revive(t),i,n,r),void 0,r)}registerOnTypeFormattingEditProvider(e,t,i,n){const r=this._addNewAdapter(new C$e(this._documents,i),e);return this._proxy.$registerOnTypeFormattingSupport(r,this._transformDocumentSelector(t,e),n,e.identifier),this._createDisposable(r)}$provideOnTypeFormattingEdits(e,t,i,n,r,o){return this._withAdapter(e,C$e,a=>a.provideOnTypeFormattingEdits(N.revive(t),i,n,r,o),void 0,o)}registerWorkspaceSymbolProvider(e,t){const i=this._addNewAdapter(new sq(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(i,typeof t.resolveWorkspaceSymbol=="function"),this._createDisposable(i)}$provideWorkspaceSymbols(e,t,i){return this._withAdapter(e,sq,n=>n.provideWorkspaceSymbols(t,i),{symbols:[]},i)}$resolveWorkspaceSymbol(e,t,i){return this._withAdapter(e,sq,n=>n.resolveWorkspaceSymbol(t,i),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,sq,i=>i.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,i){const n=this._addNewAdapter(new Y1(this._documents,i,this._logService),e);return this._proxy.$registerRenameSupport(n,this._transformDocumentSelector(t,e),Y1.supportsResolving(i)),this._createDisposable(n)}$provideRenameEdits(e,t,i,n,r){return this._withAdapter(e,Y1,o=>o.provideRenameEdits(N.revive(t),i,n,r),void 0,r)}$resolveRenameLocation(e,t,i,n){return this._withAdapter(e,Y1,r=>r.resolveRenameLocation(N.revive(t),i,n),void 0,n)}registerNewSymbolNamesProvider(e,t,i){const n=this._addNewAdapter(new Oz(this._documents,i,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,Oz,t=>t.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,i,n,r){return this._withAdapter(e,Oz,o=>o.provideNewSymbolNames(N.revive(t),i,n,r),void 0,r)}registerDocumentSemanticTokensProvider(e,t,i,n){const r=this._addNewAdapter(new Nf(this._documents,i),e),o=typeof i.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(r,this._transformDocumentSelector(t,e),n,o);let a=this._createDisposable(r);if(o){const c=i.onDidChangeSemanticTokens(l=>this._proxy.$emitDocumentSemanticTokensEvent(o));a=js.from(a,c)}return a}$provideDocumentSemanticTokens(e,t,i,n){return this._withAdapter(e,Nf,r=>r.provideDocumentSemanticTokens(N.revive(t),i,n),null,n)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,Nf,i=>i.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,i,n){const r=this._addNewAdapter(new S$e(this._documents,i),e);return this._proxy.$registerDocumentRangeSemanticTokensProvider(r,this._transformDocumentSelector(t,e),n),this._createDisposable(r)}$provideDocumentRangeSemanticTokens(e,t,i,n){return this._withAdapter(e,S$e,r=>r.provideDocumentRangeSemanticTokens(N.revive(t),i,n),null,n)}registerCompletionItemProvider(e,t,i,n){const r=this._addNewAdapter(new g1(this._documents,this._commands.converter,i,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(r,this._transformDocumentSelector(t,e),n,g1.supportsResolving(i),e.identifier),this._createDisposable(r)}$provideCompletionItems(e,t,i,n,r){return this._withAdapter(e,g1,o=>o.provideCompletionItems(N.revive(t),i,n,r),void 0,r)}$resolveCompletionItem(e,t,i){return this._withAdapter(e,g1,n=>n.resolveCompletionItem(t,i),void 0,i)}$releaseCompletionItems(e,t){this._withAdapter(e,g1,i=>i.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,i,n){const r=new kni(e,this._documents,i,this._commands.converter),o=this._addNewAdapter(r,e);return this._proxy.$registerInlineCompletionsSupport(o,this._transformDocumentSelector(t,e),r.supportsHandleEvents,An.toKey(e.identifier.value),n?.yieldTo?.map(a=>An.toKey(a))||[]),this._createDisposable(o)}$provideInlineCompletions(e,t,i,n,r){return this._withAdapter(e,tF,o=>o.provideInlineCompletions(N.revive(t),i,n,r),void 0,r)}$provideInlineEdits(e,t,i,n,r){return this._withAdapter(e,tF,o=>o.provideInlineEdits(N.revive(t),i,n,r),void 0,r)}$handleInlineCompletionDidShow(e,t,i,n){this._withAdapter(e,tF,async r=>{r.handleDidShowCompletionItem(t,i,n)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,i,n,r){this._withAdapter(e,tF,async o=>{o.handlePartialAccept(t,i,n,r)},void 0,void 0)}$freeInlineCompletionsList(e,t){this._withAdapter(e,tF,async i=>{i.disposeCompletions(t)},void 0,void 0)}registerInlineEditProvider(e,t,i){const n=new wge(e,this._documents,i,this._commands.converter),r=this._addNewAdapter(n,e);return this._proxy.$registerInlineEditProvider(r,this._transformDocumentSelector(t,e),e.identifier),this._createDisposable(r)}$provideInlineEdit(e,t,i,n){return this._withAdapter(e,wge,r=>r.provideInlineEdits(N.revive(t),i,n),void 0,n)}$freeInlineEdit(e,t){this._withAdapter(e,wge,async i=>{i.disposeEdit(t)},void 0,void 0)}registerSignatureHelpProvider(e,t,i,n){const r=Array.isArray(n)?{triggerCharacters:n,retriggerCharacters:[]}:n,o=this._addNewAdapter(new yge(this._documents,i),e);return this._proxy.$registerSignatureHelpProvider(o,this._transformDocumentSelector(t,e),r),this._createDisposable(o)}$provideSignatureHelp(e,t,i,n,r){return this._withAdapter(e,yge,o=>o.provideSignatureHelp(N.revive(t),i,n,r),void 0,r)}$releaseSignatureHelp(e,t){this._withAdapter(e,yge,i=>i.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(e,t,i){const n=typeof i.onDidChangeInlayHints=="function"?this._nextHandle():void 0,r=this._addNewAdapter(new rq(this._documents,this._commands.converter,i,this._logService,e),e);this._proxy.$registerInlayHintsProvider(r,this._transformDocumentSelector(t,e),typeof i.resolveInlayHint=="function",n,Jc._extLabel(e));let o=this._createDisposable(r);if(n!==void 0){const a=i.onDidChangeInlayHints(c=>this._proxy.$emitInlayHintsEvent(n));o=js.from(o,a)}return o}$provideInlayHints(e,t,i,n){return this._withAdapter(e,rq,r=>r.provideInlayHints(N.revive(t),i,n),void 0,n)}$resolveInlayHint(e,t,i){return this._withAdapter(e,rq,n=>n.resolveInlayHint(t,i),void 0,i)}$releaseInlayHints(e,t){this._withAdapter(e,rq,i=>i.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,i){const n=this._addNewAdapter(new eD(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,eD,n=>n.provideLinks(N.revive(t),i),void 0,i,t.scheme==="output")}$resolveDocumentLink(e,t,i){return this._withAdapter(e,eD,n=>n.resolveLink(t,i),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,eD,i=>i.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,i){const n=this._addNewAdapter(new Cge(this._documents,i),e);return this._proxy.$registerDocumentColorProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDocumentColors(e,t,i){return this._withAdapter(e,Cge,n=>n.provideColors(N.revive(t),i),[],i)}$provideColorPresentations(e,t,i,n){return this._withAdapter(e,Cge,r=>r.provideColorPresentations(N.revive(t),i,n),void 0,n)}registerFoldingRangeProvider(e,t,i){const n=this._nextHandle(),r=typeof i.onDidChangeFoldingRanges=="function"?this._nextHandle():void 0;this._adapter.set(n,new G4(new A$e(this._documents,i),e)),this._proxy.$registerFoldingRangeProvider(n,this._transformDocumentSelector(t,e),e.identifier,r);let o=this._createDisposable(n);if(r!==void 0){const a=i.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(r));o=js.from(o,a)}return o}$provideFoldingRanges(e,t,i,n){return this._withAdapter(e,A$e,r=>r.provideFoldingRanges(N.revive(t),i,n),void 0,n)}registerSelectionRangeProvider(e,t,i){const n=this._addNewAdapter(new E$e(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,E$e,r=>r.provideSelectionRanges(N.revive(t),i,n),[],n)}registerCallHierarchyProvider(e,t,i){const n=this._addNewAdapter(new z4(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,z4,r=>Promise.resolve(r.prepareSession(N.revive(t),i,n)),void 0,n)}$provideCallHierarchyIncomingCalls(e,t,i,n){return this._withAdapter(e,z4,r=>r.provideCallsTo(t,i,n),void 0,n)}$provideCallHierarchyOutgoingCalls(e,t,i,n){return this._withAdapter(e,z4,r=>r.provideCallsFrom(t,i,n),void 0,n)}$releaseCallHierarchy(e,t){this._withAdapter(e,z4,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,i){const n=this._addNewAdapter(new $4(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,$4,r=>Promise.resolve(r.prepareSession(N.revive(t),i,n)),void 0,n)}$provideTypeHierarchySupertypes(e,t,i,n){return this._withAdapter(e,$4,r=>r.provideSupertypes(t,i,n),void 0,n)}$provideTypeHierarchySubtypes(e,t,i,n){return this._withAdapter(e,$4,r=>r.provideSubtypes(t,i,n),void 0,n)}$releaseTypeHierarchy(e,t){this._withAdapter(e,$4,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,i,n){const r=this._nextHandle();return this._adapter.set(r,new G4(new oq(this._proxy,this._documents,i,r,e),e)),this._proxy.$registerDocumentOnDropEditProvider(r,this._transformDocumentSelector(t,e),hl(e,"documentPaste")&&n?{supportsResolve:!!i.resolveDocumentDropEdit,dropMimeTypes:n.dropMimeTypes}:void 0),this._createDisposable(r)}$provideDocumentOnDropEdits(e,t,i,n,r,o){return this._withAdapter(e,oq,a=>Promise.resolve(a.provideDocumentOnDropEdits(t,N.revive(i),n,r,o)),void 0,void 0)}$resolveDropEdit(e,t,i){return this._withAdapter(e,oq,n=>n.resolveDropEdit(t,i),{},void 0)}$releaseDocumentOnDropEdits(e,t){this._withAdapter(e,oq,i=>Promise.resolve(i.releaseDropEdits(t)),void 0,void 0)}registerMappedEditsProvider(e,t,i){const n=this._addNewAdapter(new x$e(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,r){return this._withAdapter(e,x$e,o=>Promise.resolve(o.provideMappedEdits(t,i,n,r)),null,r)}registerDocumentPasteEditProvider(e,t,i,n){const r=this._nextHandle();return this._adapter.set(r,new G4(new V4(this._proxy,this._documents,i,r,e),e)),this._proxy.$registerPasteEditProvider(r,this._transformDocumentSelector(t,e),{supportsCopy:!!i.prepareDocumentPaste,supportsPaste:!!i.provideDocumentPasteEdits,supportsResolve:!!i.resolveDocumentPasteEdit,providedPasteEditKinds:n.providedPasteEditKinds?.map(o=>o.value),copyMimeTypes:n.copyMimeTypes,pasteMimeTypes:n.pasteMimeTypes}),this._createDisposable(r)}$prepareDocumentPaste(e,t,i,n,r){return this._withAdapter(e,V4,o=>o.prepareDocumentPaste(N.revive(t),i,n,r),void 0,r)}$providePasteEdits(e,t,i,n,r,o,a){return this._withAdapter(e,V4,c=>c.providePasteEdits(t,N.revive(i),n,r,o,a),void 0,a)}$resolvePasteEdit(e,t,i){return this._withAdapter(e,V4,n=>n.resolvePasteEdit(t,i),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,V4,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:Jc._serializeRegExp(e.decreaseIndentPattern),increaseIndentPattern:Jc._serializeRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Jc._serializeRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Jc._serializeRegExp(e.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(e){return{beforeText:Jc._serializeRegExp(e.beforeText),afterText:e.afterText?Jc._serializeRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Jc._serializeRegExp(e.previousLineText):void 0,action:e.action}}static _serializeOnEnterRules(e){return e.map(Jc._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(t=>lN.toString(t)):void 0}}static _serializeAutoClosingPairs(e){return e.map(Jc._serializeAutoClosingPair)}setLanguageConfiguration(e,t,i){const{wordPattern:n}=i;if(n&&ATe(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 r=this._nextHandle(),o={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Jc._serializeRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Jc._serializeIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Jc._serializeOnEnterRules(i.onEnterRules):void 0,__electricCharacterSupport:i.__electricCharacterSupport,__characterPairSupport:i.__characterPairSupport,autoClosingPairs:i.autoClosingPairs?Jc._serializeAutoClosingPairs(i.autoClosingPairs):void 0};return this._proxy.$setLanguageConfiguration(r,t,o),this._createDisposable(r)}$setWordDefinitions(e){for(const t of e)this._documents.setWordDefinitionFor(t.languageId,new RegExp(t.regexSource,t.regexFlags))}};Jc._handlePool=0;let i0e=Jc;class Ini{constructor(e){this._registeredTools=new Map,this._allTools=new Map,this._proxy=e.getProxy(We.MainThreadLanguageModelTools),this._proxy.$getTools().then(t=>{for(const i of t)this._allTools.set(i.name,Mr(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=>Txe.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 Tni{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(We.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=Yr.from(t),r=await this._proxy.$tokensAtPosition(e.uri,n),o={type:PS.Other,range:e.getWordRangeAtPosition(t)??new Xn(t.line,t.character,t.line,t.character)};if(!r)return o;const a={range:tt.to(r.range),type:exe.to(r.type)};return!a.range.contains(t)||i!==e.version?o:a}createLanguageStatusItem(e,t,i){const n=this._handlePool++,r=this._proxy,o=this._ids,a=`${e.identifier.value}/${t}`;if(o.has(a))throw new Error(`LanguageStatusItem with id '${t}' ALREADY exists`);o.add(a);const c={selector:i,id:t,name:e.displayName??e.name,severity:qT.Information,command:void 0,text:"",detail:"",busy:!1};let l;const d=new Z,h=()=>{if(l?.dispose(),!o.has(a)){console.warn(`LanguageStatusItem (${t}) from ${e.identifier.value} has been disposed and CANNOT be updated anymore`);return}l=Zy(()=>{d.clear(),this._proxy.$setLanguageStatus(n,{id:a,name:c.name??e.displayName??e.name,source:e.displayName??e.name,selector:UH.from(c.selector,this._uriTransformer),label:c.text,detail:c.detail??"",severity:c.severity===qT.Error?Ze.Error:c.severity===qT.Warning?Ze.Warning:Ze.Info,command:c.command&&this._commands.toInternal(c.command,d),accessibilityInfo:c.accessibilityInformation,busy:c.busy})},0)},u={dispose(){d.dispose(),l?.dispose(),r.$removeLanguageStatus(n),o.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){ze(e,"languageStatusText"),c.text=f,h()},get text2(){return ze(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 Lni(s){return s&&s.title}let n0e=class{constructor(e,t){this._logService=t,this._proxy=e.getProxy(We.MainThreadMessageService)}showMessage(e,t,i,n,r){const o={source:{identifier:e.identifier,label:e.displayName||e.name}};let a;typeof n=="string"||Lni(n)?a=[n,...r]:(o.modal=n?.modal,o.useCustom=n?.useCustom,o.detail=n?.detail,a=r),o.useCustom&&ze(e,"resolvers");const c=[];let l=!1;for(let d=0;d{if(typeof d=="number")return a[d]})}};n0e=D([_(1,Ke)],n0e);class Sge{constructor(e,t,i,n){this.start=e,this.deletedCount=t,this.deletedItems=i,this.items=n}asApiEvent(){return{range:new Dy(this.start,this.start+this.deletedCount),addedCells:this.items.map(e=>e.apiCell),removedCells:this.deletedItems}}}class s0e{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(yI.to),this._internalMetadata=i.internalMetadata??{},this._metadata=Object.freeze(i.metadata??{}),this._previousResult=Object.freeze(qH.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:T$.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(yI.to)}setOutputItems(e,t,i){const n=i.map(QH.to),r=this._outputs.find(o=>o.id===e);if(r&&(t||(r.items.length=0),r.items.push(...n),r.items.length>1&&r.items.every(o=>vst(o.mime)))){const o=new Map,a=[];r.items.forEach(c=>{let l;o.has(c.mime)?l=o.get(c.mime):(l=[],o.set(c.mime,l),a.push(c.mime)),l.push(c.data)}),r.items.length=0,a.forEach(c=>{const l=n7t(o.get(c));r.items.push({mime:c,data:l.data.buffer})})}}setMetadata(e){this._metadata=Object.freeze(e)}setInternalMetadata(e){this._internalMetadata=e,this._previousResult=Object.freeze(qH.to(e))}setMime(e){}}const Loe=class Loe{constructor(e,t,i,n,r){this._proxy=e,this._textDocumentsAndEditors=t,this._textDocuments=i,this.uri=n,this.handle=Loe._handlePool++,this._cells=[],this._versionId=0,this._isDirty=!1,this._disposed=!1,this._notebookType=r.viewType,this._metadata=Object.freeze(r.metadata??Object.create(null)),this._spliceNotebookCells([[0,0,r.cells]],!0,void 0),this._versionId=r.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(r=>r.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:[]},r=[];for(const a of e.rawEvents)a.kind===Al.ModelChange?this._spliceNotebookCells(a.changes,!1,n.contentChanges):a.kind===Al.Move?this._moveCells(a.index,a.length,a.newIdx,n.contentChanges):a.kind===Al.Output?(this._setCellOutputs(a.index,a.outputs),r.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===Al.OutputItem?(this._setCellOutputItems(a.index,a.outputId,a.append,a.outputItems),r.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===Al.ChangeCellLanguage?(this._changeCellLanguage(a.index,a.language),r.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document})):a.kind===Al.ChangeCellContent?r.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document}):a.kind===Al.ChangeCellMime?this._changeCellMime(a.index,a.mime):a.kind===Al.ChangeCellMetadata?(this._changeCellMetadata(a.index,a.metadata),r.push({cell:this._cells[a.index].apiCell,metadata:this._cells[a.index].apiCell.metadata})):a.kind===Al.ChangeCellInternalMetadata&&(this._changeCellInternalMetadata(a.index,a.internalMetadata),r.push({cell:this._cells[a.index].apiCell,executionSummary:this._cells[a.index].apiCell.executionSummary}));const o=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 s0e(this,this._textDocumentsAndEditors,u);return t||r.push(s0e.asModelAddData(u)),f}),d=new Sge(a[0],a[1],[],l),h=this._cells.splice(a[0],a[1],...l);for(const u of h)o.push(u.uri),d.deletedItems.push(u.apiCell);n.push(d)}),this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:r,removedDocuments:o}),i)for(const a of n)i.push(a.asApiEvent())}_moveCells(e,t,i,n){const r=this._cells.splice(e,t);this._cells.splice(i,0,...r);const o=[new Sge(e,t,r.map(a=>a.apiCell),[]),new Sge(i,0,[],r)];for(const a of o)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)}};Loe._handlePool=0;let r0e=Loe;const Roe=class Roe{constructor(e,t,i,n,r,o){this.id=e,this._proxy=t,this.notebookData=i,this._selections=[],this._visibleRanges=[],this._visible=!1,this._selections=r,this._visibleRanges=n,this._viewColumn=o}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(Dy.isNotebookRange))throw Fi("selections");e._selections=t,e._trySetSelections(t)},get visibleRanges(){return e._visibleRanges},revealRange(t,i){e._proxy.$tryRevealRange(e.id,zy.from(t),i??u$.Default)},get viewColumn(){return e._viewColumn},[Symbol.for("debug.description")](){return`NotebookEditor(${this.notebook.uri.toString()})`}},Roe.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(zy.from))}_acceptViewColumn(e){this._viewColumn=e}};Roe.apiEditorsToExtHost=new WeakMap;let d7=Roe;class Rni 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 h3;e.acceptChunk(this._source);const t=e.finish(!0),{textBuffer:i,disposable:n}=t.create(Db.LF);this._inputTextBuffer=i,this._register(n)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||(this._outputTextBuffers=this._outputs.map(e=>{const t=new h3;t.acceptChunk(e);const i=t.finish(!0),{textBuffer:n,disposable:r}=i.create(Db.LF);return this._register(r),n})),this._outputTextBuffers}findInInputs(e){const i=new jC(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 jC(e,!1,!1,null).parseSearchRequest();return i?this.outputTextBuffers.map(n=>{const r=n.findMatchesLineByLine(this._getFullModelRange(n),i,!0,5e3);if(r.length!==0)return{textBuffer:n,matches:r}}).filter(n=>!!n):[]}}function D$e(s,e){let t=-1;const i=[];let n=[];return s.forEach(o=>{o.range.startLineNumber!==t&&n.length>0&&(i.push([...n]),n=[]),n.push(o),t=o.range.endLineNumber}),n.length>0&&i.push([...n]),i.map(o=>{const a=[],c=o[0].range.startLineNumber,l=o[o.length-1].range.endLineNumber;for(let d=c;d<=l;d++)a.push(e.getLineContent(d));return new R9t(a.join(` +`)[0];const o={description:r,scope:t};this.descriptionMap.set(i,o),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 fii{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 bIe=class extends vIe{constructor(e,t){super(!1,e,t)}createTerminal(e,t,i){throw new dS}createTerminalFromOptions(e,t){throw new dS}};bIe=D([_(0,iP),_(1,Jr)],bIe);function Aot(s){if(!(!s||typeof s=="string"))return"id"in s?{id:s.id,color:s.color}:s}function pii(s){return $2.isThemeColor(s)?s:void 0}function X9e(s){const e={...s};return delete e.scope,e.options=e.options??void 0,delete e.variable,e}const xle=ae("IExtHostApiDeprecationService");let wIe=class{constructor(e,t){this._extHostLogService=t,this._reportedUsages=new Set,this._telemetryShape=e.getProxy(We.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}`}};wIe=D([_(0,Jr),_(1,Ke)],wIe);var pne;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(pne||(pne={}));var mne;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(mne||(mne={}));var yIe;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(yIe||(yIe={}));var Mz;(function(s){function e(n){if(n){const r=n;return r&&!!r.process}else return!1}s.is=e;function t(n){if(n==null)return;const r={process:n.process,args:n.args};return n.options&&(r.options=yIe.from(n.options)),r}s.from=t;function i(n){if(n!=null)return new hN(n.process,n.args,n.options)}s.to=i})(Mz||(Mz={}));var CIe;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(CIe||(CIe={}));var Nz;(function(s){function e(n){if(n){const r=n;return r&&(!!r.commandLine||!!r.command)}else return!1}s.is=e;function t(n){if(n==null)return;const r={};return n.commandLine!==void 0?r.commandLine=n.commandLine:(r.command=n.command,r.args=n.args),n.options&&(r.options=CIe.from(n.options)),r}s.from=t;function i(n){if(!(n==null||n.command===void 0&&n.commandLine===void 0))return n.commandLine?new bI(n.commandLine,n.options):new bI(n.command,n.args?n.args:[],n.options)}s.to=i})(Nz||(Nz={}));var yA;(function(s){function e(n){if(n){const r=n;return r&&r.customExecution==="customExecution"}else return!1}s.is=e;function t(n){return{customExecution:"customExecution"}}s.from=t;function i(n,r){return r.get(n)}s.to=i})(yA||(yA={}));var SIe;(function(s){function e(t){if(t!=null)return{_id:t.id,isDefault:t.isDefault}}s.from=e})(SIe||(SIe={}));var Xx;(function(s){function e(n,r){if(n==null)return[];const o=[];for(const a of n){const c=t(a,r);c&&o.push(c)}return o}s.fromMany=e;function t(n,r){if(n==null)return;let o;n.execution instanceof hN?o=Mz.from(n.execution):n.execution instanceof bI?o=Nz.from(n.execution):n.execution&&n.execution instanceof ile&&(o=yA.from(n.execution));const a=pne.from(n.definition);let c;return n.scope?typeof n.scope=="number"?c=n.scope:c=n.scope.uri:c=wI.Workspace,!a||!c?void 0:{_id:n._id,definition:a,name:n.name,source:{extensionId:r.identifier.value,label:n.source,scope:c},execution:o,isBackground:n.isBackground,group:SIe.from(n.group),presentationOptions:mne.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,r,o){if(n==null)return;let a;Mz.is(n.execution)?a=Mz.to(n.execution):Nz.is(n.execution)?a=Nz.to(n.execution):yA.is(n.execution)&&(a=yA.to(n._id,o));const c=pne.to(n.definition);let l;if(n.source&&(n.source.scope!==void 0?typeof n.source.scope=="number"?l=n.source.scope:l=await r.resolveWorkspaceFolder(N.revive(n.source.scope)):l=wI.Workspace),!c||!l)return;const d=new J9(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=pH.from(n.group._id),d.group&&n.group.isDefault&&(d.group=new pH(d.group.id,d.group.label),n.group.isDefault===!0&&(d.group.isDefault=n.group.isDefault))),n.presentationOptions&&(d.presentationOptions=mne.to(n.presentationOptions)),n._id&&(d._id=n._id),n.detail&&(d.detail=n.detail),d}s.to=i})(Xx||(Xx={}));var AIe;(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})(AIe||(AIe={}));var I7;class mge{constructor(e,t,i){Ht(this,I7);this._id=t,this._task=i,St(this,I7,e)}get task(){return this._task}terminate(){Ce(this,I7).terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}}I7=new WeakMap;let EIe=class{constructor(e,t,i,n,r,o,a,c){this._onDidExecuteTask=new I,this._onDidTerminateTask=new I,this._onDidTaskProcessStarted=new I,this._onDidTaskProcessEnded=new I,this._proxy=e.getProxy(We.MainThreadTask),this._workspaceProvider=i,this._editorService=n,this._configurationService=r,this._terminalService=o,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 js(()=>{});const n=this.nextHandle();return this._handlers.set(n,{type:t,provider:i,extension:e}),this._proxy.$registerTaskProvider(n,t),new js(()=>{this._handlers.delete(n),this._proxy.$unregisterTaskProvider(n)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(AIe.from(e)).then(async t=>{const i=[];for(const n of t){const r=await Xx.to(n,this._workspaceProvider,this._providedCustomExecutions2);r&&i.push(r)}return i})}get taskExecutions(){const e=[];return this._taskExecutions.forEach(t=>e.push(t)),e}terminateTask(e){if(!(e instanceof mge))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=[],r=Jh(()=>i.provider.provideTasks(Ue.None)).then(o=>this.provideTasksInternal(t,n,i,o));return new Promise(o=>{r.then(a=>{Promise.all(n).then(()=>{o(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 Xx.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!n)throw new Error("Unexpected: Task cannot be resolved.");const r=await i.provider.resolveTask(n,Ue.None);if(!r)return;this.checkDeprecation(r,i);const o=Xx.from(r,i.extension);if(!o)throw new Error("Unexpected: Task cannot be resolved.");if(r.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 yA.is(o.execution)&&await this.addCustomExecution(o,r,!0),await this.resolveTaskInternal(o)}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 r=this._taskExecutionPromises.get(e);if(!r)throw new Ma("Unexpected: The specified task is missing an execution");return r}const i=this._taskExecutionPromises.get(e.id);if(i)return i;let n;return t?n=Promise.resolve(new mge(this,e.id,t)):n=Xx.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(r=>{if(!r)throw new Ma("Unexpected: Task does not exist.");return new mge(this,e.id,r)}),this._taskExecutionPromises.set(e.id,n),n.then(r=>(this._taskExecutions.set(e.id,r),r))}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()}};EIe=D([_(0,Jr),_(1,bu),_(2,dE),_(3,s4),_(4,hE),_(5,r4),_(6,Ke),_(7,xle)],EIe);let xIe=class extends EIe{constructor(e,t,i,n,r,o,a,c){super(e,t,i,n,r,o,a,c),this.registerTaskSystem(pe.vscodeRemote,{scheme:pe.vscodeRemote,authority:"",platform:Gat(Qd.Web)})}async executeTask(e,t){if(!t.execution)throw new Error("Tasks to execute must include an execution");const i=Xx.from(t,e);if(i===void 0)throw new Error("Task is not valid");if(yA.is(i.execution))await this.addCustomExecution(i,t,!1);else throw new dS;const n=await this.getTaskExecution(await this._proxy.$getTaskExecution(i),t);return this._proxy.$executeTask(i).catch(r=>{throw new Error(r)}),n}provideTasksInternal(e,t,i,n){const r=[];if(n)for(const o of n){if(this.checkDeprecation(o,i),!o.definition||!e[o.definition.type]){const c=o.source?o.source:"No task source";this._logService.warn(`The task [${c}, ${o.name}] uses an undefined task type. The task will be ignored in the future.`)}const a=Xx.from(o,i.extension);a&&yA.is(a.execution)?(r.push(a),t.push(this.addCustomExecution(a,o,!0))):this._logService.warn("Only custom execution tasks supported.")}return{tasks:r,extension:i.extension}}async resolveTaskInternal(e){if(yA.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){}};xIe=D([_(0,Jr),_(1,bu),_(2,dE),_(3,s4),_(4,hE),_(5,r4),_(6,Ke),_(7,xle)],xIe);const Eot=ae("IExtHostTask"),xG=ae("IExtHostEditorTabs");class Z9e{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 ua.TextInput:return new sle(N.revive(this._dto.input.uri));case ua.TextDiffInput:return new m$(N.revive(this._dto.input.original),N.revive(this._dto.input.modified));case ua.TextMergeInput:return new CPe(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 ua.CustomEditorInput:return new rle(N.revive(this._dto.input.uri),this._dto.input.viewType);case ua.WebviewEditorInput:return new SPe(this._dto.input.viewType);case ua.NotebookInput:return new ole(N.revive(this._dto.input.uri),this._dto.input.notebookType);case ua.NotebookDiffInput:return new ale(N.revive(this._dto.input.original),N.revive(this._dto.input.modified),this._dto.input.notebookType);case ua.TerminalEditorInput:return new APe;case ua.InteractiveEditorInput:return new EPe(N.revive(this._dto.input.uri),N.revive(this._dto.input.inputBoxUri));case ua.ChatEditorInput:return new xPe;case ua.MultiDiffEditorInput:return new DPe(this._dto.input.diffEditors.map(e=>new m$(N.revive(e.original),N.revive(e.modified))));default:return}}}class mii{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 Z9e(i,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return kl.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===mh.TAB_OPEN){const i=new Z9e(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===mh.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===mh.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 DIe=class{constructor(e){this._onDidChangeTabs=new I,this._onDidChangeTabGroups=new I,this._extHostTabGroups=[],this._proxy=e.getProxy(We.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(r=>r.groupId===i)?.apiObject)},close:async(i,n)=>{const r=Array.isArray(i)?i:[i];return r.length?_ii(r[0])?this._closeGroups(r,n):this._closeTabs(r,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=zoe(t,i),r=this._extHostTabGroups.filter(l=>n.removed.includes(l.groupId)).map(l=>l.apiObject),o=[],a=[];this._extHostTabGroups=e.map(l=>{const d=new mii(l,()=>this._activeGroupId);return n.added.includes(d.groupId)?o.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:o,closed:r,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 mh.TAB_OPEN:this._onDidChangeTabs.fire(Object.freeze({opened:[i.apiObject],closed:[],changed:[]}));return;case mh.TAB_CLOSE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[i.apiObject],changed:[]}));return;case mh.TAB_MOVE:case mh.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 r=this._findExtHostTabFromApi(n);if(!r)throw new Error("Tab close: Invalid tab not found!");i.push(r.tabId)}return this._proxy.$closeTab(i,t)}async _closeGroups(e,t){const i=[];for(const n of e){const r=this._findExtHostTabGroupFromApi(n);if(!r)throw new Error("Group close: Invalid group not found!");i.push(r.groupId)}return this._proxy.$closeGroup(i,t)}};DIe=D([_(0,Jr)],DIe);function _ii(s){return s.tabs!==void 0}const Eoe=class Eoe{constructor(e,t,i,n){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=i,this.activateResolvedTime=n}};Eoe.NONE=new Eoe(!1,-1,-1,-1);let eU=Eoe;class e$e{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 eU(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 Dle{constructor(e,t,i,n,r,o){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=i,this.module=n,this.exports=r,this.disposable=o}}class vii extends Dle{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,V.None)}}class bii extends Dle{constructor(){super(!1,null,eU.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}class _ne extends Dle{constructor(e){super(!0,e,eU.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}let kIe=class{constructor(e,t,i,n){this._logService=n,this._registry=e,this._globalRegistry=t,this._host=i,this._operations=new ba,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 r=new Error(`Cannot activate unknown extension '${e.id.value}'`),o=this._createAndSaveOperation(e,null,[],new _ne(r));return this._host.onExtensionActivationError(e.id,r,new GHe(e.id.value)),o}const i=[],n=typeof t.extensionDependencies>"u"?[]:t.extensionDependencies;for(const r of n){if(this._isResolvedExtension(r))continue;const o=this._operations.get(r);if(o){i.push(o);continue}if(this._isHostExtension(r)){i.push(this._handleActivationRequest({id:this._globalRegistry.getExtensionDescription(r).identifier,reason:e.reason}));continue}const a=this._registry.getExtensionDescription(r);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 '${r}'`),d=this._createAndSaveOperation(e,t.displayName,[],new _ne(l));return this._host.onExtensionActivationError(t.identifier,l,new GHe(r)),d}return this._createAndSaveOperation(e,t.displayName,i,null)}_createAndSaveOperation(e,t,i,n){const r=new IIe(e.id,t,e.reason,i,n,this._host,this._logService);return this._operations.set(e.id,r),r}_isHostExtension(e){return yD.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){const t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};kIe=D([_(3,Ke)],kIe);let IIe=class{get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}constructor(e,t,i,n,r,o,a){this._id=e,this._displayName=t,this._reason=i,this._deps=n,this._value=r,this._host=o,this._logService=a,this._barrier=new jd,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 _ne(t),this._isDisposed&&Oo(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)}}};IIe=D([_(6,Ke)],IIe);class xot{constructor(e,t){this._logService=t,this._onDidChangeStorage=new I,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(We.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,i){const n=await this._proxy.$initializeExtensionStorage(e,t);let r;return n&&(r=this.safeParseValue(e,t,n)),r||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 sFe=ae("IExtHostStorage");class Dot{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 ln(()=>{const n=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(const r of n.values())r.complete()}catch(r){for(const o of n.values())o.error(r)}})()},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 hc;return this._deferredPromises.set(e,n),this._scheduler.isScheduled()||this._scheduler.schedule(),n.p}dispose(){this._storageListener.dispose()}}class wii extends Dot{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 rFe=ae("IExtensionStoragePaths");let TIe=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(){}};TIe=D([_(0,bu),_(1,Ke),_(2,Sle)],TIe);const oFe=ae("IExtHostAuthentication");let LIe=class{constructor(e){this._authenticationProviders=new Map,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event,this._getSessionTaskSingler=new yii,this._proxy=e.getProxy(We.MainThreadAuthentication)}async getSession(e,t,i,n={}){const r=An.toKey(e.identifier),o=[...i].sort().join(" ");return await this._getSessionTaskSingler.getOrCreate(`${r} ${t} ${o}`,async()=>{await this._proxy.$ensureProvider(t);const a=e.displayName||e.name;return this._proxy.$getSession(t,i,r,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 r=i.onDidChangeSessions(o=>this._proxy.$sendDidChangeSessions(e,o));return this._proxy.$registerAuthenticationProvider(e,t,n?.supportsMultipleAccounts??!1),new js(()=>{r.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(lle)||this._onDidChangeSessions.fire({provider:{id:e,label:t}}),Promise.resolve()}};LIe=D([_(0,Jr)],LIe);class yii{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 RIe;const aFe=ae("IExtHostLanguageModels");class t$e{constructor(e,t){this.option=e,this.stream=new V2,this.stream=t??new V2}}class Cii{constructor(){this._responseStreams=new Map,this._defaultStream=new V2,this._isDone=!1;const e=this;this.apiObject={get stream(){return e._defaultStream.asyncIterable},get text(){return Yd.map(e._defaultStream.asyncIterable,t=>{if(t instanceof PH)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 t$e(e.index,this._defaultStream):t=new t$e(e.index),this._responseStreams.set(e.index,t));let i;e.part.type==="text"?i=new PH(e.part.value):i=new cle(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 fM;let MIe=(fM=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 ba,this._pendingRequest=new Map,this._languageAccessInformationExtensions=new Set,this._proxy=e.getProxy(We.MainThreadLanguageModels)}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose()}registerLanguageModel(e,t,i,n){const r=RIe._idPool++;this._languageModels.set(r,{extension:e.identifier,provider:i,languageModelId:t});let o;n.auth&&(o={providerLabel:e.displayName||e.name,accountLabel:typeof n.auth=="object"?n.auth.label:void 0}),this._proxy.$registerLanguageModelProvider(r,`${An.toKey(e.identifier)}/${r}/${t}`,{extension:e.identifier,id:t,vendor:n.vendor??An.toKey(e.identifier),name:n.name??"",family:n.family??"",version:n.version,maxInputTokens:n.maxInputTokens,maxOutputTokens:n.maxOutputTokens,auth:o,targetExtensions:n.extensions});const a=i.onDidReceiveLanguageModelResponse2?.(({extensionId:c,participant:l,tokenCount:d})=>{this._proxy.$whenLanguageModelChatRequestMade(t,new An(c),l,d)});return Ee(()=>{this._languageModels.delete(r),this._proxy.$unregisterProvider(r),a?.dispose()})}async $startChatRequest(e,t,i,n,r,o){const a=this._languageModels.get(e);if(!a)throw new Error("Provider not found");const c=new hu(async d=>{if(o.isCancellationRequested){this._logService.warn(`[CHAT](${a.extension.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}let h;if(d.part instanceof cle?h={type:"function_use",name:d.part.name,parameters:d.part.parameters}:d.part instanceof PH&&(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(PF.to),r,An.toKey(i),c,o));else{const d=new hu(async h=>{c.report({index:h.index,part:new PH(h.part)})});l=Promise.resolve(a.provider.provideLanguageModelResponse(n.map(PF.to),r?.modelOptions??{},An.toKey(i),d,o))}l.then(()=>{this._proxy.$reportResponseDone(t,void 0)},d=>{this._proxy.$reportResponseDone(t,kA(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 ba});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 Pa),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=[],r=this;for(const o of i){const a=this._allLanguageModelData.get(o);if(!a)continue;this._isUsingAuth(e.identifier,a.metadata)&&await this._fakeAuthPopulate(a.metadata);let c=a.apiObjects.get(e.identifier);c||(c={id:o,vendor:a.metadata.vendor,family:a.metadata.family,version:a.metadata.version,name:a.metadata.name,maxInputTokens:a.metadata.maxInputTokens,countTokens(l,d){if(!r._allLanguageModelData.has(o))throw Ow.NotFound(o);return r._computeTokenLength(o,l,d??Ue.None)},sendRequest(l,d,h){if(!r._allLanguageModelData.has(o))throw Ow.NotFound(o);return r._sendChatRequest(e,o,l,d??{},h??Ue.None)}},a.apiObjects.set(e.identifier,c)),n.push(c)}return n}async _sendChatRequest(e,t,i,n,r){const o=this._convertMessages(e,i),a=e.identifier,c=this._allLanguageModelData.get(t)?.metadata;if(!c||!this._allLanguageModelData.has(t))throw Ow.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 Ow.NoPermissions(`Language model '${t}' cannot be used by '${a.value}'.`);try{const l=Math.random()*1e6|0,d=new Cii;this._pendingRequest.set(l,{languageModelId:t,res:d});try{await this._proxy.$tryStartChatRequest(a,t,l,o,n,r)}catch(h){throw this._pendingRequest.delete(l),h}return d.apiObject}catch(l){throw l.name===Ow.name?l:new Ow(`Language model '${t}' errored: ${Po(l)}`,"Unknown",l)}}_convertMessages(e,t){const i=[];for(const n of t)n.role===jp.System&&ze(e,"languageModelSystem"),n.content2 instanceof b$&&ze(e,"lmTools"),i.push(PF.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(_8(t)):i.res.resolve())}async _getAuthAccess(e,t,i,n){const r=lle+t.identifier.value;if(await this._extHostAuthentication.getSession(e,r,[],{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,r,[],{forceNewSession:{detail:a}}),this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0}catch{return!1}}_isUsingAuth(e,t){return!!t.auth&&!An.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 Ow.NotFound(`Language model '${e}' is unknown.`);const r=ui.find(this._languageModels.values(),o=>o.languageModelId===e);return r?r.provider.provideTokenCount(t,i):this._proxy.$countTokens(e,typeof t=="string"?t:PF.from(t),i)}$updateModelAccesslist(e){const t=new Array;for(const{from:i,to:n,enabled:r}of e){const o=this._modelAccessList.get(i)??new D_;if(o.has(n)!==r){r?o.add(n):o.delete(n),this._modelAccessList.set(i,o);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,r=>An.equals(r.from,e.identifier))),n=M.signal(this._onDidChangeProviders.event);return{get onDidChange(){return M.any(i,n)},canSendRequest(r){let o;e:for(const[c,l]of t._allLanguageModelData)for(const d of l.apiObjects.values())if(d===r){o=l.metadata;break e}if(!o)return;if(!t._isUsingAuth(e.identifier,o))return!0;const a=t._modelAccessList.get(e.identifier);if(a)return a.has(o.extension)}}}},RIe=fM,fM._idPool=1,fM);MIe=RIe=D([_(0,Jr),_(1,Ke),_(2,oFe)],MIe);class kot{constructor(e){this._onDidChangePassword=new I,this.onDidChangePassword=this._onDidChangePassword.event,this._proxy=e.getProxy(We.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 cFe=ae("IExtHostSecretState");var px;class Sii{constructor(e,t){Ht(this,px);this.disposables=new Z,this._id=An.toKey(e.identifier),St(this,px,t),this.onDidChange=M.map(M.filter(Ce(this,px).onDidChangePassword,i=>i.extensionId===this._id),i=>({key:i.key}),this.disposables)}dispose(){this.disposables.dispose()}get(e){return Ce(this,px).get(this._id,e)}store(e,t){return Ce(this,px).store(this._id,e,t)}delete(e){return Ce(this,px).delete(this._id,e)}}px=new WeakMap;let NIe=class{constructor(e,t,i){this.logService=i,this.bundleCache=new Map,this._proxy=t.getProxy(We.MainThreadLocalization),this.currentLanguage=e.environment.appLanguage,this.isDefaultLanguage=this.currentLanguage===I1}getMessage(e,t){const{message:i,args:n,comment:r}=t;if(this.isDefaultLanguage)return wfe(i,n??{});let o=i;r&&r.length>0&&(o+=`/${Array.isArray(r)?r.join(""):r}`);const a=this.bundleCache.get(e)?.contents[o];return a||this.logService.warn(`Using default string since no string found in i18n bundle that has the key: ${o}`),wfe(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),r=JSON.parse(n);t=e.isBuiltin?r.contents?.bundle:r}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}};NIe=D([_(0,bu),_(1,Jr),_(2,Ke)],NIe);const lFe=ae("IExtHostLocalizationService"),dFe=ae("IExtHostManagedSockets");let PIe=class{constructor(e){this._remoteSocketIdCounter=0,this._factory=null,this._managedRemoteSockets=new Map,this._proxy=e.getProxy(We.MainThreadManagedSockets)}setFactory(e,t){for(const i of this._managedRemoteSockets.values())i.dispose();this._factory&&this._proxy.$unregisterSocketFactory(this._factory.socketFactoryId),this._factory=new Aii(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 Eii(t,i,n)),n.add(Ee(()=>this._managedRemoteSockets.delete(t))),n.add(i.onDidEnd(()=>{this._proxy.$onDidManagedSocketEnd(t),n.dispose()})),n.add(i.onDidClose(r=>{this._proxy.$onDidManagedSocketClose(t,r?.stack??r?.message),n.dispose()})),n.add(i.onDidReceiveMessage(r=>this._proxy.$onDidManagedSocketHaveData(t,Ge.wrap(r)))),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,Jr)],PIe);class Aii{constructor(e,t){this.socketFactoryId=e,this.makeConnection=t}}class Eii extends V{constructor(e,t,i){super(),this.socketId=e,this.actual=t,this._register(i)}}var FIe;const Iot=ae("IHostUtils");let OIe=FIe=class extends V{constructor(e,t,i,n,r,o,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=r,this._logService=o,this._extHostTunnelService=l,this._extHostTerminalService=d,this._extHostLocalizationService=h,this._mainThreadWorkspaceProxy=this._extHostContext.getProxy(We.MainThreadWorkspace),this._mainThreadTelemetryProxy=this._extHostContext.getProxy(We.MainThreadTelemetry),this._mainThreadExtensionsProxy=this._extHostContext.getProxy(We.MainThreadExtensionService),this._almostReadyToRunExtensions=new jd,this._readyToStartExtensionHost=new jd,this._readyToRunExtensions=new jd,this._eagerExtensionsActivated=new jd,this._activationEventsReader=new Dii(this._initData.extensions.activationEvents),this._globalRegistry=new yD(this._activationEventsReader,this._initData.extensions.allExtensions);const p=new D_(this._initData.extensions.myExtensions);this._myRegistry=new yD(this._activationEventsReader,Tot(this._globalRegistry,p)),Uh&&(this._logService.info(`Creating extension host with the following global extensions: ${TP(this._globalRegistry)}`),this._logService.info(`Creating extension host with the following local extensions: ${TP(this._myRegistry)}`)),this._storage=new xot(this._extHostContext,this._logService),this._secretState=new kot(this._extHostContext),this._storagePath=c,this._instaService=this._store.add(e.createChild(new Vc([sFe,this._storage],[cFe,this._secretState]))),this._activator=this._register(new kIe(this._myRegistry,this._globalRegistry,{onExtensionActivationError:(m,v,b)=>{this._mainThreadExtensionsProxy.$onExtensionActivationError(m,kA(v),b)},actualActivateExtension:async(m,v)=>{if(yD.isHostExtension(m,this._myRegistry,this._globalRegistry))return await this._mainThreadExtensionsProxy.$activateExtension(m,v),new bii;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(),ls("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(r=>r.identifier).filter(r=>this.isActivated(r)).map(r=>this._deactivate(r))}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(),m8&&gfe(n=>{this._logService.error(n)}),this._extHostContext.dispose();const i=this._deactivateAll();Promise.race([Ao(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 An(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 xii(e))),this._extensionPathIndex}async _createExtensionPathIndex(e){const t=Ih.forUris(i=>qKe.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 r=n$e(e,t);this._mainThreadTelemetryProxy.$publicLog2("extensionActivationTimes",{...r,...n||{},outcome:i})}_doActivateExtension(e,t){const i=n$e(e,t);this._mainThreadTelemetryProxy.$publicLog2("activatePlugin",i);const n=this._getEntryPoint(e);if(!n)return Promise.resolve(new vii(eU.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 r=new Z,o=new e$e(t.startup);return Promise.all([this._loadCommonJSModule(e,Ft(e.extensionLocation,n),o),this._loadExtensionContext(e,r)]).then(a=>(ls(`code/extHost/willActivateExtension/${e.identifier.value}`),FIe._callActivate(this._logService,e.identifier,a[0],a[1],r,o))).then(a=>(ls(`code/extHost/didActivateExtension/${e.identifier.value}`),a))}_loadExtensionContext(e,t){const i=this._extHostLanguageModels.createLanguageModelAccessInformation(e),n=t.add(new wii(e,this._storage)),r=t.add(new Dot(e.identifier.value,!1,this._storage)),o=t.add(new Sii(e,this._secretState)),a=e.isUnderDevelopment?this._initData.environment.extensionTestsLocationURI?eL.Test:eL.Development:eL.Production,c=this._initData.remote.isRemote?ED.Workspace:ED.UI;return this._logService.trace(`ExtensionService#loadExtensionContext ${e.identifier.value}`),Promise.all([n.whenReady,r.whenReady,this._storagePath.whenReady]).then(()=>{const l=this;let d,h;const u=hl(e,"ipc")?this._initData.messagePorts?.get(An.toKey(e.identifier)):void 0;return Object.freeze({globalState:n,workspaceState:r,secrets:o,subscriptions:[],get languageModelAccessInformation(){return i},get extensionUri(){return e.extensionLocation},get extensionPath(){return e.extensionLocation.fsPath},asAbsolutePath(f){return kfe(e.extensionLocation.fsPath,f)},get storagePath(){return l._storagePath.workspaceValue(e)?.fsPath},get globalStoragePath(){return l._storagePath.globalValue(e).fsPath},get logPath(){return kfe(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 jV(l,e.identifier,e,c,!1)),d},get extensionRuntime(){return ze(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,r,o){return i=i||{activate:void 0,deactivate:void 0},this._callActivateOptional(e,t,i,n,o).then(a=>new Dle(!1,null,o.build(),i,a,Ee(()=>{r.dispose(),wt(n.subscriptions)})))}static _callActivateOptional(e,t,i,n,r){if(typeof i.activate=="function")try{r.activateCallStart(),e.trace(`ExtensionService#_callActivateOptional ${t.value}`);const o=typeof global=="object"?global:self,a=i.activate.apply(o,[n]);return r.activateCallStop(),r.activateResolveStart(),Promise.resolve(a).then(c=>(r.activateResolveStop(),c))}catch(o){return Promise.reject(o)}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();pTe(()=>{for(let r=t;r50){this._activateAllStartupFinishedDeferred(e,r);break}else this._activateOneStartupFinished(o,a)}})}_activateAllStartupFinished(){this._mainThreadExtensionsProxy.$setPerformanceMarks(Uxt()),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 r of n.activationEvents)r==="onStartupFinished"&&this._activateOneStartupFinished(n,r)})}_handleEagerExtensions(){const e=this._activateByEvent("*",!0).then(void 0,o=>{this._logService.error(o)});this._register(this._extHostWorkspace.onDidChangeWorkspace(o=>this._handleWorkspaceContainsEagerExtensions(o.added)));const t=this._extHostWorkspace.workspace?this._extHostWorkspace.workspace.folders:[],i=this._handleWorkspaceContainsEagerExtensions(t),n=this._handleRemoteResolverEagerExtensions(),r=Promise.all([n,e,i]).then(()=>{});return Promise.race([r,Ao(1e4)]).then(()=>{this._activateAllStartupFinished()}),r}_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(o=>o.uri),forceUsingSearch:i||!this._hostUtils.fsExists,exists:o=>this._hostUtils.fsExists(o.fsPath),checkExists:(o,a,c)=>this._mainThreadWorkspaceProxy.$checkExists(o,a,c)},r=await ost(n,t);if(r)return this._activateById(t.identifier,{startup:!0,extensionId:t.identifier,activationEvent:r.activationEvent}).then(void 0,o=>this._logService.error(o))}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 e$e(!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,r)=>{const o=(l,d)=>{l?(Uh&&this._logService.error("Test runner called back with error",l),r(l)):(Uh&&(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=i_(t),c=i.run(a,o);c&&c.then&&c.then(()=>{Uh&&this._logService.info("Test runner finished successfully."),n(0)}).catch(l=>{Uh&&this._logService.error("Test runner finished with error",l),r(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(),Ao(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 a1("Not an authority that can be resolved!",id.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=Ys.create(!1),n=()=>`[resolveAuthority(${Eee(e)},${t})][${i.elapsed()}ms] `,r=w=>this._logService.info(`${n()}${w}`),o=w=>this._logService.warn(`${n()}${w}`),a=(w,y=void 0)=>this._logService.error(`${n()}${w}`,y),c=w=>{if(w instanceof a1)return{type:"error",error:{code:w._code,message:w._message,detail:w._detail}};throw w},l=async w=>{r(`activating resolver for ${w}...`);const{resolver:y,authorityPrefix:C}=await this._activateAndGetResolver(w);if(!y)throw a(`no resolver for ${C}`),new a1(`No remote extension installed to resolve ${C}.`,id.NoResolverFound);return{resolver:y,authorityPrefix:C,remoteAuthority:w}},d=e.split(/@|%40/g).reverse();r(`activating remote resolvers ${d.join(" -> ")}`);let h;try{h=await Promise.all(d.map(l)).catch(async w=>{if(!(w instanceof a1)||w._code!==id.InvalidAuthority)throw w;return o(`resolving nested authorities failed: ${w.message}`),[await l(e)]})}catch(w){return c(w)}const u=new l6;u.cancelAndSet(()=>r("waiting..."),1e3);let f,p;for(const[w,{authorityPrefix:y,resolver:C,remoteAuthority:A}]of h.entries())try{if(w===h.length-1)r("invoking final resolve()..."),ls(`code/extHost/willResolveAuthority/${y}`),f=await C.resolve(A,{resolveAttempt:t,execServer:p}),ls(`code/extHost/didResolveAuthorityOK/${y}`),r("setting tunnel factory..."),this._register(await this._extHostTunnelService.setTunnelFactory(C,uz.isManagedResolvedAuthority(f)?f:void 0));else{if(r(`invoking resolveExecServer() for ${A}`),ls(`code/extHost/willResolveExecServer/${y}`),p=await C.resolveExecServer?.(A,{resolveAttempt:t,execServer:p}),!p)throw new a1(`Exec server was not available for ${A}`,id.NoResolverFound);ls(`code/extHost/didResolveExecServerOK/${y}`)}}catch(L){return ls(`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};r(`returned ${uz.isManagedResolvedAuthority(f)?"managed authority":`${f.host}:${f.port}`}`);let b;if(uz.isManagedResolvedAuthority(f)){const w=t;this._extHostManagedSockets.setFactory(w,f.makeConnection),b={authority:e,connectTo:new Qnt(w),connectionToken:f.connectionToken}}else b={authority:e,connectTo:new jnt(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 (${Eee(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 r=await Jh(()=>i.getCanonicalURI(n));return r||n}async $startExtensionHost(e){e.toAdd.forEach(o=>o.extensionLocation=N.revive(o.extensionLocation));const{globalRegistry:t,myExtensions:i}=i$e(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),Uh&&(this._logService.info(`$startExtensionHost: global extensions: ${TP(this._globalRegistry)}`),this._logService.info(`$startExtensionHost: local extensions: ${TP(this._myRegistry)}`)),this._startExtensionHost()}$activateByEvent(e,t){return t===Bb.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(o=>o.extensionLocation=N.revive(o.extensionLocation));const{globalRegistry:t,myExtensions:i}=i$e(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),Uh&&(this._logService.info(`$deltaExtensions: global extensions: ${TP(this._globalRegistry)}`),this._logService.info(`$deltaExtensions: local extensions: ${TP(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=Ge.alloc(e),i=Math.random()%256;for(let n=0;na.identifier));for(const a of i.myToRemove)r.delete(a);for(const a of i.myToAdd)r.add(a);const o=Tot(n,r);return{globalRegistry:n,myExtensions:o}}function n$e(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 TP(s){return s.getAllExtensionDescriptions().map(e=>e.identifier.value).join(",")}const WI=ae("IExtHostExtensionService");var eT,T7,tT;class jV{constructor(e,t,i,n,r){Ht(this,eT);Ht(this,T7);Ht(this,tT);St(this,eT,e),St(this,T7,t),St(this,tT,i.identifier),this.id=i.identifier.value,this.extensionUri=i.extensionLocation,this.extensionPath=Bk(i_(i.extensionLocation)),this.packageJSON=i,this.extensionKind=n,this.isFromDifferentExtensionHost=r}get isActive(){return Ce(this,eT).isActivated(Ce(this,tT))}get exports(){if(!(this.packageJSON.api==="none"||this.isFromDifferentExtensionHost))return Ce(this,eT).getExtensionExports(Ce(this,tT))}async activate(){if(this.isFromDifferentExtensionHost)throw new Error("Cannot activate foreign extension");return await Ce(this,eT).activateByIdWithErrors(Ce(this,tT),{startup:!1,extensionId:Ce(this,T7),activationEvent:"api"}),this.exports}}eT=new WeakMap,T7=new WeakMap,tT=new WeakMap;function Tot(s,e){return s.getAllExtensionDescriptions().filter(t=>e.has(t.identifier))}class xii{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 Dii{constructor(e){this._map=new ba,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 hFe=ae("IExtHostVariableResolverProvider");class kii extends cne{constructor(e,t,i,n,r,o,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 m$||d.input instanceof ale)return d.input.modified;if(d.input instanceof sle||d.input instanceof ole||d.input instanceof rle)return d.input.uri}}}super({getFolderUri:l=>{const d=o.folders.filter(h=>h.name===l);if(d&&d.length>0)return d[0].uri},getWorkspaceFolderCount:()=>o.folders.length,getConfigurationValue:(l,d)=>r.getConfiguration(void 0,l).get(d),getAppRoot:()=>M2(),getExecPath:()=>N2.VSCODE_EXEC_PATH,getFilePath:()=>{const l=c();if(l)return Bk(l.fsPath)},getWorkspaceFolderPathForFile:()=>{if(t){const l=c();if(l){const d=t.getWorkspaceFolder(l);if(d)return Bk(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(N2))}}let BIe=class extends V{constructor(e,t,i,n,r){super(),this.extensionService=e,this.workspaceService=t,this.editorService=i,this.configurationService=n,this.editorTabs=r,this._resolver=new Ca(async()=>{const o=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 kii(this.extensionService,this.workspaceService,this.editorService,this.editorTabs,o,c,this.homeDir())})}getResolver(){return this._resolver.value}homeDir(){}};BIe=D([_(0,WI),_(1,dE),_(2,s4),_(3,hE),_(4,xG)],BIe);var s$e;(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"})(s$e||(s$e={}));var r$e;(function(s){s.List="list",s.Tree="true"})(r$e||(r$e={}));var o$e;(function(s){s.ByLocation="location",s.ByStatus="status",s.ByDuration="duration"})(o$e||(o$e={}));Un.Errored+"",g(4063,"Errored"),Un.Failed+"",g(4064,"Failed"),Un.Passed+"",g(4065,"Passed"),Un.Queued+"",g(4066,"Queued"),Un.Running+"",g(4067,"Running"),Un.Skipped+"",g(4068,"Skipped"),Un.Unset+"",g(4069,"Not yet run");Qh.Debug+"",g(4071,"Debug"),Qh.Run+"",g(4072,"Run"),Qh.Coverage+"",g(4073,"Coverage");var WIe;(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"})(WIe||(WIe={}));let Iii=0;const a$e=new WeakMap,kle=ae("IExtHostTesting");let HIe=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(We.MainThreadTesting),this.observer=new Pii(this.proxy),this.runTracker=new Rii(this.proxy,t),i.registerArgumentProcessor({processArgument:r=>{switch(r?.$mid){case ys.TestItemContext:{const o=r,a=o.tests[o.tests.length-1].item.extId;return this.controllers.get(bn.root(a))?.collection.tree.get(a)?.actual??j9e(r)}case ys.TestMessageMenuArgs:{const{test:o,message:a}=r,c=o.item.extId;return{test:this.controllers.get(bn.root(c))?.collection.tree.get(c)?.actual??j9e({$mid:ys.TestItemContext,tests:[o]}),message:jH.to(a)}}default:return r}}}),i.registerCommand(!1,"testing.getExplorerSelection",async()=>{const r=await i.executeCommand(WIe.GetExplorerSelection),o=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:r?.include.map(o).filter(Oc)||[],exclude:r?.exclude.map(o).filter(Oc)||[]}})}createTestController(e,t,i,n){if(this.controllers.has(t))throw new Error(`Attempt to insert a duplicate controller with ID "${t}"`);const r=new Z,o=r.add(new nii(t,i,this.editors));o.root.label=i;const a=new Map,c=new Set,l=this.proxy,d=()=>{let f=0;n&&(f|=mz.Refresh);const p=u.relatedCodeProvider;return p&&(p?.provideRelatedTests&&(f|=mz.TestRelatedToCode),p?.provideRelatedCode&&(f|=mz.CodeRelatedToTest)),f},h={items:o.root.children,get label(){return i},set label(f){i=f,o.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){ze(e,"testRelatedCode"),u.relatedCodeProvider=f,l.$updateController(t,{capabilities:d()})},createRunProfile:(f,p,m,v,b,w)=>{let y=Hc(f);for(;a.has(y);)y++;return new Rot(this.proxy,a,c,this.defaultProfilesChangedEmitter.event,t,y,f,p,m,v,b,w)},createTestItem(f,p,m){return new tP(t,f,p,m)},createTestRun:(f,p,m=!0)=>this.runTracker.createTestRun(e,t,o,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=>bn.fromExtHostTestItem(m,t).toString()))}},set resolveHandler(f){o.resolveHandler=f},get resolveHandler(){return o.resolveHandler},dispose:()=>{r.dispose()}},u={controller:h,collection:o,profiles:a,extension:e,activeProfiles:c};return l.$registerTestController(t,i,d()),r.add(Ee(()=>l.$unregisterTestController(t))),this.controllers.set(t,u),r.add(Ee(()=>this.controllers.delete(t))),r.add(o.onDidGenerateDiff(f=>l.$publishDiff(t,f.map(HH.serialize)))),h}createTestObserver(){return this.observer.checkout()}async runTests(e,t=Ue.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:uFe[i.kind],targets:[{testIds:e.include?.map(r=>bn.fromExtHostTestItem(r,n.collection.root.id).toString())??[n.collection.root.id],profileId:i.profileId,controllerId:i.controllerId}],exclude:e.exclude?.map(r=>r.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 r=Yr.to(t),o=[];return await Promise.all([...this.controllers.values()].map(async a=>{let c;try{c=await a.relatedCodeProvider?.provideRelatedTests?.(n.document,r,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)o.push(bn.fromExtHostTestItem(l,a.controller.id).toString());a.collection.flushDiff()}})),o}async $getCodeRelatedToTest(e,t){const i=this.controllers.get(bn.root(e));if(!i)return[];const n=i.collection.tree.get(e);return n?(await i.relatedCodeProvider?.provideRelatedCode?.(n.actual,t))?.map(ff.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(uie.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 r=this.controllers.get(i);if(!r)continue;const o=new Map,a=n.filter(l=>!r.activeProfiles.has(l)),c=[...r.activeProfiles].filter(l=>!n.includes(l));for(const l of a)o.set(l,!0),r.activeProfiles.add(l);for(const l of c)o.set(l,!1),r.activeProfiles.delete(l);o.size&&t.set(i,o)}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=wxe.to(t);return a$e.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=>HH.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 li(t),n=await Promise.all(e.map(r=>this.runControllerTestRequest(r,!0,i.token)));return!t.isCancellationRequested&&!n.some(r=>r.error)&&await new Promise(r=>t.onCancellationRequested(r)),i.dispose(!0),n}async $provideTestFollowups(e,t){const i=this.results.find(o=>a$e.get(o)===e.resultId),n=i&&Fii(bn.fromString(e.extId),i?.results);if(!n)return[];let r=[];return await Promise.all([...this.followupProviders].map(async o=>{try{const a=await o.provideFollowup(i,n,e.taskIndex,e.messageIndex,t);a&&(r=r.concat(a))}catch(a){this.logService.error("Error thrown while providing followup for test message",a)}})),t.isCancellationRequested?[]:r.map(o=>{const a=Iii++;return this.testFollowups.set(a,o),{title:o.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:r,profiles:o,extension:a}=n,c=o.get(e.profileId);if(!c)return{};const l=e.testIds.map(f=>r.tree.get(f)).filter(Oc),d=e.excludeExtIds.map(f=>n.collection.tree.get(f)).filter(Oc).filter(f=>l.some(p=>p.fullId.compare(f.fullId)===Hv.IsChild));if(!l.length)return{};const h=new p$(l.some(f=>f.actual instanceof nFe)?void 0:l.map(f=>f.actual),d.map(f=>f.actual),c,t),u=Sjt(e)&&this.runTracker.prepareForMainThreadTestRun(a,h,l7.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)}}};HIe=D([_(0,Jr),_(1,Ke),_(2,iP),_(3,s4)],HIe);const Tii=1e4;var KE;(function(s){s[s.Running=0]="Running",s[s.Cancelling=1]="Cancelling",s[s.Ended=2]="Ended"})(KE||(KE={}));class Lii extends V{get hasRunningTasks(){return this.running>0}get id(){return this.dto.id}constructor(e,t,i,n,r,o){super(),this.dto=e,this.proxy=t,this.logService=i,this.profile=n,this.extension=r,this.state=KE.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 li(o));const a=this._register(new ln(()=>this.forciblyEndTasks(),Tii));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===KE.Running?(this.cts.cancel(),this.state=KE.Cancelling):this.state===KE.Cancelling&&this.forciblyEndTasks()}async getCoverageDetails(e,t,i){const[,n]=bn.fromString(e).path,r=this.publishedCoverage.get(e);if(!r)return[];const{report:o,extIds:a}=r,c=this.tasks.get(n);if(!c)throw new Error("unreachable: run task was not found");let l;if(t&&o instanceof mN){const h=a.indexOf(t);if(h===-1)return[];l=o.fromTests[h]}return await(l?this.profile?.loadDetailedCoverageForTest?.(c.run,o,l,i):this.profile?.loadDetailedCoverage?.(c.run,o,i))??[]}createRun(e){const t=this.dto.id,i=this.dto.controllerId,n=ao(),r=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)},o=(l,d)=>{const h=d instanceof Array?d.map(jH.from):[jH.from(d)];if(l.uri&&l.range){const u={range:tt.from(l.range),uri:l.uri};for(const f of h)f.location=f.location||u}this.proxy.$appendTestMessagesInRun(t,n,bn.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 mN?l.fromTests:[];if(d.length){ze(this.extension,"attributableCoverage");for(const f of d)this.ensureTestIsKnown(f)}const h=l.uri.toString(),u=new bn([t,n,h]).toString();this.publishedCoverage.set(u,{report:l,extIds:d.map(f=>bn.fromExtHostTestItem(f,i).toString())}),this.proxy.$appendCoverage(t,n,uie.fromFile(i,u,l))},enqueued:r(l=>{this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,i).toString(),Un.Queued)}),skipped:r(l=>{this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,i).toString(),Un.Skipped)}),started:r(l=>{this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,i).toString(),Un.Running)}),errored:r((l,d,h)=>{o(l,d),this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,i).toString(),Un.Errored,h)}),failed:r((l,d,h)=>{o(l,d),this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,i).toString(),Un.Failed,h)}),passed:r((l,d)=>{this.proxy.$updateTestStateInRun(t,n,bn.fromExtHostTestItem(l,this.dto.controllerId).toString(),Un.Passed,d)}),appendOutput:(l,d,h)=>{a||(h&&this.ensureTestIsKnown(h),this.proxy.$appendOutputToRun(t,n,Ge.fromString(l),d&&ff.from(d),h&&bn.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!==KE.Ended&&(this.state=KE.Ended,this.endEmitter.fire())}ensureTestIsKnown(e){if(!(e instanceof tP))throw new qte(e.id);if(this.sharedTestIds.has(bn.fromExtHostTestItem(e,this.dto.controllerId).toString()))return;const t=[],i=this.dto.colllection.root;for(;;){const n=CI.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 Rii{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=bn.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,r){return this.getTracker(t,i,n,e,r)}cancelRunById(e){this.trackedById.get(e)?.cancel()}cancelAllRuns(){for(const e of this.tracked.values())e.cancel()}createTestRun(e,t,i,n,r,o){const a=this.tracked.get(n);if(a)return a.createRun(r);const c=l7.fromPublic(t,i,n,o),l=Lot(n);this.proxy.$startedExtensionTestRun({controllerId:t,continuous:!!n.continuous,profile:l&&{group:uFe[l.kind],id:l.profileId},exclude:n.exclude?.map(h=>bn.fromExtHostTestItem(h,i.root.id).toString())??[],id:c.id,include:n.include?.map(h=>bn.fromExtHostTestItem(h,i.root.id).toString())??[i.root.id],preserveFocus:n.preserveFocus??!0,persist:o});const d=this.getTracker(n,c,n.profile,e);return M.once(d.onEnd)(()=>{this.proxy.$finishedExtensionTestRun(c.id)}),d.createRun(r)}getTracker(e,t,i,n,r){const o=new Lii(t,this.proxy,this.logService,i,n,r);return this.tracked.set(e,o),this.trackedById.set(o.id,o),o}}const Lot=s=>{if(s.profile){if(!(s.profile instanceof Rot))throw new Error("TestRunRequest.profile is not an instance created from TestController.createRunProfile");return s.profile}};class l7{static fromPublic(e,t,i,n){return new l7(e,ao(),n,t)}static fromInternal(e,t){return new l7(e.controllerId,e.runId,!0,t)}constructor(e,t,i,n){this.controllerId=e,this.id=t,this.isPersisted=i,this.colllection=n}}class Mii{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,CI.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(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 Nii extends Ejt{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:CI.toPlain(e.item),depth:t?t.depth+1:0,children:new Set}}createChangeCollector(){return new Mii(this.changeEmitter)}}class Pii{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:fm(()=>{--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 Nii({asCanonicalUri:t=>t});return this.proxy.$subscribeToDiffs(),{observers:0,tests:e}}}const U4=(s,e,t,i)=>{t?Object.assign(t,i):e.$updateTestRunConfig(s.controllerId,s.profileId,i)};var zv,iT,L7,Op,r2;class Rot{constructor(e,t,i,n,r,o,a,c,l,d=!1,h=void 0,u=!1){Ht(this,zv);Ht(this,iT);Ht(this,L7);Ht(this,Op);Ht(this,r2);this.controllerId=r,this.profileId=o,this._label=a,this.kind=c,this.runHandler=l,this._tag=h,this._supportsContinuousRun=u,St(this,zv,e),St(this,r2,t),St(this,iT,i),St(this,L7,n),t.set(o,this);const f=uFe[c];if(typeof f!="number")throw new Error(`Unknown TestRunProfile.group ${c}`);d&&i.add(o),St(this,Op,{profileId:o,controllerId:r,tag:h?$b.namespace(this.controllerId,h.id):null,label:a,group:f,isDefault:d,hasConfigurationHandler:!1,supportsContinuousRun:u}),queueMicrotask(()=>{Ce(this,Op)&&(Ce(this,zv).$publishTestRunProfile(Ce(this,Op)),St(this,Op,void 0))})}get label(){return this._label}set label(e){e!==this._label&&(this._label=e,U4(this,Ce(this,zv),Ce(this,Op),{label:e}))}get supportsContinuousRun(){return this._supportsContinuousRun}set supportsContinuousRun(e){e!==this._supportsContinuousRun&&(this._supportsContinuousRun=e,U4(this,Ce(this,zv),Ce(this,Op),{supportsContinuousRun:e}))}get isDefault(){return Ce(this,iT).has(this.profileId)}set isDefault(e){e!==this.isDefault&&(e?Ce(this,iT).add(this.profileId):Ce(this,iT).delete(this.profileId),U4(this,Ce(this,zv),Ce(this,Op),{isDefault:e}))}get tag(){return this._tag}set tag(e){e?.id!==this._tag?.id&&(this._tag=e,U4(this,Ce(this,zv),Ce(this,Op),{tag:e?$b.namespace(this.controllerId,e.id):null}))}get configureHandler(){return this._configureHandler}set configureHandler(e){e!==this._configureHandler&&(this._configureHandler=e,U4(this,Ce(this,zv),Ce(this,Op),{hasConfigurationHandler:!!e}))}get onDidChangeDefault(){return M.chain(Ce(this,L7),e=>e.map(t=>t.get(this.controllerId)?.get(this.profileId)).filter(Oc))}dispose(){Ce(this,r2)?.delete(this.profileId)&&(St(this,r2,void 0),Ce(this,zv).$removeTestProfile(this.controllerId,this.profileId)),St(this,Op,void 0)}}zv=new WeakMap,iT=new WeakMap,L7=new WeakMap,Op=new WeakMap,r2=new WeakMap;const uFe={[tL.Coverage]:Qh.Coverage,[tL.Debug]:Qh.Debug,[tL.Run]:Qh.Run};function Fii(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 Mot=ae("IExtHostDebugService");let UIe=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,r,o,a,c){super(),this._workspaceService=t,this._extensionService=i,this._configurationService=n,this._editorTabs=r,this._variableResolver=o,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(We.MainThreadDebugService),this._onDidChangeBreakpoints=this._register(new I),this._onDidChangeActiveStackItem=this._register(new I),this._activeDebugConsole=new Bii(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=An.toKey(e.identifier),r=this.extensionVisKey(n,t);if(this._debugVisualizationProviders.has(r))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationTrees.set(r,i),this._debugServiceProxy.$registerDebugVisualizerTree(r,!!i.editItem),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizerTree(r),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(r=>this.convertVisualizerTreeItem(e,r))||[]:[]}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 r of n)i.push(this._debugVisualizationElements.get(r)?.children),this._debugVisualizationElements.delete(r)}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})),Ixe.from(t,i)}asDebugSourceUri(e,t){const i=e;if(typeof i.sourceReference=="number"&&i.sourceReference>0){let n=`debug:${encodeURIComponent(i.path||"")}`,r="?";return t&&(n+=`${r}session=${encodeURIComponent(t.id)}`,r="&"),n+=`${r}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 r of n)NQt(r)&&t.push(r.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:r,extensionId:o}=i;if(n.visualization||(n=await r.resolveDebugVisualization?.(n,t)||n,i.v=n),!n.visualization)throw new Error(`No visualization returned from resolveDebugVisualization in '${r}'`);return this.serializeVisualization(o,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 r=this.hydrateVisualizationContext(i),o=this.extensionVisKey(e,t),a=this._debugVisualizationProviders.get(o);if(!r||!a)return[];const c=await a.provideDebugVisualization(r,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(o=>o.id===t))throw new Error(`Extensions may only call registerDebugVisualizationProvider() for renderers they contribute (got ${t})`);const n=An.toKey(e.identifier),r=this.extensionVisKey(n,t);if(this._debugVisualizationProviders.has(r))throw new Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationProviders.set(r,i),this._debugServiceProxy.$registerDebugVisualizer(n,t),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizer(n,t),this._debugVisualizationProviders.delete(t)})}addBreakpoints(e){const t=e.filter(r=>{const o=r.id;return this._breakpoints.has(o)?!1:(this._breakpoints.set(o,r),!0)});this.fireBreakpointChanges(t,[],[]);const i=[],n=new Map;for(const r of t)if(r instanceof qx){let o=n.get(r.location.uri.toString());o||(o={type:"sourceMulti",uri:r.location.uri,lines:[]},n.set(r.location.uri.toString(),o),i.push(o)),o.lines.push({id:r.id,enabled:r.enabled,condition:r.condition,hitCondition:r.hitCondition,logMessage:r.logMessage,line:r.location.range.start.line,character:r.location.range.start.character,mode:r.mode})}else r instanceof Qx&&i.push({type:"function",id:r.id,enabled:r.enabled,hitCondition:r.hitCondition,logMessage:r.logMessage,condition:r.condition,functionName:r.functionName,mode:r.mode});return this._debugServiceProxy.$registerBreakpoints(i)}removeBreakpoints(e){const t=e.filter(o=>this._breakpoints.delete(o.id));this.fireBreakpointChanges([],t,[]);const i=t.filter(o=>o instanceof qx).map(o=>o.id),n=t.filter(o=>o instanceof Qx).map(o=>o.id),r=t.filter(o=>o instanceof hte).map(o=>o.id);return this._debugServiceProxy.$unregisterBreakpoints(i,n,r)}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===c$.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 js(()=>{});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 js(()=>{this._configProviders=this._configProviders.filter(r=>r.provider!==t),this._debugServiceProxy.$unregisterDebugConfigurationProvider(n)})}registerDebugAdapterDescriptorFactory(e,t,i){if(!i)return new js(()=>{});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 js(()=>{this._adapterFactories=this._adapterFactories.filter(r=>r.factory!==i),this._debugServiceProxy.$unregisterDebugAdapterDescriptorFactory(n)})}registerDebugAdapterTrackerFactory(e,t){if(!t)return new js(()=>{});const i=this._trackerFactoryHandleCounter++;return this._trackerFactories.push({type:e,handle:i,factory:t}),new js(()=>{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 Hii(e.implementation)}createSignService(){}async $startDASession(e,t){const i=this,n=await this.getSession(t);return this.getAdapterDescriptor(this.getAdapterDescriptorFactoryByType(n.type),n).then(r=>{if(!r)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${n.type}' (extension might have failed to activate)`);const o=this.convertToDto(r),a=this.createDebugAdapter(o,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=irt(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=trt(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 r of e.added){const o=r.id;if(o&&!this._breakpoints.has(o)){let a;if(r.type==="function")a=new Qx(r.functionName,r.enabled,r.condition,r.hitCondition,r.logMessage,r.mode);else if(r.type==="data")a=new hte(r.label,r.dataId,r.canPersist,r.enabled,r.hitCondition,r.condition,r.logMessage,r.mode);else{const c=N.revive(r.uri);a=new qx(new Ap(c,new ws(r.line,r.character)),r.enabled,r.condition,r.hitCondition,r.logMessage,r.mode)}p7t(a,o),this._breakpoints.set(o,a),t.push(a)}}if(e.removed)for(const r of e.removed){const o=this._breakpoints.get(r);o&&(this._breakpoints.delete(r),i.push(o))}if(e.changed){for(const r of e.changed)if(r.id){const o=this._breakpoints.get(r.id);if(o){if(o instanceof Qx&&r.type==="function"){const a=o;a.enabled=r.enabled,a.condition=r.condition,a.hitCondition=r.hitCondition,a.logMessage=r.logMessage,a.functionName=r.functionName}else if(o instanceof qx&&r.type==="source"){const a=o;a.enabled=r.enabled,a.condition=r.condition,a.hitCondition=r.hitCondition,a.logMessage=r.logMessage,a.location=new Ap(N.revive(r.uri),new ws(r.line,r.character))}n.push(o)}}}this.fireBreakpointChanges(t,i,n)}async $acceptStackFrameFocus(e){let t;if(e){const i=await this.getSession(e.sessionId);e.kind==="thread"?t=new _Pe(i.api,e.threadId):t=new mPe(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 r=await this.getFolder(t);return n.provideDebugConfigurations(r,i)}).then(n=>{if(!n)throw new Error("nothing returned from DebugConfigurationProvider.provideDebugConfigurations");return n})}$resolveDebugConfiguration(e,t,i,n){return Jh(async()=>{const r=this.getConfigProviderByHandle(e);if(!r)throw new Error("no DebugConfigurationProvider found");if(!r.resolveDebugConfiguration)throw new Error("DebugConfigurationProvider has no method resolveDebugConfiguration");const o=await this.getFolder(t);return r.resolveDebugConfiguration(o,i,n)})}$resolveDebugConfigurationWithSubstitutedVariables(e,t,i,n){return Jh(async()=>{const r=this.getConfigProviderByHandle(e);if(!r)throw new Error("no DebugConfigurationProvider found");if(!r.resolveDebugConfigurationWithSubstitutedVariables)throw new Error("DebugConfigurationProvider has no method resolveDebugConfigurationWithSubstitutedVariables");const o=await this.getFolder(t);return r.resolveDebugConfigurationWithSubstitutedVariables(o,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(r=>{if(!r)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${n.type}'`);return this.convertToDto(r)})}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 t$)return{type:"executable",command:e.command,args:e.args,options:e.options};if(e instanceof vH)return{type:"server",port:e.port,host:e.host};if(e instanceof i$)return{type:"pipeServer",path:e.path};if(e instanceof n$)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(r=>r.type===i||r.type==="*").map(r=>Jh(()=>r.factory.createDebugAdapterTracker(e.api)).then(o=>o,o=>null));return Promise.race([Promise.all(n).then(r=>{const o=Oi(r);if(o.length>0)return new Wii(o)}),new Promise(r=>setTimeout(()=>r(void 0),1e3))]).catch(r=>{})}async getAdapterDescriptor(e,t){const i=t.configuration.debugServer;if(typeof i=="number")return Promise.resolve(new vH(i));if(e){const r=await this._extensionService.getExtensionRegistry();return Jh(()=>e.createDebugAdapterDescriptor(t.api,this.daExecutableFromPackage(t,r))).then(o=>{if(o)return o})}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 Oii(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:gee.Command};if("treeId"in t)return{type:gee.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=He.asClassName(t):i=t,{iconPath:i,iconClass:n}}getIconUris(e){if(e instanceof fu)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}}};UIe=D([_(0,Jr),_(1,dE),_(2,WI),_(3,hE),_(4,xG),_(5,hFe),_(6,iP),_(7,kle)],UIe);class Oii{constructor(e,t,i,n,r,o,a){this._debugServiceProxy=e,this._id=t,this._type=i,this._name=n,this._workspaceFolder=r,this._configuration=o,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 Bii{constructor(e){this.value=Object.freeze({append(t){e.$appendDebugConsole(t)},appendLine(t){this.append(t+` +`)}})}}class Wii{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 Hii extends Yst{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 VIe=class extends UIe{constructor(e,t,i,n,r,o,a,c){super(e,t,i,n,r,o,a,c)}};VIe=D([_(0,Jr),_(1,dE),_(2,WI),_(3,hE),_(4,xG),_(5,hFe),_(6,iP),_(7,kle)],VIe);class Uii{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&&X_(e.includePattern),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&X_(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 r=o=>{this.resultCount++,e(o)};if(this.isCanceled)return i({limitHit:this.isLimitHit});this.config.extraFileResources&&this.config.extraFileResources.forEach(o=>{const a=o.toString(),c=Kr(a);this.globalExcludePattern&&this.globalExcludePattern(a,c)||this.matchFile(r,{base:o,basename:c})}),Promise.all(t.map(o=>this.searchInFolder(o,r))).then(o=>{i({limitHit:this.isLimitHit,stats:o[0]||void 0})},o=>{n(new Error(Po(o)))})})}async searchInFolder(e,t){const i=new li,n=this.getSearchOptionsForFolder(e),r=this.initDirectoryTree(),o=new sst(this.config,e),a=!o.hasSiblingExcludeClauses();let c;try{this.activeCancellationTokens.add(i),c=Ys.create();const l=await this.provider.provideFileSearchResults({pattern:this.config.filePattern||""},n,i.token),d=c.elapsed(),h=Ys.create();return this.isCanceled&&!this.isLimitHit||(l&&l.forEach(u=>{const f=zi.relative(e.folder.path,u.path);if(a){const p=Kr(u.path);this.matchFile(t,{base:e.folder,relativePath:f,basename:p});return}this.addDirectoryEntries(r,e.folder,f,t)}),this.isCanceled&&!this.isLimitHit)?null:(this.matchDirectoryTree(r,o,t),{providerTime:d,postProcessTime:h.elapsed()})}finally{i.dispose(),this.activeCancellationTokens.delete(i)}}getSearchOptionsForFolder(e){const t=Pee(this.config.includePattern,e.includePattern),i=Pee(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 o=Kr(this.filePattern);this.matchFile(n,{base:t,relativePath:this.filePattern,basename:o})}function r(o){const a=Kr(o),c=xb(o);let l=e[c];l||(l=e[c]=[],r(c)),l.push({base:t,relativePath:o,basename:a})}r(i)}matchDirectoryTree({rootEntries:e,pathToEntries:t},i,n){const r=this,o=this.filePattern;function a(c){const l=B9t(()=>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 xoe=class xoe{constructor(){this.sessions=new Map}fileSearch(e,t,i,n){const r=this.getSessionTokenSource(e.cacheKey),o=new Uii(e,t,r&&r.token);let a=0;const c=l=>{a+=l.length,i(l.map(d=>this.rawMatchToSearchItem(d)))};return this.doSearch(o,xoe.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 li),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:Ft(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,i,n){const r=n.onCancellationRequested(()=>{e.cancel()}),o=c=>{c&&(a.push(c),t>0&&a.length>=t&&(i(a),a=[]))};let a=[];return e.search(o).then(c=>(a.length&&i(a),r.dispose(),c),c=>(a.length&&i(a),r.dispose(),Promise.reject(c)))}};xoe.BATCH_SIZE=512;let zIe=xoe;class c$e{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 li(t);return new Promise((r,o)=>{this.collector=new zii(e);let a=!1;const c=(l,d)=>{if(!a&&!this.isLimitHit){const h=this.resultSize(l);YV(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||!YV(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);r({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=Po(l);o(new Error(d))})})}resultSize(e){return YV(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 sst(this.query,e),r=[],o={report:l=>{if(!this.validateProviderResult(l))return;const d=e.folder.scheme===pe.file?O9t(()=>this.fileUtils.readdir(Ro(l.uri))):void 0,h=MN(e.folder,l.uri);if(h){const u=n.includedInQuery(h,Kr(h),d);Xy(u)?r.push(u.then(f=>{f&&t(l)})):u&&t(l)}}},a=this.getSearchOptionsForFolder(e);let c;return this.queryProviderPair.query.type===fI.aiText?c=await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,a,o,i):c=await this.queryProviderPair.provider.provideTextSearchResults(Vii(this.queryProviderPair.query.contentPattern),a,o,i),r.length&&await Promise.all(r),c}validateProviderResult(e){if(YV(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=Pee(this.query.includePattern,e.includePattern),i=Pee(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??I9t,previewOptions:this.query.previewOptions,afterContext:this.query.afterContext,beforeContext:this.query.beforeContext};return"usePCRE2"in this.query&&(n.usePCRE2=this.query.usePCRE2),n}}function Vii(s){return{isCaseSensitive:s.isCaseSensitive||!1,isRegExp:s.isRegExp||!1,isWordMatch:s.isWordMatch||!1,isMultiline:s.isMultiline||!1,pattern:s.pattern}}class zii{constructor(e){this._onResult=e,this._currentFolderIdx=-1,this._currentFileMatch=null,this._batchedCollector=new $Ie(512,t=>this.sendItems(t))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!Yi(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||(this._currentFolderIdx=t,this._currentFileMatch={resource:e.uri,results:[]}),this._currentFileMatch.results.push($ii(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 $ii(s){return YV(s)?{preview:{matches:h8(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:h8(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 YV(s){return!!s.preview}const IO=class IO{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()},IO.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))}};IO.TIMEOUT=4e3,IO.START_BATCH_AFTER_COUNT=50;let $Ie=IO;const Not=ae("IExtHostSearch");let GIe=class{constructor(e,t,i){this.extHostRpc=e,this._uriTransformer=t,this._logService=i,this._proxy=this.extHostRpc.getProxy(We.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 zIe}_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 r=_ge(i),o=this._fileSearchProvider.get(e);if(o)return this._fileSearchManager.fileSearch(r,o,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 r=this._textSearchProvider.get(e);if(!r||!r.provideTextSearchResults)throw new Error(`Unknown Text Search Provider ${e}`);const o=_ge(i);return this.createTextSearchManager(o,r).search(c=>this._proxy.$handleTextMatch(e,t,c),n)}$provideAITextSearchResults(e,t,i,n){const r=this._aiTextSearchProvider.get(e);if(!r||!r.provideAITextSearchResults)throw new Error(`Unknown AI Text Search Provider ${e}`);const o=_ge(i);return this.createAITextSearchManager(o,r).search(c=>this._proxy.$handleTextMatch(e,t,c),n)}$enableExtensionHostSearch(){}createTextSearchManager(e,t){return new c$e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"textSearchProvider")}createAITextSearchManager(e,t){return new c$e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"aiTextSearchProvider")}};GIe=D([_(0,Jr),_(1,Ale),_(2,Ke)],GIe);function _ge(s){return{...s,folderQueries:s.folderQueries&&s.folderQueries.map(Gii),extraFileResources:s.extraFileResources&&s.extraFileResources.map(e=>N.revive(e))}}function Gii(s){return{...s,folder:N.revive(s.folder)}}var KIe,pM;let qIe=(pM=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=KIe.InitialState,this._proxy=e.getProxy(We.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 Qu(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(Qu(e.scheme))return Promise.reject("Invalid scheme - cannot be empty");const i=await this._proxy.$asExternalUri(e,t);return N.from(i)}},KIe=pM,pM.InitialState={focused:!0,active:!0},pM);qIe=KIe=D([_(0,Jr)],qIe);const Pot=ae("IExtHostWindow");let vne=class extends Wje{constructor(e,t){super(t.logLevel,t.logsLocation,t.loggers.map(i=>Mr(i))),this._proxy=e.getProxy(We.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 Kii(this._proxy,e,t,i)}};vne=D([_(0,Jr),_(1,bu)],vne);class Kii extends xae{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 QIe=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(We.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 qii(t.value,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(e,n),n.store.add(t.onWillDispose(()=>this._activeShellIntegrations.get(e)?.dispose())),n.store.add(n.onDidRequestShellExecution(r=>this._proxy.$executeCommand(e,r))),n.store.add(n.onDidRequestEndExecution(r=>this._onDidEndTerminalShellExecution.fire(r))),n.store.add(n.onDidRequestChangeShellIntegration(r=>this._onDidChangeTerminalShellIntegration.fire(r))),t.shellIntegration=n.value),this._onDidChangeTerminalShellIntegration.fire({terminal:i,shellIntegration:n.value})}$shellExecutionStart(e,t,i,n,r){this._activeShellIntegrations.has(e)||this.$shellIntegrationChange(e);const o={value:t,confidence:i,isTrusted:n};this._activeShellIntegrations.get(e)?.startShellExecution(o,N.revive(r))}$shellExecutionEnd(e,t,i,n,r){const o={value:t,confidence:i,isTrusted:n};this._activeShellIntegrations.get(e)?.endShellExecution(o,r)}$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)}};QIe=D([_(0,Jr),_(1,r4)],QIe);class qii 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,r){let o=n;r&&(o+=` "${r.map(l=>`${l.replaceAll('"','\\"')}`).join('" "')}"`),i._onDidRequestShellExecution.fire(o);const a={value:o,confidence:CD.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 Qii(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 Qii{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 Yd.EMPTY;this._dataStream=new jii}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 jii extends V{constructor(){super(...arguments),this._emitters=[]}createIterable(){this._barrier||(this._barrier=new jd);const e=this._barrier;return new Yd(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(lFe,NIe,Qt.Delayed);ce(pf,vne,Qt.Delayed);ce(xle,wIe,Qt.Delayed);ce(iP,fIe,Qt.Eager);ce(oFe,LIe,Qt.Eager);ce(aFe,MIe,Qt.Eager);ce(hE,uIe,Qt.Eager);ce(Sle,cIe,Qt.Eager);ce(kle,HIe,Qt.Eager);ce(Mot,VIe,Qt.Eager);ce(yot,hIe,Qt.Eager);ce(s4,_Ie,Qt.Eager);ce(dFe,PIe,Qt.Eager);ce(n4,Gti,Qt.Eager);ce(bot,lIe,Qt.Delayed);ce(Not,GIe,Qt.Eager);ce(sFe,xot,Qt.Eager);ce(Eot,xIe,Qt.Eager);ce(r4,bIe,Qt.Eager);ce(Fot,QIe,Qt.Eager);ce(KPe,ADe,Qt.Eager);ce(Pot,qIe,Qt.Eager);ce(dE,dIe,Qt.Eager);ce(cFe,kot,Qt.Eager);ce(Ele,gIe,Qt.Eager);ce(xG,DIe,Qt.Eager);ce(hFe,BIe,Qt.Eager);let jIe=class extends tXe{constructor(e,t,i){const n=i.remote.isRemote?"remoteexthost":e?"workerexthost":"exthost",r=i.remote.isRemote?g(578,"Extension Host (Remote)"):e?g(579,"Extension Host (Worker)"):g(580,"Extension Host");super(t.createLogger(n,{name:r}))}};jIe=D([_(1,pf),_(2,bu)],jIe);class l$e{static async installEarlyHandler(e){Error.stackTraceLimit=100;const t=e.get(Ke),n=e.get(Jr).getProxy(We.MainThreadErrors);gfe(r=>{t.error(r);const o=kA(r);n.$onUnexpectedError(o)})}static async installFullHandler(e){const t=e.get(Ke),i=e.get(Jr),n=e.get(WI),r=e.get(Ele),o=i.getProxy(We.MainThreadExtensionService),a=i.getProxy(We.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})}}),gfe(f=>{t.error(f);const p=kA(f),m=l.get(f);if(!m?.extensionIdentifier){a.$onUnexpectedError(p);return}o.$onExtensionRuntimeError(m.extensionIdentifier,p);const v=r.onExtensionError(m.extensionIdentifier,f);t.trace("forwarded error to extension?",v,m)})}}class gFe{constructor(e,t,i,n,r){this._hostUtils=i,this._rpcProtocol=new kee(e,null,n),t=gFe._transform(t,this._rpcProtocol);const o=new Vc(...zpe());o.set(bu,{_serviceBrand:void 0,...t,messagePorts:r}),o.set(Jr,new nJt(this._rpcProtocol)),o.set(Ale,new qti(n)),o.set(Iot,i),o.set(Ke,new yi(jIe,[!0],!0)),o.set(pf,new yi(vne,[],!0));const a=new B3(o,!0);m8&&a.invokeFunction(l$e.installEarlyHandler),this._logService=a.invokeFunction(c=>c.get(Ke)),ls("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(WI)),this._extensionService.initialize(),m8&&a.invokeFunction(l$e.installFullHandler)}async asBrowserUri(e){const t=this._rpcProtocol.getProxy(We.MainThreadExtensionService);return N.revive(await t.$asBrowserUri(e))}async getAllStaticBrowserUris(){return(await this._rpcProtocol.getProxy(We.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 Yii{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(We.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 js(()=>{this._proxy.$unregisterAiRelatedInformationProvider(n),this._relatedInformationProviders.delete(n)})}}const Jii=[new fn("vscode.executeDocumentHighlights","_executeDocumentHighlights","Execute document highlight provider.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of DocumentHighlight-instances.",_v($H.to))),new fn("vscode.executeDocumentSymbolProvider","_executeDocumentSymbolProvider","Execute document symbol provider.",[ut.Uri],new sn("A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.",(s,e)=>{if(wU(s))return;class t extends cH{static to(n){const r=new t(n.name,rv.to(n.kind),n.containerName||"",new Ap(e[0],tt.to(n.range)));return r.detail=n.detail,r.range=r.location.range,r.selectionRange=tt.to(n.selectionRange),r.children=n.children?n.children.map(t.to):[],r}}return s.map(t.to)})),new fn("vscode.executeFormatDocumentProvider","_executeFormatDocumentProvider","Execute document format provider.",[ut.Uri,new ut("options","Formatting options",s=>!0,s=>s)],new sn("A promise that resolves to an array of TextEdits.",_v(ad.to))),new fn("vscode.executeFormatRangeProvider","_executeFormatRangeProvider","Execute range format provider.",[ut.Uri,ut.Range,new ut("options","Formatting options",s=>!0,s=>s)],new sn("A promise that resolves to an array of TextEdits.",_v(ad.to))),new fn("vscode.executeFormatOnTypeProvider","_executeFormatOnTypeProvider","Execute format on type provider.",[ut.Uri,ut.Position,new ut("ch","Trigger character",s=>typeof s=="string",s=>s),new ut("options","Formatting options",s=>!0,s=>s)],new sn("A promise that resolves to an array of TextEdits.",_v(ad.to))),new fn("vscode.executeDefinitionProvider","_executeDefinitionProvider","Execute all definition providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.experimental.executeDefinitionProvider_recursive","_executeDefinitionProvider_recursive","Execute all definition providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.executeTypeDefinitionProvider","_executeTypeDefinitionProvider","Execute all type definition providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.experimental.executeTypeDefinitionProvider_recursive","_executeTypeDefinitionProvider_recursive","Execute all type definition providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.executeDeclarationProvider","_executeDeclarationProvider","Execute all declaration providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.experimental.executeDeclarationProvider_recursive","_executeDeclarationProvider_recursive","Execute all declaration providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.executeImplementationProvider","_executeImplementationProvider","Execute all implementation providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.experimental.executeImplementationProvider_recursive","_executeImplementationProvider_recursive","Execute all implementation providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location or LocationLink instances.",yE)),new fn("vscode.executeReferenceProvider","_executeReferenceProvider","Execute all reference providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location-instances.",_v(ff.to))),new fn("vscode.experimental.executeReferenceProvider","_executeReferenceProvider_recursive","Execute all reference providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Location-instances.",_v(ff.to))),new fn("vscode.executeHoverProvider","_executeHoverProvider","Execute all hover providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Hover-instances.",_v(k$.to))),new fn("vscode.experimental.executeHoverProvider_recursive","_executeHoverProvider_recursive","Execute all hover providers.",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of Hover-instances.",_v(k$.to))),new fn("vscode.executeSelectionRangeProvider","_executeSelectionRangeProvider","Execute selection range provider.",[ut.Uri,new ut("position","A position in a text document",s=>Array.isArray(s)&&s.every(e=>ws.isPosition(e)),s=>s.map(Yr.from))],new sn("A promise that resolves to an array of ranges.",s=>s.map(e=>{let t;for(const i of e.reverse())t=new hH(tt.to(i),t);return t}))),new fn("vscode.executeWorkspaceSymbolProvider","_executeWorkspaceSymbolProvider","Execute all workspace symbol providers.",[ut.String.with("query","Search string")],new sn("A promise that resolves to an array of SymbolInformation-instances.",s=>s.map(x$.to))),new fn("vscode.prepareCallHierarchy","_executePrepareCallHierarchy","Prepare call hierarchy at a position inside a document",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of CallHierarchyItem-instances",s=>s.map(bN.to))),new fn("vscode.provideIncomingCalls","_executeProvideIncomingCalls","Compute incoming calls for an item",[ut.CallHierarchyItem],new sn("A promise that resolves to an array of CallHierarchyIncomingCall-instances",s=>s.map(sxe.to))),new fn("vscode.provideOutgoingCalls","_executeProvideOutgoingCalls","Compute outgoing calls for an item",[ut.CallHierarchyItem],new sn("A promise that resolves to an array of CallHierarchyOutgoingCall-instances",s=>s.map(rxe.to))),new fn("vscode.prepareRename","_executePrepareRename","Execute the prepareRename of rename provider.",[ut.Uri,ut.Position],new sn("A promise that resolves to a range and placeholder text.",s=>{if(s)return{range:tt.to(s.range),placeholder:s.text}})),new fn("vscode.executeDocumentRenameProvider","_executeDocumentRenameProvider","Execute rename provider.",[ut.Uri,ut.Position,ut.String.with("newName","The new symbol name")],new sn("A promise that resolves to a WorkspaceEdit.",s=>{if(s){if(s.rejectReason)throw new Error(s.rejectReason);return Zu.to(s)}})),new fn("vscode.executeLinkProvider","_executeLinkProvider","Execute document link provider.",[ut.Uri,ut.Number.with("linkResolveCount","Number of links that should be resolved, only when links are unresolved.").optional()],new sn("A promise that resolves to an array of DocumentLink-instances.",s=>s.map(sL.to))),new fn("vscode.provideDocumentSemanticTokensLegend","_provideDocumentSemanticTokensLegend","Provide semantic tokens legend for a document",[ut.Uri],new sn("A promise that resolves to SemanticTokensLegend.",s=>{if(s)return new mte(s.tokenTypes,s.tokenModifiers)})),new fn("vscode.provideDocumentSemanticTokens","_provideDocumentSemanticTokens","Provide semantic tokens for a document",[ut.Uri],new sn("A promise that resolves to SemanticTokens.",s=>{if(!s)return;const e=pZ(s);if(e.type==="full")return new gN(e.data,void 0)})),new fn("vscode.provideDocumentRangeSemanticTokensLegend","_provideDocumentRangeSemanticTokensLegend","Provide semantic tokens legend for a document range",[ut.Uri,ut.Range.optional()],new sn("A promise that resolves to SemanticTokensLegend.",s=>{if(s)return new mte(s.tokenTypes,s.tokenModifiers)})),new fn("vscode.provideDocumentRangeSemanticTokens","_provideDocumentRangeSemanticTokens","Provide semantic tokens for a document range",[ut.Uri,ut.Range],new sn("A promise that resolves to SemanticTokens.",s=>{if(!s)return;const e=pZ(s);if(e.type==="full")return new gN(e.data,void 0)})),new fn("vscode.executeCompletionItemProvider","_executeCompletionItemProvider","Execute completion item provider.",[ut.Uri,ut.Position,ut.String.with("triggerCharacter","Trigger completion when the user types the character, like `,` or `(`").optional(),ut.Number.with("itemResolveCount","Number of completions to resolve (too large numbers slow down completions)").optional()],new sn("A promise that resolves to a CompletionList-instance.",(s,e,t)=>{if(!s)return new aN([]);const i=s.suggestions.map(n=>dxe.to(n,t));return new aN(i,s.incomplete)})),new fn("vscode.executeSignatureHelpProvider","_executeSignatureHelpProvider","Execute signature help provider.",[ut.Uri,ut.Position,ut.String.with("triggerCharacter","Trigger signature help when the user types the character, like `,` or `(`").optional()],new sn("A promise that resolves to SignatureHelp.",s=>{if(s)return I$.to(s)})),new fn("vscode.executeCodeLensProvider","_executeCodeLensProvider","Execute code lens provider.",[ut.Uri,ut.Number.with("itemResolveCount","Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)").optional()],new sn("A promise that resolves to an array of CodeLens-instances.",(s,e,t)=>_v(i=>new z9(tt.to(i.range),i.command&&t.fromInternal(i.command)))(s))),new fn("vscode.executeCodeActionProvider","_executeCodeActionProvider","Execute code action provider.",[ut.Uri,new ut("rangeOrSelection","Range in a text document. Some refactoring provider requires Selection object.",s=>Xn.isRange(s),s=>uC.isSelection(s)?zb.from(s):tt.from(s)),ut.String.with("kind","Code action kind to return code actions for").optional(),ut.Number.with("itemResolveCount","Number of code actions to resolve (too large numbers slow down code actions)").optional()],new sn("A promise that resolves to an array of Command-instances.",(s,e,t)=>_v(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 V9(i.title,i.kind?new Aa(i.kind):void 0);return i.edit&&(n.edit=Zu.to(i.edit)),i.command&&(n.command=t.fromInternal(i.command)),n.isPreferred=i.isPreferred,n}})(s))),new fn("vscode.executeDocumentColorProvider","_executeDocumentColorProvider","Execute document color provider.",[ut.Uri],new sn("A promise that resolves to an array of ColorInformation objects.",s=>s?s.map(e=>new j9(tt.to(e.range),GH.to(e.color))):[])),new fn("vscode.executeColorPresentationProvider","_executeColorPresentationProvider","Execute color presentation provider.",[new ut("color","The color to show and insert",s=>s instanceof dN,GH.from),new ut("context","Context object with uri and range",s=>!0,s=>({uri:s.uri,range:tt.from(s.range)}))],new sn("A promise that resolves to an array of ColorPresentation objects.",s=>s?s.map(rie.to):[])),new fn("vscode.executeInlayHintProvider","_executeInlayHintProvider","Execute inlay hints provider",[ut.Uri,ut.Range],new sn("A promise that resolves to an array of Inlay objects",(s,e,t)=>s.map(hxe.to.bind(void 0,t)))),new fn("vscode.executeFoldingRangeProvider","_executeFoldingRangeProvider","Execute folding range provider",[ut.Uri],new sn("A promise that resolves to an array of FoldingRange objects",(s,e)=>{if(s)return s.map(aie.to)})),new fn("vscode.resolveNotebookContentProviders","_resolveNotebookContentProvider","Resolve Notebook Content Providers",[],new sn("A promise that resolves to an array of NotebookContentProvider static info objects.",_v(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=>die.to(e))})))),new fn("vscode.executeInlineValueProvider","_executeInlineValueProvider","Execute inline value provider",[ut.Uri,ut.Range,new ut("context","An InlineValueContext",s=>s&&typeof s.frameId=="number"&&s.stoppedLocation instanceof Xn,s=>Zte.from(s))],new sn("A promise that resolves to an array of InlineValue objects",s=>s.map(Xte.to))),new fn("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 ut("uriOrString","Uri-instance or string (only http/https)",s=>N.isUri(s)||typeof s=="string"&&R8(s,pe.http,pe.https),s=>s),new ut("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"?[kl.from(s),void 0]:[kl.from(s.viewColumn),vz.from(s)])).optional(),ut.String.with("label","").optional()],sn.Void),new fn("vscode.openWith","_workbench.openWith","Opens the provided resource with a specific editor.",[ut.Uri.with("resource","Resource to open"),ut.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 ut("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"?[kl.from(s),void 0]:[kl.from(s.viewColumn),vz.from(s)])).optional()],sn.Void),new fn("vscode.diff","_workbench.diff","Opens the provided resources in the diff editor to compare their contents.",[ut.Uri.with("left","Left-hand side resource of the diff editor"),ut.Uri.with("right","Right-hand side resource of the diff editor"),ut.String.with("title","Human readable title for the diff editor").optional(),new ut("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",s=>s===void 0||typeof s=="object",s=>s&&[kl.from(s.viewColumn),vz.from(s)]).optional()],sn.Void),new fn("vscode.changes","_workbench.changes","Opens a list of resources in the changes editor to compare their contents.",[ut.String.with("title","Human readable title for the changes editor"),new ut("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)],sn.Void),new fn("vscode.prepareTypeHierarchy","_executePrepareTypeHierarchy","Prepare type hierarchy at a position inside a document",[ut.Uri,ut.Position],new sn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(rL.to))),new fn("vscode.provideSupertypes","_executeProvideSupertypes","Compute supertypes for an item",[ut.TypeHierarchyItem],new sn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(rL.to))),new fn("vscode.provideSubtypes","_executeProvideSubtypes","Compute subtypes for an item",[ut.TypeHierarchyItem],new sn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(rL.to))),new fn("vscode.revealTestInExplorer","_revealTestInExplorer","Reveals a test instance in the explorer",[ut.TestItem],sn.Void),new fn("vscode.experimental.editSession.continue","_workbench.editSessions.actions.continueEditSession","Continue the current edit session in a different workspace",[ut.Uri.with("workspaceUri","The target workspace to continue the current edit session in")],sn.Void),new fn("setContext","_setContext","Set a custom context key value that can be used in when clauses.",[ut.String.with("name","The context key name"),new ut("value","The context key value",()=>!0,s=>s)],sn.Void),new fn("vscode.executeMappedEditsProvider","_executeMappedEditsProvider","Execute Mapped Edits Provider",[ut.Uri,ut.StringArray,new ut("MappedEditsContext","Mapped Edits Context",s=>lie.is(s),s=>lie.from(s))],new sn("A promise that resolves to a workspace edit or null",s=>s?Zu.to(s):null)),new fn("vscode.editorChat.start","inlineChat.start","Invoke a new editor chat session",[new ut("Run arguments","",s=>!0,s=>{if(s)return{initialRange:s.initialRange?tt.from(s.initialRange):void 0,initialSelection:uC.isSelection(s.initialSelection)?zb.from(s.initialSelection):void 0,message:s.message,autoSend:s.autoSend,position:s.position?Yr.from(s.position):void 0}})],sn.Void)];class Xii{static register(e){Jii.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,"_validateWhenClauses",nlt)}}function _v(s){return e=>{if(Array.isArray(e))return e.map(s)}}function yE(s){if(!Array.isArray(s))return;const e=[];for(const t of s)BKe(t)?e.push(D$.to(t)):e.push(ff.to(t));return e}let YIe=class{constructor(e,t){this._proxy=e.getProxy(We.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:i=>t.getDocument(i)?.version,getNotebookDocumentVersion:()=>{}}}applyWorkspaceEdit(e,t,i){const n=new Jd(Zu.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(n,void 0,i?.isRefactoring??!1)}};YIe=D([_(0,Jr)],YIe);class Zii{constructor(e,t,i,n,r){this._extension=e,this._request=t,this._proxy=i,this._commandsConverter=n,this._sessionDisposables=r,this._stopWatch=Ys.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 r=new Error("Response stream has been closed");throw Error.captureStackTrace(r,n),r}};const e=this;this._stopWatch.reset();const i=(n,r)=>{if(typeof this._firstProgress>"u"&&"content"in n&&(this._firstProgress=this._stopWatch.elapsed()),r){const o=this._proxy.$handleProgressChunk(this._request.requestId,n),a={report:c=>{o?.then(l=>{l&&(gf.isMarkdownString(c.value)?this._proxy.$handleProgressChunk(this._request.requestId,F$.from(c),l):this._proxy.$handleProgressChunk(this._request.requestId,vA.from(c),l))})}};Promise.all([o,r?.(a)]).then(([c,l])=>{c!==void 0&&l!==void 0&&this._proxy.$handleProgressChunk(this._request.requestId,Sxe.from(l),c)})}else this._proxy.$handleProgressChunk(this._request.requestId,n)};this._apiObject={markdown(n){t(this.markdown);const r=new bG(n),o=M$.from(r);return i(o),this},markdownWithVulnerabilities(n,r){t(this.markdown),r&&ze(e._extension,"chatParticipantAdditions");const o=new TH(n,r),a=mie.from(o);return i(a),this},filetree(n,r){t(this.filetree);const o=new wG(n,r),a=N$.from(o);return i(a),this},anchor(n,r){t(this.anchor);const o=new yG(n,r),a=P$.from(o);return i(a),this},button(n){t(this.anchor);const r=new CG(n),o=O$.from(r,e._commandsConverter,e._sessionDisposables);return i(o),this},progress(n,r){t(this.progress);const o=new kPe(n,r),a=r?Cxe.from(o):YH.from(o);return i(a,r),this},warning(n){t(this.progress),ze(e._extension,"chatParticipantAdditions");const r=new MH(n),o=F$.from(r);return i(o),this},reference(n,r){return this.reference2(n,r)},reference2(n,r,o){if(t(this.reference),"variableName"in n&&ze(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 Rb(n,r,o);c=[vA.from(l)]}return c.forEach(l=>i(l)),this}}else{const a=new Rb(n,r,o),c=vA.from(a);i(c)}return this},codeCitation(n,r,o){t(this.codeCitation),ze(e._extension,"chatParticipantAdditions");const a=new v$(n,r,o),c=wie.from(a);i(c)},textEdit(n,r){t(this.textEdit),ze(e._extension,"chatParticipantAdditions");const o=new NH(n,r),a=bie.from(o);return i(a),this},detectedParticipant(n,r){t(this.detectedParticipant),ze(e._extension,"chatParticipantAdditions");const o=new LH(n,r),a=_ie.from(o);return i(a),this},confirmation(n,r,o,a){t(this.confirmation),ze(e._extension,"chatParticipantAdditions");const c=new _$(n,r,o,a),l=vie.from(c);return i(l),this},push(n){if(t(this.push),(n instanceof NH||n instanceof TH||n instanceof LH||n instanceof MH||n instanceof _$||n instanceof v$)&&ze(e._extension,"chatParticipantAdditions"),n instanceof Rb)this.reference2(n.value,n.iconPath,n.options);else{const r=yie.from(n,e._commandsConverter,e._sessionDisposables);i(r)}return this}}}return this._apiObject}}const c8=class c8 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 mr),this._completionDisposables=this._register(new mr),this._proxy=e.getProxy(We.MainThreadChatAgents2)}transferActiveChat(e){this._proxy.$transferActiveChatSession(e)}createChatAgent(e,t,i){const n=c8._idPool++,r=new d$e(e,t,this._proxy,n,i);return this._agents.set(n,r),this._proxy.$registerAgent(n,e.identifier,t,{},void 0),r.apiAgent}createDynamicChatAgent(e,t,i,n){const r=c8._idPool++,o=new d$e(e,t,this._proxy,r,n);return this._agents.set(r,o),this._proxy.$registerAgent(r,e.identifier,t,{isSticky:!0},i),o.apiAgent}async $invokeAgent(e,t,i,n){const r=this._agents.get(e);if(!r)throw new Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);const o=Mr(t);let a=this._sessionDisposables.get(o.sessionId);a||(a=new Z,this._sessionDisposables.set(o.sessionId,a));const c=new Zii(r.extension,o,this._proxy,this._commands.converter,a);try{const l=await this.prepareHistoryTurns(o.agentId,i);let d;if(o.locationData?.type===To.Editor){const u=this._documents.getDocument(o.locationData.document);d=new LPe(u,zb.to(o.locationData.selection),tt.to(o.locationData.wholeRange))}else if(o.locationData?.type===To.Notebook){const u=this._documents.getDocument(o.locationData.sessionInputUri);d=new RPe(u)}else o.locationData?.type,To.Terminal;const h=r.invoke(Axe.to(o,d),{history:l},c.apiObject,n);return await $_(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(`[${r.extension.identifier.value}] [@${r.id}] ${m}`,r.extension),{errorDetails:{message:m},timings:c.timings}}let f;return u?.errorDetails&&(f={...u.errorDetails,responseIsIncomplete:!0}),f?.responseIsRedacted&&ze(r.extension,"chatParticipantPrivate"),{errorDetails:f,timings:c.timings,metadata:u?.metadata}}),n)}catch(l){return this._logService.error(l,r.extension),l instanceof Ow&&l.cause&&(l=l.cause),{errorDetails:{message:Po(l),responseIsIncomplete:!0}}}finally{c.close()}}async prepareHistoryTurns(e,t){const i=[];for(const n of t.history){const r=fB.to(n.result),o=e===n.request.agentId?r:{...r,metadata:void 0},a=n.request.variables.variables.filter(l=>!l.isTool).map(Cie.to);i.push(new IPe(n.request.message,n.request.command,a,n.request.agentId));const c=Oi(n.response.map(l=>yie.toContent(l,this._commands.converter)));i.push(new TPe(c,o,n.request.agentId,n.request.command))}return i}$releaseSession(e){this._sessionDisposables.deleteAndDispose(e)}async $provideFollowups(e,t,i,n,r){const o=this._agents.get(t);if(!o)return Promise.resolve([]);const a=Mr(e),c=await this.prepareHistoryTurns(o.id,n),l=fB.to(i);return(await o.provideFollowups(l,{history:c},r)).filter(d=>{const h=!d.participant||ui.some(this._agents.values(),u=>u.id===d.participant&&An.equals(u.extension.identifier,o.extension.identifier));return h||this._logService.warn(`[@${o.id}] ChatFollowup refers to an unknown participant: ${d.participant}`),h}).map(d=>R$.from(d,a))}$acceptFeedback(e,t,i,n){const r=this._agents.get(e);if(!r)return;const o=fB.to(t);let a;switch(i){case KW.Down:a=IH.Unhelpful;break;case KW.Up:a=IH.Helpful;break}r.acceptFeedback(Object.freeze(n?{result:o,kind:a,reportIssue:n}:{result:o,kind:a}))}$acceptAction(e,t,i){const n=this._agents.get(e);if(!n||i.action.kind==="vote")return;const r=xxe.to(t,i,this._commands.converter);r&&n.acceptAction(Object.freeze(r))}async $invokeCompletionProvider(e,t,i){const n=this._agents.get(e);if(!n)return[];let r=this._completionDisposables.get(e);return r?r.clear():(r=new Z,this._completionDisposables.set(e,r)),(await n.invokeCompletionProvider(t,i)).map(a=>Exe.from(a,this._commands.converter,r))}async $provideWelcomeMessage(e,t,i){const n=this._agents.get(e);if(n)return await n.provideWelcomeMessage(B$.to(t),i)}async $provideSampleQuestions(e,t,i){const n=this._agents.get(e);if(n)return(await n.provideSampleQuestions(B$.to(t),i)).map(r=>R$.from(r,void 0))}};c8._idPool=0;let JIe=c8;class d$e{constructor(e,t,i,n,r){this.extension=e,this.id=t,this._proxy=i,this._handle=n,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)??[]:[]}async provideFollowups(e,t,i){if(!this._followupProvider)return[];const n=await this._followupProvider.provideFollowups(e,t,i);return n?n.filter(r=>!(r&&"commandId"in r)).filter(r=>!(r&&"message"in r)):[]}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:Fs.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 fu?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,isSecondary:this._isSecondary,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix=="string"?this._helpTextPrefix:Fs.from(this._helpTextPrefix),helpTextVariablesPrefix:!this._helpTextVariablesPrefix||typeof this._helpTextVariablesPrefix=="string"?this._helpTextVariablesPrefix:Fs.from(this._helpTextVariablesPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix=="string"?this._helpTextPostfix:Fs.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(r){n._iconPath=r,i()},get requestHandler(){return n._requestHandler},set requestHandler(r){Lt(typeof r=="function","Invalid request handler"),n._requestHandler=r},get followupProvider(){return n._followupProvider},set followupProvider(r){n._followupProvider=r,i()},get isDefault(){return ze(n.extension,"defaultChatParticipant"),n._isDefault},set isDefault(r){ze(n.extension,"defaultChatParticipant"),n._isDefault=r,i()},get helpTextPrefix(){return ze(n.extension,"defaultChatParticipant"),n._helpTextPrefix},set helpTextPrefix(r){ze(n.extension,"defaultChatParticipant"),n._helpTextPrefix=r,i()},get helpTextVariablesPrefix(){return ze(n.extension,"defaultChatParticipant"),n._helpTextVariablesPrefix},set helpTextVariablesPrefix(r){ze(n.extension,"defaultChatParticipant"),n._helpTextVariablesPrefix=r,i()},get helpTextPostfix(){return ze(n.extension,"defaultChatParticipant"),n._helpTextPostfix},set helpTextPostfix(r){ze(n.extension,"defaultChatParticipant"),n._helpTextPostfix=r,i()},get isSecondary(){return ze(n.extension,"defaultChatParticipant"),n._isSecondary},set isSecondary(r){ze(n.extension,"defaultChatParticipant"),n._isSecondary=r,i()},get supportIssueReporting(){return ze(n.extension,"chatParticipantPrivate"),n._supportIssueReporting},set supportIssueReporting(r){ze(n.extension,"chatParticipantPrivate"),n._supportIssueReporting=r,i()},get onDidReceiveFeedback(){return n._onDidReceiveFeedback.event},set participantVariableProvider(r){if(ze(n.extension,"chatParticipantAdditions"),n._agentVariableProvider=r,r){if(!r.triggerCharacters.length)throw new Error("triggerCharacters are required");n._proxy.$registerAgentCompletionsProvider(n._handle,n.id,r.triggerCharacters)}else n._proxy.$unregisterAgentCompletionsProvider(n._handle,n.id)},get participantVariableProvider(){return ze(n.extension,"chatParticipantAdditions"),n._agentVariableProvider},set welcomeMessageProvider(r){ze(n.extension,"defaultChatParticipant"),n._welcomeMessageProvider=r,i()},get welcomeMessageProvider(){return ze(n.extension,"defaultChatParticipant"),n._welcomeMessageProvider},onDidPerformAction:hl(this.extension,"chatParticipantAdditions")?this._onDidPerformAction.event:void 0,set requester(r){n._requester=r,i()},get requester(){return n._requester},set supportsSlowReferences(r){ze(n.extension,"chatParticipantPrivate"),n._supportsSlowReferences=r,i()},get supportsSlowReferences(){return ze(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 Doe=class Doe{constructor(e){this._resolver=new Map,this._proxy=e.getProxy(We.MainThreadChatVariables)}async $resolveVariable(e,t,i,n){const r=this._resolver.get(e);if(r)try{if(r.resolver.resolve2){ze(r.extension,"chatParticipantAdditions");const o=new eni(t,this._proxy),a=await r.resolver.resolve2(r.data.name,{prompt:i},o.apiObject,n);if(a&&a[0])return a[0].value}else{const o=await r.resolver.resolve(r.data.name,{prompt:i},n);if(o&&o[0])return o[0].value}}catch(o){Nr(o)}}registerVariableResolver(e,t,i,n,r,o,a,c,l){const d=Doe._idPool++,h=l?He.fromId(l):void 0;return this._resolver.set(d,{extension:e,data:{id:t,name:i,description:n,modelDescription:r,icon:h},resolver:a}),this._proxy.$registerVariable(d,{id:t,name:i,description:n,modelDescription:r,isSlow:o,fullName:c,icon:h}),Ee(()=>{this._resolver.delete(d),this._proxy.$unregisterVariable(d)})}};Doe._idPool=0;let XIe=Doe;class eni{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 r=new Error("Response stream has been closed");throw Error.captureStackTrace(r,n),r}};const e=this,i=n=>{this._proxy.$handleProgressChunk(this._requestId,n)};this._apiObject={progress(n){t(this.progress);const r=new RH(n),o=YH.from(r);return i(o),this},reference(n){t(this.reference);const r=new Rb(n),o=vA.from(r);return i(o),this},push(n){return t(this.push),n instanceof Rb?i(vA.from(n)):n instanceof RH&&i(YH.from(n)),this}}}return this._apiObject}}class tni{constructor(e){const t=e.getProxy(We.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(i){return t.$writeText(i)}})}}const Oot="vscode-cdn.net",ini=`vscode-resource.${Oot}`,ZIe=`'self' https://*.${Oot}`;function Pz(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}+${nni(s.authority)}.${ini}`,path:s.path,fragment:s.fragment,query:s.query}))}function nni(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 sni{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 r of this._insets.values())n.indexOf(r.editor)<0&&r.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,i,n,r){let o;for(const f of this._editors.getVisibleTextEditors(!0))if(f.value===e){o=f;break}if(!o)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 Pz(f,a._remoteInfo)}get cspSource(){return ZIe}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,o.id,o.value.document.uri,t+1,i,n||{},r.identifier,r.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 rni(s,e,t){const i=s.getProxy(We.MainThreadComments),f=class f{constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new ba,e.registerArgumentProcessor({processArgument:v=>{if(v&&v.$mid===ys.CommentController){const b=this._commentControllers.get(v.handle);return b?b.value:v}else if(v&&v.$mid===ys.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===ys.CommentThreadReply||v.$mid===ys.CommentThreadInstance)){const b=this._commentControllers.get(v.thread.commentControlHandle);if(!b)return v;const w=b.getCommentThread(v.thread.commentThreadHandle);return w?v.$mid===ys.CommentThreadInstance?w.value:{thread:w.value,text:v.text}:v}else if(v&&v.$mid===ys.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===ys.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 gf(y),A):v}return v}})}createCommentController(v,b,w){const y=f.handlePool++,C=new o(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=>tt.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"?(ze(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 yn,this._acceptInputDisposables.value=new Z,this._id===void 0&&(this._id=`${v}.${this.handle}`),i.$createCommentThread(b,this.handle,this._id,this._uri,tt.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=tt.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){ze(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===AH.Reply?(A=!0,C=!1):b?.focus===AH.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 r=p;class o{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&&ze(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 ze(this._extension,"activeComment"),this._activeComment}get activeCommentThread(){return ze(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&&ze(this._extension,"fileComments");const y=new r(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 r(this.id,this.handle,void 0,N.revive(v),tt.to(b),[],this._extension,!0,w);return y.collapsibleState=Rc.Expanded,this._threads.set(y.handle,y),y}$updateCommentThreadTemplate(v,b){const w=this._threads.get(v);w&&(w.range=tt.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&&ze(w,"commentsDraftState"),v.reactions?.some(C=>C.reactors!==void 0)&&ze(w,"commentReactor"),{mode:v.mode,contextValue:v.contextValue,uniqueIdInThread:y,body:typeof v.body=="string"?v.body:Fs.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?fle(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 yH.Expanded:return Rc.Expanded;case yH.Collapsed:return Rc.Collapsed}return Rc.Collapsed}function h(m){let v;if(typeof m=="object"?v=m.resolved:v=m,v!==void 0)switch(v){case CH.Unresolved:return cu.Unresolved;case CH.Resolved:return cu.Resolved}return cu.Unresolved}function u(m){let v;if(typeof m=="object"&&(v=m.applicability),v!==void 0)switch(v){case SH.Current:return sD.Current;case SH.Outdated:return sD.Outdated}return sD.Current}return new n}var nT,sT,R7,M7,N7,Ww,rT,oT,aT,cT,P7,o2,lT;class oni{constructor(e,t,i,n,r,o,a){Ht(this,nT);Ht(this,sT);Ht(this,R7);Ht(this,M7);Ht(this,N7);Ht(this,Ww);Ht(this,rT);Ht(this,oT);Ht(this,aT);Ht(this,cT);Ht(this,P7);Ht(this,o2);Ht(this,lT);St(this,rT,""),St(this,aT,!1),St(this,cT,!1),this._onMessageEmitter=new I,this.onDidReceiveMessage=this._onMessageEmitter.event,St(this,lT,new I),this._onDidDispose=Ce(this,lT).event,St(this,nT,e),St(this,sT,t),St(this,oT,i),St(this,M7,n),St(this,N7,r),St(this,Ww,o),St(this,P7,tU(o)),St(this,o2,ani(o)),St(this,R7,a)}dispose(){St(this,aT,!0),Ce(this,lT).fire(),Ce(this,lT).dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return St(this,cT,!0),Pz(e,Ce(this,M7))}get cspSource(){const e=Ce(this,Ww).extensionLocation;if(e.scheme===pe.https||e.scheme===pe.http){let t=e.toString();return t.endsWith("/")||(t+="/"),t+" "+ZIe}return ZIe}get html(){return this.assertNotDisposed(),Ce(this,rT)}set html(e){this.assertNotDisposed(),Ce(this,rT)!==e&&(St(this,rT,e),Ce(this,o2)&&!Ce(this,cT)&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(St(this,cT,!0),Ce(this,R7).report("Webview vscode-resource: uris",Ce(this,Ww),"Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri")),Ce(this,sT).$setHtml(Ce(this,nT),this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),Ce(this,oT)}set options(e){this.assertNotDisposed(),Js(Ce(this,oT),e)||Ce(this,sT).$setOptions(Ce(this,nT),Bot(Ce(this,Ww),Ce(this,N7),e)),St(this,oT,e)}async postMessage(e){if(Ce(this,aT))return!1;const t=Qst(e,{serializeBuffersForPostMessage:Ce(this,P7)});return Ce(this,sT).$postMessage(Ce(this,nT),t.message,...t.buffers)}assertNotDisposed(){if(Ce(this,aT))throw new Error("Webview is disposed")}rewriteOldResourceUrlsIfNeeded(e){if(!Ce(this,o2))return e;const t=Ce(this,Ww).extensionLocation?.scheme===pe.vscodeRemote,i=Ce(this,Ww).extensionLocation.scheme===pe.vscodeRemote?Ce(this,Ww).extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(n,r,o,a,c,l)=>{const d=N.from({scheme:a||"file",path:decodeURIComponent(c)}),h=Pz(d,{isRemote:t,authority:i}).toString();return`${r}${h}${l}`}).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(n,r,o,a,c,l)=>{const d=N.from({scheme:a||"file",path:decodeURIComponent(c)}),h=Pz(d,{isRemote:t,authority:i}).toString();return`${r}${h}${l}`})}}nT=new WeakMap,sT=new WeakMap,R7=new WeakMap,M7=new WeakMap,N7=new WeakMap,Ww=new WeakMap,rT=new WeakMap,oT=new WeakMap,aT=new WeakMap,cT=new WeakMap,P7=new WeakMap,o2=new WeakMap,lT=new WeakMap;function tU(s){try{const e=P9(N9(s.engines.vscode));return!!e&&e.majorBase>=1&&e.minorBase>=57}catch{return!1}}function ani(s){try{const e=P9(N9(s.engines.vscode));return e?e.majorBase<1||e.majorBase===1&&e.minorBase<60:!1}catch{return!1}}class cni extends V{constructor(e,t,i,n,r){super(),this.remoteInfo=t,this.workspace=i,this._logService=n,this._deprecationService=r,this._webviews=new Map,this._webviewProxy=e.getProxy(We.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:r}=jst(t,i.value);n._onMessageEmitter.fire(r)}}$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 oni(e,this._webviewProxy,lni(t),this.remoteInfo,this.workspace,i,this._deprecationService);this._webviews.set(e,n);const r=n._onDidDispose(()=>{r.dispose(),this.deleteWebview(e)});return n}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}}function bne(s){return{id:s.identifier,location:s.extensionLocation}}function Bot(s,e,t){return{enableCommandUris:t.enableCommandUris,enableScripts:t.enableScripts,enableForms:t.enableForms,portMapping:t.portMapping,localResourceRoots:t.localResourceRoots||dni(s,e)}}function lni(s){return{enableCommandUris:s.enableCommandUris,enableScripts:s.enableScripts,enableForms:s.enableForms,portMapping:s.portMapping,localResourceRoots:s.localResourceRoots?.map(e=>N.from(e))}}function dni(s,e){return[...(e?.getWorkspaceFolders()||[]).map(t=>t.uri),s.extensionLocation]}const koe=class koe{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(){koe.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}};koe.enableDebugLogging=!1;let Am=koe;class hni{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new Am("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=_ni(this.document.uri)+this._backupCounter++;return Ft(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 uni{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 r=new hni(t,i);return this._documents.set(n,r),r}delete(e,t){const i=this.key(e,t.uri);this._documents.delete(i)}key(e,t){return`${e}@@@${t}`}}var Zx;(function(s){s[s.Text=0]="Text",s[s.Custom=1]="Custom"})(Zx||(Zx={}));class gni{constructor(){this._providers=new Map}addTextProvider(e,t,i){return this.add(e,{type:Zx.Text,extension:t,provider:i})}addCustomProvider(e,t,i){return this.add(e,{type:Zx.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 js(()=>this._providers.delete(e))}}class fni{constructor(e,t,i,n,r){this._extHostDocuments=t,this._extensionStoragePaths=i,this._extHostWebview=n,this._extHostWebviewPanels=r,this._editorProviders=new gni,this._documents=new uni,this._proxy=e.getProxy(We.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,i,n){const r=new Z;return pni(i)?(r.add(this._editorProviders.addTextProvider(t,e,i)),this._proxy.$registerTextEditorProvider(bne(e),t,n.webviewOptions||{},{supportsMove:!!i.moveCustomTextEditor},tU(e))):(r.add(this._editorProviders.addCustomProvider(t,e,i)),iq(i)&&r.add(i.onDidChangeCustomDocument(o=>{const a=this.getCustomDocumentEntry(t,o.document.uri);if(mni(o)){const c=a.addEdit(o);this._proxy.$onDidEdit(o.document.uri,t,c,o.label)}else this._proxy.$onContentChange(o.document.uri,t)})),this._proxy.$registerCustomEditorProvider(bne(e),t,n.webviewOptions||{},!!n.supportsMultipleEditorsPerDocument,tU(e))),js.from(r,new js(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,i,n,r){const o=this._editorProviders.get(t);if(!o)throw new Error(`No provider found for '${t}'`);if(o.type!==Zx.Custom)throw new Error(`Invalid provide type for '${t}'`);const a=N.revive(e),c=await o.provider.openCustomDocument(a,{backupId:i,untitledDocumentData:n?.buffer},r);let l;return iq(o.provider)&&this._extensionStoragePaths&&(l=this._extensionStoragePaths.workspaceValue(o.extension)??this._extensionStoragePaths.globalValue(o.extension)),this._documents.add(t,c,l),{editable:iq(o.provider)}}async $disposeCustomDocument(e,t){const i=this._editorProviders.get(t);if(!i)throw new Error(`No provider found for '${t}'`);if(i.type!==Zx.Custom)throw new Error(`Invalid provider type for '${t}'`);const n=N.revive(e),{document:r}=this.getCustomDocumentEntry(t,n);this._documents.delete(t,r),r.dispose()}async $resolveCustomEditor(e,t,i,n,r,o){const a=this._editorProviders.get(i);if(!a)throw new Error(`No provider found for '${i}'`);const c=kl.to(r),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 Zx.Custom:{const{document:u}=this.getCustomDocumentEntry(i,h);return a.provider.resolveCustomEditor(u,d,o)}case Zx.Text:{const u=this._extHostDocuments.getDocument(h);return a.provider.resolveCustomTextEditor(u,d,o)}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 r=this._extHostWebviewPanels.getWebviewPanel(e);if(!r)throw new Error("No webview found");const o=N.revive(t),a=this._extHostDocuments.getDocument(o);await n.provider.moveCustomTextEditor(a,r,Ue.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 r=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(r.document,N.revive(i),n)}async $backup(e,t,i){const n=this.getCustomDocumentEntry(t,e),o=await this.getCustomEditorProvider(t).backupCustomDocument(n.document,{destination:n.getNewBackupUri()},i);return n.updateBackup(o),o.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||!iq(i))throw new Error("Custom document is not editable");return i}}function iq(s){return!!s.onDidChangeCustomDocument}function pni(s){return typeof s.resolveCustomTextEditor=="function"}function mni(s){return typeof s.undo=="function"&&typeof s.redo=="function"}function _ni(s){const e=s.scheme===pe.file||s.scheme===pe.untitled?s.fsPath:s.toString();return Hc(e)+""}var P0,rS,mx,Dd;const BFe=class BFe{constructor(e,t,i,n,r,o,a,c){Ht(this,rS);Ht(this,mx);Ht(this,Dd);this._name=e,this._owner=t,this._maxDiagnosticsTotal=i,this._maxDiagnosticsPerFile=n,this._modelVersionIdProvider=r,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(n,i),St(this,Dd,new gi(l=>o.getComparisonKey(l))),St(this,rS,a),St(this,mx,c)}dispose(){this._isDisposed||(Ce(this,mx).fire([...Ce(this,Dd).keys()]),Ce(this,rS)?.$clear(this._owner),Ce(this,Dd).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,Dd).set(e,t.slice()),i=[e]}else if(Array.isArray(e)){i=[];let o;e=[...e].sort(BFe._compareIndexedTuplesByUri);for(const a of e){const[c,l]=a;if((!o||c.toString()!==o.toString())&&(o&&Ce(this,Dd).get(o).length===0&&Ce(this,Dd).delete(o),o=c,i.push(c),Ce(this,Dd).set(c,[])),l)Ce(this,Dd).get(c)?.push(...l);else{const d=Ce(this,Dd).get(c);d&&(d.length=0)}}}if(Ce(this,mx).fire(i),!Ce(this,rS))return;const n=[];let r=0;for(const o of i){let a=[];const c=Ce(this,Dd).get(o);if(c)if(c.length>this._maxDiagnosticsPerFile){a=[];const l=[Hd.Error,Hd.Warning,Hd.Information,Hd.Hint];e:for(let d=0;d<4;d++)for(const h of c)if(h.severity===l[d]&&a.push({...VH.from(h),modelVersionId:this._modelVersionIdProvider(o)})===this._maxDiagnosticsPerFile)break e;a.push({severity:Hs.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=>({...VH.from(l),modelVersionId:this._modelVersionIdProvider(o)}));if(n.push([o,a]),r+=a.length,r>this._maxDiagnosticsTotal)break}Ce(this,rS).$changeMany(this._owner,n)}delete(e){this._checkDisposed(),Ce(this,mx).fire([e]),Ce(this,Dd).delete(e),Ce(this,rS)?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),Ce(this,mx).fire([...Ce(this,Dd).keys()]),Ce(this,Dd).clear(),Ce(this,rS)?.$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,Dd).keys())yield[e,this.get(e)]}get(e){this._checkDisposed();const t=Ce(this,Dd).get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(Ce(this,Dd).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}};rS=new WeakMap,mx=new WeakMap,Dd=new WeakMap;let wne=BFe;var my;let e0e=(my=class{static _mapper(e){const t=new gi;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 $oe({merge:r=>r.flat(),delay:50}),this.onDidChangeDiagnostics=M.map(this._onDidChangeDiagnostics.event,P0._mapper),this._proxy=e.getProxy(We.MainThreadDiagnostics)}createDiagnosticCollection(e,t){const{_collections:i,_proxy:n,_onDidChangeDiagnostics:r,_logService:o,_fileSystemInfoService:a,_extHostDocumentsAndEditors:c}=this,l=new class{$changeMany(u,f){n.$changeMany(u,f),o.trace("[DiagnosticCollection] change many (extension, owner, uris)",e.value,u,f.length===0?"CLEARING":f)}$clear(u){n.$clear(u),o.trace("[DiagnosticCollection] remove all (extension, owner)",e.value,u)}dispose(){n.dispose()}};let d;if(!t)t="_generated_diagnostic_collection_name_#"+P0._idPool++,d=t;else if(!i.has(t))d=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do d=t+P0._idPool++;while(i.has(d))}return new class extends wne{constructor(){super(t,d,P0._maxDiagnosticsTotal,P0._maxDiagnosticsPerFile,u=>c.getDocument(u)?.version,a.extUri,l,r),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((r,o)=>{let a=t.get(r.toString());typeof a>"u"&&(a=i.length,t.set(r.toString(),a),i.push([r,[]])),i[a][1]=i[a][1].concat(...o)});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 wne(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(VH.to))}},P0=my,my._idPool=0,my._maxDiagnosticsPerFile=1e3,my._maxDiagnosticsTotal=1.1*my._maxDiagnosticsPerFile,my);e0e=P0=D([_(1,Ke),_(2,n4)],e0e);class vni{constructor(e){this._proxy=e.getProxy(We.MainThreadDialogs)}showOpenDialog(e,t){return t?.allowUIResources&&ze(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 Ioe=class Ioe{constructor(e,t,i){this._documentsAndEditors=t,this._logService=i,this._documentContentProviders=new Map,this._proxy=e.getProxy(We.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(e,t){if(Object.keys(pe).indexOf(e)>=0)throw new Error(`scheme '${e}' already registered`);const i=Ioe._handlePool++;this._documentContentProviders.set(i,t),this._proxy.$registerTextContentProvider(i,e);let n;if(typeof t.onDidChange=="function"){let r;n=t.onDidChange(async o=>{if(o.scheme!==e){this._logService.warn(`Provider for scheme '${e}' is firing event for schema '${o.scheme}' which will be IGNORED`);return}if(!this._documentsAndEditors.getDocument(o))return;r&&await r;const a=this.$provideTextDocumentContent(i,o).then(async c=>{if(!c&&typeof c!="string")return;const l=this._documentsAndEditors.getDocument(o);if(!l)return;const d=cv(c);if(!l.equalLines(d))return this._proxy.$onVirtualDocumentChange(o,c)}).catch(bt).finally(()=>{r===a&&(r=void 0)});r=a})}return new js(()=>{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),Ue.None)):Promise.reject(new Error(`unsupported uri-scheme: ${t.scheme}`))}};Ioe._handlePool=0;let t0e=Ioe;class bni{constructor(e,t,i,n={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=i,this._thresholds=n,this._callbacks=new ul,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,i,n)=>{const o={dispose:this._callbacks.push([t,i,e])};return Array.isArray(n)&&n.push(o),o}}async $participateInSave(e,t){const i=N.revive(e);let n=!1;const r=setTimeout(()=>n=!0,this._thresholds.timeout),o=[];try{for(const a of[...this._callbacks]){if(n)break;const c=this._documents.getDocument(i),l=await this._deliverEventAsyncAndBlameBadListeners(a,{document:c,reason:oie.to(t)});o.push(l)}}finally{clearTimeout(r)}return o}_deliverEventAsyncAndBlameBadListeners([e,t,i],n){const r=this._badListeners.get(e);return typeof r=="number"&&r>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(i,e,t,n).then(()=>!0,o=>{if(this._logService.error(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' threw ERROR`),this._logService.error(o),!(o instanceof Error)||o.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 r=[],o=Date.now(),{document:a,reason:c}=n,{version:l}=a,d=Object.freeze({document:a,reason:c,waitUntil(h){if(Object.isFrozen(r))throw Voe("waitUntil can not be called async");r.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(r).then(p=>{this._logService.debug(`onWillSaveTextDocument-listener from extension '${e.identifier.value}' finished after ${Date.now()-o}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 qA))for(const{newText:p,newEol:m,range:v}of f)u.edits.push({resource:a.uri,versionId:void 0,textEdit:{range:v&&tt.from(v),text:p,eol:m&&KH.from(m)}});if(u.edits.length!==0)return l===a.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new Jd(u)):Promise.reject(new Error("concurrent_edits"))})}}class wni{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(We.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 r=N.revive(n);return Qn(this._documentsAndEditors.getDocument(r))},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),r=this._documentsAndEditors.getDocument(n);if(!r)throw new Error("unknown document");r._acceptIsDirty(i),r.onEvents(t);let o;t.isUndoing?o=fH.Undo:t.isRedoing&&(o=fH.Redo),this._onDidChangeDocument.fire(QGe({document:r.document,contentChanges:t.changes.map(a=>({range:tt.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:o}))}setWordDefinitionFor(e,t){rii(e,t)}}class yni{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(We.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??=Ue.None;let n=!1;typeof t=="string"&&(t=[t],n=!0);const r=await this._proxy.$computeEmbeddings(e,t,i);if(r.length!==t.length)throw new Error;if(n){if(r.length!==1)throw new Error;return r[0]}return r}async $provideEmbeddings(e,t,i){const n=this._provider.get(e);if(!n)return[];const r=await n.provider.provideEmbeddings(t,i);return r||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}}class Cni{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(We.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 r=await n.provideEmbeddingVector(t,i);if(!r)throw new Error("Embedding vector provider returned undefined");return r}registerEmbeddingVectorProvider(e,t,i){const n=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(n,i),this._proxy.$registerAiEmbeddingVectorProvider(t,n),new js(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(n),this._AiEmbeddingVectorProviders.delete(n)})}}class Sni{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,r=Mi.LastKnownState,o=Mi.LastKnownState;for(const a of e){let c=i?Qy(i,a):0;for(c===0?n=Mi.Start:n=o;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 XT.Changed:p=Tr.UPDATED;break;case XT.Created:p=Tr.ADDED;break;case XT.Deleted:p=Tr.DELETED;break;default:throw new Error("Unknown FileChangeType")}d.push({resource:u,type:p})}this._proxy.$onFileSystemChange(r,d)});return Ee(()=>{c.dispose(),this._linkProvider.delete(t),this._registeredSchemes.delete(t),this._fsProvider.delete(r),this._proxy.$unregisterProvider(r)})}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:r,permissions:o}=e;return{type:t,ctime:i,mtime:n,size:r,permissions:o}}$stat(e,t){return Promise.resolve(this._getFsProvider(e).stat(N.revive(t))).then(i=>yne._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=>Ge.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 r=this._getFsProvider(e);if(!r.copy)throw new Error('FileSystemProvider does not implement "copy"');return Promise.resolve(r.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 r=this._getFsProvider(e).watch(N.revive(i),n);this._watches.set(t,r)}$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 r=this._getFsProvider(e);if(!r.read)throw new Error('FileSystemProvider does not implement "read"');const o=Ge.alloc(n);return Promise.resolve(r.read(t,i,o.buffer,0,n)).then(a=>o.slice(0,a))}$write(e,t,i,n){const r=this._getFsProvider(e);if(!r.write)throw new Error('FileSystemProvider does not implement "write"');return Promise.resolve(r.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 Ani{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,i,n,r,o){this.session=Math.random(),this._onDidCreate=new I,this._onDidChange=new I,this._onDidDelete=new I,this._config=0,o?.ignoreCreateEvents&&(this._config+=1),o?.ignoreChangeEvents&&(this._config+=2),o?.ignoreDeleteEvents&&(this._config+=4);const a=X_(r),c=typeof r=="string",l=o?.correlate,d=n(h=>{if(!(typeof h.session=="number"&&h.session!==this.session)&&!(l&&typeof h.session>"u")){if(!o?.ignoreCreateEvents)for(const u of h.created){const f=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidCreate.fire(f)}if(!o?.ignoreChangeEvents)for(const u of h.changed){const f=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidChange.fire(f)}if(!o?.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=js.from(this.ensureWatching(e,i,r,o,o?.correlate),this._onDidCreate,this._onDidChange,this._onDidDelete,d)}ensureWatching(e,t,i,n,r){const o=js.from();if(typeof i=="string"||n?.ignoreChangeEvents&&n?.ignoreCreateEvents&&n?.ignoreDeleteEvents)return o;const a=e.getProxy(We.MainThreadFileSystemEventService);let c=!1;(i.pattern.includes(P1)||i.pattern.includes(e_e))&&(c=!0);let l;return r&&(n?.ignoreChangeEvents||n?.ignoreCreateEvents||n?.ignoreDeleteEvents)&&(l=FE.UPDATED|FE.ADDED|FE.DELETED,n?.ignoreChangeEvents&&(l&=~FE.UPDATED),n?.ignoreCreateEvents&&(l&=~FE.ADDED),n?.ignoreDeleteEvents&&(l&=~FE.DELETED)),a.$watch(t.identifier.value,this.session,i.baseUri,{recursive:c,excludes:n?.excludes??[],filter:l},!!r),js.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 Eni{constructor(e){this._events=e,this.session=this._events.session,this._created=new Ca(()=>this._events.created.map(N.revive)),this._changed=new Ca(()=>this._events.changed.map(N.revive)),this._deleted=new Ca(()=>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 xni{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 tD,this._onWillCreateFile=new tD,this._onWillDeleteFile=new tD,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,i,n){return new Ani(this._mainContext,e,t,this._onFileSystemEvent.event,Qf.from(i),n)}$onFileEvent(e){this._onFileSystemEvent.fire(new Eni(e))}$onDidRunFileOperation(e,t){switch(e){case Ei.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(i=>({oldUri:N.revive(i.source),newUri:N.revive(i.target)}))}));break;case Ei.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(i=>N.revive(i.target))}));break;case Ei.CREATE:case Ei.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,r)=>{const o=function(c){i.call(n,c)};return o.extension=e,t.event(o,void 0,r)}}async $onWillRunFileOperation(e,t,i,n){switch(e){case Ei.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(r=>({oldUri:N.revive(r.source),newUri:N.revive(r.target)}))},i,n);case Ei.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(r=>N.revive(r.target))},i,n);case Ei.CREATE:case Ei.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(r=>N.revive(r.target))},i,n)}}async _fireWillEvent(e,t,i,n){const r=new Set,o=[];if(await e.fireAsync(t,n,async(c,l)=>{const d=Date.now(),h=await Promise.resolve(c);h instanceof _I&&(o.push([l.extension,h]),r.add(l.extension.displayName??l.extension.identifier.value)),Date.now()-d>i&&this._logService.warn("SLOW file-participant",l.extension.identifier)}),n.isCancellationRequested||o.length===0)return;const a={edits:[]};for(const[,c]of o){const{edits:l}=Zu.from(c,{getTextDocumentVersion:d=>this._extHostDocumentsAndEditors.getDocument(d)?.version,getNotebookDocumentVersion:()=>{}});a.edits=a.edits.concat(l)}return{edit:a,extensionNames:Array.from(r)}}}class Dni{constructor(e,t,i,n,r){this._extHostNotebooks=t,this._textDocumentsAndEditors=i,this._commands=n;const o=new fn("interactive.open","_interactive.open","Open interactive window and return notebook editor and input URI",[new ut("showOptions","Show Options",a=>!0,a=>a),new ut("resource","Interactive resource Uri",a=>!0,a=>a),new ut("controllerId","Notebook controller Id",a=>!0,a=>a),new ut("title","Interactive editor title",a=>!0,a=>a)],new sn("Notebook and input URI",a=>{if(r.debug("[ExtHostInteractive] open iw with notebook editor id",a.notebookEditorId),a.notebookEditorId!==void 0){const c=this._extHostNotebooks.getEditorById(a.notebookEditorId);return r.debug("[ExtHostInteractive] notebook editor found",c.id),{notebookUri:N.revive(a.notebookUri),inputUri:N.revive(a.inputUri),notebookEditor:c.apiEditor}}return r.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(o)}$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 kni{constructor(e){this._handlePool=0,this._proxy=e.getProxy(We.MainThreadLabelService)}$registerResourceLabelFormatter(e){const t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),Ee(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}}class Cne{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(!wU(n))return n[0]instanceof lH?n.map(nxe.from):Cne._asDocumentSymbolTree(n)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((n,r)=>{let o=n.location.range.start.compareTo(r.location.range.start);return o===0&&(o=r.location.range.end.compareTo(n.location.range.end)),o});const t=[],i=[];for(const n of e){const r={name:n.name||"!!MISSING: name!!",kind:rv.from(n.kind),tags:n.tags?.map(QA.from)||[],detail:"",containerName:n.containerName,range:tt.from(n.location.range),selectionRange:tt.from(n.location.range),children:[]};for(;;){if(i.length===0){i.push(r),t.push(r);break}const o=i[i.length-1];if(F.containsRange(o.range,r.range)&&!F.equalsRange(o.range,r.range)){o.children?.push(r),i.push(r);break}i.pop()}}return t}}class nq{constructor(e,t,i,n,r,o){this._documents=e,this._commands=t,this._provider=i,this._extension=n,this._extTelemetry=r,this._logService=o,this._cache=new Am("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 r=this._cache.add(n),o=new Z;this._disposables.set(r,o);const a={cacheId:r,lenses:[]};for(let c=0;cXte.from(a))}}class _$e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,i){const n=this._documents.getDocument(e),r=Yr.to(t),o=await this._provider.provideDocumentHighlights(n,r,i);if(Array.isArray(o))return o.map($H.from)}}class v$e{constructor(e,t){this._documents=e,this._provider=t}async provideMultiDocumentHighlights(e,t,i,n){const r=this._documents.getDocument(e),o=i.map(l=>this._documents.getDocument(l)),a=Yr.to(t),c=await this._provider.provideMultiDocumentHighlights(r,a,o,n);if(Array.isArray(c))return c.map(axe.from)}}class b$e{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,i){const n=this._documents.getDocument(e),r=Yr.to(t),o=await this._provider.provideLinkedEditingRanges(n,r,i);if(o&&Array.isArray(o.ranges))return{ranges:Oi(o.ranges.map(tt.from)),wordPattern:o.wordPattern}}}class w$e{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,i,n){const r=this._documents.getDocument(e),o=Yr.to(t),a=await this._provider.provideReferences(r,o,i,n);if(Array.isArray(a))return a.map(ff.from)}}const TO=class TO{constructor(e,t,i,n,r,o,a){this._documents=e,this._commands=t,this._diagnostics=i,this._provider=n,this._logService=r,this._extension=o,this._apiDeprecation=a,this._cache=new Am("CodeAction"),this._disposables=new Map}async provideCodeActions(e,t,i,n){const r=this._documents.getDocument(e),o=ht.isISelection(t)?zb.to(t):tt.to(t),a=[];for(const f of this._diagnostics.getDiagnostics(e))if(o.intersection(f.range)&&a.push(f)>TO._maxCodeActionsPerFile)break;const c={diagnostics:a,only:i.only?new Aa(i.only):void 0,triggerKind:yxe.to(i.trigger)},l=await this._provider.provideCodeActions(r,o,c,n);if(!tr(l)||n.isCancellationRequested)return;const d=this._cache.add(l),h=new Z;this._disposables.set(d,h);const u=[];for(let f=0;ftt.to(l)),a=U_.toDataTransfer(i,()=>{throw new Jat});if(await this._provider.prepareDocumentPaste(r,o,a,n),n.isCancellationRequested)return;const c=Array.from(a).filter(([,l])=>!(l instanceof cte));return U_.from(c)}async providePasteEdits(e,t,i,n,r,o){if(!this._provider.provideDocumentPasteEdits)return[];const a=this._documents.getDocument(t),c=i.map(u=>tt.to(u)),l=U_.toDataTransfer(n,async u=>(await this._proxy.$resolvePasteFileData(this._handle,e,u)).buffer),d=await this._provider.provideDocumentPasteEdits(a,c,l,{only:r.only?new e$(r.only):void 0,triggerKind:r.triggerKind},o);if(!d||o.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?Zu.from(u.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){const[i,n]=e,r=this._cache.get(i,n);if(!r||!this._provider.resolveDocumentPasteEdit)return{};const o=await this._provider.resolveDocumentPasteEdit(r,t)??r;return{additionalEdit:o.additionalEdit?Zu.from(o.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._cache.delete(e)}}class y$e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,i){const n=this._documents.getDocument(e),r=await this._provider.provideDocumentFormattingEdits(n,t,i);if(Array.isArray(r))return r.map(ad.from)}}class vge{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,i,n){const r=this._documents.getDocument(e),o=tt.to(t),a=await this._provider.provideDocumentRangeFormattingEdits(r,o,i,n);if(Array.isArray(a))return a.map(ad.from)}async provideDocumentRangesFormattingEdits(e,t,i,n){Lt(typeof this._provider.provideDocumentRangesFormattingEdits=="function","INVALID invocation of `provideDocumentRangesFormattingEdits`");const r=this._documents.getDocument(e),o=t.map(tt.to),a=await this._provider.provideDocumentRangesFormattingEdits(r,o,i,n);if(Array.isArray(a))return a.map(ad.from)}}class C$e{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,i,n,r){const o=this._documents.getDocument(e),a=Yr.to(t),c=await this._provider.provideOnTypeFormattingEdits(o,a,i,n,r);if(Array.isArray(c))return c.map(ad.from)}}class sq{constructor(e,t){this._provider=e,this._logService=t,this._cache=new Am("WorkspaceSymbols")}async provideWorkspaceSymbols(e,t){const i=await this._provider.provideWorkspaceSymbols(e,t);if(!tr(i))return{symbols:[]};const n=this._cache.add(i),r={cacheId:n,symbols:[]};for(let o=0;or.line||a.end.linetypeof l=="string"?{newSymbolName:l}:{newSymbolName:l.newSymbolName,tags:l.tags}):void 0}catch(a){this._logService.error(l8._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}};l8.languageTriggerKindToVSCodeTriggerKind={[CM.Invoke]:wH.Invoke,[CM.Automatic]:wH.Automatic};let Oz=l8;class bge{constructor(e,t){this.resultId=e,this.tokens=t}}class Nf{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),r=t!==0?this._previousResults.get(t):null;let o=typeof r?.resultId=="string"&&typeof this._provider.provideDocumentSemanticTokensEdits=="function"?await this._provider.provideDocumentSemanticTokensEdits(n,r.resultId,i):await this._provider.provideDocumentSemanticTokens(n,i);return r&&this._previousResults.delete(t),o?(o=Nf._fixProvidedSemanticTokens(o),this._send(Nf._convertToEdits(r,o),o)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(e){return Nf._isSemanticTokens(e)?Nf._isCorrectSemanticTokens(e)?e:new gN(new Uint32Array(e.data),e.resultId):Nf._isSemanticTokensEdits(e)?Nf._isCorrectSemanticTokensEdits(e)?e:new gz(e.edits.map(t=>new vPe(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(!Nf._isSemanticTokens(t)||!e||!e.tokens)return t;const i=e.tokens,n=i.length,r=t.data,o=r.length;let a=0;const c=Math.min(n,o);for(;a({start:n.start,deleteCount:n.deleteCount,data:n.data}))})}return null}}class S$e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,i){const n=this._documents.getDocument(e),r=await this._provider.provideDocumentRangeSemanticTokens(n,tt.to(t),i);return r?this._send(r):null}_send(e){return v9({id:0,type:"full",data:e.data})}}class g1{static supportsResolving(e){return typeof e.resolveCompletionItem=="function"}constructor(e,t,i,n,r){this._documents=e,this._commands=t,this._provider=i,this._apiDeprecation=n,this._extension=r,this._cache=new Am("CompletionItem"),this._disposables=new Map}async provideCompletionItems(e,t,i,n){const r=this._documents.getDocument(e),o=Yr.to(t),a=r.getWordRangeAtPosition(o)||new Xn(o,o),c=a.with({end:o}),l=new Ys,d=await this._provider.provideCompletionItems(r,o,n,lxe.to(i));if(!d||n.isCancellationRequested)return;const h=Array.isArray(d)?new aN(d):d,u=g1.supportsResolving(this._provider)?this._cache.add(h.items):this._cache.add([]),f=new Z;this._disposables.set(u,f);const p=[],m={x:u,[ky.completions]:p,[ky.defaultRanges]:{replace:tt.from(a),insert:tt.from(c)},[ky.isIncomplete]:h.isIncomplete||void 0,[ky.duration]:l.elapsed()};for(let v=0;v"u"?void 0:Fs.fromStrict(e.documentation),[Ri.sortText]:e.sortText!==e.label?e.sortText:void 0,[Ri.filterText]:e.filterText!==e.label?e.filterText:void 0,[Ri.preselect]:e.preselect||void 0,[Ri.insertTextRules]:e.keepWhitespace?Zg.KeepWhitespace:Zg.None,[Ri.commitCharacters]:e.commitCharacters?.join(""),[Ri.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(ad.from),[Ri.commandIdent]:o?.$ident,[Ri.commandId]:o?.id,[Ri.commandArguments]:o?.$ident?void 0:o?.arguments};e.textEdit?(this._apiDeprecation.report("CompletionItem.textEdit",this._extension,"Use 'CompletionItem.insertText' and 'CompletionItem.range' instead."),a[Ri.insertText]=e.textEdit.newText):typeof e.insertText=="string"?a[Ri.insertText]=e.insertText:e.insertText instanceof vI&&(a[Ri.insertText]=e.insertText.value,a[Ri.insertTextRules]|=Zg.InsertAsSnippet);let c;return e.textEdit?c=e.textEdit.range:e.range&&(c=e.range),Xn.isRange(c)?a[Ri.range]=tt.from(c):c&&(!i?.isEqual(c.inserting)||!n?.isEqual(c.replacing))&&(a[Ri.range]={insert:tt.from(c.inserting),replace:tt.from(c.replacing)}),a}}class tF{async provideInlineCompletions(e,t,i,n){}async provideInlineEdits(e,t,i,n){}disposeCompletions(e){}handleDidShowCompletionItem(e,t,i){}handlePartialAccept(e,t,i,n){}}class Ini extends tF{constructor(e,t,i,n){super(),this._extension=e,this._documents=t,this._provider=i,this._commands=n,this._references=new Wot,this._isAdditionsProposedApiEnabled=hl(this._extension,"inlineCompletionsAdditions"),this.languageTriggerKindToVSCodeTriggerKind={[nm.Automatic]:bH.Automatic,[nm.Explicit]:bH.Invoke}}get supportsHandleEvents(){return hl(this._extension,"inlineCompletionsAdditions")&&(typeof this._provider.handleDidShowCompletionItem=="function"||typeof this._provider.handleDidPartiallyAcceptCompletionItem=="function")}async provideInlineCompletions(e,t,i,n){const r=this._documents.getDocument(e),o=Yr.to(t),a=await this._provider.provideInlineCompletionItems(r,o,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:tt.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?tt.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;ze(this._extension,"inlineCompletionsAdditions");const r=this._documents.getDocument(e),o=tt.to(t),a=await this._provider.provideInlineEdits(r,o,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:tt.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?tt.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 r=this._references.get(e)?.items[t];r&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(r,i),this._provider.handleDidPartiallyAcceptCompletionItem(r,Dxe.to(n)))}}class wge{async provideInlineEdits(e,t,i){const n=this._documents.getDocument(e),r=await this._provider.provideInlineEdit(n,{triggerKind:this.languageTriggerKindToVSCodeTriggerKind[t.triggerKind]},i);if(!r||i.isCancellationRequested)return;let o;const a=this._references.createReferenceId({dispose(){o?.dispose()},item:r});let c;r.accepted&&(o||(o=new Z),c=this._commands.toInternal(r.accepted,o));let l;return r.rejected&&(o||(o=new Z),l=this._commands.toInternal(r.rejected,o)),{pid:a,text:r.text,range:tt.from(r.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 Wot,this.languageTriggerKindToVSCodeTriggerKind={[B2.Automatic]:FH.Automatic,[B2.Invoke]:FH.Invoke}}}class Wot{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 yge{constructor(e,t){this._documents=e,this._provider=t,this._cache=new Am("SignatureHelp")}async provideSignatureHelp(e,t,i,n){const r=this._documents.getDocument(e),o=Yr.to(t),a=this.reviveContext(i),c=await this._provider.provideSignatureHelp(r,o,n,a);if(c){const l=this._cache.add([c]);return{...I$.from(c),id:l}}}reviveContext(e){let t;if(e.activeSignatureHelp){const i=I$.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 rq{constructor(e,t,i,n,r){this._documents=e,this._commands=t,this._provider=i,this._logService=n,this._extension=r,this._cache=new Am("InlayHints"),this._disposables=new Map}async provideInlayHints(e,t,i){const n=this._documents.getDocument(e),r=tt.to(t),o=await this._provider.provideInlayHints(n,r,i);if(!Array.isArray(o)||o.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(o);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:Fs.fromStrict(e.tooltip),position:Yr.from(e.position),textEdits:e.textEdits&&e.textEdits.map(ad.from),kind:e.kind&&sie.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label=="string")n.label=e.label;else{const r=[];n.label=r;for(const o of e.label){if(!o.value){console.warn("INVALID inlay hint, empty label part",this._extension.identifier.value);continue}const a={label:o.value,tooltip:Fs.fromStrict(o.tooltip)};Ap.isLocation(o.location)&&(a.location=ff.from(o.location)),o.command&&(a.command=this._commands.toInternal(o.command,i)),r.push(a)}}return n}}class eD{constructor(e,t){this._documents=e,this._provider=t,this._cache=new Am("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(eD._validateLink).map(sL.from)};{const r=this._cache.add(n),o={links:[],cacheId:r};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||!eD._validateLink(n)))return sL.from(n)}releaseLinks(e){this._cache.delete(e)}}class Cge{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(o=>({color:GH.from(o.color),range:tt.from(o.range)})):[]}async provideColorPresentations(e,t,i){const n=this._documents.getDocument(e),r=tt.to(t.range),o=GH.to(t.color),a=await this._provider.provideColorPresentations(o,{document:n,range:r},i);if(Array.isArray(a))return a.map(rie.from)}}class A$e{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,i){const n=this._documents.getDocument(e),r=await this._provider.provideFoldingRanges(n,t,i);if(Array.isArray(r))return r.map(aie.from)}}class E$e{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideSelectionRanges(e,t,i){const n=this._documents.getDocument(e),r=t.map(Yr.to),o=await this._provider.provideSelectionRanges(n,r,i);if(!tr(o))return[];if(o.length!==r.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,o)]}async provideCallsTo(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing call hierarchy item");const r=await this._provider.provideCallHierarchyIncomingCalls(n,i);if(r)return r.map(o=>({from:this._cacheAndConvertItem(e,o.from),fromRanges:o.fromRanges.map(a=>tt.from(a))}))}async provideCallsFrom(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing call hierarchy item");const r=await this._provider.provideCallHierarchyOutgoingCalls(n,i);if(r)return r.map(o=>({to:this._cacheAndConvertItem(e,o.to),fromRanges:o.fromRanges.map(a=>tt.from(a))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),n=bN.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 $4{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new PU(""),this._cache=new Map}async prepareSession(e,t,i){const n=this._documents.getDocument(e),r=Yr.to(t),o=await this._provider.prepareTypeHierarchy(n,r,i);if(!o)return;const a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(o)?o.map(c=>this._cacheAndConvertItem(a,c)):[this._cacheAndConvertItem(a,o)]}async provideSupertypes(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing type hierarchy item");const r=await this._provider.provideTypeHierarchySupertypes(n,i);if(r)return r.map(o=>this._cacheAndConvertItem(e,o))}async provideSubtypes(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing type hierarchy item");const r=await this._provider.provideTypeHierarchySubtypes(n,i);if(r)return r.map(o=>this._cacheAndConvertItem(e,o))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),n=rL.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 oq{constructor(e,t,i,n,r){this._proxy=e,this._documents=t,this._provider=i,this._handle=n,this._extension=r,this._cache=new Am("DocumentDropEdit")}async provideDocumentOnDropEdits(e,t,i,n,r){const o=this._documents.getDocument(t),a=Yr.to(i),c=U_.toDataTransfer(n,async u=>(await this._proxy.$resolveDocumentOnDropFileData(this._handle,e,u)).buffer),l=await this._provider.provideDocumentDropEdits(o,a,c,r);if(!l)return;const d=z_(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?Zu.from(u.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){const[i,n]=e,r=this._cache.get(i,n);if(!r||!this._provider.resolveDocumentDropEdit)return{};const o=await this._provider.resolveDocumentDropEdit(r,t)??r;return{additionalEdit:o.additionalEdit?Zu.from(o.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}}class x$e{constructor(e,t){this._documents=e,this._provider=t}async provideMappedEdits(e,t,i,n){const r=N.revive(e),o=this._documents.getDocument(r),a=i.documents.map(d=>d.map(h=>({uri:N.revive(h.uri),version:h.version,ranges:h.ranges.map(u=>tt.to(u))}))),c={documents:a,selections:a[0]?.[0]?.ranges??[]},l=await this._provider.provideMappedEdits(o,t,c,n);return l?Zu.from(l):null}}class G4{constructor(e,t){this.adapter=e,this.extension=t}}const Jc=class Jc{constructor(e,t,i,n,r,o,a,c){this._uriTransformer=t,this._documents=i,this._commands=n,this._diagnostics=r,this._logService=o,this._apiDeprecation=a,this._extensionTelemetry=c,this._adapter=new Map,this._proxy=e.getProxy(We.MainThreadLanguageFeatures)}_transformDocumentSelector(e,t){return UH.from(e,this._uriTransformer,t)}_createDisposable(e){return new js(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return Jc._handlePool++}async _withAdapter(e,t,i,n,r,o=!1){const a=this._adapter.get(e);if(!a||!(a.adapter instanceof t))return n;const c=Date.now();o||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=>{Oo(d)||(this._logService.error(`[${a.extension.identifier.value}] provider FAILED`),this._logService.error(d),this._extensionTelemetry.onExtensionError(a.extension.identifier,d))}).finally(()=>{o||this._logService.trace(`[${a.extension.identifier.value}] provider DONE after ${Date.now()-c}ms`)}),Ue.isCancellationToken(r)?Zoe(l,r):l}_addNewAdapter(e,t){const i=this._nextHandle();return this._adapter.set(i,new G4(e,t)),i}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(e,t,i,n){const r=this._addNewAdapter(new Cne(this._documents,i),e),o=n&&n.label||Jc._extLabel(e);return this._proxy.$registerDocumentSymbolProvider(r,this._transformDocumentSelector(t,e),o),this._createDisposable(r)}$provideDocumentSymbols(e,t,i){return this._withAdapter(e,Cne,n=>n.provideDocumentSymbols(N.revive(t),i),void 0,i)}registerCodeLensProvider(e,t,i){const n=this._nextHandle(),r=typeof i.onDidChangeCodeLenses=="function"?this._nextHandle():void 0;this._adapter.set(n,new G4(new nq(this._documents,this._commands.converter,i,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(n,this._transformDocumentSelector(t,e),r);let o=this._createDisposable(n);if(r!==void 0){const a=i.onDidChangeCodeLenses(c=>this._proxy.$emitCodeLensEvent(r));o=js.from(o,a)}return o}$provideCodeLenses(e,t,i){return this._withAdapter(e,nq,n=>n.provideCodeLenses(N.revive(t),i),void 0,i)}$resolveCodeLens(e,t,i){return this._withAdapter(e,nq,n=>n.resolveCodeLens(t,i),void 0,void 0)}$releaseCodeLenses(e,t){this._withAdapter(e,nq,i=>Promise.resolve(i.releaseCodeLenses(t)),void 0,void 0)}registerDefinitionProvider(e,t,i){const n=this._addNewAdapter(new h$e(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,h$e,r=>r.provideDefinition(N.revive(t),i,n),[],n)}registerDeclarationProvider(e,t,i){const n=this._addNewAdapter(new u$e(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,u$e,r=>r.provideDeclaration(N.revive(t),i,n),[],n)}registerImplementationProvider(e,t,i){const n=this._addNewAdapter(new g$e(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,g$e,r=>r.provideImplementation(N.revive(t),i,n),[],n)}registerTypeDefinitionProvider(e,t,i){const n=this._addNewAdapter(new f$e(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,f$e,r=>r.provideTypeDefinition(N.revive(t),i,n),[],n)}registerHoverProvider(e,t,i,n){const r=this._addNewAdapter(new Fz(this._documents,i),e);return this._proxy.$registerHoverProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideHover(e,t,i,n,r){return this._withAdapter(e,Fz,o=>o.provideHover(N.revive(t),i,n,r),void 0,r)}$releaseHover(e,t){this._withAdapter(e,Fz,i=>Promise.resolve(i.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,i,n){const r=this._addNewAdapter(new p$e(this._documents,i),e);return this._proxy.$registerEvaluatableExpressionProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideEvaluatableExpression(e,t,i,n){return this._withAdapter(e,p$e,r=>r.provideEvaluatableExpression(N.revive(t),i,n),void 0,n)}registerInlineValuesProvider(e,t,i,n){const r=typeof i.onDidChangeInlineValues=="function"?this._nextHandle():void 0,o=this._addNewAdapter(new m$e(this._documents,i),e);this._proxy.$registerInlineValuesProvider(o,this._transformDocumentSelector(t,e),r);let a=this._createDisposable(o);if(r!==void 0){const c=i.onDidChangeInlineValues(l=>this._proxy.$emitInlineValuesEvent(r));a=js.from(a,c)}return a}$provideInlineValues(e,t,i,n,r){return this._withAdapter(e,m$e,o=>o.provideInlineValues(N.revive(t),i,n,r),void 0,r)}registerDocumentHighlightProvider(e,t,i){const n=this._addNewAdapter(new _$e(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 v$e(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,_$e,r=>r.provideDocumentHighlights(N.revive(t),i,n),void 0,n)}$provideMultiDocumentHighlights(e,t,i,n,r){return this._withAdapter(e,v$e,o=>o.provideMultiDocumentHighlights(N.revive(t),i,n.map(a=>N.revive(a)),r),void 0,r)}registerLinkedEditingRangeProvider(e,t,i){const n=this._addNewAdapter(new b$e(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,b$e,async r=>{const o=await r.provideLinkedEditingRanges(N.revive(t),i,n);if(o)return{ranges:o.ranges,wordPattern:o.wordPattern?Jc._serializeRegExp(o.wordPattern):void 0}},void 0,n)}registerReferenceProvider(e,t,i){const n=this._addNewAdapter(new w$e(this._documents,i),e);return this._proxy.$registerReferenceSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideReferences(e,t,i,n,r){return this._withAdapter(e,w$e,o=>o.provideReferences(N.revive(t),i,n,r),void 0,r)}registerCodeActionProvider(e,t,i,n){const r=new Z,o=this._addNewAdapter(new zF(this._documents,this._commands.converter,this._diagnostics,i,this._logService,e,this._apiDeprecation),e);return this._proxy.$registerCodeActionSupport(o,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,r)}))},Jc._extLabel(e),Jc._extId(e),!!i.resolveCodeAction),r.add(this._createDisposable(o)),r}$provideCodeActions(e,t,i,n,r){return this._withAdapter(e,zF,o=>o.provideCodeActions(N.revive(t),i,n,r),void 0,r)}$resolveCodeAction(e,t,i){return this._withAdapter(e,zF,n=>n.resolveCodeAction(t,i),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,zF,i=>Promise.resolve(i.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,i){const n=this._addNewAdapter(new y$e(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,y$e,r=>r.provideDocumentFormattingEdits(N.revive(t),i,n),void 0,n)}registerDocumentRangeFormattingEditProvider(e,t,i){const n=typeof i.provideDocumentRangesFormattingEdits=="function",r=this._addNewAdapter(new vge(this._documents,i),e);return this._proxy.$registerRangeFormattingSupport(r,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,n),this._createDisposable(r)}$provideDocumentRangeFormattingEdits(e,t,i,n,r){return this._withAdapter(e,vge,o=>o.provideDocumentRangeFormattingEdits(N.revive(t),i,n,r),void 0,r)}$provideDocumentRangesFormattingEdits(e,t,i,n,r){return this._withAdapter(e,vge,o=>o.provideDocumentRangesFormattingEdits(N.revive(t),i,n,r),void 0,r)}registerOnTypeFormattingEditProvider(e,t,i,n){const r=this._addNewAdapter(new C$e(this._documents,i),e);return this._proxy.$registerOnTypeFormattingSupport(r,this._transformDocumentSelector(t,e),n,e.identifier),this._createDisposable(r)}$provideOnTypeFormattingEdits(e,t,i,n,r,o){return this._withAdapter(e,C$e,a=>a.provideOnTypeFormattingEdits(N.revive(t),i,n,r,o),void 0,o)}registerWorkspaceSymbolProvider(e,t){const i=this._addNewAdapter(new sq(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(i,typeof t.resolveWorkspaceSymbol=="function"),this._createDisposable(i)}$provideWorkspaceSymbols(e,t,i){return this._withAdapter(e,sq,n=>n.provideWorkspaceSymbols(t,i),{symbols:[]},i)}$resolveWorkspaceSymbol(e,t,i){return this._withAdapter(e,sq,n=>n.resolveWorkspaceSymbol(t,i),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,sq,i=>i.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,i){const n=this._addNewAdapter(new Y1(this._documents,i,this._logService),e);return this._proxy.$registerRenameSupport(n,this._transformDocumentSelector(t,e),Y1.supportsResolving(i)),this._createDisposable(n)}$provideRenameEdits(e,t,i,n,r){return this._withAdapter(e,Y1,o=>o.provideRenameEdits(N.revive(t),i,n,r),void 0,r)}$resolveRenameLocation(e,t,i,n){return this._withAdapter(e,Y1,r=>r.resolveRenameLocation(N.revive(t),i,n),void 0,n)}registerNewSymbolNamesProvider(e,t,i){const n=this._addNewAdapter(new Oz(this._documents,i,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,Oz,t=>t.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,i,n,r){return this._withAdapter(e,Oz,o=>o.provideNewSymbolNames(N.revive(t),i,n,r),void 0,r)}registerDocumentSemanticTokensProvider(e,t,i,n){const r=this._addNewAdapter(new Nf(this._documents,i),e),o=typeof i.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(r,this._transformDocumentSelector(t,e),n,o);let a=this._createDisposable(r);if(o){const c=i.onDidChangeSemanticTokens(l=>this._proxy.$emitDocumentSemanticTokensEvent(o));a=js.from(a,c)}return a}$provideDocumentSemanticTokens(e,t,i,n){return this._withAdapter(e,Nf,r=>r.provideDocumentSemanticTokens(N.revive(t),i,n),null,n)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,Nf,i=>i.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,i,n){const r=this._addNewAdapter(new S$e(this._documents,i),e);return this._proxy.$registerDocumentRangeSemanticTokensProvider(r,this._transformDocumentSelector(t,e),n),this._createDisposable(r)}$provideDocumentRangeSemanticTokens(e,t,i,n){return this._withAdapter(e,S$e,r=>r.provideDocumentRangeSemanticTokens(N.revive(t),i,n),null,n)}registerCompletionItemProvider(e,t,i,n){const r=this._addNewAdapter(new g1(this._documents,this._commands.converter,i,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(r,this._transformDocumentSelector(t,e),n,g1.supportsResolving(i),e.identifier),this._createDisposable(r)}$provideCompletionItems(e,t,i,n,r){return this._withAdapter(e,g1,o=>o.provideCompletionItems(N.revive(t),i,n,r),void 0,r)}$resolveCompletionItem(e,t,i){return this._withAdapter(e,g1,n=>n.resolveCompletionItem(t,i),void 0,i)}$releaseCompletionItems(e,t){this._withAdapter(e,g1,i=>i.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,i,n){const r=new Ini(e,this._documents,i,this._commands.converter),o=this._addNewAdapter(r,e);return this._proxy.$registerInlineCompletionsSupport(o,this._transformDocumentSelector(t,e),r.supportsHandleEvents,An.toKey(e.identifier.value),n?.yieldTo?.map(a=>An.toKey(a))||[]),this._createDisposable(o)}$provideInlineCompletions(e,t,i,n,r){return this._withAdapter(e,tF,o=>o.provideInlineCompletions(N.revive(t),i,n,r),void 0,r)}$provideInlineEdits(e,t,i,n,r){return this._withAdapter(e,tF,o=>o.provideInlineEdits(N.revive(t),i,n,r),void 0,r)}$handleInlineCompletionDidShow(e,t,i,n){this._withAdapter(e,tF,async r=>{r.handleDidShowCompletionItem(t,i,n)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,i,n,r){this._withAdapter(e,tF,async o=>{o.handlePartialAccept(t,i,n,r)},void 0,void 0)}$freeInlineCompletionsList(e,t){this._withAdapter(e,tF,async i=>{i.disposeCompletions(t)},void 0,void 0)}registerInlineEditProvider(e,t,i){const n=new wge(e,this._documents,i,this._commands.converter),r=this._addNewAdapter(n,e);return this._proxy.$registerInlineEditProvider(r,this._transformDocumentSelector(t,e),e.identifier),this._createDisposable(r)}$provideInlineEdit(e,t,i,n){return this._withAdapter(e,wge,r=>r.provideInlineEdits(N.revive(t),i,n),void 0,n)}$freeInlineEdit(e,t){this._withAdapter(e,wge,async i=>{i.disposeEdit(t)},void 0,void 0)}registerSignatureHelpProvider(e,t,i,n){const r=Array.isArray(n)?{triggerCharacters:n,retriggerCharacters:[]}:n,o=this._addNewAdapter(new yge(this._documents,i),e);return this._proxy.$registerSignatureHelpProvider(o,this._transformDocumentSelector(t,e),r),this._createDisposable(o)}$provideSignatureHelp(e,t,i,n,r){return this._withAdapter(e,yge,o=>o.provideSignatureHelp(N.revive(t),i,n,r),void 0,r)}$releaseSignatureHelp(e,t){this._withAdapter(e,yge,i=>i.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(e,t,i){const n=typeof i.onDidChangeInlayHints=="function"?this._nextHandle():void 0,r=this._addNewAdapter(new rq(this._documents,this._commands.converter,i,this._logService,e),e);this._proxy.$registerInlayHintsProvider(r,this._transformDocumentSelector(t,e),typeof i.resolveInlayHint=="function",n,Jc._extLabel(e));let o=this._createDisposable(r);if(n!==void 0){const a=i.onDidChangeInlayHints(c=>this._proxy.$emitInlayHintsEvent(n));o=js.from(o,a)}return o}$provideInlayHints(e,t,i,n){return this._withAdapter(e,rq,r=>r.provideInlayHints(N.revive(t),i,n),void 0,n)}$resolveInlayHint(e,t,i){return this._withAdapter(e,rq,n=>n.resolveInlayHint(t,i),void 0,i)}$releaseInlayHints(e,t){this._withAdapter(e,rq,i=>i.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,i){const n=this._addNewAdapter(new eD(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,eD,n=>n.provideLinks(N.revive(t),i),void 0,i,t.scheme==="output")}$resolveDocumentLink(e,t,i){return this._withAdapter(e,eD,n=>n.resolveLink(t,i),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,eD,i=>i.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,i){const n=this._addNewAdapter(new Cge(this._documents,i),e);return this._proxy.$registerDocumentColorProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDocumentColors(e,t,i){return this._withAdapter(e,Cge,n=>n.provideColors(N.revive(t),i),[],i)}$provideColorPresentations(e,t,i,n){return this._withAdapter(e,Cge,r=>r.provideColorPresentations(N.revive(t),i,n),void 0,n)}registerFoldingRangeProvider(e,t,i){const n=this._nextHandle(),r=typeof i.onDidChangeFoldingRanges=="function"?this._nextHandle():void 0;this._adapter.set(n,new G4(new A$e(this._documents,i),e)),this._proxy.$registerFoldingRangeProvider(n,this._transformDocumentSelector(t,e),e.identifier,r);let o=this._createDisposable(n);if(r!==void 0){const a=i.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(r));o=js.from(o,a)}return o}$provideFoldingRanges(e,t,i,n){return this._withAdapter(e,A$e,r=>r.provideFoldingRanges(N.revive(t),i,n),void 0,n)}registerSelectionRangeProvider(e,t,i){const n=this._addNewAdapter(new E$e(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,E$e,r=>r.provideSelectionRanges(N.revive(t),i,n),[],n)}registerCallHierarchyProvider(e,t,i){const n=this._addNewAdapter(new z4(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,z4,r=>Promise.resolve(r.prepareSession(N.revive(t),i,n)),void 0,n)}$provideCallHierarchyIncomingCalls(e,t,i,n){return this._withAdapter(e,z4,r=>r.provideCallsTo(t,i,n),void 0,n)}$provideCallHierarchyOutgoingCalls(e,t,i,n){return this._withAdapter(e,z4,r=>r.provideCallsFrom(t,i,n),void 0,n)}$releaseCallHierarchy(e,t){this._withAdapter(e,z4,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,i){const n=this._addNewAdapter(new $4(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,$4,r=>Promise.resolve(r.prepareSession(N.revive(t),i,n)),void 0,n)}$provideTypeHierarchySupertypes(e,t,i,n){return this._withAdapter(e,$4,r=>r.provideSupertypes(t,i,n),void 0,n)}$provideTypeHierarchySubtypes(e,t,i,n){return this._withAdapter(e,$4,r=>r.provideSubtypes(t,i,n),void 0,n)}$releaseTypeHierarchy(e,t){this._withAdapter(e,$4,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,i,n){const r=this._nextHandle();return this._adapter.set(r,new G4(new oq(this._proxy,this._documents,i,r,e),e)),this._proxy.$registerDocumentOnDropEditProvider(r,this._transformDocumentSelector(t,e),hl(e,"documentPaste")&&n?{supportsResolve:!!i.resolveDocumentDropEdit,dropMimeTypes:n.dropMimeTypes}:void 0),this._createDisposable(r)}$provideDocumentOnDropEdits(e,t,i,n,r,o){return this._withAdapter(e,oq,a=>Promise.resolve(a.provideDocumentOnDropEdits(t,N.revive(i),n,r,o)),void 0,void 0)}$resolveDropEdit(e,t,i){return this._withAdapter(e,oq,n=>n.resolveDropEdit(t,i),{},void 0)}$releaseDocumentOnDropEdits(e,t){this._withAdapter(e,oq,i=>Promise.resolve(i.releaseDropEdits(t)),void 0,void 0)}registerMappedEditsProvider(e,t,i){const n=this._addNewAdapter(new x$e(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,r){return this._withAdapter(e,x$e,o=>Promise.resolve(o.provideMappedEdits(t,i,n,r)),null,r)}registerDocumentPasteEditProvider(e,t,i,n){const r=this._nextHandle();return this._adapter.set(r,new G4(new V4(this._proxy,this._documents,i,r,e),e)),this._proxy.$registerPasteEditProvider(r,this._transformDocumentSelector(t,e),{supportsCopy:!!i.prepareDocumentPaste,supportsPaste:!!i.provideDocumentPasteEdits,supportsResolve:!!i.resolveDocumentPasteEdit,providedPasteEditKinds:n.providedPasteEditKinds?.map(o=>o.value),copyMimeTypes:n.copyMimeTypes,pasteMimeTypes:n.pasteMimeTypes}),this._createDisposable(r)}$prepareDocumentPaste(e,t,i,n,r){return this._withAdapter(e,V4,o=>o.prepareDocumentPaste(N.revive(t),i,n,r),void 0,r)}$providePasteEdits(e,t,i,n,r,o,a){return this._withAdapter(e,V4,c=>c.providePasteEdits(t,N.revive(i),n,r,o,a),void 0,a)}$resolvePasteEdit(e,t,i){return this._withAdapter(e,V4,n=>n.resolvePasteEdit(t,i),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,V4,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:Jc._serializeRegExp(e.decreaseIndentPattern),increaseIndentPattern:Jc._serializeRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Jc._serializeRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Jc._serializeRegExp(e.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(e){return{beforeText:Jc._serializeRegExp(e.beforeText),afterText:e.afterText?Jc._serializeRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Jc._serializeRegExp(e.previousLineText):void 0,action:e.action}}static _serializeOnEnterRules(e){return e.map(Jc._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(t=>lN.toString(t)):void 0}}static _serializeAutoClosingPairs(e){return e.map(Jc._serializeAutoClosingPair)}setLanguageConfiguration(e,t,i){const{wordPattern:n}=i;if(n&&ATe(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 r=this._nextHandle(),o={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Jc._serializeRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Jc._serializeIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Jc._serializeOnEnterRules(i.onEnterRules):void 0,__electricCharacterSupport:i.__electricCharacterSupport,__characterPairSupport:i.__characterPairSupport,autoClosingPairs:i.autoClosingPairs?Jc._serializeAutoClosingPairs(i.autoClosingPairs):void 0};return this._proxy.$setLanguageConfiguration(r,t,o),this._createDisposable(r)}$setWordDefinitions(e){for(const t of e)this._documents.setWordDefinitionFor(t.languageId,new RegExp(t.regexSource,t.regexFlags))}};Jc._handlePool=0;let i0e=Jc;class Tni{constructor(e){this._registeredTools=new Map,this._allTools=new Map,this._proxy=e.getProxy(We.MainThreadLanguageModelTools),this._proxy.$getTools().then(t=>{for(const i of t)this._allTools.set(i.name,Mr(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=>Txe.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 Lni{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(We.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=Yr.from(t),r=await this._proxy.$tokensAtPosition(e.uri,n),o={type:PS.Other,range:e.getWordRangeAtPosition(t)??new Xn(t.line,t.character,t.line,t.character)};if(!r)return o;const a={range:tt.to(r.range),type:exe.to(r.type)};return!a.range.contains(t)||i!==e.version?o:a}createLanguageStatusItem(e,t,i){const n=this._handlePool++,r=this._proxy,o=this._ids,a=`${e.identifier.value}/${t}`;if(o.has(a))throw new Error(`LanguageStatusItem with id '${t}' ALREADY exists`);o.add(a);const c={selector:i,id:t,name:e.displayName??e.name,severity:qT.Information,command:void 0,text:"",detail:"",busy:!1};let l;const d=new Z,h=()=>{if(l?.dispose(),!o.has(a)){console.warn(`LanguageStatusItem (${t}) from ${e.identifier.value} has been disposed and CANNOT be updated anymore`);return}l=Zy(()=>{d.clear(),this._proxy.$setLanguageStatus(n,{id:a,name:c.name??e.displayName??e.name,source:e.displayName??e.name,selector:UH.from(c.selector,this._uriTransformer),label:c.text,detail:c.detail??"",severity:c.severity===qT.Error?Ze.Error:c.severity===qT.Warning?Ze.Warning:Ze.Info,command:c.command&&this._commands.toInternal(c.command,d),accessibilityInfo:c.accessibilityInformation,busy:c.busy})},0)},u={dispose(){d.dispose(),l?.dispose(),r.$removeLanguageStatus(n),o.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){ze(e,"languageStatusText"),c.text=f,h()},get text2(){return ze(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 Rni(s){return s&&s.title}let n0e=class{constructor(e,t){this._logService=t,this._proxy=e.getProxy(We.MainThreadMessageService)}showMessage(e,t,i,n,r){const o={source:{identifier:e.identifier,label:e.displayName||e.name}};let a;typeof n=="string"||Rni(n)?a=[n,...r]:(o.modal=n?.modal,o.useCustom=n?.useCustom,o.detail=n?.detail,a=r),o.useCustom&&ze(e,"resolvers");const c=[];let l=!1;for(let d=0;d{if(typeof d=="number")return a[d]})}};n0e=D([_(1,Ke)],n0e);class Sge{constructor(e,t,i,n){this.start=e,this.deletedCount=t,this.deletedItems=i,this.items=n}asApiEvent(){return{range:new Dy(this.start,this.start+this.deletedCount),addedCells:this.items.map(e=>e.apiCell),removedCells:this.deletedItems}}}class s0e{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(yI.to),this._internalMetadata=i.internalMetadata??{},this._metadata=Object.freeze(i.metadata??{}),this._previousResult=Object.freeze(qH.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:T$.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(yI.to)}setOutputItems(e,t,i){const n=i.map(QH.to),r=this._outputs.find(o=>o.id===e);if(r&&(t||(r.items.length=0),r.items.push(...n),r.items.length>1&&r.items.every(o=>vst(o.mime)))){const o=new Map,a=[];r.items.forEach(c=>{let l;o.has(c.mime)?l=o.get(c.mime):(l=[],o.set(c.mime,l),a.push(c.mime)),l.push(c.data)}),r.items.length=0,a.forEach(c=>{const l=n7t(o.get(c));r.items.push({mime:c,data:l.data.buffer})})}}setMetadata(e){this._metadata=Object.freeze(e)}setInternalMetadata(e){this._internalMetadata=e,this._previousResult=Object.freeze(qH.to(e))}setMime(e){}}const Loe=class Loe{constructor(e,t,i,n,r){this._proxy=e,this._textDocumentsAndEditors=t,this._textDocuments=i,this.uri=n,this.handle=Loe._handlePool++,this._cells=[],this._versionId=0,this._isDirty=!1,this._disposed=!1,this._notebookType=r.viewType,this._metadata=Object.freeze(r.metadata??Object.create(null)),this._spliceNotebookCells([[0,0,r.cells]],!0,void 0),this._versionId=r.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(r=>r.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:[]},r=[];for(const a of e.rawEvents)a.kind===El.ModelChange?this._spliceNotebookCells(a.changes,!1,n.contentChanges):a.kind===El.Move?this._moveCells(a.index,a.length,a.newIdx,n.contentChanges):a.kind===El.Output?(this._setCellOutputs(a.index,a.outputs),r.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===El.OutputItem?(this._setCellOutputItems(a.index,a.outputId,a.append,a.outputItems),r.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===El.ChangeCellLanguage?(this._changeCellLanguage(a.index,a.language),r.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document})):a.kind===El.ChangeCellContent?r.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document}):a.kind===El.ChangeCellMime?this._changeCellMime(a.index,a.mime):a.kind===El.ChangeCellMetadata?(this._changeCellMetadata(a.index,a.metadata),r.push({cell:this._cells[a.index].apiCell,metadata:this._cells[a.index].apiCell.metadata})):a.kind===El.ChangeCellInternalMetadata&&(this._changeCellInternalMetadata(a.index,a.internalMetadata),r.push({cell:this._cells[a.index].apiCell,executionSummary:this._cells[a.index].apiCell.executionSummary}));const o=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 s0e(this,this._textDocumentsAndEditors,u);return t||r.push(s0e.asModelAddData(u)),f}),d=new Sge(a[0],a[1],[],l),h=this._cells.splice(a[0],a[1],...l);for(const u of h)o.push(u.uri),d.deletedItems.push(u.apiCell);n.push(d)}),this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:r,removedDocuments:o}),i)for(const a of n)i.push(a.asApiEvent())}_moveCells(e,t,i,n){const r=this._cells.splice(e,t);this._cells.splice(i,0,...r);const o=[new Sge(e,t,r.map(a=>a.apiCell),[]),new Sge(i,0,[],r)];for(const a of o)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)}};Loe._handlePool=0;let r0e=Loe;const Roe=class Roe{constructor(e,t,i,n,r,o){this.id=e,this._proxy=t,this.notebookData=i,this._selections=[],this._visibleRanges=[],this._visible=!1,this._selections=r,this._visibleRanges=n,this._viewColumn=o}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(Dy.isNotebookRange))throw Fi("selections");e._selections=t,e._trySetSelections(t)},get visibleRanges(){return e._visibleRanges},revealRange(t,i){e._proxy.$tryRevealRange(e.id,zy.from(t),i??u$.Default)},get viewColumn(){return e._viewColumn},[Symbol.for("debug.description")](){return`NotebookEditor(${this.notebook.uri.toString()})`}},Roe.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(zy.from))}_acceptViewColumn(e){this._viewColumn=e}};Roe.apiEditorsToExtHost=new WeakMap;let d7=Roe;class Mni 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 h3;e.acceptChunk(this._source);const t=e.finish(!0),{textBuffer:i,disposable:n}=t.create(Db.LF);this._inputTextBuffer=i,this._register(n)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||(this._outputTextBuffers=this._outputs.map(e=>{const t=new h3;t.acceptChunk(e);const i=t.finish(!0),{textBuffer:n,disposable:r}=i.create(Db.LF);return this._register(r),n})),this._outputTextBuffers}findInInputs(e){const i=new jC(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 jC(e,!1,!1,null).parseSearchRequest();return i?this.outputTextBuffers.map(n=>{const r=n.findMatchesLineByLine(this._getFullModelRange(n),i,!0,5e3);if(r.length!==0)return{textBuffer:n,matches:r}}).filter(n=>!!n):[]}}function D$e(s,e){let t=-1;const i=[];let n=[];return s.forEach(o=>{o.range.startLineNumber!==t&&n.length>0&&(i.push([...n]),n=[]),n.push(o),t=o.range.endLineNumber}),n.length>0&&i.push([...n]),i.map(o=>{const a=[],c=o[0].range.startLineNumber,l=o[o.length-1].range.endLineNumber;for(let d=c;d<=l;d++)a.push(e.getLineContent(d));return new R9t(a.join(` `)+` -`,o.map(d=>new F(d.range.startLineNumber-1,d.range.startColumn-1,d.range.endLineNumber-1,d.range.endColumn-1)))})}const D1=class D1{get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(e,t,i,n,r,o,a){this._textDocumentsAndEditors=i,this._textDocuments=n,this._extHostFileSystem=r,this._extHostSearch=o,this._logService=a,this._notebookStatusBarItemProviders=new Map,this._documents=new gi,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 Am("NotebookCellStatusBarCache"),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=e.getProxy(We.MainThreadNotebook),this._notebookDocumentsProxy=e.getProxy(We.MainThreadNotebookDocuments),this._notebookEditorsProxy=e.getProxy(We.MainThreadNotebookEditors),this._commandsConverter=t.converter,t.registerArgumentProcessor({processArgument:c=>{if(c&&c.$mid===ys.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===ys.NotebookActionContext){const l=c.uri,d=this._documents.get(l);if(d)return d.apiNotebook}return c}}),D1._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=>die.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?C$.exclusive:void 0}}registerNotebookCellStatusBarItemProvider(e,t,i){const n=D1._notebookStatusBarItemProviderHandlePool++,r=typeof i.onDidChangeCellStatusBarItems=="function"?D1._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(n,i),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(n,r,t);let o;return r!==void 0&&(o=i.onDidChangeCellStatusBarItems(a=>this._notebookProxy.$emitCellStatusBarEvent(r))),new js(()=>{this._notebookStatusBarItemProviders.delete(n),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(n,r),o?.dispose()})}async createNotebookDocument(e){const t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&VE.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:Dl.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(zy.from),pinned:typeof t.preview=="boolean"?!t.preview:void 0}:i={preserveFocus:!1};const n=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,e.notebookType,i),r=n&&this._editors.get(n)?.apiEditor;if(r)return r;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 r=this._notebookStatusBarItemProviders.get(e),o=N.revive(t),a=this._documents.get(o);if(!a||!r)return;const c=a.getCellFromIndex(i);if(!c)return;const l=await r.provideCellStatusBarItems(c.apiCell,n);if(!l)return;const d=new Z,h=this._statusBarCache.add([d]),f=(Array.isArray(l)?l:[l]).map(p=>_xe.from(p,this._commandsConverter,d));return{cacheId:h,items:f}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(e,t,i,n,r){if(Qu(t))throw new Error("viewType cannot be empty or just whitespace");const o=this._handlePool++;return this._notebookSerializer.set(o,{viewType:t,serializer:i,options:n}),this._notebookProxy.$registerNotebookSerializer(o,{id:e.identifier,location:e.extensionLocation},t,bxe.from(n),D1._convertNotebookRegistrationData(e,r)),Ee(()=>{this._notebookProxy.$unregisterNotebookSerializer(o)})}async $dataToNotebook(e,t,i){const n=this._notebookSerializer.get(e);if(!n)throw new Error("NO serializer found");const r=await n.serializer.deserializeNotebook(t.buffer,i);return new Jd(VE.from(r))}async $notebookToData(e,t,i){const n=this._notebookSerializer.get(e);if(!n)throw new Error("NO serializer found");const r=await n.serializer.serializeNotebook(VE.to(t.value),i);return Ge.wrap(r)}async $saveNotebook(e,t,i,n,r){const o=N.revive(t),a=this._notebookSerializer.get(e);if(this.trace(`enter saveNotebook(versionId: ${i}, ${o.toString()})`),!a)throw new Error("NO serializer found");const c=this._documents.get(o);if(!c)throw new Error("Document NOT found");if(c.versionId!==i)throw new Error("Document version mismatch");if(!this._extHostFileSystem.value.isWritableFileSystem(o.scheme))throw new Rd(g(4585,"Unable to modify read-only file '{0}'",this._resourceForError(o)),ji.FILE_PERMISSION_DENIED);const l={metadata:Mj(c.apiNotebook.metadata,p=>!(a.options?.transientDocumentMetadata??{})[p]),cells:[]};for(const p of c.apiNotebook.getCells()){const m=new vG(p.kind,p.document.getText(),p.document.languageId,p.mime,a.options?.transientOutputs?[]:[...p.outputs],p.metadata,p.executionSummary);m.metadata=Mj(p.metadata,v=>!(a.options?.transientCellMetadata??{})[v]),l.cells.push(m)}if(await this._validateWriteFile(o,n),r.isCancellationRequested)throw new Error("canceled");const d=await a.serializer.serializeNotebook(l,r);if(r.isCancellationRequested)throw new Error("canceled");this.trace(`serialized versionId: ${i} ${o.toString()}`),await this._extHostFileSystem.value.writeFile(o,d),this.trace(`Finished write versionId: ${i} ${o.toString()}`);const h=this._extHostFileSystem.getFileSystemProviderExtUri(o.scheme),u=await this._extHostFileSystem.value.stat(o),f={name:h.basename(o),isFile:(u.type&rn.File)!==0,isDirectory:(u.type&rn.Directory)!==0,isSymbolicLink:(u.type&rn.SymbolicLink)!==0,mtime:u.mtime,ctime:u.ctime,size:u.size,readonly:!!((u.permissions??0)&up.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(o.scheme),locked:!!((u.permissions??0)&up.Locked),etag:nJ({mtime:u.mtime,size:u.size}),children:void 0};return this.trace(`exit saveNotebook(versionId: ${i}, ${o.toString()})`),f}async $searchInNotebooks(e,t,i,n,r){const o=this._notebookSerializer.get(e)?.serializer;if(!o)return{limitHit:!1,results:[]};const a=new Mk;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:fI.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=>ljt(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,r,t);const l=new gi;let d=!1;const h=Array.from(a).map(async u=>{const f=[];try{if(r.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=Ge.fromString(b.toString()),y=await o.deserializeNotebook(w.buffer,r);if(r.isCancellationRequested)return;VE.from(y).cells.forEach(A=>p.push({input:A.source,outputs:A.outputs.flatMap(L=>L.items.map(k=>k.valueBytes.toString()))}))}if(r.isCancellationRequested)return;p.forEach((b,w)=>{const y=t.contentPattern.pattern,C=new Rni(b.input,void 0,b.outputs),A=C.findInInputs(y),L=C.findInOutputs(y),k=L.flatMap(P=>D$e(P.matches,P.textBuffer)).map((P,R)=>(P.webviewIndex=R,P));if(A.length>0||L.length>0){const P={index:w,contentResults:D$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!==x_&&typeof i.mtime=="number"&&typeof i.size=="number"&&t.mtimer.document.uri)}),this._onDidCloseNotebookDocument.fire(n.apiNotebook));for(const r of this._editors.values())r.notebookData.uri.toString()===i.toString()&&this._editors.delete(r.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 r=new r0e(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,n,i);t.push(...i.cells.map(o=>s0e.asModelAddData(o))),this._documents.get(n)?.dispose(),this._documents.set(n,r),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({addedDocuments:t}),this._onDidOpenNotebookDocument.fire(r.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=ut.String.with("notebookType","A notebook type"),i=new fn("vscode.executeDataToNotebook","_executeDataToNotebook","Invoke notebook serializer",[t,new ut("data","Bytes to convert to data",r=>r instanceof Uint8Array,r=>Ge.wrap(r))],new sn("Notebook Data",r=>VE.to(r.value))),n=new fn("vscode.executeNotebookToData","_executeNotebookToData","Invoke notebook serializer",[t,new ut("NotebookData","Notebook data to convert to bytes",r=>!0,r=>new Jd(VE.from(r)))],new sn("Bytes",r=>r.buffer));e.registerApiCommand(i),e.registerApiCommand(n)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}};D1._notebookStatusBarItemProviderHandlePool=0;let o0e=D1;class Mni{constructor(e,t,i,n={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=i,this._thresholds=n,this._onWillSaveNotebookDocumentEvent=new tD}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,i,n)=>{const r=function(a){t.call(i,a)};return r.extension=e,this._onWillSaveNotebookDocumentEvent.event(r,void 0,n)}}async $participateInSave(e,t,i){const n=N.revive(e),r=this._notebooksAndEditors.getNotebookDocument(n);if(!r)throw new Error("Unable to resolve notebook document");const o=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:r.apiNotebook,reason:oie.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 _I?o.push(h):this._logService.warn("onWillSaveNotebookDocument-listener from extension",l.extension.identifier,"ignored due to invalid data"))}),i.isCancellationRequested)return!1;if(o.length===0)return!0;const a={edits:[]};for(const c of o){const{edits:l}=Zu.from(c);a.edits=a.edits.concat(l)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new Jd(a))}}class Nni{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 o=this._notebooksAndEditors.getNotebookDocument(N.revive(e)).acceptModelChanged(t.value,i,n);this._onDidChangeNotebookDocument.fire(o)}$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 a0e=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(zy.to)),t.selections&&i._acceptSelections(t.selections.selections.map(zy.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(Dl.to(e[t]))}};a0e=D([_(0,Ke)],a0e);const Pni=100;let c0e=class{constructor(e,t,i,n,r){this._initData=t,this._extHostNotebook=i,this._commands=n,this._logService=r,this._activeExecutions=new gi,this._activeNotebookExecutions=new gi,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(We.MainThreadNotebookKernels);const o=new fn("notebook.selectKernel","_notebook.selectKernel","Trigger kernel picker for specified notebook editor widget",[new ut("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})],sn.Void),a=new fn("vscode.executeNotebookVariableProvider","_executeNotebookVariableProvider","Execute notebook variable provider",[ut.Uri],new sn("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(o),this._commands.registerApiCommand(a)}createNotebookController(e,t,i,n,r,o){for(const A of this._kernelData.values())if(A.controller.id===t&&An.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:aq(e.identifier,t),notebookType:i,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:n||e.identifier.value,preloads:o?o.map(hie.from):[]};let p=r??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 gi,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(hie.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){ze(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,aq(e.identifier,this.id))},createNotebookExecution(A){if(ze(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,aq(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===g$.Hidden&&ze(e,"notebookControllerAffinityHidden"),c._proxy.$updateNotebookPriority(a,A.uri,L)},onDidReceiveMessage:u.event,postMessage(A,L){return ze(e,"notebookMessaging"),c._proxy.$postMessage(a,L&&c._extHostNotebook.getIdByEditor(L),A)},asWebviewUri(A){return ze(e,"notebookMessaging"),Pz(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 aq(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 r={dispose:()=>{this._kernelDetectionTask.delete(i),n._proxy.$removeKernelDetectionTask(i)}};return this._kernelDetectionTask.set(i,r),r}registerKernelSourceActionProvider(e,t,i){const n=this._kernelSourceActionProviderHandlePool++,r=typeof i.onDidChangeNotebookKernelSourceActions=="function"?n:void 0,o=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 r!==void 0&&(a=i.onDidChangeNotebookKernelSourceActions(c=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(r))),{dispose:()=>{this._kernelSourceActionProviders.delete(n),o._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(o=>vxe.from(o,this._commands.converter,n))}return[]}$acceptNotebookAssociation(e,t,i){const n=this._kernelData.get(e);if(n){const r=this._extHostNotebook.getNotebookDocument(N.revive(t));i?n.associatedNotebooks.set(r.uri,!0):n.associatedNotebooks.delete(r.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,r.uri.toString(),i),n.onDidChangeSelection.fire({selected:i,notebook:r.apiNotebook})}}async $executeCells(e,t,i){const n=this._kernelData.get(e);if(!n)return;const r=this._extHostNotebook.getNotebookDocument(N.revive(t)),o=[];for(const a of i){const c=r.getCell(a);c&&o.push(c.apiCell)}try{this._logService.trace(`NotebookController[${e}] EXECUTE cells`,r.uri.toString(),o.length),await n.controller.executeHandler.call(n.controller,o,r.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 r=this._extHostNotebook.getNotebookDocument(N.revive(t));if(n.controller.interruptHandler)await n.controller.interruptHandler.call(n.controller,r.apiNotebook);else for(const o of i){const a=r.getCell(o);a&&this._activeExecutions.get(a.uri)?.cancel()}if(n.controller.interruptHandler){const o=this._activeNotebookExecutions.get(r.uri);this._activeNotebookExecutions.delete(r.uri),i.length&&Array.isArray(o)&&o.length&&o.forEach(a=>a.dispose())}}async $provideVariables(e,t,i,n,r,o,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=r==="named"?DH.Named:DH.Indexed,f=d.provideVariables(l.apiNotebook,h,u,o,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++>=Pni)return}}$acceptKernelMessageFromRenderer(e,t,i){const n=this._kernelData.get(e);if(!n)return;const r=this._extHostNotebook.getEditorById(t);n.onDidReceiveMessage.fire(Object.freeze({editor:r.apiEditor,message:i}))}$cellExecutionChanged(e,t,i){const r=this._extHostNotebook.getNotebookDocument(N.revive(e)).getCell(t);if(r){const o=i?mxe.to(i):fN.Idle;o!==void 0&&this._onDidChangeCellExecutionState.fire({cell:r.apiCell,state:o})}}_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 r=new l0e(t,n,this._proxy);this._activeExecutions.set(n.uri,r);const o=r.onDidChangeState(()=>{r.state===Vv.Resolved&&(r.dispose(),o.dispose(),this._activeExecutions.delete(n.uri))});return r.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 r=new d0e(t,i,this._proxy),o=r.onDidChangeState(()=>{r.state===tS.Resolved&&(r.dispose(),o.dispose(),this._activeNotebookExecutions.delete(i.uri))});return this._activeNotebookExecutions.set(i.uri,[r,o]),r.asApiObject()}};c0e=D([_(4,Ke)],c0e);var Vv;(function(s){s[s.Init=0]="Init",s[s.Started=1]="Started",s[s.Resolved=2]="Resolved"})(Vv||(Vv={}));const Moe=class Moe extends V{get state(){return this._state}constructor(e,t,i){super(),this._cell=t,this._proxy=i,this._handle=Moe.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=Vv.Init,this._tokenSource=this._register(new li),this._collector=new Fni(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===Vv.Init)throw new Error("Must call start before modifying cell output");if(this._state===Vv.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=d$.ensureUniqueMimeTypes(t.items,!0);return i===t.items?yI.from(t):yI.from({items:i,id:t.id,metadata:t.metadata})})}async updateOutputs(e,t,i){const n=this.cellIndexToHandle(t),r=this.validateAndConvertOutputs(z_(e));return this.updateSoon({editType:Yx.Output,cellHandle:n,append:i,outputs:r})}async updateOutputItems(e,t,i){return e=d$.ensureUniqueMimeTypes(z_(e),!0),this.updateSoon({editType:Yx.OutputItems,items:e.map(QH.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:Yx.ExecutionState,executionOrder:e._executionOrder}])},start(i){if(e._state===Vv.Resolved||e._state===Vv.Started)throw new Error("Cannot call start again");e._state=Vv.Started,e._onDidChangeState.fire(),e.update({editType:Yx.ExecutionState,runStartTime:i})},end(i,n,r){if(e._state===Vv.Resolved)throw new Error("Cannot call resolve twice");e._state=Vv.Resolved,e._onDidChangeState.fire(),e._collector.flush();const o=r?{message:r.message,stack:r.stack,location:r?.location?{startLineNumber:r.location.start.line,startColumn:r.location.start.character,endLineNumber:r.location.end.line,endColumn:r.location.end.character}:void 0,uri:r.uri}:void 0;e._proxy.$completeExecution(e._handle,new Jd({runEndTime:n,lastRunSuccess:i,error:o}))},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)}})}};Moe.HANDLE=0;let l0e=Moe;var tS;(function(s){s[s.Init=0]="Init",s[s.Started=1]="Started",s[s.Resolved=2]="Resolved"})(tS||(tS={}));const Noe=class Noe extends V{get state(){return this._state}constructor(e,t,i){super(),this._notebook=t,this._proxy=i,this._handle=Noe.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=tS.Init,this._tokenSource=this._register(new li),this._proxy.$createNotebookExecution(this._handle,e,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===tS.Resolved||this._state===tS.Started)throw new Error("Cannot call start again");this._state=tS.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===tS.Resolved)throw new Error("Cannot call resolve twice");this._state=tS.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}};Noe.HANDLE=0;let d0e=Noe;class Fni{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 hc,this.startedTimer=Date.now(),Ao(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 aq(s,e){return`${s.value}/${e}`}class Oni{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(We.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,r,o)=>this.getOrCreateEmitterFor(t).event(n,r,o),postMessage:(n,r)=>{d7.apiEditorsToExtHost.has(n)&&([n,r]=[r,n]);const o=r&&d7.apiEditorsToExtHost.get(r);return this.proxy.$postMessage(o?.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 Bni{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(We.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,i){if(ze(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 r=this.handlers.get(e);if(!r)throw new Error(`Unknown handler with id: ${e}`);return r.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(Rt(t)?t:N.revive(t),i)}}class Wni{constructor(e){this._handles=0,this._mapHandleToCancellationSource=new Map,this._proxy=e}async withProgress(e,t,i){const n=this._handles++,{title:r,location:o,cancellable:a}=t,c={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(n,{location:fxe.from(o),title:r,source:c,cancellable:a},e.isUnderDevelopment?void 0:e.identifier.value).catch(Nr),this._withProgress(n,i,!!a)}_withProgress(e,t,i){let n;i&&(n=new li,this._mapHandleToCancellationSource.set(e,n));const r=a=>{this._proxy.$progressEnd(a),this._mapHandleToCancellationSource.delete(a),n?.dispose()};let o;try{o=t(new h0e(this._proxy,e),i&&n?n.token:Ue.None)}catch(a){throw r(e),a}return o.then(a=>r(e),a=>r(e)),o}$acceptProgressCanceled(e){const t=this._mapHandleToCancellationSource.get(e);t&&(t.cancel(),this._mapHandleToCancellationSource.delete(e))}}function Hni(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 h0e extends hu{constructor(e,t){super(i=>this.throttledReport(i)),this._proxy=e,this._handle=t}throttledReport(e){this._proxy.$progressReport(this._handle,e)}}h0e.__decorator=D([UEt(100,(s,e)=>Hni(s,e),()=>Object.create(null))],h0e.prototype,"throttledReport",null);const Poe=class Poe{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(We.MainThreadQuickDiff)}$provideOriginalResource(e,t,i){const n=N.revive(t),r=this.providers.get(e);return r?Jh(()=>r.provideOriginalResource(n,i)).then(o=>o||null):Promise.resolve(null)}registerQuickDiffProvider(e,t,i,n){const r=Poe.handlePool++;return this.providers.set(r,t),this.proxy.$registerQuickDiffProvider(r,UH.from(e,this.uriTransformer),i,n),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(r),this.providers.delete(r)}}}};Poe.handlePool=0;let u0e=Poe;function Uni(s,e,t){const i=s.getProxy(We.MainThreadQuickOpen);class n{constructor(p,m){this._sessions=new Map,this._instances=0,this._workspace=p,this._commands=m}showQuickPick(p,m,v,b=Ue.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=hl(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(!Oo(k))return i.$setError(y,k),Promise.reject(k)})}$onItemSelected(p){this._onDidSelectItem?.(p)}showInput(p,m=Ue.None){return this._validateInput=p?.validateInput,i.$input(p,typeof this._validateInput=="function",m).then(void 0,v=>{if(!Oo(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 ZT.Info:v=Ze.Info;break;case ZT.Warning:v=Ze.Warning;break;case ZT.Error:v=Ze.Error;break;default:v=m.message?Ze.Error:Ze.Ignore;break}return{content:m.message,severity:v}}async showWorkspaceFolderPick(p,m=Ue.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=hl(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===EH.Back?-1:b;this._handlesToButtons.set(w,v)}),this.update({buttons:p.map((v,b)=>({...l(v.iconPath),tooltip:v.tooltip,handle:v===EH.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=wt(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 r=u;function o(f){if(f instanceof fu)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=o(f);let m,v;return"id"in p?v=He.asClassName(p):m=p,{iconPath:m,iconClass:v}}class d extends r{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=hl(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=Oi(p.map(v=>this._handlesToItems.get(v)));this._activeItems=m,this._onDidChangeActiveEmitter.fire(m)}_fireDidChangeSelection(p){const m=Oi(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 r{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:Ze.Error}):this.update({validationMessage:p.message,severity:p.severity??Ze.Error}):this.update({validationMessage:void 0,severity:Ze.Ignore})}}return new n(e,t)}var g0e;function k$e(s){return s instanceof N}function Vni(s,e){return s.scheme===pe.file&&e.scheme===pe.file&&mo?s.toString()===e.toString():s.toString().toLowerCase()===e.toString().toLowerCase()}function Age(s){if(s)return typeof s.iconPath=="string"?N.file(s.iconPath):N.isUri(s.iconPath)||He.isThemeIcon(s.iconPath)?s.iconPath:void 0}function I$e(s){if(s){if(N.isUri(s))return s;if(He.isThemeIcon(s))return s;{const e=s;return{light:e.light,dark:e.dark}}}else return}function Ege(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 xge(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 rQ(t,i)}function zni(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=xge(s,e),t!==0)return t;if(s.light&&e.light)t=xge(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=xge(s.dark,e.dark);else{if(s.dark)return 1;if(e.dark)return-1}return t}function $ni(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(T$e),i=lTe(this._resourceSnapshot,e,T$e).map(o=>{const a=o.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=hl(this._extension,"scmMultiDiffEditor"),f=u?c.multiDiffEditorOriginalUri:void 0,p=u?c.multiFileDiffEditorModifiedUri:void 0,m=Age(c.decorations),v=c.decorations&&Age(c.decorations.light)||m,b=c.decorations&&Age(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:o.start,deleteCount:o.deleteCount,toInsert:a}}),n=i.map(({start:o,deleteCount:a,toInsert:c})=>[o,a,c.map(l=>l.rawResource)]),r=i.reverse();for(const{start:o,deleteCount:a,toInsert:c}of r){const l=c.map(h=>h.handle),d=this._handlesSnapshot.splice(o,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()}};Foe._handlePool=0;let f0e=Foe;var kd;const Ooe=class Ooe{constructor(e,t,i,n,r,o,a){Ht(this,kd);this._extension=e,this._commands=n,this._id=r,this._label=o,this._rootUri=a,this._groups=new Map,this._count=void 0,this._quickDiffProvider=void 0,this._historyProviderDisposable=new yn,this._commitTemplate=void 0,this._acceptInputDisposables=new yn,this._acceptInputCommand=void 0,this._actionButtonDisposables=new yn,this._statusBarDisposables=new yn,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new I,this.onDidChangeSelection=this._onDidChangeSelection.event,this.handle=Ooe._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,St(this,kd,i);const c=N.from({scheme:pe.vscodeSourceControl,path:`${r}/scm${this.handle}/input`,query:a?`rootUri=${encodeURIComponent(a.toString())}`:void 0});this._inputBox=new Qni(e,t,Ce(this,kd),this.handle,c),Ce(this,kd).$registerSourceControl(this.handle,r,o,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,kd).$updateSourceControl(this.handle,{count:e}))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;hl(this._extension,"quickDiffProvider")&&(t=e?.label),Ce(this,kd).$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t})}get historyProvider(){return ze(this._extension,"scmHistoryProvider"),this._historyProvider}set historyProvider(e){ze(this._extension,"scmHistoryProvider"),this._historyProvider=e,this._historyProviderDisposable.value=new Z,Ce(this,kd).$updateSourceControl(this.handle,{hasHistoryProvider:!!e}),e&&this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemGroup(()=>{this._historyProviderCurrentHistoryItemGroup=e?.currentHistoryItemGroup,Ce(this,kd).$onDidChangeHistoryProviderCurrentHistoryItemGroup(this.handle,this._historyProviderCurrentHistoryItemGroup)}))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,Ce(this,kd).$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,kd).$updateSourceControl(this.handle,{acceptInputCommand:t})}get actionButton(){return ze(this._extension,"scmActionButton"),this._actionButton}set actionButton(e){ze(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,kd).$updateSourceControl(this.handle,{actionButton:t??null})}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&qni(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,kd).$updateSourceControl(this.handle,{statusBarCommands:t})}get selected(){return this._selected}createResourceGroup(e,t,i){const n=hl(this._extension,"scmMultiDiffEditor")&&i?.multiDiffEditorEnableViewChanges===!0,r=new f0e(Ce(this,kd),this._commands,this.handle,e,t,n,this._extension),o=M.once(r.onDidDispose)(()=>this.createdResourceGroups.delete(r));return this.createdResourceGroups.set(r,o),this.eventuallyAddResourceGroups(),r}eventuallyAddResourceGroups(){const e=[],t=[];for(const[i,n]of this.createdResourceGroups){n.dispose();const r=i.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(i),this.eventuallyUpdateResourceStates()});M.once(i.onDidDispose)(()=>{this.updatedResourceGroups.delete(i),r.dispose(),this._groups.delete(i.handle),Ce(this,kd).$unregisterGroup(this.handle,i.handle)}),e.push([i.handle,i.id,i.label,i.features,i.multiDiffEditorEnableViewChanges]);const o=i._takeResourceStateSnapshot();o.length>0&&t.push([i.handle,o]),this._groups.set(i.handle,i)}Ce(this,kd).$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,kd).$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,kd).$unregisterSourceControl(this.handle)}};kd=new WeakMap,Ooe._handlePool=0;let SN=Ooe;SN.__decorator=D([fRe(100)],SN.prototype,"eventuallyAddResourceGroups",null);SN.__decorator=D([fRe(100)],SN.prototype,"eventuallyUpdateResourceStates",null);var mM;let p0e=(mM=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 ba,this._onDidChangeActiveProvider=new I,this._proxy=e.getProxy(We.MainThreadSCM),this._telemetry=e.getProxy(We.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:r=>{if(r&&r.$mid===ys.ScmResource){const o=this._sourceControls.get(r.sourceControlHandle);if(!o)return r;const a=o.getResourceGroup(r.groupHandle);return a?a.getResourceState(r.handle):r}else if(r&&r.$mid===ys.ScmResourceGroup){const o=this._sourceControls.get(r.sourceControlHandle);return o?o.getResourceGroup(r.groupHandle):r}else if(r&&r.$mid===ys.ScmProvider){const o=this._sourceControls.get(r.handle);return o||r}return r}})}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 r=g0e._handlePool++,o=new SN(e,this._extHostDocuments,this._proxy,this._commands,t,i,n);this._sourceControls.set(r,o);const a=this._sourceControlsByExtension.get(e.identifier)||[];return a.push(o),this._sourceControlsByExtension.set(e.identifier,a),o}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 r=this._sourceControls.get(e);return!r||!r.quickDiffProvider||!r.quickDiffProvider.provideOriginalResource?Promise.resolve(null):Jh(()=>r.quickDiffProvider.provideOriginalResource(n,i)).then(o=>o||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 r=this._sourceControls.get(e);if(!r)return Promise.resolve(void 0);const o=r.getResourceGroup(t);return o?o.$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(r=>{if(!r)return Promise.resolve(void 0);const o=Fs.fromStrict(r.message);return o?Promise.resolve([o,r.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=>Ege(a))??void 0}async $provideHistoryItems2(e,t,i){return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems2(t,i))?.map(o=>Ege(o))??void 0}async $provideHistoryItemSummary(e,t,i,n){const r=this._sourceControls.get(e)?.historyProvider;if(typeof r?.provideHistoryItemSummary!="function")return;const o=await r.provideHistoryItemSummary(t,i,n);return o?Ege(o):void 0}async $provideHistoryItemChanges(e,t,i,n){return await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemChanges(t,i,n)??void 0}},g0e=mM,mM._handlePool=0,mM);p0e=g0e=D([_(3,Ke)],p0e);const Boe=class Boe{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(We.MainThreadShare)}async $provideShare(e,t,i){return await this.providers.get(e)?.provideShare({selection:tt.to(t.selection),resourceUri:N.revive(t.resourceUri)},i)??void 0}registerShareProvider(e,t){const i=Boe.handlePool++;return this.providers.set(i,t),this.proxy.$registerShareProvider(i,UH.from(e,this.uriTransformer),t.id,t.label,t.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(i),this.providers.delete(i)}}}};Boe.handlePool=0;let m0e=Boe;const Woe=class Woe{constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(We.MainThreadSpeech)}async $createSpeechToTextSession(e,t,i){const n=this.providers.get(e);if(!n)return;const r=new Z,o=new li;this.sessions.set(t,o);const a=await n.provideSpeechToTextSession(o.token,i?{language:i}:void 0);a&&(r.add(a.onDidChange(c=>{o.token.isCancellationRequested||this.proxy.$emitSpeechToTextEvent(t,c)})),r.add(o.token.onCancellationRequested(()=>r.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 r=new Z,o=new li;this.sessions.set(t,o);const a=await n.provideTextToSpeechSession(o.token,i?{language:i}:void 0);a&&(this.synthesizers.set(t,a),r.add(a.onDidChange(c=>{o.token.isCancellationRequested||this.proxy.$emitTextToSpeechEvent(t,c)})),r.add(o.token.onCancellationRequested(()=>r.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,r=new li;this.sessions.set(t,r);const o=await i.provideKeywordRecognitionSession(r.token);o&&(n.add(o.onDidChange(a=>{r.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,a)})),n.add(r.token.onCancellationRequested(()=>n.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(e,t,i){const n=Woe.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)})}};Woe.ID_POOL=1;let _0e=Woe;var a2,c2;const k1=class k1{constructor(e,t,i,n,r,o=NS.Left,a){Ht(this,a2);Ht(this,c2);if(this._disposed=!1,this._text="",this._staleCommandRegistrations=new Z,St(this,a2,e),St(this,c2,t),r&&n){this._entryId=u7t(n.identifier,r);const c=i.get(this._entryId);c&&(o=c.alignLeft?NS.Left:NS.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(k1.ID_GEN++);this._extension=n,this._id=r,this._alignment=o,this._priority=this.validatePriority(a)}validatePriority(e){if(dc(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&&!k1.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,c2).toInternal({title:"",command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:Ce(this,c2).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,a2).$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=k1.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));const n=Fs.fromStrict(this._tooltip);Ce(this,a2).$setEntry(this._entryId,e,this._extension?.identifier.value,t,this._text,n,this._command?.internal,i,this._backgroundColor,this._alignment===NS.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._disposed=!0}};a2=new WeakMap,c2=new WeakMap,k1.ID_GEN=0,k1.ALLOWED_BACKGROUND_COLORS=new Map([["statusBarItem.errorBackground",new _H("statusBarItem.errorForeground")],["statusBarItem.warningBackground",new _H("statusBarItem.warningForeground")]]);let v0e=k1;class jni{constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,"status.extensionMessage",NS.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 js(()=>{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 Yni{constructor(e,t){this._existingItems=new Map,this._proxy=e.getProxy(We.MainThreadStatusBar),this._commands=t,this._statusMessage=new jni(this)}$acceptStaticEntries(e){for(const t of e)this._existingItems.set(t.entryId,t)}createStatusBarEntry(e,t,i,n){return new v0e(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 js(()=>{i.dispose(),clearTimeout(n)})}}class Jni 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(We.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:Dl.from(t),preserveFocus:i}:typeof t=="object"?n={position:Dl.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?tt.from(t.selection):void 0,pinned:typeof t.preview=="boolean"?!t.preview:void 0}:n={preserveFocus:!1};const r=await this._proxy.$tryShowTextDocument(e.uri,n),o=r&&this._extHostDocumentsAndEditors.getEditor(r);if(o)return o.value;throw r?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 mIe(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(zb.to);i._acceptSelections(n)}if(t.visibleRanges){const n=Oi(t.visibleRanges.map(tt.to));i._acceptVisibleRanges(n)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:i.value,options:{...t.options,lineNumbers:gB.to(t.options.lineNumbers)}}),t.selections){const n=cN.fromValue(t.selections.source),r=t.selections.selections.map(zb.to);this._onDidChangeTextEditorSelection.fire({textEditor:i.value,selections:r,kind:n})}if(t.visibleRanges){const n=Oi(t.visibleRanges.map(tt.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=Dl.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 b0e=class{constructor(e){this._actual=new vte(wS.Dark),this._onDidChangeActiveColorTheme=new I}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case"light":t=wS.Light;break;case"hcDark":t=wS.HighContrast;break;case"hcLight":t=wS.HighContrastLight;break;default:t=wS.Dark}this._actual=new vte(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};b0e=D([_(0,Jr)],b0e);class Xni{constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(We.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(i,n)=>{if(i&&i.$mid===ys.TimelineActionContext)if(this._providers.get(i.source)&&An.equals(n,this._providers.get(i.source)?.extension)){const r=i.uri===void 0?void 0:N.revive(i.uri);return this._itemsBySourceAndUriMap.get(i.source)?.get(L$e(r))?.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 r=new Z,o=this.convertTimelineItem(t.id,n,r).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&&(r.clear(),c.get(t.id)?.clear());const u=await t.provideTimeline(l,d,h);if(u==null)return;const f=o(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(),r.dispose()}},i)}convertTimelineItem(e,t,i){return(n,r)=>{let o;if(r?.cacheResults){let a=this._itemsBySourceAndUriMap.get(e);a===void 0&&(a=new Map,this._itemsBySourceAndUriMap.set(e,a));const c=L$e(n);o=a.get(c),o===void 0&&(o=new Map,a.set(c,o))}return a=>{const{iconPath:c,...l}=a,d=`${e}|${a.id??a.timestamp}`;o?.set(d,a);let h,u,f;a.iconPath&&(c instanceof fu?f={id:c.id,color:c.color}:N.isUri(c)?(h=c,u=c):{light:h,dark:u}=c);let p;return gf.isMarkdownString(l.tooltip)?p=Fs.from(l.tooltip):Rt(l.tooltip)?p=l.tooltip:gf.isMarkdownString(l.detail)?(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=Fs.from(l.detail)):Rt(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 L$e(s){return s?.toString()}function R$e(s,e){if(Rt(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 Zni extends V{constructor(e,t,i){super(),this._proxy=e,this.commands=t,this.logService=i,this.treeViews=new Map,this.treeDragAndDropService=new uMe;function n(r){return r&&r.$treeViewId&&(r.$treeItemHandle||r.$selectedTreeItems||r.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:r=>n(r)?this.convertArgument(r):Array.isArray(r)&&r.length>0?r.map(o=>n(o)?this.convertArgument(o):o):r})}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??[],r=t.dragAndDropController?.dragMimeTypes??[],o=!!t.dragAndDropController?.handleDrag,a=!!t.dragAndDropController?.handleDrop,c=this.createExtHostTreeView(e,t,i),l={showCollapseAll:!!t.showCollapseAll,canSelectMany:!!t.canSelectMany,dropMimeTypes:n,dragMimeTypes:r,hasHandleDrag:o,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 ze(i,"treeViewActiveItem"),c.focusedElement},get onDidChangeActiveItem(){return ze(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){ud(u)&&ze(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&&fEe.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 rw(e))}async $handleDrop(e,t,i,n,r,o,a,c){const l=this.treeViews.get(e);if(!l)return Promise.reject(new rw(e));const d=U_.toDataTransfer(i,async h=>(await this._proxy.$resolveDropFileData(e,t,h)).buffer);return a===e&&c&&await this.addAdditionalTransferItems(d,l,c,r,o),l.onDrop(d,n,r)}async addAdditionalTransferItems(e,t,i,n,r){const o=this.treeDragAndDropService.removeDragOperationTransfer(r);if(o)(await o)?.forEach((a,c)=>{a&&e.set(c,a)});else if(r&&t.handleDrag){const a=t.handleDrag(i,e,n);this.treeDragAndDropService.addDragOperationTransfer(r,a),await a}return e}async $handleDrag(e,t,i,n){const r=this.treeViews.get(e);if(!r)return Promise.reject(new rw(e));const o=await this.addAdditionalTransferItems(new mH,r,t,n,i);if(!(!o||n.isCancellationRequested))return U_.from(o)}async $hasResolve(e){const t=this.treeViews.get(e);if(!t)throw new rw(e);return t.hasResolve}$resolve(e,t,i){const n=this.treeViews.get(e);if(!n)throw new rw(e);return n.resolveTreeItem(t,i)}$setExpanded(e,t,i){const n=this.treeViews.get(e);if(!n)throw new rw(e);n.setExpanded(t,i)}$setSelectionAndFocus(e,t,i){const n=this.treeViews.get(e);if(!n)throw new rw(e);n.setSelectionAndFocus(t,i)}$setVisible(e,t){const i=this.treeViews.get(e);if(!i){if(!t)return;throw new rw(e)}i.setVisible(t)}$changeCheckboxState(e,t){const i=this.treeViews.get(e);if(!i)throw new rw(e);i.setCheckboxState(t)}createExtHostTreeView(e,t,i){const n=this._register(new w0e(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 LO=class LO extends V{get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!aa(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,i,n,r,o){if(super(),this.viewId=e,this.proxy=i,this.commands=n,this.logService=r,this.extension=o,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 li,o.contributes&&o.contributes.views)for(const d in o.contributes.views)for(const h of o.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,Fs.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=aa(t.select)?!0:t.select,n=aa(t.focus)?!1:t.focus,r=aa(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(o=>this.resolveTreeNode(e,o[o.length-1]).then(a=>this.proxy.$reveal(this.viewId,{item:a.item,parentChain:o.map(c=>c.item)},{select:i,focus:n,expand:r})),o=>this.logService.error(o)):this.proxy.$reveal(this.viewId,void 0,{select:i,focus:n,expand:r})}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=gie.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=!ns(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?fb.Checked:fb.Unchecked}:Promise.resolve(void 0)}))).filter(i=>i!==void 0);t.forEach(i=>{i.treeItem.checkboxState=i.newState?fb.Checked:fb.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(i=>[i.extensionItem,i.newState])})}async handleDrag(e,t,i){const n=[];for(const r of e){const o=this.getExtensionElement(r);o&&n.push(o)}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 r=await this.dataProvider.resolveTreeItem(n.extensionItem,i,t)??n.extensionItem;return this.validateTreeItem(r),n.item.tooltip=this.getTooltip(r.tooltip),n.item.command=this.getCommand(n.disposableStore,r.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 r=this.getExtensionElement(n);if(r){const o=this.nodes.get(r);if(o)return Promise.resolve(o)}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 li(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 r=Oi(n||[]),o=await Promise.all(Oi(r).map(c=>this.dataProvider.getTreeItem(c)));if(t.token.isCancellationRequested)return;const a=o.map((c,l)=>c?this.createAndRegisterTreeNode(r[l],c,i):null);return Oi(a)}finally{t.dispose()}}refresh(e){if(e.some(i=>!i))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new li,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(r=>this.nodes.get(r));for(const r of i)if(r&&!t.has(r.item.handle)){let o=r;for(;o&&o.parent&&i.findIndex(a=>o&&o.parent&&a&&a.item.handle===o.parent.item.handle)===-1;){const a=this.elements.get(o.parent.item.handle);o=a?this.nodes.get(a):void 0}o&&!o.parent&&t.add(r.item.handle)}const n=[];return t.forEach(r=>{const o=this.elements.get(r);if(o){const a=this.nodes.get(o);a&&(!a.parent||!t.has(a.parent.item.handle))&&n.push(r)}}),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 r=this.createTreeNode(t,n,i.parent);return this.updateNodeCache(t,r,i,i.parent),i.dispose(),r}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 gf.isMarkdownString(e)?Fs.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===fb.Checked,tooltip:i,accessibilityInformation:n}}validateTreeItem(e){if(!X9.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),r=this.createHandle(e,t,i),o=this.getLightIconPath(t);return{item:{handle:r,parentHandle:i?i.item.handle:void 0,label:R$e(t.label),description:t.description,resourceUri:t.resourceUri,tooltip:this.getTooltip(t.tooltip),command:this.getCommand(n,t.command),contextValue:t.contextValue,icon:o,iconDark:this.getDarkIconPath(t)||o,themeIcon:this.getThemeIcon(t),collapsibleState:aa(t.collapsibleState)?AD.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 fu?e.iconPath:void 0}createHandle(e,{id:t,label:i,resourceUri:n},r,o){if(t)return`${LO.ID_HANDLE_PREFIX}/${t}`;const a=R$e(i),c=r?r.item.handle:LO.LABEL_HANDLE_PREFIX;let l=a?a.label:n?vi(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(r)||[];let u,f=0;do{if(u=`${c}/${f}:${l}`,o||!this.elements.has(u)||d===u)break;f++}while(f<=h.length);return u}getLightIconPath(e){if(e.iconPath&&!(e.iconPath instanceof fu))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 fu)&&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 r=this.getChildrenNodes(n)||[],o=r.filter(a=>a.item.handle===i.item.handle)[0];o&&r.splice(r.indexOf(o),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)}};LO.LABEL_HANDLE_PREFIX="0",LO.ID_HANDLE_PREFIX="1";let w0e=LO;const Hoe=class Hoe{constructor(e){this._openers=new Map,this._proxy=e.getProxy(We.MainThreadUriOpeners)}registerExternalUriOpener(e,t,i,n){if(this._openers.has(t))throw new Error(`Opener with id '${t}' already registered`);const r=n.schemes.find(o=>!Hoe.supportedSchemes.has(o));if(r)throw new Error(`Scheme '${r}' 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 r=N.revive(t);return n.canOpenExternalUri(r,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)}};Hoe.supportedSchemes=new Set([pe.http,pe.https]);let y0e=Hoe;const Uoe=class Uoe{constructor(e){this.handles=new D_,this.handlers=new Map,this._proxy=e.getProxy(We.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=Uoe.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){bt(n)}return Promise.resolve(void 0)}async createAppUri(e){return N.revive(await this._proxy.$createAppUri(e))}};Uoe.HandlePool=0;let C0e=Uoe;var _x,vx,O7,l2,B7,dT,d2,oS,h2,u2,bx,g2,f2;class esi extends V{constructor(t,i,n,r){super();Ht(this,_x);Ht(this,vx);Ht(this,O7);Ht(this,l2);Ht(this,B7);Ht(this,dT);Ht(this,d2);Ht(this,oS);Ht(this,h2);Ht(this,u2);Ht(this,bx);Ht(this,g2);Ht(this,f2);St(this,oS,void 0),St(this,h2,!0),St(this,bx,!1),St(this,g2,this._register(new I)),this.onDidDispose=Ce(this,g2).event,St(this,f2,this._register(new I)),this.onDidChangeViewState=Ce(this,f2).event,St(this,_x,t),St(this,vx,i),St(this,l2,n),St(this,O7,r.viewType),St(this,B7,r.panelOptions),St(this,oS,r.viewColumn),St(this,dT,r.title),St(this,u2,r.active)}dispose(){Ce(this,bx)||(St(this,bx,!0),Ce(this,g2).fire(),Ce(this,vx).$disposeWebview(Ce(this,_x)),Ce(this,l2).dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),Ce(this,l2)}get viewType(){return this.assertNotDisposed(),Ce(this,O7)}get title(){return this.assertNotDisposed(),Ce(this,dT)}set title(t){this.assertNotDisposed(),Ce(this,dT)!==t&&(St(this,dT,t),Ce(this,vx).$setTitle(Ce(this,_x),t))}get iconPath(){return this.assertNotDisposed(),Ce(this,d2)}set iconPath(t){this.assertNotDisposed(),Ce(this,d2)!==t&&(St(this,d2,t),Ce(this,vx).$setIconPath(Ce(this,_x),N.isUri(t)?{light:t,dark:t}:t))}get options(){return Ce(this,B7)}get viewColumn(){if(this.assertNotDisposed(),!(typeof Ce(this,oS)=="number"&&Ce(this,oS)<0))return Ce(this,oS)}get active(){return this.assertNotDisposed(),Ce(this,u2)}get visible(){return this.assertNotDisposed(),Ce(this,h2)}_updateViewState(t){Ce(this,bx)||(this.active!==t.active||this.visible!==t.visible||this.viewColumn!==t.viewColumn)&&(St(this,u2,t.active),St(this,h2,t.visible),St(this,oS,t.viewColumn),Ce(this,f2).fire({webviewPanel:this}))}reveal(t,i){this.assertNotDisposed(),Ce(this,vx).$reveal(Ce(this,_x),{viewColumn:typeof t>"u"?void 0:Dl.from(t),preserveFocus:!!i})}assertNotDisposed(){if(Ce(this,bx))throw new Error("Webview is disposed")}}_x=new WeakMap,vx=new WeakMap,O7=new WeakMap,l2=new WeakMap,B7=new WeakMap,dT=new WeakMap,d2=new WeakMap,oS=new WeakMap,h2=new WeakMap,u2=new WeakMap,bx=new WeakMap,g2=new WeakMap,f2=new WeakMap;class fFe extends V{static newHandle(){return ao()}constructor(e,t,i){super(),this.webviews=t,this.workspace=i,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(We.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(e,t,i,n,r={}){const o=typeof n=="object"?n.viewColumn:n,a={viewColumn:Dl.from(o),preserveFocus:typeof n=="object"&&!!n.preserveFocus},c=tU(e),l=fFe.newHandle();this._proxy.$createWebviewPanel(bne(e),l,t,{title:i,panelOptions:tsi(r),webviewOptions:Bot(e,this.workspace,r),serializeBuffersForPostMessage:c},a);const d=this.webviews.createNewWebview(l,r,e);return this.createNewWebviewPanel(l,t,i,o,r,d,!0)}$onDidChangeWebviewPanelViewStates(e){const t=Object.keys(e);t.sort((i,n)=>{const r=e[i],o=e[n];return r.active?1:o.active?-1:+r.visible-+o.visible});for(const i of t){const n=this.getWebviewPanel(i);if(!n)continue;const r=e[i];n._updateViewState({active:r.active,visible:r.visible,viewColumn:Dl.to(r.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:tU(e)}),new js(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,i,n){const r=this._serializers.get(t);if(!r)throw new Error(`No serializer found for '${t}'`);const{serializer:o,extension:a}=r,c=this.webviews.createNewWebview(e,i.webviewOptions,a),l=this.createNewWebviewPanel(e,t,i.title,n,i.panelOptions,c,i.active);await o.deserializeWebviewPanel(l,i.state)}createNewWebviewPanel(e,t,i,n,r,o,a){const c=new esi(e,this._proxy,o,{viewType:t,title:i,viewColumn:n,panelOptions:r,active:a});return this._webviewPanels.set(e,c),c}getWebviewPanel(e){return this._webviewPanels.get(e)}}function tsi(s){return{enableFindWidget:s.enableFindWidget,retainContextWhenHidden:s.retainContextWhenHidden}}var wx,yx,W7,p2,Cx,hT,uT,m2,gT,_2,v2;class isi extends V{constructor(t,i,n,r,o,a){super();Ht(this,wx);Ht(this,yx);Ht(this,W7);Ht(this,p2);Ht(this,Cx);Ht(this,hT);Ht(this,uT);Ht(this,m2);Ht(this,gT);Ht(this,_2);Ht(this,v2);St(this,Cx,!1),St(this,_2,this._register(new I)),this.onDidChangeVisibility=Ce(this,_2).event,St(this,v2,this._register(new I)),this.onDidDispose=Ce(this,v2).event,St(this,W7,n),St(this,uT,r),St(this,wx,t),St(this,yx,i),St(this,p2,o),St(this,hT,a)}dispose(){Ce(this,Cx)||(St(this,Cx,!0),Ce(this,v2).fire(),Ce(this,p2).dispose(),super.dispose())}get title(){return this.assertNotDisposed(),Ce(this,uT)}set title(t){this.assertNotDisposed(),Ce(this,uT)!==t&&(St(this,uT,t),Ce(this,yx).$setWebviewViewTitle(Ce(this,wx),t))}get description(){return this.assertNotDisposed(),Ce(this,m2)}set description(t){this.assertNotDisposed(),Ce(this,m2)!==t&&(St(this,m2,t),Ce(this,yx).$setWebviewViewDescription(Ce(this,wx),t))}get visible(){return Ce(this,hT)}get webview(){return Ce(this,p2)}get viewType(){return Ce(this,W7)}_setVisible(t){t===Ce(this,hT)||Ce(this,Cx)||(St(this,hT,t),Ce(this,_2).fire())}get badge(){return this.assertNotDisposed(),Ce(this,gT)}set badge(t){this.assertNotDisposed(),!(t?.value===Ce(this,gT)?.value&&t?.tooltip===Ce(this,gT)?.tooltip)&&(St(this,gT,gie.from(t)),Ce(this,yx).$setWebviewViewBadge(Ce(this,wx),t))}show(t){this.assertNotDisposed(),Ce(this,yx).$show(Ce(this,wx),!!t)}assertNotDisposed(){if(Ce(this,Cx))throw new Error("Webview is disposed")}}wx=new WeakMap,yx=new WeakMap,W7=new WeakMap,p2=new WeakMap,Cx=new WeakMap,hT=new WeakMap,uT=new WeakMap,m2=new WeakMap,gT=new WeakMap,_2=new WeakMap,v2=new WeakMap;class nsi{constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(We.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(bne(e),t,{retainContextWhenHidden:n?.retainContextWhenHidden,serializeBuffersForPostMessage:tU(e)}),new js(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,i,n,r){const o=this._viewProviders.get(t);if(!o)throw new Error(`No view provider found for '${t}'`);const{provider:a,extension:c}=o,l=this._extHostWebview.createNewWebview(e,{},c),d=new isi(e,this._proxy,t,i,l,!0);this._webviewViews.set(e,d),await a.resolveWebviewView(d,{state:n},r)}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 ssi(s){const e=s.get(bu),t=s.get(n4),i=s.get(Sle),n=s.get(WI),r=s.get(dE),o=s.get(Ele),a=s.get(hE),c=s.get(Ale),l=s.get(Jr),d=s.get(sFe),h=s.get(rFe),u=s.get(pf),f=s.get(Ke),p=s.get(KPe),m=s.get(xle),v=s.get(Pot),b=s.get(cFe),w=s.get(xG),y=s.get(dFe),C=s.get(oFe),A=s.get(aFe);l.set(Je.ExtHostFileSystemInfo,t),l.set(Je.ExtHostLogLevelServiceShape,u),l.set(Je.ExtHostWorkspace,r),l.set(Je.ExtHostConfiguration,a),l.set(Je.ExtHostExtensionService,n),l.set(Je.ExtHostStorage,d),l.set(Je.ExtHostTunnelService,p),l.set(Je.ExtHostWindow,v),l.set(Je.ExtHostSecretState,b),l.set(Je.ExtHostTelemetry,o),l.set(Je.ExtHostEditorTabs,w),l.set(Je.ExtHostManagedSockets,y),l.set(Je.ExtHostAuthentication,C),l.set(Je.ExtHostChatProvider,A);const L=l.set(Je.ExtHostDecorations,s.get(yot)),k=l.set(Je.ExtHostDocumentsAndEditors,s.get(s4)),P=l.set(Je.ExtHostCommands,s.get(iP)),R=l.set(Je.ExtHostTerminalService,s.get(r4)),z=l.set(Je.ExtHostTerminalShellIntegration,s.get(Fot)),G=l.set(Je.ExtHostDebugService,s.get(Mot)),Y=l.set(Je.ExtHostSearch,s.get(Not)),j=l.set(Je.ExtHostTask,s.get(Eot)),ne=l.set(Je.ExtHostOutputService,s.get(bot)),ge=l.set(Je.ExtHostLocalization,s.get(lFe)),De=l.set(Je.ExtHostUrls,new C0e(l)),Be=l.set(Je.ExtHostDocuments,new bni(l,k)),Ct=l.set(Je.ExtHostDocumentContentProviders,new t0e(l,k,f)),Ne=l.set(Je.ExtHostDocumentSaveParticipant,new vni(f,Be,l.getProxy(We.MainThreadBulkEdits))),dt=l.set(Je.ExtHostNotebook,new o0e(l,P,k,Be,i,Y,f)),Dt=l.set(Je.ExtHostNotebookDocuments,new Nni(dt)),Xi=l.set(Je.ExtHostNotebookEditors,new a0e(f,dt)),Ti=l.set(Je.ExtHostNotebookKernels,new c0e(l,e,dt,P,f)),ss=l.set(Je.ExtHostNotebookRenderers,new Oni(l,dt)),$s=l.set(Je.ExtHostNotebookDocumentSaveParticipant,new Mni(f,dt,l.getProxy(We.MainThreadBulkEdits))),Fn=l.set(Je.ExtHostEditors,new Jni(l,k)),Zo=l.set(Je.ExtHostTreeViews,new Zni(l.getProxy(We.MainThreadTreeViews),P,f)),hs=l.set(Je.ExtHostEditorInsets,new nni(l.getProxy(We.MainThreadEditorInsets),Fn,e.remote)),Zr=l.set(Je.ExtHostDiagnostics,new e0e(l,f,t,k)),ea=l.set(Je.ExtHostLanguages,new Tni(l,Be,P.converter,c)),ki=l.set(Je.ExtHostLanguageFeatures,new i0e(l,c,Be,P,Zr,f,m,o)),rs=l.set(Je.ExtHostFileSystem,new yne(l,ki)),Or=l.set(Je.ExtHostFileSystemEventService,new Eni(l,f,k)),Ln=l.set(Je.ExtHostQuickOpen,Uni(l,r,P)),Wa=l.set(Je.ExtHostSCM,new p0e(l,P,Be,f)),wd=l.set(Je.ExtHostQuickDiff,new u0e(l,c)),On=l.set(Je.ExtHostShare,new m0e(l,c)),nh=l.set(Je.ExtHostComments,sni(l,P,Be)),mc=l.set(Je.ExtHostProgress,new Wni(l.getProxy(We.MainThreadProgress))),$c=l.set(Je.ExtHostLabelService,new Dni(l)),Gs=l.set(Je.ExtHostTheming,new b0e(l)),ic=l.set(Je.ExtHostTimeline,new Xni(l,P)),pl=l.set(Je.ExtHostWebviews,new ani(l,e.remote,r,f,m)),sh=l.set(Je.ExtHostWebviewPanels,new fFe(l,pl,r)),mg=l.set(Je.ExtHostCustomEditors,new gni(l,Be,h,pl,sh)),_c=l.set(Je.ExtHostWebviewViews,new nsi(l,pl)),Gc=l.set(Je.ExtHostTesting,s.get(kle)),rh=l.set(Je.ExtHostUriOpeners,new y0e(l)),kc=l.set(Je.ExtHostProfileContentHandlers,new Bni(l));l.set(Je.ExtHostInteractive,new xni(l,dt,k,P,f));const ml=l.set(Je.ExtHostChatAgents2,new JIe(l,f,P,Be)),nc=l.set(Je.ExtHostChatVariables,new XIe(l)),Bo=l.set(Je.ExtHostLanguageModelTools,new Ini(l)),_l=l.set(Je.ExtHostAiRelatedInformation,new jii(l)),oh=l.set(Je.ExtHostAiEmbeddingVector,new yni(l)),ah=l.set(Je.ExtHostStatusBar,new Yni(l,P.converter)),Kc=l.set(Je.ExtHostSpeech,new _0e(l)),qc=l.set(Je.ExtHostEmbeddings,new wni(l)),Ha=Object.values(Je);l.assertRegistered(Ha);const Br=new YIe(l,k),Ts=new eni(l),Ic=new n0e(l,f),Fh=new _ni(l);return Jii.register(P),function(be,Ea,ee){function xe(O){return($,se,qe)=>{const Wi=O(Hi=>{try{$.call(se,Hi)}catch(ia){Nr(new Error(`[ExtensionListenerError] Extension '${be.identifier.value}' FAILED to handle event: ${ia.toString()}`,{cause:ia})),o.onExtensionError(be.identifier,ia)}});return qe?.push(Wi),Wi}}const ft=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(qe){if(Array.isArray(qe))qe.forEach(se);else if(typeof qe=="string")$();else{const Wi=qe;typeof Wi.scheme>"u"&&$(),typeof Wi.exclusive=="boolean"&&ze(be,"documentFiltersExclusive")}return qe}}(),$n={getSession(O,$,se){return typeof se?.forceNewSession=="object"&&se.forceNewSession.learnMore&&ze(be,"authLearnMore"),se?.account&&ze(be,"authGetSessions"),C.getSession(be,O,$,se)},getAccounts(O){return ze(be,"authGetSessions"),C.getAccounts(O)},async hasSession(O,$){return ze(be,"authSession"),!!await C.getSession(be,O,$,{silent:!0})},get onDidChangeSessions(){return xe(C.onDidChangeSessions)},registerAuthenticationProvider(O,$,se,qe){return C.registerAuthenticationProvider(O,$,se,qe)}},Ss={registerCommand(O,$,se){return P.registerCommand(!0,O,$,se,void 0,be)},registerTextEditorCommand(O,$,se){return P.registerCommand(!0,O,(...qe)=>{const Wi=Fn.getActiveTextEditor();if(!Wi){f.warn("Cannot execute "+O+" because there is no active text editor.");return}return Wi.edit(Hi=>{$.apply(se,[Wi,Hi,...qe])}).then(Hi=>{Hi||f.warn("Edits from command "+O+" were not applied.")},Hi=>{f.warn("An error occurred while running command "+O,Hi)})},void 0,void 0,be)},registerDiffInformationCommand:(O,$,se)=>(ze(be,"diffCommand"),P.registerCommand(!0,O,async(...qe)=>{const Wi=k.activeEditor(!0);if(!Wi){f.warn("Cannot execute "+O+" because there is no active text editor.");return}const Hi=await Fn.getDiffInformation(Wi.id);$.apply(se,[Hi,...qe])},void 0,void 0,be)),executeCommand(O,...$){return P.executeCommand(O,...$)},getCommands(O=!1){return P.getCommands(O)}},Wr={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 Ts.value},get shell(){return R.getDefaultShell(!1)},get onDidChangeShell(){return xe(R.onDidChangeShell)},get isTelemetryEnabled(){return o.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return xe(o.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return ze(be,"telemetry"),o.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return ze(be,"telemetry"),xe(o.onDidChangeTelemetryConfiguration)},get isNewAppInstall(){return Sot(e.telemetryInfo.firstSessionDate)},createTelemetryLogger(O,$){return Cot.validateSender(O),o.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(IA(O,pe.http)||IA(O,pe.https))return O;throw $}},get remoteName(){return W6(e.remote.authority)},get remoteAuthority(){return ze(be,"resolvers"),e.remote.authority},get uiKind(){return e.uiKind},get logLevel(){return f.getLevel()},get onDidChangeLogLevel(){return xe(f.onDidChangeLogLevel)},get appQuality(){return ze(be,"resolvers"),e.quality},get appCommit(){return ze(be,"resolvers"),e.commit}},Ua={createTestController(O,$,se){return Gc.createTestController(be,O,$,se)},createTestObserver(){return ze(be,"testObserver"),Gc.createTestObserver()},runTests(O){return ze(be,"testObserver"),Gc.runTests(O)},registerTestFollowupProvider(O){return ze(be,"testObserver"),Gc.registerTestFollowupProvider(O)},get onDidChangeTestResults(){return ze(be,"testObserver"),xe(Gc.onResultsChanged)},get testResults(){return ze(be,"testObserver"),Gc.results}},ta=e.remote.isRemote?ED.Workspace:ED.UI,Oh={getExtension(O,$){hl(be,"extensionsAny")||($=!1);const se=Ea.mine.getExtensionDescription(O);if(se)return new jV(n,be.identifier,se,ta,!1);if($){const qe=Ea.all.getExtensionDescription(O);if(qe)return new jV(n,be.identifier,qe,ta,!0)}},get all(){const O=[];for(const $ of Ea.mine.getAllExtensionDescriptions())O.push(new jV(n,be.identifier,$,ta,!1));return O},get allAcrossExtensionHosts(){ze(be,"extensionsAny");const O=new D_(Ea.mine.getAllExtensionDescriptions().map(se=>se.identifier)),$=[];for(const se of Ea.all.getAllExtensionDescriptions()){const qe=!O.has(se.identifier);$.push(new jV(n,be.identifier,se,ta,qe))}return $},get onDidChange(){return hl(be,"extensionsAny")?xe(M.any(Ea.mine.onDidChange,Ea.all.onDidChange)):xe(Ea.mine.onDidChange)}},le={createDiagnosticCollection(O){return Zr.createDiagnosticCollection(be.identifier,O)},get onDidChangeDiagnostics(){return xe(Zr.onDidChangeDiagnostics)},getDiagnostics:O=>Zr.getDiagnostics(O),getLanguages(){return ea.getLanguages()},setTextDocumentLanguage(O,$){return ea.changeLanguage(O.uri,$)},match(O,$){const se=pxe.from(O);let qe;return Kje(se)&&(qe=dt.notebookDocuments.find(Wi=>Wi.apiNotebook.getCells().find(Hi=>Hi.document===$))?.apiNotebook),kae(se,$.uri,$.languageId,!0,qe?.uri,qe?.notebookType)},registerCodeActionsProvider(O,$,se){return ki.registerCodeActionProvider(be,ft(O),$,se)},registerDocumentPasteEditProvider(O,$,se){return ze(be,"documentPaste"),ki.registerDocumentPasteEditProvider(be,ft(O),$,se)},registerCodeLensProvider(O,$){return ki.registerCodeLensProvider(be,ft(O),$)},registerDefinitionProvider(O,$){return ki.registerDefinitionProvider(be,ft(O),$)},registerDeclarationProvider(O,$){return ki.registerDeclarationProvider(be,ft(O),$)},registerImplementationProvider(O,$){return ki.registerImplementationProvider(be,ft(O),$)},registerTypeDefinitionProvider(O,$){return ki.registerTypeDefinitionProvider(be,ft(O),$)},registerHoverProvider(O,$){return ki.registerHoverProvider(be,ft(O),$,be.identifier)},registerEvaluatableExpressionProvider(O,$){return ki.registerEvaluatableExpressionProvider(be,ft(O),$,be.identifier)},registerInlineValuesProvider(O,$){return ki.registerInlineValuesProvider(be,ft(O),$,be.identifier)},registerDocumentHighlightProvider(O,$){return ki.registerDocumentHighlightProvider(be,ft(O),$)},registerMultiDocumentHighlightProvider(O,$){return ki.registerMultiDocumentHighlightProvider(be,ft(O),$)},registerLinkedEditingRangeProvider(O,$){return ki.registerLinkedEditingRangeProvider(be,ft(O),$)},registerReferenceProvider(O,$){return ki.registerReferenceProvider(be,ft(O),$)},registerRenameProvider(O,$){return ki.registerRenameProvider(be,ft(O),$)},registerNewSymbolNamesProvider(O,$){return ze(be,"newSymbolNamesProvider"),ki.registerNewSymbolNamesProvider(be,ft(O),$)},registerDocumentSymbolProvider(O,$,se){return ki.registerDocumentSymbolProvider(be,ft(O),$,se)},registerWorkspaceSymbolProvider(O){return ki.registerWorkspaceSymbolProvider(be,O)},registerDocumentFormattingEditProvider(O,$){return ki.registerDocumentFormattingEditProvider(be,ft(O),$)},registerDocumentRangeFormattingEditProvider(O,$){return ki.registerDocumentRangeFormattingEditProvider(be,ft(O),$)},registerOnTypeFormattingEditProvider(O,$,se,...qe){return ki.registerOnTypeFormattingEditProvider(be,ft(O),$,[se].concat(qe))},registerDocumentSemanticTokensProvider(O,$,se){return ki.registerDocumentSemanticTokensProvider(be,ft(O),$,se)},registerDocumentRangeSemanticTokensProvider(O,$,se){return ki.registerDocumentRangeSemanticTokensProvider(be,ft(O),$,se)},registerSignatureHelpProvider(O,$,se,...qe){return typeof se=="object"?ki.registerSignatureHelpProvider(be,ft(O),$,se):ki.registerSignatureHelpProvider(be,ft(O),$,typeof se>"u"?[]:[se,...qe])},registerCompletionItemProvider(O,$,...se){return ki.registerCompletionItemProvider(be,ft(O),$,se)},registerInlineCompletionItemProvider(O,$,se){return $.handleDidShowCompletionItem&&ze(be,"inlineCompletionsAdditions"),$.handleDidPartiallyAcceptCompletionItem&&ze(be,"inlineCompletionsAdditions"),se&&ze(be,"inlineCompletionsAdditions"),ki.registerInlineCompletionsProvider(be,ft(O),$,se)},registerInlineEditProvider(O,$){return ze(be,"inlineEdit"),ki.registerInlineEditProvider(be,ft(O),$)},registerDocumentLinkProvider(O,$){return ki.registerDocumentLinkProvider(be,ft(O),$)},registerColorProvider(O,$){return ki.registerColorProvider(be,ft(O),$)},registerFoldingRangeProvider(O,$){return ki.registerFoldingRangeProvider(be,ft(O),$)},registerSelectionRangeProvider(O,$){return ki.registerSelectionRangeProvider(be,O,$)},registerCallHierarchyProvider(O,$){return ki.registerCallHierarchyProvider(be,O,$)},registerTypeHierarchyProvider(O,$){return ki.registerTypeHierarchyProvider(be,O,$)},setLanguageConfiguration:(O,$)=>ki.setLanguageConfiguration(be,O,$),getTokenInformationAtPosition(O,$){return ze(be,"tokenInformation"),ea.tokenAtPosition(O,$)},registerInlayHintsProvider(O,$){return ki.registerInlayHintsProvider(be,O,$)},createLanguageStatusItem(O,$){return ea.createLanguageStatusItem(be,O,$)},registerDocumentDropEditProvider(O,$,se){return ki.registerDocumentOnDropEditProvider(be,O,$,hl(be,"documentPaste")?se:void 0)}},ho={get activeTextEditor(){return Fn.getActiveTextEditor()},get visibleTextEditors(){return Fn.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 qe=await(N.isUri(O)?Promise.resolve(nr.openTextDocument(O)):Promise.resolve(O));return Fn.showTextDocument(qe,$,se)},createTextEditorDecorationType(O){return Fn.createTextEditorDecorationType(be,O)},onDidChangeActiveTextEditor(O,$,se){return xe(Fn.onDidChangeActiveTextEditor)(O,$,se)},onDidChangeVisibleTextEditors(O,$,se){return xe(Fn.onDidChangeVisibleTextEditors)(O,$,se)},onDidChangeTextEditorSelection(O,$,se){return xe(Fn.onDidChangeTextEditorSelection)(O,$,se)},onDidChangeTextEditorOptions(O,$,se){return xe(Fn.onDidChangeTextEditorOptions)(O,$,se)},onDidChangeTextEditorVisibleRanges(O,$,se){return xe(Fn.onDidChangeTextEditorVisibleRanges)(O,$,se)},onDidChangeTextEditorViewColumn(O,$,se){return xe(Fn.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 ze(be,"terminalDimensions"),xe(R.onDidChangeTerminalDimensions)(O,$,se)},onDidChangeTerminalState(O,$,se){return xe(R.onDidChangeTerminalState)(O,$,se)},onDidWriteTerminalData(O,$,se){return ze(be,"terminalDataWriteEvent"),xe(R.onDidWriteTerminalData)(O,$,se)},onDidExecuteTerminalCommand(O,$,se){return ze(be,"terminalExecuteCommandEvent"),xe(R.onDidExecuteTerminalCommand)(O,$,se)},onDidChangeTerminalShellIntegration(O,$,se){return ze(be,"terminalShellIntegration"),xe(z.onDidChangeTerminalShellIntegration)(O,$,se)},onDidStartTerminalShellExecution(O,$,se){return ze(be,"terminalShellIntegration"),xe(z.onDidStartTerminalShellExecution)(O,$,se)},onDidEndTerminalShellExecution(O,$,se){return ze(be,"terminalShellIntegration"),xe(z.onDidEndTerminalShellExecution)(O,$,se)},get state(){return v.getState()},onDidChangeWindowState(O,$,se){return xe(v.onDidChangeWindowState)(O,$,se)},showInformationMessage(O,...$){return Ic.showMessage(be,Ze.Info,O,$[0],$.slice(1))},showWarningMessage(O,...$){return Ic.showMessage(be,Ze.Warning,O,$[0],$.slice(1))},showErrorMessage(O,...$){return Ic.showMessage(be,Ze.Error,O,$[0],$.slice(1))},showQuickPick(O,$,se){return Ln.showQuickPick(be,O,$,se)},showWorkspaceFolderPick(O){return Ln.showWorkspaceFolderPick(O)},showInputBox(O,$){return Ln.showInput(O,$)},showOpenDialog(O){return Fh.showOpenDialog(be,O)},showSaveDialog(O){return Fh.showSaveDialog(O)},createStatusBarItem(O,$,se){let qe,Wi,Hi;return typeof O=="string"?(qe=O,Wi=$,Hi=se):(Wi=O,Hi=$),ah.createStatusBarEntry(be,qe,Wi,Hi)},setStatusBarMessage(O,$){return ah.setStatusBarMessage(O,$)},withScmProgress(O){return m.report("window.withScmProgress",be,"Use 'withProgress' instead."),mc.withProgress(be,{location:SD.SourceControl},($,se)=>O({report(qe){}}))},withProgress(O,$){return mc.withProgress(be,O,$)},createOutputChannel(O,$){return ne.createOutputChannel(O,$,be)},createWebviewPanel(O,$,se,qe){return sh.createWebviewPanel(be,O,$,se,qe)},createWebviewTextEditorInset(O,$,se,qe){return ze(be,"editorInsets"),hs.createWebviewEditorInset(O,$,se,qe,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 ze(be,"terminalQuickFixProvider"),R.registerTerminalQuickFixProvider(O,be.identifier.value,$)},registerTreeDataProvider(O,$){return Zo.registerTreeDataProvider(O,$,be)},createTreeView(O,$){return Zo.createTreeView(O,$,be)},registerWebviewPanelSerializer:(O,$)=>sh.registerWebviewPanelSerializer(be,O,$),registerCustomEditorProvider:(O,$,se={})=>mg.registerCustomEditorProvider(be,O,$,se),registerFileDecorationProvider(O){return L.registerFileDecorationProvider(O,be)},registerUriHandler(O){return De.registerUriHandler(be,O)},createQuickPick(){return Ln.createQuickPick(be)},createInputBox(){return Ln.createInputBox(be)},get activeColorTheme(){return Gs.activeColorTheme},onDidChangeActiveColorTheme(O,$,se){return xe(Gs.onDidChangeActiveColorTheme)(O,$,se)},registerWebviewViewProvider(O,$,se){return _c.registerWebviewViewProvider(be,O,$,se?.webviewOptions)},get activeNotebookEditor(){return dt.activeNotebookEditor},onDidChangeActiveNotebookEditor(O,$,se){return xe(dt.onDidChangeActiveNotebookEditor)(O,$,se)},get visibleNotebookEditors(){return dt.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return xe(dt.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(O,$,se){return xe(Xi.onDidChangeNotebookEditorSelection)(O,$,se)},onDidChangeNotebookEditorVisibleRanges(O,$,se){return xe(Xi.onDidChangeNotebookEditorVisibleRanges)(O,$,se)},showNotebookDocument(O,$){return dt.showNotebookDocument(O,$)},registerExternalUriOpener(O,$,se){return ze(be,"externalUriOpener"),rh.registerExternalUriOpener(be.identifier,O,$,se)},registerProfileContentHandler(O,$){return ze(be,"profileContentHandlers"),kc.registerProfileContentHandler(be,O,$)},registerQuickDiffProvider(O,$,se,qe){return ze(be,"quickDiffProvider"),wd.registerQuickDiffProvider(ft(O),$,se,qe)},get tabGroups(){return w.tabGroups},registerShareProvider(O,$){return ze(be,"shareProvider"),On.registerShareProvider(ft(O),$)}},nr={get rootPath(){return m.report("workspace.rootPath",be,"Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath"),r.getPath()},set rootPath(O){throw new T1("rootPath")},getWorkspaceFolder(O){return r.getWorkspaceFolder(O)},get workspaceFolders(){return r.getWorkspaceFolders()},get name(){return r.name},set name(O){throw new T1("name")},get workspaceFile(){return r.workspaceFile},set workspaceFile(O){throw new T1("workspaceFile")},updateWorkspaceFolders:(O,$,...se)=>r.updateWorkspaceFolders(be,O,$||0,...se),onDidChangeWorkspaceFolders:function(O,$,se){return xe(r.onDidChangeWorkspace)(O,$,se)},asRelativePath:(O,$)=>r.getRelativePath(O,$),findFiles:(O,$,se,qe)=>r.findFiles(O,$,se,be.identifier,qe),findFiles2:(O,$,se)=>(ze(be,"findFiles2"),r.findFiles2(O,$,be.identifier,se)),findFiles2New:(O,$,se)=>{ze(be,"findFiles2New");const qe={exclude:$?.exclude&&$.exclude.length>0?$.exclude[0]:void 0,useDefaultExcludes:!$?.useExcludeSettings||$?.useExcludeSettings===Fw.filesExclude||$?.useExcludeSettings===Fw.searchAndFilesExclude,useDefaultSearchExcludes:!$?.useExcludeSettings||$?.useExcludeSettings===Fw.searchAndFilesExclude,maxResults:$?.maxResults,useIgnoreFiles:$?.useIgnoreFiles?.local,useGlobalIgnoreFiles:$?.useIgnoreFiles?.global,useParentIgnoreFiles:$?.useIgnoreFiles?.parent,followSymlinks:$?.followSymlinks};return r.findFiles2(O&&O.length>0?O[0]:void 0,qe,be.identifier,se)},findTextInFiles:(O,$,se,qe)=>{ze(be,"findTextInFiles");let Wi,Hi;return typeof $=="object"?(Wi=$,Hi=se):(Wi={},Hi=$,qe=se),r.findTextInFiles(O,Wi||{},Hi,be.identifier,qe)},findTextInFilesNew:(O,$,se)=>{ze(be,"findTextInFilesNew"),ze(be,"textSearchProviderNew");let qe={};$&&(qe={include:$.include&&$.include.length>0?$.include[0]:void 0,exclude:$.exclude&&$.exclude.length>0?$.exclude[0]:void 0,useDefaultExcludes:$.useExcludeSettings===void 0||$.useExcludeSettings===Fw.filesExclude||$.useExcludeSettings===Fw.searchAndFilesExclude,useSearchExclude:$.useExcludeSettings===void 0||$.useExcludeSettings===Fw.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 Wi=Promise.resolve(void 0);return{results:new Yd(async ia=>{const Ol=async _g=>(ia.emitOne(k9t(_g)),_g);await Wi.then(_g=>r.findTextInFiles(O,qe,Ol,be.identifier,se))}),complete:Wi.then(ia=>({limitHit:ia?.limitHit??!1}))}},save:O=>r.save(O),saveAs:O=>r.saveAs(O),saveAll:O=>r.saveAll(O),applyEdit(O,$){return Br.applyWorkspaceEdit(O,be,$)},createFileSystemWatcher:(O,$,se,qe)=>{let Wi;return typeof $=="boolean"?Wi={ignoreCreateEvents:!!$,ignoreChangeEvents:!!se,ignoreDeleteEvents:!!qe,correlate:!1}:$&&(ze(be,"createFileSystemWatcher"),Wi={...$,correlate:!0}),Or.createFileSystemWatcher(r,be,O,Wi)},get textDocuments(){return Be.getAllDocumentData().map(O=>O.document)},set textDocuments(O){throw new T1("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")$=Be.createDocumentData(se);else throw new Error("illegal argument - uriOrFileNameOrOptions");return $.then(qe=>(qe.scheme===pe.vscodeRemote&&!qe.authority&&m.report("workspace.openTextDocument",be,"A URI of 'vscode-remote' scheme requires an authority."),Be.ensureDocumentData(qe).then(Wi=>Wi.document)))},onDidOpenTextDocument:(O,$,se)=>xe(Be.onDidAddDocument)(O,$,se),onDidCloseTextDocument:(O,$,se)=>xe(Be.onDidRemoveDocument)(O,$,se),onDidChangeTextDocument:(O,$,se)=>xe(Be.onDidChangeDocument)(O,$,se),onDidSaveTextDocument:(O,$,se)=>xe(Be.onDidSaveDocument)(O,$,se),onWillSaveTextDocument:(O,$,se)=>xe(Ne.getOnWillSaveTextDocumentEvent(be))(O,$,se),get notebookDocuments(){return dt.notebookDocuments.map(O=>O.apiNotebook)},async openNotebookDocument(O,$){let se;if(N.isUri(O))se=O,await dt.openNotebookDocument(O);else if(typeof O=="string")se=N.revive(await dt.createNotebookDocument({viewType:O,content:$}));else throw new Error("Invalid arguments");return dt.getNotebookDocument(se).apiNotebook},onDidSaveNotebookDocument(O,$,se){return xe(Dt.onDidSaveNotebookDocument)(O,$,se)},onDidChangeNotebookDocument(O,$,se){return xe(Dt.onDidChangeNotebookDocument)(O,$,se)},onWillSaveNotebookDocument(O,$,se){return xe($s.getOnWillSaveNotebookDocumentEvent(be))(O,$,se)},get onDidOpenNotebookDocument(){return xe(dt.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return xe(dt.onDidCloseNotebookDocument)},registerNotebookSerializer(O,$,se,qe){return dt.registerNotebookSerializer(be,O,$,se,hl(be,"notebookLiveShare")?qe: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 Ct.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 Yo(rs.registerFileSystemProvider(be,O,$,se),i.addFileSystemProvider(O,$,se))},get fs(){return i.value},registerFileSearchProvider:(O,$)=>(ze(be,"fileSearchProvider"),Y.registerFileSearchProvider(O,$)),registerTextSearchProvider:(O,$)=>(ze(be,"textSearchProvider"),Y.registerTextSearchProvider(O,$)),registerAITextSearchProvider:(O,$)=>(ze(be,"aiTextSearchProvider"),ze(be,"textSearchProvider"),Y.registerAITextSearchProvider(O,$)),registerFileSearchProviderNew:(O,$)=>(ze(be,"fileSearchProviderNew"),{dispose:()=>{}}),registerTextSearchProviderNew:(O,$)=>(ze(be,"textSearchProviderNew"),{dispose:()=>{}}),registerAITextSearchProviderNew:(O,$)=>(ze(be,"aiTextSearchProviderNew"),ze(be,"textSearchProviderNew"),{dispose:()=>{}}),registerRemoteAuthorityResolver:(O,$)=>(ze(be,"resolvers"),n.registerRemoteAuthorityResolver(O,$)),registerResourceLabelFormatter:O=>(ze(be,"resolvers"),$c.$registerResourceLabelFormatter(O)),getRemoteExecServer:O=>(ze(be,"resolvers"),n.getRemoteExecServer(O)),onDidCreateFiles:(O,$,se)=>xe(Or.onDidCreateFile)(O,$,se),onDidDeleteFiles:(O,$,se)=>xe(Or.onDidDeleteFile)(O,$,se),onDidRenameFiles:(O,$,se)=>xe(Or.onDidRenameFile)(O,$,se),onWillCreateFiles:(O,$,se)=>xe(Or.getOnWillCreateFileEvent(be))(O,$,se),onWillDeleteFiles:(O,$,se)=>xe(Or.getOnWillDeleteFileEvent(be))(O,$,se),onWillRenameFiles:(O,$,se)=>xe(Or.getOnWillRenameFileEvent(be))(O,$,se),openTunnel:O=>(ze(be,"tunnels"),p.openTunnel(be,O).then($=>{if(!$)throw new Error("cannot open tunnel");return $})),get tunnels(){return ze(be,"tunnels"),p.getTunnels()},onDidChangeTunnels:(O,$,se)=>(ze(be,"tunnels"),xe(p.onDidChangeTunnels)(O,$,se)),registerPortAttributesProvider:(O,$)=>(ze(be,"portsAttributes"),p.registerPortsAttributesProvider(O,$)),registerTunnelProvider:(O,$)=>(ze(be,"tunnelFactory"),p.registerTunnelProvider(O,$)),registerTimelineProvider:(O,$)=>(ze(be,"timeline"),ic.registerTimelineProvider(O,$,be.identifier,P.converter)),get isTrusted(){return r.trusted},requestWorkspaceTrust:O=>(ze(be,"workspaceTrust"),r.requestWorkspaceTrust(O)),onDidGrantWorkspaceTrust:(O,$,se)=>xe(r.onDidGrantWorkspaceTrust)(O,$,se),registerEditSessionIdentityProvider:(O,$)=>(ze(be,"editSessionIdentityProvider"),r.registerEditSessionIdentityProvider(O,$)),onWillCreateEditSessionIdentity:(O,$,se)=>(ze(be,"editSessionIdentityProvider"),xe(r.getOnWillCreateEditSessionIdentityEvent(be))(O,$,se)),registerCanonicalUriProvider:(O,$)=>(ze(be,"canonicalUriProvider"),r.registerCanonicalUriProvider(O,$)),getCanonicalUri:(O,$,se)=>(ze(be,"canonicalUriProvider"),r.provideCanonicalUri(O,$,se))},gn={get inputBox(){return m.report("scm.inputBox",be,"Use 'SourceControl.inputBox' instead"),Wa.getLastInputBox(be)},createSourceControl(O,$,se){return Wa.createSourceControl(be,O,$,se)}},Se={createCommentController(O,$){return nh.createCommentController(be,O,$)}},at={get activeDebugSession(){return G.activeDebugSession},get activeDebugConsole(){return G.activeDebugConsole},get breakpoints(){return G.breakpoints},get activeStackItem(){return G.activeStackItem},registerDebugVisualizationProvider(O,$){return ze(be,"debugVisualization"),G.registerDebugVisualizationProvider(be,O,$)},registerDebugVisualizationTreeProvider(O,$){return ze(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||R9.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,$)}},Ot={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)},Si={createNotebookController(O,$,se,qe,Wi){return Ti.createNotebookController(be,O,$,se,qe,hl(be,"notebookMessaging")?Wi:void 0)},registerNotebookCellStatusBarItemProvider:(O,$)=>dt.registerNotebookCellStatusBarItemProvider(be,O,$),createRendererMessaging(O){return ss.createRendererMessaging(be,O)},createNotebookControllerDetectionTask(O){return ze(be,"notebookKernelSource"),Ti.createNotebookControllerDetectionTask(be,O)},registerKernelSourceActionProvider(O,$){return ze(be,"notebookKernelSource"),Ti.registerKernelSourceActionProvider(be,O,$)},onDidChangeNotebookCellExecutionState(O,$,se){return ze(be,"notebookCellExecutionState"),xe(Ti.onDidChangeNotebookCellExecutionState)(O,$,se)}},Bt={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 ze(be,"interactive"),ml.transferActiveChat(O)}},de={getRelatedInformation(O,$){return ze(be,"aiRelatedInformation"),_l.getRelatedInformation(be,O,$)},registerRelatedInformationProvider(O,$){return ze(be,"aiRelatedInformation"),_l.registerRelatedInformationProvider(be,O,$)},registerEmbeddingVectorProvider(O,$){return ze(be,"aiRelatedInformation"),oh.registerEmbeddingVectorProvider(be,O,$)}},T={_version:1,registerChatResponseProvider(O,$,se){return ze(be,"chatProvider"),A.registerLanguageModel(be,O,$,se)},registerChatVariableResolver(O,$,se,qe,Wi,Hi,ia,Ol){return ze(be,"chatVariableResolver"),nc.registerVariableResolver(be,O,$,se,qe,Wi,Hi,ia,Ol?.id)},registerMappedEditsProvider(O,$){return ze(be,"mappedEditsProvider"),ki.registerMappedEditsProvider(be,O,$)},createChatParticipant(O,$){return ml.createChatAgent(be,O,$)},createDynamicChatParticipant(O,$,se){return ze(be,"chatParticipantPrivate"),ml.createDynamicChatAgent(be,O,$,se)}},ie={selectChatModels:O=>A.selectLanguageModels(be,O??{}),onDidChangeChatModels:(O,$,se)=>A.onDidChangeProviders(O,$,se),registerChatModelProvider:(O,$,se)=>(ze(be,"chatProvider"),A.registerLanguageModel(be,O,$,se)),get embeddingModels(){return ze(be,"embeddings"),qc.embeddingsModels},onDidChangeEmbeddingModels:(O,$,se)=>(ze(be,"embeddings"),qc.onDidChange(O,$,se)),registerEmbeddingsProvider(O,$){return ze(be,"embeddings"),qc.registerEmbeddingsProvider(be,O,$)},async computeEmbeddings(O,$,se){return ze(be,"embeddings"),qc.computeEmbeddings(O,$,se)},registerTool(O,$){return ze(be,"lmTools"),Bo.registerTool(be,O,$)},invokeTool(O,$,se){return ze(be,"lmTools"),Bo.invokeTool(O,$,se)},get tools(){return ze(be,"lmTools"),Bo.tools}},ye={registerSpeechProvider(O,$){return ze(be,"speech"),Kc.registerProvider(be.identifier,O,$)}};return{version:e.version,ai:de,authentication:$n,commands:Ss,comments:Se,chat:T,debug:at,env:Wr,extensions:Oh,interactive:K,l10n:Bt,languages:le,lm:ie,notebooks:Si,scm:gn,speech:ye,tasks:Ot,tests:Ua,window:ho,workspace:nr,Breakpoint:uN,TerminalOutputAnchor:qee,ChatResultFeedbackKind:IH,ChatVariableLevel:Ete,ChatCompletionItem:Vst,CallHierarchyIncomingCall:fPe,CallHierarchyItem:tle,CallHierarchyOutgoingCall:pPe,CancellationError:Na,CancellationTokenSource:li,CandidatePortSource:iL,CodeAction:V9,CodeActionKind:Aa,CodeActionTriggerKind:dH,CodeLens:z9,Color:dN,ColorInformation:j9,ColorPresentation:Y9,ColorThemeKind:wS,CommentMode:fte,CommentState:pte,CommentThreadCollapsibleState:yH,CommentThreadState:CH,CommentThreadApplicability:SH,CommentThreadFocus:AH,CompletionItem:K9,CompletionItemKind:en,CompletionItemTag:uH,CompletionList:aN,CompletionTriggerKind:QT,ConfigurationTarget:YT,CustomExecution:ile,DebugAdapterExecutable:t$,DebugAdapterInlineImplementation:n$,DebugAdapterNamedPipeServer:i$,DebugAdapterServer:vH,DebugConfigurationProviderTriggerKind:R9,DebugConsoleMode:c$,DebugVisualization:Rst,DecorationRangeBehavior:Kx,Diagnostic:O9,DiagnosticRelatedInformation:rH,DiagnosticSeverity:Hd,DiagnosticTag:$x,Disposable:js,DocumentHighlight:H9,DocumentHighlightKind:oH,MultiDocumentHighlight:U9,DocumentLink:Q9,DocumentSymbol:lH,EndOfLine:T_,EnvironmentVariableMutatorType:KT,EvaluatableExpression:s$,InlineValueText:r$,InlineValueVariableLookup:o$,InlineValueEvaluatableExpression:a$,InlineCompletionTriggerKind:bH,EventEmitter:I,ExtensionKind:ED,ExtensionMode:eL,ExternalUriOpenerPriority:Cte,FileChangeType:XT,FileDecoration:l$,FileDecoration2:l$,FileSystemError:Xc,FileType:rn,FilePermission:up,FoldingRange:gte,FoldingRangeKind:Gw,FunctionBreakpoint:Qx,InlineCompletionItem:ete,InlineCompletionList:tte,Hover:B9,VerboseHover:W9,HoverVerbosityAction:Qee,IndentAction:Co,Location:Ap,MarkdownString:gf,OverviewRulerLane:Il,ParameterInformation:jee,PortAutoForwardAction:Ste,Position:ws,ProcessExecution:hN,ProgressLocation:SD,QuickInputButtonLocation:_te,QuickInputButtons:EH,Range:Xn,RelativePattern:JT,Selection:uC,SelectionRange:hH,SemanticTokens:gN,SemanticTokensBuilder:Tst,SemanticTokensEdit:vPe,SemanticTokensEdits:gz,SemanticTokensLegend:mte,ShellExecution:bI,ShellQuoting:ate,SignatureHelp:Jee,SignatureHelpTriggerKind:Xee,SignatureInformation:Yee,SnippetString:vI,SourceBreakpoint:qx,StandardTokenType:PS,StatusBarAlignment:NS,SymbolInformation:cH,SymbolKind:vo,SymbolTag:aH,Task:J9,TaskGroup:pH,TaskPanelKind:ote,TaskRevealKind:rte,TaskScope:wI,TerminalLink:Cst,TerminalQuickFixTerminalCommand:Ast,TerminalQuickFixOpener:Sst,TerminalLocation:ste,TerminalProfile:Est,TerminalExitReason:nte,TerminalShellExecutionCommandLineConfidence:CD,TextDocumentSaveReason:jT,TextEdit:qA,SnippetTextEdit:ele,TextEditorCursorStyle:Qo,TextEditorLineNumbersStyle:c_,TextEditorRevealType:q9,TextEditorSelectionChangeKind:cN,SyntaxTokenType:lN,TextDocumentChangeReason:fH,ThemeColor:_H,ThemeIcon:fu,TreeItem:X9,TreeItemCheckboxState:fb,TreeItemCollapsibleState:AD,TypeHierarchyItem:nle,UIKind:sv,Uri:N,ViewColumn:gH,WorkspaceEdit:_I,DocumentPasteTriggerKind:dte,DocumentDropEdit:lte,DocumentDropOrPasteEditKind:e$,DocumentPasteEdit:Dst,InlayHint:G9,InlayHintLabelPart:$9,InlayHintKind:Zee,RemoteAuthorityResolverError:a1,ResolvedAuthority:yst,ManagedResolvedAuthority:uz,SourceControlInputBoxValidationType:ite,ExtensionRuntime:f$,TimelineItem:wte,NotebookRange:Dy,NotebookCellKind:jx,NotebookCellExecutionState:fN,NotebookCellData:vG,NotebookData:bPe,NotebookRendererScript:yPe,NotebookCellStatusBarAlignment:h$,NotebookEditorRevealType:u$,NotebookCellOutput:d$,NotebookCellOutputItem:wPe,NotebookCellStatusBarItem:Mst,NotebookControllerAffinity:bte,NotebookControllerAffinity2:g$,NotebookEdit:F9,NotebookKernelSourceAction:Nst,NotebookVariablesRequestKind:DH,PortAttributes:Fst,LinkedEditingRanges:Pst,TestResultState:yte,TestRunRequest:p$,TestMessage:pN,TestMessage2:pN,TestMessageStackFrame:Ost,TestTag:kH,TestRunProfileKind:tL,TextSearchCompleteMessageType:Mee,DataTransfer:mH,DataTransferItem:Z9,TestCoverageCount:fz,FileCoverage:mN,FileCoverage2:mN,StatementCoverage:Wst,BranchCoverage:Hst,DeclarationCoverage:Ust,WorkspaceTrustState:bEe,LanguageStatusSeverity:qT,QuickPickItemKind:xH,InputBoxValidationSeverity:ZT,TabInputText:sle,TabInputTextDiff:m$,TabInputTextMerge:CPe,TabInputCustom:rle,TabInputNotebook:ole,TabInputNotebookDiff:ale,TabInputWebview:SPe,TabInputTerminal:APe,TabInputInteractiveWindow:EPe,TabInputChat:xPe,TabInputTextMultiDiff:DPe,TelemetryTrustedValue:rce,LogLevel:Kn,EditSessionIdentityMatch:Lte,InteractiveSessionVoteDirection:wEe,ChatCopyKind:Ate,InteractiveEditorResponseFeedbackKind:yEe,DebugStackFrame:mPe,DebugThread:_Pe,RelatedInformationType:Dte,SpeechToTextStatus:kte,TextToSpeechStatus:Ite,PartialAcceptTriggerKind:Gx,KeywordRecognitionStatus:Tte,ChatResponseMarkdownPart:bG,ChatResponseFileTreePart:wG,ChatResponseAnchorPart:yG,ChatResponseProgressPart:RH,ChatResponseProgressPart2:kPe,ChatResponseReferencePart:Rb,ChatResponseReferencePart2:Rb,ChatResponseCodeCitationPart:v$,ChatResponseWarningPart:MH,ChatResponseTextEditPart:NH,ChatResponseMarkdownWithVulnerabilitiesPart:TH,ChatResponseCommandButtonPart:CG,ChatResponseDetectedParticipantPart:LH,ChatResponseConfirmationPart:_$,ChatResponseReferencePartStatusKind:xte,ChatRequestTurn:IPe,ChatResponseTurn:TPe,ChatLocation:l_,ChatRequestEditorData:LPe,ChatRequestNotebookData:RPe,LanguageModelChatMessageRole:jp,LanguageModelChatMessage:MPe,LanguageModelChatMessageFunctionResultPart:b$,LanguageModelChatResponseTextPart:PH,LanguageModelChatResponseFunctionUsePart:cle,LanguageModelError:Ow,NewSymbolName:Ist,NewSymbolNameTag:ute,NewSymbolNameTriggerKind:wH,InlineEdit:zst,InlineEditTriggerKind:FH,ExcludeSettingOptions:Fw,TextSearchContextNew:uPe,TextSearchMatchNew:hPe,TextSearchCompleteMessageTypeNew:Nee}}}var kj;let S0e=class{constructor(e,t,i,n,r,o,a){this._apiFactory=e,this._extensionRegistry=t,this._instaService=i,this._extHostConfiguration=n,this._extHostExtensionService=r,this._initData=o,this._logService=a,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),ls("code/extHost/willWaitForConfig");const e=await this._extHostConfiguration.getConfigProvider();ls("code/extHost/didWaitForConfig");const t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new rsi(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(A0e)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(E0e,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))}};S0e=D([_(2,we),_(3,hE),_(4,WI),_(5,bu),_(6,Ke)],S0e);var _M;let A0e=(_M=class{constructor(e){if(e.environment.appRoot&&kj.aliased.size){const t=Nh(this.forceForwardSlashes(e.environment.appRoot.fsPath)),i="[a-z0-9_.-]",n=`@${i}+\\/${i}+|${i}+`,r="node_modules|node_modules\\.asar(?:\\.unpacked)?";this.re=new RegExp(`^(${t}/${r}\\/)(${n})(.*)$`,"i")}}alternativeModuleName(e){if(!this.re)return;const t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;const[,i,n,r]=t,o=kj.aliased.get(n);if(o!==void 0)return console.warn(`${n} as been renamed to ${o}, please update your imports`),i+o+r}forceForwardSlashes(e){return e.replace(/\\/g,"/")}},kj=_M,_M.aliased=new Map([["vscode-ripgrep","@vscode/ripgrep"],["vscode-windows-registry","@vscode/windows-registry"]]),_M);A0e=kj=D([_(0,bu)],A0e);class rsi{constructor(e,t,i,n,r){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=i,this._configProvider=n,this._logService=r,this.nodeModuleName="vscode",this._extApiImpl=new ba}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((r,o)=>n+=` ${o} -> ${r.identifier.value} +`,o.map(d=>new F(d.range.startLineNumber-1,d.range.startColumn-1,d.range.endLineNumber-1,d.range.endColumn-1)))})}const D1=class D1{get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(e,t,i,n,r,o,a){this._textDocumentsAndEditors=i,this._textDocuments=n,this._extHostFileSystem=r,this._extHostSearch=o,this._logService=a,this._notebookStatusBarItemProviders=new Map,this._documents=new gi,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 Am("NotebookCellStatusBarCache"),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=e.getProxy(We.MainThreadNotebook),this._notebookDocumentsProxy=e.getProxy(We.MainThreadNotebookDocuments),this._notebookEditorsProxy=e.getProxy(We.MainThreadNotebookEditors),this._commandsConverter=t.converter,t.registerArgumentProcessor({processArgument:c=>{if(c&&c.$mid===ys.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===ys.NotebookActionContext){const l=c.uri,d=this._documents.get(l);if(d)return d.apiNotebook}return c}}),D1._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=>die.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?C$.exclusive:void 0}}registerNotebookCellStatusBarItemProvider(e,t,i){const n=D1._notebookStatusBarItemProviderHandlePool++,r=typeof i.onDidChangeCellStatusBarItems=="function"?D1._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(n,i),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(n,r,t);let o;return r!==void 0&&(o=i.onDidChangeCellStatusBarItems(a=>this._notebookProxy.$emitCellStatusBarEvent(r))),new js(()=>{this._notebookStatusBarItemProviders.delete(n),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(n,r),o?.dispose()})}async createNotebookDocument(e){const t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&VE.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:kl.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(zy.from),pinned:typeof t.preview=="boolean"?!t.preview:void 0}:i={preserveFocus:!1};const n=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,e.notebookType,i),r=n&&this._editors.get(n)?.apiEditor;if(r)return r;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 r=this._notebookStatusBarItemProviders.get(e),o=N.revive(t),a=this._documents.get(o);if(!a||!r)return;const c=a.getCellFromIndex(i);if(!c)return;const l=await r.provideCellStatusBarItems(c.apiCell,n);if(!l)return;const d=new Z,h=this._statusBarCache.add([d]),f=(Array.isArray(l)?l:[l]).map(p=>_xe.from(p,this._commandsConverter,d));return{cacheId:h,items:f}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(e,t,i,n,r){if(Qu(t))throw new Error("viewType cannot be empty or just whitespace");const o=this._handlePool++;return this._notebookSerializer.set(o,{viewType:t,serializer:i,options:n}),this._notebookProxy.$registerNotebookSerializer(o,{id:e.identifier,location:e.extensionLocation},t,bxe.from(n),D1._convertNotebookRegistrationData(e,r)),Ee(()=>{this._notebookProxy.$unregisterNotebookSerializer(o)})}async $dataToNotebook(e,t,i){const n=this._notebookSerializer.get(e);if(!n)throw new Error("NO serializer found");const r=await n.serializer.deserializeNotebook(t.buffer,i);return new Jd(VE.from(r))}async $notebookToData(e,t,i){const n=this._notebookSerializer.get(e);if(!n)throw new Error("NO serializer found");const r=await n.serializer.serializeNotebook(VE.to(t.value),i);return Ge.wrap(r)}async $saveNotebook(e,t,i,n,r){const o=N.revive(t),a=this._notebookSerializer.get(e);if(this.trace(`enter saveNotebook(versionId: ${i}, ${o.toString()})`),!a)throw new Error("NO serializer found");const c=this._documents.get(o);if(!c)throw new Error("Document NOT found");if(c.versionId!==i)throw new Error("Document version mismatch");if(!this._extHostFileSystem.value.isWritableFileSystem(o.scheme))throw new Rd(g(4585,"Unable to modify read-only file '{0}'",this._resourceForError(o)),ji.FILE_PERMISSION_DENIED);const l={metadata:Mj(c.apiNotebook.metadata,p=>!(a.options?.transientDocumentMetadata??{})[p]),cells:[]};for(const p of c.apiNotebook.getCells()){const m=new vG(p.kind,p.document.getText(),p.document.languageId,p.mime,a.options?.transientOutputs?[]:[...p.outputs],p.metadata,p.executionSummary);m.metadata=Mj(p.metadata,v=>!(a.options?.transientCellMetadata??{})[v]),l.cells.push(m)}if(await this._validateWriteFile(o,n),r.isCancellationRequested)throw new Error("canceled");const d=await a.serializer.serializeNotebook(l,r);if(r.isCancellationRequested)throw new Error("canceled");this.trace(`serialized versionId: ${i} ${o.toString()}`),await this._extHostFileSystem.value.writeFile(o,d),this.trace(`Finished write versionId: ${i} ${o.toString()}`);const h=this._extHostFileSystem.getFileSystemProviderExtUri(o.scheme),u=await this._extHostFileSystem.value.stat(o),f={name:h.basename(o),isFile:(u.type&rn.File)!==0,isDirectory:(u.type&rn.Directory)!==0,isSymbolicLink:(u.type&rn.SymbolicLink)!==0,mtime:u.mtime,ctime:u.ctime,size:u.size,readonly:!!((u.permissions??0)&up.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(o.scheme),locked:!!((u.permissions??0)&up.Locked),etag:nJ({mtime:u.mtime,size:u.size}),children:void 0};return this.trace(`exit saveNotebook(versionId: ${i}, ${o.toString()})`),f}async $searchInNotebooks(e,t,i,n,r){const o=this._notebookSerializer.get(e)?.serializer;if(!o)return{limitHit:!1,results:[]};const a=new Mk;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:fI.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=>ljt(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,r,t);const l=new gi;let d=!1;const h=Array.from(a).map(async u=>{const f=[];try{if(r.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=Ge.fromString(b.toString()),y=await o.deserializeNotebook(w.buffer,r);if(r.isCancellationRequested)return;VE.from(y).cells.forEach(A=>p.push({input:A.source,outputs:A.outputs.flatMap(L=>L.items.map(k=>k.valueBytes.toString()))}))}if(r.isCancellationRequested)return;p.forEach((b,w)=>{const y=t.contentPattern.pattern,C=new Mni(b.input,void 0,b.outputs),A=C.findInInputs(y),L=C.findInOutputs(y),k=L.flatMap(P=>D$e(P.matches,P.textBuffer)).map((P,R)=>(P.webviewIndex=R,P));if(A.length>0||L.length>0){const P={index:w,contentResults:D$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!==x_&&typeof i.mtime=="number"&&typeof i.size=="number"&&t.mtimer.document.uri)}),this._onDidCloseNotebookDocument.fire(n.apiNotebook));for(const r of this._editors.values())r.notebookData.uri.toString()===i.toString()&&this._editors.delete(r.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 r=new r0e(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,n,i);t.push(...i.cells.map(o=>s0e.asModelAddData(o))),this._documents.get(n)?.dispose(),this._documents.set(n,r),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({addedDocuments:t}),this._onDidOpenNotebookDocument.fire(r.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=ut.String.with("notebookType","A notebook type"),i=new fn("vscode.executeDataToNotebook","_executeDataToNotebook","Invoke notebook serializer",[t,new ut("data","Bytes to convert to data",r=>r instanceof Uint8Array,r=>Ge.wrap(r))],new sn("Notebook Data",r=>VE.to(r.value))),n=new fn("vscode.executeNotebookToData","_executeNotebookToData","Invoke notebook serializer",[t,new ut("NotebookData","Notebook data to convert to bytes",r=>!0,r=>new Jd(VE.from(r)))],new sn("Bytes",r=>r.buffer));e.registerApiCommand(i),e.registerApiCommand(n)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}};D1._notebookStatusBarItemProviderHandlePool=0;let o0e=D1;class Nni{constructor(e,t,i,n={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=i,this._thresholds=n,this._onWillSaveNotebookDocumentEvent=new tD}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,i,n)=>{const r=function(a){t.call(i,a)};return r.extension=e,this._onWillSaveNotebookDocumentEvent.event(r,void 0,n)}}async $participateInSave(e,t,i){const n=N.revive(e),r=this._notebooksAndEditors.getNotebookDocument(n);if(!r)throw new Error("Unable to resolve notebook document");const o=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:r.apiNotebook,reason:oie.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 _I?o.push(h):this._logService.warn("onWillSaveNotebookDocument-listener from extension",l.extension.identifier,"ignored due to invalid data"))}),i.isCancellationRequested)return!1;if(o.length===0)return!0;const a={edits:[]};for(const c of o){const{edits:l}=Zu.from(c);a.edits=a.edits.concat(l)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new Jd(a))}}class Pni{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 o=this._notebooksAndEditors.getNotebookDocument(N.revive(e)).acceptModelChanged(t.value,i,n);this._onDidChangeNotebookDocument.fire(o)}$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 a0e=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(zy.to)),t.selections&&i._acceptSelections(t.selections.selections.map(zy.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(kl.to(e[t]))}};a0e=D([_(0,Ke)],a0e);const Fni=100;let c0e=class{constructor(e,t,i,n,r){this._initData=t,this._extHostNotebook=i,this._commands=n,this._logService=r,this._activeExecutions=new gi,this._activeNotebookExecutions=new gi,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(We.MainThreadNotebookKernels);const o=new fn("notebook.selectKernel","_notebook.selectKernel","Trigger kernel picker for specified notebook editor widget",[new ut("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})],sn.Void),a=new fn("vscode.executeNotebookVariableProvider","_executeNotebookVariableProvider","Execute notebook variable provider",[ut.Uri],new sn("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(o),this._commands.registerApiCommand(a)}createNotebookController(e,t,i,n,r,o){for(const A of this._kernelData.values())if(A.controller.id===t&&An.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:aq(e.identifier,t),notebookType:i,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:n||e.identifier.value,preloads:o?o.map(hie.from):[]};let p=r??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 gi,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(hie.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){ze(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,aq(e.identifier,this.id))},createNotebookExecution(A){if(ze(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,aq(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===g$.Hidden&&ze(e,"notebookControllerAffinityHidden"),c._proxy.$updateNotebookPriority(a,A.uri,L)},onDidReceiveMessage:u.event,postMessage(A,L){return ze(e,"notebookMessaging"),c._proxy.$postMessage(a,L&&c._extHostNotebook.getIdByEditor(L),A)},asWebviewUri(A){return ze(e,"notebookMessaging"),Pz(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 aq(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 r={dispose:()=>{this._kernelDetectionTask.delete(i),n._proxy.$removeKernelDetectionTask(i)}};return this._kernelDetectionTask.set(i,r),r}registerKernelSourceActionProvider(e,t,i){const n=this._kernelSourceActionProviderHandlePool++,r=typeof i.onDidChangeNotebookKernelSourceActions=="function"?n:void 0,o=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 r!==void 0&&(a=i.onDidChangeNotebookKernelSourceActions(c=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(r))),{dispose:()=>{this._kernelSourceActionProviders.delete(n),o._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(o=>vxe.from(o,this._commands.converter,n))}return[]}$acceptNotebookAssociation(e,t,i){const n=this._kernelData.get(e);if(n){const r=this._extHostNotebook.getNotebookDocument(N.revive(t));i?n.associatedNotebooks.set(r.uri,!0):n.associatedNotebooks.delete(r.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,r.uri.toString(),i),n.onDidChangeSelection.fire({selected:i,notebook:r.apiNotebook})}}async $executeCells(e,t,i){const n=this._kernelData.get(e);if(!n)return;const r=this._extHostNotebook.getNotebookDocument(N.revive(t)),o=[];for(const a of i){const c=r.getCell(a);c&&o.push(c.apiCell)}try{this._logService.trace(`NotebookController[${e}] EXECUTE cells`,r.uri.toString(),o.length),await n.controller.executeHandler.call(n.controller,o,r.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 r=this._extHostNotebook.getNotebookDocument(N.revive(t));if(n.controller.interruptHandler)await n.controller.interruptHandler.call(n.controller,r.apiNotebook);else for(const o of i){const a=r.getCell(o);a&&this._activeExecutions.get(a.uri)?.cancel()}if(n.controller.interruptHandler){const o=this._activeNotebookExecutions.get(r.uri);this._activeNotebookExecutions.delete(r.uri),i.length&&Array.isArray(o)&&o.length&&o.forEach(a=>a.dispose())}}async $provideVariables(e,t,i,n,r,o,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=r==="named"?DH.Named:DH.Indexed,f=d.provideVariables(l.apiNotebook,h,u,o,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++>=Fni)return}}$acceptKernelMessageFromRenderer(e,t,i){const n=this._kernelData.get(e);if(!n)return;const r=this._extHostNotebook.getEditorById(t);n.onDidReceiveMessage.fire(Object.freeze({editor:r.apiEditor,message:i}))}$cellExecutionChanged(e,t,i){const r=this._extHostNotebook.getNotebookDocument(N.revive(e)).getCell(t);if(r){const o=i?mxe.to(i):fN.Idle;o!==void 0&&this._onDidChangeCellExecutionState.fire({cell:r.apiCell,state:o})}}_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 r=new l0e(t,n,this._proxy);this._activeExecutions.set(n.uri,r);const o=r.onDidChangeState(()=>{r.state===Vv.Resolved&&(r.dispose(),o.dispose(),this._activeExecutions.delete(n.uri))});return r.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 r=new d0e(t,i,this._proxy),o=r.onDidChangeState(()=>{r.state===tS.Resolved&&(r.dispose(),o.dispose(),this._activeNotebookExecutions.delete(i.uri))});return this._activeNotebookExecutions.set(i.uri,[r,o]),r.asApiObject()}};c0e=D([_(4,Ke)],c0e);var Vv;(function(s){s[s.Init=0]="Init",s[s.Started=1]="Started",s[s.Resolved=2]="Resolved"})(Vv||(Vv={}));const Moe=class Moe extends V{get state(){return this._state}constructor(e,t,i){super(),this._cell=t,this._proxy=i,this._handle=Moe.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=Vv.Init,this._tokenSource=this._register(new li),this._collector=new Oni(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===Vv.Init)throw new Error("Must call start before modifying cell output");if(this._state===Vv.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=d$.ensureUniqueMimeTypes(t.items,!0);return i===t.items?yI.from(t):yI.from({items:i,id:t.id,metadata:t.metadata})})}async updateOutputs(e,t,i){const n=this.cellIndexToHandle(t),r=this.validateAndConvertOutputs(z_(e));return this.updateSoon({editType:Yx.Output,cellHandle:n,append:i,outputs:r})}async updateOutputItems(e,t,i){return e=d$.ensureUniqueMimeTypes(z_(e),!0),this.updateSoon({editType:Yx.OutputItems,items:e.map(QH.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:Yx.ExecutionState,executionOrder:e._executionOrder}])},start(i){if(e._state===Vv.Resolved||e._state===Vv.Started)throw new Error("Cannot call start again");e._state=Vv.Started,e._onDidChangeState.fire(),e.update({editType:Yx.ExecutionState,runStartTime:i})},end(i,n,r){if(e._state===Vv.Resolved)throw new Error("Cannot call resolve twice");e._state=Vv.Resolved,e._onDidChangeState.fire(),e._collector.flush();const o=r?{message:r.message,stack:r.stack,location:r?.location?{startLineNumber:r.location.start.line,startColumn:r.location.start.character,endLineNumber:r.location.end.line,endColumn:r.location.end.character}:void 0,uri:r.uri}:void 0;e._proxy.$completeExecution(e._handle,new Jd({runEndTime:n,lastRunSuccess:i,error:o}))},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)}})}};Moe.HANDLE=0;let l0e=Moe;var tS;(function(s){s[s.Init=0]="Init",s[s.Started=1]="Started",s[s.Resolved=2]="Resolved"})(tS||(tS={}));const Noe=class Noe extends V{get state(){return this._state}constructor(e,t,i){super(),this._notebook=t,this._proxy=i,this._handle=Noe.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=tS.Init,this._tokenSource=this._register(new li),this._proxy.$createNotebookExecution(this._handle,e,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===tS.Resolved||this._state===tS.Started)throw new Error("Cannot call start again");this._state=tS.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===tS.Resolved)throw new Error("Cannot call resolve twice");this._state=tS.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}};Noe.HANDLE=0;let d0e=Noe;class Oni{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 hc,this.startedTimer=Date.now(),Ao(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 aq(s,e){return`${s.value}/${e}`}class Bni{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(We.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,r,o)=>this.getOrCreateEmitterFor(t).event(n,r,o),postMessage:(n,r)=>{d7.apiEditorsToExtHost.has(n)&&([n,r]=[r,n]);const o=r&&d7.apiEditorsToExtHost.get(r);return this.proxy.$postMessage(o?.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 Wni{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(We.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,i){if(ze(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 r=this.handlers.get(e);if(!r)throw new Error(`Unknown handler with id: ${e}`);return r.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(Rt(t)?t:N.revive(t),i)}}class Hni{constructor(e){this._handles=0,this._mapHandleToCancellationSource=new Map,this._proxy=e}async withProgress(e,t,i){const n=this._handles++,{title:r,location:o,cancellable:a}=t,c={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(n,{location:fxe.from(o),title:r,source:c,cancellable:a},e.isUnderDevelopment?void 0:e.identifier.value).catch(Nr),this._withProgress(n,i,!!a)}_withProgress(e,t,i){let n;i&&(n=new li,this._mapHandleToCancellationSource.set(e,n));const r=a=>{this._proxy.$progressEnd(a),this._mapHandleToCancellationSource.delete(a),n?.dispose()};let o;try{o=t(new h0e(this._proxy,e),i&&n?n.token:Ue.None)}catch(a){throw r(e),a}return o.then(a=>r(e),a=>r(e)),o}$acceptProgressCanceled(e){const t=this._mapHandleToCancellationSource.get(e);t&&(t.cancel(),this._mapHandleToCancellationSource.delete(e))}}function Uni(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 h0e extends hu{constructor(e,t){super(i=>this.throttledReport(i)),this._proxy=e,this._handle=t}throttledReport(e){this._proxy.$progressReport(this._handle,e)}}h0e.__decorator=D([UEt(100,(s,e)=>Uni(s,e),()=>Object.create(null))],h0e.prototype,"throttledReport",null);const Poe=class Poe{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(We.MainThreadQuickDiff)}$provideOriginalResource(e,t,i){const n=N.revive(t),r=this.providers.get(e);return r?Jh(()=>r.provideOriginalResource(n,i)).then(o=>o||null):Promise.resolve(null)}registerQuickDiffProvider(e,t,i,n){const r=Poe.handlePool++;return this.providers.set(r,t),this.proxy.$registerQuickDiffProvider(r,UH.from(e,this.uriTransformer),i,n),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(r),this.providers.delete(r)}}}};Poe.handlePool=0;let u0e=Poe;function Vni(s,e,t){const i=s.getProxy(We.MainThreadQuickOpen);class n{constructor(p,m){this._sessions=new Map,this._instances=0,this._workspace=p,this._commands=m}showQuickPick(p,m,v,b=Ue.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=hl(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(!Oo(k))return i.$setError(y,k),Promise.reject(k)})}$onItemSelected(p){this._onDidSelectItem?.(p)}showInput(p,m=Ue.None){return this._validateInput=p?.validateInput,i.$input(p,typeof this._validateInput=="function",m).then(void 0,v=>{if(!Oo(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 ZT.Info:v=Ze.Info;break;case ZT.Warning:v=Ze.Warning;break;case ZT.Error:v=Ze.Error;break;default:v=m.message?Ze.Error:Ze.Ignore;break}return{content:m.message,severity:v}}async showWorkspaceFolderPick(p,m=Ue.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=hl(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===EH.Back?-1:b;this._handlesToButtons.set(w,v)}),this.update({buttons:p.map((v,b)=>({...l(v.iconPath),tooltip:v.tooltip,handle:v===EH.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=wt(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 r=u;function o(f){if(f instanceof fu)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=o(f);let m,v;return"id"in p?v=He.asClassName(p):m=p,{iconPath:m,iconClass:v}}class d extends r{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=hl(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=Oi(p.map(v=>this._handlesToItems.get(v)));this._activeItems=m,this._onDidChangeActiveEmitter.fire(m)}_fireDidChangeSelection(p){const m=Oi(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 r{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:Ze.Error}):this.update({validationMessage:p.message,severity:p.severity??Ze.Error}):this.update({validationMessage:void 0,severity:Ze.Ignore})}}return new n(e,t)}var g0e;function k$e(s){return s instanceof N}function zni(s,e){return s.scheme===pe.file&&e.scheme===pe.file&&mo?s.toString()===e.toString():s.toString().toLowerCase()===e.toString().toLowerCase()}function Age(s){if(s)return typeof s.iconPath=="string"?N.file(s.iconPath):N.isUri(s.iconPath)||He.isThemeIcon(s.iconPath)?s.iconPath:void 0}function I$e(s){if(s){if(N.isUri(s))return s;if(He.isThemeIcon(s))return s;{const e=s;return{light:e.light,dark:e.dark}}}else return}function Ege(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 xge(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 rQ(t,i)}function $ni(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=xge(s,e),t!==0)return t;if(s.light&&e.light)t=xge(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=xge(s.dark,e.dark);else{if(s.dark)return 1;if(e.dark)return-1}return t}function Gni(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(T$e),i=lTe(this._resourceSnapshot,e,T$e).map(o=>{const a=o.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=hl(this._extension,"scmMultiDiffEditor"),f=u?c.multiDiffEditorOriginalUri:void 0,p=u?c.multiFileDiffEditorModifiedUri:void 0,m=Age(c.decorations),v=c.decorations&&Age(c.decorations.light)||m,b=c.decorations&&Age(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:o.start,deleteCount:o.deleteCount,toInsert:a}}),n=i.map(({start:o,deleteCount:a,toInsert:c})=>[o,a,c.map(l=>l.rawResource)]),r=i.reverse();for(const{start:o,deleteCount:a,toInsert:c}of r){const l=c.map(h=>h.handle),d=this._handlesSnapshot.splice(o,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()}};Foe._handlePool=0;let f0e=Foe;var kd;const Ooe=class Ooe{constructor(e,t,i,n,r,o,a){Ht(this,kd);this._extension=e,this._commands=n,this._id=r,this._label=o,this._rootUri=a,this._groups=new Map,this._count=void 0,this._quickDiffProvider=void 0,this._historyProviderDisposable=new yn,this._commitTemplate=void 0,this._acceptInputDisposables=new yn,this._acceptInputCommand=void 0,this._actionButtonDisposables=new yn,this._statusBarDisposables=new yn,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new I,this.onDidChangeSelection=this._onDidChangeSelection.event,this.handle=Ooe._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,St(this,kd,i);const c=N.from({scheme:pe.vscodeSourceControl,path:`${r}/scm${this.handle}/input`,query:a?`rootUri=${encodeURIComponent(a.toString())}`:void 0});this._inputBox=new jni(e,t,Ce(this,kd),this.handle,c),Ce(this,kd).$registerSourceControl(this.handle,r,o,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,kd).$updateSourceControl(this.handle,{count:e}))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;hl(this._extension,"quickDiffProvider")&&(t=e?.label),Ce(this,kd).$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t})}get historyProvider(){return ze(this._extension,"scmHistoryProvider"),this._historyProvider}set historyProvider(e){ze(this._extension,"scmHistoryProvider"),this._historyProvider=e,this._historyProviderDisposable.value=new Z,Ce(this,kd).$updateSourceControl(this.handle,{hasHistoryProvider:!!e}),e&&this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemGroup(()=>{this._historyProviderCurrentHistoryItemGroup=e?.currentHistoryItemGroup,Ce(this,kd).$onDidChangeHistoryProviderCurrentHistoryItemGroup(this.handle,this._historyProviderCurrentHistoryItemGroup)}))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,Ce(this,kd).$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,kd).$updateSourceControl(this.handle,{acceptInputCommand:t})}get actionButton(){return ze(this._extension,"scmActionButton"),this._actionButton}set actionButton(e){ze(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,kd).$updateSourceControl(this.handle,{actionButton:t??null})}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&Qni(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,kd).$updateSourceControl(this.handle,{statusBarCommands:t})}get selected(){return this._selected}createResourceGroup(e,t,i){const n=hl(this._extension,"scmMultiDiffEditor")&&i?.multiDiffEditorEnableViewChanges===!0,r=new f0e(Ce(this,kd),this._commands,this.handle,e,t,n,this._extension),o=M.once(r.onDidDispose)(()=>this.createdResourceGroups.delete(r));return this.createdResourceGroups.set(r,o),this.eventuallyAddResourceGroups(),r}eventuallyAddResourceGroups(){const e=[],t=[];for(const[i,n]of this.createdResourceGroups){n.dispose();const r=i.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(i),this.eventuallyUpdateResourceStates()});M.once(i.onDidDispose)(()=>{this.updatedResourceGroups.delete(i),r.dispose(),this._groups.delete(i.handle),Ce(this,kd).$unregisterGroup(this.handle,i.handle)}),e.push([i.handle,i.id,i.label,i.features,i.multiDiffEditorEnableViewChanges]);const o=i._takeResourceStateSnapshot();o.length>0&&t.push([i.handle,o]),this._groups.set(i.handle,i)}Ce(this,kd).$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,kd).$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,kd).$unregisterSourceControl(this.handle)}};kd=new WeakMap,Ooe._handlePool=0;let SN=Ooe;SN.__decorator=D([fRe(100)],SN.prototype,"eventuallyAddResourceGroups",null);SN.__decorator=D([fRe(100)],SN.prototype,"eventuallyUpdateResourceStates",null);var mM;let p0e=(mM=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 ba,this._onDidChangeActiveProvider=new I,this._proxy=e.getProxy(We.MainThreadSCM),this._telemetry=e.getProxy(We.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:r=>{if(r&&r.$mid===ys.ScmResource){const o=this._sourceControls.get(r.sourceControlHandle);if(!o)return r;const a=o.getResourceGroup(r.groupHandle);return a?a.getResourceState(r.handle):r}else if(r&&r.$mid===ys.ScmResourceGroup){const o=this._sourceControls.get(r.sourceControlHandle);return o?o.getResourceGroup(r.groupHandle):r}else if(r&&r.$mid===ys.ScmProvider){const o=this._sourceControls.get(r.handle);return o||r}return r}})}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 r=g0e._handlePool++,o=new SN(e,this._extHostDocuments,this._proxy,this._commands,t,i,n);this._sourceControls.set(r,o);const a=this._sourceControlsByExtension.get(e.identifier)||[];return a.push(o),this._sourceControlsByExtension.set(e.identifier,a),o}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 r=this._sourceControls.get(e);return!r||!r.quickDiffProvider||!r.quickDiffProvider.provideOriginalResource?Promise.resolve(null):Jh(()=>r.quickDiffProvider.provideOriginalResource(n,i)).then(o=>o||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 r=this._sourceControls.get(e);if(!r)return Promise.resolve(void 0);const o=r.getResourceGroup(t);return o?o.$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(r=>{if(!r)return Promise.resolve(void 0);const o=Fs.fromStrict(r.message);return o?Promise.resolve([o,r.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=>Ege(a))??void 0}async $provideHistoryItems2(e,t,i){return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems2(t,i))?.map(o=>Ege(o))??void 0}async $provideHistoryItemSummary(e,t,i,n){const r=this._sourceControls.get(e)?.historyProvider;if(typeof r?.provideHistoryItemSummary!="function")return;const o=await r.provideHistoryItemSummary(t,i,n);return o?Ege(o):void 0}async $provideHistoryItemChanges(e,t,i,n){return await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemChanges(t,i,n)??void 0}},g0e=mM,mM._handlePool=0,mM);p0e=g0e=D([_(3,Ke)],p0e);const Boe=class Boe{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(We.MainThreadShare)}async $provideShare(e,t,i){return await this.providers.get(e)?.provideShare({selection:tt.to(t.selection),resourceUri:N.revive(t.resourceUri)},i)??void 0}registerShareProvider(e,t){const i=Boe.handlePool++;return this.providers.set(i,t),this.proxy.$registerShareProvider(i,UH.from(e,this.uriTransformer),t.id,t.label,t.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(i),this.providers.delete(i)}}}};Boe.handlePool=0;let m0e=Boe;const Woe=class Woe{constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(We.MainThreadSpeech)}async $createSpeechToTextSession(e,t,i){const n=this.providers.get(e);if(!n)return;const r=new Z,o=new li;this.sessions.set(t,o);const a=await n.provideSpeechToTextSession(o.token,i?{language:i}:void 0);a&&(r.add(a.onDidChange(c=>{o.token.isCancellationRequested||this.proxy.$emitSpeechToTextEvent(t,c)})),r.add(o.token.onCancellationRequested(()=>r.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 r=new Z,o=new li;this.sessions.set(t,o);const a=await n.provideTextToSpeechSession(o.token,i?{language:i}:void 0);a&&(this.synthesizers.set(t,a),r.add(a.onDidChange(c=>{o.token.isCancellationRequested||this.proxy.$emitTextToSpeechEvent(t,c)})),r.add(o.token.onCancellationRequested(()=>r.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,r=new li;this.sessions.set(t,r);const o=await i.provideKeywordRecognitionSession(r.token);o&&(n.add(o.onDidChange(a=>{r.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,a)})),n.add(r.token.onCancellationRequested(()=>n.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(e,t,i){const n=Woe.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)})}};Woe.ID_POOL=1;let _0e=Woe;var a2,c2;const k1=class k1{constructor(e,t,i,n,r,o=NS.Left,a){Ht(this,a2);Ht(this,c2);if(this._disposed=!1,this._text="",this._staleCommandRegistrations=new Z,St(this,a2,e),St(this,c2,t),r&&n){this._entryId=u7t(n.identifier,r);const c=i.get(this._entryId);c&&(o=c.alignLeft?NS.Left:NS.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(k1.ID_GEN++);this._extension=n,this._id=r,this._alignment=o,this._priority=this.validatePriority(a)}validatePriority(e){if(dc(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&&!k1.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,c2).toInternal({title:"",command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:Ce(this,c2).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,a2).$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=k1.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));const n=Fs.fromStrict(this._tooltip);Ce(this,a2).$setEntry(this._entryId,e,this._extension?.identifier.value,t,this._text,n,this._command?.internal,i,this._backgroundColor,this._alignment===NS.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._disposed=!0}};a2=new WeakMap,c2=new WeakMap,k1.ID_GEN=0,k1.ALLOWED_BACKGROUND_COLORS=new Map([["statusBarItem.errorBackground",new _H("statusBarItem.errorForeground")],["statusBarItem.warningBackground",new _H("statusBarItem.warningForeground")]]);let v0e=k1;class Yni{constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,"status.extensionMessage",NS.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 js(()=>{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 Jni{constructor(e,t){this._existingItems=new Map,this._proxy=e.getProxy(We.MainThreadStatusBar),this._commands=t,this._statusMessage=new Yni(this)}$acceptStaticEntries(e){for(const t of e)this._existingItems.set(t.entryId,t)}createStatusBarEntry(e,t,i,n){return new v0e(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 js(()=>{i.dispose(),clearTimeout(n)})}}class Xni 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(We.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:kl.from(t),preserveFocus:i}:typeof t=="object"?n={position:kl.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?tt.from(t.selection):void 0,pinned:typeof t.preview=="boolean"?!t.preview:void 0}:n={preserveFocus:!1};const r=await this._proxy.$tryShowTextDocument(e.uri,n),o=r&&this._extHostDocumentsAndEditors.getEditor(r);if(o)return o.value;throw r?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 mIe(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(zb.to);i._acceptSelections(n)}if(t.visibleRanges){const n=Oi(t.visibleRanges.map(tt.to));i._acceptVisibleRanges(n)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:i.value,options:{...t.options,lineNumbers:gB.to(t.options.lineNumbers)}}),t.selections){const n=cN.fromValue(t.selections.source),r=t.selections.selections.map(zb.to);this._onDidChangeTextEditorSelection.fire({textEditor:i.value,selections:r,kind:n})}if(t.visibleRanges){const n=Oi(t.visibleRanges.map(tt.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=kl.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 b0e=class{constructor(e){this._actual=new vte(wS.Dark),this._onDidChangeActiveColorTheme=new I}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case"light":t=wS.Light;break;case"hcDark":t=wS.HighContrast;break;case"hcLight":t=wS.HighContrastLight;break;default:t=wS.Dark}this._actual=new vte(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};b0e=D([_(0,Jr)],b0e);class Zni{constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(We.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(i,n)=>{if(i&&i.$mid===ys.TimelineActionContext)if(this._providers.get(i.source)&&An.equals(n,this._providers.get(i.source)?.extension)){const r=i.uri===void 0?void 0:N.revive(i.uri);return this._itemsBySourceAndUriMap.get(i.source)?.get(L$e(r))?.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 r=new Z,o=this.convertTimelineItem(t.id,n,r).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&&(r.clear(),c.get(t.id)?.clear());const u=await t.provideTimeline(l,d,h);if(u==null)return;const f=o(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(),r.dispose()}},i)}convertTimelineItem(e,t,i){return(n,r)=>{let o;if(r?.cacheResults){let a=this._itemsBySourceAndUriMap.get(e);a===void 0&&(a=new Map,this._itemsBySourceAndUriMap.set(e,a));const c=L$e(n);o=a.get(c),o===void 0&&(o=new Map,a.set(c,o))}return a=>{const{iconPath:c,...l}=a,d=`${e}|${a.id??a.timestamp}`;o?.set(d,a);let h,u,f;a.iconPath&&(c instanceof fu?f={id:c.id,color:c.color}:N.isUri(c)?(h=c,u=c):{light:h,dark:u}=c);let p;return gf.isMarkdownString(l.tooltip)?p=Fs.from(l.tooltip):Rt(l.tooltip)?p=l.tooltip:gf.isMarkdownString(l.detail)?(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=Fs.from(l.detail)):Rt(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 L$e(s){return s?.toString()}function R$e(s,e){if(Rt(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 esi extends V{constructor(e,t,i){super(),this._proxy=e,this.commands=t,this.logService=i,this.treeViews=new Map,this.treeDragAndDropService=new uMe;function n(r){return r&&r.$treeViewId&&(r.$treeItemHandle||r.$selectedTreeItems||r.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:r=>n(r)?this.convertArgument(r):Array.isArray(r)&&r.length>0?r.map(o=>n(o)?this.convertArgument(o):o):r})}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??[],r=t.dragAndDropController?.dragMimeTypes??[],o=!!t.dragAndDropController?.handleDrag,a=!!t.dragAndDropController?.handleDrop,c=this.createExtHostTreeView(e,t,i),l={showCollapseAll:!!t.showCollapseAll,canSelectMany:!!t.canSelectMany,dropMimeTypes:n,dragMimeTypes:r,hasHandleDrag:o,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 ze(i,"treeViewActiveItem"),c.focusedElement},get onDidChangeActiveItem(){return ze(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){ud(u)&&ze(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&&fEe.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 rw(e))}async $handleDrop(e,t,i,n,r,o,a,c){const l=this.treeViews.get(e);if(!l)return Promise.reject(new rw(e));const d=U_.toDataTransfer(i,async h=>(await this._proxy.$resolveDropFileData(e,t,h)).buffer);return a===e&&c&&await this.addAdditionalTransferItems(d,l,c,r,o),l.onDrop(d,n,r)}async addAdditionalTransferItems(e,t,i,n,r){const o=this.treeDragAndDropService.removeDragOperationTransfer(r);if(o)(await o)?.forEach((a,c)=>{a&&e.set(c,a)});else if(r&&t.handleDrag){const a=t.handleDrag(i,e,n);this.treeDragAndDropService.addDragOperationTransfer(r,a),await a}return e}async $handleDrag(e,t,i,n){const r=this.treeViews.get(e);if(!r)return Promise.reject(new rw(e));const o=await this.addAdditionalTransferItems(new mH,r,t,n,i);if(!(!o||n.isCancellationRequested))return U_.from(o)}async $hasResolve(e){const t=this.treeViews.get(e);if(!t)throw new rw(e);return t.hasResolve}$resolve(e,t,i){const n=this.treeViews.get(e);if(!n)throw new rw(e);return n.resolveTreeItem(t,i)}$setExpanded(e,t,i){const n=this.treeViews.get(e);if(!n)throw new rw(e);n.setExpanded(t,i)}$setSelectionAndFocus(e,t,i){const n=this.treeViews.get(e);if(!n)throw new rw(e);n.setSelectionAndFocus(t,i)}$setVisible(e,t){const i=this.treeViews.get(e);if(!i){if(!t)return;throw new rw(e)}i.setVisible(t)}$changeCheckboxState(e,t){const i=this.treeViews.get(e);if(!i)throw new rw(e);i.setCheckboxState(t)}createExtHostTreeView(e,t,i){const n=this._register(new w0e(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 LO=class LO extends V{get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!aa(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,i,n,r,o){if(super(),this.viewId=e,this.proxy=i,this.commands=n,this.logService=r,this.extension=o,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 li,o.contributes&&o.contributes.views)for(const d in o.contributes.views)for(const h of o.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,Fs.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=aa(t.select)?!0:t.select,n=aa(t.focus)?!1:t.focus,r=aa(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(o=>this.resolveTreeNode(e,o[o.length-1]).then(a=>this.proxy.$reveal(this.viewId,{item:a.item,parentChain:o.map(c=>c.item)},{select:i,focus:n,expand:r})),o=>this.logService.error(o)):this.proxy.$reveal(this.viewId,void 0,{select:i,focus:n,expand:r})}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=gie.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=!ns(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?fb.Checked:fb.Unchecked}:Promise.resolve(void 0)}))).filter(i=>i!==void 0);t.forEach(i=>{i.treeItem.checkboxState=i.newState?fb.Checked:fb.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(i=>[i.extensionItem,i.newState])})}async handleDrag(e,t,i){const n=[];for(const r of e){const o=this.getExtensionElement(r);o&&n.push(o)}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 r=await this.dataProvider.resolveTreeItem(n.extensionItem,i,t)??n.extensionItem;return this.validateTreeItem(r),n.item.tooltip=this.getTooltip(r.tooltip),n.item.command=this.getCommand(n.disposableStore,r.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 r=this.getExtensionElement(n);if(r){const o=this.nodes.get(r);if(o)return Promise.resolve(o)}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 li(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 r=Oi(n||[]),o=await Promise.all(Oi(r).map(c=>this.dataProvider.getTreeItem(c)));if(t.token.isCancellationRequested)return;const a=o.map((c,l)=>c?this.createAndRegisterTreeNode(r[l],c,i):null);return Oi(a)}finally{t.dispose()}}refresh(e){if(e.some(i=>!i))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new li,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(r=>this.nodes.get(r));for(const r of i)if(r&&!t.has(r.item.handle)){let o=r;for(;o&&o.parent&&i.findIndex(a=>o&&o.parent&&a&&a.item.handle===o.parent.item.handle)===-1;){const a=this.elements.get(o.parent.item.handle);o=a?this.nodes.get(a):void 0}o&&!o.parent&&t.add(r.item.handle)}const n=[];return t.forEach(r=>{const o=this.elements.get(r);if(o){const a=this.nodes.get(o);a&&(!a.parent||!t.has(a.parent.item.handle))&&n.push(r)}}),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 r=this.createTreeNode(t,n,i.parent);return this.updateNodeCache(t,r,i,i.parent),i.dispose(),r}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 gf.isMarkdownString(e)?Fs.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===fb.Checked,tooltip:i,accessibilityInformation:n}}validateTreeItem(e){if(!X9.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),r=this.createHandle(e,t,i),o=this.getLightIconPath(t);return{item:{handle:r,parentHandle:i?i.item.handle:void 0,label:R$e(t.label),description:t.description,resourceUri:t.resourceUri,tooltip:this.getTooltip(t.tooltip),command:this.getCommand(n,t.command),contextValue:t.contextValue,icon:o,iconDark:this.getDarkIconPath(t)||o,themeIcon:this.getThemeIcon(t),collapsibleState:aa(t.collapsibleState)?AD.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 fu?e.iconPath:void 0}createHandle(e,{id:t,label:i,resourceUri:n},r,o){if(t)return`${LO.ID_HANDLE_PREFIX}/${t}`;const a=R$e(i),c=r?r.item.handle:LO.LABEL_HANDLE_PREFIX;let l=a?a.label:n?vi(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(r)||[];let u,f=0;do{if(u=`${c}/${f}:${l}`,o||!this.elements.has(u)||d===u)break;f++}while(f<=h.length);return u}getLightIconPath(e){if(e.iconPath&&!(e.iconPath instanceof fu))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 fu)&&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 r=this.getChildrenNodes(n)||[],o=r.filter(a=>a.item.handle===i.item.handle)[0];o&&r.splice(r.indexOf(o),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)}};LO.LABEL_HANDLE_PREFIX="0",LO.ID_HANDLE_PREFIX="1";let w0e=LO;const Hoe=class Hoe{constructor(e){this._openers=new Map,this._proxy=e.getProxy(We.MainThreadUriOpeners)}registerExternalUriOpener(e,t,i,n){if(this._openers.has(t))throw new Error(`Opener with id '${t}' already registered`);const r=n.schemes.find(o=>!Hoe.supportedSchemes.has(o));if(r)throw new Error(`Scheme '${r}' 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 r=N.revive(t);return n.canOpenExternalUri(r,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)}};Hoe.supportedSchemes=new Set([pe.http,pe.https]);let y0e=Hoe;const Uoe=class Uoe{constructor(e){this.handles=new D_,this.handlers=new Map,this._proxy=e.getProxy(We.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=Uoe.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){bt(n)}return Promise.resolve(void 0)}async createAppUri(e){return N.revive(await this._proxy.$createAppUri(e))}};Uoe.HandlePool=0;let C0e=Uoe;var _x,vx,O7,l2,B7,dT,d2,oS,h2,u2,bx,g2,f2;class tsi extends V{constructor(t,i,n,r){super();Ht(this,_x);Ht(this,vx);Ht(this,O7);Ht(this,l2);Ht(this,B7);Ht(this,dT);Ht(this,d2);Ht(this,oS);Ht(this,h2);Ht(this,u2);Ht(this,bx);Ht(this,g2);Ht(this,f2);St(this,oS,void 0),St(this,h2,!0),St(this,bx,!1),St(this,g2,this._register(new I)),this.onDidDispose=Ce(this,g2).event,St(this,f2,this._register(new I)),this.onDidChangeViewState=Ce(this,f2).event,St(this,_x,t),St(this,vx,i),St(this,l2,n),St(this,O7,r.viewType),St(this,B7,r.panelOptions),St(this,oS,r.viewColumn),St(this,dT,r.title),St(this,u2,r.active)}dispose(){Ce(this,bx)||(St(this,bx,!0),Ce(this,g2).fire(),Ce(this,vx).$disposeWebview(Ce(this,_x)),Ce(this,l2).dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),Ce(this,l2)}get viewType(){return this.assertNotDisposed(),Ce(this,O7)}get title(){return this.assertNotDisposed(),Ce(this,dT)}set title(t){this.assertNotDisposed(),Ce(this,dT)!==t&&(St(this,dT,t),Ce(this,vx).$setTitle(Ce(this,_x),t))}get iconPath(){return this.assertNotDisposed(),Ce(this,d2)}set iconPath(t){this.assertNotDisposed(),Ce(this,d2)!==t&&(St(this,d2,t),Ce(this,vx).$setIconPath(Ce(this,_x),N.isUri(t)?{light:t,dark:t}:t))}get options(){return Ce(this,B7)}get viewColumn(){if(this.assertNotDisposed(),!(typeof Ce(this,oS)=="number"&&Ce(this,oS)<0))return Ce(this,oS)}get active(){return this.assertNotDisposed(),Ce(this,u2)}get visible(){return this.assertNotDisposed(),Ce(this,h2)}_updateViewState(t){Ce(this,bx)||(this.active!==t.active||this.visible!==t.visible||this.viewColumn!==t.viewColumn)&&(St(this,u2,t.active),St(this,h2,t.visible),St(this,oS,t.viewColumn),Ce(this,f2).fire({webviewPanel:this}))}reveal(t,i){this.assertNotDisposed(),Ce(this,vx).$reveal(Ce(this,_x),{viewColumn:typeof t>"u"?void 0:kl.from(t),preserveFocus:!!i})}assertNotDisposed(){if(Ce(this,bx))throw new Error("Webview is disposed")}}_x=new WeakMap,vx=new WeakMap,O7=new WeakMap,l2=new WeakMap,B7=new WeakMap,dT=new WeakMap,d2=new WeakMap,oS=new WeakMap,h2=new WeakMap,u2=new WeakMap,bx=new WeakMap,g2=new WeakMap,f2=new WeakMap;class fFe extends V{static newHandle(){return ao()}constructor(e,t,i){super(),this.webviews=t,this.workspace=i,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(We.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(e,t,i,n,r={}){const o=typeof n=="object"?n.viewColumn:n,a={viewColumn:kl.from(o),preserveFocus:typeof n=="object"&&!!n.preserveFocus},c=tU(e),l=fFe.newHandle();this._proxy.$createWebviewPanel(bne(e),l,t,{title:i,panelOptions:isi(r),webviewOptions:Bot(e,this.workspace,r),serializeBuffersForPostMessage:c},a);const d=this.webviews.createNewWebview(l,r,e);return this.createNewWebviewPanel(l,t,i,o,r,d,!0)}$onDidChangeWebviewPanelViewStates(e){const t=Object.keys(e);t.sort((i,n)=>{const r=e[i],o=e[n];return r.active?1:o.active?-1:+r.visible-+o.visible});for(const i of t){const n=this.getWebviewPanel(i);if(!n)continue;const r=e[i];n._updateViewState({active:r.active,visible:r.visible,viewColumn:kl.to(r.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:tU(e)}),new js(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,i,n){const r=this._serializers.get(t);if(!r)throw new Error(`No serializer found for '${t}'`);const{serializer:o,extension:a}=r,c=this.webviews.createNewWebview(e,i.webviewOptions,a),l=this.createNewWebviewPanel(e,t,i.title,n,i.panelOptions,c,i.active);await o.deserializeWebviewPanel(l,i.state)}createNewWebviewPanel(e,t,i,n,r,o,a){const c=new tsi(e,this._proxy,o,{viewType:t,title:i,viewColumn:n,panelOptions:r,active:a});return this._webviewPanels.set(e,c),c}getWebviewPanel(e){return this._webviewPanels.get(e)}}function isi(s){return{enableFindWidget:s.enableFindWidget,retainContextWhenHidden:s.retainContextWhenHidden}}var wx,yx,W7,p2,Cx,hT,uT,m2,gT,_2,v2;class nsi extends V{constructor(t,i,n,r,o,a){super();Ht(this,wx);Ht(this,yx);Ht(this,W7);Ht(this,p2);Ht(this,Cx);Ht(this,hT);Ht(this,uT);Ht(this,m2);Ht(this,gT);Ht(this,_2);Ht(this,v2);St(this,Cx,!1),St(this,_2,this._register(new I)),this.onDidChangeVisibility=Ce(this,_2).event,St(this,v2,this._register(new I)),this.onDidDispose=Ce(this,v2).event,St(this,W7,n),St(this,uT,r),St(this,wx,t),St(this,yx,i),St(this,p2,o),St(this,hT,a)}dispose(){Ce(this,Cx)||(St(this,Cx,!0),Ce(this,v2).fire(),Ce(this,p2).dispose(),super.dispose())}get title(){return this.assertNotDisposed(),Ce(this,uT)}set title(t){this.assertNotDisposed(),Ce(this,uT)!==t&&(St(this,uT,t),Ce(this,yx).$setWebviewViewTitle(Ce(this,wx),t))}get description(){return this.assertNotDisposed(),Ce(this,m2)}set description(t){this.assertNotDisposed(),Ce(this,m2)!==t&&(St(this,m2,t),Ce(this,yx).$setWebviewViewDescription(Ce(this,wx),t))}get visible(){return Ce(this,hT)}get webview(){return Ce(this,p2)}get viewType(){return Ce(this,W7)}_setVisible(t){t===Ce(this,hT)||Ce(this,Cx)||(St(this,hT,t),Ce(this,_2).fire())}get badge(){return this.assertNotDisposed(),Ce(this,gT)}set badge(t){this.assertNotDisposed(),!(t?.value===Ce(this,gT)?.value&&t?.tooltip===Ce(this,gT)?.tooltip)&&(St(this,gT,gie.from(t)),Ce(this,yx).$setWebviewViewBadge(Ce(this,wx),t))}show(t){this.assertNotDisposed(),Ce(this,yx).$show(Ce(this,wx),!!t)}assertNotDisposed(){if(Ce(this,Cx))throw new Error("Webview is disposed")}}wx=new WeakMap,yx=new WeakMap,W7=new WeakMap,p2=new WeakMap,Cx=new WeakMap,hT=new WeakMap,uT=new WeakMap,m2=new WeakMap,gT=new WeakMap,_2=new WeakMap,v2=new WeakMap;class ssi{constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(We.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(bne(e),t,{retainContextWhenHidden:n?.retainContextWhenHidden,serializeBuffersForPostMessage:tU(e)}),new js(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,i,n,r){const o=this._viewProviders.get(t);if(!o)throw new Error(`No view provider found for '${t}'`);const{provider:a,extension:c}=o,l=this._extHostWebview.createNewWebview(e,{},c),d=new nsi(e,this._proxy,t,i,l,!0);this._webviewViews.set(e,d),await a.resolveWebviewView(d,{state:n},r)}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 rsi(s){const e=s.get(bu),t=s.get(n4),i=s.get(Sle),n=s.get(WI),r=s.get(dE),o=s.get(Ele),a=s.get(hE),c=s.get(Ale),l=s.get(Jr),d=s.get(sFe),h=s.get(rFe),u=s.get(pf),f=s.get(Ke),p=s.get(KPe),m=s.get(xle),v=s.get(Pot),b=s.get(cFe),w=s.get(xG),y=s.get(dFe),C=s.get(oFe),A=s.get(aFe);l.set(Je.ExtHostFileSystemInfo,t),l.set(Je.ExtHostLogLevelServiceShape,u),l.set(Je.ExtHostWorkspace,r),l.set(Je.ExtHostConfiguration,a),l.set(Je.ExtHostExtensionService,n),l.set(Je.ExtHostStorage,d),l.set(Je.ExtHostTunnelService,p),l.set(Je.ExtHostWindow,v),l.set(Je.ExtHostSecretState,b),l.set(Je.ExtHostTelemetry,o),l.set(Je.ExtHostEditorTabs,w),l.set(Je.ExtHostManagedSockets,y),l.set(Je.ExtHostAuthentication,C),l.set(Je.ExtHostChatProvider,A);const L=l.set(Je.ExtHostDecorations,s.get(yot)),k=l.set(Je.ExtHostDocumentsAndEditors,s.get(s4)),P=l.set(Je.ExtHostCommands,s.get(iP)),R=l.set(Je.ExtHostTerminalService,s.get(r4)),z=l.set(Je.ExtHostTerminalShellIntegration,s.get(Fot)),G=l.set(Je.ExtHostDebugService,s.get(Mot)),Y=l.set(Je.ExtHostSearch,s.get(Not)),j=l.set(Je.ExtHostTask,s.get(Eot)),ne=l.set(Je.ExtHostOutputService,s.get(bot)),ge=l.set(Je.ExtHostLocalization,s.get(lFe)),De=l.set(Je.ExtHostUrls,new C0e(l)),Be=l.set(Je.ExtHostDocuments,new wni(l,k)),Ct=l.set(Je.ExtHostDocumentContentProviders,new t0e(l,k,f)),Ne=l.set(Je.ExtHostDocumentSaveParticipant,new bni(f,Be,l.getProxy(We.MainThreadBulkEdits))),dt=l.set(Je.ExtHostNotebook,new o0e(l,P,k,Be,i,Y,f)),Dt=l.set(Je.ExtHostNotebookDocuments,new Pni(dt)),Xi=l.set(Je.ExtHostNotebookEditors,new a0e(f,dt)),Ti=l.set(Je.ExtHostNotebookKernels,new c0e(l,e,dt,P,f)),ss=l.set(Je.ExtHostNotebookRenderers,new Bni(l,dt)),$s=l.set(Je.ExtHostNotebookDocumentSaveParticipant,new Nni(f,dt,l.getProxy(We.MainThreadBulkEdits))),Fn=l.set(Je.ExtHostEditors,new Xni(l,k)),Zo=l.set(Je.ExtHostTreeViews,new esi(l.getProxy(We.MainThreadTreeViews),P,f)),hs=l.set(Je.ExtHostEditorInsets,new sni(l.getProxy(We.MainThreadEditorInsets),Fn,e.remote)),Zr=l.set(Je.ExtHostDiagnostics,new e0e(l,f,t,k)),ea=l.set(Je.ExtHostLanguages,new Lni(l,Be,P.converter,c)),ki=l.set(Je.ExtHostLanguageFeatures,new i0e(l,c,Be,P,Zr,f,m,o)),rs=l.set(Je.ExtHostFileSystem,new yne(l,ki)),Or=l.set(Je.ExtHostFileSystemEventService,new xni(l,f,k)),Ln=l.set(Je.ExtHostQuickOpen,Vni(l,r,P)),Ha=l.set(Je.ExtHostSCM,new p0e(l,P,Be,f)),wd=l.set(Je.ExtHostQuickDiff,new u0e(l,c)),On=l.set(Je.ExtHostShare,new m0e(l,c)),nh=l.set(Je.ExtHostComments,rni(l,P,Be)),mc=l.set(Je.ExtHostProgress,new Hni(l.getProxy(We.MainThreadProgress))),$c=l.set(Je.ExtHostLabelService,new kni(l)),Gs=l.set(Je.ExtHostTheming,new b0e(l)),ic=l.set(Je.ExtHostTimeline,new Zni(l,P)),pl=l.set(Je.ExtHostWebviews,new cni(l,e.remote,r,f,m)),sh=l.set(Je.ExtHostWebviewPanels,new fFe(l,pl,r)),mg=l.set(Je.ExtHostCustomEditors,new fni(l,Be,h,pl,sh)),_c=l.set(Je.ExtHostWebviewViews,new ssi(l,pl)),Gc=l.set(Je.ExtHostTesting,s.get(kle)),rh=l.set(Je.ExtHostUriOpeners,new y0e(l)),kc=l.set(Je.ExtHostProfileContentHandlers,new Wni(l));l.set(Je.ExtHostInteractive,new Dni(l,dt,k,P,f));const ml=l.set(Je.ExtHostChatAgents2,new JIe(l,f,P,Be)),nc=l.set(Je.ExtHostChatVariables,new XIe(l)),Bo=l.set(Je.ExtHostLanguageModelTools,new Tni(l)),_l=l.set(Je.ExtHostAiRelatedInformation,new Yii(l)),oh=l.set(Je.ExtHostAiEmbeddingVector,new Cni(l)),ah=l.set(Je.ExtHostStatusBar,new Jni(l,P.converter)),Kc=l.set(Je.ExtHostSpeech,new _0e(l)),qc=l.set(Je.ExtHostEmbeddings,new yni(l)),Ua=Object.values(Je);l.assertRegistered(Ua);const Br=new YIe(l,k),Ts=new tni(l),Ic=new n0e(l,f),Fh=new vni(l);return Xii.register(P),function(be,Ea,ee){function xe(O){return($,se,qe)=>{const Wi=O(Hi=>{try{$.call(se,Hi)}catch(ia){Nr(new Error(`[ExtensionListenerError] Extension '${be.identifier.value}' FAILED to handle event: ${ia.toString()}`,{cause:ia})),o.onExtensionError(be.identifier,ia)}});return qe?.push(Wi),Wi}}const ft=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(qe){if(Array.isArray(qe))qe.forEach(se);else if(typeof qe=="string")$();else{const Wi=qe;typeof Wi.scheme>"u"&&$(),typeof Wi.exclusive=="boolean"&&ze(be,"documentFiltersExclusive")}return qe}}(),$n={getSession(O,$,se){return typeof se?.forceNewSession=="object"&&se.forceNewSession.learnMore&&ze(be,"authLearnMore"),se?.account&&ze(be,"authGetSessions"),C.getSession(be,O,$,se)},getAccounts(O){return ze(be,"authGetSessions"),C.getAccounts(O)},async hasSession(O,$){return ze(be,"authSession"),!!await C.getSession(be,O,$,{silent:!0})},get onDidChangeSessions(){return xe(C.onDidChangeSessions)},registerAuthenticationProvider(O,$,se,qe){return C.registerAuthenticationProvider(O,$,se,qe)}},Ss={registerCommand(O,$,se){return P.registerCommand(!0,O,$,se,void 0,be)},registerTextEditorCommand(O,$,se){return P.registerCommand(!0,O,(...qe)=>{const Wi=Fn.getActiveTextEditor();if(!Wi){f.warn("Cannot execute "+O+" because there is no active text editor.");return}return Wi.edit(Hi=>{$.apply(se,[Wi,Hi,...qe])}).then(Hi=>{Hi||f.warn("Edits from command "+O+" were not applied.")},Hi=>{f.warn("An error occurred while running command "+O,Hi)})},void 0,void 0,be)},registerDiffInformationCommand:(O,$,se)=>(ze(be,"diffCommand"),P.registerCommand(!0,O,async(...qe)=>{const Wi=k.activeEditor(!0);if(!Wi){f.warn("Cannot execute "+O+" because there is no active text editor.");return}const Hi=await Fn.getDiffInformation(Wi.id);$.apply(se,[Hi,...qe])},void 0,void 0,be)),executeCommand(O,...$){return P.executeCommand(O,...$)},getCommands(O=!1){return P.getCommands(O)}},Wr={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 Ts.value},get shell(){return R.getDefaultShell(!1)},get onDidChangeShell(){return xe(R.onDidChangeShell)},get isTelemetryEnabled(){return o.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return xe(o.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return ze(be,"telemetry"),o.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return ze(be,"telemetry"),xe(o.onDidChangeTelemetryConfiguration)},get isNewAppInstall(){return Sot(e.telemetryInfo.firstSessionDate)},createTelemetryLogger(O,$){return Cot.validateSender(O),o.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(IA(O,pe.http)||IA(O,pe.https))return O;throw $}},get remoteName(){return W6(e.remote.authority)},get remoteAuthority(){return ze(be,"resolvers"),e.remote.authority},get uiKind(){return e.uiKind},get logLevel(){return f.getLevel()},get onDidChangeLogLevel(){return xe(f.onDidChangeLogLevel)},get appQuality(){return ze(be,"resolvers"),e.quality},get appCommit(){return ze(be,"resolvers"),e.commit}},Va={createTestController(O,$,se){return Gc.createTestController(be,O,$,se)},createTestObserver(){return ze(be,"testObserver"),Gc.createTestObserver()},runTests(O){return ze(be,"testObserver"),Gc.runTests(O)},registerTestFollowupProvider(O){return ze(be,"testObserver"),Gc.registerTestFollowupProvider(O)},get onDidChangeTestResults(){return ze(be,"testObserver"),xe(Gc.onResultsChanged)},get testResults(){return ze(be,"testObserver"),Gc.results}},ta=e.remote.isRemote?ED.Workspace:ED.UI,Oh={getExtension(O,$){hl(be,"extensionsAny")||($=!1);const se=Ea.mine.getExtensionDescription(O);if(se)return new jV(n,be.identifier,se,ta,!1);if($){const qe=Ea.all.getExtensionDescription(O);if(qe)return new jV(n,be.identifier,qe,ta,!0)}},get all(){const O=[];for(const $ of Ea.mine.getAllExtensionDescriptions())O.push(new jV(n,be.identifier,$,ta,!1));return O},get allAcrossExtensionHosts(){ze(be,"extensionsAny");const O=new D_(Ea.mine.getAllExtensionDescriptions().map(se=>se.identifier)),$=[];for(const se of Ea.all.getAllExtensionDescriptions()){const qe=!O.has(se.identifier);$.push(new jV(n,be.identifier,se,ta,qe))}return $},get onDidChange(){return hl(be,"extensionsAny")?xe(M.any(Ea.mine.onDidChange,Ea.all.onDidChange)):xe(Ea.mine.onDidChange)}},le={createDiagnosticCollection(O){return Zr.createDiagnosticCollection(be.identifier,O)},get onDidChangeDiagnostics(){return xe(Zr.onDidChangeDiagnostics)},getDiagnostics:O=>Zr.getDiagnostics(O),getLanguages(){return ea.getLanguages()},setTextDocumentLanguage(O,$){return ea.changeLanguage(O.uri,$)},match(O,$){const se=pxe.from(O);let qe;return Kje(se)&&(qe=dt.notebookDocuments.find(Wi=>Wi.apiNotebook.getCells().find(Hi=>Hi.document===$))?.apiNotebook),kae(se,$.uri,$.languageId,!0,qe?.uri,qe?.notebookType)},registerCodeActionsProvider(O,$,se){return ki.registerCodeActionProvider(be,ft(O),$,se)},registerDocumentPasteEditProvider(O,$,se){return ze(be,"documentPaste"),ki.registerDocumentPasteEditProvider(be,ft(O),$,se)},registerCodeLensProvider(O,$){return ki.registerCodeLensProvider(be,ft(O),$)},registerDefinitionProvider(O,$){return ki.registerDefinitionProvider(be,ft(O),$)},registerDeclarationProvider(O,$){return ki.registerDeclarationProvider(be,ft(O),$)},registerImplementationProvider(O,$){return ki.registerImplementationProvider(be,ft(O),$)},registerTypeDefinitionProvider(O,$){return ki.registerTypeDefinitionProvider(be,ft(O),$)},registerHoverProvider(O,$){return ki.registerHoverProvider(be,ft(O),$,be.identifier)},registerEvaluatableExpressionProvider(O,$){return ki.registerEvaluatableExpressionProvider(be,ft(O),$,be.identifier)},registerInlineValuesProvider(O,$){return ki.registerInlineValuesProvider(be,ft(O),$,be.identifier)},registerDocumentHighlightProvider(O,$){return ki.registerDocumentHighlightProvider(be,ft(O),$)},registerMultiDocumentHighlightProvider(O,$){return ki.registerMultiDocumentHighlightProvider(be,ft(O),$)},registerLinkedEditingRangeProvider(O,$){return ki.registerLinkedEditingRangeProvider(be,ft(O),$)},registerReferenceProvider(O,$){return ki.registerReferenceProvider(be,ft(O),$)},registerRenameProvider(O,$){return ki.registerRenameProvider(be,ft(O),$)},registerNewSymbolNamesProvider(O,$){return ze(be,"newSymbolNamesProvider"),ki.registerNewSymbolNamesProvider(be,ft(O),$)},registerDocumentSymbolProvider(O,$,se){return ki.registerDocumentSymbolProvider(be,ft(O),$,se)},registerWorkspaceSymbolProvider(O){return ki.registerWorkspaceSymbolProvider(be,O)},registerDocumentFormattingEditProvider(O,$){return ki.registerDocumentFormattingEditProvider(be,ft(O),$)},registerDocumentRangeFormattingEditProvider(O,$){return ki.registerDocumentRangeFormattingEditProvider(be,ft(O),$)},registerOnTypeFormattingEditProvider(O,$,se,...qe){return ki.registerOnTypeFormattingEditProvider(be,ft(O),$,[se].concat(qe))},registerDocumentSemanticTokensProvider(O,$,se){return ki.registerDocumentSemanticTokensProvider(be,ft(O),$,se)},registerDocumentRangeSemanticTokensProvider(O,$,se){return ki.registerDocumentRangeSemanticTokensProvider(be,ft(O),$,se)},registerSignatureHelpProvider(O,$,se,...qe){return typeof se=="object"?ki.registerSignatureHelpProvider(be,ft(O),$,se):ki.registerSignatureHelpProvider(be,ft(O),$,typeof se>"u"?[]:[se,...qe])},registerCompletionItemProvider(O,$,...se){return ki.registerCompletionItemProvider(be,ft(O),$,se)},registerInlineCompletionItemProvider(O,$,se){return $.handleDidShowCompletionItem&&ze(be,"inlineCompletionsAdditions"),$.handleDidPartiallyAcceptCompletionItem&&ze(be,"inlineCompletionsAdditions"),se&&ze(be,"inlineCompletionsAdditions"),ki.registerInlineCompletionsProvider(be,ft(O),$,se)},registerInlineEditProvider(O,$){return ze(be,"inlineEdit"),ki.registerInlineEditProvider(be,ft(O),$)},registerDocumentLinkProvider(O,$){return ki.registerDocumentLinkProvider(be,ft(O),$)},registerColorProvider(O,$){return ki.registerColorProvider(be,ft(O),$)},registerFoldingRangeProvider(O,$){return ki.registerFoldingRangeProvider(be,ft(O),$)},registerSelectionRangeProvider(O,$){return ki.registerSelectionRangeProvider(be,O,$)},registerCallHierarchyProvider(O,$){return ki.registerCallHierarchyProvider(be,O,$)},registerTypeHierarchyProvider(O,$){return ki.registerTypeHierarchyProvider(be,O,$)},setLanguageConfiguration:(O,$)=>ki.setLanguageConfiguration(be,O,$),getTokenInformationAtPosition(O,$){return ze(be,"tokenInformation"),ea.tokenAtPosition(O,$)},registerInlayHintsProvider(O,$){return ki.registerInlayHintsProvider(be,O,$)},createLanguageStatusItem(O,$){return ea.createLanguageStatusItem(be,O,$)},registerDocumentDropEditProvider(O,$,se){return ki.registerDocumentOnDropEditProvider(be,O,$,hl(be,"documentPaste")?se:void 0)}},ho={get activeTextEditor(){return Fn.getActiveTextEditor()},get visibleTextEditors(){return Fn.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 qe=await(N.isUri(O)?Promise.resolve(nr.openTextDocument(O)):Promise.resolve(O));return Fn.showTextDocument(qe,$,se)},createTextEditorDecorationType(O){return Fn.createTextEditorDecorationType(be,O)},onDidChangeActiveTextEditor(O,$,se){return xe(Fn.onDidChangeActiveTextEditor)(O,$,se)},onDidChangeVisibleTextEditors(O,$,se){return xe(Fn.onDidChangeVisibleTextEditors)(O,$,se)},onDidChangeTextEditorSelection(O,$,se){return xe(Fn.onDidChangeTextEditorSelection)(O,$,se)},onDidChangeTextEditorOptions(O,$,se){return xe(Fn.onDidChangeTextEditorOptions)(O,$,se)},onDidChangeTextEditorVisibleRanges(O,$,se){return xe(Fn.onDidChangeTextEditorVisibleRanges)(O,$,se)},onDidChangeTextEditorViewColumn(O,$,se){return xe(Fn.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 ze(be,"terminalDimensions"),xe(R.onDidChangeTerminalDimensions)(O,$,se)},onDidChangeTerminalState(O,$,se){return xe(R.onDidChangeTerminalState)(O,$,se)},onDidWriteTerminalData(O,$,se){return ze(be,"terminalDataWriteEvent"),xe(R.onDidWriteTerminalData)(O,$,se)},onDidExecuteTerminalCommand(O,$,se){return ze(be,"terminalExecuteCommandEvent"),xe(R.onDidExecuteTerminalCommand)(O,$,se)},onDidChangeTerminalShellIntegration(O,$,se){return ze(be,"terminalShellIntegration"),xe(z.onDidChangeTerminalShellIntegration)(O,$,se)},onDidStartTerminalShellExecution(O,$,se){return ze(be,"terminalShellIntegration"),xe(z.onDidStartTerminalShellExecution)(O,$,se)},onDidEndTerminalShellExecution(O,$,se){return ze(be,"terminalShellIntegration"),xe(z.onDidEndTerminalShellExecution)(O,$,se)},get state(){return v.getState()},onDidChangeWindowState(O,$,se){return xe(v.onDidChangeWindowState)(O,$,se)},showInformationMessage(O,...$){return Ic.showMessage(be,Ze.Info,O,$[0],$.slice(1))},showWarningMessage(O,...$){return Ic.showMessage(be,Ze.Warning,O,$[0],$.slice(1))},showErrorMessage(O,...$){return Ic.showMessage(be,Ze.Error,O,$[0],$.slice(1))},showQuickPick(O,$,se){return Ln.showQuickPick(be,O,$,se)},showWorkspaceFolderPick(O){return Ln.showWorkspaceFolderPick(O)},showInputBox(O,$){return Ln.showInput(O,$)},showOpenDialog(O){return Fh.showOpenDialog(be,O)},showSaveDialog(O){return Fh.showSaveDialog(O)},createStatusBarItem(O,$,se){let qe,Wi,Hi;return typeof O=="string"?(qe=O,Wi=$,Hi=se):(Wi=O,Hi=$),ah.createStatusBarEntry(be,qe,Wi,Hi)},setStatusBarMessage(O,$){return ah.setStatusBarMessage(O,$)},withScmProgress(O){return m.report("window.withScmProgress",be,"Use 'withProgress' instead."),mc.withProgress(be,{location:SD.SourceControl},($,se)=>O({report(qe){}}))},withProgress(O,$){return mc.withProgress(be,O,$)},createOutputChannel(O,$){return ne.createOutputChannel(O,$,be)},createWebviewPanel(O,$,se,qe){return sh.createWebviewPanel(be,O,$,se,qe)},createWebviewTextEditorInset(O,$,se,qe){return ze(be,"editorInsets"),hs.createWebviewEditorInset(O,$,se,qe,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 ze(be,"terminalQuickFixProvider"),R.registerTerminalQuickFixProvider(O,be.identifier.value,$)},registerTreeDataProvider(O,$){return Zo.registerTreeDataProvider(O,$,be)},createTreeView(O,$){return Zo.createTreeView(O,$,be)},registerWebviewPanelSerializer:(O,$)=>sh.registerWebviewPanelSerializer(be,O,$),registerCustomEditorProvider:(O,$,se={})=>mg.registerCustomEditorProvider(be,O,$,se),registerFileDecorationProvider(O){return L.registerFileDecorationProvider(O,be)},registerUriHandler(O){return De.registerUriHandler(be,O)},createQuickPick(){return Ln.createQuickPick(be)},createInputBox(){return Ln.createInputBox(be)},get activeColorTheme(){return Gs.activeColorTheme},onDidChangeActiveColorTheme(O,$,se){return xe(Gs.onDidChangeActiveColorTheme)(O,$,se)},registerWebviewViewProvider(O,$,se){return _c.registerWebviewViewProvider(be,O,$,se?.webviewOptions)},get activeNotebookEditor(){return dt.activeNotebookEditor},onDidChangeActiveNotebookEditor(O,$,se){return xe(dt.onDidChangeActiveNotebookEditor)(O,$,se)},get visibleNotebookEditors(){return dt.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return xe(dt.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(O,$,se){return xe(Xi.onDidChangeNotebookEditorSelection)(O,$,se)},onDidChangeNotebookEditorVisibleRanges(O,$,se){return xe(Xi.onDidChangeNotebookEditorVisibleRanges)(O,$,se)},showNotebookDocument(O,$){return dt.showNotebookDocument(O,$)},registerExternalUriOpener(O,$,se){return ze(be,"externalUriOpener"),rh.registerExternalUriOpener(be.identifier,O,$,se)},registerProfileContentHandler(O,$){return ze(be,"profileContentHandlers"),kc.registerProfileContentHandler(be,O,$)},registerQuickDiffProvider(O,$,se,qe){return ze(be,"quickDiffProvider"),wd.registerQuickDiffProvider(ft(O),$,se,qe)},get tabGroups(){return w.tabGroups},registerShareProvider(O,$){return ze(be,"shareProvider"),On.registerShareProvider(ft(O),$)}},nr={get rootPath(){return m.report("workspace.rootPath",be,"Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath"),r.getPath()},set rootPath(O){throw new T1("rootPath")},getWorkspaceFolder(O){return r.getWorkspaceFolder(O)},get workspaceFolders(){return r.getWorkspaceFolders()},get name(){return r.name},set name(O){throw new T1("name")},get workspaceFile(){return r.workspaceFile},set workspaceFile(O){throw new T1("workspaceFile")},updateWorkspaceFolders:(O,$,...se)=>r.updateWorkspaceFolders(be,O,$||0,...se),onDidChangeWorkspaceFolders:function(O,$,se){return xe(r.onDidChangeWorkspace)(O,$,se)},asRelativePath:(O,$)=>r.getRelativePath(O,$),findFiles:(O,$,se,qe)=>r.findFiles(O,$,se,be.identifier,qe),findFiles2:(O,$,se)=>(ze(be,"findFiles2"),r.findFiles2(O,$,be.identifier,se)),findFiles2New:(O,$,se)=>{ze(be,"findFiles2New");const qe={exclude:$?.exclude&&$.exclude.length>0?$.exclude[0]:void 0,useDefaultExcludes:!$?.useExcludeSettings||$?.useExcludeSettings===Fw.filesExclude||$?.useExcludeSettings===Fw.searchAndFilesExclude,useDefaultSearchExcludes:!$?.useExcludeSettings||$?.useExcludeSettings===Fw.searchAndFilesExclude,maxResults:$?.maxResults,useIgnoreFiles:$?.useIgnoreFiles?.local,useGlobalIgnoreFiles:$?.useIgnoreFiles?.global,useParentIgnoreFiles:$?.useIgnoreFiles?.parent,followSymlinks:$?.followSymlinks};return r.findFiles2(O&&O.length>0?O[0]:void 0,qe,be.identifier,se)},findTextInFiles:(O,$,se,qe)=>{ze(be,"findTextInFiles");let Wi,Hi;return typeof $=="object"?(Wi=$,Hi=se):(Wi={},Hi=$,qe=se),r.findTextInFiles(O,Wi||{},Hi,be.identifier,qe)},findTextInFilesNew:(O,$,se)=>{ze(be,"findTextInFilesNew"),ze(be,"textSearchProviderNew");let qe={};$&&(qe={include:$.include&&$.include.length>0?$.include[0]:void 0,exclude:$.exclude&&$.exclude.length>0?$.exclude[0]:void 0,useDefaultExcludes:$.useExcludeSettings===void 0||$.useExcludeSettings===Fw.filesExclude||$.useExcludeSettings===Fw.searchAndFilesExclude,useSearchExclude:$.useExcludeSettings===void 0||$.useExcludeSettings===Fw.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 Wi=Promise.resolve(void 0);return{results:new Yd(async ia=>{const Bl=async _g=>(ia.emitOne(k9t(_g)),_g);await Wi.then(_g=>r.findTextInFiles(O,qe,Bl,be.identifier,se))}),complete:Wi.then(ia=>({limitHit:ia?.limitHit??!1}))}},save:O=>r.save(O),saveAs:O=>r.saveAs(O),saveAll:O=>r.saveAll(O),applyEdit(O,$){return Br.applyWorkspaceEdit(O,be,$)},createFileSystemWatcher:(O,$,se,qe)=>{let Wi;return typeof $=="boolean"?Wi={ignoreCreateEvents:!!$,ignoreChangeEvents:!!se,ignoreDeleteEvents:!!qe,correlate:!1}:$&&(ze(be,"createFileSystemWatcher"),Wi={...$,correlate:!0}),Or.createFileSystemWatcher(r,be,O,Wi)},get textDocuments(){return Be.getAllDocumentData().map(O=>O.document)},set textDocuments(O){throw new T1("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")$=Be.createDocumentData(se);else throw new Error("illegal argument - uriOrFileNameOrOptions");return $.then(qe=>(qe.scheme===pe.vscodeRemote&&!qe.authority&&m.report("workspace.openTextDocument",be,"A URI of 'vscode-remote' scheme requires an authority."),Be.ensureDocumentData(qe).then(Wi=>Wi.document)))},onDidOpenTextDocument:(O,$,se)=>xe(Be.onDidAddDocument)(O,$,se),onDidCloseTextDocument:(O,$,se)=>xe(Be.onDidRemoveDocument)(O,$,se),onDidChangeTextDocument:(O,$,se)=>xe(Be.onDidChangeDocument)(O,$,se),onDidSaveTextDocument:(O,$,se)=>xe(Be.onDidSaveDocument)(O,$,se),onWillSaveTextDocument:(O,$,se)=>xe(Ne.getOnWillSaveTextDocumentEvent(be))(O,$,se),get notebookDocuments(){return dt.notebookDocuments.map(O=>O.apiNotebook)},async openNotebookDocument(O,$){let se;if(N.isUri(O))se=O,await dt.openNotebookDocument(O);else if(typeof O=="string")se=N.revive(await dt.createNotebookDocument({viewType:O,content:$}));else throw new Error("Invalid arguments");return dt.getNotebookDocument(se).apiNotebook},onDidSaveNotebookDocument(O,$,se){return xe(Dt.onDidSaveNotebookDocument)(O,$,se)},onDidChangeNotebookDocument(O,$,se){return xe(Dt.onDidChangeNotebookDocument)(O,$,se)},onWillSaveNotebookDocument(O,$,se){return xe($s.getOnWillSaveNotebookDocumentEvent(be))(O,$,se)},get onDidOpenNotebookDocument(){return xe(dt.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return xe(dt.onDidCloseNotebookDocument)},registerNotebookSerializer(O,$,se,qe){return dt.registerNotebookSerializer(be,O,$,se,hl(be,"notebookLiveShare")?qe: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 Ct.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 Yo(rs.registerFileSystemProvider(be,O,$,se),i.addFileSystemProvider(O,$,se))},get fs(){return i.value},registerFileSearchProvider:(O,$)=>(ze(be,"fileSearchProvider"),Y.registerFileSearchProvider(O,$)),registerTextSearchProvider:(O,$)=>(ze(be,"textSearchProvider"),Y.registerTextSearchProvider(O,$)),registerAITextSearchProvider:(O,$)=>(ze(be,"aiTextSearchProvider"),ze(be,"textSearchProvider"),Y.registerAITextSearchProvider(O,$)),registerFileSearchProviderNew:(O,$)=>(ze(be,"fileSearchProviderNew"),{dispose:()=>{}}),registerTextSearchProviderNew:(O,$)=>(ze(be,"textSearchProviderNew"),{dispose:()=>{}}),registerAITextSearchProviderNew:(O,$)=>(ze(be,"aiTextSearchProviderNew"),ze(be,"textSearchProviderNew"),{dispose:()=>{}}),registerRemoteAuthorityResolver:(O,$)=>(ze(be,"resolvers"),n.registerRemoteAuthorityResolver(O,$)),registerResourceLabelFormatter:O=>(ze(be,"resolvers"),$c.$registerResourceLabelFormatter(O)),getRemoteExecServer:O=>(ze(be,"resolvers"),n.getRemoteExecServer(O)),onDidCreateFiles:(O,$,se)=>xe(Or.onDidCreateFile)(O,$,se),onDidDeleteFiles:(O,$,se)=>xe(Or.onDidDeleteFile)(O,$,se),onDidRenameFiles:(O,$,se)=>xe(Or.onDidRenameFile)(O,$,se),onWillCreateFiles:(O,$,se)=>xe(Or.getOnWillCreateFileEvent(be))(O,$,se),onWillDeleteFiles:(O,$,se)=>xe(Or.getOnWillDeleteFileEvent(be))(O,$,se),onWillRenameFiles:(O,$,se)=>xe(Or.getOnWillRenameFileEvent(be))(O,$,se),openTunnel:O=>(ze(be,"tunnels"),p.openTunnel(be,O).then($=>{if(!$)throw new Error("cannot open tunnel");return $})),get tunnels(){return ze(be,"tunnels"),p.getTunnels()},onDidChangeTunnels:(O,$,se)=>(ze(be,"tunnels"),xe(p.onDidChangeTunnels)(O,$,se)),registerPortAttributesProvider:(O,$)=>(ze(be,"portsAttributes"),p.registerPortsAttributesProvider(O,$)),registerTunnelProvider:(O,$)=>(ze(be,"tunnelFactory"),p.registerTunnelProvider(O,$)),registerTimelineProvider:(O,$)=>(ze(be,"timeline"),ic.registerTimelineProvider(O,$,be.identifier,P.converter)),get isTrusted(){return r.trusted},requestWorkspaceTrust:O=>(ze(be,"workspaceTrust"),r.requestWorkspaceTrust(O)),onDidGrantWorkspaceTrust:(O,$,se)=>xe(r.onDidGrantWorkspaceTrust)(O,$,se),registerEditSessionIdentityProvider:(O,$)=>(ze(be,"editSessionIdentityProvider"),r.registerEditSessionIdentityProvider(O,$)),onWillCreateEditSessionIdentity:(O,$,se)=>(ze(be,"editSessionIdentityProvider"),xe(r.getOnWillCreateEditSessionIdentityEvent(be))(O,$,se)),registerCanonicalUriProvider:(O,$)=>(ze(be,"canonicalUriProvider"),r.registerCanonicalUriProvider(O,$)),getCanonicalUri:(O,$,se)=>(ze(be,"canonicalUriProvider"),r.provideCanonicalUri(O,$,se))},gn={get inputBox(){return m.report("scm.inputBox",be,"Use 'SourceControl.inputBox' instead"),Ha.getLastInputBox(be)},createSourceControl(O,$,se){return Ha.createSourceControl(be,O,$,se)}},Se={createCommentController(O,$){return nh.createCommentController(be,O,$)}},at={get activeDebugSession(){return G.activeDebugSession},get activeDebugConsole(){return G.activeDebugConsole},get breakpoints(){return G.breakpoints},get activeStackItem(){return G.activeStackItem},registerDebugVisualizationProvider(O,$){return ze(be,"debugVisualization"),G.registerDebugVisualizationProvider(be,O,$)},registerDebugVisualizationTreeProvider(O,$){return ze(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||R9.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,$)}},Ot={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)},Si={createNotebookController(O,$,se,qe,Wi){return Ti.createNotebookController(be,O,$,se,qe,hl(be,"notebookMessaging")?Wi:void 0)},registerNotebookCellStatusBarItemProvider:(O,$)=>dt.registerNotebookCellStatusBarItemProvider(be,O,$),createRendererMessaging(O){return ss.createRendererMessaging(be,O)},createNotebookControllerDetectionTask(O){return ze(be,"notebookKernelSource"),Ti.createNotebookControllerDetectionTask(be,O)},registerKernelSourceActionProvider(O,$){return ze(be,"notebookKernelSource"),Ti.registerKernelSourceActionProvider(be,O,$)},onDidChangeNotebookCellExecutionState(O,$,se){return ze(be,"notebookCellExecutionState"),xe(Ti.onDidChangeNotebookCellExecutionState)(O,$,se)}},Bt={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 ze(be,"interactive"),ml.transferActiveChat(O)}},de={getRelatedInformation(O,$){return ze(be,"aiRelatedInformation"),_l.getRelatedInformation(be,O,$)},registerRelatedInformationProvider(O,$){return ze(be,"aiRelatedInformation"),_l.registerRelatedInformationProvider(be,O,$)},registerEmbeddingVectorProvider(O,$){return ze(be,"aiRelatedInformation"),oh.registerEmbeddingVectorProvider(be,O,$)}},T={_version:1,registerChatResponseProvider(O,$,se){return ze(be,"chatProvider"),A.registerLanguageModel(be,O,$,se)},registerChatVariableResolver(O,$,se,qe,Wi,Hi,ia,Bl){return ze(be,"chatVariableResolver"),nc.registerVariableResolver(be,O,$,se,qe,Wi,Hi,ia,Bl?.id)},registerMappedEditsProvider(O,$){return ze(be,"mappedEditsProvider"),ki.registerMappedEditsProvider(be,O,$)},createChatParticipant(O,$){return ml.createChatAgent(be,O,$)},createDynamicChatParticipant(O,$,se){return ze(be,"chatParticipantPrivate"),ml.createDynamicChatAgent(be,O,$,se)}},ie={selectChatModels:O=>A.selectLanguageModels(be,O??{}),onDidChangeChatModels:(O,$,se)=>A.onDidChangeProviders(O,$,se),registerChatModelProvider:(O,$,se)=>(ze(be,"chatProvider"),A.registerLanguageModel(be,O,$,se)),get embeddingModels(){return ze(be,"embeddings"),qc.embeddingsModels},onDidChangeEmbeddingModels:(O,$,se)=>(ze(be,"embeddings"),qc.onDidChange(O,$,se)),registerEmbeddingsProvider(O,$){return ze(be,"embeddings"),qc.registerEmbeddingsProvider(be,O,$)},async computeEmbeddings(O,$,se){return ze(be,"embeddings"),qc.computeEmbeddings(O,$,se)},registerTool(O,$){return ze(be,"lmTools"),Bo.registerTool(be,O,$)},invokeTool(O,$,se){return ze(be,"lmTools"),Bo.invokeTool(O,$,se)},get tools(){return ze(be,"lmTools"),Bo.tools}},ye={registerSpeechProvider(O,$){return ze(be,"speech"),Kc.registerProvider(be.identifier,O,$)}};return{version:e.version,ai:de,authentication:$n,commands:Ss,comments:Se,chat:T,debug:at,env:Wr,extensions:Oh,interactive:K,l10n:Bt,languages:le,lm:ie,notebooks:Si,scm:gn,speech:ye,tasks:Ot,tests:Va,window:ho,workspace:nr,Breakpoint:uN,TerminalOutputAnchor:qee,ChatResultFeedbackKind:IH,ChatVariableLevel:Ete,ChatCompletionItem:Vst,CallHierarchyIncomingCall:fPe,CallHierarchyItem:tle,CallHierarchyOutgoingCall:pPe,CancellationError:Pa,CancellationTokenSource:li,CandidatePortSource:iL,CodeAction:V9,CodeActionKind:Aa,CodeActionTriggerKind:dH,CodeLens:z9,Color:dN,ColorInformation:j9,ColorPresentation:Y9,ColorThemeKind:wS,CommentMode:fte,CommentState:pte,CommentThreadCollapsibleState:yH,CommentThreadState:CH,CommentThreadApplicability:SH,CommentThreadFocus:AH,CompletionItem:K9,CompletionItemKind:en,CompletionItemTag:uH,CompletionList:aN,CompletionTriggerKind:QT,ConfigurationTarget:YT,CustomExecution:ile,DebugAdapterExecutable:t$,DebugAdapterInlineImplementation:n$,DebugAdapterNamedPipeServer:i$,DebugAdapterServer:vH,DebugConfigurationProviderTriggerKind:R9,DebugConsoleMode:c$,DebugVisualization:Rst,DecorationRangeBehavior:Kx,Diagnostic:O9,DiagnosticRelatedInformation:rH,DiagnosticSeverity:Hd,DiagnosticTag:$x,Disposable:js,DocumentHighlight:H9,DocumentHighlightKind:oH,MultiDocumentHighlight:U9,DocumentLink:Q9,DocumentSymbol:lH,EndOfLine:T_,EnvironmentVariableMutatorType:KT,EvaluatableExpression:s$,InlineValueText:r$,InlineValueVariableLookup:o$,InlineValueEvaluatableExpression:a$,InlineCompletionTriggerKind:bH,EventEmitter:I,ExtensionKind:ED,ExtensionMode:eL,ExternalUriOpenerPriority:Cte,FileChangeType:XT,FileDecoration:l$,FileDecoration2:l$,FileSystemError:Xc,FileType:rn,FilePermission:up,FoldingRange:gte,FoldingRangeKind:Gw,FunctionBreakpoint:Qx,InlineCompletionItem:ete,InlineCompletionList:tte,Hover:B9,VerboseHover:W9,HoverVerbosityAction:Qee,IndentAction:Co,Location:Ap,MarkdownString:gf,OverviewRulerLane:Tl,ParameterInformation:jee,PortAutoForwardAction:Ste,Position:ws,ProcessExecution:hN,ProgressLocation:SD,QuickInputButtonLocation:_te,QuickInputButtons:EH,Range:Xn,RelativePattern:JT,Selection:uC,SelectionRange:hH,SemanticTokens:gN,SemanticTokensBuilder:Tst,SemanticTokensEdit:vPe,SemanticTokensEdits:gz,SemanticTokensLegend:mte,ShellExecution:bI,ShellQuoting:ate,SignatureHelp:Jee,SignatureHelpTriggerKind:Xee,SignatureInformation:Yee,SnippetString:vI,SourceBreakpoint:qx,StandardTokenType:PS,StatusBarAlignment:NS,SymbolInformation:cH,SymbolKind:vo,SymbolTag:aH,Task:J9,TaskGroup:pH,TaskPanelKind:ote,TaskRevealKind:rte,TaskScope:wI,TerminalLink:Cst,TerminalQuickFixTerminalCommand:Ast,TerminalQuickFixOpener:Sst,TerminalLocation:ste,TerminalProfile:Est,TerminalExitReason:nte,TerminalShellExecutionCommandLineConfidence:CD,TextDocumentSaveReason:jT,TextEdit:qA,SnippetTextEdit:ele,TextEditorCursorStyle:Qo,TextEditorLineNumbersStyle:c_,TextEditorRevealType:q9,TextEditorSelectionChangeKind:cN,SyntaxTokenType:lN,TextDocumentChangeReason:fH,ThemeColor:_H,ThemeIcon:fu,TreeItem:X9,TreeItemCheckboxState:fb,TreeItemCollapsibleState:AD,TypeHierarchyItem:nle,UIKind:sv,Uri:N,ViewColumn:gH,WorkspaceEdit:_I,DocumentPasteTriggerKind:dte,DocumentDropEdit:lte,DocumentDropOrPasteEditKind:e$,DocumentPasteEdit:Dst,InlayHint:G9,InlayHintLabelPart:$9,InlayHintKind:Zee,RemoteAuthorityResolverError:a1,ResolvedAuthority:yst,ManagedResolvedAuthority:uz,SourceControlInputBoxValidationType:ite,ExtensionRuntime:f$,TimelineItem:wte,NotebookRange:Dy,NotebookCellKind:jx,NotebookCellExecutionState:fN,NotebookCellData:vG,NotebookData:bPe,NotebookRendererScript:yPe,NotebookCellStatusBarAlignment:h$,NotebookEditorRevealType:u$,NotebookCellOutput:d$,NotebookCellOutputItem:wPe,NotebookCellStatusBarItem:Mst,NotebookControllerAffinity:bte,NotebookControllerAffinity2:g$,NotebookEdit:F9,NotebookKernelSourceAction:Nst,NotebookVariablesRequestKind:DH,PortAttributes:Fst,LinkedEditingRanges:Pst,TestResultState:yte,TestRunRequest:p$,TestMessage:pN,TestMessage2:pN,TestMessageStackFrame:Ost,TestTag:kH,TestRunProfileKind:tL,TextSearchCompleteMessageType:Mee,DataTransfer:mH,DataTransferItem:Z9,TestCoverageCount:fz,FileCoverage:mN,FileCoverage2:mN,StatementCoverage:Wst,BranchCoverage:Hst,DeclarationCoverage:Ust,WorkspaceTrustState:bEe,LanguageStatusSeverity:qT,QuickPickItemKind:xH,InputBoxValidationSeverity:ZT,TabInputText:sle,TabInputTextDiff:m$,TabInputTextMerge:CPe,TabInputCustom:rle,TabInputNotebook:ole,TabInputNotebookDiff:ale,TabInputWebview:SPe,TabInputTerminal:APe,TabInputInteractiveWindow:EPe,TabInputChat:xPe,TabInputTextMultiDiff:DPe,TelemetryTrustedValue:rce,LogLevel:Kn,EditSessionIdentityMatch:Lte,InteractiveSessionVoteDirection:wEe,ChatCopyKind:Ate,InteractiveEditorResponseFeedbackKind:yEe,DebugStackFrame:mPe,DebugThread:_Pe,RelatedInformationType:Dte,SpeechToTextStatus:kte,TextToSpeechStatus:Ite,PartialAcceptTriggerKind:Gx,KeywordRecognitionStatus:Tte,ChatResponseMarkdownPart:bG,ChatResponseFileTreePart:wG,ChatResponseAnchorPart:yG,ChatResponseProgressPart:RH,ChatResponseProgressPart2:kPe,ChatResponseReferencePart:Rb,ChatResponseReferencePart2:Rb,ChatResponseCodeCitationPart:v$,ChatResponseWarningPart:MH,ChatResponseTextEditPart:NH,ChatResponseMarkdownWithVulnerabilitiesPart:TH,ChatResponseCommandButtonPart:CG,ChatResponseDetectedParticipantPart:LH,ChatResponseConfirmationPart:_$,ChatResponseReferencePartStatusKind:xte,ChatRequestTurn:IPe,ChatResponseTurn:TPe,ChatLocation:l_,ChatRequestEditorData:LPe,ChatRequestNotebookData:RPe,LanguageModelChatMessageRole:jp,LanguageModelChatMessage:MPe,LanguageModelChatMessageFunctionResultPart:b$,LanguageModelChatResponseTextPart:PH,LanguageModelChatResponseFunctionUsePart:cle,LanguageModelError:Ow,NewSymbolName:Ist,NewSymbolNameTag:ute,NewSymbolNameTriggerKind:wH,InlineEdit:zst,InlineEditTriggerKind:FH,ExcludeSettingOptions:Fw,TextSearchContextNew:uPe,TextSearchMatchNew:hPe,TextSearchCompleteMessageTypeNew:Nee}}}var kj;let S0e=class{constructor(e,t,i,n,r,o,a){this._apiFactory=e,this._extensionRegistry=t,this._instaService=i,this._extHostConfiguration=n,this._extHostExtensionService=r,this._initData=o,this._logService=a,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),ls("code/extHost/willWaitForConfig");const e=await this._extHostConfiguration.getConfigProvider();ls("code/extHost/didWaitForConfig");const t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new osi(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(A0e)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(E0e,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))}};S0e=D([_(2,we),_(3,hE),_(4,WI),_(5,bu),_(6,Ke)],S0e);var _M;let A0e=(_M=class{constructor(e){if(e.environment.appRoot&&kj.aliased.size){const t=Nh(this.forceForwardSlashes(e.environment.appRoot.fsPath)),i="[a-z0-9_.-]",n=`@${i}+\\/${i}+|${i}+`,r="node_modules|node_modules\\.asar(?:\\.unpacked)?";this.re=new RegExp(`^(${t}/${r}\\/)(${n})(.*)$`,"i")}}alternativeModuleName(e){if(!this.re)return;const t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;const[,i,n,r]=t,o=kj.aliased.get(n);if(o!==void 0)return console.warn(`${n} as been renamed to ${o}, please update your imports`),i+o+r}forceForwardSlashes(e){return e.replace(/\\/g,"/")}},kj=_M,_M.aliased=new Map([["vscode-ripgrep","@vscode/ripgrep"],["vscode-windows-registry","@vscode/windows-registry"]]),_M);A0e=kj=D([_(0,bu)],A0e);class osi{constructor(e,t,i,n,r){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=i,this._configProvider=n,this._logService=r,this.nodeModuleName="vscode",this._extApiImpl=new ba}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((r,o)=>n+=` ${o} -> ${r.identifier.value} `),this._logService.warn(`Could not identify extension for 'vscode' require call from ${t}. These are the extension path mappings: -${n}`),this._defaultApiImpl=this._apiFactory(BZe,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}}let E0e=class{constructor(e,t,i){this._extensionPaths=e,this._appUriScheme=t,this.nodeModuleName=["open","opn"],this._mainThreadTelemetry=i.getProxy(We.MainThreadTelemetry);const n=i.getProxy(We.MainThreadWindow);this._impl=(r,o)=>{const a=N.parse(r);return o?this.callOriginal(r,o):a.scheme==="http"||a.scheme==="https"?n.$openUri(a,r,{allowTunneling:!0}):a.scheme==="mailto"||a.scheme===this._appUriScheme?n.$openUri(a,r,{}):this.callOriginal(r,o)}}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})}};E0e=D([_(2,Jr)],E0e);let x0e=class{constructor(e,t){this._mainThreadConsole=e.getProxy(We.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:asi(n,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,i,n)}};x0e=D([_(0,Jr),_(1,bu)],x0e);const osi=1e5;function asi(s,e){const t=[];if(s.length)for(let i=0;i"u")n="undefined";else if(n instanceof Error){const r=n;r.stack?n=r.stack:n=r.toString()}t.push(n)}if(e){const i=new Error().stack;i&&t.push({__$stack:i.split(` +${n}`),this._defaultApiImpl=this._apiFactory(BZe,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}}let E0e=class{constructor(e,t,i){this._extensionPaths=e,this._appUriScheme=t,this.nodeModuleName=["open","opn"],this._mainThreadTelemetry=i.getProxy(We.MainThreadTelemetry);const n=i.getProxy(We.MainThreadWindow);this._impl=(r,o)=>{const a=N.parse(r);return o?this.callOriginal(r,o):a.scheme==="http"||a.scheme==="https"?n.$openUri(a,r,{allowTunneling:!0}):a.scheme==="mailto"||a.scheme===this._appUriScheme?n.$openUri(a,r,{}):this.callOriginal(r,o)}}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})}};E0e=D([_(2,Jr)],E0e);let x0e=class{constructor(e,t){this._mainThreadConsole=e.getProxy(We.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:csi(n,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,i,n)}};x0e=D([_(0,Jr),_(1,bu)],x0e);const asi=1e5;function csi(s,e){const t=[];if(s.length)for(let i=0;i"u")n="undefined";else if(n instanceof Error){const r=n;r.stack?n=r.stack:n=r.toString()}t.push(n)}if(e){const i=new Error().stack;i&&t.push({__$stack:i.split(` `).slice(3).join(` -`)})}try{const i=ufe(t);return i.length>osi?"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 D0e=class extends x0e{constructor(e,t){super(e,t)}_nativeConsoleLogMessage(e,t,i){t.apply(console,i)}};D0e=D([_(0,Jr),_(1,bu)],D0e);class csi extends S0e{_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 lsi extends OIe{constructor(){super(...arguments),this.extensionRuntime=f$.Webworker}async _beforeAlmostReadyToRunExtensions(){m8&&this._instaService.createInstance(D0e),this._apiFactory=this._instaService.invokeFunction(ssi),this._fakeModules=this._instaService.createInstance(csi,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:dsi(t.path,".js")});const n=e?.identifier.value;n&&performance.mark(`code/extHost/willFetchExtensionCode/${n}`);const r=N.revive(await this._mainThreadExtensionsProxy.$asBrowserUri(t)),o=await fetch(r.toString(!0));if(n&&performance.mark(`code/extHost/didFetchExtensionCode/${n}`),o.status!==200)throw new Error(o.statusText);const a=await o.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()r.getApi(o)),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&&!Rk.isDefaultVariant()&&(n=N.joinPath(N.parse(i),this._productService.commit,this._productService.version,Rk.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??(Hn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:jl,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:pMe(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:Hn?sv.Web:sv.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){}};k0e=D([_(3,Ji),_(4,Ci),_(5,Os),_(6,Ke),_(7,pf),_(8,fv),_(9,xo),_(10,km)],k0e);async function fsi(s){return(await Hot.p)(s)}SJt(k0e);WVt(async s=>{s.get(ps),$st(await fsi())});let Uot=null;const I0e=new Vnt(!1);function psi(){return new Promise((s,e)=>{try{t9t("slintpad",I0e),ZJt({...Xei(),...oti((t,i,n)=>Promise.resolve(Uot.open_model_ref(t))),...Rti(),...Oti(),...Bti(),...zti()},void 0,{workspaceProvider:{trusted:!0,workspace:{folderUri:Zv.parse("slintpad:///")},open:t=>Promise.resolve(!1)}}).then(()=>{Jx.register({id:"slint",extensions:[".slint"],aliases:["Slint","slint"],mimetypes:["application/slint"]}),Jx.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*[\\}\\]].*$")}}),Jx.onLanguage("slint",()=>{Jx.setMonarchTokensProvider("slint",GZt)}),s()})}catch(t){e(t)}})}const msi=`import { AboutSlint, Button, VerticalBox } from "std-widgets.slint"; +`)})}try{const i=ufe(t);return i.length>asi?"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 D0e=class extends x0e{constructor(e,t){super(e,t)}_nativeConsoleLogMessage(e,t,i){t.apply(console,i)}};D0e=D([_(0,Jr),_(1,bu)],D0e);class lsi extends S0e{_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 dsi extends OIe{constructor(){super(...arguments),this.extensionRuntime=f$.Webworker}async _beforeAlmostReadyToRunExtensions(){m8&&this._instaService.createInstance(D0e),this._apiFactory=this._instaService.invokeFunction(rsi),this._fakeModules=this._instaService.createInstance(lsi,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:hsi(t.path,".js")});const n=e?.identifier.value;n&&performance.mark(`code/extHost/willFetchExtensionCode/${n}`);const r=N.revive(await this._mainThreadExtensionsProxy.$asBrowserUri(t)),o=await fetch(r.toString(!0));if(n&&performance.mark(`code/extHost/didFetchExtensionCode/${n}`),o.status!==200)throw new Error(o.statusText);const a=await o.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()r.getApi(o)),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&&!Rk.isDefaultVariant()&&(n=N.joinPath(N.parse(i),this._productService.commit,this._productService.version,Rk.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??(Hn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:jl,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:pMe(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:Hn?sv.Web:sv.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){}};k0e=D([_(3,Ji),_(4,Ci),_(5,Os),_(6,Ke),_(7,pf),_(8,fv),_(9,xo),_(10,km)],k0e);async function psi(s){return(await Hot.p)(s)}SJt(k0e);WVt(async s=>{s.get(ps),$st(await psi())});let Uot=null;const I0e=new Vnt(!1);function msi(){return new Promise((s,e)=>{try{t9t("slintpad",I0e),ZJt({...Zei(),...ati((t,i,n)=>Promise.resolve(Uot.open_model_ref(t))),...Mti(),...Bti(),...Wti(),...$ti()},void 0,{workspaceProvider:{trusted:!0,workspace:{folderUri:Zv.parse("slintpad:///")},open:t=>Promise.resolve(!1)}}).then(()=>{Jx.register({id:"slint",extensions:[".slint"],aliases:["Slint","slint"],mimetypes:["application/slint"]}),Jx.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*[\\}\\]].*$")}}),Jx.onLanguage("slint",()=>{Jx.setMonarchTokensProvider("slint",GZt)}),s()})}catch(t){e(t)}})}const _si=`import { AboutSlint, Button, VerticalBox } from "std-widgets.slint"; export component Demo { VerticalBox { @@ -1053,12 +1053,12 @@ export component Demo { HorizontalLayout { alignment: center; Button { text: "OK!"; } } } } -`;function LP(s){return console.assert(s.startsWith("/")),Zv.from({scheme:"slintpad",path:s})}function Tle(s){return s.scheme==="slintpad"}function pFe(s){return console.assert(Tle(s)),s.path}var H7;class _si{constructor(e){Ht(this,H7);St(this,H7,e),console.assert(Object.keys(e).length>0),Object.keys(e).forEach(t=>console.assert(t.startsWith("/")))}from_internal(e){if(!Tle(e))return e;const t=pFe(e),i=Ce(this,H7)[t]||null;return i?Zv.parse(i)??Zv.parse("file:///broken_url"):e}}H7=new WeakMap;var b2;class vsi{constructor(e){Ht(this,b2);St(this,b2,e)}from_internal(e){return Tle(e)?Zv.from({scheme:Ce(this,b2).scheme,authority:Ce(this,b2).authority,path:pFe(e)}):e}}b2=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 bsi(s){try{const e=s?.path??"";return e.substring(e.lastIndexOf("/")+1)}catch{return s?.toString()??""}}var Sx;const WFe=class WFe extends st{constructor(t){const i=WFe.createNode();super({node:i});Ht(this,Sx);this.id=t.object.textEditorModel?.uri.toString()??"",St(this,Sx,yN.create(this.contentNode,{model:t.object.textEditorModel})),this.setFlag(st.Flag.DisallowLayout),this.addClass("content"),this.addClass("editor"),this.title.label=bsi(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,Sx)}dispose(){Ce(this,Sx).dispose(),this.dispose()}get contentNode(){return this.node.getElementsByTagName("div")[0]}resize_editor(){if(Ce(this,Sx)!=null){const t=this.contentNode.offsetWidth-2,i=this.contentNode.offsetHeight-2;Ce(this,Sx).layout({width:t,height:i})}}onResize(t){this.isAttached&&this.resize_editor()}};Sx=new WeakMap;let T0e=WFe;var fT,aS,cS,U7,V7,Ax,w2;class wsi extends st{constructor(t){super({});Ht(this,fT);Ht(this,aS,new Map);Ht(this,cS,null);Ht(this,U7,null);Ht(this,V7);Ht(this,Ax,null);Ht(this,w2,{});St(this,V7,0),this.title.label="Editor",this.title.closable=!1,this.title.caption="Slint code editor",St(this,fT,new nf({spacing:0})),super.layout=Ce(this,fT),St(this,U7,t.language_client),Uot=this,t.file_reader=i=>this.handle_lsp_url_request(i),this.clear_editors(),this.open_default_content().then(i=>{Ce(this,U7)?.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"),r=t.get("load_demo");return i?(this.clear_editors(),Promise.resolve(this.open_file_with_content(LP("/main.slint"),i))):n?this.project_from_url(n):this.set_demo(r??"")}clear_editors(){St(this,V7,Ce(this,V7)+1),St(this,Ax,null),Ce(this,cS)!==null&&Ce(this,fT).removeWidget(Ce(this,cS)),St(this,cS,new gei({addButtonEnabled:!1})),Ce(this,fT).addWidget(Ce(this,cS)),Ce(this,aS).clear(),St(this,w2,{})}open_hello_world(){this.clear_editors();const t=LP("/main.slint");return this.open_file_with_content(t,msi),t}open_file_with_content(t,i){I0e.registerFile(new X3t(t,i)),yN.createModelReference(t).then(n=>this.open_model_ref(n))}open_model_ref(t){const i=new T0e(t);return Ce(this,aS).set(t.object.textEditorModel?.uri??LP("unknown.slint"),i),Ce(this,cS).addWidget(i),i.editor}async map_url(t){const i=new URL(t),n=Zv.parse(i.toString()),r=Ce(this,Ax)?.from_internal(n)??n,o=r.toString();if(Tle(r)){const a=pFe(r);Ce(this,w2)[a]=o}return o}get current_editor_pane(){const t=Zv.parse(this.current_text_document_uri??"")??LP("broken.slint");return Ce(this,aS).get(t)??Ce(this,aS).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,cS).currentWidget?.id}async project_from_url(t){return t==null?null:(this.clear_editors(),Promise.resolve((await this.open_tab_from_url(Zv.parse(t)))[0]))}async open_tab_from_url(t){const[i,n,r]=await eei(t.toString()),o=Zv.parse(i??t.toString());return St(this,Ax,r??new vsi(o)),this.safely_open_editor_with_url_content(o,LP(n??o.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=LP(i);return yN.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 r;(r=window.location.pathname.match(/releases\/([^/]*)\/editor/))&&(n="v"+r[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,aS)).map((t,i)=>t.toString())}document_contents(t){const i=Zv.parse(t);return i===void 0?void 0:Ce(this,aS).get(i)?.editor.getModel()?.getValue()}get extra_files(){return Ce(this,w2)}async handle_lsp_url_request(t){if(Ce(this,Ax)===null)return Promise.resolve("Error: Can not resolve URL.");const i=Zv.parse(t),n=Ce(this,Ax).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 o=await I0e.readFile(i);return[i,new TextDecoder().decode(o)??""]}catch{}let r="";try{const o=await fetch(t.toString());if(!o.ok)return n&&alert("Failed to download data from "+t+`: -`+o.status+" "+o.statusText),[null,""];r=await o.text()}catch{return n&&alert("Failed to download data from "+t+"."),[null,""]}return this.open_file_with_content(i,r),[i,r]}}fT=new WeakMap,aS=new WeakMap,cS=new WeakMap,U7=new WeakMap,V7=new WeakMap,Ax=new WeakMap,w2=new WeakMap;var lS,z7;class ysi{constructor(e,t){Ht(this,lS);Ht(this,z7);St(this,lS,e),St(this,z7,t),this.onError=Ce(this,lS).onError,this.onClose=Ce(this,lS).onClose,this.onPartialMessage=Ce(this,lS).onPartialMessage}dispose(){Ce(this,lS).dispose()}listen(e){return Ce(this,lS).listen(t=>{Ce(this,z7).call(this,t)||e(t)})}}lS=new WeakMap,z7=new WeakMap;var cd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cDi(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Vot(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 L0e={},R0e={},ms={},nP={},mFe={},Sne={},dn={},Xl={};Object.defineProperty(Xl,"__esModule",{value:!0});Xl.stringArray=Xl.array=Xl.func=Xl.error=Xl.number=Xl.string=Xl.boolean=void 0;function Csi(s){return s===!0||s===!1}Xl.boolean=Csi;function zot(s){return typeof s=="string"||s instanceof String}Xl.string=zot;function Ssi(s){return typeof s=="number"||s instanceof Number}Xl.number=Ssi;function Asi(s){return s instanceof Error}Xl.error=Asi;function Esi(s){return typeof s=="function"}Xl.func=Esi;function $ot(s){return Array.isArray(s)}Xl.array=$ot;function xsi(s){return $ot(s)&&s.every(e=>zot(e))}Xl.stringArray=xsi;Object.defineProperty(dn,"__esModule",{value:!0});dn.Message=dn.NotificationType9=dn.NotificationType8=dn.NotificationType7=dn.NotificationType6=dn.NotificationType5=dn.NotificationType4=dn.NotificationType3=dn.NotificationType2=dn.NotificationType1=dn.NotificationType0=dn.NotificationType=dn.RequestType9=dn.RequestType8=dn.RequestType7=dn.RequestType6=dn.RequestType5=dn.RequestType4=dn.RequestType3=dn.RequestType2=dn.RequestType1=dn.RequestType=dn.RequestType0=dn.AbstractMessageSignature=dn.ParameterStructures=dn.ResponseError=dn.ErrorCodes=void 0;const F0=Xl;var M0e;(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})(M0e||(dn.ErrorCodes=M0e={}));class _Fe extends Error{constructor(e,t,i){super(t),this.code=F0.number(e)?e:M0e.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,_Fe.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}dn.ResponseError=_Fe;class eg{constructor(e){this.kind=e}static is(e){return e===eg.auto||e===eg.byName||e===eg.byPosition}toString(){return this.kind}}dn.ParameterStructures=eg;eg.auto=new eg("auto");eg.byPosition=new eg("byPosition");eg.byName=new eg("byName");class zc{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return eg.auto}}dn.AbstractMessageSignature=zc;class Dsi extends zc{constructor(e){super(e,0)}}dn.RequestType0=Dsi;class ksi extends zc{constructor(e,t=eg.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}dn.RequestType=ksi;class Isi extends zc{constructor(e,t=eg.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}dn.RequestType1=Isi;class Tsi extends zc{constructor(e){super(e,2)}}dn.RequestType2=Tsi;class Lsi extends zc{constructor(e){super(e,3)}}dn.RequestType3=Lsi;class Rsi extends zc{constructor(e){super(e,4)}}dn.RequestType4=Rsi;class Msi extends zc{constructor(e){super(e,5)}}dn.RequestType5=Msi;class Nsi extends zc{constructor(e){super(e,6)}}dn.RequestType6=Nsi;class Psi extends zc{constructor(e){super(e,7)}}dn.RequestType7=Psi;class Fsi extends zc{constructor(e){super(e,8)}}dn.RequestType8=Fsi;class Osi extends zc{constructor(e){super(e,9)}}dn.RequestType9=Osi;class Bsi extends zc{constructor(e,t=eg.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}dn.NotificationType=Bsi;class Wsi extends zc{constructor(e){super(e,0)}}dn.NotificationType0=Wsi;class Hsi extends zc{constructor(e,t=eg.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}dn.NotificationType1=Hsi;class Usi extends zc{constructor(e){super(e,2)}}dn.NotificationType2=Usi;class Vsi extends zc{constructor(e){super(e,3)}}dn.NotificationType3=Vsi;class zsi extends zc{constructor(e){super(e,4)}}dn.NotificationType4=zsi;class $si extends zc{constructor(e){super(e,5)}}dn.NotificationType5=$si;class Gsi extends zc{constructor(e){super(e,6)}}dn.NotificationType6=Gsi;class Ksi extends zc{constructor(e){super(e,7)}}dn.NotificationType7=Ksi;class qsi extends zc{constructor(e){super(e,8)}}dn.NotificationType8=qsi;class Qsi extends zc{constructor(e){super(e,9)}}dn.NotificationType9=Qsi;var M$e;(function(s){function e(n){const r=n;return r&&F0.string(r.method)&&(F0.string(r.id)||F0.number(r.id))}s.isRequest=e;function t(n){const r=n;return r&&F0.string(r.method)&&n.id===void 0}s.isNotification=t;function i(n){const r=n;return r&&(r.result!==void 0||!!r.error)&&(F0.string(r.id)||F0.number(r.id)||r.id===null)}s.isResponse=i})(M$e||(dn.Message=M$e={}));var CA={},N$e;Object.defineProperty(CA,"__esModule",{value:!0});CA.LRUCache=CA.LinkedMap=CA.Touch=void 0;var ku;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(ku||(CA.Touch=ku={}));class Got{constructor(){this[N$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=ku.None){const i=this._map.get(e);if(i)return t!==ku.None&&this.touch(i,t),i.value}set(e,t,i=ku.None){let n=this._map.get(e);if(n)n.value=t,i!==ku.None&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case ku.None:this.addItemLast(n);break;case ku.First:this.addItemFirst(n);break;case ku.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}[(N$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!==ku.First&&t!==ku.Last)){if(t===ku.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===ku.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)}}CA.LinkedMap=Got;class jsi extends Got{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=ku.AsNew){return super.get(e,t)}peek(e){return super.get(e,ku.None)}set(e,t){return super.set(e,t,ku.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}CA.LRUCache=jsi;var Lle={};Object.defineProperty(Lle,"__esModule",{value:!0});Lle.Disposable=void 0;var P$e;(function(s){function e(t){return{dispose:t}}s.create=e})(P$e||(Lle.Disposable=P$e={}));var fC={},uE={};Object.defineProperty(uE,"__esModule",{value:!0});let N0e;function P0e(){if(N0e===void 0)throw new Error("No runtime abstraction layer installed");return N0e}(function(s){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");N0e=t}s.install=e})(P0e||(P0e={}));uE.default=P0e;Object.defineProperty(fC,"__esModule",{value:!0});fC.Emitter=fC.Event=void 0;const Ysi=uE;var F$e;(function(s){const e={dispose(){}};s.None=function(){return e}})(F$e||(fC.Event=F$e={}));class Jsi{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,r=this._callbacks.length;n{this._callbacks||(this._callbacks=new Jsi),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=Rle._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)}}fC.Emitter=Rle;Rle._noop=function(){};var AI={};Object.defineProperty(AI,"__esModule",{value:!0});AI.CancellationTokenSource=AI.CancellationToken=void 0;const Xsi=uE,Zsi=Xl,F0e=fC;var Ane;(function(s){s.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:F0e.Event.None}),s.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:F0e.Event.None});function e(t){const i=t;return i&&(i===s.None||i===s.Cancelled||Zsi.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}s.is=e})(Ane||(AI.CancellationToken=Ane={}));const eri=Object.freeze(function(s,e){const t=(0,Xsi.default)().timer.setTimeout(s.bind(e),0);return{dispose(){t.dispose()}}});class O$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?eri:(this._emitter||(this._emitter=new F0e.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class tri{get token(){return this._token||(this._token=new O$e),this._token}cancel(){this._token?this._token.cancel():this._token=Ane.Cancelled}dispose(){this._token?this._token instanceof O$e&&this._token.dispose():this._token=Ane.None}}AI.CancellationTokenSource=tri;var iU={};Object.defineProperty(iU,"__esModule",{value:!0});iU.SharedArrayReceiverStrategy=iU.SharedArraySenderStrategy=void 0;const iri=AI;var h7;(function(s){s.Continue=0,s.Cancelled=1})(h7||(h7={}));class nri{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]=h7.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,h7.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}iU.SharedArraySenderStrategy=nri;class sri{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===h7.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class rri{constructor(e){this.token=new sri(e)}cancel(){}dispose(){}}class ori{constructor(){this.kind="request"}createCancellationTokenSource(e){const t=e.$cancellationData;return t===void 0?new iri.CancellationTokenSource:new rri(t)}}iU.SharedArrayReceiverStrategy=ori;var LD={},DG={};Object.defineProperty(DG,"__esModule",{value:!0});DG.Semaphore=void 0;const ari=uE;let cri=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,ari.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()}}};DG.Semaphore=cri;Object.defineProperty(LD,"__esModule",{value:!0});LD.ReadableStreamMessageReader=LD.AbstractMessageReader=LD.MessageReader=void 0;const O0e=uE,iF=Xl,Dge=fC,lri=DG;var B$e;(function(s){function e(t){let i=t;return i&&iF.func(i.listen)&&iF.func(i.dispose)&&iF.func(i.onError)&&iF.func(i.onClose)&&iF.func(i.onPartialMessage)}s.is=e})(B$e||(LD.MessageReader=B$e={}));class Kot{constructor(){this.errorEmitter=new Dge.Emitter,this.closeEmitter=new Dge.Emitter,this.partialMessageEmitter=new Dge.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: ${iF.string(e.message)?e.message:"unknown"}`)}}LD.AbstractMessageReader=Kot;var B0e;(function(s){function e(t){let i,n;const r=new Map;let o;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,r.set(n.name,n)),t.contentDecoders!==void 0)for(const c of t.contentDecoders)r.set(c.name,c);if(t.contentTypeDecoder!==void 0&&(o=t.contentTypeDecoder,a.set(o.name,o)),t.contentTypeDecoders!==void 0)for(const c of t.contentTypeDecoders)a.set(c.name,c)}return o===void 0&&(o=(0,O0e.default)().applicationJson.decoder,a.set(o.name,o)),{charset:i,contentDecoder:n,contentDecoders:r,contentTypeDecoder:o,contentTypeDecoders:a}}s.fromOptions=e})(B0e||(B0e={}));class dri extends Kot{constructor(e,t){super(),this.readable=e,this.options=B0e.fromOptions(t),this.buffer=(0,O0e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new lri.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 r=parseInt(n);if(isNaN(r)){this.fireError(new Error(`Content-Length value must be a number. Got ${n}`));return}this.nextMessageLength=r}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,O0e.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))}}LD.ReadableStreamMessageReader=dri;var RD={};Object.defineProperty(RD,"__esModule",{value:!0});RD.WriteableStreamMessageWriter=RD.AbstractMessageWriter=RD.MessageWriter=void 0;const W$e=uE,JV=Xl,hri=DG,H$e=fC,uri="Content-Length: ",U$e=`\r -`;var V$e;(function(s){function e(t){let i=t;return i&&JV.func(i.dispose)&&JV.func(i.onClose)&&JV.func(i.onError)&&JV.func(i.write)}s.is=e})(V$e||(RD.MessageWriter=V$e={}));class qot{constructor(){this.errorEmitter=new H$e.Emitter,this.closeEmitter=new H$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: ${JV.string(e.message)?e.message:"unknown"}`)}}RD.AbstractMessageWriter=qot;var W0e;(function(s){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,W$e.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,W$e.default)().applicationJson.encoder}}s.fromOptions=e})(W0e||(W0e={}));class gri extends qot{constructor(e,t){super(),this.writable=e,this.options=W0e.fromOptions(t),this.errorCount=0,this.writeSemaphore=new hri.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(uri,i.byteLength.toString(),U$e),n.push(U$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()}}RD.WriteableStreamMessageWriter=gri;var Mle={};Object.defineProperty(Mle,"__esModule",{value:!0});Mle.AbstractMessageBuffer=void 0;const fri=13,pri=10,mri=`\r -`;class _ri{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,r=0;e:for(;ithis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const r=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(r)}if(this._chunks[0].byteLength>e){const r=this._chunks[0],o=this.asNative(r,e);return this._chunks[0]=r.slice(e),this._totalLength-=e,o}const t=this.allocNative(e);let i=0,n=0;for(;e>0;){const r=this._chunks[n];if(r.byteLength>e){const o=r.slice(0,e);t.set(o,i),i+=e,this._chunks[n]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,i),i+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}Mle.AbstractMessageBuffer=_ri;var Qot={};(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=uE,t=Xl,i=dn,n=CA,r=fC,o=AI;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 o.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 Be=ge!==void 0?ge:s.NullLogger;let Ct=0,Ne=0,dt=0;const Dt="2.0";let Xi;const Ti=new Map;let ss;const $s=new Map,Fn=new Map;let Zo,hs=new n.LinkedMap,Zr=new Map,ea=new Set,ki=new Map,rs=u.Off,Or=p.Text,Ln,Wa=G.New;const wd=new r.Emitter,On=new r.Emitter,nh=new r.Emitter,mc=new r.Emitter,$c=new r.Emitter,Gs=De&&De.cancellationStrategy?De.cancellationStrategy:P.Message;function ic(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 pl(Se){return Se===null?"res-unknown-"+(++dt).toString():"res-"+Se.toString()}function sh(){return"not-"+(++Ne).toString()}function mg(Se,at){i.Message.isRequest(at)?Se.set(ic(at.id),at):i.Message.isResponse(at)?Se.set(pl(at.id),at):Se.set(sh(),at)}function _c(Se){}function Gc(){return Wa===G.Listening}function rh(){return Wa===G.Closed}function kc(){return Wa===G.Disposed}function ml(){(Wa===G.New||Wa===G.Listening)&&(Wa=G.Closed,On.fire(void 0))}function nc(Se){wd.fire([Se,void 0,void 0])}function Bo(Se){wd.fire(Se)}j.onClose(ml),j.onError(nc),ne.onClose(ml),ne.onError(Bo);function _l(){Zo||hs.size===0||(Zo=(0,e.default)().timer.setImmediate(()=>{Zo=void 0,ah()}))}function oh(Se){i.Message.isRequest(Se)?qc(Se):i.Message.isNotification(Se)?Br(Se):i.Message.isResponse(Se)?Ha(Se):Ts(Se)}function ah(){if(hs.size===0)return;const Se=hs.shift();try{const at=De?.messageStrategy;R.is(at)?at.handleMessage(Se,oh):oh(Se)}finally{_l()}}const Kc=Se=>{try{if(i.Message.isNotification(Se)&&Se.method===a.type.method){const at=Se.params.id,Ot=ic(at),Si=hs.get(Ot);if(i.Message.isRequest(Si)){const K=De?.connectionStrategy,de=K&&K.cancelUndispatched?K.cancelUndispatched(Si,_c):void 0;if(de&&(de.error!==void 0||de.result!==void 0)){hs.delete(Ot),ki.delete(at),de.id=Si.id,Ea(de,Se.method,Date.now()),ne.write(de).catch(()=>Be.error("Sending response for canceled message failed."));return}}const Bt=ki.get(at);if(Bt!==void 0){Bt.cancel(),xe(Se);return}else ea.add(at)}mg(hs,Se)}finally{_l()}};function qc(Se){if(kc())return;function at(ie,ye,O){const $={jsonrpc:Dt,id:Se.id};ie instanceof i.ResponseError?$.error=ie.toJson():$.result=ie===void 0?null:ie,Ea($,ye,O),ne.write($).catch(()=>Be.error("Sending response failed."))}function Ot(ie,ye,O){const $={jsonrpc:Dt,id:Se.id,error:ie.toJson()};Ea($,ye,O),ne.write($).catch(()=>Be.error("Sending response failed."))}function Si(ie,ye,O){ie===void 0&&(ie=null);const $={jsonrpc:Dt,id:Se.id,result:ie};Ea($,ye,O),ne.write($).catch(()=>Be.error("Sending response failed."))}ee(Se);const Bt=Ti.get(Se.method);let K,de;Bt&&(K=Bt.type,de=Bt.handler);const T=Date.now();if(de||Xi){const ie=Se.id??String(Date.now()),ye=C.is(Gs.receiver)?Gs.receiver.createCancellationTokenSource(ie):Gs.receiver.createCancellationTokenSource(Se);Se.id!==null&&ea.has(Se.id)&&ye.cancel(),Se.id!==null&&ki.set(ie,ye);try{let O;if(de)if(Se.params===void 0){if(K!==void 0&&K.numberOfParams!==0){Ot(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){Ot(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){Ot(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 Xi&&(O=Xi(Se.method,Se.params,ye.token));const $=O;O?$.then?$.then(se=>{ki.delete(ie),at(se,Se.method,T)},se=>{ki.delete(ie),se instanceof i.ResponseError?Ot(se,Se.method,T):se&&t.string(se.message)?Ot(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${se.message}`),Se.method,T):Ot(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,T)}):(ki.delete(ie),at(O,Se.method,T)):(ki.delete(ie),Si(O,Se.method,T))}catch(O){ki.delete(ie),O instanceof i.ResponseError?at(O,Se.method,T):O&&t.string(O.message)?Ot(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${O.message}`),Se.method,T):Ot(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,T)}}else Ot(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${Se.method}`),Se.method,T)}function Ha(Se){if(!kc())if(Se.id===null)Se.error?Be.error(`Received response message without id: Error is: +`;function LP(s){return console.assert(s.startsWith("/")),Zv.from({scheme:"slintpad",path:s})}function Tle(s){return s.scheme==="slintpad"}function pFe(s){return console.assert(Tle(s)),s.path}var H7;class vsi{constructor(e){Ht(this,H7);St(this,H7,e),console.assert(Object.keys(e).length>0),Object.keys(e).forEach(t=>console.assert(t.startsWith("/")))}from_internal(e){if(!Tle(e))return e;const t=pFe(e),i=Ce(this,H7)[t]||null;return i?Zv.parse(i)??Zv.parse("file:///broken_url"):e}}H7=new WeakMap;var b2;class bsi{constructor(e){Ht(this,b2);St(this,b2,e)}from_internal(e){return Tle(e)?Zv.from({scheme:Ce(this,b2).scheme,authority:Ce(this,b2).authority,path:pFe(e)}):e}}b2=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 wsi(s){try{const e=s?.path??"";return e.substring(e.lastIndexOf("/")+1)}catch{return s?.toString()??""}}var Sx;const WFe=class WFe extends st{constructor(t){const i=WFe.createNode();super({node:i});Ht(this,Sx);this.id=t.object.textEditorModel?.uri.toString()??"",St(this,Sx,yN.create(this.contentNode,{model:t.object.textEditorModel})),this.setFlag(st.Flag.DisallowLayout),this.addClass("content"),this.addClass("editor"),this.title.label=wsi(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,Sx)}dispose(){Ce(this,Sx).dispose(),this.dispose()}get contentNode(){return this.node.getElementsByTagName("div")[0]}resize_editor(){if(Ce(this,Sx)!=null){const t=this.contentNode.offsetWidth-2,i=this.contentNode.offsetHeight-2;Ce(this,Sx).layout({width:t,height:i})}}onResize(t){this.isAttached&&this.resize_editor()}};Sx=new WeakMap;let T0e=WFe;var fT,aS,cS,U7,V7,Ax,w2;class ysi extends st{constructor(t){super({});Ht(this,fT);Ht(this,aS,new Map);Ht(this,cS,null);Ht(this,U7,null);Ht(this,V7);Ht(this,Ax,null);Ht(this,w2,{});St(this,V7,0),this.title.label="Editor",this.title.closable=!1,this.title.caption="Slint code editor",St(this,fT,new nf({spacing:0})),super.layout=Ce(this,fT),St(this,U7,t.language_client),Uot=this,t.file_reader=i=>this.handle_lsp_url_request(i),this.clear_editors(),this.open_default_content().then(i=>{Ce(this,U7)?.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"),r=t.get("load_demo");return i?(this.clear_editors(),Promise.resolve(this.open_file_with_content(LP("/main.slint"),i))):n?this.project_from_url(n):this.set_demo(r??"")}clear_editors(){St(this,V7,Ce(this,V7)+1),St(this,Ax,null),Ce(this,cS)!==null&&Ce(this,fT).removeWidget(Ce(this,cS)),St(this,cS,new fei({addButtonEnabled:!1})),Ce(this,fT).addWidget(Ce(this,cS)),Ce(this,aS).clear(),St(this,w2,{})}open_hello_world(){this.clear_editors();const t=LP("/main.slint");return this.open_file_with_content(t,_si),t}open_file_with_content(t,i){I0e.registerFile(new X3t(t,i)),yN.createModelReference(t).then(n=>this.open_model_ref(n))}open_model_ref(t){const i=new T0e(t);return Ce(this,aS).set(t.object.textEditorModel?.uri??LP("unknown.slint"),i),Ce(this,cS).addWidget(i),i.editor}async map_url(t){const i=new URL(t),n=Zv.parse(i.toString()),r=Ce(this,Ax)?.from_internal(n)??n,o=r.toString();if(Tle(r)){const a=pFe(r);Ce(this,w2)[a]=o}return o}get current_editor_pane(){const t=Zv.parse(this.current_text_document_uri??"")??LP("broken.slint");return Ce(this,aS).get(t)??Ce(this,aS).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,cS).currentWidget?.id}async project_from_url(t){return t==null?null:(this.clear_editors(),Promise.resolve((await this.open_tab_from_url(Zv.parse(t)))[0]))}async open_tab_from_url(t){const[i,n,r]=await eei(t.toString()),o=Zv.parse(i??t.toString());return St(this,Ax,r??new bsi(o)),this.safely_open_editor_with_url_content(o,LP(n??o.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=LP(i);return yN.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 r;(r=window.location.pathname.match(/releases\/([^/]*)\/editor/))&&(n="v"+r[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,aS)).map((t,i)=>t.toString())}document_contents(t){const i=Zv.parse(t);return i===void 0?void 0:Ce(this,aS).get(i)?.editor.getModel()?.getValue()}get extra_files(){return Ce(this,w2)}async handle_lsp_url_request(t){if(Ce(this,Ax)===null)return Promise.resolve("Error: Can not resolve URL.");const i=Zv.parse(t),n=Ce(this,Ax).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 o=await I0e.readFile(i);return[i,new TextDecoder().decode(o)??""]}catch{}let r="";try{const o=await fetch(t.toString());if(!o.ok)return n&&alert("Failed to download data from "+t+`: +`+o.status+" "+o.statusText),[null,""];r=await o.text()}catch{return n&&alert("Failed to download data from "+t+"."),[null,""]}return this.open_file_with_content(i,r),[i,r]}}fT=new WeakMap,aS=new WeakMap,cS=new WeakMap,U7=new WeakMap,V7=new WeakMap,Ax=new WeakMap,w2=new WeakMap;var lS,z7;class Csi{constructor(e,t){Ht(this,lS);Ht(this,z7);St(this,lS,e),St(this,z7,t),this.onError=Ce(this,lS).onError,this.onClose=Ce(this,lS).onClose,this.onPartialMessage=Ce(this,lS).onPartialMessage}dispose(){Ce(this,lS).dispose()}listen(e){return Ce(this,lS).listen(t=>{Ce(this,z7).call(this,t)||e(t)})}}lS=new WeakMap,z7=new WeakMap;var cd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lDi(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Vot(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 L0e={},R0e={},ms={},nP={},mFe={},Sne={},dn={},Xl={};Object.defineProperty(Xl,"__esModule",{value:!0});Xl.stringArray=Xl.array=Xl.func=Xl.error=Xl.number=Xl.string=Xl.boolean=void 0;function Ssi(s){return s===!0||s===!1}Xl.boolean=Ssi;function zot(s){return typeof s=="string"||s instanceof String}Xl.string=zot;function Asi(s){return typeof s=="number"||s instanceof Number}Xl.number=Asi;function Esi(s){return s instanceof Error}Xl.error=Esi;function xsi(s){return typeof s=="function"}Xl.func=xsi;function $ot(s){return Array.isArray(s)}Xl.array=$ot;function Dsi(s){return $ot(s)&&s.every(e=>zot(e))}Xl.stringArray=Dsi;Object.defineProperty(dn,"__esModule",{value:!0});dn.Message=dn.NotificationType9=dn.NotificationType8=dn.NotificationType7=dn.NotificationType6=dn.NotificationType5=dn.NotificationType4=dn.NotificationType3=dn.NotificationType2=dn.NotificationType1=dn.NotificationType0=dn.NotificationType=dn.RequestType9=dn.RequestType8=dn.RequestType7=dn.RequestType6=dn.RequestType5=dn.RequestType4=dn.RequestType3=dn.RequestType2=dn.RequestType1=dn.RequestType=dn.RequestType0=dn.AbstractMessageSignature=dn.ParameterStructures=dn.ResponseError=dn.ErrorCodes=void 0;const F0=Xl;var M0e;(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})(M0e||(dn.ErrorCodes=M0e={}));class _Fe extends Error{constructor(e,t,i){super(t),this.code=F0.number(e)?e:M0e.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,_Fe.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}dn.ResponseError=_Fe;class eg{constructor(e){this.kind=e}static is(e){return e===eg.auto||e===eg.byName||e===eg.byPosition}toString(){return this.kind}}dn.ParameterStructures=eg;eg.auto=new eg("auto");eg.byPosition=new eg("byPosition");eg.byName=new eg("byName");class zc{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return eg.auto}}dn.AbstractMessageSignature=zc;class ksi extends zc{constructor(e){super(e,0)}}dn.RequestType0=ksi;class Isi extends zc{constructor(e,t=eg.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}dn.RequestType=Isi;class Tsi extends zc{constructor(e,t=eg.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}dn.RequestType1=Tsi;class Lsi extends zc{constructor(e){super(e,2)}}dn.RequestType2=Lsi;class Rsi extends zc{constructor(e){super(e,3)}}dn.RequestType3=Rsi;class Msi extends zc{constructor(e){super(e,4)}}dn.RequestType4=Msi;class Nsi extends zc{constructor(e){super(e,5)}}dn.RequestType5=Nsi;class Psi extends zc{constructor(e){super(e,6)}}dn.RequestType6=Psi;class Fsi extends zc{constructor(e){super(e,7)}}dn.RequestType7=Fsi;class Osi extends zc{constructor(e){super(e,8)}}dn.RequestType8=Osi;class Bsi extends zc{constructor(e){super(e,9)}}dn.RequestType9=Bsi;class Wsi extends zc{constructor(e,t=eg.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}dn.NotificationType=Wsi;class Hsi extends zc{constructor(e){super(e,0)}}dn.NotificationType0=Hsi;class Usi extends zc{constructor(e,t=eg.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}dn.NotificationType1=Usi;class Vsi extends zc{constructor(e){super(e,2)}}dn.NotificationType2=Vsi;class zsi extends zc{constructor(e){super(e,3)}}dn.NotificationType3=zsi;class $si extends zc{constructor(e){super(e,4)}}dn.NotificationType4=$si;class Gsi extends zc{constructor(e){super(e,5)}}dn.NotificationType5=Gsi;class Ksi extends zc{constructor(e){super(e,6)}}dn.NotificationType6=Ksi;class qsi extends zc{constructor(e){super(e,7)}}dn.NotificationType7=qsi;class Qsi extends zc{constructor(e){super(e,8)}}dn.NotificationType8=Qsi;class jsi extends zc{constructor(e){super(e,9)}}dn.NotificationType9=jsi;var M$e;(function(s){function e(n){const r=n;return r&&F0.string(r.method)&&(F0.string(r.id)||F0.number(r.id))}s.isRequest=e;function t(n){const r=n;return r&&F0.string(r.method)&&n.id===void 0}s.isNotification=t;function i(n){const r=n;return r&&(r.result!==void 0||!!r.error)&&(F0.string(r.id)||F0.number(r.id)||r.id===null)}s.isResponse=i})(M$e||(dn.Message=M$e={}));var CA={},N$e;Object.defineProperty(CA,"__esModule",{value:!0});CA.LRUCache=CA.LinkedMap=CA.Touch=void 0;var ku;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(ku||(CA.Touch=ku={}));class Got{constructor(){this[N$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=ku.None){const i=this._map.get(e);if(i)return t!==ku.None&&this.touch(i,t),i.value}set(e,t,i=ku.None){let n=this._map.get(e);if(n)n.value=t,i!==ku.None&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case ku.None:this.addItemLast(n);break;case ku.First:this.addItemFirst(n);break;case ku.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}[(N$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!==ku.First&&t!==ku.Last)){if(t===ku.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===ku.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)}}CA.LinkedMap=Got;class Ysi extends Got{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=ku.AsNew){return super.get(e,t)}peek(e){return super.get(e,ku.None)}set(e,t){return super.set(e,t,ku.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}CA.LRUCache=Ysi;var Lle={};Object.defineProperty(Lle,"__esModule",{value:!0});Lle.Disposable=void 0;var P$e;(function(s){function e(t){return{dispose:t}}s.create=e})(P$e||(Lle.Disposable=P$e={}));var fC={},uE={};Object.defineProperty(uE,"__esModule",{value:!0});let N0e;function P0e(){if(N0e===void 0)throw new Error("No runtime abstraction layer installed");return N0e}(function(s){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");N0e=t}s.install=e})(P0e||(P0e={}));uE.default=P0e;Object.defineProperty(fC,"__esModule",{value:!0});fC.Emitter=fC.Event=void 0;const Jsi=uE;var F$e;(function(s){const e={dispose(){}};s.None=function(){return e}})(F$e||(fC.Event=F$e={}));class Xsi{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,r=this._callbacks.length;n{this._callbacks||(this._callbacks=new Xsi),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=Rle._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)}}fC.Emitter=Rle;Rle._noop=function(){};var AI={};Object.defineProperty(AI,"__esModule",{value:!0});AI.CancellationTokenSource=AI.CancellationToken=void 0;const Zsi=uE,eri=Xl,F0e=fC;var Ane;(function(s){s.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:F0e.Event.None}),s.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:F0e.Event.None});function e(t){const i=t;return i&&(i===s.None||i===s.Cancelled||eri.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}s.is=e})(Ane||(AI.CancellationToken=Ane={}));const tri=Object.freeze(function(s,e){const t=(0,Zsi.default)().timer.setTimeout(s.bind(e),0);return{dispose(){t.dispose()}}});class O$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?tri:(this._emitter||(this._emitter=new F0e.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class iri{get token(){return this._token||(this._token=new O$e),this._token}cancel(){this._token?this._token.cancel():this._token=Ane.Cancelled}dispose(){this._token?this._token instanceof O$e&&this._token.dispose():this._token=Ane.None}}AI.CancellationTokenSource=iri;var iU={};Object.defineProperty(iU,"__esModule",{value:!0});iU.SharedArrayReceiverStrategy=iU.SharedArraySenderStrategy=void 0;const nri=AI;var h7;(function(s){s.Continue=0,s.Cancelled=1})(h7||(h7={}));class sri{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]=h7.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,h7.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}iU.SharedArraySenderStrategy=sri;class rri{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===h7.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class ori{constructor(e){this.token=new rri(e)}cancel(){}dispose(){}}class ari{constructor(){this.kind="request"}createCancellationTokenSource(e){const t=e.$cancellationData;return t===void 0?new nri.CancellationTokenSource:new ori(t)}}iU.SharedArrayReceiverStrategy=ari;var LD={},DG={};Object.defineProperty(DG,"__esModule",{value:!0});DG.Semaphore=void 0;const cri=uE;let lri=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,cri.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()}}};DG.Semaphore=lri;Object.defineProperty(LD,"__esModule",{value:!0});LD.ReadableStreamMessageReader=LD.AbstractMessageReader=LD.MessageReader=void 0;const O0e=uE,iF=Xl,Dge=fC,dri=DG;var B$e;(function(s){function e(t){let i=t;return i&&iF.func(i.listen)&&iF.func(i.dispose)&&iF.func(i.onError)&&iF.func(i.onClose)&&iF.func(i.onPartialMessage)}s.is=e})(B$e||(LD.MessageReader=B$e={}));class Kot{constructor(){this.errorEmitter=new Dge.Emitter,this.closeEmitter=new Dge.Emitter,this.partialMessageEmitter=new Dge.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: ${iF.string(e.message)?e.message:"unknown"}`)}}LD.AbstractMessageReader=Kot;var B0e;(function(s){function e(t){let i,n;const r=new Map;let o;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,r.set(n.name,n)),t.contentDecoders!==void 0)for(const c of t.contentDecoders)r.set(c.name,c);if(t.contentTypeDecoder!==void 0&&(o=t.contentTypeDecoder,a.set(o.name,o)),t.contentTypeDecoders!==void 0)for(const c of t.contentTypeDecoders)a.set(c.name,c)}return o===void 0&&(o=(0,O0e.default)().applicationJson.decoder,a.set(o.name,o)),{charset:i,contentDecoder:n,contentDecoders:r,contentTypeDecoder:o,contentTypeDecoders:a}}s.fromOptions=e})(B0e||(B0e={}));class hri extends Kot{constructor(e,t){super(),this.readable=e,this.options=B0e.fromOptions(t),this.buffer=(0,O0e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new dri.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 r=parseInt(n);if(isNaN(r)){this.fireError(new Error(`Content-Length value must be a number. Got ${n}`));return}this.nextMessageLength=r}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,O0e.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))}}LD.ReadableStreamMessageReader=hri;var RD={};Object.defineProperty(RD,"__esModule",{value:!0});RD.WriteableStreamMessageWriter=RD.AbstractMessageWriter=RD.MessageWriter=void 0;const W$e=uE,JV=Xl,uri=DG,H$e=fC,gri="Content-Length: ",U$e=`\r +`;var V$e;(function(s){function e(t){let i=t;return i&&JV.func(i.dispose)&&JV.func(i.onClose)&&JV.func(i.onError)&&JV.func(i.write)}s.is=e})(V$e||(RD.MessageWriter=V$e={}));class qot{constructor(){this.errorEmitter=new H$e.Emitter,this.closeEmitter=new H$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: ${JV.string(e.message)?e.message:"unknown"}`)}}RD.AbstractMessageWriter=qot;var W0e;(function(s){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,W$e.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,W$e.default)().applicationJson.encoder}}s.fromOptions=e})(W0e||(W0e={}));class fri extends qot{constructor(e,t){super(),this.writable=e,this.options=W0e.fromOptions(t),this.errorCount=0,this.writeSemaphore=new uri.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(gri,i.byteLength.toString(),U$e),n.push(U$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()}}RD.WriteableStreamMessageWriter=fri;var Mle={};Object.defineProperty(Mle,"__esModule",{value:!0});Mle.AbstractMessageBuffer=void 0;const pri=13,mri=10,_ri=`\r +`;class vri{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,r=0;e:for(;ithis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const r=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(r)}if(this._chunks[0].byteLength>e){const r=this._chunks[0],o=this.asNative(r,e);return this._chunks[0]=r.slice(e),this._totalLength-=e,o}const t=this.allocNative(e);let i=0,n=0;for(;e>0;){const r=this._chunks[n];if(r.byteLength>e){const o=r.slice(0,e);t.set(o,i),i+=e,this._chunks[n]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,i),i+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}Mle.AbstractMessageBuffer=vri;var Qot={};(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=uE,t=Xl,i=dn,n=CA,r=fC,o=AI;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 o.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 Be=ge!==void 0?ge:s.NullLogger;let Ct=0,Ne=0,dt=0;const Dt="2.0";let Xi;const Ti=new Map;let ss;const $s=new Map,Fn=new Map;let Zo,hs=new n.LinkedMap,Zr=new Map,ea=new Set,ki=new Map,rs=u.Off,Or=p.Text,Ln,Ha=G.New;const wd=new r.Emitter,On=new r.Emitter,nh=new r.Emitter,mc=new r.Emitter,$c=new r.Emitter,Gs=De&&De.cancellationStrategy?De.cancellationStrategy:P.Message;function ic(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 pl(Se){return Se===null?"res-unknown-"+(++dt).toString():"res-"+Se.toString()}function sh(){return"not-"+(++Ne).toString()}function mg(Se,at){i.Message.isRequest(at)?Se.set(ic(at.id),at):i.Message.isResponse(at)?Se.set(pl(at.id),at):Se.set(sh(),at)}function _c(Se){}function Gc(){return Ha===G.Listening}function rh(){return Ha===G.Closed}function kc(){return Ha===G.Disposed}function ml(){(Ha===G.New||Ha===G.Listening)&&(Ha=G.Closed,On.fire(void 0))}function nc(Se){wd.fire([Se,void 0,void 0])}function Bo(Se){wd.fire(Se)}j.onClose(ml),j.onError(nc),ne.onClose(ml),ne.onError(Bo);function _l(){Zo||hs.size===0||(Zo=(0,e.default)().timer.setImmediate(()=>{Zo=void 0,ah()}))}function oh(Se){i.Message.isRequest(Se)?qc(Se):i.Message.isNotification(Se)?Br(Se):i.Message.isResponse(Se)?Ua(Se):Ts(Se)}function ah(){if(hs.size===0)return;const Se=hs.shift();try{const at=De?.messageStrategy;R.is(at)?at.handleMessage(Se,oh):oh(Se)}finally{_l()}}const Kc=Se=>{try{if(i.Message.isNotification(Se)&&Se.method===a.type.method){const at=Se.params.id,Ot=ic(at),Si=hs.get(Ot);if(i.Message.isRequest(Si)){const K=De?.connectionStrategy,de=K&&K.cancelUndispatched?K.cancelUndispatched(Si,_c):void 0;if(de&&(de.error!==void 0||de.result!==void 0)){hs.delete(Ot),ki.delete(at),de.id=Si.id,Ea(de,Se.method,Date.now()),ne.write(de).catch(()=>Be.error("Sending response for canceled message failed."));return}}const Bt=ki.get(at);if(Bt!==void 0){Bt.cancel(),xe(Se);return}else ea.add(at)}mg(hs,Se)}finally{_l()}};function qc(Se){if(kc())return;function at(ie,ye,O){const $={jsonrpc:Dt,id:Se.id};ie instanceof i.ResponseError?$.error=ie.toJson():$.result=ie===void 0?null:ie,Ea($,ye,O),ne.write($).catch(()=>Be.error("Sending response failed."))}function Ot(ie,ye,O){const $={jsonrpc:Dt,id:Se.id,error:ie.toJson()};Ea($,ye,O),ne.write($).catch(()=>Be.error("Sending response failed."))}function Si(ie,ye,O){ie===void 0&&(ie=null);const $={jsonrpc:Dt,id:Se.id,result:ie};Ea($,ye,O),ne.write($).catch(()=>Be.error("Sending response failed."))}ee(Se);const Bt=Ti.get(Se.method);let K,de;Bt&&(K=Bt.type,de=Bt.handler);const T=Date.now();if(de||Xi){const ie=Se.id??String(Date.now()),ye=C.is(Gs.receiver)?Gs.receiver.createCancellationTokenSource(ie):Gs.receiver.createCancellationTokenSource(Se);Se.id!==null&&ea.has(Se.id)&&ye.cancel(),Se.id!==null&&ki.set(ie,ye);try{let O;if(de)if(Se.params===void 0){if(K!==void 0&&K.numberOfParams!==0){Ot(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){Ot(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){Ot(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 Xi&&(O=Xi(Se.method,Se.params,ye.token));const $=O;O?$.then?$.then(se=>{ki.delete(ie),at(se,Se.method,T)},se=>{ki.delete(ie),se instanceof i.ResponseError?Ot(se,Se.method,T):se&&t.string(se.message)?Ot(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${se.message}`),Se.method,T):Ot(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,T)}):(ki.delete(ie),at(O,Se.method,T)):(ki.delete(ie),Si(O,Se.method,T))}catch(O){ki.delete(ie),O instanceof i.ResponseError?at(O,Se.method,T):O&&t.string(O.message)?Ot(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${O.message}`),Se.method,T):Ot(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,T)}}else Ot(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${Se.method}`),Se.method,T)}function Ua(Se){if(!kc())if(Se.id===null)Se.error?Be.error(`Received response message without id: Error is: ${JSON.stringify(Se.error,void 0,4)}`):Be.error("Received response message without id. No further error information provided.");else{const at=Se.id,Ot=Zr.get(at);if(ft(Se,Ot),Ot!==void 0){Zr.delete(at);try{if(Se.error){const Si=Se.error;Ot.reject(new i.ResponseError(Si.code,Si.message,Si.data))}else if(Se.result!==void 0)Ot.resolve(Se.result);else throw new Error("Should never happen.")}catch(Si){Si.message?Be.error(`Response handler '${Ot.method}' failed with message: ${Si.message}`):Be.error(`Response handler '${Ot.method}' failed unexpectedly.`)}}}}function Br(Se){if(kc())return;let at,Ot;if(Se.method===a.type.method){const Si=Se.params.id;ea.delete(Si),xe(Se);return}else{const Si=$s.get(Se.method);Si&&(Ot=Si.handler,at=Si.type)}if(Ot||ss)try{if(xe(Se),Ot)if(Se.params===void 0)at!==void 0&&at.numberOfParams!==0&&at.parameterStructures!==i.ParameterStructures.byName&&Be.error(`Notification ${Se.method} defines ${at.numberOfParams} params but received none.`),Ot();else if(Array.isArray(Se.params)){const Si=Se.params;Se.method===l.type.method&&Si.length===2&&c.is(Si[0])?Ot({token:Si[0],value:Si[1]}):(at!==void 0&&(at.parameterStructures===i.ParameterStructures.byName&&Be.error(`Notification ${Se.method} defines parameters by name but received parameters by position`),at.numberOfParams!==Se.params.length&&Be.error(`Notification ${Se.method} defines ${at.numberOfParams} params but received ${Si.length} arguments`)),Ot(...Si))}else at!==void 0&&at.parameterStructures===i.ParameterStructures.byPosition&&Be.error(`Notification ${Se.method} defines parameters by position but received parameters by name`),Ot(Se.params);else ss&&ss(Se.method,Se.params)}catch(Si){Si.message?Be.error(`Notification handler '${Se.method}' failed with message: ${Si.message}`):Be.error(`Notification handler '${Se.method}' failed unexpectedly.`)}else nh.fire(Se)}function Ts(Se){if(!Se){Be.error("Received empty message.");return}Be.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(Se,null,4)}`);const at=Se;if(t.string(at.id)||t.number(at.id)){const Ot=at.id,Si=Zr.get(Ot);Si&&Si.reject(new Error("The received response has neither a result nor an error property."))}}function Ic(Se){if(Se!=null)switch(rs){case u.Verbose:return JSON.stringify(Se,null,4);case u.Compact:return JSON.stringify(Se);default:return}}function Fh(Se){if(!(rs===u.Off||!Ln))if(Or===p.Text){let at;(rs===u.Verbose||rs===u.Compact)&&Se.params&&(at=`Params: ${Ic(Se.params)} @@ -1084,20 +1084,20 @@ ${JSON.stringify(Se,null,4)}`);const at=Se;if(t.string(at.id)||t.number(at.id)){ `:Se.error===void 0&&(Ot=`No result returned. -`)),at){const Si=Se.error?` Request failed: ${Se.error.message} (${Se.error.code}).`:"";Ln.log(`Received response '${at.method} - (${Se.id})' in ${Date.now()-at.timerStart}ms.${Si}`,Ot)}else Ln.log(`Received response ${Se.id} without active response promise.`,Ot)}else $n("receive-response",Se)}function $n(Se,at){if(!Ln||rs===u.Off)return;const Ot={isLSPMessage:!0,type:Se,message:at,timestamp:Date.now()};Ln.log(Ot)}function Ss(){if(rh())throw new w(b.Closed,"Connection is closed.");if(kc())throw new w(b.Disposed,"Connection is disposed.")}function Wr(){if(Gc())throw new w(b.AlreadyListening,"Connection is already listening")}function Ua(){if(!Gc())throw new Error("Call listen() first.")}function ta(Se){return Se===void 0?null:Se}function Oh(Se){if(Se!==null)return Se}function le(Se){return Se!=null&&!Array.isArray(Se)&&typeof Se=="object"}function ho(Se,at){switch(Se){case i.ParameterStructures.auto:return le(at)?Oh(at):[ta(at)];case i.ParameterStructures.byName:if(!le(at))throw new Error("Received parameters by name but param is not an object literal.");return Oh(at);case i.ParameterStructures.byPosition:return[ta(at)];default:throw new Error(`Unknown parameter structure ${Se.toString()}`)}}function nr(Se,at){let Ot;const Si=Se.numberOfParams;switch(Si){case 0:Ot=void 0;break;case 1:Ot=ho(Se.parameterStructures,at[0]);break;default:Ot=[];for(let Bt=0;Bt{Ss();let Ot,Si;if(t.string(Se)){Ot=Se;const K=at[0];let de=0,T=i.ParameterStructures.auto;i.ParameterStructures.is(K)&&(de=1,T=K);let ie=at.length;const ye=ie-de;switch(ye){case 0:Si=void 0;break;case 1:Si=ho(T,at[de]);break;default:if(T===i.ParameterStructures.byName)throw new Error(`Received ${ye} parameters for 'by Name' notification parameter structure.`);Si=at.slice(de,ie).map(O=>ta(O));break}}else{const K=at;Ot=Se.method,Si=nr(Se,K)}const Bt={jsonrpc:Dt,method:Ot,params:Si};return be(Bt),ne.write(Bt).catch(K=>{throw Be.error("Sending notification failed."),K})},onNotification:(Se,at)=>{Ss();let Ot;return t.func(Se)?ss=Se:at&&(t.string(Se)?(Ot=Se,$s.set(Se,{type:void 0,handler:at})):(Ot=Se.method,$s.set(Se.method,{type:Se,handler:at}))),{dispose:()=>{Ot!==void 0?$s.delete(Ot):ss=void 0}}},onProgress:(Se,at,Ot)=>{if(Fn.has(at))throw new Error(`Progress handler for token ${at} already registered`);return Fn.set(at,Ot),{dispose:()=>{Fn.delete(at)}}},sendProgress:(Se,at,Ot)=>gn.sendNotification(l.type,{token:at,value:Ot}),onUnhandledProgress:mc.event,sendRequest:(Se,...at)=>{Ss(),Ua();let Ot,Si,Bt;if(t.string(Se)){Ot=Se;const ie=at[0],ye=at[at.length-1];let O=0,$=i.ParameterStructures.auto;i.ParameterStructures.is(ie)&&(O=1,$=ie);let se=at.length;o.CancellationToken.is(ye)&&(se=se-1,Bt=ye);const qe=se-O;switch(qe){case 0:Si=void 0;break;case 1:Si=ho($,at[O]);break;default:if($===i.ParameterStructures.byName)throw new Error(`Received ${qe} parameters for 'by Name' request parameter structure.`);Si=at.slice(O,se).map(Wi=>ta(Wi));break}}else{const ie=at;Ot=Se.method,Si=nr(Se,ie);const ye=Se.numberOfParams;Bt=o.CancellationToken.is(ie[ye])?ie[ye]:void 0}const K=Ct++;let de;Bt&&(de=Bt.onCancellationRequested(()=>{const ie=Gs.sender.sendCancellation(gn,K);return ie===void 0?(Be.log(`Received no promise from cancellation strategy when cancelling id ${K}`),Promise.resolve()):ie.catch(()=>{Be.log(`Sending cancellation messages for id ${K} failed`)})}));const T={jsonrpc:Dt,id:K,method:Ot,params:Si};return Fh(T),typeof Gs.sender.enableCancellation=="function"&&Gs.sender.enableCancellation(T),new Promise(async(ie,ye)=>{const O=qe=>{ie(qe),Gs.sender.cleanup(K),de?.dispose()},$=qe=>{ye(qe),Gs.sender.cleanup(K),de?.dispose()},se={method:Ot,timerStart:Date.now(),resolve:O,reject:$};try{await ne.write(T),Zr.set(K,se)}catch(qe){throw Be.error("Sending request failed."),se.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,qe.message?qe.message:"Unknown reason")),qe}})},onRequest:(Se,at)=>{Ss();let Ot=null;return h.is(Se)?(Ot=void 0,Xi=Se):t.string(Se)?(Ot=null,at!==void 0&&(Ot=Se,Ti.set(Se,{handler:at,type:void 0}))):at!==void 0&&(Ot=Se.method,Ti.set(Se.method,{type:Se,handler:at})),{dispose:()=>{Ot!==null&&(Ot!==void 0?Ti.delete(Ot):Xi=void 0)}}},hasPendingResponse:()=>Zr.size>0,trace:async(Se,at,Ot)=>{let Si=!1,Bt=p.Text;Ot!==void 0&&(t.boolean(Ot)?Si=Ot:(Si=Ot.sendNotification||!1,Bt=Ot.traceFormat||p.Text)),rs=Se,Or=Bt,rs===u.Off?Ln=void 0:Ln=at,Si&&!rh()&&!kc()&&await gn.sendNotification(m.type,{value:u.toString(Se)})},onError:wd.event,onClose:On.event,onUnhandledNotification:nh.event,onDispose:$c.event,end:()=>{ne.end()},dispose:()=>{if(kc())return;Wa=G.Disposed,$c.fire(void 0);const Se=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const at of Zr.values())at.reject(Se);Zr=new Map,ki=new Map,ea=new Set,hs=new n.LinkedMap,t.func(ne.dispose)&&ne.dispose(),t.func(j.dispose)&&j.dispose()},listen:()=>{Ss(),Wr(),Wa=G.Listening,j.listen(Kc)},inspect:()=>{(0,e.default)().console.log("inspect")}};return gn.onNotification(v.type,Se=>{if(rs===u.Off||!Ln)return;const at=rs===u.Verbose||rs===u.Compact;Ln.log(Se.message,at?Se.verbose:void 0)}),gn.onNotification(l.type,Se=>{const at=Fn.get(Se.token);at?at(Se.value):mc.fire(Se)}),gn}s.createMessageConnection=Y})(Qot);(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=dn;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=CA;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=Lle;Object.defineProperty(s,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const n=fC;Object.defineProperty(s,"Event",{enumerable:!0,get:function(){return n.Event}}),Object.defineProperty(s,"Emitter",{enumerable:!0,get:function(){return n.Emitter}});const r=AI;Object.defineProperty(s,"CancellationTokenSource",{enumerable:!0,get:function(){return r.CancellationTokenSource}}),Object.defineProperty(s,"CancellationToken",{enumerable:!0,get:function(){return r.CancellationToken}});const o=iU;Object.defineProperty(s,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(s,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});const a=LD;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=RD;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=Mle;Object.defineProperty(s,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const d=Qot;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=uE;s.RAL=h.default})(Sne);Object.defineProperty(mFe,"__esModule",{value:!0});const iy=Sne;class Nle extends iy.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Nle.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)}}Nle.emptyBuffer=new Uint8Array(0);class vri{constructor(e){this.socket=e,this._onData=new iy.Emitter,this._messageListener=t=>{t.data.arrayBuffer().then(n=>{this._onData.fire(new Uint8Array(n))},()=>{(0,iy.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),iy.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),iy.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),iy.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class bri{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),iy.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),iy.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),iy.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 wri=new TextEncoder,jot=Object.freeze({messageBuffer:Object.freeze({create:s=>new Nle(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(wri.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 vri(s),asWritableStream:s=>new bri(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 H0e(){return jot}(function(s){function e(){iy.RAL.install(jot)}s.install=e})(H0e||(H0e={}));mFe.default=H0e;(function(s){var e=cd&&cd.__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=cd&&cd.__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,mFe.default.install();const n=Sne;t(Sne,s);class r 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=r;class o 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=o;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})(nP);var z$e=nP,Yot={},U0e;(function(s){function e(t){return typeof t=="string"}s.is=e})(U0e||(U0e={}));var Ene;(function(s){function e(t){return typeof t=="string"}s.is=e})(Ene||(Ene={}));var V0e;(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})(V0e||(V0e={}));var u7;(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})(u7||(u7={}));var __;(function(s){function e(i,n){return i===Number.MAX_VALUE&&(i=u7.MAX_VALUE),n===Number.MAX_VALUE&&(n=u7.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})(__||(__={}));var gl;(function(s){function e(i,n,r,o){if(Fe.uinteger(i)&&Fe.uinteger(n)&&Fe.uinteger(r)&&Fe.uinteger(o))return{start:__.create(i,n),end:__.create(r,o)};if(__.is(i)&&__.is(n))return{start:i,end:n};throw new Error(`Range#create called with invalid arguments[${i}, ${n}, ${r}, ${o}]`)}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&__.is(n.start)&&__.is(n.end)}s.is=t})(gl||(gl={}));var g7;(function(s){function e(i,n){return{uri:i,range:n}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&gl.is(n.range)&&(Fe.string(n.uri)||Fe.undefined(n.uri))}s.is=t})(g7||(g7={}));var z0e;(function(s){function e(i,n,r,o){return{targetUri:i,targetRange:n,targetSelectionRange:r,originSelectionRange:o}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&gl.is(n.targetRange)&&Fe.string(n.targetUri)&&gl.is(n.targetSelectionRange)&&(gl.is(n.originSelectionRange)||Fe.undefined(n.originSelectionRange))}s.is=t})(z0e||(z0e={}));var xne;(function(s){function e(i,n,r,o){return{red:i,green:n,blue:r,alpha:o}}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})(xne||(xne={}));var $0e;(function(s){function e(i,n){return{range:i,color:n}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&gl.is(n.range)&&xne.is(n.color)}s.is=t})($0e||($0e={}));var G0e;(function(s){function e(i,n,r){return{label:i,textEdit:n,additionalTextEdits:r}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&Fe.string(n.label)&&(Fe.undefined(n.textEdit)||$y.is(n))&&(Fe.undefined(n.additionalTextEdits)||Fe.typedArray(n.additionalTextEdits,$y.is))}s.is=t})(G0e||(G0e={}));var K0e;(function(s){s.Comment="comment",s.Imports="imports",s.Region="region"})(K0e||(K0e={}));var q0e;(function(s){function e(i,n,r,o,a,c){const l={startLine:i,endLine:n};return Fe.defined(r)&&(l.startCharacter=r),Fe.defined(o)&&(l.endCharacter=o),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})(q0e||(q0e={}));var Dne;(function(s){function e(i,n){return{location:i,message:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&g7.is(n.location)&&Fe.string(n.message)}s.is=t})(Dne||(Dne={}));var Q0e;(function(s){s.Error=1,s.Warning=2,s.Information=3,s.Hint=4})(Q0e||(Q0e={}));var j0e;(function(s){s.Unnecessary=1,s.Deprecated=2})(j0e||(j0e={}));var Y0e;(function(s){function e(t){const i=t;return Fe.objectLiteral(i)&&Fe.string(i.href)}s.is=e})(Y0e||(Y0e={}));var f7;(function(s){function e(i,n,r,o,a,c){let l={range:i,message:n};return Fe.defined(r)&&(l.severity=r),Fe.defined(o)&&(l.code=o),Fe.defined(a)&&(l.source=a),Fe.defined(c)&&(l.relatedInformation=c),l}s.create=e;function t(i){var n;let r=i;return Fe.defined(r)&&gl.is(r.range)&&Fe.string(r.message)&&(Fe.number(r.severity)||Fe.undefined(r.severity))&&(Fe.integer(r.code)||Fe.string(r.code)||Fe.undefined(r.code))&&(Fe.undefined(r.codeDescription)||Fe.string((n=r.codeDescription)===null||n===void 0?void 0:n.href))&&(Fe.string(r.source)||Fe.undefined(r.source))&&(Fe.undefined(r.relatedInformation)||Fe.typedArray(r.relatedInformation,Dne.is))}s.is=t})(f7||(f7={}));var AN;(function(s){function e(i,n,...r){let o={title:i,command:n};return Fe.defined(r)&&r.length>0&&(o.arguments=r),o}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.title)&&Fe.string(n.command)}s.is=t})(AN||(AN={}));var $y;(function(s){function e(r,o){return{range:r,newText:o}}s.replace=e;function t(r,o){return{range:{start:r,end:r},newText:o}}s.insert=t;function i(r){return{range:r,newText:""}}s.del=i;function n(r){const o=r;return Fe.objectLiteral(o)&&Fe.string(o.newText)&&gl.is(o.range)}s.is=n})($y||($y={}));var lL;(function(s){function e(i,n,r){const o={label:i};return n!==void 0&&(o.needsConfirmation=n),r!==void 0&&(o.description=r),o}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})(lL||(lL={}));var Yh;(function(s){function e(t){const i=t;return Fe.string(i)}s.is=e})(Yh||(Yh={}));var iS;(function(s){function e(r,o,a){return{range:r,newText:o,annotationId:a}}s.replace=e;function t(r,o,a){return{range:{start:r,end:r},newText:o,annotationId:a}}s.insert=t;function i(r,o){return{range:r,newText:"",annotationId:o}}s.del=i;function n(r){const o=r;return $y.is(o)&&(lL.is(o.annotationId)||Yh.is(o.annotationId))}s.is=n})(iS||(iS={}));var p7;(function(s){function e(i,n){return{textDocument:i,edits:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&m7.is(n.textDocument)&&Array.isArray(n.edits)}s.is=t})(p7||(p7={}));var nU;(function(s){function e(i,n,r){let o={kind:"create",uri:i};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(o.options=n),r!==void 0&&(o.annotationId=r),o}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||Yh.is(n.annotationId))}s.is=t})(nU||(nU={}));var sU;(function(s){function e(i,n,r,o){let a={kind:"rename",oldUri:i,newUri:n};return r!==void 0&&(r.overwrite!==void 0||r.ignoreIfExists!==void 0)&&(a.options=r),o!==void 0&&(a.annotationId=o),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||Yh.is(n.annotationId))}s.is=t})(sU||(sU={}));var rU;(function(s){function e(i,n,r){let o={kind:"delete",uri:i};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(o.options=n),r!==void 0&&(o.annotationId=r),o}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||Yh.is(n.annotationId))}s.is=t})(rU||(rU={}));var kne;(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)?nU.is(n)||sU.is(n)||rU.is(n):p7.is(n)))}s.is=e})(kne||(kne={}));let cq=class{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,i){let n,r;if(i===void 0?n=$y.insert(e,t):Yh.is(i)?(r=i,n=iS.insert(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(i),n=iS.insert(e,t,r)),this.edits.push(n),r!==void 0)return r}replace(e,t,i){let n,r;if(i===void 0?n=$y.replace(e,t):Yh.is(i)?(r=i,n=iS.replace(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(i),n=iS.replace(e,t,r)),this.edits.push(n),r!==void 0)return r}delete(e,t){let i,n;if(t===void 0?i=$y.del(e):Yh.is(t)?(n=t,i=iS.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),i=iS.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.")}},$$e=class{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(Yh.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 yri{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(p7.is(t)){const i=new cq(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=i}})):e.changes&&Object.keys(e.changes).forEach(t=>{const i=new cq(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(m7.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=[],r={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(r),i=new cq(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 cq(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;lL.is(t)||Yh.is(t)?n=t:i=t;let r,o;if(n===void 0?r=nU.create(e,i):(o=Yh.is(n)?n:this._changeAnnotations.manage(n),r=nU.create(e,i,o)),this._workspaceEdit.documentChanges.push(r),o!==void 0)return o}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 r;lL.is(i)||Yh.is(i)?r=i:n=i;let o,a;if(r===void 0?o=sU.create(e,t,n):(a=Yh.is(r)?r:this._changeAnnotations.manage(r),o=sU.create(e,t,n,a)),this._workspaceEdit.documentChanges.push(o),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;lL.is(t)||Yh.is(t)?n=t:i=t;let r,o;if(n===void 0?r=rU.create(e,i):(o=Yh.is(n)?n:this._changeAnnotations.manage(n),r=rU.create(e,i,o)),this._workspaceEdit.documentChanges.push(r),o!==void 0)return o}}var J0e;(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})(J0e||(J0e={}));var X0e;(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})(X0e||(X0e={}));var m7;(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})(m7||(m7={}));var Z0e;(function(s){function e(i,n,r,o){return{uri:i,languageId:n,version:r,text:o}}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})(Z0e||(Z0e={}));var Ine;(function(s){s.PlainText="plaintext",s.Markdown="markdown";function e(t){const i=t;return i===s.PlainText||i===s.Markdown}s.is=e})(Ine||(Ine={}));var oU;(function(s){function e(t){const i=t;return Fe.objectLiteral(t)&&Ine.is(i.kind)&&Fe.string(i.value)}s.is=e})(oU||(oU={}));var e1e;(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})(e1e||(e1e={}));var t1e;(function(s){s.PlainText=1,s.Snippet=2})(t1e||(t1e={}));var i1e;(function(s){s.Deprecated=1})(i1e||(i1e={}));var n1e;(function(s){function e(i,n,r){return{newText:i,insert:n,replace:r}}s.create=e;function t(i){const n=i;return n&&Fe.string(n.newText)&&gl.is(n.insert)&&gl.is(n.replace)}s.is=t})(n1e||(n1e={}));var s1e;(function(s){s.asIs=1,s.adjustIndentation=2})(s1e||(s1e={}));var r1e;(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})(r1e||(r1e={}));var o1e;(function(s){function e(t){return{label:t}}s.create=e})(o1e||(o1e={}));var a1e;(function(s){function e(t,i){return{items:t||[],isIncomplete:!!i}}s.create=e})(a1e||(a1e={}));var _7;(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})(_7||(_7={}));var c1e;(function(s){function e(t){let i=t;return!!i&&Fe.objectLiteral(i)&&(oU.is(i.contents)||_7.is(i.contents)||Fe.typedArray(i.contents,_7.is))&&(t.range===void 0||gl.is(t.range))}s.is=e})(c1e||(c1e={}));var l1e;(function(s){function e(t,i){return i?{label:t,documentation:i}:{label:t}}s.create=e})(l1e||(l1e={}));var d1e;(function(s){function e(t,i,...n){let r={label:t};return Fe.defined(i)&&(r.documentation=i),Fe.defined(n)?r.parameters=n:r.parameters=[],r}s.create=e})(d1e||(d1e={}));var h1e;(function(s){s.Text=1,s.Read=2,s.Write=3})(h1e||(h1e={}));var u1e;(function(s){function e(t,i){let n={range:t};return Fe.number(i)&&(n.kind=i),n}s.create=e})(u1e||(u1e={}));var g1e;(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})(g1e||(g1e={}));var f1e;(function(s){s.Deprecated=1})(f1e||(f1e={}));var p1e;(function(s){function e(t,i,n,r,o){let a={name:t,kind:i,location:{uri:r,range:n}};return o&&(a.containerName=o),a}s.create=e})(p1e||(p1e={}));var m1e;(function(s){function e(t,i,n,r){return r!==void 0?{name:t,kind:i,location:{uri:n,range:r}}:{name:t,kind:i,location:{uri:n}}}s.create=e})(m1e||(m1e={}));var _1e;(function(s){function e(i,n,r,o,a,c){let l={name:i,detail:n,kind:r,range:o,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)&&gl.is(n.range)&&gl.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})(_1e||(_1e={}));var v1e;(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"})(v1e||(v1e={}));var v7;(function(s){s.Invoked=1,s.Automatic=2})(v7||(v7={}));var b1e;(function(s){function e(i,n,r){let o={diagnostics:i};return n!=null&&(o.only=n),r!=null&&(o.triggerKind=r),o}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.typedArray(n.diagnostics,f7.is)&&(n.only===void 0||Fe.typedArray(n.only,Fe.string))&&(n.triggerKind===void 0||n.triggerKind===v7.Invoked||n.triggerKind===v7.Automatic)}s.is=t})(b1e||(b1e={}));var w1e;(function(s){function e(i,n,r){let o={title:i},a=!0;return typeof n=="string"?(a=!1,o.kind=n):AN.is(n)?o.command=n:o.edit=n,a&&r!==void 0&&(o.kind=r),o}s.create=e;function t(i){let n=i;return n&&Fe.string(n.title)&&(n.diagnostics===void 0||Fe.typedArray(n.diagnostics,f7.is))&&(n.kind===void 0||Fe.string(n.kind))&&(n.edit!==void 0||n.command!==void 0)&&(n.command===void 0||AN.is(n.command))&&(n.isPreferred===void 0||Fe.boolean(n.isPreferred))&&(n.edit===void 0||kne.is(n.edit))}s.is=t})(w1e||(w1e={}));var y1e;(function(s){function e(i,n){let r={range:i};return Fe.defined(n)&&(r.data=n),r}s.create=e;function t(i){let n=i;return Fe.defined(n)&&gl.is(n.range)&&(Fe.undefined(n.command)||AN.is(n.command))}s.is=t})(y1e||(y1e={}));var C1e;(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})(C1e||(C1e={}));var S1e;(function(s){function e(i,n,r){return{range:i,target:n,data:r}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&gl.is(n.range)&&(Fe.undefined(n.target)||Fe.string(n.target))}s.is=t})(S1e||(S1e={}));var A1e;(function(s){function e(i,n){return{range:i,parent:n}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&gl.is(n.range)&&(n.parent===void 0||s.is(n.parent))}s.is=t})(A1e||(A1e={}));var E1e;(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"})(E1e||(E1e={}));var x1e;(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"})(x1e||(x1e={}));var D1e;(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})(D1e||(D1e={}));var k1e;(function(s){function e(i,n){return{range:i,text:n}}s.create=e;function t(i){const n=i;return n!=null&&gl.is(n.range)&&Fe.string(n.text)}s.is=t})(k1e||(k1e={}));var I1e;(function(s){function e(i,n,r){return{range:i,variableName:n,caseSensitiveLookup:r}}s.create=e;function t(i){const n=i;return n!=null&&gl.is(n.range)&&Fe.boolean(n.caseSensitiveLookup)&&(Fe.string(n.variableName)||n.variableName===void 0)}s.is=t})(I1e||(I1e={}));var T1e;(function(s){function e(i,n){return{range:i,expression:n}}s.create=e;function t(i){const n=i;return n!=null&&gl.is(n.range)&&(Fe.string(n.expression)||n.expression===void 0)}s.is=t})(T1e||(T1e={}));var L1e;(function(s){function e(i,n){return{frameId:i,stoppedLocation:n}}s.create=e;function t(i){const n=i;return Fe.defined(n)&&gl.is(i.stoppedLocation)}s.is=t})(L1e||(L1e={}));var Tne;(function(s){s.Type=1,s.Parameter=2;function e(t){return t===1||t===2}s.is=e})(Tne||(Tne={}));var Lne;(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)||oU.is(n.tooltip))&&(n.location===void 0||g7.is(n.location))&&(n.command===void 0||AN.is(n.command))}s.is=t})(Lne||(Lne={}));var R1e;(function(s){function e(i,n,r){const o={position:i,label:n};return r!==void 0&&(o.kind=r),o}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&__.is(n.position)&&(Fe.string(n.label)||Fe.typedArray(n.label,Lne.is))&&(n.kind===void 0||Tne.is(n.kind))&&n.textEdits===void 0||Fe.typedArray(n.textEdits,$y.is)&&(n.tooltip===void 0||Fe.string(n.tooltip)||oU.is(n.tooltip))&&(n.paddingLeft===void 0||Fe.boolean(n.paddingLeft))&&(n.paddingRight===void 0||Fe.boolean(n.paddingRight))}s.is=t})(R1e||(R1e={}));var M1e;(function(s){function e(t){return{kind:"snippet",value:t}}s.createSnippet=e})(M1e||(M1e={}));var N1e;(function(s){function e(t,i,n,r){return{insertText:t,filterText:i,range:n,command:r}}s.create=e})(N1e||(N1e={}));var P1e;(function(s){function e(t){return{items:t}}s.create=e})(P1e||(P1e={}));var F1e;(function(s){s.Invoked=0,s.Automatic=1})(F1e||(F1e={}));var O1e;(function(s){function e(t,i){return{range:t,text:i}}s.create=e})(O1e||(O1e={}));var B1e;(function(s){function e(t,i){return{triggerKind:t,selectedCompletionInfo:i}}s.create=e})(B1e||(B1e={}));var W1e;(function(s){function e(t){const i=t;return Fe.objectLiteral(i)&&Ene.is(i.uri)&&Fe.string(i.name)}s.is=e})(W1e||(W1e={}));const Cri=[` +`)),at){const Si=Se.error?` Request failed: ${Se.error.message} (${Se.error.code}).`:"";Ln.log(`Received response '${at.method} - (${Se.id})' in ${Date.now()-at.timerStart}ms.${Si}`,Ot)}else Ln.log(`Received response ${Se.id} without active response promise.`,Ot)}else $n("receive-response",Se)}function $n(Se,at){if(!Ln||rs===u.Off)return;const Ot={isLSPMessage:!0,type:Se,message:at,timestamp:Date.now()};Ln.log(Ot)}function Ss(){if(rh())throw new w(b.Closed,"Connection is closed.");if(kc())throw new w(b.Disposed,"Connection is disposed.")}function Wr(){if(Gc())throw new w(b.AlreadyListening,"Connection is already listening")}function Va(){if(!Gc())throw new Error("Call listen() first.")}function ta(Se){return Se===void 0?null:Se}function Oh(Se){if(Se!==null)return Se}function le(Se){return Se!=null&&!Array.isArray(Se)&&typeof Se=="object"}function ho(Se,at){switch(Se){case i.ParameterStructures.auto:return le(at)?Oh(at):[ta(at)];case i.ParameterStructures.byName:if(!le(at))throw new Error("Received parameters by name but param is not an object literal.");return Oh(at);case i.ParameterStructures.byPosition:return[ta(at)];default:throw new Error(`Unknown parameter structure ${Se.toString()}`)}}function nr(Se,at){let Ot;const Si=Se.numberOfParams;switch(Si){case 0:Ot=void 0;break;case 1:Ot=ho(Se.parameterStructures,at[0]);break;default:Ot=[];for(let Bt=0;Bt{Ss();let Ot,Si;if(t.string(Se)){Ot=Se;const K=at[0];let de=0,T=i.ParameterStructures.auto;i.ParameterStructures.is(K)&&(de=1,T=K);let ie=at.length;const ye=ie-de;switch(ye){case 0:Si=void 0;break;case 1:Si=ho(T,at[de]);break;default:if(T===i.ParameterStructures.byName)throw new Error(`Received ${ye} parameters for 'by Name' notification parameter structure.`);Si=at.slice(de,ie).map(O=>ta(O));break}}else{const K=at;Ot=Se.method,Si=nr(Se,K)}const Bt={jsonrpc:Dt,method:Ot,params:Si};return be(Bt),ne.write(Bt).catch(K=>{throw Be.error("Sending notification failed."),K})},onNotification:(Se,at)=>{Ss();let Ot;return t.func(Se)?ss=Se:at&&(t.string(Se)?(Ot=Se,$s.set(Se,{type:void 0,handler:at})):(Ot=Se.method,$s.set(Se.method,{type:Se,handler:at}))),{dispose:()=>{Ot!==void 0?$s.delete(Ot):ss=void 0}}},onProgress:(Se,at,Ot)=>{if(Fn.has(at))throw new Error(`Progress handler for token ${at} already registered`);return Fn.set(at,Ot),{dispose:()=>{Fn.delete(at)}}},sendProgress:(Se,at,Ot)=>gn.sendNotification(l.type,{token:at,value:Ot}),onUnhandledProgress:mc.event,sendRequest:(Se,...at)=>{Ss(),Va();let Ot,Si,Bt;if(t.string(Se)){Ot=Se;const ie=at[0],ye=at[at.length-1];let O=0,$=i.ParameterStructures.auto;i.ParameterStructures.is(ie)&&(O=1,$=ie);let se=at.length;o.CancellationToken.is(ye)&&(se=se-1,Bt=ye);const qe=se-O;switch(qe){case 0:Si=void 0;break;case 1:Si=ho($,at[O]);break;default:if($===i.ParameterStructures.byName)throw new Error(`Received ${qe} parameters for 'by Name' request parameter structure.`);Si=at.slice(O,se).map(Wi=>ta(Wi));break}}else{const ie=at;Ot=Se.method,Si=nr(Se,ie);const ye=Se.numberOfParams;Bt=o.CancellationToken.is(ie[ye])?ie[ye]:void 0}const K=Ct++;let de;Bt&&(de=Bt.onCancellationRequested(()=>{const ie=Gs.sender.sendCancellation(gn,K);return ie===void 0?(Be.log(`Received no promise from cancellation strategy when cancelling id ${K}`),Promise.resolve()):ie.catch(()=>{Be.log(`Sending cancellation messages for id ${K} failed`)})}));const T={jsonrpc:Dt,id:K,method:Ot,params:Si};return Fh(T),typeof Gs.sender.enableCancellation=="function"&&Gs.sender.enableCancellation(T),new Promise(async(ie,ye)=>{const O=qe=>{ie(qe),Gs.sender.cleanup(K),de?.dispose()},$=qe=>{ye(qe),Gs.sender.cleanup(K),de?.dispose()},se={method:Ot,timerStart:Date.now(),resolve:O,reject:$};try{await ne.write(T),Zr.set(K,se)}catch(qe){throw Be.error("Sending request failed."),se.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,qe.message?qe.message:"Unknown reason")),qe}})},onRequest:(Se,at)=>{Ss();let Ot=null;return h.is(Se)?(Ot=void 0,Xi=Se):t.string(Se)?(Ot=null,at!==void 0&&(Ot=Se,Ti.set(Se,{handler:at,type:void 0}))):at!==void 0&&(Ot=Se.method,Ti.set(Se.method,{type:Se,handler:at})),{dispose:()=>{Ot!==null&&(Ot!==void 0?Ti.delete(Ot):Xi=void 0)}}},hasPendingResponse:()=>Zr.size>0,trace:async(Se,at,Ot)=>{let Si=!1,Bt=p.Text;Ot!==void 0&&(t.boolean(Ot)?Si=Ot:(Si=Ot.sendNotification||!1,Bt=Ot.traceFormat||p.Text)),rs=Se,Or=Bt,rs===u.Off?Ln=void 0:Ln=at,Si&&!rh()&&!kc()&&await gn.sendNotification(m.type,{value:u.toString(Se)})},onError:wd.event,onClose:On.event,onUnhandledNotification:nh.event,onDispose:$c.event,end:()=>{ne.end()},dispose:()=>{if(kc())return;Ha=G.Disposed,$c.fire(void 0);const Se=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const at of Zr.values())at.reject(Se);Zr=new Map,ki=new Map,ea=new Set,hs=new n.LinkedMap,t.func(ne.dispose)&&ne.dispose(),t.func(j.dispose)&&j.dispose()},listen:()=>{Ss(),Wr(),Ha=G.Listening,j.listen(Kc)},inspect:()=>{(0,e.default)().console.log("inspect")}};return gn.onNotification(v.type,Se=>{if(rs===u.Off||!Ln)return;const at=rs===u.Verbose||rs===u.Compact;Ln.log(Se.message,at?Se.verbose:void 0)}),gn.onNotification(l.type,Se=>{const at=Fn.get(Se.token);at?at(Se.value):mc.fire(Se)}),gn}s.createMessageConnection=Y})(Qot);(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=dn;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=CA;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=Lle;Object.defineProperty(s,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const n=fC;Object.defineProperty(s,"Event",{enumerable:!0,get:function(){return n.Event}}),Object.defineProperty(s,"Emitter",{enumerable:!0,get:function(){return n.Emitter}});const r=AI;Object.defineProperty(s,"CancellationTokenSource",{enumerable:!0,get:function(){return r.CancellationTokenSource}}),Object.defineProperty(s,"CancellationToken",{enumerable:!0,get:function(){return r.CancellationToken}});const o=iU;Object.defineProperty(s,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(s,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});const a=LD;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=RD;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=Mle;Object.defineProperty(s,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const d=Qot;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=uE;s.RAL=h.default})(Sne);Object.defineProperty(mFe,"__esModule",{value:!0});const iy=Sne;class Nle extends iy.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return Nle.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)}}Nle.emptyBuffer=new Uint8Array(0);class bri{constructor(e){this.socket=e,this._onData=new iy.Emitter,this._messageListener=t=>{t.data.arrayBuffer().then(n=>{this._onData.fire(new Uint8Array(n))},()=>{(0,iy.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),iy.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),iy.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),iy.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class wri{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),iy.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),iy.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),iy.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 yri=new TextEncoder,jot=Object.freeze({messageBuffer:Object.freeze({create:s=>new Nle(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(yri.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 bri(s),asWritableStream:s=>new wri(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 H0e(){return jot}(function(s){function e(){iy.RAL.install(jot)}s.install=e})(H0e||(H0e={}));mFe.default=H0e;(function(s){var e=cd&&cd.__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=cd&&cd.__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,mFe.default.install();const n=Sne;t(Sne,s);class r 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=r;class o 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=o;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})(nP);var z$e=nP,Yot={},U0e;(function(s){function e(t){return typeof t=="string"}s.is=e})(U0e||(U0e={}));var Ene;(function(s){function e(t){return typeof t=="string"}s.is=e})(Ene||(Ene={}));var V0e;(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})(V0e||(V0e={}));var u7;(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})(u7||(u7={}));var __;(function(s){function e(i,n){return i===Number.MAX_VALUE&&(i=u7.MAX_VALUE),n===Number.MAX_VALUE&&(n=u7.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})(__||(__={}));var gl;(function(s){function e(i,n,r,o){if(Fe.uinteger(i)&&Fe.uinteger(n)&&Fe.uinteger(r)&&Fe.uinteger(o))return{start:__.create(i,n),end:__.create(r,o)};if(__.is(i)&&__.is(n))return{start:i,end:n};throw new Error(`Range#create called with invalid arguments[${i}, ${n}, ${r}, ${o}]`)}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&__.is(n.start)&&__.is(n.end)}s.is=t})(gl||(gl={}));var g7;(function(s){function e(i,n){return{uri:i,range:n}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&gl.is(n.range)&&(Fe.string(n.uri)||Fe.undefined(n.uri))}s.is=t})(g7||(g7={}));var z0e;(function(s){function e(i,n,r,o){return{targetUri:i,targetRange:n,targetSelectionRange:r,originSelectionRange:o}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&gl.is(n.targetRange)&&Fe.string(n.targetUri)&&gl.is(n.targetSelectionRange)&&(gl.is(n.originSelectionRange)||Fe.undefined(n.originSelectionRange))}s.is=t})(z0e||(z0e={}));var xne;(function(s){function e(i,n,r,o){return{red:i,green:n,blue:r,alpha:o}}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})(xne||(xne={}));var $0e;(function(s){function e(i,n){return{range:i,color:n}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&gl.is(n.range)&&xne.is(n.color)}s.is=t})($0e||($0e={}));var G0e;(function(s){function e(i,n,r){return{label:i,textEdit:n,additionalTextEdits:r}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&Fe.string(n.label)&&(Fe.undefined(n.textEdit)||$y.is(n))&&(Fe.undefined(n.additionalTextEdits)||Fe.typedArray(n.additionalTextEdits,$y.is))}s.is=t})(G0e||(G0e={}));var K0e;(function(s){s.Comment="comment",s.Imports="imports",s.Region="region"})(K0e||(K0e={}));var q0e;(function(s){function e(i,n,r,o,a,c){const l={startLine:i,endLine:n};return Fe.defined(r)&&(l.startCharacter=r),Fe.defined(o)&&(l.endCharacter=o),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})(q0e||(q0e={}));var Dne;(function(s){function e(i,n){return{location:i,message:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&g7.is(n.location)&&Fe.string(n.message)}s.is=t})(Dne||(Dne={}));var Q0e;(function(s){s.Error=1,s.Warning=2,s.Information=3,s.Hint=4})(Q0e||(Q0e={}));var j0e;(function(s){s.Unnecessary=1,s.Deprecated=2})(j0e||(j0e={}));var Y0e;(function(s){function e(t){const i=t;return Fe.objectLiteral(i)&&Fe.string(i.href)}s.is=e})(Y0e||(Y0e={}));var f7;(function(s){function e(i,n,r,o,a,c){let l={range:i,message:n};return Fe.defined(r)&&(l.severity=r),Fe.defined(o)&&(l.code=o),Fe.defined(a)&&(l.source=a),Fe.defined(c)&&(l.relatedInformation=c),l}s.create=e;function t(i){var n;let r=i;return Fe.defined(r)&&gl.is(r.range)&&Fe.string(r.message)&&(Fe.number(r.severity)||Fe.undefined(r.severity))&&(Fe.integer(r.code)||Fe.string(r.code)||Fe.undefined(r.code))&&(Fe.undefined(r.codeDescription)||Fe.string((n=r.codeDescription)===null||n===void 0?void 0:n.href))&&(Fe.string(r.source)||Fe.undefined(r.source))&&(Fe.undefined(r.relatedInformation)||Fe.typedArray(r.relatedInformation,Dne.is))}s.is=t})(f7||(f7={}));var AN;(function(s){function e(i,n,...r){let o={title:i,command:n};return Fe.defined(r)&&r.length>0&&(o.arguments=r),o}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.title)&&Fe.string(n.command)}s.is=t})(AN||(AN={}));var $y;(function(s){function e(r,o){return{range:r,newText:o}}s.replace=e;function t(r,o){return{range:{start:r,end:r},newText:o}}s.insert=t;function i(r){return{range:r,newText:""}}s.del=i;function n(r){const o=r;return Fe.objectLiteral(o)&&Fe.string(o.newText)&&gl.is(o.range)}s.is=n})($y||($y={}));var lL;(function(s){function e(i,n,r){const o={label:i};return n!==void 0&&(o.needsConfirmation=n),r!==void 0&&(o.description=r),o}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})(lL||(lL={}));var Yh;(function(s){function e(t){const i=t;return Fe.string(i)}s.is=e})(Yh||(Yh={}));var iS;(function(s){function e(r,o,a){return{range:r,newText:o,annotationId:a}}s.replace=e;function t(r,o,a){return{range:{start:r,end:r},newText:o,annotationId:a}}s.insert=t;function i(r,o){return{range:r,newText:"",annotationId:o}}s.del=i;function n(r){const o=r;return $y.is(o)&&(lL.is(o.annotationId)||Yh.is(o.annotationId))}s.is=n})(iS||(iS={}));var p7;(function(s){function e(i,n){return{textDocument:i,edits:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&m7.is(n.textDocument)&&Array.isArray(n.edits)}s.is=t})(p7||(p7={}));var nU;(function(s){function e(i,n,r){let o={kind:"create",uri:i};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(o.options=n),r!==void 0&&(o.annotationId=r),o}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||Yh.is(n.annotationId))}s.is=t})(nU||(nU={}));var sU;(function(s){function e(i,n,r,o){let a={kind:"rename",oldUri:i,newUri:n};return r!==void 0&&(r.overwrite!==void 0||r.ignoreIfExists!==void 0)&&(a.options=r),o!==void 0&&(a.annotationId=o),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||Yh.is(n.annotationId))}s.is=t})(sU||(sU={}));var rU;(function(s){function e(i,n,r){let o={kind:"delete",uri:i};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(o.options=n),r!==void 0&&(o.annotationId=r),o}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||Yh.is(n.annotationId))}s.is=t})(rU||(rU={}));var kne;(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)?nU.is(n)||sU.is(n)||rU.is(n):p7.is(n)))}s.is=e})(kne||(kne={}));let cq=class{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,i){let n,r;if(i===void 0?n=$y.insert(e,t):Yh.is(i)?(r=i,n=iS.insert(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(i),n=iS.insert(e,t,r)),this.edits.push(n),r!==void 0)return r}replace(e,t,i){let n,r;if(i===void 0?n=$y.replace(e,t):Yh.is(i)?(r=i,n=iS.replace(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(i),n=iS.replace(e,t,r)),this.edits.push(n),r!==void 0)return r}delete(e,t){let i,n;if(t===void 0?i=$y.del(e):Yh.is(t)?(n=t,i=iS.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),i=iS.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.")}},$$e=class{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(Yh.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 Cri{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(p7.is(t)){const i=new cq(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=i}})):e.changes&&Object.keys(e.changes).forEach(t=>{const i=new cq(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(m7.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=[],r={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(r),i=new cq(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 cq(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;lL.is(t)||Yh.is(t)?n=t:i=t;let r,o;if(n===void 0?r=nU.create(e,i):(o=Yh.is(n)?n:this._changeAnnotations.manage(n),r=nU.create(e,i,o)),this._workspaceEdit.documentChanges.push(r),o!==void 0)return o}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 r;lL.is(i)||Yh.is(i)?r=i:n=i;let o,a;if(r===void 0?o=sU.create(e,t,n):(a=Yh.is(r)?r:this._changeAnnotations.manage(r),o=sU.create(e,t,n,a)),this._workspaceEdit.documentChanges.push(o),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;lL.is(t)||Yh.is(t)?n=t:i=t;let r,o;if(n===void 0?r=rU.create(e,i):(o=Yh.is(n)?n:this._changeAnnotations.manage(n),r=rU.create(e,i,o)),this._workspaceEdit.documentChanges.push(r),o!==void 0)return o}}var J0e;(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})(J0e||(J0e={}));var X0e;(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})(X0e||(X0e={}));var m7;(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})(m7||(m7={}));var Z0e;(function(s){function e(i,n,r,o){return{uri:i,languageId:n,version:r,text:o}}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})(Z0e||(Z0e={}));var Ine;(function(s){s.PlainText="plaintext",s.Markdown="markdown";function e(t){const i=t;return i===s.PlainText||i===s.Markdown}s.is=e})(Ine||(Ine={}));var oU;(function(s){function e(t){const i=t;return Fe.objectLiteral(t)&&Ine.is(i.kind)&&Fe.string(i.value)}s.is=e})(oU||(oU={}));var e1e;(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})(e1e||(e1e={}));var t1e;(function(s){s.PlainText=1,s.Snippet=2})(t1e||(t1e={}));var i1e;(function(s){s.Deprecated=1})(i1e||(i1e={}));var n1e;(function(s){function e(i,n,r){return{newText:i,insert:n,replace:r}}s.create=e;function t(i){const n=i;return n&&Fe.string(n.newText)&&gl.is(n.insert)&&gl.is(n.replace)}s.is=t})(n1e||(n1e={}));var s1e;(function(s){s.asIs=1,s.adjustIndentation=2})(s1e||(s1e={}));var r1e;(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})(r1e||(r1e={}));var o1e;(function(s){function e(t){return{label:t}}s.create=e})(o1e||(o1e={}));var a1e;(function(s){function e(t,i){return{items:t||[],isIncomplete:!!i}}s.create=e})(a1e||(a1e={}));var _7;(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})(_7||(_7={}));var c1e;(function(s){function e(t){let i=t;return!!i&&Fe.objectLiteral(i)&&(oU.is(i.contents)||_7.is(i.contents)||Fe.typedArray(i.contents,_7.is))&&(t.range===void 0||gl.is(t.range))}s.is=e})(c1e||(c1e={}));var l1e;(function(s){function e(t,i){return i?{label:t,documentation:i}:{label:t}}s.create=e})(l1e||(l1e={}));var d1e;(function(s){function e(t,i,...n){let r={label:t};return Fe.defined(i)&&(r.documentation=i),Fe.defined(n)?r.parameters=n:r.parameters=[],r}s.create=e})(d1e||(d1e={}));var h1e;(function(s){s.Text=1,s.Read=2,s.Write=3})(h1e||(h1e={}));var u1e;(function(s){function e(t,i){let n={range:t};return Fe.number(i)&&(n.kind=i),n}s.create=e})(u1e||(u1e={}));var g1e;(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})(g1e||(g1e={}));var f1e;(function(s){s.Deprecated=1})(f1e||(f1e={}));var p1e;(function(s){function e(t,i,n,r,o){let a={name:t,kind:i,location:{uri:r,range:n}};return o&&(a.containerName=o),a}s.create=e})(p1e||(p1e={}));var m1e;(function(s){function e(t,i,n,r){return r!==void 0?{name:t,kind:i,location:{uri:n,range:r}}:{name:t,kind:i,location:{uri:n}}}s.create=e})(m1e||(m1e={}));var _1e;(function(s){function e(i,n,r,o,a,c){let l={name:i,detail:n,kind:r,range:o,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)&&gl.is(n.range)&&gl.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})(_1e||(_1e={}));var v1e;(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"})(v1e||(v1e={}));var v7;(function(s){s.Invoked=1,s.Automatic=2})(v7||(v7={}));var b1e;(function(s){function e(i,n,r){let o={diagnostics:i};return n!=null&&(o.only=n),r!=null&&(o.triggerKind=r),o}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.typedArray(n.diagnostics,f7.is)&&(n.only===void 0||Fe.typedArray(n.only,Fe.string))&&(n.triggerKind===void 0||n.triggerKind===v7.Invoked||n.triggerKind===v7.Automatic)}s.is=t})(b1e||(b1e={}));var w1e;(function(s){function e(i,n,r){let o={title:i},a=!0;return typeof n=="string"?(a=!1,o.kind=n):AN.is(n)?o.command=n:o.edit=n,a&&r!==void 0&&(o.kind=r),o}s.create=e;function t(i){let n=i;return n&&Fe.string(n.title)&&(n.diagnostics===void 0||Fe.typedArray(n.diagnostics,f7.is))&&(n.kind===void 0||Fe.string(n.kind))&&(n.edit!==void 0||n.command!==void 0)&&(n.command===void 0||AN.is(n.command))&&(n.isPreferred===void 0||Fe.boolean(n.isPreferred))&&(n.edit===void 0||kne.is(n.edit))}s.is=t})(w1e||(w1e={}));var y1e;(function(s){function e(i,n){let r={range:i};return Fe.defined(n)&&(r.data=n),r}s.create=e;function t(i){let n=i;return Fe.defined(n)&&gl.is(n.range)&&(Fe.undefined(n.command)||AN.is(n.command))}s.is=t})(y1e||(y1e={}));var C1e;(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})(C1e||(C1e={}));var S1e;(function(s){function e(i,n,r){return{range:i,target:n,data:r}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&gl.is(n.range)&&(Fe.undefined(n.target)||Fe.string(n.target))}s.is=t})(S1e||(S1e={}));var A1e;(function(s){function e(i,n){return{range:i,parent:n}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&gl.is(n.range)&&(n.parent===void 0||s.is(n.parent))}s.is=t})(A1e||(A1e={}));var E1e;(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"})(E1e||(E1e={}));var x1e;(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"})(x1e||(x1e={}));var D1e;(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})(D1e||(D1e={}));var k1e;(function(s){function e(i,n){return{range:i,text:n}}s.create=e;function t(i){const n=i;return n!=null&&gl.is(n.range)&&Fe.string(n.text)}s.is=t})(k1e||(k1e={}));var I1e;(function(s){function e(i,n,r){return{range:i,variableName:n,caseSensitiveLookup:r}}s.create=e;function t(i){const n=i;return n!=null&&gl.is(n.range)&&Fe.boolean(n.caseSensitiveLookup)&&(Fe.string(n.variableName)||n.variableName===void 0)}s.is=t})(I1e||(I1e={}));var T1e;(function(s){function e(i,n){return{range:i,expression:n}}s.create=e;function t(i){const n=i;return n!=null&&gl.is(n.range)&&(Fe.string(n.expression)||n.expression===void 0)}s.is=t})(T1e||(T1e={}));var L1e;(function(s){function e(i,n){return{frameId:i,stoppedLocation:n}}s.create=e;function t(i){const n=i;return Fe.defined(n)&&gl.is(i.stoppedLocation)}s.is=t})(L1e||(L1e={}));var Tne;(function(s){s.Type=1,s.Parameter=2;function e(t){return t===1||t===2}s.is=e})(Tne||(Tne={}));var Lne;(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)||oU.is(n.tooltip))&&(n.location===void 0||g7.is(n.location))&&(n.command===void 0||AN.is(n.command))}s.is=t})(Lne||(Lne={}));var R1e;(function(s){function e(i,n,r){const o={position:i,label:n};return r!==void 0&&(o.kind=r),o}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&__.is(n.position)&&(Fe.string(n.label)||Fe.typedArray(n.label,Lne.is))&&(n.kind===void 0||Tne.is(n.kind))&&n.textEdits===void 0||Fe.typedArray(n.textEdits,$y.is)&&(n.tooltip===void 0||Fe.string(n.tooltip)||oU.is(n.tooltip))&&(n.paddingLeft===void 0||Fe.boolean(n.paddingLeft))&&(n.paddingRight===void 0||Fe.boolean(n.paddingRight))}s.is=t})(R1e||(R1e={}));var M1e;(function(s){function e(t){return{kind:"snippet",value:t}}s.createSnippet=e})(M1e||(M1e={}));var N1e;(function(s){function e(t,i,n,r){return{insertText:t,filterText:i,range:n,command:r}}s.create=e})(N1e||(N1e={}));var P1e;(function(s){function e(t){return{items:t}}s.create=e})(P1e||(P1e={}));var F1e;(function(s){s.Invoked=0,s.Automatic=1})(F1e||(F1e={}));var O1e;(function(s){function e(t,i){return{range:t,text:i}}s.create=e})(O1e||(O1e={}));var B1e;(function(s){function e(t,i){return{triggerKind:t,selectedCompletionInfo:i}}s.create=e})(B1e||(B1e={}));var W1e;(function(s){function e(t){const i=t;return Fe.objectLiteral(i)&&Ene.is(i.uri)&&Fe.string(i.name)}s.is=e})(W1e||(W1e={}));const Sri=[` `,`\r -`,"\r"];var H1e;(function(s){function e(r,o,a,c){return new Sri(r,o,a,c)}s.create=e;function t(r){let o=r;return!!(Fe.defined(o)&&Fe.string(o.uri)&&(Fe.undefined(o.languageId)||Fe.string(o.languageId))&&Fe.uinteger(o.lineCount)&&Fe.func(o.getText)&&Fe.func(o.positionAt)&&Fe.func(o.offsetAt))}s.is=t;function i(r,o){let a=r.getText(),c=n(o,(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=r.offsetAt(h.range.start),f=r.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(r,o){if(r.length<=1)return r;const a=r.length/2|0,c=r.slice(0,a),l=r.slice(a);n(c,o),n(l,o);let d=0,h=0,u=0;for(;d{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=r.offsetAt(h.range.start),f=r.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(r,o){if(r.length<=1)return r;const a=r.length/2|0,c=r.slice(0,a),l=r.slice(a);n(c,o),n(l,o);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 __.create(0,e);for(;ie?n=o:i=o+1}let r=i-1;return __.create(r,e-t[r])}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 r(f){return e.call(f)==="[object String]"}s.string=r;function o(f){return e.call(f)==="[object Number]"}s.number=o;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 Ari=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return iS},get ChangeAnnotation(){return lL},get ChangeAnnotationIdentifier(){return Yh},get CodeAction(){return w1e},get CodeActionContext(){return b1e},get CodeActionKind(){return v1e},get CodeActionTriggerKind(){return v7},get CodeDescription(){return Y0e},get CodeLens(){return y1e},get Color(){return xne},get ColorInformation(){return $0e},get ColorPresentation(){return G0e},get Command(){return AN},get CompletionItem(){return o1e},get CompletionItemKind(){return e1e},get CompletionItemLabelDetails(){return r1e},get CompletionItemTag(){return i1e},get CompletionList(){return a1e},get CreateFile(){return nU},get DeleteFile(){return rU},get Diagnostic(){return f7},get DiagnosticRelatedInformation(){return Dne},get DiagnosticSeverity(){return Q0e},get DiagnosticTag(){return j0e},get DocumentHighlight(){return u1e},get DocumentHighlightKind(){return h1e},get DocumentLink(){return S1e},get DocumentSymbol(){return _1e},get DocumentUri(){return U0e},EOL:Cri,get FoldingRange(){return q0e},get FoldingRangeKind(){return K0e},get FormattingOptions(){return C1e},get Hover(){return c1e},get InlayHint(){return R1e},get InlayHintKind(){return Tne},get InlayHintLabelPart(){return Lne},get InlineCompletionContext(){return B1e},get InlineCompletionItem(){return N1e},get InlineCompletionList(){return P1e},get InlineCompletionTriggerKind(){return F1e},get InlineValueContext(){return L1e},get InlineValueEvaluatableExpression(){return T1e},get InlineValueText(){return k1e},get InlineValueVariableLookup(){return I1e},get InsertReplaceEdit(){return n1e},get InsertTextFormat(){return t1e},get InsertTextMode(){return s1e},get Location(){return g7},get LocationLink(){return z0e},get MarkedString(){return _7},get MarkupContent(){return oU},get MarkupKind(){return Ine},get OptionalVersionedTextDocumentIdentifier(){return m7},get ParameterInformation(){return l1e},get Position(){return __},get Range(){return gl},get RenameFile(){return sU},get SelectedCompletionInfo(){return O1e},get SelectionRange(){return A1e},get SemanticTokenModifiers(){return x1e},get SemanticTokenTypes(){return E1e},get SemanticTokens(){return D1e},get SignatureInformation(){return d1e},get StringValue(){return M1e},get SymbolInformation(){return p1e},get SymbolKind(){return g1e},get SymbolTag(){return f1e},get TextDocument(){return H1e},get TextDocumentEdit(){return p7},get TextDocumentIdentifier(){return J0e},get TextDocumentItem(){return Z0e},get TextEdit(){return $y},get URI(){return Ene},get VersionedTextDocumentIdentifier(){return X0e},WorkspaceChange:yri,get WorkspaceEdit(){return kne},get WorkspaceFolder(){return W1e},get WorkspaceSymbol(){return m1e},get integer(){return V0e},get uinteger(){return u7}},Symbol.toStringTag,{value:"Module"})),vFe=Vot(Ari);var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.ProtocolNotificationType=Lr.ProtocolNotificationType0=Lr.ProtocolRequestType=Lr.ProtocolRequestType0=Lr.RegistrationType=Lr.MessageDirection=void 0;const aU=nP;var G$e;(function(s){s.clientToServer="clientToServer",s.serverToClient="serverToClient",s.both="both"})(G$e||(Lr.MessageDirection=G$e={}));class Eri{constructor(e){this.method=e}}Lr.RegistrationType=Eri;class xri extends aU.RequestType0{constructor(e){super(e)}}Lr.ProtocolRequestType0=xri;class Dri extends aU.RequestType{constructor(e){super(e,aU.ParameterStructures.byName)}}Lr.ProtocolRequestType=Dri;class kri extends aU.NotificationType0{constructor(e){super(e)}}Lr.ProtocolNotificationType0=kri;class Iri extends aU.NotificationType{constructor(e){super(e,aU.ParameterStructures.byName)}}Lr.ProtocolNotificationType=Iri;var Jot={},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 Tri(s){return s===!0||s===!1}ol.boolean=Tri;function Xot(s){return typeof s=="string"||s instanceof String}ol.string=Xot;function Lri(s){return typeof s=="number"||s instanceof Number}ol.number=Lri;function Rri(s){return s instanceof Error}ol.error=Rri;function Mri(s){return typeof s=="function"}ol.func=Mri;function Zot(s){return Array.isArray(s)}ol.array=Zot;function Nri(s){return Zot(s)&&s.every(e=>Xot(e))}ol.stringArray=Nri;function Pri(s,e){return Array.isArray(s)&&s.every(e)}ol.typedArray=Pri;function Fri(s){return s!==null&&typeof s=="object"}ol.objectLiteral=Fri;var Ple={};Object.defineProperty(Ple,"__esModule",{value:!0});Ple.ImplementationRequest=void 0;const K$e=Lr;var q$e;(function(s){s.method="textDocument/implementation",s.messageDirection=K$e.MessageDirection.clientToServer,s.type=new K$e.ProtocolRequestType(s.method)})(q$e||(Ple.ImplementationRequest=q$e={}));var Fle={};Object.defineProperty(Fle,"__esModule",{value:!0});Fle.TypeDefinitionRequest=void 0;const Q$e=Lr;var j$e;(function(s){s.method="textDocument/typeDefinition",s.messageDirection=Q$e.MessageDirection.clientToServer,s.type=new Q$e.ProtocolRequestType(s.method)})(j$e||(Fle.TypeDefinitionRequest=j$e={}));var cU={};Object.defineProperty(cU,"__esModule",{value:!0});cU.DidChangeWorkspaceFoldersNotification=cU.WorkspaceFoldersRequest=void 0;const Rne=Lr;var Y$e;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=Rne.MessageDirection.serverToClient,s.type=new Rne.ProtocolRequestType0(s.method)})(Y$e||(cU.WorkspaceFoldersRequest=Y$e={}));var J$e;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=Rne.MessageDirection.clientToServer,s.type=new Rne.ProtocolNotificationType(s.method)})(J$e||(cU.DidChangeWorkspaceFoldersNotification=J$e={}));var Ole={};Object.defineProperty(Ole,"__esModule",{value:!0});Ole.ConfigurationRequest=void 0;const X$e=Lr;var Z$e;(function(s){s.method="workspace/configuration",s.messageDirection=X$e.MessageDirection.serverToClient,s.type=new X$e.ProtocolRequestType(s.method)})(Z$e||(Ole.ConfigurationRequest=Z$e={}));var lU={};Object.defineProperty(lU,"__esModule",{value:!0});lU.ColorPresentationRequest=lU.DocumentColorRequest=void 0;const Mne=Lr;var e7e;(function(s){s.method="textDocument/documentColor",s.messageDirection=Mne.MessageDirection.clientToServer,s.type=new Mne.ProtocolRequestType(s.method)})(e7e||(lU.DocumentColorRequest=e7e={}));var t7e;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=Mne.MessageDirection.clientToServer,s.type=new Mne.ProtocolRequestType(s.method)})(t7e||(lU.ColorPresentationRequest=t7e={}));var dU={};Object.defineProperty(dU,"__esModule",{value:!0});dU.FoldingRangeRefreshRequest=dU.FoldingRangeRequest=void 0;const Nne=Lr;var i7e;(function(s){s.method="textDocument/foldingRange",s.messageDirection=Nne.MessageDirection.clientToServer,s.type=new Nne.ProtocolRequestType(s.method)})(i7e||(dU.FoldingRangeRequest=i7e={}));var n7e;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=Nne.MessageDirection.serverToClient,s.type=new Nne.ProtocolRequestType0(s.method)})(n7e||(dU.FoldingRangeRefreshRequest=n7e={}));var Ble={};Object.defineProperty(Ble,"__esModule",{value:!0});Ble.DeclarationRequest=void 0;const s7e=Lr;var r7e;(function(s){s.method="textDocument/declaration",s.messageDirection=s7e.MessageDirection.clientToServer,s.type=new s7e.ProtocolRequestType(s.method)})(r7e||(Ble.DeclarationRequest=r7e={}));var Wle={};Object.defineProperty(Wle,"__esModule",{value:!0});Wle.SelectionRangeRequest=void 0;const o7e=Lr;var a7e;(function(s){s.method="textDocument/selectionRange",s.messageDirection=o7e.MessageDirection.clientToServer,s.type=new o7e.ProtocolRequestType(s.method)})(a7e||(Wle.SelectionRangeRequest=a7e={}));var MD={};Object.defineProperty(MD,"__esModule",{value:!0});MD.WorkDoneProgressCancelNotification=MD.WorkDoneProgressCreateRequest=MD.WorkDoneProgress=void 0;const Ori=nP,Pne=Lr;var c7e;(function(s){s.type=new Ori.ProgressType;function e(t){return t===s.type}s.is=e})(c7e||(MD.WorkDoneProgress=c7e={}));var l7e;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=Pne.MessageDirection.serverToClient,s.type=new Pne.ProtocolRequestType(s.method)})(l7e||(MD.WorkDoneProgressCreateRequest=l7e={}));var d7e;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=Pne.MessageDirection.clientToServer,s.type=new Pne.ProtocolNotificationType(s.method)})(d7e||(MD.WorkDoneProgressCancelNotification=d7e={}));var ND={};Object.defineProperty(ND,"__esModule",{value:!0});ND.CallHierarchyOutgoingCallsRequest=ND.CallHierarchyIncomingCallsRequest=ND.CallHierarchyPrepareRequest=void 0;const hU=Lr;var h7e;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=hU.MessageDirection.clientToServer,s.type=new hU.ProtocolRequestType(s.method)})(h7e||(ND.CallHierarchyPrepareRequest=h7e={}));var u7e;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=hU.MessageDirection.clientToServer,s.type=new hU.ProtocolRequestType(s.method)})(u7e||(ND.CallHierarchyIncomingCallsRequest=u7e={}));var g7e;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=hU.MessageDirection.clientToServer,s.type=new hU.ProtocolRequestType(s.method)})(g7e||(ND.CallHierarchyOutgoingCallsRequest=g7e={}));var jf={};Object.defineProperty(jf,"__esModule",{value:!0});jf.SemanticTokensRefreshRequest=jf.SemanticTokensRangeRequest=jf.SemanticTokensDeltaRequest=jf.SemanticTokensRequest=jf.SemanticTokensRegistrationType=jf.TokenFormat=void 0;const XA=Lr;var f7e;(function(s){s.Relative="relative"})(f7e||(jf.TokenFormat=f7e={}));var b7;(function(s){s.method="textDocument/semanticTokens",s.type=new XA.RegistrationType(s.method)})(b7||(jf.SemanticTokensRegistrationType=b7={}));var p7e;(function(s){s.method="textDocument/semanticTokens/full",s.messageDirection=XA.MessageDirection.clientToServer,s.type=new XA.ProtocolRequestType(s.method),s.registrationMethod=b7.method})(p7e||(jf.SemanticTokensRequest=p7e={}));var m7e;(function(s){s.method="textDocument/semanticTokens/full/delta",s.messageDirection=XA.MessageDirection.clientToServer,s.type=new XA.ProtocolRequestType(s.method),s.registrationMethod=b7.method})(m7e||(jf.SemanticTokensDeltaRequest=m7e={}));var _7e;(function(s){s.method="textDocument/semanticTokens/range",s.messageDirection=XA.MessageDirection.clientToServer,s.type=new XA.ProtocolRequestType(s.method),s.registrationMethod=b7.method})(_7e||(jf.SemanticTokensRangeRequest=_7e={}));var v7e;(function(s){s.method="workspace/semanticTokens/refresh",s.messageDirection=XA.MessageDirection.serverToClient,s.type=new XA.ProtocolRequestType0(s.method)})(v7e||(jf.SemanticTokensRefreshRequest=v7e={}));var Hle={};Object.defineProperty(Hle,"__esModule",{value:!0});Hle.ShowDocumentRequest=void 0;const b7e=Lr;var w7e;(function(s){s.method="window/showDocument",s.messageDirection=b7e.MessageDirection.serverToClient,s.type=new b7e.ProtocolRequestType(s.method)})(w7e||(Hle.ShowDocumentRequest=w7e={}));var Ule={};Object.defineProperty(Ule,"__esModule",{value:!0});Ule.LinkedEditingRangeRequest=void 0;const y7e=Lr;var C7e;(function(s){s.method="textDocument/linkedEditingRange",s.messageDirection=y7e.MessageDirection.clientToServer,s.type=new y7e.ProtocolRequestType(s.method)})(C7e||(Ule.LinkedEditingRangeRequest=C7e={}));var Uu={};Object.defineProperty(Uu,"__esModule",{value:!0});Uu.WillDeleteFilesRequest=Uu.DidDeleteFilesNotification=Uu.DidRenameFilesNotification=Uu.WillRenameFilesRequest=Uu.DidCreateFilesNotification=Uu.WillCreateFilesRequest=Uu.FileOperationPatternKind=void 0;const av=Lr;var S7e;(function(s){s.file="file",s.folder="folder"})(S7e||(Uu.FileOperationPatternKind=S7e={}));var A7e;(function(s){s.method="workspace/willCreateFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolRequestType(s.method)})(A7e||(Uu.WillCreateFilesRequest=A7e={}));var E7e;(function(s){s.method="workspace/didCreateFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolNotificationType(s.method)})(E7e||(Uu.DidCreateFilesNotification=E7e={}));var x7e;(function(s){s.method="workspace/willRenameFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolRequestType(s.method)})(x7e||(Uu.WillRenameFilesRequest=x7e={}));var D7e;(function(s){s.method="workspace/didRenameFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolNotificationType(s.method)})(D7e||(Uu.DidRenameFilesNotification=D7e={}));var k7e;(function(s){s.method="workspace/didDeleteFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolNotificationType(s.method)})(k7e||(Uu.DidDeleteFilesNotification=k7e={}));var I7e;(function(s){s.method="workspace/willDeleteFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolRequestType(s.method)})(I7e||(Uu.WillDeleteFilesRequest=I7e={}));var PD={};Object.defineProperty(PD,"__esModule",{value:!0});PD.MonikerRequest=PD.MonikerKind=PD.UniquenessLevel=void 0;const T7e=Lr;var L7e;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(L7e||(PD.UniquenessLevel=L7e={}));var R7e;(function(s){s.$import="import",s.$export="export",s.local="local"})(R7e||(PD.MonikerKind=R7e={}));var M7e;(function(s){s.method="textDocument/moniker",s.messageDirection=T7e.MessageDirection.clientToServer,s.type=new T7e.ProtocolRequestType(s.method)})(M7e||(PD.MonikerRequest=M7e={}));var FD={};Object.defineProperty(FD,"__esModule",{value:!0});FD.TypeHierarchySubtypesRequest=FD.TypeHierarchySupertypesRequest=FD.TypeHierarchyPrepareRequest=void 0;const uU=Lr;var N7e;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=uU.MessageDirection.clientToServer,s.type=new uU.ProtocolRequestType(s.method)})(N7e||(FD.TypeHierarchyPrepareRequest=N7e={}));var P7e;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=uU.MessageDirection.clientToServer,s.type=new uU.ProtocolRequestType(s.method)})(P7e||(FD.TypeHierarchySupertypesRequest=P7e={}));var F7e;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=uU.MessageDirection.clientToServer,s.type=new uU.ProtocolRequestType(s.method)})(F7e||(FD.TypeHierarchySubtypesRequest=F7e={}));var gU={};Object.defineProperty(gU,"__esModule",{value:!0});gU.InlineValueRefreshRequest=gU.InlineValueRequest=void 0;const Fne=Lr;var O7e;(function(s){s.method="textDocument/inlineValue",s.messageDirection=Fne.MessageDirection.clientToServer,s.type=new Fne.ProtocolRequestType(s.method)})(O7e||(gU.InlineValueRequest=O7e={}));var B7e;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=Fne.MessageDirection.serverToClient,s.type=new Fne.ProtocolRequestType0(s.method)})(B7e||(gU.InlineValueRefreshRequest=B7e={}));var OD={};Object.defineProperty(OD,"__esModule",{value:!0});OD.InlayHintRefreshRequest=OD.InlayHintResolveRequest=OD.InlayHintRequest=void 0;const fU=Lr;var W7e;(function(s){s.method="textDocument/inlayHint",s.messageDirection=fU.MessageDirection.clientToServer,s.type=new fU.ProtocolRequestType(s.method)})(W7e||(OD.InlayHintRequest=W7e={}));var H7e;(function(s){s.method="inlayHint/resolve",s.messageDirection=fU.MessageDirection.clientToServer,s.type=new fU.ProtocolRequestType(s.method)})(H7e||(OD.InlayHintResolveRequest=H7e={}));var U7e;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=fU.MessageDirection.serverToClient,s.type=new fU.ProtocolRequestType0(s.method)})(U7e||(OD.InlayHintRefreshRequest=U7e={}));var y_={};Object.defineProperty(y_,"__esModule",{value:!0});y_.DiagnosticRefreshRequest=y_.WorkspaceDiagnosticRequest=y_.DocumentDiagnosticRequest=y_.DocumentDiagnosticReportKind=y_.DiagnosticServerCancellationData=void 0;const eat=nP,Bri=ol,pU=Lr;var V7e;(function(s){function e(t){const i=t;return i&&Bri.boolean(i.retriggerRequest)}s.is=e})(V7e||(y_.DiagnosticServerCancellationData=V7e={}));var z7e;(function(s){s.Full="full",s.Unchanged="unchanged"})(z7e||(y_.DocumentDiagnosticReportKind=z7e={}));var $7e;(function(s){s.method="textDocument/diagnostic",s.messageDirection=pU.MessageDirection.clientToServer,s.type=new pU.ProtocolRequestType(s.method),s.partialResult=new eat.ProgressType})($7e||(y_.DocumentDiagnosticRequest=$7e={}));var G7e;(function(s){s.method="workspace/diagnostic",s.messageDirection=pU.MessageDirection.clientToServer,s.type=new pU.ProtocolRequestType(s.method),s.partialResult=new eat.ProgressType})(G7e||(y_.WorkspaceDiagnosticRequest=G7e={}));var K7e;(function(s){s.method="workspace/diagnostic/refresh",s.messageDirection=pU.MessageDirection.serverToClient,s.type=new pU.ProtocolRequestType0(s.method)})(K7e||(y_.DiagnosticRefreshRequest=K7e={}));var rl={};Object.defineProperty(rl,"__esModule",{value:!0});rl.DidCloseNotebookDocumentNotification=rl.DidSaveNotebookDocumentNotification=rl.DidChangeNotebookDocumentNotification=rl.NotebookCellArrayChange=rl.DidOpenNotebookDocumentNotification=rl.NotebookDocumentSyncRegistrationType=rl.NotebookDocument=rl.NotebookCell=rl.ExecutionSummary=rl.NotebookCellKind=void 0;const w7=vFe,Eb=ol,pC=Lr;var U1e;(function(s){s.Markup=1,s.Code=2;function e(t){return t===1||t===2}s.is=e})(U1e||(rl.NotebookCellKind=U1e={}));var V1e;(function(s){function e(n,r){const o={executionOrder:n};return(r===!0||r===!1)&&(o.success=r),o}s.create=e;function t(n){const r=n;return Eb.objectLiteral(r)&&w7.uinteger.is(r.executionOrder)&&(r.success===void 0||Eb.boolean(r.success))}s.is=t;function i(n,r){return n===r?!0:n==null||r===null||r===void 0?!1:n.executionOrder===r.executionOrder&&n.success===r.success}s.equals=i})(V1e||(rl.ExecutionSummary=V1e={}));var One;(function(s){function e(r,o){return{kind:r,document:o}}s.create=e;function t(r){const o=r;return Eb.objectLiteral(o)&&U1e.is(o.kind)&&w7.DocumentUri.is(o.document)&&(o.metadata===void 0||Eb.objectLiteral(o.metadata))}s.is=t;function i(r,o){const a=new Set;return r.document!==o.document&&a.add("document"),r.kind!==o.kind&&a.add("kind"),r.executionSummary!==o.executionSummary&&a.add("executionSummary"),(r.metadata!==void 0||o.metadata!==void 0)&&!n(r.metadata,o.metadata)&&a.add("metadata"),(r.executionSummary!==void 0||o.executionSummary!==void 0)&&!V1e.equals(r.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}s.diff=i;function n(r,o){if(r===o)return!0;if(r==null||o===null||o===void 0||typeof r!=typeof o||typeof r!="object")return!1;const a=Array.isArray(r),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(r.length!==o.length)return!1;for(let l=0;l0}le.hasId=ho})(Ct||(s.StaticRegistrationOptions=Ct={}));var Ne;(function(le){function ho(nr){const gn=nr;return gn&&(gn.documentSelector===null||Y.is(gn.documentSelector))}le.is=ho})(Ne||(s.TextDocumentRegistrationOptions=Ne={}));var dt;(function(le){function ho(gn){const Se=gn;return i.objectLiteral(Se)&&(Se.workDoneProgress===void 0||i.boolean(Se.workDoneProgress))}le.is=ho;function nr(gn){const Se=gn;return Se&&i.boolean(Se.workDoneProgress)}le.hasWorkDoneProgress=nr})(dt||(s.WorkDoneProgressOptions=dt={}));var Dt;(function(le){le.method="initialize",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Dt||(s.InitializeRequest=Dt={}));var Xi;(function(le){le.unknownProtocolVersion=1})(Xi||(s.InitializeErrorCodes=Xi={}));var Ti;(function(le){le.method="initialized",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Ti||(s.InitializedNotification=Ti={}));var ss;(function(le){le.method="shutdown",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType0(le.method)})(ss||(s.ShutdownRequest=ss={}));var $s;(function(le){le.method="exit",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType0(le.method)})($s||(s.ExitNotification=$s={}));var Fn;(function(le){le.method="workspace/didChangeConfiguration",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Fn||(s.DidChangeConfigurationNotification=Fn={}));var Zo;(function(le){le.Error=1,le.Warning=2,le.Info=3,le.Log=4,le.Debug=5})(Zo||(s.MessageType=Zo={}));var hs;(function(le){le.method="window/showMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(hs||(s.ShowMessageNotification=hs={}));var Zr;(function(le){le.method="window/showMessageRequest",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType(le.method)})(Zr||(s.ShowMessageRequest=Zr={}));var ea;(function(le){le.method="window/logMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ea||(s.LogMessageNotification=ea={}));var ki;(function(le){le.method="telemetry/event",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ki||(s.TelemetryEventNotification=ki={}));var rs;(function(le){le.None=0,le.Full=1,le.Incremental=2})(rs||(s.TextDocumentSyncKind=rs={}));var Or;(function(le){le.method="textDocument/didOpen",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Or||(s.DidOpenTextDocumentNotification=Or={}));var Ln;(function(le){function ho(gn){let Se=gn;return Se!=null&&typeof Se.text=="string"&&Se.range!==void 0&&(Se.rangeLength===void 0||typeof Se.rangeLength=="number")}le.isIncremental=ho;function nr(gn){let Se=gn;return Se!=null&&typeof Se.text=="string"&&Se.range===void 0&&Se.rangeLength===void 0}le.isFull=nr})(Ln||(s.TextDocumentContentChangeEvent=Ln={}));var Wa;(function(le){le.method="textDocument/didChange",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Wa||(s.DidChangeTextDocumentNotification=Wa={}));var wd;(function(le){le.method="textDocument/didClose",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(wd||(s.DidCloseTextDocumentNotification=wd={}));var On;(function(le){le.method="textDocument/didSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(On||(s.DidSaveTextDocumentNotification=On={}));var nh;(function(le){le.Manual=1,le.AfterDelay=2,le.FocusOut=3})(nh||(s.TextDocumentSaveReason=nh={}));var mc;(function(le){le.method="textDocument/willSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(mc||(s.WillSaveTextDocumentNotification=mc={}));var $c;(function(le){le.method="textDocument/willSaveWaitUntil",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})($c||(s.WillSaveTextDocumentWaitUntilRequest=$c={}));var Gs;(function(le){le.method="workspace/didChangeWatchedFiles",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Gs||(s.DidChangeWatchedFilesNotification=Gs={}));var ic;(function(le){le.Created=1,le.Changed=2,le.Deleted=3})(ic||(s.FileChangeType=ic={}));var pl;(function(le){function ho(nr){const gn=nr;return i.objectLiteral(gn)&&(t.URI.is(gn.baseUri)||t.WorkspaceFolder.is(gn.baseUri))&&i.string(gn.pattern)}le.is=ho})(pl||(s.RelativePattern=pl={}));var sh;(function(le){le.Create=1,le.Change=2,le.Delete=4})(sh||(s.WatchKind=sh={}));var mg;(function(le){le.method="textDocument/publishDiagnostics",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(mg||(s.PublishDiagnosticsNotification=mg={}));var _c;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.TriggerForIncompleteCompletions=3})(_c||(s.CompletionTriggerKind=_c={}));var Gc;(function(le){le.method="textDocument/completion",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Gc||(s.CompletionRequest=Gc={}));var rh;(function(le){le.method="completionItem/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(rh||(s.CompletionResolveRequest=rh={}));var kc;(function(le){le.method="textDocument/hover",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(kc||(s.HoverRequest=kc={}));var ml;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.ContentChange=3})(ml||(s.SignatureHelpTriggerKind=ml={}));var nc;(function(le){le.method="textDocument/signatureHelp",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(nc||(s.SignatureHelpRequest=nc={}));var Bo;(function(le){le.method="textDocument/definition",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Bo||(s.DefinitionRequest=Bo={}));var _l;(function(le){le.method="textDocument/references",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(_l||(s.ReferencesRequest=_l={}));var oh;(function(le){le.method="textDocument/documentHighlight",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(oh||(s.DocumentHighlightRequest=oh={}));var ah;(function(le){le.method="textDocument/documentSymbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ah||(s.DocumentSymbolRequest=ah={}));var Kc;(function(le){le.method="textDocument/codeAction",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Kc||(s.CodeActionRequest=Kc={}));var qc;(function(le){le.method="codeAction/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(qc||(s.CodeActionResolveRequest=qc={}));var Ha;(function(le){le.method="workspace/symbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ha||(s.WorkspaceSymbolRequest=Ha={}));var Br;(function(le){le.method="workspaceSymbol/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Br||(s.WorkspaceSymbolResolveRequest=Br={}));var Ts;(function(le){le.method="textDocument/codeLens",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ts||(s.CodeLensRequest=Ts={}));var Ic;(function(le){le.method="codeLens/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ic||(s.CodeLensResolveRequest=Ic={}));var Fh;(function(le){le.method="workspace/codeLens/refresh",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType0(le.method)})(Fh||(s.CodeLensRefreshRequest=Fh={}));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 Ea;(function(le){le.method="documentLink/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ea||(s.DocumentLinkResolveRequest=Ea={}));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 ft;(function(le){le.method="textDocument/rangesFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ft||(s.DocumentRangesFormattingRequest=ft={}));var $n;(function(le){le.method="textDocument/onTypeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})($n||(s.DocumentOnTypeFormattingRequest=$n={}));var Ss;(function(le){le.Identifier=1})(Ss||(s.PrepareSupportDefaultBehavior=Ss={}));var Wr;(function(le){le.method="textDocument/rename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Wr||(s.RenameRequest=Wr={}));var Ua;(function(le){le.method="textDocument/prepareRename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ua||(s.PrepareRenameRequest=Ua={}));var ta;(function(le){le.method="workspace/executeCommand",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ta||(s.ExecuteCommandRequest=ta={}));var Oh;(function(le){le.method="workspace/applyEdit",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType("workspace/applyEdit")})(Oh||(s.ApplyWorkspaceEditRequest=Oh={}))})(Jot);var zle={};Object.defineProperty(zle,"__esModule",{value:!0});zle.createProtocolConnection=void 0;const t6e=nP;function Wri(s,e,t,i){return t6e.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,t6e.createMessageConnection)(s,e,t,i)}zle.createProtocolConnection=Wri;(function(s){var e=cd&&cd.__createBinding||(Object.create?function(r,o,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(o,a);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,c,l)}:function(r,o,a,c){c===void 0&&(c=a),r[c]=o[a]}),t=cd&&cd.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(s,"__esModule",{value:!0}),s.LSPErrorCodes=s.createProtocolConnection=void 0,t(nP,s),t(vFe,s),t(Lr,s),t(Jot,s);var i=zle;Object.defineProperty(s,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var n;(function(r){r.lspReservedErrorRangeStart=-32899,r.RequestFailed=-32803,r.ServerCancelled=-32802,r.ContentModified=-32801,r.RequestCancelled=-32800,r.lspReservedErrorRangeEnd=-32800})(n||(s.LSPErrorCodes=n={}))})(Yot);(function(s){var e=cd&&cd.__createBinding||(Object.create?function(r,o,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(o,a);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,c,l)}:function(r,o,a,c){c===void 0&&(c=a),r[c]=o[a]}),t=cd&&cd.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(s,"__esModule",{value:!0}),s.createProtocolConnection=void 0;const i=z$e;t(z$e,s),t(Yot,s);function n(r,o,a,c){return(0,i.createMessageConnection)(r,o,a,c)}s.createProtocolConnection=n})(ms);var Nn={};const Zn=Vot(gQt);var Io={};Object.defineProperty(Io,"__esModule",{value:!0});Io.asPromise=Io.thenable=Io.typedArray=Io.stringArray=Io.array=Io.func=Io.error=Io.number=Io.string=Io.boolean=void 0;function Hri(s){return s===!0||s===!1}Io.boolean=Hri;function tat(s){return typeof s=="string"||s instanceof String}Io.string=tat;function Uri(s){return typeof s=="number"||s instanceof Number}Io.number=Uri;function Vri(s){return s instanceof Error}Io.error=Vri;function iat(s){return typeof s=="function"}Io.func=iat;function nat(s){return Array.isArray(s)}Io.array=nat;function zri(s){return nat(s)&&s.every(e=>tat(e))}Io.stringArray=zri;function $ri(s,e){return Array.isArray(s)&&s.every(e)}Io.typedArray=$ri;function sat(s){return s&&iat(s.then)}Io.thenable=sat;function Gri(s){return s instanceof Promise?s:sat(s)?new Promise((e,t)=>{s.then(i=>e(i),i=>t(i))}):Promise.resolve(s)}Io.asPromise=Gri;var ro={};Object.defineProperty(ro,"__esModule",{value:!0});ro.generateUuid=ro.parse=ro.isUUID=ro.v4=ro.empty=void 0;class bFe{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class rr extends bFe{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return rr._oneOf(rr._chars)}constructor(){super([rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),"-",rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),"-","4",rr._randomHex(),rr._randomHex(),rr._randomHex(),"-",rr._oneOf(rr._timeHighBits),rr._randomHex(),rr._randomHex(),rr._randomHex(),"-",rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex()].join(""))}}rr._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];rr._timeHighBits=["8","9","a","b"];ro.empty=new bFe("00000000-0000-0000-0000-000000000000");function rat(){return new rr}ro.v4=rat;const Kri=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function oat(s){return Kri.test(s)}ro.isUUID=oat;function qri(s){if(!oat(s))throw new Error("invalid uuid");return new bFe(s)}ro.parse=qri;function Qri(){return rat().asHex()}ro.generateUuid=Qri;Object.defineProperty(Nn,"__esModule",{value:!0});Nn.WorkspaceFeature=Nn.TextDocumentLanguageFeature=Nn.TextDocumentEventFeature=Nn.DynamicDocumentFeature=Nn.DynamicFeature=Nn.StaticFeature=Nn.ensure=Nn.LSPCancellationError=void 0;const dL=Zn,kge=ms,$g=Io,i6e=ro;class jri extends dL.CancellationError{constructor(e){super(),this.data=e}}Nn.LSPCancellationError=jri;function Yri(s,e){return s[e]===void 0&&(s[e]={}),s[e]}Nn.ensure=Yri;var n6e;(function(s){function e(t){const i=t;return i!=null&&$g.func(i.fillClientCapabilities)&&$g.func(i.initialize)&&$g.func(i.getState)&&$g.func(i.clear)&&(i.fillInitializeParams===void 0||$g.func(i.fillInitializeParams))}s.is=e})(n6e||(Nn.StaticFeature=n6e={}));var s6e;(function(s){function e(t){const i=t;return i!=null&&$g.func(i.fillClientCapabilities)&&$g.func(i.initialize)&&$g.func(i.getState)&&$g.func(i.clear)&&(i.fillInitializeParams===void 0||$g.func(i.fillInitializeParams))&&$g.func(i.register)&&$g.func(i.unregister)&&i.registrationType!==void 0}s.is=e})(s6e||(Nn.DynamicFeature=s6e={}));class wFe{constructor(e){this._client=e}getState(){const e=this.getDocumentSelectors();let t=0;for(const n of e){t++;for(const r of dL.workspace.textDocuments)if(dL.languages.match(n,r)>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}}}Nn.DynamicDocumentFeature=wFe;class Jri extends wFe{static textDocumentFilter(e,t){for(const i of e)if(dL.languages.match(i,t)>0)return!0;return!1}constructor(e,t,i,n,r,o,a){super(e),this._event=t,this._type=i,this._middleware=n,this._createParams=r,this._textDocument=o,this._selectorFilter=a,this._selectors=new Map,this._onNotificationSent=new dL.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(dL.languages.match(t,e)>0)return{send:i=>this.callback(i)}}}Nn.TextDocumentEventFeature=Jri;class Xri extends wFe{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(kge.TextDocumentRegistrationOptions.is(t)){const i=kge.StaticRegistrationOptions.hasId(t)?t.id:i6e.generateUuid(),n=t.documentSelector??e;if(n)return[i,Object.assign({},t,{documentSelector:n})]}else if($g.boolean(t)&&t===!0||kge.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];const i=$g.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[i6e.generateUuid(),i]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return $g.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&&dL.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}}Nn.TextDocumentLanguageFeature=Xri;class Zri{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}}Nn.WorkspaceFeature=Zri;var SA={};const eoi=typeof process=="object"&&process&&process.platform==="win32";var toi=eoi?{sep:"\\"}:{sep:"/"},ioi=aat;function aat(s,e,t){s instanceof RegExp&&(s=r6e(s,t)),e instanceof RegExp&&(e=r6e(e,t));var i=cat(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 r6e(s,e){var t=e.match(s);return t?t[0]:null}aat.range=cat;function cat(s,e,t){var i,n,r,o,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=[],r=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=[r,o])}return a}var lat=ioi,noi=ooi,dat="\0SLASH"+Math.random()+"\0",hat="\0OPEN"+Math.random()+"\0",yFe="\0CLOSE"+Math.random()+"\0",uat="\0COMMA"+Math.random()+"\0",gat="\0PERIOD"+Math.random()+"\0";function Ige(s){return parseInt(s,10)==s?parseInt(s,10):s.charCodeAt(0)}function soi(s){return s.split("\\\\").join(dat).split("\\{").join(hat).split("\\}").join(yFe).split("\\,").join(uat).split("\\.").join(gat)}function roi(s){return s.split(dat).join("\\").split(hat).join("{").split(yFe).join("}").split(uat).join(",").split(gat).join(".")}function fat(s){if(!s)return[""];var e=[],t=lat("{","}",s);if(!t)return s.split(",");var i=t.pre,n=t.body,r=t.post,o=i.split(",");o[o.length-1]+="{"+n+"}";var a=fat(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function ooi(s){return s?(s.substr(0,2)==="{}"&&(s="\\{\\}"+s.substr(2)),XV(soi(s),!0).map(roi)):[]}function aoi(s){return"{"+s+"}"}function coi(s){return/^-?0\d/.test(s)}function loi(s,e){return s<=e}function doi(s,e){return s>=e}function XV(s,e){var t=[],i=lat("{","}",s);if(!i)return[s];var n=i.pre,r=i.post.length?XV(i.post,!1):[""];if(/\$$/.test(i.pre))for(var o=0;o=0;if(!d&&!h)return i.post.match(/,.*\}/)?(s=i.pre+"{"+i.body+yFe+i.post,XV(s)):[s];var u;if(d)u=i.body.split(/\.\./);else if(u=fat(i.body),u.length===1&&(u=XV(u[0],!1).map(aoi),u.length===1))return r.map(function(z){return i.pre+u[0]+z});var f;if(d){var p=Ige(u[0]),m=Ige(u[1]),v=Math.max(u[0].length,u[1].length),b=u.length==3?Math.abs(Ige(u[2])):1,w=loi,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(Bne(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Gle(e,t).match(s));var $le=hm;const z1e=toi;hm.sep=z1e.sep;const kv=Symbol("globstar **");hm.GLOBSTAR=kv;const hoi=noi,o6e={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},$1e="[^/]",Tge=$1e+"*?",uoi="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",goi="(?:(?!(?:\\/|^)\\.).)*?",pat=s=>s.split("").reduce((e,t)=>(e[t]=!0,e),{}),a6e=pat("().*{}+?[]^$\\!"),foi=pat("[.("),c6e=/\/+/;hm.filter=(s,e={})=>(t,i,n)=>hm(t,s,e);const CE=(s,e={})=>{const t={};return Object.keys(s).forEach(i=>t[i]=s[i]),Object.keys(e).forEach(i=>t[i]=e[i]),t};hm.defaults=s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return hm;const e=hm,t=(i,n,r)=>e(i,n,CE(s,r));return t.Minimatch=class extends e.Minimatch{constructor(n,r){super(n,CE(s,r))}},t.Minimatch.defaults=i=>e.defaults(CE(s,i)).Minimatch,t.filter=(i,n)=>e.filter(i,CE(s,n)),t.defaults=i=>e.defaults(CE(s,i)),t.makeRe=(i,n)=>e.makeRe(i,CE(s,n)),t.braceExpand=(i,n)=>e.braceExpand(i,CE(s,n)),t.match=(i,n,r)=>e.match(i,n,CE(s,r)),t};hm.braceExpand=(s,e)=>mat(s,e);const mat=(s,e={})=>(Bne(s),e.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:hoi(s)),poi=1024*64,Bne=s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>poi)throw new TypeError("pattern is too long")},Lge=Symbol("subparse");hm.makeRe=(s,e)=>new Gle(s,e||{}).makeRe();hm.match=(s,e,t={})=>{const i=new Gle(e,t);return s=s.filter(n=>i.match(n)),i.options.nonull&&!s.length&&s.push(e),s};const moi=s=>s.replace(/\\(.)/g,"$1"),_oi=s=>s.replace(/\\([^-\]])/g,"$1"),voi=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),boi=s=>s.replace(/[[\]\\]/g,"\\$&");class Gle{constructor(e,t){Bne(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(c6e)),this.debug(this.pattern,i),i=i.map((n,r,o)=>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;n0&&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 __.create(0,e);for(;ie?n=o:i=o+1}let r=i-1;return __.create(r,e-t[r])}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 r(f){return e.call(f)==="[object String]"}s.string=r;function o(f){return e.call(f)==="[object Number]"}s.number=o;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 Eri=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return iS},get ChangeAnnotation(){return lL},get ChangeAnnotationIdentifier(){return Yh},get CodeAction(){return w1e},get CodeActionContext(){return b1e},get CodeActionKind(){return v1e},get CodeActionTriggerKind(){return v7},get CodeDescription(){return Y0e},get CodeLens(){return y1e},get Color(){return xne},get ColorInformation(){return $0e},get ColorPresentation(){return G0e},get Command(){return AN},get CompletionItem(){return o1e},get CompletionItemKind(){return e1e},get CompletionItemLabelDetails(){return r1e},get CompletionItemTag(){return i1e},get CompletionList(){return a1e},get CreateFile(){return nU},get DeleteFile(){return rU},get Diagnostic(){return f7},get DiagnosticRelatedInformation(){return Dne},get DiagnosticSeverity(){return Q0e},get DiagnosticTag(){return j0e},get DocumentHighlight(){return u1e},get DocumentHighlightKind(){return h1e},get DocumentLink(){return S1e},get DocumentSymbol(){return _1e},get DocumentUri(){return U0e},EOL:Sri,get FoldingRange(){return q0e},get FoldingRangeKind(){return K0e},get FormattingOptions(){return C1e},get Hover(){return c1e},get InlayHint(){return R1e},get InlayHintKind(){return Tne},get InlayHintLabelPart(){return Lne},get InlineCompletionContext(){return B1e},get InlineCompletionItem(){return N1e},get InlineCompletionList(){return P1e},get InlineCompletionTriggerKind(){return F1e},get InlineValueContext(){return L1e},get InlineValueEvaluatableExpression(){return T1e},get InlineValueText(){return k1e},get InlineValueVariableLookup(){return I1e},get InsertReplaceEdit(){return n1e},get InsertTextFormat(){return t1e},get InsertTextMode(){return s1e},get Location(){return g7},get LocationLink(){return z0e},get MarkedString(){return _7},get MarkupContent(){return oU},get MarkupKind(){return Ine},get OptionalVersionedTextDocumentIdentifier(){return m7},get ParameterInformation(){return l1e},get Position(){return __},get Range(){return gl},get RenameFile(){return sU},get SelectedCompletionInfo(){return O1e},get SelectionRange(){return A1e},get SemanticTokenModifiers(){return x1e},get SemanticTokenTypes(){return E1e},get SemanticTokens(){return D1e},get SignatureInformation(){return d1e},get StringValue(){return M1e},get SymbolInformation(){return p1e},get SymbolKind(){return g1e},get SymbolTag(){return f1e},get TextDocument(){return H1e},get TextDocumentEdit(){return p7},get TextDocumentIdentifier(){return J0e},get TextDocumentItem(){return Z0e},get TextEdit(){return $y},get URI(){return Ene},get VersionedTextDocumentIdentifier(){return X0e},WorkspaceChange:Cri,get WorkspaceEdit(){return kne},get WorkspaceFolder(){return W1e},get WorkspaceSymbol(){return m1e},get integer(){return V0e},get uinteger(){return u7}},Symbol.toStringTag,{value:"Module"})),vFe=Vot(Eri);var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.ProtocolNotificationType=Lr.ProtocolNotificationType0=Lr.ProtocolRequestType=Lr.ProtocolRequestType0=Lr.RegistrationType=Lr.MessageDirection=void 0;const aU=nP;var G$e;(function(s){s.clientToServer="clientToServer",s.serverToClient="serverToClient",s.both="both"})(G$e||(Lr.MessageDirection=G$e={}));class xri{constructor(e){this.method=e}}Lr.RegistrationType=xri;class Dri extends aU.RequestType0{constructor(e){super(e)}}Lr.ProtocolRequestType0=Dri;class kri extends aU.RequestType{constructor(e){super(e,aU.ParameterStructures.byName)}}Lr.ProtocolRequestType=kri;class Iri extends aU.NotificationType0{constructor(e){super(e)}}Lr.ProtocolNotificationType0=Iri;class Tri extends aU.NotificationType{constructor(e){super(e,aU.ParameterStructures.byName)}}Lr.ProtocolNotificationType=Tri;var Jot={},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 Lri(s){return s===!0||s===!1}ol.boolean=Lri;function Xot(s){return typeof s=="string"||s instanceof String}ol.string=Xot;function Rri(s){return typeof s=="number"||s instanceof Number}ol.number=Rri;function Mri(s){return s instanceof Error}ol.error=Mri;function Nri(s){return typeof s=="function"}ol.func=Nri;function Zot(s){return Array.isArray(s)}ol.array=Zot;function Pri(s){return Zot(s)&&s.every(e=>Xot(e))}ol.stringArray=Pri;function Fri(s,e){return Array.isArray(s)&&s.every(e)}ol.typedArray=Fri;function Ori(s){return s!==null&&typeof s=="object"}ol.objectLiteral=Ori;var Ple={};Object.defineProperty(Ple,"__esModule",{value:!0});Ple.ImplementationRequest=void 0;const K$e=Lr;var q$e;(function(s){s.method="textDocument/implementation",s.messageDirection=K$e.MessageDirection.clientToServer,s.type=new K$e.ProtocolRequestType(s.method)})(q$e||(Ple.ImplementationRequest=q$e={}));var Fle={};Object.defineProperty(Fle,"__esModule",{value:!0});Fle.TypeDefinitionRequest=void 0;const Q$e=Lr;var j$e;(function(s){s.method="textDocument/typeDefinition",s.messageDirection=Q$e.MessageDirection.clientToServer,s.type=new Q$e.ProtocolRequestType(s.method)})(j$e||(Fle.TypeDefinitionRequest=j$e={}));var cU={};Object.defineProperty(cU,"__esModule",{value:!0});cU.DidChangeWorkspaceFoldersNotification=cU.WorkspaceFoldersRequest=void 0;const Rne=Lr;var Y$e;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=Rne.MessageDirection.serverToClient,s.type=new Rne.ProtocolRequestType0(s.method)})(Y$e||(cU.WorkspaceFoldersRequest=Y$e={}));var J$e;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=Rne.MessageDirection.clientToServer,s.type=new Rne.ProtocolNotificationType(s.method)})(J$e||(cU.DidChangeWorkspaceFoldersNotification=J$e={}));var Ole={};Object.defineProperty(Ole,"__esModule",{value:!0});Ole.ConfigurationRequest=void 0;const X$e=Lr;var Z$e;(function(s){s.method="workspace/configuration",s.messageDirection=X$e.MessageDirection.serverToClient,s.type=new X$e.ProtocolRequestType(s.method)})(Z$e||(Ole.ConfigurationRequest=Z$e={}));var lU={};Object.defineProperty(lU,"__esModule",{value:!0});lU.ColorPresentationRequest=lU.DocumentColorRequest=void 0;const Mne=Lr;var e7e;(function(s){s.method="textDocument/documentColor",s.messageDirection=Mne.MessageDirection.clientToServer,s.type=new Mne.ProtocolRequestType(s.method)})(e7e||(lU.DocumentColorRequest=e7e={}));var t7e;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=Mne.MessageDirection.clientToServer,s.type=new Mne.ProtocolRequestType(s.method)})(t7e||(lU.ColorPresentationRequest=t7e={}));var dU={};Object.defineProperty(dU,"__esModule",{value:!0});dU.FoldingRangeRefreshRequest=dU.FoldingRangeRequest=void 0;const Nne=Lr;var i7e;(function(s){s.method="textDocument/foldingRange",s.messageDirection=Nne.MessageDirection.clientToServer,s.type=new Nne.ProtocolRequestType(s.method)})(i7e||(dU.FoldingRangeRequest=i7e={}));var n7e;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=Nne.MessageDirection.serverToClient,s.type=new Nne.ProtocolRequestType0(s.method)})(n7e||(dU.FoldingRangeRefreshRequest=n7e={}));var Ble={};Object.defineProperty(Ble,"__esModule",{value:!0});Ble.DeclarationRequest=void 0;const s7e=Lr;var r7e;(function(s){s.method="textDocument/declaration",s.messageDirection=s7e.MessageDirection.clientToServer,s.type=new s7e.ProtocolRequestType(s.method)})(r7e||(Ble.DeclarationRequest=r7e={}));var Wle={};Object.defineProperty(Wle,"__esModule",{value:!0});Wle.SelectionRangeRequest=void 0;const o7e=Lr;var a7e;(function(s){s.method="textDocument/selectionRange",s.messageDirection=o7e.MessageDirection.clientToServer,s.type=new o7e.ProtocolRequestType(s.method)})(a7e||(Wle.SelectionRangeRequest=a7e={}));var MD={};Object.defineProperty(MD,"__esModule",{value:!0});MD.WorkDoneProgressCancelNotification=MD.WorkDoneProgressCreateRequest=MD.WorkDoneProgress=void 0;const Bri=nP,Pne=Lr;var c7e;(function(s){s.type=new Bri.ProgressType;function e(t){return t===s.type}s.is=e})(c7e||(MD.WorkDoneProgress=c7e={}));var l7e;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=Pne.MessageDirection.serverToClient,s.type=new Pne.ProtocolRequestType(s.method)})(l7e||(MD.WorkDoneProgressCreateRequest=l7e={}));var d7e;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=Pne.MessageDirection.clientToServer,s.type=new Pne.ProtocolNotificationType(s.method)})(d7e||(MD.WorkDoneProgressCancelNotification=d7e={}));var ND={};Object.defineProperty(ND,"__esModule",{value:!0});ND.CallHierarchyOutgoingCallsRequest=ND.CallHierarchyIncomingCallsRequest=ND.CallHierarchyPrepareRequest=void 0;const hU=Lr;var h7e;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=hU.MessageDirection.clientToServer,s.type=new hU.ProtocolRequestType(s.method)})(h7e||(ND.CallHierarchyPrepareRequest=h7e={}));var u7e;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=hU.MessageDirection.clientToServer,s.type=new hU.ProtocolRequestType(s.method)})(u7e||(ND.CallHierarchyIncomingCallsRequest=u7e={}));var g7e;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=hU.MessageDirection.clientToServer,s.type=new hU.ProtocolRequestType(s.method)})(g7e||(ND.CallHierarchyOutgoingCallsRequest=g7e={}));var jf={};Object.defineProperty(jf,"__esModule",{value:!0});jf.SemanticTokensRefreshRequest=jf.SemanticTokensRangeRequest=jf.SemanticTokensDeltaRequest=jf.SemanticTokensRequest=jf.SemanticTokensRegistrationType=jf.TokenFormat=void 0;const XA=Lr;var f7e;(function(s){s.Relative="relative"})(f7e||(jf.TokenFormat=f7e={}));var b7;(function(s){s.method="textDocument/semanticTokens",s.type=new XA.RegistrationType(s.method)})(b7||(jf.SemanticTokensRegistrationType=b7={}));var p7e;(function(s){s.method="textDocument/semanticTokens/full",s.messageDirection=XA.MessageDirection.clientToServer,s.type=new XA.ProtocolRequestType(s.method),s.registrationMethod=b7.method})(p7e||(jf.SemanticTokensRequest=p7e={}));var m7e;(function(s){s.method="textDocument/semanticTokens/full/delta",s.messageDirection=XA.MessageDirection.clientToServer,s.type=new XA.ProtocolRequestType(s.method),s.registrationMethod=b7.method})(m7e||(jf.SemanticTokensDeltaRequest=m7e={}));var _7e;(function(s){s.method="textDocument/semanticTokens/range",s.messageDirection=XA.MessageDirection.clientToServer,s.type=new XA.ProtocolRequestType(s.method),s.registrationMethod=b7.method})(_7e||(jf.SemanticTokensRangeRequest=_7e={}));var v7e;(function(s){s.method="workspace/semanticTokens/refresh",s.messageDirection=XA.MessageDirection.serverToClient,s.type=new XA.ProtocolRequestType0(s.method)})(v7e||(jf.SemanticTokensRefreshRequest=v7e={}));var Hle={};Object.defineProperty(Hle,"__esModule",{value:!0});Hle.ShowDocumentRequest=void 0;const b7e=Lr;var w7e;(function(s){s.method="window/showDocument",s.messageDirection=b7e.MessageDirection.serverToClient,s.type=new b7e.ProtocolRequestType(s.method)})(w7e||(Hle.ShowDocumentRequest=w7e={}));var Ule={};Object.defineProperty(Ule,"__esModule",{value:!0});Ule.LinkedEditingRangeRequest=void 0;const y7e=Lr;var C7e;(function(s){s.method="textDocument/linkedEditingRange",s.messageDirection=y7e.MessageDirection.clientToServer,s.type=new y7e.ProtocolRequestType(s.method)})(C7e||(Ule.LinkedEditingRangeRequest=C7e={}));var Uu={};Object.defineProperty(Uu,"__esModule",{value:!0});Uu.WillDeleteFilesRequest=Uu.DidDeleteFilesNotification=Uu.DidRenameFilesNotification=Uu.WillRenameFilesRequest=Uu.DidCreateFilesNotification=Uu.WillCreateFilesRequest=Uu.FileOperationPatternKind=void 0;const av=Lr;var S7e;(function(s){s.file="file",s.folder="folder"})(S7e||(Uu.FileOperationPatternKind=S7e={}));var A7e;(function(s){s.method="workspace/willCreateFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolRequestType(s.method)})(A7e||(Uu.WillCreateFilesRequest=A7e={}));var E7e;(function(s){s.method="workspace/didCreateFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolNotificationType(s.method)})(E7e||(Uu.DidCreateFilesNotification=E7e={}));var x7e;(function(s){s.method="workspace/willRenameFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolRequestType(s.method)})(x7e||(Uu.WillRenameFilesRequest=x7e={}));var D7e;(function(s){s.method="workspace/didRenameFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolNotificationType(s.method)})(D7e||(Uu.DidRenameFilesNotification=D7e={}));var k7e;(function(s){s.method="workspace/didDeleteFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolNotificationType(s.method)})(k7e||(Uu.DidDeleteFilesNotification=k7e={}));var I7e;(function(s){s.method="workspace/willDeleteFiles",s.messageDirection=av.MessageDirection.clientToServer,s.type=new av.ProtocolRequestType(s.method)})(I7e||(Uu.WillDeleteFilesRequest=I7e={}));var PD={};Object.defineProperty(PD,"__esModule",{value:!0});PD.MonikerRequest=PD.MonikerKind=PD.UniquenessLevel=void 0;const T7e=Lr;var L7e;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(L7e||(PD.UniquenessLevel=L7e={}));var R7e;(function(s){s.$import="import",s.$export="export",s.local="local"})(R7e||(PD.MonikerKind=R7e={}));var M7e;(function(s){s.method="textDocument/moniker",s.messageDirection=T7e.MessageDirection.clientToServer,s.type=new T7e.ProtocolRequestType(s.method)})(M7e||(PD.MonikerRequest=M7e={}));var FD={};Object.defineProperty(FD,"__esModule",{value:!0});FD.TypeHierarchySubtypesRequest=FD.TypeHierarchySupertypesRequest=FD.TypeHierarchyPrepareRequest=void 0;const uU=Lr;var N7e;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=uU.MessageDirection.clientToServer,s.type=new uU.ProtocolRequestType(s.method)})(N7e||(FD.TypeHierarchyPrepareRequest=N7e={}));var P7e;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=uU.MessageDirection.clientToServer,s.type=new uU.ProtocolRequestType(s.method)})(P7e||(FD.TypeHierarchySupertypesRequest=P7e={}));var F7e;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=uU.MessageDirection.clientToServer,s.type=new uU.ProtocolRequestType(s.method)})(F7e||(FD.TypeHierarchySubtypesRequest=F7e={}));var gU={};Object.defineProperty(gU,"__esModule",{value:!0});gU.InlineValueRefreshRequest=gU.InlineValueRequest=void 0;const Fne=Lr;var O7e;(function(s){s.method="textDocument/inlineValue",s.messageDirection=Fne.MessageDirection.clientToServer,s.type=new Fne.ProtocolRequestType(s.method)})(O7e||(gU.InlineValueRequest=O7e={}));var B7e;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=Fne.MessageDirection.serverToClient,s.type=new Fne.ProtocolRequestType0(s.method)})(B7e||(gU.InlineValueRefreshRequest=B7e={}));var OD={};Object.defineProperty(OD,"__esModule",{value:!0});OD.InlayHintRefreshRequest=OD.InlayHintResolveRequest=OD.InlayHintRequest=void 0;const fU=Lr;var W7e;(function(s){s.method="textDocument/inlayHint",s.messageDirection=fU.MessageDirection.clientToServer,s.type=new fU.ProtocolRequestType(s.method)})(W7e||(OD.InlayHintRequest=W7e={}));var H7e;(function(s){s.method="inlayHint/resolve",s.messageDirection=fU.MessageDirection.clientToServer,s.type=new fU.ProtocolRequestType(s.method)})(H7e||(OD.InlayHintResolveRequest=H7e={}));var U7e;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=fU.MessageDirection.serverToClient,s.type=new fU.ProtocolRequestType0(s.method)})(U7e||(OD.InlayHintRefreshRequest=U7e={}));var y_={};Object.defineProperty(y_,"__esModule",{value:!0});y_.DiagnosticRefreshRequest=y_.WorkspaceDiagnosticRequest=y_.DocumentDiagnosticRequest=y_.DocumentDiagnosticReportKind=y_.DiagnosticServerCancellationData=void 0;const eat=nP,Wri=ol,pU=Lr;var V7e;(function(s){function e(t){const i=t;return i&&Wri.boolean(i.retriggerRequest)}s.is=e})(V7e||(y_.DiagnosticServerCancellationData=V7e={}));var z7e;(function(s){s.Full="full",s.Unchanged="unchanged"})(z7e||(y_.DocumentDiagnosticReportKind=z7e={}));var $7e;(function(s){s.method="textDocument/diagnostic",s.messageDirection=pU.MessageDirection.clientToServer,s.type=new pU.ProtocolRequestType(s.method),s.partialResult=new eat.ProgressType})($7e||(y_.DocumentDiagnosticRequest=$7e={}));var G7e;(function(s){s.method="workspace/diagnostic",s.messageDirection=pU.MessageDirection.clientToServer,s.type=new pU.ProtocolRequestType(s.method),s.partialResult=new eat.ProgressType})(G7e||(y_.WorkspaceDiagnosticRequest=G7e={}));var K7e;(function(s){s.method="workspace/diagnostic/refresh",s.messageDirection=pU.MessageDirection.serverToClient,s.type=new pU.ProtocolRequestType0(s.method)})(K7e||(y_.DiagnosticRefreshRequest=K7e={}));var rl={};Object.defineProperty(rl,"__esModule",{value:!0});rl.DidCloseNotebookDocumentNotification=rl.DidSaveNotebookDocumentNotification=rl.DidChangeNotebookDocumentNotification=rl.NotebookCellArrayChange=rl.DidOpenNotebookDocumentNotification=rl.NotebookDocumentSyncRegistrationType=rl.NotebookDocument=rl.NotebookCell=rl.ExecutionSummary=rl.NotebookCellKind=void 0;const w7=vFe,Eb=ol,pC=Lr;var U1e;(function(s){s.Markup=1,s.Code=2;function e(t){return t===1||t===2}s.is=e})(U1e||(rl.NotebookCellKind=U1e={}));var V1e;(function(s){function e(n,r){const o={executionOrder:n};return(r===!0||r===!1)&&(o.success=r),o}s.create=e;function t(n){const r=n;return Eb.objectLiteral(r)&&w7.uinteger.is(r.executionOrder)&&(r.success===void 0||Eb.boolean(r.success))}s.is=t;function i(n,r){return n===r?!0:n==null||r===null||r===void 0?!1:n.executionOrder===r.executionOrder&&n.success===r.success}s.equals=i})(V1e||(rl.ExecutionSummary=V1e={}));var One;(function(s){function e(r,o){return{kind:r,document:o}}s.create=e;function t(r){const o=r;return Eb.objectLiteral(o)&&U1e.is(o.kind)&&w7.DocumentUri.is(o.document)&&(o.metadata===void 0||Eb.objectLiteral(o.metadata))}s.is=t;function i(r,o){const a=new Set;return r.document!==o.document&&a.add("document"),r.kind!==o.kind&&a.add("kind"),r.executionSummary!==o.executionSummary&&a.add("executionSummary"),(r.metadata!==void 0||o.metadata!==void 0)&&!n(r.metadata,o.metadata)&&a.add("metadata"),(r.executionSummary!==void 0||o.executionSummary!==void 0)&&!V1e.equals(r.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}s.diff=i;function n(r,o){if(r===o)return!0;if(r==null||o===null||o===void 0||typeof r!=typeof o||typeof r!="object")return!1;const a=Array.isArray(r),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(r.length!==o.length)return!1;for(let l=0;l0}le.hasId=ho})(Ct||(s.StaticRegistrationOptions=Ct={}));var Ne;(function(le){function ho(nr){const gn=nr;return gn&&(gn.documentSelector===null||Y.is(gn.documentSelector))}le.is=ho})(Ne||(s.TextDocumentRegistrationOptions=Ne={}));var dt;(function(le){function ho(gn){const Se=gn;return i.objectLiteral(Se)&&(Se.workDoneProgress===void 0||i.boolean(Se.workDoneProgress))}le.is=ho;function nr(gn){const Se=gn;return Se&&i.boolean(Se.workDoneProgress)}le.hasWorkDoneProgress=nr})(dt||(s.WorkDoneProgressOptions=dt={}));var Dt;(function(le){le.method="initialize",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Dt||(s.InitializeRequest=Dt={}));var Xi;(function(le){le.unknownProtocolVersion=1})(Xi||(s.InitializeErrorCodes=Xi={}));var Ti;(function(le){le.method="initialized",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Ti||(s.InitializedNotification=Ti={}));var ss;(function(le){le.method="shutdown",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType0(le.method)})(ss||(s.ShutdownRequest=ss={}));var $s;(function(le){le.method="exit",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType0(le.method)})($s||(s.ExitNotification=$s={}));var Fn;(function(le){le.method="workspace/didChangeConfiguration",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Fn||(s.DidChangeConfigurationNotification=Fn={}));var Zo;(function(le){le.Error=1,le.Warning=2,le.Info=3,le.Log=4,le.Debug=5})(Zo||(s.MessageType=Zo={}));var hs;(function(le){le.method="window/showMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(hs||(s.ShowMessageNotification=hs={}));var Zr;(function(le){le.method="window/showMessageRequest",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType(le.method)})(Zr||(s.ShowMessageRequest=Zr={}));var ea;(function(le){le.method="window/logMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ea||(s.LogMessageNotification=ea={}));var ki;(function(le){le.method="telemetry/event",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ki||(s.TelemetryEventNotification=ki={}));var rs;(function(le){le.None=0,le.Full=1,le.Incremental=2})(rs||(s.TextDocumentSyncKind=rs={}));var Or;(function(le){le.method="textDocument/didOpen",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Or||(s.DidOpenTextDocumentNotification=Or={}));var Ln;(function(le){function ho(gn){let Se=gn;return Se!=null&&typeof Se.text=="string"&&Se.range!==void 0&&(Se.rangeLength===void 0||typeof Se.rangeLength=="number")}le.isIncremental=ho;function nr(gn){let Se=gn;return Se!=null&&typeof Se.text=="string"&&Se.range===void 0&&Se.rangeLength===void 0}le.isFull=nr})(Ln||(s.TextDocumentContentChangeEvent=Ln={}));var Ha;(function(le){le.method="textDocument/didChange",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Ha||(s.DidChangeTextDocumentNotification=Ha={}));var wd;(function(le){le.method="textDocument/didClose",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(wd||(s.DidCloseTextDocumentNotification=wd={}));var On;(function(le){le.method="textDocument/didSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(On||(s.DidSaveTextDocumentNotification=On={}));var nh;(function(le){le.Manual=1,le.AfterDelay=2,le.FocusOut=3})(nh||(s.TextDocumentSaveReason=nh={}));var mc;(function(le){le.method="textDocument/willSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(mc||(s.WillSaveTextDocumentNotification=mc={}));var $c;(function(le){le.method="textDocument/willSaveWaitUntil",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})($c||(s.WillSaveTextDocumentWaitUntilRequest=$c={}));var Gs;(function(le){le.method="workspace/didChangeWatchedFiles",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Gs||(s.DidChangeWatchedFilesNotification=Gs={}));var ic;(function(le){le.Created=1,le.Changed=2,le.Deleted=3})(ic||(s.FileChangeType=ic={}));var pl;(function(le){function ho(nr){const gn=nr;return i.objectLiteral(gn)&&(t.URI.is(gn.baseUri)||t.WorkspaceFolder.is(gn.baseUri))&&i.string(gn.pattern)}le.is=ho})(pl||(s.RelativePattern=pl={}));var sh;(function(le){le.Create=1,le.Change=2,le.Delete=4})(sh||(s.WatchKind=sh={}));var mg;(function(le){le.method="textDocument/publishDiagnostics",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(mg||(s.PublishDiagnosticsNotification=mg={}));var _c;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.TriggerForIncompleteCompletions=3})(_c||(s.CompletionTriggerKind=_c={}));var Gc;(function(le){le.method="textDocument/completion",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Gc||(s.CompletionRequest=Gc={}));var rh;(function(le){le.method="completionItem/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(rh||(s.CompletionResolveRequest=rh={}));var kc;(function(le){le.method="textDocument/hover",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(kc||(s.HoverRequest=kc={}));var ml;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.ContentChange=3})(ml||(s.SignatureHelpTriggerKind=ml={}));var nc;(function(le){le.method="textDocument/signatureHelp",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(nc||(s.SignatureHelpRequest=nc={}));var Bo;(function(le){le.method="textDocument/definition",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Bo||(s.DefinitionRequest=Bo={}));var _l;(function(le){le.method="textDocument/references",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(_l||(s.ReferencesRequest=_l={}));var oh;(function(le){le.method="textDocument/documentHighlight",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(oh||(s.DocumentHighlightRequest=oh={}));var ah;(function(le){le.method="textDocument/documentSymbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ah||(s.DocumentSymbolRequest=ah={}));var Kc;(function(le){le.method="textDocument/codeAction",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Kc||(s.CodeActionRequest=Kc={}));var qc;(function(le){le.method="codeAction/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(qc||(s.CodeActionResolveRequest=qc={}));var Ua;(function(le){le.method="workspace/symbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ua||(s.WorkspaceSymbolRequest=Ua={}));var Br;(function(le){le.method="workspaceSymbol/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Br||(s.WorkspaceSymbolResolveRequest=Br={}));var Ts;(function(le){le.method="textDocument/codeLens",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ts||(s.CodeLensRequest=Ts={}));var Ic;(function(le){le.method="codeLens/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ic||(s.CodeLensResolveRequest=Ic={}));var Fh;(function(le){le.method="workspace/codeLens/refresh",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType0(le.method)})(Fh||(s.CodeLensRefreshRequest=Fh={}));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 Ea;(function(le){le.method="documentLink/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ea||(s.DocumentLinkResolveRequest=Ea={}));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 ft;(function(le){le.method="textDocument/rangesFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ft||(s.DocumentRangesFormattingRequest=ft={}));var $n;(function(le){le.method="textDocument/onTypeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})($n||(s.DocumentOnTypeFormattingRequest=$n={}));var Ss;(function(le){le.Identifier=1})(Ss||(s.PrepareSupportDefaultBehavior=Ss={}));var Wr;(function(le){le.method="textDocument/rename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Wr||(s.RenameRequest=Wr={}));var Va;(function(le){le.method="textDocument/prepareRename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Va||(s.PrepareRenameRequest=Va={}));var ta;(function(le){le.method="workspace/executeCommand",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ta||(s.ExecuteCommandRequest=ta={}));var Oh;(function(le){le.method="workspace/applyEdit",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType("workspace/applyEdit")})(Oh||(s.ApplyWorkspaceEditRequest=Oh={}))})(Jot);var zle={};Object.defineProperty(zle,"__esModule",{value:!0});zle.createProtocolConnection=void 0;const t6e=nP;function Hri(s,e,t,i){return t6e.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,t6e.createMessageConnection)(s,e,t,i)}zle.createProtocolConnection=Hri;(function(s){var e=cd&&cd.__createBinding||(Object.create?function(r,o,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(o,a);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,c,l)}:function(r,o,a,c){c===void 0&&(c=a),r[c]=o[a]}),t=cd&&cd.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(s,"__esModule",{value:!0}),s.LSPErrorCodes=s.createProtocolConnection=void 0,t(nP,s),t(vFe,s),t(Lr,s),t(Jot,s);var i=zle;Object.defineProperty(s,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var n;(function(r){r.lspReservedErrorRangeStart=-32899,r.RequestFailed=-32803,r.ServerCancelled=-32802,r.ContentModified=-32801,r.RequestCancelled=-32800,r.lspReservedErrorRangeEnd=-32800})(n||(s.LSPErrorCodes=n={}))})(Yot);(function(s){var e=cd&&cd.__createBinding||(Object.create?function(r,o,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(o,a);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,c,l)}:function(r,o,a,c){c===void 0&&(c=a),r[c]=o[a]}),t=cd&&cd.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(s,"__esModule",{value:!0}),s.createProtocolConnection=void 0;const i=z$e;t(z$e,s),t(Yot,s);function n(r,o,a,c){return(0,i.createMessageConnection)(r,o,a,c)}s.createProtocolConnection=n})(ms);var Nn={};const Zn=Vot(gQt);var Io={};Object.defineProperty(Io,"__esModule",{value:!0});Io.asPromise=Io.thenable=Io.typedArray=Io.stringArray=Io.array=Io.func=Io.error=Io.number=Io.string=Io.boolean=void 0;function Uri(s){return s===!0||s===!1}Io.boolean=Uri;function tat(s){return typeof s=="string"||s instanceof String}Io.string=tat;function Vri(s){return typeof s=="number"||s instanceof Number}Io.number=Vri;function zri(s){return s instanceof Error}Io.error=zri;function iat(s){return typeof s=="function"}Io.func=iat;function nat(s){return Array.isArray(s)}Io.array=nat;function $ri(s){return nat(s)&&s.every(e=>tat(e))}Io.stringArray=$ri;function Gri(s,e){return Array.isArray(s)&&s.every(e)}Io.typedArray=Gri;function sat(s){return s&&iat(s.then)}Io.thenable=sat;function Kri(s){return s instanceof Promise?s:sat(s)?new Promise((e,t)=>{s.then(i=>e(i),i=>t(i))}):Promise.resolve(s)}Io.asPromise=Kri;var ro={};Object.defineProperty(ro,"__esModule",{value:!0});ro.generateUuid=ro.parse=ro.isUUID=ro.v4=ro.empty=void 0;class bFe{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class rr extends bFe{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return rr._oneOf(rr._chars)}constructor(){super([rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),"-",rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),"-","4",rr._randomHex(),rr._randomHex(),rr._randomHex(),"-",rr._oneOf(rr._timeHighBits),rr._randomHex(),rr._randomHex(),rr._randomHex(),"-",rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex(),rr._randomHex()].join(""))}}rr._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];rr._timeHighBits=["8","9","a","b"];ro.empty=new bFe("00000000-0000-0000-0000-000000000000");function rat(){return new rr}ro.v4=rat;const qri=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function oat(s){return qri.test(s)}ro.isUUID=oat;function Qri(s){if(!oat(s))throw new Error("invalid uuid");return new bFe(s)}ro.parse=Qri;function jri(){return rat().asHex()}ro.generateUuid=jri;Object.defineProperty(Nn,"__esModule",{value:!0});Nn.WorkspaceFeature=Nn.TextDocumentLanguageFeature=Nn.TextDocumentEventFeature=Nn.DynamicDocumentFeature=Nn.DynamicFeature=Nn.StaticFeature=Nn.ensure=Nn.LSPCancellationError=void 0;const dL=Zn,kge=ms,$g=Io,i6e=ro;class Yri extends dL.CancellationError{constructor(e){super(),this.data=e}}Nn.LSPCancellationError=Yri;function Jri(s,e){return s[e]===void 0&&(s[e]={}),s[e]}Nn.ensure=Jri;var n6e;(function(s){function e(t){const i=t;return i!=null&&$g.func(i.fillClientCapabilities)&&$g.func(i.initialize)&&$g.func(i.getState)&&$g.func(i.clear)&&(i.fillInitializeParams===void 0||$g.func(i.fillInitializeParams))}s.is=e})(n6e||(Nn.StaticFeature=n6e={}));var s6e;(function(s){function e(t){const i=t;return i!=null&&$g.func(i.fillClientCapabilities)&&$g.func(i.initialize)&&$g.func(i.getState)&&$g.func(i.clear)&&(i.fillInitializeParams===void 0||$g.func(i.fillInitializeParams))&&$g.func(i.register)&&$g.func(i.unregister)&&i.registrationType!==void 0}s.is=e})(s6e||(Nn.DynamicFeature=s6e={}));class wFe{constructor(e){this._client=e}getState(){const e=this.getDocumentSelectors();let t=0;for(const n of e){t++;for(const r of dL.workspace.textDocuments)if(dL.languages.match(n,r)>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}}}Nn.DynamicDocumentFeature=wFe;class Xri extends wFe{static textDocumentFilter(e,t){for(const i of e)if(dL.languages.match(i,t)>0)return!0;return!1}constructor(e,t,i,n,r,o,a){super(e),this._event=t,this._type=i,this._middleware=n,this._createParams=r,this._textDocument=o,this._selectorFilter=a,this._selectors=new Map,this._onNotificationSent=new dL.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(dL.languages.match(t,e)>0)return{send:i=>this.callback(i)}}}Nn.TextDocumentEventFeature=Xri;class Zri extends wFe{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(kge.TextDocumentRegistrationOptions.is(t)){const i=kge.StaticRegistrationOptions.hasId(t)?t.id:i6e.generateUuid(),n=t.documentSelector??e;if(n)return[i,Object.assign({},t,{documentSelector:n})]}else if($g.boolean(t)&&t===!0||kge.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];const i=$g.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[i6e.generateUuid(),i]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return $g.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&&dL.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}}Nn.TextDocumentLanguageFeature=Zri;class eoi{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}}Nn.WorkspaceFeature=eoi;var SA={};const toi=typeof process=="object"&&process&&process.platform==="win32";var ioi=toi?{sep:"\\"}:{sep:"/"},noi=aat;function aat(s,e,t){s instanceof RegExp&&(s=r6e(s,t)),e instanceof RegExp&&(e=r6e(e,t));var i=cat(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 r6e(s,e){var t=e.match(s);return t?t[0]:null}aat.range=cat;function cat(s,e,t){var i,n,r,o,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=[],r=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=[r,o])}return a}var lat=noi,soi=aoi,dat="\0SLASH"+Math.random()+"\0",hat="\0OPEN"+Math.random()+"\0",yFe="\0CLOSE"+Math.random()+"\0",uat="\0COMMA"+Math.random()+"\0",gat="\0PERIOD"+Math.random()+"\0";function Ige(s){return parseInt(s,10)==s?parseInt(s,10):s.charCodeAt(0)}function roi(s){return s.split("\\\\").join(dat).split("\\{").join(hat).split("\\}").join(yFe).split("\\,").join(uat).split("\\.").join(gat)}function ooi(s){return s.split(dat).join("\\").split(hat).join("{").split(yFe).join("}").split(uat).join(",").split(gat).join(".")}function fat(s){if(!s)return[""];var e=[],t=lat("{","}",s);if(!t)return s.split(",");var i=t.pre,n=t.body,r=t.post,o=i.split(",");o[o.length-1]+="{"+n+"}";var a=fat(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function aoi(s){return s?(s.substr(0,2)==="{}"&&(s="\\{\\}"+s.substr(2)),XV(roi(s),!0).map(ooi)):[]}function coi(s){return"{"+s+"}"}function loi(s){return/^-?0\d/.test(s)}function doi(s,e){return s<=e}function hoi(s,e){return s>=e}function XV(s,e){var t=[],i=lat("{","}",s);if(!i)return[s];var n=i.pre,r=i.post.length?XV(i.post,!1):[""];if(/\$$/.test(i.pre))for(var o=0;o=0;if(!d&&!h)return i.post.match(/,.*\}/)?(s=i.pre+"{"+i.body+yFe+i.post,XV(s)):[s];var u;if(d)u=i.body.split(/\.\./);else if(u=fat(i.body),u.length===1&&(u=XV(u[0],!1).map(coi),u.length===1))return r.map(function(z){return i.pre+u[0]+z});var f;if(d){var p=Ige(u[0]),m=Ige(u[1]),v=Math.max(u[0].length,u[1].length),b=u.length==3?Math.abs(Ige(u[2])):1,w=doi,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(Bne(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Gle(e,t).match(s));var $le=hm;const z1e=ioi;hm.sep=z1e.sep;const kv=Symbol("globstar **");hm.GLOBSTAR=kv;const uoi=soi,o6e={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},$1e="[^/]",Tge=$1e+"*?",goi="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",foi="(?:(?!(?:\\/|^)\\.).)*?",pat=s=>s.split("").reduce((e,t)=>(e[t]=!0,e),{}),a6e=pat("().*{}+?[]^$\\!"),poi=pat("[.("),c6e=/\/+/;hm.filter=(s,e={})=>(t,i,n)=>hm(t,s,e);const CE=(s,e={})=>{const t={};return Object.keys(s).forEach(i=>t[i]=s[i]),Object.keys(e).forEach(i=>t[i]=e[i]),t};hm.defaults=s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return hm;const e=hm,t=(i,n,r)=>e(i,n,CE(s,r));return t.Minimatch=class extends e.Minimatch{constructor(n,r){super(n,CE(s,r))}},t.Minimatch.defaults=i=>e.defaults(CE(s,i)).Minimatch,t.filter=(i,n)=>e.filter(i,CE(s,n)),t.defaults=i=>e.defaults(CE(s,i)),t.makeRe=(i,n)=>e.makeRe(i,CE(s,n)),t.braceExpand=(i,n)=>e.braceExpand(i,CE(s,n)),t.match=(i,n,r)=>e.match(i,n,CE(s,r)),t};hm.braceExpand=(s,e)=>mat(s,e);const mat=(s,e={})=>(Bne(s),e.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:uoi(s)),moi=1024*64,Bne=s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>moi)throw new TypeError("pattern is too long")},Lge=Symbol("subparse");hm.makeRe=(s,e)=>new Gle(s,e||{}).makeRe();hm.match=(s,e,t={})=>{const i=new Gle(e,t);return s=s.filter(n=>i.match(n)),i.options.nonull&&!s.length&&s.push(e),s};const _oi=s=>s.replace(/\\(.)/g,"$1"),voi=s=>s.replace(/\\([^-\]])/g,"$1"),boi=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),woi=s=>s.replace(/[[\]\\]/g,"\\$&");class Gle{constructor(e,t){Bne(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(c6e)),this.debug(this.pattern,i),i=i.map((n,r,o)=>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(r===a&&o===c)return!0;if(r===a)return i;if(o===c)return r===a-1&&e[r]==="";throw new Error("wtf?")}braceExpand(){return mat(this.pattern,this.options)}parse(e,t){Bne(e);const i=this.options;if(e==="**")if(i.noglobstar)e="*";else return kv;if(e==="")return"";let n="",r=!1,o=!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+=Tge,r=!0;break;case"?":n+=$1e,r=!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==="*"?Tge:p.type==="?"?$1e:"\\"+p.type;r=!0,n=n.slice(0,p.reStart)+P+"\\("+k}C(),o&&(n+="\\\\");const A=foi[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 Be=0;Be(o=o.map(a=>typeof a=="string"?voi(a):a===kv?kv:a._src).reduce((a,c)=>(a[a.length-1]===kv&&c===kv||a.push(c),a),[]),o.forEach((a,c)=>{a!==kv||o[c-1]===kv||(c===0?o.length>1?o[c+1]="(?:\\/|"+i+"\\/)?"+o[c+1]:o[c]=i:c===o.length-1?o[c-1]+="(?:\\/|"+i+")?":(o[c-1]+="(?:\\/|\\/"+i+"\\/)"+o[c+1],o[c+1]=kv))}),o.filter(a=>a!==kv).join("/"))).join("|");r="^(?:"+r+")$",this.negate&&(r="^(?!"+r+").*$");try{this.regexp=new RegExp(r,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;z1e.sep!=="/"&&(e=e.split(z1e.sep).join("/")),e=e.split(c6e),this.debug(this.pattern,"split",e);const n=this.set;this.debug(this.pattern,"set",n);let r;for(let o=e.length-1;o>=0&&(r=e[o],!r);o--);for(let o=0;o{if(t.closed.length===0&&t.opened.length===0)return;const i=this.open,n=new Set;Bz.fillTabResources(n);const r=new Set,o=new Set(n);for(const a of i.values())n.has(a)?o.delete(a):r.add(a);if(this.open=n,r.size>0){const a=new Set;for(const c of r)a.add(kr.Uri.parse(c));this._onClose.fire(a)}if(o.size>0){const a=new Set;for(const c of o)a.add(kr.Uri.parse(c));this._onOpen.fire(a)}};kr.window.tabGroups.onDidChangeTabs!==void 0?this.disposable=kr.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 kr.Uri?kr.window.activeTextEditor?.document.uri===e:kr.window.activeTextEditor?.document===e}isVisible(e){const t=e instanceof kr.Uri?e:e.uri;return this.open.has(t.toString())}getTabResources(){const e=new Set;return Bz.fillTabResources(new Set,e),e}static fillTabResources(e,t){const i=e??new Set;for(const n of kr.window.tabGroups.all)for(const r of n.tabs){const o=r.input;let a;o instanceof kr.TabInputText?a=o.uri:o instanceof kr.TabInputTextDiff?a=o.modified:o instanceof kr.TabInputCustom&&(a=o.uri),a!==void 0&&!i.has(a.toString())&&(i.add(a.toString()),t!==void 0&&t.add(a))}}}var zd;(function(s){s[s.document=1]="document",s[s.workspace=2]="workspace"})(zd||(zd={}));var BS;(function(s){function e(t){return t instanceof kr.Uri?t.toString():t.uri.toString()}s.asKey=e})(BS||(BS={}));class Coi{constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,i){const n=e===zd.document?this.documentPullStates:this.workspacePullStates,[r,o,a]=t instanceof kr.Uri?[t.toString(),t,i]:[t.uri.toString(),t.uri,t.version];let c=n.get(r);return c===void 0&&(c={document:o,pulledVersion:a,resultId:void 0},n.set(r,c)),c}update(e,t,i,n){const r=e===zd.document?this.documentPullStates:this.workspacePullStates,[o,a,c,l]=t instanceof kr.Uri?[t.toString(),t,i,n]:[t.uri.toString(),t.uri,t.version,i];let d=r.get(o);d===void 0?(d={document:a,pulledVersion:c,resultId:l},r.set(o,d)):(d.pulledVersion=c,d.resultId=l)}unTrack(e,t){const i=BS.asKey(t);(e===zd.document?this.documentPullStates:this.workspacePullStates).delete(i)}tracks(e,t){const i=BS.asKey(t);return(e===zd.document?this.documentPullStates:this.workspacePullStates).has(i)}getResultId(e,t){const i=BS.asKey(t);return(e===zd.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 Soi{constructor(e,t,i){this.client=e,this.tabs=t,this.options=i,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new kr.EventEmitter,this.provider=this.createProvider(),this.diagnostics=kr.languages.createDiagnosticCollection(i.identifier),this.openRequests=new Map,this.documentStates=new Coi,this.workspaceErrorCounter=0}knows(e,t){const i=t instanceof kr.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 kr.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 kr.Uri,n=i?e:e.uri,r=n.toString();t=i?t:e.version;const o=this.openRequests.get(r),a=i?this.documentStates.track(zd.document,e,t):this.documentStates.track(zd.document,e);if(o===void 0){const c=new kr.CancellationTokenSource;this.openRequests.set(r,{state:Cu.active,document:e,version:t,tokenSource:c});let l,d;try{l=await this.provider.provideDiagnostics(e,a.resultId,c.token)??{kind:Jm.DocumentDiagnosticReportKind.full,items:[]}}catch(h){if(h instanceof G1e.LSPCancellationError&&sl.DiagnosticServerCancellationData.is(h.data)&&h.data.retriggerRequest===!1&&(d={state:Cu.outDated,document:e}),d===void 0&&h instanceof kr.CancellationError)d={state:Cu.reschedule,document:e};else throw h}if(d=d??this.openRequests.get(r),d===void 0){this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${r}`),this.diagnostics.delete(n);return}if(this.openRequests.delete(r),!this.tabs.isVisible(e)){this.documentStates.unTrack(zd.document,e);return}if(d.state===Cu.outDated)return;l!==void 0&&(l.kind===Jm.DocumentDiagnosticReportKind.full&&this.diagnostics.set(n,l.items),a.pulledVersion=t,a.resultId=l.resultId),d.state===Cu.reschedule&&this.pull(e)}else o.state===Cu.active?(o.tokenSource.cancel(),this.openRequests.set(r,{state:Cu.reschedule,document:o.document})):o.state===Cu.outDated&&this.openRequests.set(r,{state:Cu.reschedule,document:o.document})}forgetDocument(e){const t=e instanceof kr.Uri?e:e.uri,i=t.toString(),n=this.openRequests.get(i);this.options.workspaceDiagnostics?n!==void 0?this.openRequests.set(i,{state:Cu.reschedule,document:e}):this.pull(e,()=>{this.forget(zd.document,e)}):(n!==void 0&&(n.state===Cu.active&&n.tokenSource.cancel(),this.openRequests.set(i,{state:Cu.outDated,document:e})),this.diagnostics.delete(t),this.forget(zd.document,e))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,sl.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof G1e.LSPCancellationError)&&!sl.DiagnosticServerCancellationData.is(e.data)&&(this.client.error("Workspace diagnostic pull failed.",e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,sl.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 kr.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===Jm.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(zd.document,i.uri)||this.diagnostics.set(i.uri,i.items)),this.documentStates.update(zd.workspace,i.uri,i.version??void 0,i.resultId)})}createProvider(){const e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(t,i,n)=>{const r=(a,c,l)=>{const d={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(a instanceof kr.Uri?a:a.uri)},previousResultId:c};return this.isDisposed===!0||!this.client.isRunning()?{kind:Jm.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(sl.DocumentDiagnosticRequest.type,d,l).then(async h=>h==null||this.isDisposed||l.isCancellationRequested?{kind:Jm.DocumentDiagnosticReportKind.full,items:[]}:h.kind===sl.DocumentDiagnosticReportKind.Full?{kind:Jm.DocumentDiagnosticReportKind.full,resultId:h.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(h.items,l)}:{kind:Jm.DocumentDiagnosticReportKind.unChanged,resultId:h.resultId},h=>this.client.handleFailedRequest(sl.DocumentDiagnosticRequest.type,l,h,{kind:Jm.DocumentDiagnosticReportKind.full,items:[]}))},o=this.client.middleware;return o.provideDiagnostics?o.provideDiagnostics(t,i,n,r):r(t,i,n)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(t,i,n)=>{const r=async l=>l.kind===sl.DocumentDiagnosticReportKind.Full?{kind:Jm.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:Jm.DocumentDiagnosticReportKind.unChanged,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version},o=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,yoi.generateUuid)(),u=this.client.onProgress(sl.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 r(v))}catch(b){this.client.error("Converting workspace diagnostics failed.",b)}n(m)}),f={identifier:this.options.identifier,previousResultIds:o(l),partialResultToken:h};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(sl.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 r(v));return u.dispose(),n(m),{items:[]}},p=>(u.dispose(),this.client.handleFailedRequest(sl.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===Cu.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:Cu.outDated,document:t.document});this.diagnostics.dispose()}}class Aoi{constructor(e){this.diagnosticRequestor=e,this.documents=new sl.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;const t=BS.asKey(e);this.documents.has(t)||(this.documents.set(t,e,sl.Touch.Last),this.trigger())}remove(e){const t=BS.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,sl.RAL)().timer.setInterval(()=>{const e=this.documents.first;if(e!==void 0){const t=BS.asKey(e);this.diagnosticRequestor.pull(e),this.documents.set(t,e,sl.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?BS.asKey(this.endDocument):void 0}}class Eoi{constructor(e,t,i){const n=e.clientOptions.diagnosticPullOptions??{onChange:!0,onSave:!1},r=e.protocol2CodeConverter.asDocumentSelector(i.documentSelector),o=[],a=p=>{const m=i.documentSelector;if(n.match!==void 0)return n.match(m,p);for(const v of m)if(sl.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 woi.Minimatch(v.pattern,{noext:!0});if(!b.makeRe()||!b.match(p.fsPath))return!1}}return!0},c=p=>p instanceof kr.Uri?a(p):kr.languages.match(r,p)>0&&t.isVisible(p),l=p=>p instanceof kr.Uri?this.activeTextDocument?.uri.toString()===p.toString():this.activeTextDocument===p;this.diagnosticRequestor=new Soi(e,t,i),this.backgroundScheduler=new Aoi(this.diagnosticRequestor);const d=p=>{!c(p)||!i.interFileDependencies||l(p)||this.backgroundScheduler.add(p)};this.activeTextDocument=kr.window.activeTextEditor?.document,kr.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(sl.DidOpenTextDocumentNotification.method);o.push(h.onNotificationSent(p=>{const m=p.textDocument;this.diagnosticRequestor.knows(zd.document,m)||c(m)&&this.diagnosticRequestor.pull(m,()=>{d(m)})})),o.push(t.onOpen(p=>{for(const m of p){if(this.diagnosticRequestor.knows(zd.document,m))continue;const v=m.toString();let b;for(const w of kr.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 kr.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(sl.DidChangeTextDocumentNotification.method);o.push(p.onNotificationSent(async m=>{const v=m.textDocument;(n.filter===void 0||!n.filter(v,Wne.onType))&&this.diagnosticRequestor.knows(zd.document,v)&&this.diagnosticRequestor.pull(v,()=>{this.backgroundScheduler.trigger()})}))}if(n.onSave===!0){const p=e.getFeature(sl.DidSaveTextDocumentNotification.method);o.push(p.onNotificationSent(m=>{const v=m.textDocument;(n.filter===void 0||!n.filter(v,Wne.onSave))&&this.diagnosticRequestor.knows(zd.document,v)&&this.diagnosticRequestor.pull(m.textDocument,()=>{this.backgroundScheduler.trigger()})}))}const f=e.getFeature(sl.DidCloseTextDocumentNotification.method);o.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 kr.workspace.textDocuments)c(p)&&this.diagnosticRequestor.pull(p)}),i.workspaceDiagnostics===!0&&i.identifier!=="da348dc5-c30a-4515-9d98-31ff3be38d14"&&this.diagnosticRequestor.pullWorkspace(),this.disposable=kr.Disposable.from(...o,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}cleanUpDocument(e){this.diagnosticRequestor.knows(zd.document,e)&&(this.diagnosticRequestor.forgetDocument(e),this.backgroundScheduler.remove(e))}}class xoi extends G1e.TextDocumentLanguageFeature{constructor(e){super(e,sl.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=lq(lq(e,"textDocument"),"diagnostic");t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,lq(lq(e,"workspace"),"diagnostics").refreshSupport=!0}initialize(e,t){this._client.onRequest(sl.DiagnosticRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeDiagnosticsEmitter.fire()});let[n,r]=this.getRegistration(t,e.diagnosticProvider);!n||!r||this.register({id:n,registerOptions:r})}clear(){this.tabs!==void 0&&(this.tabs.dispose(),this.tabs=void 0),super.clear()}registerLanguageProvider(e){this.tabs===void 0&&(this.tabs=new Bz);const t=new Eoi(this._client,this.tabs,e);return[t.disposable,t]}}SA.DiagnosticFeature=xoi;var wh={},Kle={},Sh={};Object.defineProperty(Sh,"__esModule",{value:!0});Sh.forEach=Sh.mapAsync=Sh.map=Sh.clearTestMode=Sh.setTestMode=Sh.Semaphore=Sh.Delayer=void 0;const kG=ms;class Doi{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,kG.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)}}Sh.Delayer=Doi;class koi{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,kG.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()}}}Sh.Semaphore=koi;let CFe=!1;function Ioi(){CFe=!0}Sh.setTestMode=Ioi;function Toi(){CFe=!1}Sh.clearTestMode=Toi;const l6e=15;class SFe{constructor(e=l6e){this.yieldAfter=CFe===!0?Math.max(e,2):Math.max(e,l6e),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),r=new SFe(i?.yieldAfter);function o(c){r.start();for(let l=c;l{(0,kG.RAL)().timer.setImmediate(()=>{c(o(a))})});return n}Sh.map=Loi;async function Roi(s,e,t,i){if(s.length===0)return[];const n=new Array(s.length),r=new SFe(i?.yieldAfter);async function o(c){r.start();for(let l=c;l{(0,kG.RAL)().timer.setImmediate(()=>{c(o(a))})});return n}Sh.mapAsync=Roi;async function Moi(s,e,t,i){if(s.length===0)return;const n=new SFe(i?.yieldAfter);function r(a){n.start();for(let c=a;c{(0,kG.RAL)().timer.setImmediate(()=>{a(r(o))})})}Sh.forEach=Moi;var qle={};Object.defineProperty(qle,"__esModule",{value:!0});const Noi=Zn;class Poi extends Noi.CompletionItem{constructor(e){super(e)}}qle.default=Poi;var Qle={};Object.defineProperty(Qle,"__esModule",{value:!0});const Foi=Zn;class Ooi extends Foi.CodeLens{constructor(e){super(e)}}Qle.default=Ooi;var jle={};Object.defineProperty(jle,"__esModule",{value:!0});const Boi=Zn;class Woi extends Boi.DocumentLink{constructor(e,t){super(e,t)}}jle.default=Woi;var Yle={};Object.defineProperty(Yle,"__esModule",{value:!0});const Hoi=Zn;class Uoi extends Hoi.CodeAction{constructor(e,t){super(e),this.data=t}}Yle.default=Uoi;var EN={};Object.defineProperty(EN,"__esModule",{value:!0});EN.ProtocolDiagnostic=EN.DiagnosticCode=void 0;const Voi=Zn,Rge=Io;var d6e;(function(s){function e(t){const i=t;return i!=null&&(Rge.number(i.value)||Rge.string(i.value))&&Rge.string(i.target)}s.is=e})(d6e||(EN.DiagnosticCode=d6e={}));class zoi extends Voi.Diagnostic{constructor(e,t,i,n){super(e,t,i),this.data=n,this.hasDiagnosticCode=!1}}EN.ProtocolDiagnostic=zoi;var Jle={};Object.defineProperty(Jle,"__esModule",{value:!0});const $oi=Zn;class Goi extends $oi.CallHierarchyItem{constructor(e,t,i,n,r,o,a){super(e,t,i,n,r,o),a!==void 0&&(this.data=a)}}Jle.default=Goi;var Xle={};Object.defineProperty(Xle,"__esModule",{value:!0});const Koi=Zn;class qoi extends Koi.TypeHierarchyItem{constructor(e,t,i,n,r,o,a){super(e,t,i,n,r,o),a!==void 0&&(this.data=a)}}Xle.default=qoi;var Zle={};Object.defineProperty(Zle,"__esModule",{value:!0});const dq=Zn;let Qoi=class extends dq.SymbolInformation{constructor(e,t,i,n,r){const o=!(n instanceof dq.Uri);super(e,t,i,o?n:new dq.Location(n,new dq.Range(0,0,0,0))),this.hasRange=o,r!==void 0&&(this.data=r)}};Zle.default=Qoi;var ede={};Object.defineProperty(ede,"__esModule",{value:!0});const joi=Zn;class Yoi extends joi.InlayHint{constructor(e,t,i){super(e,t,i)}}ede.default=Yoi;Object.defineProperty(Kle,"__esModule",{value:!0});Kle.createConverter=void 0;const Bl=Zn,_s=ms,e0=Io,h6e=Sh,Joi=qle,Xoi=Qle,Zoi=jle,u6e=Yle,g6e=EN,eai=Jle,tai=Xle,iai=Zle,nai=ede;var K1e;(function(s){function e(t){const i=t;return i&&!!i.inserting&&!!i.replacing}s.is=e})(K1e||(K1e={}));function sai(s){const t=s||(ee=>ee.toString());function i(ee){return t(ee)}function n(ee){return{uri:t(ee.uri)}}function r(ee){return{uri:t(ee.uri),languageId:ee.languageId,version:ee.version,text:ee.getText()}}function o(ee){return{uri:t(ee.uri),version:ee.version}}function a(ee){return{textDocument:r(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,ft){if(l(ee))return{textDocument:{uri:t(ee.uri),version:ee.version},contentChanges:[{text:ee.getText()}]};if(c(ee)){const $n=xe,Ss=ft;return{textDocument:{uri:t($n),version:Ss},contentChanges:ee.contentChanges.map(Ua=>{const ta=Ua.range;return{range:{start:{line:ta.start.line,character:ta.start.character},end:{line:ta.end.line,character:ta.end.character}},rangeLength:Ua.rangeLength,text:Ua.text}})}}else throw Error("Unsupported text document change parameter")}function h(ee){return{textDocument:n(ee)}}function u(ee,xe=!1){let ft={textDocument:n(ee)};return xe&&(ft.text=ee.getText()),ft}function f(ee){switch(ee){case Bl.TextDocumentSaveReason.Manual:return _s.TextDocumentSaveReason.Manual;case Bl.TextDocumentSaveReason.AfterDelay:return _s.TextDocumentSaveReason.AfterDelay;case Bl.TextDocumentSaveReason.FocusOut:return _s.TextDocumentSaveReason.FocusOut}return _s.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 Bl.CompletionTriggerKind.TriggerCharacter:return _s.CompletionTriggerKind.TriggerCharacter;case Bl.CompletionTriggerKind.TriggerForIncompleteCompletions:return _s.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return _s.CompletionTriggerKind.Invoked}}function k(ee,xe,ft){return{textDocument:n(ee),position:ge(xe),context:{triggerKind:L(ft.triggerKind),triggerCharacter:ft.triggerCharacter}}}function P(ee){switch(ee){case Bl.SignatureHelpTriggerKind.Invoke:return _s.SignatureHelpTriggerKind.Invoked;case Bl.SignatureHelpTriggerKind.TriggerCharacter:return _s.SignatureHelpTriggerKind.TriggerCharacter;case Bl.SignatureHelpTriggerKind.ContentChange:return _s.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,ft){return{textDocument:n(ee),position:ge(xe),context:{isRetrigger:ft.isRetrigger,triggerCharacter:ft.triggerCharacter,triggerKind:P(ft.triggerKind),activeSignatureHelp:j(ft.activeSignatureHelp)}}}function ge(ee){return{line:ee.line,character:ee.character}}function De(ee){return ee==null?ee:{line:ee.line>_s.uinteger.MAX_VALUE?_s.uinteger.MAX_VALUE:ee.line,character:ee.character>_s.uinteger.MAX_VALUE?_s.uinteger.MAX_VALUE:ee.character}}function Be(ee,xe){return h6e.map(ee,De,xe)}function Ct(ee){return ee.map(De)}function Ne(ee){return ee==null?ee:{start:De(ee.start),end:De(ee.end)}}function dt(ee){return ee.map(Ne)}function Dt(ee){return ee==null?ee:_s.Location.create(i(ee.uri),Ne(ee.range))}function Xi(ee){switch(ee){case Bl.DiagnosticSeverity.Error:return _s.DiagnosticSeverity.Error;case Bl.DiagnosticSeverity.Warning:return _s.DiagnosticSeverity.Warning;case Bl.DiagnosticSeverity.Information:return _s.DiagnosticSeverity.Information;case Bl.DiagnosticSeverity.Hint:return _s.DiagnosticSeverity.Hint}}function Ti(ee){if(!ee)return;let xe=[];for(let ft of ee){let $n=ss(ft);$n!==void 0&&xe.push($n)}return xe.length>0?xe:void 0}function ss(ee){switch(ee){case Bl.DiagnosticTag.Unnecessary:return _s.DiagnosticTag.Unnecessary;case Bl.DiagnosticTag.Deprecated:return _s.DiagnosticTag.Deprecated;default:return}}function $s(ee){return{message:ee.message,location:Dt(ee.location)}}function Fn(ee){return ee.map($s)}function Zo(ee){if(ee!=null)return e0.number(ee)||e0.string(ee)?ee:{value:ee.value,target:i(ee.target)}}function hs(ee){const xe=_s.Diagnostic.create(Ne(ee.range),ee.message),ft=ee instanceof g6e.ProtocolDiagnostic?ee:void 0;ft!==void 0&&ft.data!==void 0&&(xe.data=ft.data);const $n=Zo(ee.code);return g6e.DiagnosticCode.is($n)?ft!==void 0&&ft.hasDiagnosticCode?xe.code=$n:(xe.code=$n.value,xe.codeDescription={href:$n.target}):xe.code=$n,e0.number(ee.severity)&&(xe.severity=Xi(ee.severity)),Array.isArray(ee.tags)&&(xe.tags=Ti(ee.tags)),ee.relatedInformation&&(xe.relatedInformation=Fn(ee.relatedInformation)),ee.source&&(xe.source=ee.source),xe}function Zr(ee,xe){return ee==null?ee:h6e.map(ee,hs,xe)}function ea(ee){return ee==null?ee:ee.map(hs)}function ki(ee,xe){switch(ee){case"$string":return xe;case _s.MarkupKind.PlainText:return{kind:ee,value:xe};case _s.MarkupKind.Markdown:return{kind:ee,value:xe.value};default:return`Unsupported Markup content received. Kind is: ${ee}`}}function rs(ee){switch(ee){case Bl.CompletionItemTag.Deprecated:return _s.CompletionItemTag.Deprecated}}function Or(ee){if(ee===void 0)return ee;const xe=[];for(let ft of ee){const $n=rs(ft);$n!==void 0&&xe.push($n)}return xe}function Ln(ee,xe){return xe!==void 0?xe:ee+1}function Wa(ee,xe=!1){let ft,$n;e0.string(ee.label)?ft=ee.label:(ft=ee.label.label,xe&&(ee.label.detail!==void 0||ee.label.description!==void 0)&&($n={detail:ee.label.detail,description:ee.label.description}));let Ss={label:ft};$n!==void 0&&(Ss.labelDetails=$n);let Wr=ee instanceof Joi.default?ee:void 0;ee.detail&&(Ss.detail=ee.detail),ee.documentation&&(!Wr||Wr.documentationFormat==="$string"?Ss.documentation=ee.documentation:Ss.documentation=ki(Wr.documentationFormat,ee.documentation)),ee.filterText&&(Ss.filterText=ee.filterText),wd(Ss,ee),e0.number(ee.kind)&&(Ss.kind=Ln(ee.kind,Wr&&Wr.originalItemKind)),ee.sortText&&(Ss.sortText=ee.sortText),ee.additionalTextEdits&&(Ss.additionalTextEdits=mc(ee.additionalTextEdits)),ee.commitCharacters&&(Ss.commitCharacters=ee.commitCharacters.slice()),ee.command&&(Ss.command=Bo(ee.command)),(ee.preselect===!0||ee.preselect===!1)&&(Ss.preselect=ee.preselect);const Ua=Or(ee.tags);if(Wr){if(Wr.data!==void 0&&(Ss.data=Wr.data),Wr.deprecated===!0||Wr.deprecated===!1){if(Wr.deprecated===!0&&Ua!==void 0&&Ua.length>0){const ta=Ua.indexOf(Bl.CompletionItemTag.Deprecated);ta!==-1&&Ua.splice(ta,1)}Ss.deprecated=Wr.deprecated}Wr.insertTextMode!==void 0&&(Ss.insertTextMode=Wr.insertTextMode)}return Ua!==void 0&&Ua.length>0&&(Ss.tags=Ua),Ss.insertTextMode===void 0&&ee.keepWhitespace===!0&&(Ss.insertTextMode=_s.InsertTextMode.adjustIndentation),Ss}function wd(ee,xe){let ft=_s.InsertTextFormat.PlainText,$n,Ss;xe.textEdit?($n=xe.textEdit.newText,Ss=xe.textEdit.range):xe.insertText instanceof Bl.SnippetString?(ft=_s.InsertTextFormat.Snippet,$n=xe.insertText.value):$n=xe.insertText,xe.range&&(Ss=xe.range),ee.insertTextFormat=ft,xe.fromEdit&&$n!==void 0&&Ss!==void 0?ee.textEdit=On($n,Ss):ee.insertText=$n}function On(ee,xe){return K1e.is(xe)?_s.InsertReplaceEdit.create(ee,Ne(xe.inserting),Ne(xe.replacing)):{newText:ee,range:Ne(xe)}}function nh(ee){return{range:Ne(ee.range),newText:ee.newText}}function mc(ee){return ee==null?ee:ee.map(nh)}function $c(ee){return ee<=Bl.SymbolKind.TypeParameter?ee+1:_s.SymbolKind.Property}function Gs(ee){return ee}function ic(ee){return ee.map(Gs)}function pl(ee,xe,ft){return{textDocument:n(ee),position:ge(xe),context:{includeDeclaration:ft.includeDeclaration}}}async function sh(ee,xe){let ft=_s.CodeAction.create(ee.title);if(ee instanceof u6e.default&&ee.data!==void 0&&(ft.data=ee.data),ee.kind!==void 0&&(ft.kind=kc(ee.kind)),ee.diagnostics!==void 0&&(ft.diagnostics=await Zr(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&&(ft.command=Bo(ee.command)),ee.isPreferred!==void 0&&(ft.isPreferred=ee.isPreferred),ee.disabled!==void 0&&(ft.disabled={reason:ee.disabled.reason}),ft}function mg(ee){let xe=_s.CodeAction.create(ee.title);if(ee instanceof u6e.default&&ee.data!==void 0&&(xe.data=ee.data),ee.kind!==void 0&&(xe.kind=kc(ee.kind)),ee.diagnostics!==void 0&&(xe.diagnostics=ea(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=Bo(ee.command)),ee.isPreferred!==void 0&&(xe.isPreferred=ee.isPreferred),ee.disabled!==void 0&&(xe.disabled={reason:ee.disabled.reason}),xe}async function _c(ee,xe){if(ee==null)return ee;let ft;return ee.only&&e0.string(ee.only.value)&&(ft=[ee.only.value]),_s.CodeActionContext.create(await Zr(ee.diagnostics,xe),ft,rh(ee.triggerKind))}function Gc(ee){if(ee==null)return ee;let xe;return ee.only&&e0.string(ee.only.value)&&(xe=[ee.only.value]),_s.CodeActionContext.create(ea(ee.diagnostics),xe,rh(ee.triggerKind))}function rh(ee){switch(ee){case Bl.CodeActionTriggerKind.Invoke:return _s.CodeActionTriggerKind.Invoked;case Bl.CodeActionTriggerKind.Automatic:return _s.CodeActionTriggerKind.Automatic;default:return}}function kc(ee){if(ee!=null)return ee.value}function ml(ee){return ee==null?ee:_s.InlineValueContext.create(ee.frameId,Ne(ee.stoppedLocation))}function nc(ee,xe,ft){return{context:_s.InlineCompletionContext.create(ft.triggerKind,ft.selectedCompletionInfo),textDocument:n(ee),position:De(xe)}}function Bo(ee){let xe=_s.Command.create(ee.title,ee.command);return ee.arguments&&(xe.arguments=ee.arguments),xe}function _l(ee){let xe=_s.CodeLens.create(Ne(ee.range));return ee.command&&(xe.command=Bo(ee.command)),ee instanceof Xoi.default&&ee.data&&(xe.data=ee.data),xe}function oh(ee,xe){const ft={tabSize:ee.tabSize,insertSpaces:ee.insertSpaces};return xe.trimTrailingWhitespace&&(ft.trimTrailingWhitespace=!0),xe.trimFinalNewlines&&(ft.trimFinalNewlines=!0),xe.insertFinalNewline&&(ft.insertFinalNewline=!0),ft}function ah(ee){return{textDocument:n(ee)}}function Kc(ee){return{textDocument:n(ee)}}function qc(ee){let xe=_s.DocumentLink.create(Ne(ee.range));ee.target&&(xe.target=i(ee.target)),ee.tooltip!==void 0&&(xe.tooltip=ee.tooltip);let ft=ee instanceof Zoi.default?ee:void 0;return ft&&ft.data&&(xe.data=ft.data),xe}function Ha(ee){return{textDocument:n(ee)}}function Br(ee){const xe={name:ee.name,kind:$c(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=ic(ee.tags)),ee instanceof eai.default&&ee.data!==void 0&&(xe.data=ee.data),xe}function Ts(ee){const xe={name:ee.name,kind:$c(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=ic(ee.tags)),ee instanceof tai.default&&ee.data!==void 0&&(xe.data=ee.data),xe}function Ic(ee){const xe=ee instanceof iai.default?{name:ee.name,kind:$c(ee.kind),location:ee.hasRange?Dt(ee.location):{uri:t(ee.location.uri)},data:ee.data}:{name:ee.name,kind:$c(ee.kind),location:Dt(ee.location)};return ee.tags!==void 0&&(xe.tags=ic(ee.tags)),ee.containerName!==""&&(xe.containerName=ee.containerName),xe}function Fh(ee){const xe=typeof ee.label=="string"?ee.label:ee.label.map(be),ft=_s.InlayHint.create(De(ee.position),xe);return ee.kind!==void 0&&(ft.kind=ee.kind),ee.textEdits!==void 0&&(ft.textEdits=mc(ee.textEdits)),ee.tooltip!==void 0&&(ft.tooltip=Ea(ee.tooltip)),ee.paddingLeft!==void 0&&(ft.paddingLeft=ee.paddingLeft),ee.paddingRight!==void 0&&(ft.paddingRight=ee.paddingRight),ee instanceof nai.default&&ee.data!==void 0&&(ft.data=ee.data),ft}function be(ee){const xe=_s.InlayHintLabelPart.create(ee.value);return ee.location!==void 0&&(xe.location=Dt(ee.location)),ee.command!==void 0&&(xe.command=Bo(ee.command)),ee.tooltip!==void 0&&(xe.tooltip=Ea(ee.tooltip)),xe}function Ea(ee){return typeof ee=="string"?ee:{kind:_s.MarkupKind.Markdown,value:ee.value}}return{asUri:i,asTextDocumentIdentifier:n,asTextDocumentItem:r,asVersionedTextDocumentIdentifier:o,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:dt,asPosition:De,asPositions:Be,asPositionsSync:Ct,asLocation:Dt,asDiagnosticSeverity:Xi,asDiagnosticTag:ss,asDiagnostic:hs,asDiagnostics:Zr,asDiagnosticsSync:ea,asCompletionItem:Wa,asTextEdit:nh,asSymbolKind:$c,asSymbolTag:Gs,asSymbolTags:ic,asReferenceParams:pl,asCodeAction:sh,asCodeActionSync:mg,asCodeActionContext:_c,asCodeActionContextSync:Gc,asInlineValueContext:ml,asCommand:Bo,asCodeLens:_l,asFormattingOptions:oh,asDocumentSymbolParams:ah,asCodeLensParams:Kc,asDocumentLink:qc,asDocumentLinkParams:Ha,asCallHierarchyItem:Br,asTypeHierarchyItem:Ts,asInlayHint:Fh,asWorkspaceSymbol:Ic,asInlineCompletionParams:nc}}Kle.createConverter=sai;var tde={};Object.defineProperty(tde,"__esModule",{value:!0});tde.createConverter=void 0;const hi=Zn,Bn=ms,Xm=Io,uo=Sh,rai=qle,oai=Qle,aai=jle,cai=Yle,f6e=EN,lai=Jle,dai=Xle,hai=Zle,uai=ede,p6e=ms;var Hne;(function(s){function e(t){let i=t;return i&&Xm.string(i.language)&&Xm.string(i.value)}s.is=e})(Hne||(Hne={}));function gai(s,e,t){const n=s||(T=>hi.Uri.parse(T));function r(T){return n(T)}function o(T){const ie=[];for(const ye of T)if(typeof ye=="string")ie.push(ye);else if(p6e.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 p6e.TextDocumentFilter.is(ye)&&ie.push({language:ye.language,scheme:ye.scheme,pattern:ye.pattern});return ie}async function a(T,ie){return uo.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 Bn.DiagnosticTag.Unnecessary:return hi.DiagnosticTag.Unnecessary;case Bn.DiagnosticTag.Deprecated:return hi.DiagnosticTag.Deprecated;default:return}}function f(T){return T?new hi.Position(T.line,T.character):void 0}function p(T){return T?new hi.Range(T.start.line,T.start.character,T.end.line,T.end.character):void 0}async function m(T,ie){return uo.map(T,ye=>new hi.Range(ye.start.line,ye.start.character,ye.end.line,ye.end.character),ie)}function v(T){if(T==null)return hi.DiagnosticSeverity.Error;switch(T){case Bn.DiagnosticSeverity.Error:return hi.DiagnosticSeverity.Error;case Bn.DiagnosticSeverity.Warning:return hi.DiagnosticSeverity.Warning;case Bn.DiagnosticSeverity.Information:return hi.DiagnosticSeverity.Information;case Bn.DiagnosticSeverity.Hint:return hi.DiagnosticSeverity.Hint}return hi.DiagnosticSeverity.Error}function b(T){if(Xm.string(T))return y(T);if(Hne.is(T))return y().appendCodeblock(T.value,T.language);if(Array.isArray(T)){let ie=[];for(let ye of T){let O=y();Hne.is(ye)?O.appendCodeblock(ye.value,ye.language):O.appendMarkdown(ye),ie.push(O)}return ie}else return y(T)}function w(T){if(Xm.string(T))return T;switch(T.kind){case Bn.MarkupKind.Markdown:return y(T.value);case Bn.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 hi.MarkdownString(T);else switch(T.kind){case Bn.MarkupKind.Markdown:ie=new hi.MarkdownString(T.value);break;case Bn.MarkupKind.PlainText:ie=new hi.MarkdownString,ie.appendText(T.value);break;default:ie=new hi.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 hi.Hover(b(T.contents),p(T.range))}async function A(T,ie,ye){if(!T)return;if(Array.isArray(T))return uo.map(T,Wi=>z(Wi,ie),ye);const O=T,{defaultRange:$,commitCharacters:se}=L(O,ie),qe=await uo.map(O.items,Wi=>z(Wi,se,$,O.itemDefaults?.insertTextMode,O.itemDefaults?.insertTextFormat,O.itemDefaults?.data),ye);return new hi.CompletionList(qe,O.isIncomplete)}function L(T,ie){const ye=T.itemDefaults?.editRange,O=T.itemDefaults?.commitCharacters??ie;return Bn.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 Bn.CompletionItemKind.Text<=T&&T<=Bn.CompletionItemKind.TypeParameter?[T-1,void 0]:[hi.CompletionItemKind.Text,T]}function P(T){switch(T){case Bn.CompletionItemTag.Deprecated:return hi.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 qe=R(T.tags),Wi=G(T),Hi=new rai.default(Wi);T.detail&&(Hi.detail=T.detail),T.documentation&&(Hi.documentation=w(T.documentation),Hi.documentationFormat=Xm.string(T.documentation)?"$string":T.documentation.kind),T.filterText&&(Hi.filterText=T.filterText);const ia=Y(T,ye,$);if(ia&&(Hi.insertText=ia.text,Hi.range=ia.range,Hi.fromEdit=ia.fromEdit),Xm.number(T.kind)){let[Cat,UFe]=k(T.kind);Hi.kind=Cat,UFe&&(Hi.originalItemKind=UFe)}T.sortText&&(Hi.sortText=T.sortText),T.additionalTextEdits&&(Hi.additionalTextEdits=De(T.additionalTextEdits));const Ol=T.commitCharacters!==void 0?Xm.stringArray(T.commitCharacters)?T.commitCharacters:void 0:ie;Ol&&(Hi.commitCharacters=Ol.slice()),T.command&&(Hi.command=mc(T.command)),(T.deprecated===!0||T.deprecated===!1)&&(Hi.deprecated=T.deprecated,T.deprecated===!0&&qe.push(hi.CompletionItemTag.Deprecated)),(T.preselect===!0||T.preselect===!1)&&(Hi.preselect=T.preselect);const _g=T.data??se;_g!==void 0&&(Hi.data=_g),qe.length>0&&(Hi.tags=qe);const Rde=T.insertTextMode??O;return Rde!==void 0&&(Hi.insertTextMode=Rde,Rde===Bn.InsertTextMode.asIs&&(Hi.keepWhitespace=!0)),Hi}function G(T){return Bn.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===Bn.InsertTextFormat.Snippet?{text:new hi.SnippetString(se),range:$,fromEdit:!0}:{text:se,range:$,fromEdit:!0}}else return T.insertText?O===Bn.InsertTextFormat.Snippet?{text:new hi.SnippetString(T.insertText),fromEdit:!1}:{text:T.insertText,fromEdit:!1}:void 0}function j(T){return Bn.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 hi.TextEdit(p(T.range),T.newText)}async function ge(T,ie){if(T)return uo.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(On(O));ie.children=ye}return ie}function nh(T,ie){T.tags=Ln(ie.tags),ie.deprecated&&(T.tags?T.tags.includes(hi.SymbolTag.Deprecated)||(T.tags=T.tags.concat(hi.SymbolTag.Deprecated)):T.tags=[hi.SymbolTag.Deprecated])}function mc(T){let ie={title:T.title,command:T.command};return T.arguments&&(ie.arguments=T.arguments),ie}async function $c(T,ie){if(T)return uo.map(T,mc,ie)}const Gs=new Map;Gs.set(Bn.CodeActionKind.Empty,hi.CodeActionKind.Empty),Gs.set(Bn.CodeActionKind.QuickFix,hi.CodeActionKind.QuickFix),Gs.set(Bn.CodeActionKind.Refactor,hi.CodeActionKind.Refactor),Gs.set(Bn.CodeActionKind.RefactorExtract,hi.CodeActionKind.RefactorExtract),Gs.set(Bn.CodeActionKind.RefactorInline,hi.CodeActionKind.RefactorInline),Gs.set(Bn.CodeActionKind.RefactorRewrite,hi.CodeActionKind.RefactorRewrite),Gs.set(Bn.CodeActionKind.Source,hi.CodeActionKind.Source),Gs.set(Bn.CodeActionKind.SourceOrganizeImports,hi.CodeActionKind.SourceOrganizeImports);function ic(T){if(T==null)return;let ie=Gs.get(T);if(ie)return ie;let ye=T.split(".");ie=hi.CodeActionKind.Empty;for(let O of ye)ie=ie.append(O);return ie}function pl(T){if(T!=null)return T.map(ie=>ic(ie))}async function sh(T,ie){if(T==null)return;let ye=new cai.default(T.title,T.data);return T.kind!==void 0&&(ye.kind=ic(T.kind)),T.diagnostics!==void 0&&(ye.diagnostics=c(T.diagnostics)),T.edit!==void 0&&(ye.edit=await rh(T.edit,ie)),T.command!==void 0&&(ye.command=mc(T.command)),T.isPreferred!==void 0&&(ye.isPreferred=T.isPreferred),T.disabled!==void 0&&(ye.disabled={reason:T.disabled.reason}),ye}function mg(T,ie){return uo.mapAsync(T,async ye=>Bn.Command.is(ye)?mc(ye):sh(ye,ie),ie)}function _c(T){if(!T)return;let ie=new oai.default(p(T.range));return T.command&&(ie.command=mc(T.command)),T.data!==void 0&&T.data!==null&&(ie.data=T.data),ie}async function Gc(T,ie){if(T)return uo.map(T,_c,ie)}async function rh(T,ie){if(!T)return;const ye=new Map;if(T.changeAnnotations!==void 0){const se=T.changeAnnotations;await uo.forEach(Object.keys(se),qe=>{const Wi=kc(se[qe]);ye.set(qe,Wi)},ie)}const O=se=>{if(se!==void 0)return ye.get(se)},$=new hi.WorkspaceEdit;if(T.documentChanges){const se=T.documentChanges;await uo.forEach(se,qe=>{if(Bn.CreateFile.is(qe))$.createFile(n(qe.uri),qe.options,O(qe.annotationId));else if(Bn.RenameFile.is(qe))$.renameFile(n(qe.oldUri),n(qe.newUri),qe.options,O(qe.annotationId));else if(Bn.DeleteFile.is(qe))$.deleteFile(n(qe.uri),qe.options,O(qe.annotationId));else if(Bn.TextDocumentEdit.is(qe)){const Wi=n(qe.textDocument.uri);for(const Hi of qe.edits)Bn.AnnotatedTextEdit.is(Hi)?$.replace(Wi,p(Hi.range),Hi.newText,O(Hi.annotationId)):$.replace(Wi,p(Hi.range),Hi.newText)}else throw new Error(`Unknown workspace edit change received: -${JSON.stringify(qe,void 0,4)}`)},ie)}else if(T.changes){const se=T.changes;await uo.forEach(Object.keys(se),qe=>{$.set(n(qe),De(se[qe]))},ie)}return $}function kc(T){if(T!==void 0)return{label:T.label,needsConfirmation:!!T.needsConfirmation,description:T.description}}function ml(T){let ie=p(T.range),ye=T.target?r(T.target):void 0,O=new aai.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 nc(T,ie){if(T)return uo.map(T,ml,ie)}function Bo(T){return new hi.Color(T.red,T.green,T.blue,T.alpha)}function _l(T){return new hi.ColorInformation(p(T.range),Bo(T.color))}async function oh(T,ie){if(T)return uo.map(T,_l,ie)}function ah(T){let ie=new hi.ColorPresentation(T.label);return ie.additionalTextEdits=De(T.additionalTextEdits),T.textEdit&&(ie.textEdit=ne(T.textEdit)),ie}async function Kc(T,ie){if(T)return uo.map(T,ah,ie)}function qc(T){if(T)switch(T){case Bn.FoldingRangeKind.Comment:return hi.FoldingRangeKind.Comment;case Bn.FoldingRangeKind.Imports:return hi.FoldingRangeKind.Imports;case Bn.FoldingRangeKind.Region:return hi.FoldingRangeKind.Region}}function Ha(T){return new hi.FoldingRange(T.startLine,T.endLine,qc(T.kind))}async function Br(T,ie){if(T)return uo.map(T,Ha,ie)}function Ts(T){return new hi.SelectionRange(p(T.range),T.parent?Ts(T.parent):void 0)}async function Ic(T,ie){return Array.isArray(T)?uo.map(T,Ts,ie):[]}function Fh(T){return Bn.InlineValueText.is(T)?new hi.InlineValueText(p(T.range),T.text):Bn.InlineValueVariableLookup.is(T)?new hi.InlineValueVariableLookup(p(T.range),T.variableName,T.caseSensitiveLookup):new hi.InlineValueEvaluatableExpression(p(T.range),T.expression)}async function be(T,ie){return Array.isArray(T)?uo.map(T,Fh,ie):[]}async function Ea(T,ie){const ye=typeof T.label=="string"?T.label:await uo.map(T.label,ee,ie),O=new uai.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 hi.InlayHintLabelPart(T.value);return T.location!==void 0&&(ie.location=Xi(T.location)),T.tooltip!==void 0&&(ie.tooltip=xe(T.tooltip)),T.command!==void 0&&(ie.command=mc(T.command)),ie}function xe(T){return typeof T=="string"?T:y(T)}async function ft(T,ie){if(Array.isArray(T))return uo.mapAsync(T,Ea,ie)}function $n(T){if(T===null)return;const ie=new lai.default(rs(T.kind),T.name,T.detail||"",r(T.uri),p(T.range),p(T.selectionRange),T.data);return T.tags!==void 0&&(ie.tags=Ln(T.tags)),ie}async function Ss(T,ie){if(T!==null)return uo.map(T,$n,ie)}async function Wr(T,ie){return new hi.CallHierarchyIncomingCall($n(T.from),await m(T.fromRanges,ie))}async function Ua(T,ie){if(T!==null)return uo.mapAsync(T,Wr,ie)}async function ta(T,ie){return new hi.CallHierarchyOutgoingCall($n(T.to),await m(T.fromRanges,ie))}async function Oh(T,ie){if(T!==null)return uo.mapAsync(T,ta,ie)}async function le(T,ie){if(T!=null)return new hi.SemanticTokens(new Uint32Array(T.data),T.resultId)}function ho(T){return new hi.SemanticTokensEdit(T.start,T.deleteCount,T.data!==void 0?new Uint32Array(T.data):void 0)}async function nr(T,ie){if(T!=null)return new hi.SemanticTokensEdits(T.edits.map(ho),T.resultId)}function gn(T){return T}async function Se(T,ie){if(T!=null)return new hi.LinkedEditingRanges(await m(T.ranges,ie),at(T.wordPattern))}function at(T){if(T!=null)return new RegExp(T)}function Ot(T){if(T===null)return;let ie=new dai.default(rs(T.kind),T.name,T.detail||"",r(T.uri),p(T.range),p(T.selectionRange),T.data);return T.tags!==void 0&&(ie.tags=Ln(T.tags)),ie}async function Si(T,ie){if(T!==null)return uo.map(T,Ot,ie)}function Bt(T){if(Xm.string(T))return T;if(Bn.RelativePattern.is(T)){if(Bn.URI.is(T.baseUri))return new hi.RelativePattern(r(T.baseUri),T.pattern);if(Bn.WorkspaceFolder.is(T.baseUri)){const ie=hi.workspace.getWorkspaceFolder(r(T.baseUri.uri));return ie!==void 0?new hi.RelativePattern(ie,T.pattern):void 0}}}async function K(T,ie){if(!T)return;if(Array.isArray(T))return uo.map(T,$=>de($),ie);const ye=T,O=await uo.map(ye.items,$=>de($),ie);return new hi.InlineCompletionList(O)}function de(T){let ie;typeof T.insertText=="string"?ie=T.insertText:ie=new hi.SnippetString(T.insertText.value);let ye;T.command&&(ye=mc(T.command));const O=new hi.InlineCompletionItem(ie,p(T.range),ye);return T.filterText&&(O.filterText=T.filterText),O}return{asUri:r,asDocumentSelector:o,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:Be,asSignatureInformations:Ct,asSignatureInformation:Ne,asParameterInformations:dt,asParameterInformation:Dt,asDeclarationResult:Ti,asDefinitionResult:ss,asLocation:Xi,asReferences:Zo,asDocumentHighlights:hs,asDocumentHighlight:Zr,asDocumentHighlightKind:ea,asSymbolKind:rs,asSymbolTag:Or,asSymbolTags:Ln,asSymbolInformations:ki,asSymbolInformation:Wa,asDocumentSymbols:wd,asDocumentSymbol:On,asCommand:mc,asCommands:$c,asCodeAction:sh,asCodeActionKind:ic,asCodeActionKinds:pl,asCodeActionResult:mg,asCodeLens:_c,asCodeLenses:Gc,asWorkspaceEdit:rh,asDocumentLink:ml,asDocumentLinks:nc,asFoldingRangeKind:qc,asFoldingRange:Ha,asFoldingRanges:Br,asColor:Bo,asColorInformation:_l,asColorInformations:oh,asColorPresentation:ah,asColorPresentations:Kc,asSelectionRange:Ts,asSelectionRanges:Ic,asInlineValue:Fh,asInlineValues:be,asInlayHint:Ea,asInlayHints:ft,asSemanticTokensLegend:gn,asSemanticTokens:le,asSemanticTokensEdit:ho,asSemanticTokensEdits:nr,asCallHierarchyItem:$n,asCallHierarchyItems:Ss,asCallHierarchyIncomingCall:Wr,asCallHierarchyIncomingCalls:Ua,asCallHierarchyOutgoingCall:ta,asCallHierarchyOutgoingCalls:Oh,asLinkedEditingRanges:Se,asTypeHierarchyItem:Ot,asTypeHierarchyItems:Si,asGlobPattern:Bt,asInlineCompletionResult:K,asInlineCompletionItem:de}}tde.createConverter=gai;var IG={};Object.defineProperty(IG,"__esModule",{value:!0});IG.ProgressPart=void 0;const m6e=Zn,_6e=ms,v6e=Io;class fai{constructor(e,t,i){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress(_6e.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&&m6e.window.withProgress({location:m6e.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(_6e.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((n,r)=>{this._resolve=n,this._reject=r})})}report(e){if(this._infinite&&v6e.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(v6e.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}}IG.ProgressPart=fai;var ide={};Object.defineProperty(ide,"__esModule",{value:!0});ide.NotebookDocumentSyncFeature=void 0;const Tu=Zn,pai=$le,WS=ms,mai=ro,b6e=Io;function w6e(s,e){return s[e]===void 0&&(s[e]={}),s[e]}var $F;(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=WS.NotebookDocument.create(f.asUri(h.uri),h.notebookType,h.version,n(u,f));return Object.keys(h.metadata).length>0&&(p.metadata=r(h.metadata)),p}e.asNotebookDocument=i;function n(h,u){return h.map(f=>o(f,u))}e.asNotebookCells=n;function r(h){return c(new Set,h)}e.asMetadata=r;function o(h,u){const f=WS.NotebookCell.create(a(h.kind),u.asUri(h.document.uri));return Object.keys(h.metadata).length>0&&(f.metadata=r(h.metadata)),h.executionSummary!==void 0&&b6e.number(h.executionSummary.executionOrder)&&b6e.boolean(h.executionSummary.success)&&(f.executionSummary={executionOrder:h.executionSummary.executionOrder,success:h.executionSummary.success}),f}e.asNotebookCell=o;function a(h){switch(h){case Tu.NotebookCellKind.Markup:return WS.NotebookCellKind.Markup;case Tu.NotebookCellKind.Code:return WS.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={}))})($F||($F={}));var q1e;(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})(Vne||(Vne={}));class hq{constructor(e,t){this.client=e,this.options=t,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(Une.asDocumentSelector(t)),Tu.workspace.onDidOpenNotebookDocument(i=>{this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i)},void 0,this.disposables);for(const i of Tu.workspace.notebookDocuments)this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i);Tu.workspace.onDidChangeNotebookDocument(i=>this.didChangeNotebookDocument(i),void 0,this.disposables),this.options.save===!0&&Tu.workspace.onDidSaveNotebookDocument(i=>this.didSave(i),void 0,this.disposables),Tu.workspace.onDidCloseNotebookDocument(i=>{this.didClose(i),this.notebookDidOpen.delete(i.uri.toString())},void 0,this.disposables)}getState(){for(const e of Tu.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 Tu.languages.match(this.selector,e)>0}didOpenNotebookCellTextDocument(e,t){if(Tu.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 r=i.uris.has(t.document.uri.toString());if(n&&r||!n&&!r)return;if(n){const o=this.getMatchingCells(e);if(o!==void 0){const a=this.asNotebookDocumentChangeEvent(e,void 0,i,o);a!==void 0&&this.doSendChange(a,o).catch(()=>{})}}}else n&&this.doSendOpen(e,[t]).catch(()=>{})}didChangeNotebookCellTextDocument(e,t){Tu.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,r=i.cells.findIndex(o=>o.document.uri.toString()===n.toString());if(r!==-1)if(r===0&&i.cells.length===1)this.doSendClose(e,i.cells).catch(()=>{});else{const o=i.cells.slice(),a=o.splice(r,1);this.doSendChange({notebook:e,cells:{structure:{array:{start:r,deleteCount:1},didClose:a}}},o).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 r=this.asNotebookDocumentChangeEvent(e.notebook,e,i,n);r!==void 0&&this.doSendChange(r,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(r,o)=>{const a=$F.c2p.asNotebookDocument(r,o,this.client.code2ProtocolConverter),c=o.map(l=>this.client.code2ProtocolConverter.asTextDocumentItem(l.document));try{await this.client.sendNotification(WS.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(),Vne.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 r=>{try{await this.client.sendNotification(WS.DidChangeNotebookDocumentNotification.type,{notebookDocument:$F.c2p.asVersionedNotebookDocumentIdentifier(r.notebook,this.client.code2ProtocolConverter),change:$F.c2p.asNotebookDocumentChangeEvent(r,this.client.code2ProtocolConverter)})}catch(o){throw this.client.error("Sending DidChangeNotebookDocumentNotification failed",o),o}},n=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),Vne.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(WS.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(n.uri)}})}catch(r){throw this.client.error("Sending DidSaveNotebookDocumentNotification failed",r),r}},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(r,o)=>{try{await this.client.sendNotification(WS.DidCloseNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(r.uri)},cellTextDocuments:o.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 r={notebook:e};t?.metadata!==void 0&&(r.metadata=$F.c2p.asMetadata(t.metadata));let o;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){const a=[];o=new Set(n.map(c=>c.document.uri.toString()));for(const c of t.cellChanges)o.has(c.cell.document.uri.toString())&&(c.executionSummary!==void 0||c.metadata!==void 0)&&a.push(c.cell);a.length>0&&(r.cells=r.cells??{},r.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=q1e.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));r.cells=r.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)}r.cells.structure={array:l,didOpen:u,didClose:f}}}return Object.keys(r).length>1?r: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||Q1e.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(r=>{const o=r.document.languageId;return i.some(a=>a.language==="*"||o===a.language)}):t;return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells=="function"?this.client.clientOptions.notebookDocumentOptions.filterCells(e,n):n}}class J1{constructor(e){this.client=e,this.registrations=new Map,this.registrationType=WS.NotebookDocumentSyncRegistrationType.type,Tu.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==J1.CellScheme)return;const[i,n]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||n===void 0))for(const r of this.registrations.values())r instanceof hq&&r.didOpenNotebookCellTextDocument(i,n)}),Tu.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;const i=t.document;if(i.uri.scheme!==J1.CellScheme)return;const[n]=this.findNotebookDocumentAndCell(i);if(n!==void 0)for(const r of this.registrations.values())r instanceof hq&&r.didChangeNotebookCellTextDocument(n,t)}),Tu.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==J1.CellScheme)return;const[i,n]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||n===void 0))for(const r of this.registrations.values())r instanceof hq&&r.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=w6e(w6e(e,"notebookDocument"),"synchronization");t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){const t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(Une.asDocumentSelector(t)))}initialize(e){const t=e.notebookDocumentSync;if(t===void 0)return;const i=t.id??mai.generateUuid();this.register({id:i,registerOptions:t})}register(e){const t=new hq(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!==J1.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&Tu.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 Tu.workspace.notebookDocuments)for(const n of i.getCells())if(n.document.uri.toString()===t)return[i,n];return[void 0,void 0]}}ide.NotebookDocumentSyncFeature=J1;J1.CellScheme="vscode-notebook-cell";var BD={};Object.defineProperty(BD,"__esModule",{value:!0});BD.SyncConfigurationFeature=BD.toJSONObject=BD.ConfigurationFeature=void 0;const vB=Zn,ZV=ms,_ai=Io,vai=ro,y6e=Nn;class bai{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(ZV.ConfigurationRequest.type,(t,i)=>{let n=o=>{let a=[];for(let c of o.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},r=e.middleware.workspace;return r&&r.configuration?r.configuration(t,i,n):n(t)})}getConfiguration(e,t){let i=null;if(t){let n=t.lastIndexOf(".");if(n===-1)i=hL(vB.workspace.getConfiguration(void 0,e).get(t));else{let r=vB.workspace.getConfiguration(t.substr(0,n),e);r&&(i=hL(r.get(t.substr(n+1))))}}else{let n=vB.workspace.getConfiguration(void 0,e);i={};for(let r of Object.keys(n))n.has(r)&&(i[r]=hL(n.get(r)))}return i===void 0&&(i=null),i}clear(){}}BD.ConfigurationFeature=bai;function hL(s){if(s){if(Array.isArray(s))return s.map(hL);if(typeof s=="object"){const e=Object.create(null);for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=hL(s[t]));return e}}return s}BD.toJSONObject=hL;class wai{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 ZV.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,y6e.ensure)((0,y6e.ensure)(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){this.isCleared=!1;let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:vai.generateUuid(),registerOptions:{section:e}})}register(e){let t=vB.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(_ai.string(e)?i=[e]:i=e,i!==void 0&&t!==void 0&&!i.some(a=>t.affectsConfiguration(a)))return;const n=async o=>o===void 0?this._client.sendNotification(ZV.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(ZV.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(o)});let r=this._client.middleware.workspace?.didChangeConfiguration;(r?r(i,n):n(i)).catch(o=>{this._client.error(`Sending notification ${ZV.DidChangeConfigurationNotification.type.method} failed`,o)})}extractSettingsInformation(e){function t(r,o){let a=r;for(let c=0;c=0?c=vB.workspace.getConfiguration(o.substr(0,a),i).get(o.substr(a+1)):c=vB.workspace.getConfiguration(void 0,i).get(o),c){let l=e[r].split(".");t(n,l)[l[l.length-1]]=hL(c)}}return n}}BD.SyncConfigurationFeature=wai;var Yf={};Object.defineProperty(Yf,"__esModule",{value:!0});Yf.DidSaveTextDocumentFeature=Yf.WillSaveWaitUntilFeature=Yf.WillSaveFeature=Yf.DidChangeTextDocumentFeature=Yf.DidCloseTextDocumentFeature=Yf.DidOpenTextDocumentFeature=void 0;const tm=Zn,ka=ms,Bc=Nn,o4=ro;class yai extends Bc.TextDocumentEventFeature{constructor(e,t){super(e,tm.workspace.onDidOpenTextDocument,ka.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,i=>e.code2ProtocolConverter.asOpenTextDocumentParams(i),i=>i,Bc.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,Bc.ensure)((0,Bc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:o4.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return ka.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;const t=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);tm.workspace.textDocuments.forEach(i=>{const n=i.uri.toString();if(!this._syncedDocuments.has(n)&&tm.languages.match(t,i)>0&&!this._client.hasDedicatedTextSynchronizationFeature(i)){const r=this._client.middleware,o=a=>this._client.sendNotification(this._type,this._createParams(a));(r.didOpen?r.didOpen(i,o):o(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)}}Yf.DidOpenTextDocumentFeature=yai;class Cai extends Bc.TextDocumentEventFeature{constructor(e,t,i){super(e,tm.workspace.onDidCloseTextDocument,ka.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,n=>e.code2ProtocolConverter.asCloseTextDocumentParams(n),n=>n,Bc.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t,this._pendingTextDocumentChanges=i}get registrationType(){return ka.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,Bc.ensure)((0,Bc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:o4.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(tm.languages.match(t,n)>0&&!this._selectorFilter(i,n)&&!this._client.hasDedicatedTextSynchronizationFeature(n)){let r=this._client.middleware,o=a=>this._client.sendNotification(this._type,this._createParams(a));this._syncedDocuments.delete(n.uri.toString()),(r.didClose?r.didClose(n,o):o(n)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)})}})}}Yf.DidCloseTextDocumentFeature=Cai;class Sai extends Bc.DynamicDocumentFeature{constructor(e,t){super(e),this._changeData=new Map,this._onNotificationSent=new tm.EventEmitter,this._onPendingChangeAdded=new tm.EventEmitter,this._pendingTextDocumentChanges=t,this._syncKind=ka.TextDocumentSyncKind.None}get onNotificationSent(){return this._onNotificationSent.event}get onPendingChangeAdded(){return this._onPendingChangeAdded.event}get syncKind(){return this._syncKind}get registrationType(){return ka.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,Bc.ensure)((0,Bc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.change!==void 0&&i.change!==ka.TextDocumentSyncKind.None&&this.register({id:o4.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:i.change})})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=tm.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 r of this._changeData.values())if(tm.languages.match(r.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){const o=this._client.middleware;if(r.syncKind===ka.TextDocumentSyncKind.Incremental){const a=async c=>{const l=this._client.code2ProtocolConverter.asChangeTextDocumentParams(c,t,i);await this._client.sendNotification(ka.DidChangeTextDocumentNotification.type,l),this.notificationSent(c.document,ka.DidChangeTextDocumentNotification.type,l)};n.push(o.didChange?o.didChange(e,c=>a(c)):a(e))}else if(r.syncKind===ka.TextDocumentSyncKind.Full){const a=async c=>{const l=c.document.uri.toString();this._pendingTextDocumentChanges.set(l,c.document),this._onPendingChangeAdded.fire()};n.push(o.didChange?o.didChange(e,c=>a(c)):a(e))}}return Promise.all(n).then(void 0,r=>{throw this._client.error(`Sending document notification ${ka.DidChangeTextDocumentNotification.type.method} failed`,r),r})}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=ka.TextDocumentSyncKind.None;else{this._syncKind=ka.TextDocumentSyncKind.None;for(const t of this._changeData.values())if(this.updateSyncKind(t.syncKind),this._syncKind===ka.TextDocumentSyncKind.Full)break}}clear(){this._pendingTextDocumentChanges.clear(),this._changeData.clear(),this._syncKind=ka.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(tm.languages.match(t.documentSelector,e)>0)return{send:i=>this.callback(i)}}updateSyncKind(e){if(this._syncKind!==ka.TextDocumentSyncKind.Full)switch(e){case ka.TextDocumentSyncKind.Full:this._syncKind=e;break;case ka.TextDocumentSyncKind.Incremental:this._syncKind===ka.TextDocumentSyncKind.None&&(this._syncKind=ka.TextDocumentSyncKind.Incremental);break}}}Yf.DidChangeTextDocumentFeature=Sai;class Aai extends Bc.TextDocumentEventFeature{constructor(e){super(e,tm.workspace.onWillSaveTextDocument,ka.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),t=>t.document,(t,i)=>Bc.TextDocumentEventFeature.textDocumentFilter(t,i.document))}get registrationType(){return ka.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,Bc.ensure)((0,Bc.ensure)(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSave&&this.register({id:o4.generateUuid(),registerOptions:{documentSelector:t}})}getTextDocument(e){return e.document}}Yf.WillSaveFeature=Aai;class Eai extends Bc.DynamicDocumentFeature{constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return ka.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,Bc.ensure)((0,Bc.ensure)(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSaveWaitUntil&&this.register({id:o4.generateUuid(),registerOptions:{documentSelector:t}})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=tm.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(Bc.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,i=n=>this._client.sendRequest(ka.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(n)).then(async r=>{let o=await this._client.protocol2CodeConverter.asTextEdits(r);return o===void 0?[]:o});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)}}Yf.WillSaveWaitUntilFeature=Eai;class xai extends Bc.TextDocumentEventFeature{constructor(e){super(e,tm.workspace.onDidSaveTextDocument,ka.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),t=>t,Bc.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return ka.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,Bc.ensure)((0,Bc.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:o4.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},n)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}getTextDocument(e){return e}}Yf.DidSaveTextDocumentFeature=xai;var nde={};Object.defineProperty(nde,"__esModule",{value:!0});nde.CompletionItemFeature=void 0;const Dai=Zn,xr=ms,Mge=Nn,kai=ro,Iai=[xr.CompletionItemKind.Text,xr.CompletionItemKind.Method,xr.CompletionItemKind.Function,xr.CompletionItemKind.Constructor,xr.CompletionItemKind.Field,xr.CompletionItemKind.Variable,xr.CompletionItemKind.Class,xr.CompletionItemKind.Interface,xr.CompletionItemKind.Module,xr.CompletionItemKind.Property,xr.CompletionItemKind.Unit,xr.CompletionItemKind.Value,xr.CompletionItemKind.Enum,xr.CompletionItemKind.Keyword,xr.CompletionItemKind.Snippet,xr.CompletionItemKind.Color,xr.CompletionItemKind.File,xr.CompletionItemKind.Reference,xr.CompletionItemKind.Folder,xr.CompletionItemKind.EnumMember,xr.CompletionItemKind.Constant,xr.CompletionItemKind.Struct,xr.CompletionItemKind.Event,xr.CompletionItemKind.Operator,xr.CompletionItemKind.TypeParameter];class Tai extends Mge.TextDocumentLanguageFeature{constructor(e){super(e,xr.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,Mge.ensure)((0,Mge.ensure)(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[xr.MarkupKind.Markdown,xr.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[xr.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[xr.InsertTextMode.asIs,xr.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=xr.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:Iai},t.completionList={itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]}}initialize(e,t){const i=this.getRegistrationOptions(t,e.completionProvider);i&&this.register({id:kai.generateUuid(),registerOptions:i})}registerLanguageProvider(e,t){this.labelDetailsSupport.set(t,!!e.completionItem?.labelDetailsSupport);const i=e.triggerCharacters??[],n=e.allCommitCharacters,r=e.documentSelector,o={provideCompletionItems:(a,c,l,d)=>{const h=this._client,u=this._client.middleware,f=(p,m,v,b)=>h.sendRequest(xr.CompletionRequest.type,h.code2ProtocolConverter.asCompletionParams(p,m,v),b).then(w=>b.isCancellationRequested?null:h.protocol2CodeConverter.asCompletionResult(w,n,b),w=>h.handleFailedRequest(xr.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(xr.CompletionResolveRequest.type,l.code2ProtocolConverter.asCompletionItem(u,!!this.labelDetailsSupport.get(t)),f).then(p=>f.isCancellationRequested?null:l.protocol2CodeConverter.asCompletionItem(p),p=>l.handleFailedRequest(xr.CompletionResolveRequest.type,f,p,u));return d.resolveCompletionItem?d.resolveCompletionItem(a,c,h):h(a,c)}:void 0};return[Dai.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),o,...i),o]}}nde.CompletionItemFeature=Tai;var sde={};Object.defineProperty(sde,"__esModule",{value:!0});sde.HoverFeature=void 0;const Lai=Zn,K4=ms,Nge=Nn,Rai=ro;class Mai extends Nge.TextDocumentLanguageFeature{constructor(e){super(e,K4.HoverRequest.type)}fillClientCapabilities(e){const t=(0,Nge.ensure)((0,Nge.ensure)(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[K4.MarkupKind.Markdown,K4.MarkupKind.PlainText]}initialize(e,t){const i=this.getRegistrationOptions(t,e.hoverProvider);i&&this.register({id:Rai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideHover:(n,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(K4.HoverRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asHover(f),f=>a.handleFailedRequest(K4.HoverRequest.type,u,f,null)),l=a.middleware;return l.provideHover?l.provideHover(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Lai.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}sde.HoverFeature=Mai;var rde={};Object.defineProperty(rde,"__esModule",{value:!0});rde.DefinitionFeature=void 0;const Nai=Zn,Pge=ms,Fge=Nn,Pai=ro;class Fai extends Fge.TextDocumentLanguageFeature{constructor(e){super(e,Pge.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,Fge.ensure)((0,Fge.ensure)(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.definitionProvider);i&&this.register({id:Pai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDefinition:(n,r,o)=>{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,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Nai.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}rde.DefinitionFeature=Fai;var ode={};Object.defineProperty(ode,"__esModule",{value:!0});ode.SignatureHelpFeature=void 0;const C6e=Zn,q4=ms,Oge=Nn,Oai=ro;class Bai extends Oge.TextDocumentLanguageFeature{constructor(e){super(e,q4.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,Oge.ensure)((0,Oge.ensure)(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[q4.MarkupKind.Markdown,q4.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,n,r,o)=>{const a=this._client,c=(d,h,u,f)=>a.sendRequest(q4.SignatureHelpRequest.type,a.code2ProtocolConverter.asSignatureHelpParams(d,h,u),f).then(p=>f.isCancellationRequested?null:a.protocol2CodeConverter.asSignatureHelp(p,f),p=>a.handleFailedRequest(q4.SignatureHelpRequest.type,f,p,null)),l=a.middleware;return l.provideSignatureHelp?l.provideSignatureHelp(i,n,o,r,c):c(i,n,o,r)}};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 C6e.languages.registerSignatureHelpProvider(i,t,...n)}else{const n={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return C6e.languages.registerSignatureHelpProvider(i,t,n)}}}ode.SignatureHelpFeature=Bai;var ade={};Object.defineProperty(ade,"__esModule",{value:!0});ade.DocumentHighlightFeature=void 0;const Wai=Zn,Bge=ms,Wge=Nn,Hai=ro;class Uai extends Wge.TextDocumentLanguageFeature{constructor(e){super(e,Bge.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,Wge.ensure)((0,Wge.ensure)(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentHighlightProvider);i&&this.register({id:Hai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentHighlights:(n,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Bge.DocumentHighlightRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDocumentHighlights(f,u),f=>a.handleFailedRequest(Bge.DocumentHighlightRequest.type,u,f,null)),l=a.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(n,r,o,c):c(n,r,o)}};return[Wai.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}ade.DocumentHighlightFeature=Uai;var AFe={};(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.DocumentSymbolFeature=s.SupportedSymbolTags=s.SupportedSymbolKinds=void 0;const e=Zn,t=ms,i=Nn,n=ro;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 r 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=r})(AFe);var cde={};Object.defineProperty(cde,"__esModule",{value:!0});cde.WorkspaceSymbolFeature=void 0;const Vai=Zn,Q4=ms,Hge=Nn,S6e=AFe,zai=ro;class $ai extends Hge.WorkspaceFeature{constructor(e){super(e,Q4.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,Hge.ensure)((0,Hge.ensure)(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:S6e.SupportedSymbolKinds},t.tagSupport={valueSet:S6e.SupportedSymbolTags},t.resolveSupport={properties:["location.range"]}}initialize(e){e.workspaceSymbolProvider&&this.register({id:zai.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){const t={provideWorkspaceSymbols:(i,n)=>{const r=this._client,o=(c,l)=>r.sendRequest(Q4.WorkspaceSymbolRequest.type,{query:c},l).then(d=>l.isCancellationRequested?null:r.protocol2CodeConverter.asSymbolInformations(d,l),d=>r.handleFailedRequest(Q4.WorkspaceSymbolRequest.type,l,d,null)),a=r.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(i,n,o):o(i,n)},resolveWorkspaceSymbol:e.resolveProvider===!0?(i,n)=>{const r=this._client,o=(c,l)=>r.sendRequest(Q4.WorkspaceSymbolResolveRequest.type,r.code2ProtocolConverter.asWorkspaceSymbol(c),l).then(d=>l.isCancellationRequested?null:r.protocol2CodeConverter.asSymbolInformation(d),d=>r.handleFailedRequest(Q4.WorkspaceSymbolResolveRequest.type,l,d,null)),a=r.middleware;return a.resolveWorkspaceSymbol?a.resolveWorkspaceSymbol(i,n,o):o(i,n)}:void 0};return[Vai.languages.registerWorkspaceSymbolProvider(t),t]}}cde.WorkspaceSymbolFeature=$ai;var lde={};Object.defineProperty(lde,"__esModule",{value:!0});lde.ReferencesFeature=void 0;const Gai=Zn,Uge=ms,Vge=Nn,Kai=ro;class qai extends Vge.TextDocumentLanguageFeature{constructor(e){super(e,Uge.ReferencesRequest.type)}fillClientCapabilities(e){(0,Vge.ensure)((0,Vge.ensure)(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.referencesProvider);i&&this.register({id:Kai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideReferences:(n,r,o,a)=>{const c=this._client,l=(h,u,f,p)=>c.sendRequest(Uge.ReferencesRequest.type,c.code2ProtocolConverter.asReferenceParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asReferences(m,p),m=>c.handleFailedRequest(Uge.ReferencesRequest.type,p,m,null)),d=c.middleware;return d.provideReferences?d.provideReferences(n,r,o,a,l):l(n,r,o,a)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Gai.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}lde.ReferencesFeature=qai;var dde={};Object.defineProperty(dde,"__esModule",{value:!0});dde.CodeActionFeature=void 0;const Qai=Zn,Ip=ms,jai=ro,zge=Nn;class Yai extends zge.TextDocumentLanguageFeature{constructor(e){super(e,Ip.CodeActionRequest.type)}fillClientCapabilities(e){const t=(0,zge.ensure)((0,zge.ensure)(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:["edit"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[Ip.CodeActionKind.Empty,Ip.CodeActionKind.QuickFix,Ip.CodeActionKind.Refactor,Ip.CodeActionKind.RefactorExtract,Ip.CodeActionKind.RefactorInline,Ip.CodeActionKind.RefactorRewrite,Ip.CodeActionKind.Source,Ip.CodeActionKind.SourceOrganizeImports]}},t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.codeActionProvider);i&&this.register({id:jai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideCodeActions:(n,r,o,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(Ip.CodeActionRequest.type,m,p).then(v=>p.isCancellationRequested||v===null||v===void 0?null:c.protocol2CodeConverter.asCodeActionResult(v,p),v=>c.handleFailedRequest(Ip.CodeActionRequest.type,p,v,null))},d=c.middleware;return d.provideCodeActions?d.provideCodeActions(n,r,o,a,l):l(n,r,o,a)},resolveCodeAction:e.resolveProvider?(n,r)=>{const o=this._client,a=this._client.middleware,c=async(l,d)=>o.sendRequest(Ip.CodeActionResolveRequest.type,o.code2ProtocolConverter.asCodeActionSync(l),d).then(h=>d.isCancellationRequested?l:o.protocol2CodeConverter.asCodeAction(h,d),h=>o.handleFailedRequest(Ip.CodeActionResolveRequest.type,d,h,l));return a.resolveCodeAction?a.resolveCodeAction(n,r,c):c(n,r)}:void 0};return[Qai.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),i]}}dde.CodeActionFeature=Yai;var hde={};Object.defineProperty(hde,"__esModule",{value:!0});hde.CodeLensFeature=void 0;const A6e=Zn,RP=ms,Jai=ro,j4=Nn;class Xai extends j4.TextDocumentLanguageFeature{constructor(e){super(e,RP.CodeLensRequest.type)}fillClientCapabilities(e){(0,j4.ensure)((0,j4.ensure)(e,"textDocument"),"codeLens").dynamicRegistration=!0,(0,j4.ensure)((0,j4.ensure)(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(RP.CodeLensRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeCodeLensEmitter.fire()});const n=this.getRegistrationOptions(t,e.codeLensProvider);n&&this.register({id:Jai.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new A6e.EventEmitter,n={onDidChangeCodeLenses:i.event,provideCodeLenses:(r,o)=>{const a=this._client,c=(d,h)=>a.sendRequest(RP.CodeLensRequest.type,a.code2ProtocolConverter.asCodeLensParams(d),h).then(u=>h.isCancellationRequested?null:a.protocol2CodeConverter.asCodeLenses(u,h),u=>a.handleFailedRequest(RP.CodeLensRequest.type,h,u,null)),l=a.middleware;return l.provideCodeLenses?l.provideCodeLenses(r,o,c):c(r,o)},resolveCodeLens:e.resolveProvider?(r,o)=>{const a=this._client,c=(d,h)=>a.sendRequest(RP.CodeLensResolveRequest.type,a.code2ProtocolConverter.asCodeLens(d),h).then(u=>h.isCancellationRequested?d:a.protocol2CodeConverter.asCodeLens(u),u=>a.handleFailedRequest(RP.CodeLensResolveRequest.type,h,u,d)),l=a.middleware;return l.resolveCodeLens?l.resolveCodeLens(r,o,c):c(r,o)}:void 0};return[A6e.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),{provider:n,onDidChangeCodeLensEmitter:i}]}}hde.CodeLensFeature=Xai;var WD={};Object.defineProperty(WD,"__esModule",{value:!0});WD.DocumentOnTypeFormattingFeature=WD.DocumentRangeFormattingFeature=WD.DocumentFormattingFeature=void 0;const ude=Zn,mb=ms,EFe=ro,AA=Nn;var _U;(function(s){function e(t){const i=ude.workspace.getConfiguration("files",t);return{trimTrailingWhitespace:i.get("trimTrailingWhitespace"),trimFinalNewlines:i.get("trimFinalNewlines"),insertFinalNewline:i.get("insertFinalNewline")}}s.fromConfiguration=e})(_U||(_U={}));class Zai extends AA.TextDocumentLanguageFeature{constructor(e){super(e,mb.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,AA.ensure)((0,AA.ensure)(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentFormattingProvider);i&&this.register({id:EFe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentFormattingEdits:(n,r,o)=>{const a=this._client,c=(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),options:a.code2ProtocolConverter.asFormattingOptions(h,_U.fromConfiguration(d))};return a.sendRequest(mb.DocumentFormattingRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asTextEdits(p,u),p=>a.handleFailedRequest(mb.DocumentFormattingRequest.type,u,p,null))},l=a.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(n,r,o,c):c(n,r,o)}};return[ude.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}WD.DocumentFormattingFeature=Zai;class eci extends AA.TextDocumentLanguageFeature{constructor(e){super(e,mb.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){const t=(0,AA.ensure)((0,AA.ensure)(e,"textDocument"),"rangeFormatting");t.dynamicRegistration=!0,t.rangesSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);i&&this.register({id:EFe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentRangeFormattingEdits:(n,r,o,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,_U.fromConfiguration(h))};return c.sendRequest(mb.DocumentRangeFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(mb.DocumentRangeFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangeFormattingEdits?d.provideDocumentRangeFormattingEdits(n,r,o,a,l):l(n,r,o,a)}};return e.rangesSupport&&(i.provideDocumentRangesFormattingEdits=(n,r,o,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,_U.fromConfiguration(h))};return c.sendRequest(mb.DocumentRangesFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(mb.DocumentRangesFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangesFormattingEdits?d.provideDocumentRangesFormattingEdits(n,r,o,a,l):l(n,r,o,a)}),[ude.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}WD.DocumentRangeFormattingFeature=eci;class tci extends AA.TextDocumentLanguageFeature{constructor(e){super(e,mb.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,AA.ensure)((0,AA.ensure)(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);i&&this.register({id:EFe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideOnTypeFormattingEdits:(r,o,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,_U.fromConfiguration(f))};return d.sendRequest(mb.DocumentOnTypeFormattingRequest.type,w,b).then(y=>b.isCancellationRequested?null:d.protocol2CodeConverter.asTextEdits(y,b),y=>d.handleFailedRequest(mb.DocumentOnTypeFormattingRequest.type,b,y,null))},u=d.middleware;return u.provideOnTypeFormattingEdits?u.provideOnTypeFormattingEdits(r,o,a,c,l,h):h(r,o,a,c,l)}},n=e.moreTriggerCharacter||[];return[ude.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.firstTriggerCharacter,...n),i]}}WD.DocumentOnTypeFormattingFeature=tci;var gde={};Object.defineProperty(gde,"__esModule",{value:!0});gde.RenameFeature=void 0;const ici=Zn,t0=ms,nci=ro,E6e=Io,$ge=Nn;class sci extends $ge.TextDocumentLanguageFeature{constructor(e){super(e,t0.RenameRequest.type)}fillClientCapabilities(e){let t=(0,$ge.ensure)((0,$ge.ensure)(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=t0.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.renameProvider);i&&(E6e.boolean(e.renameProvider)&&(i.prepareProvider=!1),this.register({id:nci.generateUuid(),registerOptions:i}))}registerLanguageProvider(e){const t=e.documentSelector,i={provideRenameEdits:(n,r,o,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(t0.RenameRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asWorkspaceEdit(v,p),v=>c.handleFailedRequest(t0.RenameRequest.type,p,v,null,!1))},d=c.middleware;return d.provideRenameEdits?d.provideRenameEdits(n,r,o,a,l):l(n,r,o,a)},prepareRename:e.prepareProvider?(n,r,o)=>{const a=this._client,c=(d,h,u)=>{let f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),position:a.code2ProtocolConverter.asPosition(h)};return a.sendRequest(t0.PrepareRenameRequest.type,f,u).then(p=>u.isCancellationRequested?null:t0.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&&t0.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,r,o,c):c(n,r,o)}:void 0};return[this.registerProvider(t,i),i]}registerProvider(e,t){return ici.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}isDefaultBehavior(e){const t=e;return t&&E6e.boolean(t.defaultBehavior)}}gde.RenameFeature=sci;var fde={};Object.defineProperty(fde,"__esModule",{value:!0});fde.DocumentLinkFeature=void 0;const rci=Zn,Y4=ms,Gge=Nn,oci=ro;class aci extends Gge.TextDocumentLanguageFeature{constructor(e){super(e,Y4.DocumentLinkRequest.type)}fillClientCapabilities(e){const t=(0,Gge.ensure)((0,Gge.ensure)(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentLinkProvider);i&&this.register({id:oci.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentLinks:(n,r)=>{const o=this._client,a=(l,d)=>o.sendRequest(Y4.DocumentLinkRequest.type,o.code2ProtocolConverter.asDocumentLinkParams(l),d).then(h=>d.isCancellationRequested?null:o.protocol2CodeConverter.asDocumentLinks(h,d),h=>o.handleFailedRequest(Y4.DocumentLinkRequest.type,d,h,null)),c=o.middleware;return c.provideDocumentLinks?c.provideDocumentLinks(n,r,a):a(n,r)},resolveDocumentLink:e.resolveProvider?(n,r)=>{const o=this._client;let a=(l,d)=>o.sendRequest(Y4.DocumentLinkResolveRequest.type,o.code2ProtocolConverter.asDocumentLink(l),d).then(h=>d.isCancellationRequested?l:o.protocol2CodeConverter.asDocumentLink(h),h=>o.handleFailedRequest(Y4.DocumentLinkResolveRequest.type,d,h,l));const c=o.middleware;return c.resolveDocumentLink?c.resolveDocumentLink(n,r,a):a(n,r)}:void 0};return[rci.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}fde.DocumentLinkFeature=aci;var pde={};Object.defineProperty(pde,"__esModule",{value:!0});pde.ExecuteCommandFeature=void 0;const cci=Zn,Kge=ms,lci=ro,x6e=Nn;class dci{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 Kge.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,x6e.ensure)((0,x6e.ensure)(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register({id:lci.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){const t=this._client,i=t.middleware,n=(r,o)=>{let a={command:r,arguments:o};return t.sendRequest(Kge.ExecuteCommandRequest.type,a).then(void 0,c=>t.handleFailedRequest(Kge.ExecuteCommandRequest.type,void 0,c,void 0))};if(e.registerOptions.commands){const r=[];for(const o of e.registerOptions.commands)r.push(cci.commands.registerCommand(o,(...a)=>i.executeCommand?i.executeCommand(o,a,n):n(o,a)));this._commands.set(e.id,r)}}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()}}pde.ExecuteCommandFeature=dci;var mde={};Object.defineProperty(mde,"__esModule",{value:!0});mde.FileSystemWatcherFeature=void 0;const hci=Zn,i0=ms,uq=Nn;class uci{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 i0.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,uq.ensure)((0,uq.ensure)(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0,(0,uq.ensure)((0,uq.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 r=!0,o=!0,a=!0;i.kind!==void 0&&i.kind!==null&&(r=(i.kind&i0.WatchKind.Create)!==0,o=(i.kind&i0.WatchKind.Change)!==0,a=(i.kind&i0.WatchKind.Delete)!==0);const c=hci.workspace.createFileSystemWatcher(n,!r,!o,!a);this.hookListeners(c,r,o,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,r){t&&e.onDidCreate(o=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(o),type:i0.FileChangeType.Created}),null,r),i&&e.onDidChange(o=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(o),type:i0.FileChangeType.Changed}),null,r),n&&e.onDidDelete(o=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(o),type:i0.FileChangeType.Deleted}),null,r)}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()}}mde.FileSystemWatcherFeature=uci;var _de={};Object.defineProperty(_de,"__esModule",{value:!0});_de.ColorProviderFeature=void 0;const gci=Zn,J4=ms,qge=Nn;class fci extends qge.TextDocumentLanguageFeature{constructor(e){super(e,J4.DocumentColorRequest.type)}fillClientCapabilities(e){(0,qge.ensure)((0,qge.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,r,o)=>{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(J4.ColorPresentationRequest.type,f,u).then(p=>u.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(p,u),p=>a.handleFailedRequest(J4.ColorPresentationRequest.type,u,p,null))},l=a.middleware;return l.provideColorPresentations?l.provideColorPresentations(n,r,o,c):c(n,r,o)},provideDocumentColors:(n,r)=>{const o=this._client,a=(l,d)=>{const h={textDocument:o.code2ProtocolConverter.asTextDocumentIdentifier(l)};return o.sendRequest(J4.DocumentColorRequest.type,h,d).then(u=>d.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(u,d),u=>o.handleFailedRequest(J4.DocumentColorRequest.type,d,u,null))},c=o.middleware;return c.provideDocumentColors?c.provideDocumentColors(n,r,a):a(n,r)}};return[gci.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}_de.ColorProviderFeature=fci;var vde={};Object.defineProperty(vde,"__esModule",{value:!0});vde.ImplementationFeature=void 0;const pci=Zn,Qge=ms,jge=Nn;class mci extends jge.TextDocumentLanguageFeature{constructor(e){super(e,Qge.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,jge.ensure)((0,jge.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,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Qge.ImplementationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Qge.ImplementationRequest.type,u,f,null)),l=a.middleware;return l.provideImplementation?l.provideImplementation(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return pci.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}vde.ImplementationFeature=mci;var bde={};Object.defineProperty(bde,"__esModule",{value:!0});bde.TypeDefinitionFeature=void 0;const _ci=Zn,Yge=ms,X4=Nn;class vci extends X4.TextDocumentLanguageFeature{constructor(e){super(e,Yge.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,X4.ensure)((0,X4.ensure)(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=(0,X4.ensure)((0,X4.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,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Yge.TypeDefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Yge.TypeDefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return _ci.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}bde.TypeDefinitionFeature=vci;var vU={};Object.defineProperty(vU,"__esModule",{value:!0});vU.WorkspaceFoldersFeature=vU.arrayDiff=void 0;const bci=ro,gq=Zn,Z4=ms;function Jge(s,e){if(s!=null)return s[e]}function j1e(s,e){return s.filter(t=>e.indexOf(t)<0)}vU.arrayDiff=j1e;class wci{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 Z4.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){const t=gq.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(Z4.WorkspaceFoldersRequest.type,r=>{const o=()=>{const c=gq.workspace.workspaceFolders;return c===void 0?null:c.map(d=>this.asProtocol(d))},a=t.middleware.workspace;return a&&a.workspaceFolders?a.workspaceFolders(r,o):o()});const i=Jge(Jge(Jge(e,"workspace"),"workspaceFolders"),"changeNotifications");let n;typeof i=="string"?n=i:i===!0&&(n=bci.generateUuid()),n&&this.register({id:n,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){const i=j1e(this._initialFolders,e),n=j1e(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 ${Z4.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(Z4.DidChangeWorkspaceFoldersNotification.type,i)}register(e){let t=e.id,i=this._client,n=gq.workspace.onDidChangeWorkspaceFolders(r=>{let o=l=>this.doSendEvent(l.added,l.removed),a=i.middleware.workspace;(a&&a.didChangeWorkspaceFolders?a.didChangeWorkspaceFolders(r,o):o(r)).catch(l=>{this._client.error(`Sending notification ${Z4.DidChangeWorkspaceFoldersNotification.type.method} failed`,l)})});this._listeners.set(t,n),this.sendInitialEvent(gq.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}}}vU.WorkspaceFoldersFeature=wci;var wde={};Object.defineProperty(wde,"__esModule",{value:!0});wde.FoldingRangeFeature=void 0;const D6e=Zn,n0=ms,eV=Nn;class yci extends eV.TextDocumentLanguageFeature{constructor(e){super(e,n0.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,eV.ensure)((0,eV.ensure)(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[n0.FoldingRangeKind.Comment,n0.FoldingRangeKind.Imports,n0.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1},(0,eV.ensure)((0,eV.ensure)(e,"workspace"),"foldingRange").refreshSupport=!0}initialize(e,t){this._client.onRequest(n0.FoldingRangeRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.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 D6e.EventEmitter,n={onDidChangeFoldingRanges:i.event,provideFoldingRanges:(r,o,a)=>{const c=this._client,l=(h,u,f)=>{const p={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h)};return c.sendRequest(n0.FoldingRangeRequest.type,p,f).then(m=>f.isCancellationRequested?null:c.protocol2CodeConverter.asFoldingRanges(m,f),m=>c.handleFailedRequest(n0.FoldingRangeRequest.type,f,m,null))},d=c.middleware;return d.provideFoldingRanges?d.provideFoldingRanges(r,o,a,l):l(r,o,a)}};return[D6e.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),{provider:n,onDidChangeFoldingRange:i}]}}wde.FoldingRangeFeature=yci;var yde={};Object.defineProperty(yde,"__esModule",{value:!0});yde.DeclarationFeature=void 0;const Cci=Zn,Xge=ms,Zge=Nn;class Sci extends Zge.TextDocumentLanguageFeature{constructor(e){super(e,Xge.DeclarationRequest.type)}fillClientCapabilities(e){const t=(0,Zge.ensure)((0,Zge.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,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Xge.DeclarationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDeclarationResult(f,u),f=>a.handleFailedRequest(Xge.DeclarationRequest.type,u,f,null)),l=a.middleware;return l.provideDeclaration?l.provideDeclaration(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Cci.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}yde.DeclarationFeature=Sci;var Cde={};Object.defineProperty(Cde,"__esModule",{value:!0});Cde.SelectionRangeFeature=void 0;const Aci=Zn,efe=ms,tfe=Nn;class Eci extends tfe.TextDocumentLanguageFeature{constructor(e){super(e,efe.SelectionRangeRequest.type)}fillClientCapabilities(e){const t=(0,tfe.ensure)((0,tfe.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,r,o)=>{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(efe.SelectionRangeRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asSelectionRanges(p,u),p=>a.handleFailedRequest(efe.SelectionRangeRequest.type,u,p,null))},l=a.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Aci.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Cde.SelectionRangeFeature=Eci;var Sde={};Object.defineProperty(Sde,"__esModule",{value:!0});Sde.ProgressFeature=void 0;const k6e=ms,xci=IG;function Dci(s,e){return s[e]===void 0&&(s[e]=Object.create(null)),s[e]}class kci{constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:"window",id:k6e.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){Dci(e,"window").workDoneProgress=!0}initialize(){const e=this._client,t=n=>{this.activeParts.delete(n)},i=n=>{this.activeParts.add(new xci.ProgressPart(this._client,n.token,t))};e.onRequest(k6e.WorkDoneProgressCreateRequest.type,i)}clear(){for(const e of this.activeParts)e.done();this.activeParts.clear()}}Sde.ProgressFeature=kci;var Ade={};Object.defineProperty(Ade,"__esModule",{value:!0});Ade.CallHierarchyFeature=void 0;const Ici=Zn,O0=ms,ife=Nn;class Tci{constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,i){const n=this.client,r=this.middleware,o=(a,c,l)=>{const d=n.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return n.sendRequest(O0.CallHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:n.protocol2CodeConverter.asCallHierarchyItems(h,l),h=>n.handleFailedRequest(O0.CallHierarchyPrepareRequest.type,l,h,null))};return r.prepareCallHierarchy?r.prepareCallHierarchy(e,t,i,o):o(e,t,i)}provideCallHierarchyIncomingCalls(e,t){const i=this.client,n=this.middleware,r=(o,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(o)};return i.sendRequest(O0.CallHierarchyIncomingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyIncomingCalls(l,a),l=>i.handleFailedRequest(O0.CallHierarchyIncomingCallsRequest.type,a,l,null))};return n.provideCallHierarchyIncomingCalls?n.provideCallHierarchyIncomingCalls(e,t,r):r(e,t)}provideCallHierarchyOutgoingCalls(e,t){const i=this.client,n=this.middleware,r=(o,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(o)};return i.sendRequest(O0.CallHierarchyOutgoingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyOutgoingCalls(l,a),l=>i.handleFailedRequest(O0.CallHierarchyOutgoingCallsRequest.type,a,l,null))};return n.provideCallHierarchyOutgoingCalls?n.provideCallHierarchyOutgoingCalls(e,t,r):r(e,t)}}class Lci extends ife.TextDocumentLanguageFeature{constructor(e){super(e,O0.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=e,i=(0,ife.ensure)((0,ife.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 Tci(t);return[Ici.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}Ade.CallHierarchyFeature=Lci;var Ede={};Object.defineProperty(Ede,"__esModule",{value:!0});Ede.SemanticTokensFeature=void 0;const fq=Zn,As=ms,tV=Nn,Rci=Io;class Mci extends tV.TextDocumentLanguageFeature{constructor(e){super(e,As.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){const t=(0,tV.ensure)((0,tV.ensure)(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[As.SemanticTokenTypes.namespace,As.SemanticTokenTypes.type,As.SemanticTokenTypes.class,As.SemanticTokenTypes.enum,As.SemanticTokenTypes.interface,As.SemanticTokenTypes.struct,As.SemanticTokenTypes.typeParameter,As.SemanticTokenTypes.parameter,As.SemanticTokenTypes.variable,As.SemanticTokenTypes.property,As.SemanticTokenTypes.enumMember,As.SemanticTokenTypes.event,As.SemanticTokenTypes.function,As.SemanticTokenTypes.method,As.SemanticTokenTypes.macro,As.SemanticTokenTypes.keyword,As.SemanticTokenTypes.modifier,As.SemanticTokenTypes.comment,As.SemanticTokenTypes.string,As.SemanticTokenTypes.number,As.SemanticTokenTypes.regexp,As.SemanticTokenTypes.operator,As.SemanticTokenTypes.decorator],t.tokenModifiers=[As.SemanticTokenModifiers.declaration,As.SemanticTokenModifiers.definition,As.SemanticTokenModifiers.readonly,As.SemanticTokenModifiers.static,As.SemanticTokenModifiers.deprecated,As.SemanticTokenModifiers.abstract,As.SemanticTokenModifiers.async,As.SemanticTokenModifiers.modification,As.SemanticTokenModifiers.documentation,As.SemanticTokenModifiers.defaultLibrary],t.formats=[As.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,tV.ensure)((0,tV.ensure)(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(As.SemanticTokensRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeSemanticTokensEmitter.fire()});const[n,r]=this.getRegistration(t,e.semanticTokensProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){const t=e.documentSelector,i=Rci.boolean(e.full)?e.full:e.full!==void 0,n=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,r=new fq.EventEmitter,o=i?{onDidChangeSemanticTokens:r.event,provideDocumentSemanticTokens:(f,p)=>{const m=this._client,v=m.middleware,b=(w,y)=>{const C={textDocument:m.code2ProtocolConverter.asTextDocumentIdentifier(w)};return m.sendRequest(As.SemanticTokensRequest.type,C,y).then(A=>y.isCancellationRequested?null:m.protocol2CodeConverter.asSemanticTokens(A,y),A=>m.handleFailedRequest(As.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(As.SemanticTokensDeltaRequest.type,L,A).then(async k=>A.isCancellationRequested?null:As.SemanticTokens.is(k)?await v.protocol2CodeConverter.asSemanticTokens(k,A):await v.protocol2CodeConverter.asSemanticTokensEdits(k,A),k=>v.handleFailedRequest(As.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(As.SemanticTokensRangeRequest.type,L,A).then(k=>A.isCancellationRequested?null:v.protocol2CodeConverter.asSemanticTokens(k,A),k=>v.handleFailedRequest(As.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 o!==void 0&&l.push(fq.languages.registerDocumentSemanticTokensProvider(u,o,h)),c!==void 0&&l.push(fq.languages.registerDocumentRangeSemanticTokensProvider(u,c,h)),[new fq.Disposable(()=>l.forEach(f=>f.dispose())),{range:c,full:o,onDidChangeSemanticTokensEmitter:r}]}}Ede.SemanticTokensFeature=Mci;var Jf={};Object.defineProperty(Jf,"__esModule",{value:!0});Jf.WillDeleteFilesFeature=Jf.WillRenameFilesFeature=Jf.WillCreateFilesFeature=Jf.DidDeleteFilesFeature=Jf.DidRenameFilesFeature=Jf.DidCreateFilesFeature=void 0;const R_=Zn,Nci=$le,EA=ms,Pci=ro;function I6e(s,e){return s[e]===void 0&&(s[e]={}),s[e]}function Fci(s,e){return s[e]}function T6e(s,e,t){s[e]=t}class uL{constructor(e,t,i,n,r){this._client=e,this._event=t,this._registrationType=i,this._clientCapability=n,this._serverCapability=r,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");T6e(t,"dynamicRegistration",!0),T6e(t,this._clientCapability,!0)}initialize(e){const t=e.workspace?.fileOperations,i=t!==void 0?Fci(t,this._serverCapability):void 0;if(i?.filters!==void 0)try{this.register({id:Pci.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 Nci.Minimatch(i.pattern.glob,uL.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 uL.getFileType(e)}async filter(e,t){const i=await Promise.all(e.files.map(async r=>{const o=t(r),a=o.fsPath.replace(/\\/g,"/");for(const c of this._filters.values())for(const l of c)if(!(l.scheme!==void 0&&l.scheme!==o.scheme)){if(l.matcher.match(a)){if(l.kind===void 0)return!0;const d=await this.getFileType(o);if(d===void 0)return this._client.error(`Failed to determine file type for ${o.toString()}.`),!0;if(d===R_.FileType.File&&l.kind===EA.FileOperationPatternKind.file||d===R_.FileType.Directory&&l.kind===EA.FileOperationPatternKind.folder)return!0}else if(l.kind===EA.FileOperationPatternKind.folder&&await uL.getFileType(o)===R_.FileType.Directory&&l.matcher.match(`${a}/`))return!0}return!1})),n=e.files.filter((r,o)=>i[o]);return{...e,files:n}}static async getFileType(e){try{return(await R_.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){const t={dot:!0};return e?.ignoreCase===!0&&(t.nocase=!0),t}}class _at extends uL{constructor(e,t,i,n,r,o,a){super(e,t,i,n,r),this._notificationType=i,this._accessUri=o,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 vat extends _at{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 uL.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 _at{constructor(e){super(e,R_.workspace.onDidCreateFiles,EA.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)}}Jf.DidCreateFilesFeature=Oci;class Bci extends vat{constructor(e){super(e,R_.workspace.onDidRenameFiles,EA.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||(this._willListener=R_.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)}}Jf.DidRenameFilesFeature=Bci;class Wci extends vat{constructor(e){super(e,R_.workspace.onDidDeleteFiles,EA.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||(this._willListener=R_.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)}}Jf.DidDeleteFilesFeature=Wci;class xFe extends uL{constructor(e,t,i,n,r,o,a){super(e,t,i,n,r),this._requestType=i,this._accessUri=o,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 Hci extends xFe{constructor(e){super(e,R_.workspace.onWillCreateFiles,EA.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)}}Jf.WillCreateFilesFeature=Hci;class Uci extends xFe{constructor(e){super(e,R_.workspace.onWillRenameFiles,EA.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)}}Jf.WillRenameFilesFeature=Uci;class Vci extends xFe{constructor(e){super(e,R_.workspace.onWillDeleteFiles,EA.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)}}Jf.WillDeleteFilesFeature=Vci;var xde={};Object.defineProperty(xde,"__esModule",{value:!0});xde.LinkedEditingFeature=void 0;const zci=Zn,nfe=ms,sfe=Nn;class $ci extends sfe.TextDocumentLanguageFeature{constructor(e){super(e,nfe.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){const t=(0,sfe.ensure)((0,sfe.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,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(nfe.LinkedEditingRangeRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asLinkedEditingRanges(f,u),f=>a.handleFailedRequest(nfe.LinkedEditingRangeRequest.type,u,f,null)),l=a.middleware;return l.provideLinkedEditingRange?l.provideLinkedEditingRange(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return zci.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}xde.LinkedEditingFeature=$ci;var Dde={};Object.defineProperty(Dde,"__esModule",{value:!0});Dde.TypeHierarchyFeature=void 0;const Gci=Zn,B0=ms,rfe=Nn;class Kci{constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,i){const n=this.client,r=this.middleware,o=(a,c,l)=>{const d=n.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return n.sendRequest(B0.TypeHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:n.protocol2CodeConverter.asTypeHierarchyItems(h,l),h=>n.handleFailedRequest(B0.TypeHierarchyPrepareRequest.type,l,h,null))};return r.prepareTypeHierarchy?r.prepareTypeHierarchy(e,t,i,o):o(e,t,i)}provideTypeHierarchySupertypes(e,t){const i=this.client,n=this.middleware,r=(o,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(o)};return i.sendRequest(B0.TypeHierarchySupertypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(B0.TypeHierarchySupertypesRequest.type,a,l,null))};return n.provideTypeHierarchySupertypes?n.provideTypeHierarchySupertypes(e,t,r):r(e,t)}provideTypeHierarchySubtypes(e,t){const i=this.client,n=this.middleware,r=(o,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(o)};return i.sendRequest(B0.TypeHierarchySubtypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(B0.TypeHierarchySubtypesRequest.type,a,l,null))};return n.provideTypeHierarchySubtypes?n.provideTypeHierarchySubtypes(e,t,r):r(e,t)}}class qci extends rfe.TextDocumentLanguageFeature{constructor(e){super(e,B0.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=(0,rfe.ensure)((0,rfe.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 Kci(t);return[Gci.languages.registerTypeHierarchyProvider(t.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}Dde.TypeHierarchyFeature=qci;var kde={};Object.defineProperty(kde,"__esModule",{value:!0});kde.InlineValueFeature=void 0;const L6e=Zn,pq=ms,iV=Nn;class Qci extends iV.TextDocumentLanguageFeature{constructor(e){super(e,pq.InlineValueRequest.type)}fillClientCapabilities(e){(0,iV.ensure)((0,iV.ensure)(e,"textDocument"),"inlineValue").dynamicRegistration=!0,(0,iV.ensure)((0,iV.ensure)(e,"workspace"),"inlineValue").refreshSupport=!0}initialize(e,t){this._client.onRequest(pq.InlineValueRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.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 L6e.EventEmitter,n={onDidChangeInlineValues:i.event,provideInlineValues:(r,o,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(pq.InlineValueRequest.type,v,m).then(b=>m.isCancellationRequested?null:l.protocol2CodeConverter.asInlineValues(b,m),b=>l.handleFailedRequest(pq.InlineValueRequest.type,m,b,null))},h=l.middleware;return h.provideInlineValues?h.provideInlineValues(r,o,a,c,d):d(r,o,a,c)}};return[this.registerProvider(t,n),{provider:n,onDidChangeInlineValues:i}]}registerProvider(e,t){return L6e.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}kde.InlineValueFeature=Qci;var Ide={};Object.defineProperty(Ide,"__esModule",{value:!0});Ide.InlayHintsFeature=void 0;const R6e=Zn,MP=ms,nV=Nn;class jci extends nV.TextDocumentLanguageFeature{constructor(e){super(e,MP.InlayHintRequest.type)}fillClientCapabilities(e){const t=(0,nV.ensure)((0,nV.ensure)(e,"textDocument"),"inlayHint");t.dynamicRegistration=!0,t.resolveSupport={properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]},(0,nV.ensure)((0,nV.ensure)(e,"workspace"),"inlayHint").refreshSupport=!0}initialize(e,t){this._client.onRequest(MP.InlayHintRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.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 R6e.EventEmitter,n={onDidChangeInlayHints:i.event,provideInlayHints:(r,o,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(MP.InlayHintRequest.type,p,f);return f.isCancellationRequested?null:c.protocol2CodeConverter.asInlayHints(m,f)}catch(m){return c.handleFailedRequest(MP.InlayHintRequest.type,f,m,null)}},d=c.middleware;return d.provideInlayHints?d.provideInlayHints(r,o,a,l):l(r,o,a)}};return n.resolveInlayHint=e.resolveProvider===!0?(r,o)=>{const a=this._client,c=async(d,h)=>{try{const u=await a.sendRequest(MP.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(MP.InlayHintResolveRequest.type,h,u,null)}},l=a.middleware;return l.resolveInlayHint?l.resolveInlayHint(r,o,c):c(r,o)}:void 0,[this.registerProvider(t,n),{provider:n,onDidChangeInlayHints:i}]}registerProvider(e,t){return R6e.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Ide.InlayHintsFeature=jci;var Tde={};Object.defineProperty(Tde,"__esModule",{value:!0});Tde.InlineCompletionItemFeature=void 0;const Yci=Zn,ofe=ms,afe=Nn,Jci=ro;class Xci extends afe.TextDocumentLanguageFeature{constructor(e){super(e,ofe.InlineCompletionRequest.type)}fillClientCapabilities(e){let t=(0,afe.ensure)((0,afe.ensure)(e,"textDocument"),"inlineCompletion");t.dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.inlineCompletionProvider);i&&this.register({id:Jci.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideInlineCompletionItems:(n,r,o,a)=>{const c=this._client,l=this._client.middleware,d=(h,u,f,p)=>c.sendRequest(ofe.InlineCompletionRequest.type,c.code2ProtocolConverter.asInlineCompletionParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asInlineCompletionResult(m,p),m=>c.handleFailedRequest(ofe.InlineCompletionRequest.type,p,m,null));return l.provideInlineCompletionItems?l.provideInlineCompletionItems(n,r,o,a,d):d(n,r,o,a)}};return[Yci.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Tde.InlineCompletionItemFeature=Xci;Object.defineProperty(wh,"__esModule",{value:!0});wh.ProposedFeatures=bat=wh.BaseLanguageClient=wh.MessageTransports=wh.SuspendMode=wh.State=wh.CloseAction=wh.ErrorAction=wh.RevealOutputChannelOn=void 0;const Ho=Zn,Tt=ms,Zci=Kle,eli=tde,Ov=Io,mq=Sh,M6e=ro,tli=IG,vv=Nn,ili=SA,N6e=ide,P6e=BD,NP=Yf,nli=nde,sli=sde,rli=rde,oli=ode,ali=ade,cli=AFe,lli=cde,dli=lde,hli=dde,uli=hde,cfe=WD,gli=gde,fli=fde,pli=pde,mli=mde,_li=_de,vli=vde,bli=bde,wli=vU,yli=wde,Cli=yde,Sli=Cde,Ali=Sde,Eli=Ade,xli=Ede,PP=Jf,Dli=xde,kli=Dde,Ili=kde,Tli=Ide,Lli=Tde;var f1;(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"})(f1||(wh.RevealOutputChannelOn=f1={}));var y7;(function(s){s[s.Continue=1]="Continue",s[s.Shutdown=2]="Shutdown"})(y7||(wh.ErrorAction=y7={}));var HD;(function(s){s[s.DoNotRestart=1]="DoNotRestart",s[s.Restart=2]="Restart"})(HD||(wh.CloseAction=HD={}));var Wz;(function(s){s[s.Stopped=1]="Stopped",s[s.Starting=3]="Starting",s[s.Running=2]="Running"})(Wz||(wh.State=Wz={}));var F6e;(function(s){s.off="off",s.on="on"})(F6e||(wh.SuspendMode=F6e={}));var Y1e;(function(s){function e(t){return t==null?!1:typeof t=="boolean"||typeof t=="object"&&t!==null&&Ov.stringArray(t.enabledCommands)?t:!1}s.sanitizeIsTrusted=e})(Y1e||(Y1e={}));class Rli{constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,i){return i&&i<=3?{action:y7.Continue}:{action:y7.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:HD.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=3*60*1e3?{action:HD.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:HD.Restart})}}var sr;(function(s){s.Initial="initial",s.Starting="starting",s.StartFailed="startFailed",s.Running="running",s.Stopping="stopping",s.Stopped="stopped"})(sr||(sr={}));var O6e;(function(s){function e(t){return t&&Tt.MessageReader.is(t.reader)&&Tt.MessageWriter.is(t.writer)}s.is=e})(O6e||(wh.MessageTransports=O6e={}));class gL{constructor(e,t,i){this._traceFormat=Tt.TraceFormat.Text,this._diagnosticQueue=new Map,this._diagnosticQueueState={state:"idle"},this._features=[],this._dynamicFeatures=new Map,this.workspaceEditLock=new mq.Semaphore(1),this._id=e,this._name=t,i=i||{};const n={isTrusted:!1,supportHtml:!1};i.markdown!==void 0&&(n.isTrusted=Y1e.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??f1.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=sr.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 mq.Semaphore(1),this._pendingChangeDelayer=new mq.Delayer(250),this._fileEvents=[],this._fileEventDelayer=new mq.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new Tt.Emitter,this._stateChangeEmitter=new Tt.Emitter,this._trace=Tt.Trace.Off,this._tracer={log:(r,o)=>{Ov.string(r)?this.logTrace(r,o):this.logObjectTrace(r)}},this._c2p=Zci.createConverter(i.uriConverters?i.uriConverters.code2Protocol:void 0),this._p2c=eli.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=Ho.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 sr.Starting:return Wz.Starting;case sr.Running:return Wz.Running;default:return Wz.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===sr.StartFailed||this.$state===sr.Stopping||this.$state===sr.Stopped)return Promise.reject(new Tt.ResponseError(Tt.ErrorCodes.ConnectionInactive,"Client is not running"));const i=await this.$start();this._didChangeTextDocumentFeature.syncKind===Tt.TextDocumentSyncKind.Full&&await this.sendPendingFullTextDocumentChanges(i);const n=this._clientOptions.middleware?.sendRequest;if(n!==void 0){let r,o;return t.length===1?Tt.CancellationToken.is(t[0])?o=t[0]:r=t[0]:t.length===2&&(r=t[0],o=t[1]),n(e,r,o,(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 r;return n!==void 0?(this._requestDisposables.set(i,n.onRequest(e,t)),r={dispose:()=>{const o=this._requestDisposables.get(i);o!==void 0&&(o.dispose(),this._requestDisposables.delete(i))}}):(this._pendingRequestHandlers.set(i,t),r={dispose:()=>{this._pendingRequestHandlers.delete(i);const o=this._requestDisposables.get(i);o!==void 0&&(o.dispose(),this._requestDisposables.delete(i))}}),{dispose:()=>{this._requestHandlers.delete(i),r.dispose()}}}async sendNotification(e,t){if(this.$state===sr.StartFailed||this.$state===sr.Stopping||this.$state===sr.Stopped)return Promise.reject(new Tt.ResponseError(Tt.ErrorCodes.ConnectionInactive,"Client is not running"));const i=this._didChangeTextDocumentFeature.syncKind===Tt.TextDocumentSyncKind.Full;let n;i&&typeof e!="string"&&e.method===Tt.DidOpenTextDocumentNotification.method&&(n=t?.textDocument.uri,this._pendingOpenNotifications.add(n));const r=await this.$start();i&&await this.sendPendingFullTextDocumentChanges(r),n!==void 0&&this._pendingOpenNotifications.delete(n);const o=this._clientOptions.middleware?.sendNotification;return o?o(e,r.sendNotification.bind(r),t):r.sendNotification(e,t)}onNotification(e,t){const i=typeof e=="string"?e:e.method;this._notificationHandlers.set(i,t);const n=this.activeConnection();let r;return n!==void 0?(this._notificationDisposables.set(i,n.onNotification(e,t)),r={dispose:()=>{const o=this._notificationDisposables.get(i);o!==void 0&&(o.dispose(),this._notificationDisposables.delete(i))}}):(this._pendingNotificationHandlers.set(i,t),r={dispose:()=>{this._pendingNotificationHandlers.delete(i);const o=this._notificationDisposables.get(i);o!==void 0&&(o.dispose(),this._notificationDisposables.delete(i))}}),{dispose:()=>{this._notificationHandlers.delete(i),r.dispose()}}}async sendProgress(e,t,i){if(this.$state===sr.StartFailed||this.$state===sr.Stopping||this.$state===sr.Stopped)return Promise.reject(new Tt.ResponseError(Tt.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 r;const o=this._clientOptions.middleware?.handleWorkDoneProgress,a=Tt.WorkDoneProgress.is(e)&&o!==void 0?c=>{o(t,c,()=>i(c))}:i;return n!==void 0?(this._progressDisposables.set(t,n.onProgress(e,t,a)),r={dispose:()=>{const c=this._progressDisposables.get(t);c!==void 0&&(c.dispose(),this._progressDisposables.delete(t))}}):(this._pendingProgressHandlers.set(t,{type:e,handler:i}),r={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),r.dispose()}}}createDefaultErrorHandler(e){if(e!==void 0&&e<0)throw new Error(`Invalid maxRestartCount: ${e}`);return new Rli(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 Tt.ResponseError){const t=e;return` Message: ${t.message} +>>> 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(r===a&&o===c)return!0;if(r===a)return i;if(o===c)return r===a-1&&e[r]==="";throw new Error("wtf?")}braceExpand(){return mat(this.pattern,this.options)}parse(e,t){Bne(e);const i=this.options;if(e==="**")if(i.noglobstar)e="*";else return kv;if(e==="")return"";let n="",r=!1,o=!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+=Tge,r=!0;break;case"?":n+=$1e,r=!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==="*"?Tge:p.type==="?"?$1e:"\\"+p.type;r=!0,n=n.slice(0,p.reStart)+P+"\\("+k}C(),o&&(n+="\\\\");const A=poi[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 Be=0;Be(o=o.map(a=>typeof a=="string"?boi(a):a===kv?kv:a._src).reduce((a,c)=>(a[a.length-1]===kv&&c===kv||a.push(c),a),[]),o.forEach((a,c)=>{a!==kv||o[c-1]===kv||(c===0?o.length>1?o[c+1]="(?:\\/|"+i+"\\/)?"+o[c+1]:o[c]=i:c===o.length-1?o[c-1]+="(?:\\/|"+i+")?":(o[c-1]+="(?:\\/|\\/"+i+"\\/)"+o[c+1],o[c+1]=kv))}),o.filter(a=>a!==kv).join("/"))).join("|");r="^(?:"+r+")$",this.negate&&(r="^(?!"+r+").*$");try{this.regexp=new RegExp(r,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;z1e.sep!=="/"&&(e=e.split(z1e.sep).join("/")),e=e.split(c6e),this.debug(this.pattern,"split",e);const n=this.set;this.debug(this.pattern,"set",n);let r;for(let o=e.length-1;o>=0&&(r=e[o],!r);o--);for(let o=0;o{if(t.closed.length===0&&t.opened.length===0)return;const i=this.open,n=new Set;Bz.fillTabResources(n);const r=new Set,o=new Set(n);for(const a of i.values())n.has(a)?o.delete(a):r.add(a);if(this.open=n,r.size>0){const a=new Set;for(const c of r)a.add(kr.Uri.parse(c));this._onClose.fire(a)}if(o.size>0){const a=new Set;for(const c of o)a.add(kr.Uri.parse(c));this._onOpen.fire(a)}};kr.window.tabGroups.onDidChangeTabs!==void 0?this.disposable=kr.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 kr.Uri?kr.window.activeTextEditor?.document.uri===e:kr.window.activeTextEditor?.document===e}isVisible(e){const t=e instanceof kr.Uri?e:e.uri;return this.open.has(t.toString())}getTabResources(){const e=new Set;return Bz.fillTabResources(new Set,e),e}static fillTabResources(e,t){const i=e??new Set;for(const n of kr.window.tabGroups.all)for(const r of n.tabs){const o=r.input;let a;o instanceof kr.TabInputText?a=o.uri:o instanceof kr.TabInputTextDiff?a=o.modified:o instanceof kr.TabInputCustom&&(a=o.uri),a!==void 0&&!i.has(a.toString())&&(i.add(a.toString()),t!==void 0&&t.add(a))}}}var zd;(function(s){s[s.document=1]="document",s[s.workspace=2]="workspace"})(zd||(zd={}));var BS;(function(s){function e(t){return t instanceof kr.Uri?t.toString():t.uri.toString()}s.asKey=e})(BS||(BS={}));class Soi{constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,i){const n=e===zd.document?this.documentPullStates:this.workspacePullStates,[r,o,a]=t instanceof kr.Uri?[t.toString(),t,i]:[t.uri.toString(),t.uri,t.version];let c=n.get(r);return c===void 0&&(c={document:o,pulledVersion:a,resultId:void 0},n.set(r,c)),c}update(e,t,i,n){const r=e===zd.document?this.documentPullStates:this.workspacePullStates,[o,a,c,l]=t instanceof kr.Uri?[t.toString(),t,i,n]:[t.uri.toString(),t.uri,t.version,i];let d=r.get(o);d===void 0?(d={document:a,pulledVersion:c,resultId:l},r.set(o,d)):(d.pulledVersion=c,d.resultId=l)}unTrack(e,t){const i=BS.asKey(t);(e===zd.document?this.documentPullStates:this.workspacePullStates).delete(i)}tracks(e,t){const i=BS.asKey(t);return(e===zd.document?this.documentPullStates:this.workspacePullStates).has(i)}getResultId(e,t){const i=BS.asKey(t);return(e===zd.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 Aoi{constructor(e,t,i){this.client=e,this.tabs=t,this.options=i,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new kr.EventEmitter,this.provider=this.createProvider(),this.diagnostics=kr.languages.createDiagnosticCollection(i.identifier),this.openRequests=new Map,this.documentStates=new Soi,this.workspaceErrorCounter=0}knows(e,t){const i=t instanceof kr.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 kr.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 kr.Uri,n=i?e:e.uri,r=n.toString();t=i?t:e.version;const o=this.openRequests.get(r),a=i?this.documentStates.track(zd.document,e,t):this.documentStates.track(zd.document,e);if(o===void 0){const c=new kr.CancellationTokenSource;this.openRequests.set(r,{state:Cu.active,document:e,version:t,tokenSource:c});let l,d;try{l=await this.provider.provideDiagnostics(e,a.resultId,c.token)??{kind:Jm.DocumentDiagnosticReportKind.full,items:[]}}catch(h){if(h instanceof G1e.LSPCancellationError&&sl.DiagnosticServerCancellationData.is(h.data)&&h.data.retriggerRequest===!1&&(d={state:Cu.outDated,document:e}),d===void 0&&h instanceof kr.CancellationError)d={state:Cu.reschedule,document:e};else throw h}if(d=d??this.openRequests.get(r),d===void 0){this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${r}`),this.diagnostics.delete(n);return}if(this.openRequests.delete(r),!this.tabs.isVisible(e)){this.documentStates.unTrack(zd.document,e);return}if(d.state===Cu.outDated)return;l!==void 0&&(l.kind===Jm.DocumentDiagnosticReportKind.full&&this.diagnostics.set(n,l.items),a.pulledVersion=t,a.resultId=l.resultId),d.state===Cu.reschedule&&this.pull(e)}else o.state===Cu.active?(o.tokenSource.cancel(),this.openRequests.set(r,{state:Cu.reschedule,document:o.document})):o.state===Cu.outDated&&this.openRequests.set(r,{state:Cu.reschedule,document:o.document})}forgetDocument(e){const t=e instanceof kr.Uri?e:e.uri,i=t.toString(),n=this.openRequests.get(i);this.options.workspaceDiagnostics?n!==void 0?this.openRequests.set(i,{state:Cu.reschedule,document:e}):this.pull(e,()=>{this.forget(zd.document,e)}):(n!==void 0&&(n.state===Cu.active&&n.tokenSource.cancel(),this.openRequests.set(i,{state:Cu.outDated,document:e})),this.diagnostics.delete(t),this.forget(zd.document,e))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,sl.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof G1e.LSPCancellationError)&&!sl.DiagnosticServerCancellationData.is(e.data)&&(this.client.error("Workspace diagnostic pull failed.",e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,sl.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 kr.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===Jm.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(zd.document,i.uri)||this.diagnostics.set(i.uri,i.items)),this.documentStates.update(zd.workspace,i.uri,i.version??void 0,i.resultId)})}createProvider(){const e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(t,i,n)=>{const r=(a,c,l)=>{const d={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(a instanceof kr.Uri?a:a.uri)},previousResultId:c};return this.isDisposed===!0||!this.client.isRunning()?{kind:Jm.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(sl.DocumentDiagnosticRequest.type,d,l).then(async h=>h==null||this.isDisposed||l.isCancellationRequested?{kind:Jm.DocumentDiagnosticReportKind.full,items:[]}:h.kind===sl.DocumentDiagnosticReportKind.Full?{kind:Jm.DocumentDiagnosticReportKind.full,resultId:h.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(h.items,l)}:{kind:Jm.DocumentDiagnosticReportKind.unChanged,resultId:h.resultId},h=>this.client.handleFailedRequest(sl.DocumentDiagnosticRequest.type,l,h,{kind:Jm.DocumentDiagnosticReportKind.full,items:[]}))},o=this.client.middleware;return o.provideDiagnostics?o.provideDiagnostics(t,i,n,r):r(t,i,n)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(t,i,n)=>{const r=async l=>l.kind===sl.DocumentDiagnosticReportKind.Full?{kind:Jm.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:Jm.DocumentDiagnosticReportKind.unChanged,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version},o=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,Coi.generateUuid)(),u=this.client.onProgress(sl.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 r(v))}catch(b){this.client.error("Converting workspace diagnostics failed.",b)}n(m)}),f={identifier:this.options.identifier,previousResultIds:o(l),partialResultToken:h};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(sl.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 r(v));return u.dispose(),n(m),{items:[]}},p=>(u.dispose(),this.client.handleFailedRequest(sl.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===Cu.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:Cu.outDated,document:t.document});this.diagnostics.dispose()}}class Eoi{constructor(e){this.diagnosticRequestor=e,this.documents=new sl.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;const t=BS.asKey(e);this.documents.has(t)||(this.documents.set(t,e,sl.Touch.Last),this.trigger())}remove(e){const t=BS.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,sl.RAL)().timer.setInterval(()=>{const e=this.documents.first;if(e!==void 0){const t=BS.asKey(e);this.diagnosticRequestor.pull(e),this.documents.set(t,e,sl.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?BS.asKey(this.endDocument):void 0}}class xoi{constructor(e,t,i){const n=e.clientOptions.diagnosticPullOptions??{onChange:!0,onSave:!1},r=e.protocol2CodeConverter.asDocumentSelector(i.documentSelector),o=[],a=p=>{const m=i.documentSelector;if(n.match!==void 0)return n.match(m,p);for(const v of m)if(sl.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 yoi.Minimatch(v.pattern,{noext:!0});if(!b.makeRe()||!b.match(p.fsPath))return!1}}return!0},c=p=>p instanceof kr.Uri?a(p):kr.languages.match(r,p)>0&&t.isVisible(p),l=p=>p instanceof kr.Uri?this.activeTextDocument?.uri.toString()===p.toString():this.activeTextDocument===p;this.diagnosticRequestor=new Aoi(e,t,i),this.backgroundScheduler=new Eoi(this.diagnosticRequestor);const d=p=>{!c(p)||!i.interFileDependencies||l(p)||this.backgroundScheduler.add(p)};this.activeTextDocument=kr.window.activeTextEditor?.document,kr.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(sl.DidOpenTextDocumentNotification.method);o.push(h.onNotificationSent(p=>{const m=p.textDocument;this.diagnosticRequestor.knows(zd.document,m)||c(m)&&this.diagnosticRequestor.pull(m,()=>{d(m)})})),o.push(t.onOpen(p=>{for(const m of p){if(this.diagnosticRequestor.knows(zd.document,m))continue;const v=m.toString();let b;for(const w of kr.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 kr.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(sl.DidChangeTextDocumentNotification.method);o.push(p.onNotificationSent(async m=>{const v=m.textDocument;(n.filter===void 0||!n.filter(v,Wne.onType))&&this.diagnosticRequestor.knows(zd.document,v)&&this.diagnosticRequestor.pull(v,()=>{this.backgroundScheduler.trigger()})}))}if(n.onSave===!0){const p=e.getFeature(sl.DidSaveTextDocumentNotification.method);o.push(p.onNotificationSent(m=>{const v=m.textDocument;(n.filter===void 0||!n.filter(v,Wne.onSave))&&this.diagnosticRequestor.knows(zd.document,v)&&this.diagnosticRequestor.pull(m.textDocument,()=>{this.backgroundScheduler.trigger()})}))}const f=e.getFeature(sl.DidCloseTextDocumentNotification.method);o.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 kr.workspace.textDocuments)c(p)&&this.diagnosticRequestor.pull(p)}),i.workspaceDiagnostics===!0&&i.identifier!=="da348dc5-c30a-4515-9d98-31ff3be38d14"&&this.diagnosticRequestor.pullWorkspace(),this.disposable=kr.Disposable.from(...o,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}cleanUpDocument(e){this.diagnosticRequestor.knows(zd.document,e)&&(this.diagnosticRequestor.forgetDocument(e),this.backgroundScheduler.remove(e))}}class Doi extends G1e.TextDocumentLanguageFeature{constructor(e){super(e,sl.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=lq(lq(e,"textDocument"),"diagnostic");t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,lq(lq(e,"workspace"),"diagnostics").refreshSupport=!0}initialize(e,t){this._client.onRequest(sl.DiagnosticRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeDiagnosticsEmitter.fire()});let[n,r]=this.getRegistration(t,e.diagnosticProvider);!n||!r||this.register({id:n,registerOptions:r})}clear(){this.tabs!==void 0&&(this.tabs.dispose(),this.tabs=void 0),super.clear()}registerLanguageProvider(e){this.tabs===void 0&&(this.tabs=new Bz);const t=new xoi(this._client,this.tabs,e);return[t.disposable,t]}}SA.DiagnosticFeature=Doi;var wh={},Kle={},Sh={};Object.defineProperty(Sh,"__esModule",{value:!0});Sh.forEach=Sh.mapAsync=Sh.map=Sh.clearTestMode=Sh.setTestMode=Sh.Semaphore=Sh.Delayer=void 0;const kG=ms;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,kG.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)}}Sh.Delayer=koi;class Ioi{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,kG.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()}}}Sh.Semaphore=Ioi;let CFe=!1;function Toi(){CFe=!0}Sh.setTestMode=Toi;function Loi(){CFe=!1}Sh.clearTestMode=Loi;const l6e=15;class SFe{constructor(e=l6e){this.yieldAfter=CFe===!0?Math.max(e,2):Math.max(e,l6e),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 Roi(s,e,t,i){if(s.length===0)return[];const n=new Array(s.length),r=new SFe(i?.yieldAfter);function o(c){r.start();for(let l=c;l{(0,kG.RAL)().timer.setImmediate(()=>{c(o(a))})});return n}Sh.map=Roi;async function Moi(s,e,t,i){if(s.length===0)return[];const n=new Array(s.length),r=new SFe(i?.yieldAfter);async function o(c){r.start();for(let l=c;l{(0,kG.RAL)().timer.setImmediate(()=>{c(o(a))})});return n}Sh.mapAsync=Moi;async function Noi(s,e,t,i){if(s.length===0)return;const n=new SFe(i?.yieldAfter);function r(a){n.start();for(let c=a;c{(0,kG.RAL)().timer.setImmediate(()=>{a(r(o))})})}Sh.forEach=Noi;var qle={};Object.defineProperty(qle,"__esModule",{value:!0});const Poi=Zn;class Foi extends Poi.CompletionItem{constructor(e){super(e)}}qle.default=Foi;var Qle={};Object.defineProperty(Qle,"__esModule",{value:!0});const Ooi=Zn;class Boi extends Ooi.CodeLens{constructor(e){super(e)}}Qle.default=Boi;var jle={};Object.defineProperty(jle,"__esModule",{value:!0});const Woi=Zn;class Hoi extends Woi.DocumentLink{constructor(e,t){super(e,t)}}jle.default=Hoi;var Yle={};Object.defineProperty(Yle,"__esModule",{value:!0});const Uoi=Zn;class Voi extends Uoi.CodeAction{constructor(e,t){super(e),this.data=t}}Yle.default=Voi;var EN={};Object.defineProperty(EN,"__esModule",{value:!0});EN.ProtocolDiagnostic=EN.DiagnosticCode=void 0;const zoi=Zn,Rge=Io;var d6e;(function(s){function e(t){const i=t;return i!=null&&(Rge.number(i.value)||Rge.string(i.value))&&Rge.string(i.target)}s.is=e})(d6e||(EN.DiagnosticCode=d6e={}));class $oi extends zoi.Diagnostic{constructor(e,t,i,n){super(e,t,i),this.data=n,this.hasDiagnosticCode=!1}}EN.ProtocolDiagnostic=$oi;var Jle={};Object.defineProperty(Jle,"__esModule",{value:!0});const Goi=Zn;class Koi extends Goi.CallHierarchyItem{constructor(e,t,i,n,r,o,a){super(e,t,i,n,r,o),a!==void 0&&(this.data=a)}}Jle.default=Koi;var Xle={};Object.defineProperty(Xle,"__esModule",{value:!0});const qoi=Zn;class Qoi extends qoi.TypeHierarchyItem{constructor(e,t,i,n,r,o,a){super(e,t,i,n,r,o),a!==void 0&&(this.data=a)}}Xle.default=Qoi;var Zle={};Object.defineProperty(Zle,"__esModule",{value:!0});const dq=Zn;let joi=class extends dq.SymbolInformation{constructor(e,t,i,n,r){const o=!(n instanceof dq.Uri);super(e,t,i,o?n:new dq.Location(n,new dq.Range(0,0,0,0))),this.hasRange=o,r!==void 0&&(this.data=r)}};Zle.default=joi;var ede={};Object.defineProperty(ede,"__esModule",{value:!0});const Yoi=Zn;class Joi extends Yoi.InlayHint{constructor(e,t,i){super(e,t,i)}}ede.default=Joi;Object.defineProperty(Kle,"__esModule",{value:!0});Kle.createConverter=void 0;const Wl=Zn,_s=ms,e0=Io,h6e=Sh,Xoi=qle,Zoi=Qle,eai=jle,u6e=Yle,g6e=EN,tai=Jle,iai=Xle,nai=Zle,sai=ede;var K1e;(function(s){function e(t){const i=t;return i&&!!i.inserting&&!!i.replacing}s.is=e})(K1e||(K1e={}));function rai(s){const t=s||(ee=>ee.toString());function i(ee){return t(ee)}function n(ee){return{uri:t(ee.uri)}}function r(ee){return{uri:t(ee.uri),languageId:ee.languageId,version:ee.version,text:ee.getText()}}function o(ee){return{uri:t(ee.uri),version:ee.version}}function a(ee){return{textDocument:r(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,ft){if(l(ee))return{textDocument:{uri:t(ee.uri),version:ee.version},contentChanges:[{text:ee.getText()}]};if(c(ee)){const $n=xe,Ss=ft;return{textDocument:{uri:t($n),version:Ss},contentChanges:ee.contentChanges.map(Va=>{const ta=Va.range;return{range:{start:{line:ta.start.line,character:ta.start.character},end:{line:ta.end.line,character:ta.end.character}},rangeLength:Va.rangeLength,text:Va.text}})}}else throw Error("Unsupported text document change parameter")}function h(ee){return{textDocument:n(ee)}}function u(ee,xe=!1){let ft={textDocument:n(ee)};return xe&&(ft.text=ee.getText()),ft}function f(ee){switch(ee){case Wl.TextDocumentSaveReason.Manual:return _s.TextDocumentSaveReason.Manual;case Wl.TextDocumentSaveReason.AfterDelay:return _s.TextDocumentSaveReason.AfterDelay;case Wl.TextDocumentSaveReason.FocusOut:return _s.TextDocumentSaveReason.FocusOut}return _s.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 Wl.CompletionTriggerKind.TriggerCharacter:return _s.CompletionTriggerKind.TriggerCharacter;case Wl.CompletionTriggerKind.TriggerForIncompleteCompletions:return _s.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return _s.CompletionTriggerKind.Invoked}}function k(ee,xe,ft){return{textDocument:n(ee),position:ge(xe),context:{triggerKind:L(ft.triggerKind),triggerCharacter:ft.triggerCharacter}}}function P(ee){switch(ee){case Wl.SignatureHelpTriggerKind.Invoke:return _s.SignatureHelpTriggerKind.Invoked;case Wl.SignatureHelpTriggerKind.TriggerCharacter:return _s.SignatureHelpTriggerKind.TriggerCharacter;case Wl.SignatureHelpTriggerKind.ContentChange:return _s.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,ft){return{textDocument:n(ee),position:ge(xe),context:{isRetrigger:ft.isRetrigger,triggerCharacter:ft.triggerCharacter,triggerKind:P(ft.triggerKind),activeSignatureHelp:j(ft.activeSignatureHelp)}}}function ge(ee){return{line:ee.line,character:ee.character}}function De(ee){return ee==null?ee:{line:ee.line>_s.uinteger.MAX_VALUE?_s.uinteger.MAX_VALUE:ee.line,character:ee.character>_s.uinteger.MAX_VALUE?_s.uinteger.MAX_VALUE:ee.character}}function Be(ee,xe){return h6e.map(ee,De,xe)}function Ct(ee){return ee.map(De)}function Ne(ee){return ee==null?ee:{start:De(ee.start),end:De(ee.end)}}function dt(ee){return ee.map(Ne)}function Dt(ee){return ee==null?ee:_s.Location.create(i(ee.uri),Ne(ee.range))}function Xi(ee){switch(ee){case Wl.DiagnosticSeverity.Error:return _s.DiagnosticSeverity.Error;case Wl.DiagnosticSeverity.Warning:return _s.DiagnosticSeverity.Warning;case Wl.DiagnosticSeverity.Information:return _s.DiagnosticSeverity.Information;case Wl.DiagnosticSeverity.Hint:return _s.DiagnosticSeverity.Hint}}function Ti(ee){if(!ee)return;let xe=[];for(let ft of ee){let $n=ss(ft);$n!==void 0&&xe.push($n)}return xe.length>0?xe:void 0}function ss(ee){switch(ee){case Wl.DiagnosticTag.Unnecessary:return _s.DiagnosticTag.Unnecessary;case Wl.DiagnosticTag.Deprecated:return _s.DiagnosticTag.Deprecated;default:return}}function $s(ee){return{message:ee.message,location:Dt(ee.location)}}function Fn(ee){return ee.map($s)}function Zo(ee){if(ee!=null)return e0.number(ee)||e0.string(ee)?ee:{value:ee.value,target:i(ee.target)}}function hs(ee){const xe=_s.Diagnostic.create(Ne(ee.range),ee.message),ft=ee instanceof g6e.ProtocolDiagnostic?ee:void 0;ft!==void 0&&ft.data!==void 0&&(xe.data=ft.data);const $n=Zo(ee.code);return g6e.DiagnosticCode.is($n)?ft!==void 0&&ft.hasDiagnosticCode?xe.code=$n:(xe.code=$n.value,xe.codeDescription={href:$n.target}):xe.code=$n,e0.number(ee.severity)&&(xe.severity=Xi(ee.severity)),Array.isArray(ee.tags)&&(xe.tags=Ti(ee.tags)),ee.relatedInformation&&(xe.relatedInformation=Fn(ee.relatedInformation)),ee.source&&(xe.source=ee.source),xe}function Zr(ee,xe){return ee==null?ee:h6e.map(ee,hs,xe)}function ea(ee){return ee==null?ee:ee.map(hs)}function ki(ee,xe){switch(ee){case"$string":return xe;case _s.MarkupKind.PlainText:return{kind:ee,value:xe};case _s.MarkupKind.Markdown:return{kind:ee,value:xe.value};default:return`Unsupported Markup content received. Kind is: ${ee}`}}function rs(ee){switch(ee){case Wl.CompletionItemTag.Deprecated:return _s.CompletionItemTag.Deprecated}}function Or(ee){if(ee===void 0)return ee;const xe=[];for(let ft of ee){const $n=rs(ft);$n!==void 0&&xe.push($n)}return xe}function Ln(ee,xe){return xe!==void 0?xe:ee+1}function Ha(ee,xe=!1){let ft,$n;e0.string(ee.label)?ft=ee.label:(ft=ee.label.label,xe&&(ee.label.detail!==void 0||ee.label.description!==void 0)&&($n={detail:ee.label.detail,description:ee.label.description}));let Ss={label:ft};$n!==void 0&&(Ss.labelDetails=$n);let Wr=ee instanceof Xoi.default?ee:void 0;ee.detail&&(Ss.detail=ee.detail),ee.documentation&&(!Wr||Wr.documentationFormat==="$string"?Ss.documentation=ee.documentation:Ss.documentation=ki(Wr.documentationFormat,ee.documentation)),ee.filterText&&(Ss.filterText=ee.filterText),wd(Ss,ee),e0.number(ee.kind)&&(Ss.kind=Ln(ee.kind,Wr&&Wr.originalItemKind)),ee.sortText&&(Ss.sortText=ee.sortText),ee.additionalTextEdits&&(Ss.additionalTextEdits=mc(ee.additionalTextEdits)),ee.commitCharacters&&(Ss.commitCharacters=ee.commitCharacters.slice()),ee.command&&(Ss.command=Bo(ee.command)),(ee.preselect===!0||ee.preselect===!1)&&(Ss.preselect=ee.preselect);const Va=Or(ee.tags);if(Wr){if(Wr.data!==void 0&&(Ss.data=Wr.data),Wr.deprecated===!0||Wr.deprecated===!1){if(Wr.deprecated===!0&&Va!==void 0&&Va.length>0){const ta=Va.indexOf(Wl.CompletionItemTag.Deprecated);ta!==-1&&Va.splice(ta,1)}Ss.deprecated=Wr.deprecated}Wr.insertTextMode!==void 0&&(Ss.insertTextMode=Wr.insertTextMode)}return Va!==void 0&&Va.length>0&&(Ss.tags=Va),Ss.insertTextMode===void 0&&ee.keepWhitespace===!0&&(Ss.insertTextMode=_s.InsertTextMode.adjustIndentation),Ss}function wd(ee,xe){let ft=_s.InsertTextFormat.PlainText,$n,Ss;xe.textEdit?($n=xe.textEdit.newText,Ss=xe.textEdit.range):xe.insertText instanceof Wl.SnippetString?(ft=_s.InsertTextFormat.Snippet,$n=xe.insertText.value):$n=xe.insertText,xe.range&&(Ss=xe.range),ee.insertTextFormat=ft,xe.fromEdit&&$n!==void 0&&Ss!==void 0?ee.textEdit=On($n,Ss):ee.insertText=$n}function On(ee,xe){return K1e.is(xe)?_s.InsertReplaceEdit.create(ee,Ne(xe.inserting),Ne(xe.replacing)):{newText:ee,range:Ne(xe)}}function nh(ee){return{range:Ne(ee.range),newText:ee.newText}}function mc(ee){return ee==null?ee:ee.map(nh)}function $c(ee){return ee<=Wl.SymbolKind.TypeParameter?ee+1:_s.SymbolKind.Property}function Gs(ee){return ee}function ic(ee){return ee.map(Gs)}function pl(ee,xe,ft){return{textDocument:n(ee),position:ge(xe),context:{includeDeclaration:ft.includeDeclaration}}}async function sh(ee,xe){let ft=_s.CodeAction.create(ee.title);if(ee instanceof u6e.default&&ee.data!==void 0&&(ft.data=ee.data),ee.kind!==void 0&&(ft.kind=kc(ee.kind)),ee.diagnostics!==void 0&&(ft.diagnostics=await Zr(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&&(ft.command=Bo(ee.command)),ee.isPreferred!==void 0&&(ft.isPreferred=ee.isPreferred),ee.disabled!==void 0&&(ft.disabled={reason:ee.disabled.reason}),ft}function mg(ee){let xe=_s.CodeAction.create(ee.title);if(ee instanceof u6e.default&&ee.data!==void 0&&(xe.data=ee.data),ee.kind!==void 0&&(xe.kind=kc(ee.kind)),ee.diagnostics!==void 0&&(xe.diagnostics=ea(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=Bo(ee.command)),ee.isPreferred!==void 0&&(xe.isPreferred=ee.isPreferred),ee.disabled!==void 0&&(xe.disabled={reason:ee.disabled.reason}),xe}async function _c(ee,xe){if(ee==null)return ee;let ft;return ee.only&&e0.string(ee.only.value)&&(ft=[ee.only.value]),_s.CodeActionContext.create(await Zr(ee.diagnostics,xe),ft,rh(ee.triggerKind))}function Gc(ee){if(ee==null)return ee;let xe;return ee.only&&e0.string(ee.only.value)&&(xe=[ee.only.value]),_s.CodeActionContext.create(ea(ee.diagnostics),xe,rh(ee.triggerKind))}function rh(ee){switch(ee){case Wl.CodeActionTriggerKind.Invoke:return _s.CodeActionTriggerKind.Invoked;case Wl.CodeActionTriggerKind.Automatic:return _s.CodeActionTriggerKind.Automatic;default:return}}function kc(ee){if(ee!=null)return ee.value}function ml(ee){return ee==null?ee:_s.InlineValueContext.create(ee.frameId,Ne(ee.stoppedLocation))}function nc(ee,xe,ft){return{context:_s.InlineCompletionContext.create(ft.triggerKind,ft.selectedCompletionInfo),textDocument:n(ee),position:De(xe)}}function Bo(ee){let xe=_s.Command.create(ee.title,ee.command);return ee.arguments&&(xe.arguments=ee.arguments),xe}function _l(ee){let xe=_s.CodeLens.create(Ne(ee.range));return ee.command&&(xe.command=Bo(ee.command)),ee instanceof Zoi.default&&ee.data&&(xe.data=ee.data),xe}function oh(ee,xe){const ft={tabSize:ee.tabSize,insertSpaces:ee.insertSpaces};return xe.trimTrailingWhitespace&&(ft.trimTrailingWhitespace=!0),xe.trimFinalNewlines&&(ft.trimFinalNewlines=!0),xe.insertFinalNewline&&(ft.insertFinalNewline=!0),ft}function ah(ee){return{textDocument:n(ee)}}function Kc(ee){return{textDocument:n(ee)}}function qc(ee){let xe=_s.DocumentLink.create(Ne(ee.range));ee.target&&(xe.target=i(ee.target)),ee.tooltip!==void 0&&(xe.tooltip=ee.tooltip);let ft=ee instanceof eai.default?ee:void 0;return ft&&ft.data&&(xe.data=ft.data),xe}function Ua(ee){return{textDocument:n(ee)}}function Br(ee){const xe={name:ee.name,kind:$c(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=ic(ee.tags)),ee instanceof tai.default&&ee.data!==void 0&&(xe.data=ee.data),xe}function Ts(ee){const xe={name:ee.name,kind:$c(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=ic(ee.tags)),ee instanceof iai.default&&ee.data!==void 0&&(xe.data=ee.data),xe}function Ic(ee){const xe=ee instanceof nai.default?{name:ee.name,kind:$c(ee.kind),location:ee.hasRange?Dt(ee.location):{uri:t(ee.location.uri)},data:ee.data}:{name:ee.name,kind:$c(ee.kind),location:Dt(ee.location)};return ee.tags!==void 0&&(xe.tags=ic(ee.tags)),ee.containerName!==""&&(xe.containerName=ee.containerName),xe}function Fh(ee){const xe=typeof ee.label=="string"?ee.label:ee.label.map(be),ft=_s.InlayHint.create(De(ee.position),xe);return ee.kind!==void 0&&(ft.kind=ee.kind),ee.textEdits!==void 0&&(ft.textEdits=mc(ee.textEdits)),ee.tooltip!==void 0&&(ft.tooltip=Ea(ee.tooltip)),ee.paddingLeft!==void 0&&(ft.paddingLeft=ee.paddingLeft),ee.paddingRight!==void 0&&(ft.paddingRight=ee.paddingRight),ee instanceof sai.default&&ee.data!==void 0&&(ft.data=ee.data),ft}function be(ee){const xe=_s.InlayHintLabelPart.create(ee.value);return ee.location!==void 0&&(xe.location=Dt(ee.location)),ee.command!==void 0&&(xe.command=Bo(ee.command)),ee.tooltip!==void 0&&(xe.tooltip=Ea(ee.tooltip)),xe}function Ea(ee){return typeof ee=="string"?ee:{kind:_s.MarkupKind.Markdown,value:ee.value}}return{asUri:i,asTextDocumentIdentifier:n,asTextDocumentItem:r,asVersionedTextDocumentIdentifier:o,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:dt,asPosition:De,asPositions:Be,asPositionsSync:Ct,asLocation:Dt,asDiagnosticSeverity:Xi,asDiagnosticTag:ss,asDiagnostic:hs,asDiagnostics:Zr,asDiagnosticsSync:ea,asCompletionItem:Ha,asTextEdit:nh,asSymbolKind:$c,asSymbolTag:Gs,asSymbolTags:ic,asReferenceParams:pl,asCodeAction:sh,asCodeActionSync:mg,asCodeActionContext:_c,asCodeActionContextSync:Gc,asInlineValueContext:ml,asCommand:Bo,asCodeLens:_l,asFormattingOptions:oh,asDocumentSymbolParams:ah,asCodeLensParams:Kc,asDocumentLink:qc,asDocumentLinkParams:Ua,asCallHierarchyItem:Br,asTypeHierarchyItem:Ts,asInlayHint:Fh,asWorkspaceSymbol:Ic,asInlineCompletionParams:nc}}Kle.createConverter=rai;var tde={};Object.defineProperty(tde,"__esModule",{value:!0});tde.createConverter=void 0;const hi=Zn,Bn=ms,Xm=Io,uo=Sh,oai=qle,aai=Qle,cai=jle,lai=Yle,f6e=EN,dai=Jle,hai=Xle,uai=Zle,gai=ede,p6e=ms;var Hne;(function(s){function e(t){let i=t;return i&&Xm.string(i.language)&&Xm.string(i.value)}s.is=e})(Hne||(Hne={}));function fai(s,e,t){const n=s||(T=>hi.Uri.parse(T));function r(T){return n(T)}function o(T){const ie=[];for(const ye of T)if(typeof ye=="string")ie.push(ye);else if(p6e.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 p6e.TextDocumentFilter.is(ye)&&ie.push({language:ye.language,scheme:ye.scheme,pattern:ye.pattern});return ie}async function a(T,ie){return uo.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 Bn.DiagnosticTag.Unnecessary:return hi.DiagnosticTag.Unnecessary;case Bn.DiagnosticTag.Deprecated:return hi.DiagnosticTag.Deprecated;default:return}}function f(T){return T?new hi.Position(T.line,T.character):void 0}function p(T){return T?new hi.Range(T.start.line,T.start.character,T.end.line,T.end.character):void 0}async function m(T,ie){return uo.map(T,ye=>new hi.Range(ye.start.line,ye.start.character,ye.end.line,ye.end.character),ie)}function v(T){if(T==null)return hi.DiagnosticSeverity.Error;switch(T){case Bn.DiagnosticSeverity.Error:return hi.DiagnosticSeverity.Error;case Bn.DiagnosticSeverity.Warning:return hi.DiagnosticSeverity.Warning;case Bn.DiagnosticSeverity.Information:return hi.DiagnosticSeverity.Information;case Bn.DiagnosticSeverity.Hint:return hi.DiagnosticSeverity.Hint}return hi.DiagnosticSeverity.Error}function b(T){if(Xm.string(T))return y(T);if(Hne.is(T))return y().appendCodeblock(T.value,T.language);if(Array.isArray(T)){let ie=[];for(let ye of T){let O=y();Hne.is(ye)?O.appendCodeblock(ye.value,ye.language):O.appendMarkdown(ye),ie.push(O)}return ie}else return y(T)}function w(T){if(Xm.string(T))return T;switch(T.kind){case Bn.MarkupKind.Markdown:return y(T.value);case Bn.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 hi.MarkdownString(T);else switch(T.kind){case Bn.MarkupKind.Markdown:ie=new hi.MarkdownString(T.value);break;case Bn.MarkupKind.PlainText:ie=new hi.MarkdownString,ie.appendText(T.value);break;default:ie=new hi.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 hi.Hover(b(T.contents),p(T.range))}async function A(T,ie,ye){if(!T)return;if(Array.isArray(T))return uo.map(T,Wi=>z(Wi,ie),ye);const O=T,{defaultRange:$,commitCharacters:se}=L(O,ie),qe=await uo.map(O.items,Wi=>z(Wi,se,$,O.itemDefaults?.insertTextMode,O.itemDefaults?.insertTextFormat,O.itemDefaults?.data),ye);return new hi.CompletionList(qe,O.isIncomplete)}function L(T,ie){const ye=T.itemDefaults?.editRange,O=T.itemDefaults?.commitCharacters??ie;return Bn.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 Bn.CompletionItemKind.Text<=T&&T<=Bn.CompletionItemKind.TypeParameter?[T-1,void 0]:[hi.CompletionItemKind.Text,T]}function P(T){switch(T){case Bn.CompletionItemTag.Deprecated:return hi.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 qe=R(T.tags),Wi=G(T),Hi=new oai.default(Wi);T.detail&&(Hi.detail=T.detail),T.documentation&&(Hi.documentation=w(T.documentation),Hi.documentationFormat=Xm.string(T.documentation)?"$string":T.documentation.kind),T.filterText&&(Hi.filterText=T.filterText);const ia=Y(T,ye,$);if(ia&&(Hi.insertText=ia.text,Hi.range=ia.range,Hi.fromEdit=ia.fromEdit),Xm.number(T.kind)){let[Cat,UFe]=k(T.kind);Hi.kind=Cat,UFe&&(Hi.originalItemKind=UFe)}T.sortText&&(Hi.sortText=T.sortText),T.additionalTextEdits&&(Hi.additionalTextEdits=De(T.additionalTextEdits));const Bl=T.commitCharacters!==void 0?Xm.stringArray(T.commitCharacters)?T.commitCharacters:void 0:ie;Bl&&(Hi.commitCharacters=Bl.slice()),T.command&&(Hi.command=mc(T.command)),(T.deprecated===!0||T.deprecated===!1)&&(Hi.deprecated=T.deprecated,T.deprecated===!0&&qe.push(hi.CompletionItemTag.Deprecated)),(T.preselect===!0||T.preselect===!1)&&(Hi.preselect=T.preselect);const _g=T.data??se;_g!==void 0&&(Hi.data=_g),qe.length>0&&(Hi.tags=qe);const Rde=T.insertTextMode??O;return Rde!==void 0&&(Hi.insertTextMode=Rde,Rde===Bn.InsertTextMode.asIs&&(Hi.keepWhitespace=!0)),Hi}function G(T){return Bn.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===Bn.InsertTextFormat.Snippet?{text:new hi.SnippetString(se),range:$,fromEdit:!0}:{text:se,range:$,fromEdit:!0}}else return T.insertText?O===Bn.InsertTextFormat.Snippet?{text:new hi.SnippetString(T.insertText),fromEdit:!1}:{text:T.insertText,fromEdit:!1}:void 0}function j(T){return Bn.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 hi.TextEdit(p(T.range),T.newText)}async function ge(T,ie){if(T)return uo.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(On(O));ie.children=ye}return ie}function nh(T,ie){T.tags=Ln(ie.tags),ie.deprecated&&(T.tags?T.tags.includes(hi.SymbolTag.Deprecated)||(T.tags=T.tags.concat(hi.SymbolTag.Deprecated)):T.tags=[hi.SymbolTag.Deprecated])}function mc(T){let ie={title:T.title,command:T.command};return T.arguments&&(ie.arguments=T.arguments),ie}async function $c(T,ie){if(T)return uo.map(T,mc,ie)}const Gs=new Map;Gs.set(Bn.CodeActionKind.Empty,hi.CodeActionKind.Empty),Gs.set(Bn.CodeActionKind.QuickFix,hi.CodeActionKind.QuickFix),Gs.set(Bn.CodeActionKind.Refactor,hi.CodeActionKind.Refactor),Gs.set(Bn.CodeActionKind.RefactorExtract,hi.CodeActionKind.RefactorExtract),Gs.set(Bn.CodeActionKind.RefactorInline,hi.CodeActionKind.RefactorInline),Gs.set(Bn.CodeActionKind.RefactorRewrite,hi.CodeActionKind.RefactorRewrite),Gs.set(Bn.CodeActionKind.Source,hi.CodeActionKind.Source),Gs.set(Bn.CodeActionKind.SourceOrganizeImports,hi.CodeActionKind.SourceOrganizeImports);function ic(T){if(T==null)return;let ie=Gs.get(T);if(ie)return ie;let ye=T.split(".");ie=hi.CodeActionKind.Empty;for(let O of ye)ie=ie.append(O);return ie}function pl(T){if(T!=null)return T.map(ie=>ic(ie))}async function sh(T,ie){if(T==null)return;let ye=new lai.default(T.title,T.data);return T.kind!==void 0&&(ye.kind=ic(T.kind)),T.diagnostics!==void 0&&(ye.diagnostics=c(T.diagnostics)),T.edit!==void 0&&(ye.edit=await rh(T.edit,ie)),T.command!==void 0&&(ye.command=mc(T.command)),T.isPreferred!==void 0&&(ye.isPreferred=T.isPreferred),T.disabled!==void 0&&(ye.disabled={reason:T.disabled.reason}),ye}function mg(T,ie){return uo.mapAsync(T,async ye=>Bn.Command.is(ye)?mc(ye):sh(ye,ie),ie)}function _c(T){if(!T)return;let ie=new aai.default(p(T.range));return T.command&&(ie.command=mc(T.command)),T.data!==void 0&&T.data!==null&&(ie.data=T.data),ie}async function Gc(T,ie){if(T)return uo.map(T,_c,ie)}async function rh(T,ie){if(!T)return;const ye=new Map;if(T.changeAnnotations!==void 0){const se=T.changeAnnotations;await uo.forEach(Object.keys(se),qe=>{const Wi=kc(se[qe]);ye.set(qe,Wi)},ie)}const O=se=>{if(se!==void 0)return ye.get(se)},$=new hi.WorkspaceEdit;if(T.documentChanges){const se=T.documentChanges;await uo.forEach(se,qe=>{if(Bn.CreateFile.is(qe))$.createFile(n(qe.uri),qe.options,O(qe.annotationId));else if(Bn.RenameFile.is(qe))$.renameFile(n(qe.oldUri),n(qe.newUri),qe.options,O(qe.annotationId));else if(Bn.DeleteFile.is(qe))$.deleteFile(n(qe.uri),qe.options,O(qe.annotationId));else if(Bn.TextDocumentEdit.is(qe)){const Wi=n(qe.textDocument.uri);for(const Hi of qe.edits)Bn.AnnotatedTextEdit.is(Hi)?$.replace(Wi,p(Hi.range),Hi.newText,O(Hi.annotationId)):$.replace(Wi,p(Hi.range),Hi.newText)}else throw new Error(`Unknown workspace edit change received: +${JSON.stringify(qe,void 0,4)}`)},ie)}else if(T.changes){const se=T.changes;await uo.forEach(Object.keys(se),qe=>{$.set(n(qe),De(se[qe]))},ie)}return $}function kc(T){if(T!==void 0)return{label:T.label,needsConfirmation:!!T.needsConfirmation,description:T.description}}function ml(T){let ie=p(T.range),ye=T.target?r(T.target):void 0,O=new cai.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 nc(T,ie){if(T)return uo.map(T,ml,ie)}function Bo(T){return new hi.Color(T.red,T.green,T.blue,T.alpha)}function _l(T){return new hi.ColorInformation(p(T.range),Bo(T.color))}async function oh(T,ie){if(T)return uo.map(T,_l,ie)}function ah(T){let ie=new hi.ColorPresentation(T.label);return ie.additionalTextEdits=De(T.additionalTextEdits),T.textEdit&&(ie.textEdit=ne(T.textEdit)),ie}async function Kc(T,ie){if(T)return uo.map(T,ah,ie)}function qc(T){if(T)switch(T){case Bn.FoldingRangeKind.Comment:return hi.FoldingRangeKind.Comment;case Bn.FoldingRangeKind.Imports:return hi.FoldingRangeKind.Imports;case Bn.FoldingRangeKind.Region:return hi.FoldingRangeKind.Region}}function Ua(T){return new hi.FoldingRange(T.startLine,T.endLine,qc(T.kind))}async function Br(T,ie){if(T)return uo.map(T,Ua,ie)}function Ts(T){return new hi.SelectionRange(p(T.range),T.parent?Ts(T.parent):void 0)}async function Ic(T,ie){return Array.isArray(T)?uo.map(T,Ts,ie):[]}function Fh(T){return Bn.InlineValueText.is(T)?new hi.InlineValueText(p(T.range),T.text):Bn.InlineValueVariableLookup.is(T)?new hi.InlineValueVariableLookup(p(T.range),T.variableName,T.caseSensitiveLookup):new hi.InlineValueEvaluatableExpression(p(T.range),T.expression)}async function be(T,ie){return Array.isArray(T)?uo.map(T,Fh,ie):[]}async function Ea(T,ie){const ye=typeof T.label=="string"?T.label:await uo.map(T.label,ee,ie),O=new gai.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 hi.InlayHintLabelPart(T.value);return T.location!==void 0&&(ie.location=Xi(T.location)),T.tooltip!==void 0&&(ie.tooltip=xe(T.tooltip)),T.command!==void 0&&(ie.command=mc(T.command)),ie}function xe(T){return typeof T=="string"?T:y(T)}async function ft(T,ie){if(Array.isArray(T))return uo.mapAsync(T,Ea,ie)}function $n(T){if(T===null)return;const ie=new dai.default(rs(T.kind),T.name,T.detail||"",r(T.uri),p(T.range),p(T.selectionRange),T.data);return T.tags!==void 0&&(ie.tags=Ln(T.tags)),ie}async function Ss(T,ie){if(T!==null)return uo.map(T,$n,ie)}async function Wr(T,ie){return new hi.CallHierarchyIncomingCall($n(T.from),await m(T.fromRanges,ie))}async function Va(T,ie){if(T!==null)return uo.mapAsync(T,Wr,ie)}async function ta(T,ie){return new hi.CallHierarchyOutgoingCall($n(T.to),await m(T.fromRanges,ie))}async function Oh(T,ie){if(T!==null)return uo.mapAsync(T,ta,ie)}async function le(T,ie){if(T!=null)return new hi.SemanticTokens(new Uint32Array(T.data),T.resultId)}function ho(T){return new hi.SemanticTokensEdit(T.start,T.deleteCount,T.data!==void 0?new Uint32Array(T.data):void 0)}async function nr(T,ie){if(T!=null)return new hi.SemanticTokensEdits(T.edits.map(ho),T.resultId)}function gn(T){return T}async function Se(T,ie){if(T!=null)return new hi.LinkedEditingRanges(await m(T.ranges,ie),at(T.wordPattern))}function at(T){if(T!=null)return new RegExp(T)}function Ot(T){if(T===null)return;let ie=new hai.default(rs(T.kind),T.name,T.detail||"",r(T.uri),p(T.range),p(T.selectionRange),T.data);return T.tags!==void 0&&(ie.tags=Ln(T.tags)),ie}async function Si(T,ie){if(T!==null)return uo.map(T,Ot,ie)}function Bt(T){if(Xm.string(T))return T;if(Bn.RelativePattern.is(T)){if(Bn.URI.is(T.baseUri))return new hi.RelativePattern(r(T.baseUri),T.pattern);if(Bn.WorkspaceFolder.is(T.baseUri)){const ie=hi.workspace.getWorkspaceFolder(r(T.baseUri.uri));return ie!==void 0?new hi.RelativePattern(ie,T.pattern):void 0}}}async function K(T,ie){if(!T)return;if(Array.isArray(T))return uo.map(T,$=>de($),ie);const ye=T,O=await uo.map(ye.items,$=>de($),ie);return new hi.InlineCompletionList(O)}function de(T){let ie;typeof T.insertText=="string"?ie=T.insertText:ie=new hi.SnippetString(T.insertText.value);let ye;T.command&&(ye=mc(T.command));const O=new hi.InlineCompletionItem(ie,p(T.range),ye);return T.filterText&&(O.filterText=T.filterText),O}return{asUri:r,asDocumentSelector:o,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:Be,asSignatureInformations:Ct,asSignatureInformation:Ne,asParameterInformations:dt,asParameterInformation:Dt,asDeclarationResult:Ti,asDefinitionResult:ss,asLocation:Xi,asReferences:Zo,asDocumentHighlights:hs,asDocumentHighlight:Zr,asDocumentHighlightKind:ea,asSymbolKind:rs,asSymbolTag:Or,asSymbolTags:Ln,asSymbolInformations:ki,asSymbolInformation:Ha,asDocumentSymbols:wd,asDocumentSymbol:On,asCommand:mc,asCommands:$c,asCodeAction:sh,asCodeActionKind:ic,asCodeActionKinds:pl,asCodeActionResult:mg,asCodeLens:_c,asCodeLenses:Gc,asWorkspaceEdit:rh,asDocumentLink:ml,asDocumentLinks:nc,asFoldingRangeKind:qc,asFoldingRange:Ua,asFoldingRanges:Br,asColor:Bo,asColorInformation:_l,asColorInformations:oh,asColorPresentation:ah,asColorPresentations:Kc,asSelectionRange:Ts,asSelectionRanges:Ic,asInlineValue:Fh,asInlineValues:be,asInlayHint:Ea,asInlayHints:ft,asSemanticTokensLegend:gn,asSemanticTokens:le,asSemanticTokensEdit:ho,asSemanticTokensEdits:nr,asCallHierarchyItem:$n,asCallHierarchyItems:Ss,asCallHierarchyIncomingCall:Wr,asCallHierarchyIncomingCalls:Va,asCallHierarchyOutgoingCall:ta,asCallHierarchyOutgoingCalls:Oh,asLinkedEditingRanges:Se,asTypeHierarchyItem:Ot,asTypeHierarchyItems:Si,asGlobPattern:Bt,asInlineCompletionResult:K,asInlineCompletionItem:de}}tde.createConverter=fai;var IG={};Object.defineProperty(IG,"__esModule",{value:!0});IG.ProgressPart=void 0;const m6e=Zn,_6e=ms,v6e=Io;class pai{constructor(e,t,i){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress(_6e.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&&m6e.window.withProgress({location:m6e.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(_6e.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((n,r)=>{this._resolve=n,this._reject=r})})}report(e){if(this._infinite&&v6e.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(v6e.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}}IG.ProgressPart=pai;var ide={};Object.defineProperty(ide,"__esModule",{value:!0});ide.NotebookDocumentSyncFeature=void 0;const Tu=Zn,mai=$le,WS=ms,_ai=ro,b6e=Io;function w6e(s,e){return s[e]===void 0&&(s[e]={}),s[e]}var $F;(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=WS.NotebookDocument.create(f.asUri(h.uri),h.notebookType,h.version,n(u,f));return Object.keys(h.metadata).length>0&&(p.metadata=r(h.metadata)),p}e.asNotebookDocument=i;function n(h,u){return h.map(f=>o(f,u))}e.asNotebookCells=n;function r(h){return c(new Set,h)}e.asMetadata=r;function o(h,u){const f=WS.NotebookCell.create(a(h.kind),u.asUri(h.document.uri));return Object.keys(h.metadata).length>0&&(f.metadata=r(h.metadata)),h.executionSummary!==void 0&&b6e.number(h.executionSummary.executionOrder)&&b6e.boolean(h.executionSummary.success)&&(f.executionSummary={executionOrder:h.executionSummary.executionOrder,success:h.executionSummary.success}),f}e.asNotebookCell=o;function a(h){switch(h){case Tu.NotebookCellKind.Markup:return WS.NotebookCellKind.Markup;case Tu.NotebookCellKind.Code:return WS.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={}))})($F||($F={}));var q1e;(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})(Vne||(Vne={}));class hq{constructor(e,t){this.client=e,this.options=t,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(Une.asDocumentSelector(t)),Tu.workspace.onDidOpenNotebookDocument(i=>{this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i)},void 0,this.disposables);for(const i of Tu.workspace.notebookDocuments)this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i);Tu.workspace.onDidChangeNotebookDocument(i=>this.didChangeNotebookDocument(i),void 0,this.disposables),this.options.save===!0&&Tu.workspace.onDidSaveNotebookDocument(i=>this.didSave(i),void 0,this.disposables),Tu.workspace.onDidCloseNotebookDocument(i=>{this.didClose(i),this.notebookDidOpen.delete(i.uri.toString())},void 0,this.disposables)}getState(){for(const e of Tu.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 Tu.languages.match(this.selector,e)>0}didOpenNotebookCellTextDocument(e,t){if(Tu.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 r=i.uris.has(t.document.uri.toString());if(n&&r||!n&&!r)return;if(n){const o=this.getMatchingCells(e);if(o!==void 0){const a=this.asNotebookDocumentChangeEvent(e,void 0,i,o);a!==void 0&&this.doSendChange(a,o).catch(()=>{})}}}else n&&this.doSendOpen(e,[t]).catch(()=>{})}didChangeNotebookCellTextDocument(e,t){Tu.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,r=i.cells.findIndex(o=>o.document.uri.toString()===n.toString());if(r!==-1)if(r===0&&i.cells.length===1)this.doSendClose(e,i.cells).catch(()=>{});else{const o=i.cells.slice(),a=o.splice(r,1);this.doSendChange({notebook:e,cells:{structure:{array:{start:r,deleteCount:1},didClose:a}}},o).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 r=this.asNotebookDocumentChangeEvent(e.notebook,e,i,n);r!==void 0&&this.doSendChange(r,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(r,o)=>{const a=$F.c2p.asNotebookDocument(r,o,this.client.code2ProtocolConverter),c=o.map(l=>this.client.code2ProtocolConverter.asTextDocumentItem(l.document));try{await this.client.sendNotification(WS.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(),Vne.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 r=>{try{await this.client.sendNotification(WS.DidChangeNotebookDocumentNotification.type,{notebookDocument:$F.c2p.asVersionedNotebookDocumentIdentifier(r.notebook,this.client.code2ProtocolConverter),change:$F.c2p.asNotebookDocumentChangeEvent(r,this.client.code2ProtocolConverter)})}catch(o){throw this.client.error("Sending DidChangeNotebookDocumentNotification failed",o),o}},n=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),Vne.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(WS.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(n.uri)}})}catch(r){throw this.client.error("Sending DidSaveNotebookDocumentNotification failed",r),r}},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(r,o)=>{try{await this.client.sendNotification(WS.DidCloseNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(r.uri)},cellTextDocuments:o.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 r={notebook:e};t?.metadata!==void 0&&(r.metadata=$F.c2p.asMetadata(t.metadata));let o;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){const a=[];o=new Set(n.map(c=>c.document.uri.toString()));for(const c of t.cellChanges)o.has(c.cell.document.uri.toString())&&(c.executionSummary!==void 0||c.metadata!==void 0)&&a.push(c.cell);a.length>0&&(r.cells=r.cells??{},r.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=q1e.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));r.cells=r.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)}r.cells.structure={array:l,didOpen:u,didClose:f}}}return Object.keys(r).length>1?r: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||Q1e.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(r=>{const o=r.document.languageId;return i.some(a=>a.language==="*"||o===a.language)}):t;return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells=="function"?this.client.clientOptions.notebookDocumentOptions.filterCells(e,n):n}}class J1{constructor(e){this.client=e,this.registrations=new Map,this.registrationType=WS.NotebookDocumentSyncRegistrationType.type,Tu.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==J1.CellScheme)return;const[i,n]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||n===void 0))for(const r of this.registrations.values())r instanceof hq&&r.didOpenNotebookCellTextDocument(i,n)}),Tu.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;const i=t.document;if(i.uri.scheme!==J1.CellScheme)return;const[n]=this.findNotebookDocumentAndCell(i);if(n!==void 0)for(const r of this.registrations.values())r instanceof hq&&r.didChangeNotebookCellTextDocument(n,t)}),Tu.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==J1.CellScheme)return;const[i,n]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||n===void 0))for(const r of this.registrations.values())r instanceof hq&&r.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=w6e(w6e(e,"notebookDocument"),"synchronization");t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){const t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(Une.asDocumentSelector(t)))}initialize(e){const t=e.notebookDocumentSync;if(t===void 0)return;const i=t.id??_ai.generateUuid();this.register({id:i,registerOptions:t})}register(e){const t=new hq(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!==J1.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&Tu.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 Tu.workspace.notebookDocuments)for(const n of i.getCells())if(n.document.uri.toString()===t)return[i,n];return[void 0,void 0]}}ide.NotebookDocumentSyncFeature=J1;J1.CellScheme="vscode-notebook-cell";var BD={};Object.defineProperty(BD,"__esModule",{value:!0});BD.SyncConfigurationFeature=BD.toJSONObject=BD.ConfigurationFeature=void 0;const vB=Zn,ZV=ms,vai=Io,bai=ro,y6e=Nn;class wai{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(ZV.ConfigurationRequest.type,(t,i)=>{let n=o=>{let a=[];for(let c of o.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},r=e.middleware.workspace;return r&&r.configuration?r.configuration(t,i,n):n(t)})}getConfiguration(e,t){let i=null;if(t){let n=t.lastIndexOf(".");if(n===-1)i=hL(vB.workspace.getConfiguration(void 0,e).get(t));else{let r=vB.workspace.getConfiguration(t.substr(0,n),e);r&&(i=hL(r.get(t.substr(n+1))))}}else{let n=vB.workspace.getConfiguration(void 0,e);i={};for(let r of Object.keys(n))n.has(r)&&(i[r]=hL(n.get(r)))}return i===void 0&&(i=null),i}clear(){}}BD.ConfigurationFeature=wai;function hL(s){if(s){if(Array.isArray(s))return s.map(hL);if(typeof s=="object"){const e=Object.create(null);for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=hL(s[t]));return e}}return s}BD.toJSONObject=hL;class yai{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 ZV.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,y6e.ensure)((0,y6e.ensure)(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){this.isCleared=!1;let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:bai.generateUuid(),registerOptions:{section:e}})}register(e){let t=vB.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(vai.string(e)?i=[e]:i=e,i!==void 0&&t!==void 0&&!i.some(a=>t.affectsConfiguration(a)))return;const n=async o=>o===void 0?this._client.sendNotification(ZV.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(ZV.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(o)});let r=this._client.middleware.workspace?.didChangeConfiguration;(r?r(i,n):n(i)).catch(o=>{this._client.error(`Sending notification ${ZV.DidChangeConfigurationNotification.type.method} failed`,o)})}extractSettingsInformation(e){function t(r,o){let a=r;for(let c=0;c=0?c=vB.workspace.getConfiguration(o.substr(0,a),i).get(o.substr(a+1)):c=vB.workspace.getConfiguration(void 0,i).get(o),c){let l=e[r].split(".");t(n,l)[l[l.length-1]]=hL(c)}}return n}}BD.SyncConfigurationFeature=yai;var Yf={};Object.defineProperty(Yf,"__esModule",{value:!0});Yf.DidSaveTextDocumentFeature=Yf.WillSaveWaitUntilFeature=Yf.WillSaveFeature=Yf.DidChangeTextDocumentFeature=Yf.DidCloseTextDocumentFeature=Yf.DidOpenTextDocumentFeature=void 0;const tm=Zn,ka=ms,Bc=Nn,o4=ro;class Cai extends Bc.TextDocumentEventFeature{constructor(e,t){super(e,tm.workspace.onDidOpenTextDocument,ka.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,i=>e.code2ProtocolConverter.asOpenTextDocumentParams(i),i=>i,Bc.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,Bc.ensure)((0,Bc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:o4.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return ka.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;const t=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);tm.workspace.textDocuments.forEach(i=>{const n=i.uri.toString();if(!this._syncedDocuments.has(n)&&tm.languages.match(t,i)>0&&!this._client.hasDedicatedTextSynchronizationFeature(i)){const r=this._client.middleware,o=a=>this._client.sendNotification(this._type,this._createParams(a));(r.didOpen?r.didOpen(i,o):o(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)}}Yf.DidOpenTextDocumentFeature=Cai;class Sai extends Bc.TextDocumentEventFeature{constructor(e,t,i){super(e,tm.workspace.onDidCloseTextDocument,ka.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,n=>e.code2ProtocolConverter.asCloseTextDocumentParams(n),n=>n,Bc.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t,this._pendingTextDocumentChanges=i}get registrationType(){return ka.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,Bc.ensure)((0,Bc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:o4.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(tm.languages.match(t,n)>0&&!this._selectorFilter(i,n)&&!this._client.hasDedicatedTextSynchronizationFeature(n)){let r=this._client.middleware,o=a=>this._client.sendNotification(this._type,this._createParams(a));this._syncedDocuments.delete(n.uri.toString()),(r.didClose?r.didClose(n,o):o(n)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)})}})}}Yf.DidCloseTextDocumentFeature=Sai;class Aai extends Bc.DynamicDocumentFeature{constructor(e,t){super(e),this._changeData=new Map,this._onNotificationSent=new tm.EventEmitter,this._onPendingChangeAdded=new tm.EventEmitter,this._pendingTextDocumentChanges=t,this._syncKind=ka.TextDocumentSyncKind.None}get onNotificationSent(){return this._onNotificationSent.event}get onPendingChangeAdded(){return this._onPendingChangeAdded.event}get syncKind(){return this._syncKind}get registrationType(){return ka.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,Bc.ensure)((0,Bc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.change!==void 0&&i.change!==ka.TextDocumentSyncKind.None&&this.register({id:o4.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:i.change})})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=tm.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 r of this._changeData.values())if(tm.languages.match(r.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){const o=this._client.middleware;if(r.syncKind===ka.TextDocumentSyncKind.Incremental){const a=async c=>{const l=this._client.code2ProtocolConverter.asChangeTextDocumentParams(c,t,i);await this._client.sendNotification(ka.DidChangeTextDocumentNotification.type,l),this.notificationSent(c.document,ka.DidChangeTextDocumentNotification.type,l)};n.push(o.didChange?o.didChange(e,c=>a(c)):a(e))}else if(r.syncKind===ka.TextDocumentSyncKind.Full){const a=async c=>{const l=c.document.uri.toString();this._pendingTextDocumentChanges.set(l,c.document),this._onPendingChangeAdded.fire()};n.push(o.didChange?o.didChange(e,c=>a(c)):a(e))}}return Promise.all(n).then(void 0,r=>{throw this._client.error(`Sending document notification ${ka.DidChangeTextDocumentNotification.type.method} failed`,r),r})}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=ka.TextDocumentSyncKind.None;else{this._syncKind=ka.TextDocumentSyncKind.None;for(const t of this._changeData.values())if(this.updateSyncKind(t.syncKind),this._syncKind===ka.TextDocumentSyncKind.Full)break}}clear(){this._pendingTextDocumentChanges.clear(),this._changeData.clear(),this._syncKind=ka.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(tm.languages.match(t.documentSelector,e)>0)return{send:i=>this.callback(i)}}updateSyncKind(e){if(this._syncKind!==ka.TextDocumentSyncKind.Full)switch(e){case ka.TextDocumentSyncKind.Full:this._syncKind=e;break;case ka.TextDocumentSyncKind.Incremental:this._syncKind===ka.TextDocumentSyncKind.None&&(this._syncKind=ka.TextDocumentSyncKind.Incremental);break}}}Yf.DidChangeTextDocumentFeature=Aai;class Eai extends Bc.TextDocumentEventFeature{constructor(e){super(e,tm.workspace.onWillSaveTextDocument,ka.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),t=>t.document,(t,i)=>Bc.TextDocumentEventFeature.textDocumentFilter(t,i.document))}get registrationType(){return ka.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,Bc.ensure)((0,Bc.ensure)(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSave&&this.register({id:o4.generateUuid(),registerOptions:{documentSelector:t}})}getTextDocument(e){return e.document}}Yf.WillSaveFeature=Eai;class xai extends Bc.DynamicDocumentFeature{constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return ka.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,Bc.ensure)((0,Bc.ensure)(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSaveWaitUntil&&this.register({id:o4.generateUuid(),registerOptions:{documentSelector:t}})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=tm.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(Bc.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,i=n=>this._client.sendRequest(ka.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(n)).then(async r=>{let o=await this._client.protocol2CodeConverter.asTextEdits(r);return o===void 0?[]:o});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)}}Yf.WillSaveWaitUntilFeature=xai;class Dai extends Bc.TextDocumentEventFeature{constructor(e){super(e,tm.workspace.onDidSaveTextDocument,ka.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),t=>t,Bc.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return ka.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,Bc.ensure)((0,Bc.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:o4.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},n)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}getTextDocument(e){return e}}Yf.DidSaveTextDocumentFeature=Dai;var nde={};Object.defineProperty(nde,"__esModule",{value:!0});nde.CompletionItemFeature=void 0;const kai=Zn,xr=ms,Mge=Nn,Iai=ro,Tai=[xr.CompletionItemKind.Text,xr.CompletionItemKind.Method,xr.CompletionItemKind.Function,xr.CompletionItemKind.Constructor,xr.CompletionItemKind.Field,xr.CompletionItemKind.Variable,xr.CompletionItemKind.Class,xr.CompletionItemKind.Interface,xr.CompletionItemKind.Module,xr.CompletionItemKind.Property,xr.CompletionItemKind.Unit,xr.CompletionItemKind.Value,xr.CompletionItemKind.Enum,xr.CompletionItemKind.Keyword,xr.CompletionItemKind.Snippet,xr.CompletionItemKind.Color,xr.CompletionItemKind.File,xr.CompletionItemKind.Reference,xr.CompletionItemKind.Folder,xr.CompletionItemKind.EnumMember,xr.CompletionItemKind.Constant,xr.CompletionItemKind.Struct,xr.CompletionItemKind.Event,xr.CompletionItemKind.Operator,xr.CompletionItemKind.TypeParameter];class Lai extends Mge.TextDocumentLanguageFeature{constructor(e){super(e,xr.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,Mge.ensure)((0,Mge.ensure)(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[xr.MarkupKind.Markdown,xr.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[xr.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[xr.InsertTextMode.asIs,xr.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=xr.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:Tai},t.completionList={itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]}}initialize(e,t){const i=this.getRegistrationOptions(t,e.completionProvider);i&&this.register({id:Iai.generateUuid(),registerOptions:i})}registerLanguageProvider(e,t){this.labelDetailsSupport.set(t,!!e.completionItem?.labelDetailsSupport);const i=e.triggerCharacters??[],n=e.allCommitCharacters,r=e.documentSelector,o={provideCompletionItems:(a,c,l,d)=>{const h=this._client,u=this._client.middleware,f=(p,m,v,b)=>h.sendRequest(xr.CompletionRequest.type,h.code2ProtocolConverter.asCompletionParams(p,m,v),b).then(w=>b.isCancellationRequested?null:h.protocol2CodeConverter.asCompletionResult(w,n,b),w=>h.handleFailedRequest(xr.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(xr.CompletionResolveRequest.type,l.code2ProtocolConverter.asCompletionItem(u,!!this.labelDetailsSupport.get(t)),f).then(p=>f.isCancellationRequested?null:l.protocol2CodeConverter.asCompletionItem(p),p=>l.handleFailedRequest(xr.CompletionResolveRequest.type,f,p,u));return d.resolveCompletionItem?d.resolveCompletionItem(a,c,h):h(a,c)}:void 0};return[kai.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),o,...i),o]}}nde.CompletionItemFeature=Lai;var sde={};Object.defineProperty(sde,"__esModule",{value:!0});sde.HoverFeature=void 0;const Rai=Zn,K4=ms,Nge=Nn,Mai=ro;class Nai extends Nge.TextDocumentLanguageFeature{constructor(e){super(e,K4.HoverRequest.type)}fillClientCapabilities(e){const t=(0,Nge.ensure)((0,Nge.ensure)(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[K4.MarkupKind.Markdown,K4.MarkupKind.PlainText]}initialize(e,t){const i=this.getRegistrationOptions(t,e.hoverProvider);i&&this.register({id:Mai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideHover:(n,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(K4.HoverRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asHover(f),f=>a.handleFailedRequest(K4.HoverRequest.type,u,f,null)),l=a.middleware;return l.provideHover?l.provideHover(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Rai.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}sde.HoverFeature=Nai;var rde={};Object.defineProperty(rde,"__esModule",{value:!0});rde.DefinitionFeature=void 0;const Pai=Zn,Pge=ms,Fge=Nn,Fai=ro;class Oai extends Fge.TextDocumentLanguageFeature{constructor(e){super(e,Pge.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,Fge.ensure)((0,Fge.ensure)(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.definitionProvider);i&&this.register({id:Fai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDefinition:(n,r,o)=>{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,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Pai.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}rde.DefinitionFeature=Oai;var ode={};Object.defineProperty(ode,"__esModule",{value:!0});ode.SignatureHelpFeature=void 0;const C6e=Zn,q4=ms,Oge=Nn,Bai=ro;class Wai extends Oge.TextDocumentLanguageFeature{constructor(e){super(e,q4.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,Oge.ensure)((0,Oge.ensure)(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[q4.MarkupKind.Markdown,q4.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:Bai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t={provideSignatureHelp:(i,n,r,o)=>{const a=this._client,c=(d,h,u,f)=>a.sendRequest(q4.SignatureHelpRequest.type,a.code2ProtocolConverter.asSignatureHelpParams(d,h,u),f).then(p=>f.isCancellationRequested?null:a.protocol2CodeConverter.asSignatureHelp(p,f),p=>a.handleFailedRequest(q4.SignatureHelpRequest.type,f,p,null)),l=a.middleware;return l.provideSignatureHelp?l.provideSignatureHelp(i,n,o,r,c):c(i,n,o,r)}};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 C6e.languages.registerSignatureHelpProvider(i,t,...n)}else{const n={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return C6e.languages.registerSignatureHelpProvider(i,t,n)}}}ode.SignatureHelpFeature=Wai;var ade={};Object.defineProperty(ade,"__esModule",{value:!0});ade.DocumentHighlightFeature=void 0;const Hai=Zn,Bge=ms,Wge=Nn,Uai=ro;class Vai extends Wge.TextDocumentLanguageFeature{constructor(e){super(e,Bge.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,Wge.ensure)((0,Wge.ensure)(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentHighlightProvider);i&&this.register({id:Uai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentHighlights:(n,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Bge.DocumentHighlightRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDocumentHighlights(f,u),f=>a.handleFailedRequest(Bge.DocumentHighlightRequest.type,u,f,null)),l=a.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(n,r,o,c):c(n,r,o)}};return[Hai.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}ade.DocumentHighlightFeature=Vai;var AFe={};(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.DocumentSymbolFeature=s.SupportedSymbolTags=s.SupportedSymbolKinds=void 0;const e=Zn,t=ms,i=Nn,n=ro;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 r 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=r})(AFe);var cde={};Object.defineProperty(cde,"__esModule",{value:!0});cde.WorkspaceSymbolFeature=void 0;const zai=Zn,Q4=ms,Hge=Nn,S6e=AFe,$ai=ro;class Gai extends Hge.WorkspaceFeature{constructor(e){super(e,Q4.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,Hge.ensure)((0,Hge.ensure)(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:S6e.SupportedSymbolKinds},t.tagSupport={valueSet:S6e.SupportedSymbolTags},t.resolveSupport={properties:["location.range"]}}initialize(e){e.workspaceSymbolProvider&&this.register({id:$ai.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){const t={provideWorkspaceSymbols:(i,n)=>{const r=this._client,o=(c,l)=>r.sendRequest(Q4.WorkspaceSymbolRequest.type,{query:c},l).then(d=>l.isCancellationRequested?null:r.protocol2CodeConverter.asSymbolInformations(d,l),d=>r.handleFailedRequest(Q4.WorkspaceSymbolRequest.type,l,d,null)),a=r.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(i,n,o):o(i,n)},resolveWorkspaceSymbol:e.resolveProvider===!0?(i,n)=>{const r=this._client,o=(c,l)=>r.sendRequest(Q4.WorkspaceSymbolResolveRequest.type,r.code2ProtocolConverter.asWorkspaceSymbol(c),l).then(d=>l.isCancellationRequested?null:r.protocol2CodeConverter.asSymbolInformation(d),d=>r.handleFailedRequest(Q4.WorkspaceSymbolResolveRequest.type,l,d,null)),a=r.middleware;return a.resolveWorkspaceSymbol?a.resolveWorkspaceSymbol(i,n,o):o(i,n)}:void 0};return[zai.languages.registerWorkspaceSymbolProvider(t),t]}}cde.WorkspaceSymbolFeature=Gai;var lde={};Object.defineProperty(lde,"__esModule",{value:!0});lde.ReferencesFeature=void 0;const Kai=Zn,Uge=ms,Vge=Nn,qai=ro;class Qai extends Vge.TextDocumentLanguageFeature{constructor(e){super(e,Uge.ReferencesRequest.type)}fillClientCapabilities(e){(0,Vge.ensure)((0,Vge.ensure)(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.referencesProvider);i&&this.register({id:qai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideReferences:(n,r,o,a)=>{const c=this._client,l=(h,u,f,p)=>c.sendRequest(Uge.ReferencesRequest.type,c.code2ProtocolConverter.asReferenceParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asReferences(m,p),m=>c.handleFailedRequest(Uge.ReferencesRequest.type,p,m,null)),d=c.middleware;return d.provideReferences?d.provideReferences(n,r,o,a,l):l(n,r,o,a)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Kai.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}lde.ReferencesFeature=Qai;var dde={};Object.defineProperty(dde,"__esModule",{value:!0});dde.CodeActionFeature=void 0;const jai=Zn,Ip=ms,Yai=ro,zge=Nn;class Jai extends zge.TextDocumentLanguageFeature{constructor(e){super(e,Ip.CodeActionRequest.type)}fillClientCapabilities(e){const t=(0,zge.ensure)((0,zge.ensure)(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:["edit"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[Ip.CodeActionKind.Empty,Ip.CodeActionKind.QuickFix,Ip.CodeActionKind.Refactor,Ip.CodeActionKind.RefactorExtract,Ip.CodeActionKind.RefactorInline,Ip.CodeActionKind.RefactorRewrite,Ip.CodeActionKind.Source,Ip.CodeActionKind.SourceOrganizeImports]}},t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.codeActionProvider);i&&this.register({id:Yai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideCodeActions:(n,r,o,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(Ip.CodeActionRequest.type,m,p).then(v=>p.isCancellationRequested||v===null||v===void 0?null:c.protocol2CodeConverter.asCodeActionResult(v,p),v=>c.handleFailedRequest(Ip.CodeActionRequest.type,p,v,null))},d=c.middleware;return d.provideCodeActions?d.provideCodeActions(n,r,o,a,l):l(n,r,o,a)},resolveCodeAction:e.resolveProvider?(n,r)=>{const o=this._client,a=this._client.middleware,c=async(l,d)=>o.sendRequest(Ip.CodeActionResolveRequest.type,o.code2ProtocolConverter.asCodeActionSync(l),d).then(h=>d.isCancellationRequested?l:o.protocol2CodeConverter.asCodeAction(h,d),h=>o.handleFailedRequest(Ip.CodeActionResolveRequest.type,d,h,l));return a.resolveCodeAction?a.resolveCodeAction(n,r,c):c(n,r)}:void 0};return[jai.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),i]}}dde.CodeActionFeature=Jai;var hde={};Object.defineProperty(hde,"__esModule",{value:!0});hde.CodeLensFeature=void 0;const A6e=Zn,RP=ms,Xai=ro,j4=Nn;class Zai extends j4.TextDocumentLanguageFeature{constructor(e){super(e,RP.CodeLensRequest.type)}fillClientCapabilities(e){(0,j4.ensure)((0,j4.ensure)(e,"textDocument"),"codeLens").dynamicRegistration=!0,(0,j4.ensure)((0,j4.ensure)(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(RP.CodeLensRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeCodeLensEmitter.fire()});const n=this.getRegistrationOptions(t,e.codeLensProvider);n&&this.register({id:Xai.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new A6e.EventEmitter,n={onDidChangeCodeLenses:i.event,provideCodeLenses:(r,o)=>{const a=this._client,c=(d,h)=>a.sendRequest(RP.CodeLensRequest.type,a.code2ProtocolConverter.asCodeLensParams(d),h).then(u=>h.isCancellationRequested?null:a.protocol2CodeConverter.asCodeLenses(u,h),u=>a.handleFailedRequest(RP.CodeLensRequest.type,h,u,null)),l=a.middleware;return l.provideCodeLenses?l.provideCodeLenses(r,o,c):c(r,o)},resolveCodeLens:e.resolveProvider?(r,o)=>{const a=this._client,c=(d,h)=>a.sendRequest(RP.CodeLensResolveRequest.type,a.code2ProtocolConverter.asCodeLens(d),h).then(u=>h.isCancellationRequested?d:a.protocol2CodeConverter.asCodeLens(u),u=>a.handleFailedRequest(RP.CodeLensResolveRequest.type,h,u,d)),l=a.middleware;return l.resolveCodeLens?l.resolveCodeLens(r,o,c):c(r,o)}:void 0};return[A6e.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),{provider:n,onDidChangeCodeLensEmitter:i}]}}hde.CodeLensFeature=Zai;var WD={};Object.defineProperty(WD,"__esModule",{value:!0});WD.DocumentOnTypeFormattingFeature=WD.DocumentRangeFormattingFeature=WD.DocumentFormattingFeature=void 0;const ude=Zn,mb=ms,EFe=ro,AA=Nn;var _U;(function(s){function e(t){const i=ude.workspace.getConfiguration("files",t);return{trimTrailingWhitespace:i.get("trimTrailingWhitespace"),trimFinalNewlines:i.get("trimFinalNewlines"),insertFinalNewline:i.get("insertFinalNewline")}}s.fromConfiguration=e})(_U||(_U={}));class eci extends AA.TextDocumentLanguageFeature{constructor(e){super(e,mb.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,AA.ensure)((0,AA.ensure)(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentFormattingProvider);i&&this.register({id:EFe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentFormattingEdits:(n,r,o)=>{const a=this._client,c=(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),options:a.code2ProtocolConverter.asFormattingOptions(h,_U.fromConfiguration(d))};return a.sendRequest(mb.DocumentFormattingRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asTextEdits(p,u),p=>a.handleFailedRequest(mb.DocumentFormattingRequest.type,u,p,null))},l=a.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(n,r,o,c):c(n,r,o)}};return[ude.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}WD.DocumentFormattingFeature=eci;class tci extends AA.TextDocumentLanguageFeature{constructor(e){super(e,mb.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){const t=(0,AA.ensure)((0,AA.ensure)(e,"textDocument"),"rangeFormatting");t.dynamicRegistration=!0,t.rangesSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);i&&this.register({id:EFe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentRangeFormattingEdits:(n,r,o,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,_U.fromConfiguration(h))};return c.sendRequest(mb.DocumentRangeFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(mb.DocumentRangeFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangeFormattingEdits?d.provideDocumentRangeFormattingEdits(n,r,o,a,l):l(n,r,o,a)}};return e.rangesSupport&&(i.provideDocumentRangesFormattingEdits=(n,r,o,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,_U.fromConfiguration(h))};return c.sendRequest(mb.DocumentRangesFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(mb.DocumentRangesFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangesFormattingEdits?d.provideDocumentRangesFormattingEdits(n,r,o,a,l):l(n,r,o,a)}),[ude.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}WD.DocumentRangeFormattingFeature=tci;class ici extends AA.TextDocumentLanguageFeature{constructor(e){super(e,mb.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,AA.ensure)((0,AA.ensure)(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);i&&this.register({id:EFe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideOnTypeFormattingEdits:(r,o,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,_U.fromConfiguration(f))};return d.sendRequest(mb.DocumentOnTypeFormattingRequest.type,w,b).then(y=>b.isCancellationRequested?null:d.protocol2CodeConverter.asTextEdits(y,b),y=>d.handleFailedRequest(mb.DocumentOnTypeFormattingRequest.type,b,y,null))},u=d.middleware;return u.provideOnTypeFormattingEdits?u.provideOnTypeFormattingEdits(r,o,a,c,l,h):h(r,o,a,c,l)}},n=e.moreTriggerCharacter||[];return[ude.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.firstTriggerCharacter,...n),i]}}WD.DocumentOnTypeFormattingFeature=ici;var gde={};Object.defineProperty(gde,"__esModule",{value:!0});gde.RenameFeature=void 0;const nci=Zn,t0=ms,sci=ro,E6e=Io,$ge=Nn;class rci extends $ge.TextDocumentLanguageFeature{constructor(e){super(e,t0.RenameRequest.type)}fillClientCapabilities(e){let t=(0,$ge.ensure)((0,$ge.ensure)(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=t0.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.renameProvider);i&&(E6e.boolean(e.renameProvider)&&(i.prepareProvider=!1),this.register({id:sci.generateUuid(),registerOptions:i}))}registerLanguageProvider(e){const t=e.documentSelector,i={provideRenameEdits:(n,r,o,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(t0.RenameRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asWorkspaceEdit(v,p),v=>c.handleFailedRequest(t0.RenameRequest.type,p,v,null,!1))},d=c.middleware;return d.provideRenameEdits?d.provideRenameEdits(n,r,o,a,l):l(n,r,o,a)},prepareRename:e.prepareProvider?(n,r,o)=>{const a=this._client,c=(d,h,u)=>{let f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),position:a.code2ProtocolConverter.asPosition(h)};return a.sendRequest(t0.PrepareRenameRequest.type,f,u).then(p=>u.isCancellationRequested?null:t0.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&&t0.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,r,o,c):c(n,r,o)}:void 0};return[this.registerProvider(t,i),i]}registerProvider(e,t){return nci.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}isDefaultBehavior(e){const t=e;return t&&E6e.boolean(t.defaultBehavior)}}gde.RenameFeature=rci;var fde={};Object.defineProperty(fde,"__esModule",{value:!0});fde.DocumentLinkFeature=void 0;const oci=Zn,Y4=ms,Gge=Nn,aci=ro;class cci extends Gge.TextDocumentLanguageFeature{constructor(e){super(e,Y4.DocumentLinkRequest.type)}fillClientCapabilities(e){const t=(0,Gge.ensure)((0,Gge.ensure)(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentLinkProvider);i&&this.register({id:aci.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentLinks:(n,r)=>{const o=this._client,a=(l,d)=>o.sendRequest(Y4.DocumentLinkRequest.type,o.code2ProtocolConverter.asDocumentLinkParams(l),d).then(h=>d.isCancellationRequested?null:o.protocol2CodeConverter.asDocumentLinks(h,d),h=>o.handleFailedRequest(Y4.DocumentLinkRequest.type,d,h,null)),c=o.middleware;return c.provideDocumentLinks?c.provideDocumentLinks(n,r,a):a(n,r)},resolveDocumentLink:e.resolveProvider?(n,r)=>{const o=this._client;let a=(l,d)=>o.sendRequest(Y4.DocumentLinkResolveRequest.type,o.code2ProtocolConverter.asDocumentLink(l),d).then(h=>d.isCancellationRequested?l:o.protocol2CodeConverter.asDocumentLink(h),h=>o.handleFailedRequest(Y4.DocumentLinkResolveRequest.type,d,h,l));const c=o.middleware;return c.resolveDocumentLink?c.resolveDocumentLink(n,r,a):a(n,r)}:void 0};return[oci.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}fde.DocumentLinkFeature=cci;var pde={};Object.defineProperty(pde,"__esModule",{value:!0});pde.ExecuteCommandFeature=void 0;const lci=Zn,Kge=ms,dci=ro,x6e=Nn;class hci{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 Kge.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,x6e.ensure)((0,x6e.ensure)(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register({id:dci.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){const t=this._client,i=t.middleware,n=(r,o)=>{let a={command:r,arguments:o};return t.sendRequest(Kge.ExecuteCommandRequest.type,a).then(void 0,c=>t.handleFailedRequest(Kge.ExecuteCommandRequest.type,void 0,c,void 0))};if(e.registerOptions.commands){const r=[];for(const o of e.registerOptions.commands)r.push(lci.commands.registerCommand(o,(...a)=>i.executeCommand?i.executeCommand(o,a,n):n(o,a)));this._commands.set(e.id,r)}}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()}}pde.ExecuteCommandFeature=hci;var mde={};Object.defineProperty(mde,"__esModule",{value:!0});mde.FileSystemWatcherFeature=void 0;const uci=Zn,i0=ms,uq=Nn;class gci{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 i0.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,uq.ensure)((0,uq.ensure)(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0,(0,uq.ensure)((0,uq.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 r=!0,o=!0,a=!0;i.kind!==void 0&&i.kind!==null&&(r=(i.kind&i0.WatchKind.Create)!==0,o=(i.kind&i0.WatchKind.Change)!==0,a=(i.kind&i0.WatchKind.Delete)!==0);const c=uci.workspace.createFileSystemWatcher(n,!r,!o,!a);this.hookListeners(c,r,o,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,r){t&&e.onDidCreate(o=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(o),type:i0.FileChangeType.Created}),null,r),i&&e.onDidChange(o=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(o),type:i0.FileChangeType.Changed}),null,r),n&&e.onDidDelete(o=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(o),type:i0.FileChangeType.Deleted}),null,r)}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()}}mde.FileSystemWatcherFeature=gci;var _de={};Object.defineProperty(_de,"__esModule",{value:!0});_de.ColorProviderFeature=void 0;const fci=Zn,J4=ms,qge=Nn;class pci extends qge.TextDocumentLanguageFeature{constructor(e){super(e,J4.DocumentColorRequest.type)}fillClientCapabilities(e){(0,qge.ensure)((0,qge.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,r,o)=>{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(J4.ColorPresentationRequest.type,f,u).then(p=>u.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(p,u),p=>a.handleFailedRequest(J4.ColorPresentationRequest.type,u,p,null))},l=a.middleware;return l.provideColorPresentations?l.provideColorPresentations(n,r,o,c):c(n,r,o)},provideDocumentColors:(n,r)=>{const o=this._client,a=(l,d)=>{const h={textDocument:o.code2ProtocolConverter.asTextDocumentIdentifier(l)};return o.sendRequest(J4.DocumentColorRequest.type,h,d).then(u=>d.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(u,d),u=>o.handleFailedRequest(J4.DocumentColorRequest.type,d,u,null))},c=o.middleware;return c.provideDocumentColors?c.provideDocumentColors(n,r,a):a(n,r)}};return[fci.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}_de.ColorProviderFeature=pci;var vde={};Object.defineProperty(vde,"__esModule",{value:!0});vde.ImplementationFeature=void 0;const mci=Zn,Qge=ms,jge=Nn;class _ci extends jge.TextDocumentLanguageFeature{constructor(e){super(e,Qge.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,jge.ensure)((0,jge.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,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Qge.ImplementationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Qge.ImplementationRequest.type,u,f,null)),l=a.middleware;return l.provideImplementation?l.provideImplementation(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return mci.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}vde.ImplementationFeature=_ci;var bde={};Object.defineProperty(bde,"__esModule",{value:!0});bde.TypeDefinitionFeature=void 0;const vci=Zn,Yge=ms,X4=Nn;class bci extends X4.TextDocumentLanguageFeature{constructor(e){super(e,Yge.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,X4.ensure)((0,X4.ensure)(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=(0,X4.ensure)((0,X4.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,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Yge.TypeDefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Yge.TypeDefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return vci.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}bde.TypeDefinitionFeature=bci;var vU={};Object.defineProperty(vU,"__esModule",{value:!0});vU.WorkspaceFoldersFeature=vU.arrayDiff=void 0;const wci=ro,gq=Zn,Z4=ms;function Jge(s,e){if(s!=null)return s[e]}function j1e(s,e){return s.filter(t=>e.indexOf(t)<0)}vU.arrayDiff=j1e;class yci{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 Z4.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){const t=gq.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(Z4.WorkspaceFoldersRequest.type,r=>{const o=()=>{const c=gq.workspace.workspaceFolders;return c===void 0?null:c.map(d=>this.asProtocol(d))},a=t.middleware.workspace;return a&&a.workspaceFolders?a.workspaceFolders(r,o):o()});const i=Jge(Jge(Jge(e,"workspace"),"workspaceFolders"),"changeNotifications");let n;typeof i=="string"?n=i:i===!0&&(n=wci.generateUuid()),n&&this.register({id:n,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){const i=j1e(this._initialFolders,e),n=j1e(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 ${Z4.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(Z4.DidChangeWorkspaceFoldersNotification.type,i)}register(e){let t=e.id,i=this._client,n=gq.workspace.onDidChangeWorkspaceFolders(r=>{let o=l=>this.doSendEvent(l.added,l.removed),a=i.middleware.workspace;(a&&a.didChangeWorkspaceFolders?a.didChangeWorkspaceFolders(r,o):o(r)).catch(l=>{this._client.error(`Sending notification ${Z4.DidChangeWorkspaceFoldersNotification.type.method} failed`,l)})});this._listeners.set(t,n),this.sendInitialEvent(gq.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}}}vU.WorkspaceFoldersFeature=yci;var wde={};Object.defineProperty(wde,"__esModule",{value:!0});wde.FoldingRangeFeature=void 0;const D6e=Zn,n0=ms,eV=Nn;class Cci extends eV.TextDocumentLanguageFeature{constructor(e){super(e,n0.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,eV.ensure)((0,eV.ensure)(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[n0.FoldingRangeKind.Comment,n0.FoldingRangeKind.Imports,n0.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1},(0,eV.ensure)((0,eV.ensure)(e,"workspace"),"foldingRange").refreshSupport=!0}initialize(e,t){this._client.onRequest(n0.FoldingRangeRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.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 D6e.EventEmitter,n={onDidChangeFoldingRanges:i.event,provideFoldingRanges:(r,o,a)=>{const c=this._client,l=(h,u,f)=>{const p={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h)};return c.sendRequest(n0.FoldingRangeRequest.type,p,f).then(m=>f.isCancellationRequested?null:c.protocol2CodeConverter.asFoldingRanges(m,f),m=>c.handleFailedRequest(n0.FoldingRangeRequest.type,f,m,null))},d=c.middleware;return d.provideFoldingRanges?d.provideFoldingRanges(r,o,a,l):l(r,o,a)}};return[D6e.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),{provider:n,onDidChangeFoldingRange:i}]}}wde.FoldingRangeFeature=Cci;var yde={};Object.defineProperty(yde,"__esModule",{value:!0});yde.DeclarationFeature=void 0;const Sci=Zn,Xge=ms,Zge=Nn;class Aci extends Zge.TextDocumentLanguageFeature{constructor(e){super(e,Xge.DeclarationRequest.type)}fillClientCapabilities(e){const t=(0,Zge.ensure)((0,Zge.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,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Xge.DeclarationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDeclarationResult(f,u),f=>a.handleFailedRequest(Xge.DeclarationRequest.type,u,f,null)),l=a.middleware;return l.provideDeclaration?l.provideDeclaration(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Sci.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}yde.DeclarationFeature=Aci;var Cde={};Object.defineProperty(Cde,"__esModule",{value:!0});Cde.SelectionRangeFeature=void 0;const Eci=Zn,efe=ms,tfe=Nn;class xci extends tfe.TextDocumentLanguageFeature{constructor(e){super(e,efe.SelectionRangeRequest.type)}fillClientCapabilities(e){const t=(0,tfe.ensure)((0,tfe.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,r,o)=>{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(efe.SelectionRangeRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asSelectionRanges(p,u),p=>a.handleFailedRequest(efe.SelectionRangeRequest.type,u,p,null))},l=a.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Eci.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Cde.SelectionRangeFeature=xci;var Sde={};Object.defineProperty(Sde,"__esModule",{value:!0});Sde.ProgressFeature=void 0;const k6e=ms,Dci=IG;function kci(s,e){return s[e]===void 0&&(s[e]=Object.create(null)),s[e]}class Ici{constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:"window",id:k6e.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){kci(e,"window").workDoneProgress=!0}initialize(){const e=this._client,t=n=>{this.activeParts.delete(n)},i=n=>{this.activeParts.add(new Dci.ProgressPart(this._client,n.token,t))};e.onRequest(k6e.WorkDoneProgressCreateRequest.type,i)}clear(){for(const e of this.activeParts)e.done();this.activeParts.clear()}}Sde.ProgressFeature=Ici;var Ade={};Object.defineProperty(Ade,"__esModule",{value:!0});Ade.CallHierarchyFeature=void 0;const Tci=Zn,O0=ms,ife=Nn;class Lci{constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,i){const n=this.client,r=this.middleware,o=(a,c,l)=>{const d=n.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return n.sendRequest(O0.CallHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:n.protocol2CodeConverter.asCallHierarchyItems(h,l),h=>n.handleFailedRequest(O0.CallHierarchyPrepareRequest.type,l,h,null))};return r.prepareCallHierarchy?r.prepareCallHierarchy(e,t,i,o):o(e,t,i)}provideCallHierarchyIncomingCalls(e,t){const i=this.client,n=this.middleware,r=(o,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(o)};return i.sendRequest(O0.CallHierarchyIncomingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyIncomingCalls(l,a),l=>i.handleFailedRequest(O0.CallHierarchyIncomingCallsRequest.type,a,l,null))};return n.provideCallHierarchyIncomingCalls?n.provideCallHierarchyIncomingCalls(e,t,r):r(e,t)}provideCallHierarchyOutgoingCalls(e,t){const i=this.client,n=this.middleware,r=(o,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(o)};return i.sendRequest(O0.CallHierarchyOutgoingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyOutgoingCalls(l,a),l=>i.handleFailedRequest(O0.CallHierarchyOutgoingCallsRequest.type,a,l,null))};return n.provideCallHierarchyOutgoingCalls?n.provideCallHierarchyOutgoingCalls(e,t,r):r(e,t)}}class Rci extends ife.TextDocumentLanguageFeature{constructor(e){super(e,O0.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=e,i=(0,ife.ensure)((0,ife.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 Lci(t);return[Tci.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}Ade.CallHierarchyFeature=Rci;var Ede={};Object.defineProperty(Ede,"__esModule",{value:!0});Ede.SemanticTokensFeature=void 0;const fq=Zn,As=ms,tV=Nn,Mci=Io;class Nci extends tV.TextDocumentLanguageFeature{constructor(e){super(e,As.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){const t=(0,tV.ensure)((0,tV.ensure)(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[As.SemanticTokenTypes.namespace,As.SemanticTokenTypes.type,As.SemanticTokenTypes.class,As.SemanticTokenTypes.enum,As.SemanticTokenTypes.interface,As.SemanticTokenTypes.struct,As.SemanticTokenTypes.typeParameter,As.SemanticTokenTypes.parameter,As.SemanticTokenTypes.variable,As.SemanticTokenTypes.property,As.SemanticTokenTypes.enumMember,As.SemanticTokenTypes.event,As.SemanticTokenTypes.function,As.SemanticTokenTypes.method,As.SemanticTokenTypes.macro,As.SemanticTokenTypes.keyword,As.SemanticTokenTypes.modifier,As.SemanticTokenTypes.comment,As.SemanticTokenTypes.string,As.SemanticTokenTypes.number,As.SemanticTokenTypes.regexp,As.SemanticTokenTypes.operator,As.SemanticTokenTypes.decorator],t.tokenModifiers=[As.SemanticTokenModifiers.declaration,As.SemanticTokenModifiers.definition,As.SemanticTokenModifiers.readonly,As.SemanticTokenModifiers.static,As.SemanticTokenModifiers.deprecated,As.SemanticTokenModifiers.abstract,As.SemanticTokenModifiers.async,As.SemanticTokenModifiers.modification,As.SemanticTokenModifiers.documentation,As.SemanticTokenModifiers.defaultLibrary],t.formats=[As.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,tV.ensure)((0,tV.ensure)(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(As.SemanticTokensRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeSemanticTokensEmitter.fire()});const[n,r]=this.getRegistration(t,e.semanticTokensProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){const t=e.documentSelector,i=Mci.boolean(e.full)?e.full:e.full!==void 0,n=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,r=new fq.EventEmitter,o=i?{onDidChangeSemanticTokens:r.event,provideDocumentSemanticTokens:(f,p)=>{const m=this._client,v=m.middleware,b=(w,y)=>{const C={textDocument:m.code2ProtocolConverter.asTextDocumentIdentifier(w)};return m.sendRequest(As.SemanticTokensRequest.type,C,y).then(A=>y.isCancellationRequested?null:m.protocol2CodeConverter.asSemanticTokens(A,y),A=>m.handleFailedRequest(As.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(As.SemanticTokensDeltaRequest.type,L,A).then(async k=>A.isCancellationRequested?null:As.SemanticTokens.is(k)?await v.protocol2CodeConverter.asSemanticTokens(k,A):await v.protocol2CodeConverter.asSemanticTokensEdits(k,A),k=>v.handleFailedRequest(As.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(As.SemanticTokensRangeRequest.type,L,A).then(k=>A.isCancellationRequested?null:v.protocol2CodeConverter.asSemanticTokens(k,A),k=>v.handleFailedRequest(As.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 o!==void 0&&l.push(fq.languages.registerDocumentSemanticTokensProvider(u,o,h)),c!==void 0&&l.push(fq.languages.registerDocumentRangeSemanticTokensProvider(u,c,h)),[new fq.Disposable(()=>l.forEach(f=>f.dispose())),{range:c,full:o,onDidChangeSemanticTokensEmitter:r}]}}Ede.SemanticTokensFeature=Nci;var Jf={};Object.defineProperty(Jf,"__esModule",{value:!0});Jf.WillDeleteFilesFeature=Jf.WillRenameFilesFeature=Jf.WillCreateFilesFeature=Jf.DidDeleteFilesFeature=Jf.DidRenameFilesFeature=Jf.DidCreateFilesFeature=void 0;const R_=Zn,Pci=$le,EA=ms,Fci=ro;function I6e(s,e){return s[e]===void 0&&(s[e]={}),s[e]}function Oci(s,e){return s[e]}function T6e(s,e,t){s[e]=t}class uL{constructor(e,t,i,n,r){this._client=e,this._event=t,this._registrationType=i,this._clientCapability=n,this._serverCapability=r,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");T6e(t,"dynamicRegistration",!0),T6e(t,this._clientCapability,!0)}initialize(e){const t=e.workspace?.fileOperations,i=t!==void 0?Oci(t,this._serverCapability):void 0;if(i?.filters!==void 0)try{this.register({id:Fci.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 Pci.Minimatch(i.pattern.glob,uL.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 uL.getFileType(e)}async filter(e,t){const i=await Promise.all(e.files.map(async r=>{const o=t(r),a=o.fsPath.replace(/\\/g,"/");for(const c of this._filters.values())for(const l of c)if(!(l.scheme!==void 0&&l.scheme!==o.scheme)){if(l.matcher.match(a)){if(l.kind===void 0)return!0;const d=await this.getFileType(o);if(d===void 0)return this._client.error(`Failed to determine file type for ${o.toString()}.`),!0;if(d===R_.FileType.File&&l.kind===EA.FileOperationPatternKind.file||d===R_.FileType.Directory&&l.kind===EA.FileOperationPatternKind.folder)return!0}else if(l.kind===EA.FileOperationPatternKind.folder&&await uL.getFileType(o)===R_.FileType.Directory&&l.matcher.match(`${a}/`))return!0}return!1})),n=e.files.filter((r,o)=>i[o]);return{...e,files:n}}static async getFileType(e){try{return(await R_.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){const t={dot:!0};return e?.ignoreCase===!0&&(t.nocase=!0),t}}class _at extends uL{constructor(e,t,i,n,r,o,a){super(e,t,i,n,r),this._notificationType=i,this._accessUri=o,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 vat extends _at{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 uL.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 Bci extends _at{constructor(e){super(e,R_.workspace.onDidCreateFiles,EA.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)}}Jf.DidCreateFilesFeature=Bci;class Wci extends vat{constructor(e){super(e,R_.workspace.onDidRenameFiles,EA.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||(this._willListener=R_.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)}}Jf.DidRenameFilesFeature=Wci;class Hci extends vat{constructor(e){super(e,R_.workspace.onDidDeleteFiles,EA.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||(this._willListener=R_.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)}}Jf.DidDeleteFilesFeature=Hci;class xFe extends uL{constructor(e,t,i,n,r,o,a){super(e,t,i,n,r),this._requestType=i,this._accessUri=o,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 Uci extends xFe{constructor(e){super(e,R_.workspace.onWillCreateFiles,EA.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)}}Jf.WillCreateFilesFeature=Uci;class Vci extends xFe{constructor(e){super(e,R_.workspace.onWillRenameFiles,EA.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)}}Jf.WillRenameFilesFeature=Vci;class zci extends xFe{constructor(e){super(e,R_.workspace.onWillDeleteFiles,EA.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)}}Jf.WillDeleteFilesFeature=zci;var xde={};Object.defineProperty(xde,"__esModule",{value:!0});xde.LinkedEditingFeature=void 0;const $ci=Zn,nfe=ms,sfe=Nn;class Gci extends sfe.TextDocumentLanguageFeature{constructor(e){super(e,nfe.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){const t=(0,sfe.ensure)((0,sfe.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,r,o)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(nfe.LinkedEditingRangeRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asLinkedEditingRanges(f,u),f=>a.handleFailedRequest(nfe.LinkedEditingRangeRequest.type,u,f,null)),l=a.middleware;return l.provideLinkedEditingRange?l.provideLinkedEditingRange(n,r,o,c):c(n,r,o)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return $ci.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}xde.LinkedEditingFeature=Gci;var Dde={};Object.defineProperty(Dde,"__esModule",{value:!0});Dde.TypeHierarchyFeature=void 0;const Kci=Zn,B0=ms,rfe=Nn;class qci{constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,i){const n=this.client,r=this.middleware,o=(a,c,l)=>{const d=n.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return n.sendRequest(B0.TypeHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:n.protocol2CodeConverter.asTypeHierarchyItems(h,l),h=>n.handleFailedRequest(B0.TypeHierarchyPrepareRequest.type,l,h,null))};return r.prepareTypeHierarchy?r.prepareTypeHierarchy(e,t,i,o):o(e,t,i)}provideTypeHierarchySupertypes(e,t){const i=this.client,n=this.middleware,r=(o,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(o)};return i.sendRequest(B0.TypeHierarchySupertypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(B0.TypeHierarchySupertypesRequest.type,a,l,null))};return n.provideTypeHierarchySupertypes?n.provideTypeHierarchySupertypes(e,t,r):r(e,t)}provideTypeHierarchySubtypes(e,t){const i=this.client,n=this.middleware,r=(o,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(o)};return i.sendRequest(B0.TypeHierarchySubtypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(B0.TypeHierarchySubtypesRequest.type,a,l,null))};return n.provideTypeHierarchySubtypes?n.provideTypeHierarchySubtypes(e,t,r):r(e,t)}}class Qci extends rfe.TextDocumentLanguageFeature{constructor(e){super(e,B0.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=(0,rfe.ensure)((0,rfe.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 qci(t);return[Kci.languages.registerTypeHierarchyProvider(t.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}Dde.TypeHierarchyFeature=Qci;var kde={};Object.defineProperty(kde,"__esModule",{value:!0});kde.InlineValueFeature=void 0;const L6e=Zn,pq=ms,iV=Nn;class jci extends iV.TextDocumentLanguageFeature{constructor(e){super(e,pq.InlineValueRequest.type)}fillClientCapabilities(e){(0,iV.ensure)((0,iV.ensure)(e,"textDocument"),"inlineValue").dynamicRegistration=!0,(0,iV.ensure)((0,iV.ensure)(e,"workspace"),"inlineValue").refreshSupport=!0}initialize(e,t){this._client.onRequest(pq.InlineValueRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.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 L6e.EventEmitter,n={onDidChangeInlineValues:i.event,provideInlineValues:(r,o,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(pq.InlineValueRequest.type,v,m).then(b=>m.isCancellationRequested?null:l.protocol2CodeConverter.asInlineValues(b,m),b=>l.handleFailedRequest(pq.InlineValueRequest.type,m,b,null))},h=l.middleware;return h.provideInlineValues?h.provideInlineValues(r,o,a,c,d):d(r,o,a,c)}};return[this.registerProvider(t,n),{provider:n,onDidChangeInlineValues:i}]}registerProvider(e,t){return L6e.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}kde.InlineValueFeature=jci;var Ide={};Object.defineProperty(Ide,"__esModule",{value:!0});Ide.InlayHintsFeature=void 0;const R6e=Zn,MP=ms,nV=Nn;class Yci extends nV.TextDocumentLanguageFeature{constructor(e){super(e,MP.InlayHintRequest.type)}fillClientCapabilities(e){const t=(0,nV.ensure)((0,nV.ensure)(e,"textDocument"),"inlayHint");t.dynamicRegistration=!0,t.resolveSupport={properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]},(0,nV.ensure)((0,nV.ensure)(e,"workspace"),"inlayHint").refreshSupport=!0}initialize(e,t){this._client.onRequest(MP.InlayHintRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.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 R6e.EventEmitter,n={onDidChangeInlayHints:i.event,provideInlayHints:(r,o,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(MP.InlayHintRequest.type,p,f);return f.isCancellationRequested?null:c.protocol2CodeConverter.asInlayHints(m,f)}catch(m){return c.handleFailedRequest(MP.InlayHintRequest.type,f,m,null)}},d=c.middleware;return d.provideInlayHints?d.provideInlayHints(r,o,a,l):l(r,o,a)}};return n.resolveInlayHint=e.resolveProvider===!0?(r,o)=>{const a=this._client,c=async(d,h)=>{try{const u=await a.sendRequest(MP.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(MP.InlayHintResolveRequest.type,h,u,null)}},l=a.middleware;return l.resolveInlayHint?l.resolveInlayHint(r,o,c):c(r,o)}:void 0,[this.registerProvider(t,n),{provider:n,onDidChangeInlayHints:i}]}registerProvider(e,t){return R6e.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Ide.InlayHintsFeature=Yci;var Tde={};Object.defineProperty(Tde,"__esModule",{value:!0});Tde.InlineCompletionItemFeature=void 0;const Jci=Zn,ofe=ms,afe=Nn,Xci=ro;class Zci extends afe.TextDocumentLanguageFeature{constructor(e){super(e,ofe.InlineCompletionRequest.type)}fillClientCapabilities(e){let t=(0,afe.ensure)((0,afe.ensure)(e,"textDocument"),"inlineCompletion");t.dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.inlineCompletionProvider);i&&this.register({id:Xci.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideInlineCompletionItems:(n,r,o,a)=>{const c=this._client,l=this._client.middleware,d=(h,u,f,p)=>c.sendRequest(ofe.InlineCompletionRequest.type,c.code2ProtocolConverter.asInlineCompletionParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asInlineCompletionResult(m,p),m=>c.handleFailedRequest(ofe.InlineCompletionRequest.type,p,m,null));return l.provideInlineCompletionItems?l.provideInlineCompletionItems(n,r,o,a,d):d(n,r,o,a)}};return[Jci.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Tde.InlineCompletionItemFeature=Zci;Object.defineProperty(wh,"__esModule",{value:!0});wh.ProposedFeatures=bat=wh.BaseLanguageClient=wh.MessageTransports=wh.SuspendMode=wh.State=wh.CloseAction=wh.ErrorAction=wh.RevealOutputChannelOn=void 0;const Ho=Zn,Tt=ms,eli=Kle,tli=tde,Ov=Io,mq=Sh,M6e=ro,ili=IG,vv=Nn,nli=SA,N6e=ide,P6e=BD,NP=Yf,sli=nde,rli=sde,oli=rde,ali=ode,cli=ade,lli=AFe,dli=cde,hli=lde,uli=dde,gli=hde,cfe=WD,fli=gde,pli=fde,mli=pde,_li=mde,vli=_de,bli=vde,wli=bde,yli=vU,Cli=wde,Sli=yde,Ali=Cde,Eli=Sde,xli=Ade,Dli=Ede,PP=Jf,kli=xde,Ili=Dde,Tli=kde,Lli=Ide,Rli=Tde;var f1;(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"})(f1||(wh.RevealOutputChannelOn=f1={}));var y7;(function(s){s[s.Continue=1]="Continue",s[s.Shutdown=2]="Shutdown"})(y7||(wh.ErrorAction=y7={}));var HD;(function(s){s[s.DoNotRestart=1]="DoNotRestart",s[s.Restart=2]="Restart"})(HD||(wh.CloseAction=HD={}));var Wz;(function(s){s[s.Stopped=1]="Stopped",s[s.Starting=3]="Starting",s[s.Running=2]="Running"})(Wz||(wh.State=Wz={}));var F6e;(function(s){s.off="off",s.on="on"})(F6e||(wh.SuspendMode=F6e={}));var Y1e;(function(s){function e(t){return t==null?!1:typeof t=="boolean"||typeof t=="object"&&t!==null&&Ov.stringArray(t.enabledCommands)?t:!1}s.sanitizeIsTrusted=e})(Y1e||(Y1e={}));class Mli{constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,i){return i&&i<=3?{action:y7.Continue}:{action:y7.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:HD.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=3*60*1e3?{action:HD.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:HD.Restart})}}var sr;(function(s){s.Initial="initial",s.Starting="starting",s.StartFailed="startFailed",s.Running="running",s.Stopping="stopping",s.Stopped="stopped"})(sr||(sr={}));var O6e;(function(s){function e(t){return t&&Tt.MessageReader.is(t.reader)&&Tt.MessageWriter.is(t.writer)}s.is=e})(O6e||(wh.MessageTransports=O6e={}));class gL{constructor(e,t,i){this._traceFormat=Tt.TraceFormat.Text,this._diagnosticQueue=new Map,this._diagnosticQueueState={state:"idle"},this._features=[],this._dynamicFeatures=new Map,this.workspaceEditLock=new mq.Semaphore(1),this._id=e,this._name=t,i=i||{};const n={isTrusted:!1,supportHtml:!1};i.markdown!==void 0&&(n.isTrusted=Y1e.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??f1.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=sr.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 mq.Semaphore(1),this._pendingChangeDelayer=new mq.Delayer(250),this._fileEvents=[],this._fileEventDelayer=new mq.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new Tt.Emitter,this._stateChangeEmitter=new Tt.Emitter,this._trace=Tt.Trace.Off,this._tracer={log:(r,o)=>{Ov.string(r)?this.logTrace(r,o):this.logObjectTrace(r)}},this._c2p=eli.createConverter(i.uriConverters?i.uriConverters.code2Protocol:void 0),this._p2c=tli.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=Ho.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 sr.Starting:return Wz.Starting;case sr.Running:return Wz.Running;default:return Wz.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===sr.StartFailed||this.$state===sr.Stopping||this.$state===sr.Stopped)return Promise.reject(new Tt.ResponseError(Tt.ErrorCodes.ConnectionInactive,"Client is not running"));const i=await this.$start();this._didChangeTextDocumentFeature.syncKind===Tt.TextDocumentSyncKind.Full&&await this.sendPendingFullTextDocumentChanges(i);const n=this._clientOptions.middleware?.sendRequest;if(n!==void 0){let r,o;return t.length===1?Tt.CancellationToken.is(t[0])?o=t[0]:r=t[0]:t.length===2&&(r=t[0],o=t[1]),n(e,r,o,(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 r;return n!==void 0?(this._requestDisposables.set(i,n.onRequest(e,t)),r={dispose:()=>{const o=this._requestDisposables.get(i);o!==void 0&&(o.dispose(),this._requestDisposables.delete(i))}}):(this._pendingRequestHandlers.set(i,t),r={dispose:()=>{this._pendingRequestHandlers.delete(i);const o=this._requestDisposables.get(i);o!==void 0&&(o.dispose(),this._requestDisposables.delete(i))}}),{dispose:()=>{this._requestHandlers.delete(i),r.dispose()}}}async sendNotification(e,t){if(this.$state===sr.StartFailed||this.$state===sr.Stopping||this.$state===sr.Stopped)return Promise.reject(new Tt.ResponseError(Tt.ErrorCodes.ConnectionInactive,"Client is not running"));const i=this._didChangeTextDocumentFeature.syncKind===Tt.TextDocumentSyncKind.Full;let n;i&&typeof e!="string"&&e.method===Tt.DidOpenTextDocumentNotification.method&&(n=t?.textDocument.uri,this._pendingOpenNotifications.add(n));const r=await this.$start();i&&await this.sendPendingFullTextDocumentChanges(r),n!==void 0&&this._pendingOpenNotifications.delete(n);const o=this._clientOptions.middleware?.sendNotification;return o?o(e,r.sendNotification.bind(r),t):r.sendNotification(e,t)}onNotification(e,t){const i=typeof e=="string"?e:e.method;this._notificationHandlers.set(i,t);const n=this.activeConnection();let r;return n!==void 0?(this._notificationDisposables.set(i,n.onNotification(e,t)),r={dispose:()=>{const o=this._notificationDisposables.get(i);o!==void 0&&(o.dispose(),this._notificationDisposables.delete(i))}}):(this._pendingNotificationHandlers.set(i,t),r={dispose:()=>{this._pendingNotificationHandlers.delete(i);const o=this._notificationDisposables.get(i);o!==void 0&&(o.dispose(),this._notificationDisposables.delete(i))}}),{dispose:()=>{this._notificationHandlers.delete(i),r.dispose()}}}async sendProgress(e,t,i){if(this.$state===sr.StartFailed||this.$state===sr.Stopping||this.$state===sr.Stopped)return Promise.reject(new Tt.ResponseError(Tt.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 r;const o=this._clientOptions.middleware?.handleWorkDoneProgress,a=Tt.WorkDoneProgress.is(e)&&o!==void 0?c=>{o(t,c,()=>i(c))}:i;return n!==void 0?(this._progressDisposables.set(t,n.onProgress(e,t,a)),r={dispose:()=>{const c=this._progressDisposables.get(t);c!==void 0&&(c.dispose(),this._progressDisposables.delete(t))}}):(this._pendingProgressHandlers.set(t,{type:e,handler:i}),r={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),r.dispose()}}}createDefaultErrorHandler(e){if(e!==void 0&&e<0)throw new Error(`Invalid maxRestartCount: ${e}`);return new Mli(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 Tt.ResponseError){const t=e;return` Message: ${t.message} Code: ${t.code} ${t.data?` -`+t.data.toString():""}`}return e instanceof Error?Ov.string(e.stack)?e.stack:e.message:Ov.string(e)?e:e.toString()}debug(e,t,i=!0){this.logOutputMessage(Tt.MessageType.Debug,f1.Debug,"Debug",e,t,i)}info(e,t,i=!0){this.logOutputMessage(Tt.MessageType.Info,f1.Info,"Info",e,t,i)}warn(e,t,i=!0){this.logOutputMessage(Tt.MessageType.Warning,f1.Warn,"Warn",e,t,i)}error(e,t,i=!0){this.logOutputMessage(Tt.MessageType.Error,f1.Error,"Error",e,t,i)}logOutputMessage(e,t,i,n,r,o){this.outputChannel.appendLine(`[${i.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${n}`),r!=null&&this.outputChannel.appendLine(this.data2String(r)),(o==="force"||o&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,n)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===Tt.MessageType.Error?Ho.window.showErrorMessage:e===Tt.MessageType.Warning?Ho.window.showWarningMessage:Ho.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===sr.Initial||this.$state===sr.Stopping||this.$state===sr.Stopped}needsStop(){return this.$state===sr.Starting||this.$state===sr.Running}activeConnection(){return this.$state===sr.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===sr.Running}async start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===sr.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?Ho.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):Ho.languages.createDiagnosticCollection());for(const[n,r]of this._notificationHandlers)this._pendingNotificationHandlers.has(n)||this._pendingNotificationHandlers.set(n,r);for(const[n,r]of this._requestHandlers)this._pendingRequestHandlers.has(n)||this._pendingRequestHandlers.set(n,r);for(const[n,r]of this._progressHandlers)this._pendingProgressHandlers.has(n)||this._pendingProgressHandlers.set(n,r);this.$state=sr.Starting;try{const n=await this.createConnection();n.onNotification(Tt.LogMessageNotification.type,r=>{switch(r.type){case Tt.MessageType.Error:this.error(r.message,void 0,!1);break;case Tt.MessageType.Warning:this.warn(r.message,void 0,!1);break;case Tt.MessageType.Info:this.info(r.message,void 0,!1);break;case Tt.MessageType.Debug:this.debug(r.message,void 0,!1);break;default:this.outputChannel.appendLine(r.message)}}),n.onNotification(Tt.ShowMessageNotification.type,r=>{switch(r.type){case Tt.MessageType.Error:Ho.window.showErrorMessage(r.message);break;case Tt.MessageType.Warning:Ho.window.showWarningMessage(r.message);break;case Tt.MessageType.Info:Ho.window.showInformationMessage(r.message);break;default:Ho.window.showInformationMessage(r.message)}}),n.onRequest(Tt.ShowMessageRequest.type,r=>{let o;switch(r.type){case Tt.MessageType.Error:o=Ho.window.showErrorMessage;break;case Tt.MessageType.Warning:o=Ho.window.showWarningMessage;break;case Tt.MessageType.Info:o=Ho.window.showInformationMessage;break;default:o=Ho.window.showInformationMessage}let a=r.actions||[];return o(r.message,...a)}),n.onNotification(Tt.TelemetryEventNotification.type,r=>{this._telemetryEmitter.fire(r)}),n.onRequest(Tt.ShowDocumentRequest.type,async r=>{const o=async c=>{const l=this.protocol2CodeConverter.asUri(c.uri);try{if(c.external===!0)return{success:await Ho.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 Ho.window.showTextDocument(l,d),{success:!0}}}catch{return{success:!1}}},a=this._clientOptions.middleware.window?.showDocument;return a!==void 0?a(r,o):o(r)}),n.listen(),await this.initialize(n),t()}catch(n){this.$state=sr.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,r)=>{e=n,t=r}),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],r={processId:null,clientInfo:{name:Ho.env.appName,version:Ho.version},locale:this.getLocale(),rootPath:i||null,rootUri:i?this._c2p.asUri(Ho.Uri.file(i)):null,capabilities:this.computeClientCapabilities(),initializationOptions:Ov.func(t)?t():t,trace:Tt.Trace.toString(this._trace),workspaceFolders:n};if(this.fillInitializeParams(r),this._clientOptions.progressOnInitialization){const o=M6e.generateUuid(),a=new tli.ProgressPart(e,o);r.workDoneToken=o;try{const c=await this.doInitialize(e,r);return a.done(),c}catch(c){throw a.cancel(),c}}else return this.doInitialize(e,r)}async doInitialize(e,t){try{const i=await e.initialize(t);if(i.capabilities.positionEncoding!==void 0&&i.capabilities.positionEncoding!==Tt.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${i.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=i,this.$state=sr.Running;let n;Ov.number(i.capabilities.textDocumentSync)?i.capabilities.textDocumentSync===Tt.TextDocumentSyncKind.None?n={openClose:!1,change:Tt.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(Tt.PublishDiagnosticsNotification.type,r=>this.handleDiagnostics(r)),e.onRequest(Tt.RegistrationRequest.type,r=>this.handleRegistrationRequest(r)),e.onRequest("client/registerFeature",r=>this.handleRegistrationRequest(r)),e.onRequest(Tt.UnregistrationRequest.type,r=>this.handleUnregistrationRequest(r)),e.onRequest("client/unregisterFeature",r=>this.handleUnregistrationRequest(r)),e.onRequest(Tt.ApplyWorkspaceEditRequest.type,r=>this.handleApplyWorkspaceEdit(r));for(const[r,o]of this._pendingNotificationHandlers)this._notificationDisposables.set(r,e.onNotification(r,o));this._pendingNotificationHandlers.clear();for(const[r,o]of this._pendingRequestHandlers)this._requestDisposables.set(r,e.onRequest(r,o));this._pendingRequestHandlers.clear();for(const[r,o]of this._pendingProgressHandlers)this._progressDisposables.set(r,e.onProgress(o.type,r,o.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(Tt.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 Tt.ResponseError&&i.data&&i.data.retry?Ho.window.showErrorMessage(i.message,{title:"Retry",id:"retry"}).then(n=>{n&&n.id==="retry"?this.initialize(e):this.stop()}):(i&&i.message&&Ho.window.showErrorMessage(i.message),this.error("Server initialization failed.",i),this.stop()),i}}_clientGetRootPath(){let e=Ho.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===sr.Stopped||this.$state===sr.Initial)return;if(this.$state===sr.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!==sr.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=sr.Stopping,this.cleanUp(e);const n=new Promise(o=>{(0,Tt.RAL)().timer.setTimeout(o,t)}),r=(async o=>(await o.shutdown(),await o.exit(),o))(i);return this._onStop=Promise.race([n,r]).then(o=>{if(o!==void 0)o.end(),o.dispose();else throw this.error("Stopping server timed out",void 0,!1),new Error("Stopping the server timed out")},o=>{throw this.error("Stopping server failed",o,!1),o}).finally(()=>{this.$state=sr.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(r){return t._fileEvents.push(r),t._fileEventDelayer.trigger(async()=>{await t.sendNotification(Tt.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}const n=this.clientOptions.middleware?.workspace;(n?.didChangeWatchedFile?n.didChangeWatchedFile(e,i):i(e)).catch(r=>{t.error("Notify file events failed.",r)})}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(Tt.DidChangeTextDocumentNotification.type,n),this._didChangeTextDocumentFeature.notificationSent(i,Tt.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,Tt.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 Ho.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:n},this._p2c.asDiagnostics(i,n.token).then(r=>{if(!n.token.isCancellationRequested){const o=this._p2c.asUri(t),a=this.clientOptions.middleware;a.handleDiagnostics?a.handleDiagnostics(o,r,(c,l)=>this.setDiagnostics(c,l)):this.setDiagnostics(o,r)}}).finally(()=>{this._diagnosticQueueState={state:"idle"},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}getLocale(){return Ho.env.language}async $start(){if(this.$state===sr.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,r,o)=>{this.handleConnectionError(n,r,o).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=Nli(i.reader,i.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===sr.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:HD.DoNotRestart};if(this.$state!==sr.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===HD.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===sr.Starting?this.$state=sr.StartFailed:this.$state=sr.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===HD.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart.",!e.handled),this.cleanUp("restart"),this.$state=sr.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===y7.Shutdown?(this.error(n.message??`Client ${this._name}: connection to server is erroring. +`+t.data.toString():""}`}return e instanceof Error?Ov.string(e.stack)?e.stack:e.message:Ov.string(e)?e:e.toString()}debug(e,t,i=!0){this.logOutputMessage(Tt.MessageType.Debug,f1.Debug,"Debug",e,t,i)}info(e,t,i=!0){this.logOutputMessage(Tt.MessageType.Info,f1.Info,"Info",e,t,i)}warn(e,t,i=!0){this.logOutputMessage(Tt.MessageType.Warning,f1.Warn,"Warn",e,t,i)}error(e,t,i=!0){this.logOutputMessage(Tt.MessageType.Error,f1.Error,"Error",e,t,i)}logOutputMessage(e,t,i,n,r,o){this.outputChannel.appendLine(`[${i.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${n}`),r!=null&&this.outputChannel.appendLine(this.data2String(r)),(o==="force"||o&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,n)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===Tt.MessageType.Error?Ho.window.showErrorMessage:e===Tt.MessageType.Warning?Ho.window.showWarningMessage:Ho.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===sr.Initial||this.$state===sr.Stopping||this.$state===sr.Stopped}needsStop(){return this.$state===sr.Starting||this.$state===sr.Running}activeConnection(){return this.$state===sr.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===sr.Running}async start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===sr.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?Ho.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):Ho.languages.createDiagnosticCollection());for(const[n,r]of this._notificationHandlers)this._pendingNotificationHandlers.has(n)||this._pendingNotificationHandlers.set(n,r);for(const[n,r]of this._requestHandlers)this._pendingRequestHandlers.has(n)||this._pendingRequestHandlers.set(n,r);for(const[n,r]of this._progressHandlers)this._pendingProgressHandlers.has(n)||this._pendingProgressHandlers.set(n,r);this.$state=sr.Starting;try{const n=await this.createConnection();n.onNotification(Tt.LogMessageNotification.type,r=>{switch(r.type){case Tt.MessageType.Error:this.error(r.message,void 0,!1);break;case Tt.MessageType.Warning:this.warn(r.message,void 0,!1);break;case Tt.MessageType.Info:this.info(r.message,void 0,!1);break;case Tt.MessageType.Debug:this.debug(r.message,void 0,!1);break;default:this.outputChannel.appendLine(r.message)}}),n.onNotification(Tt.ShowMessageNotification.type,r=>{switch(r.type){case Tt.MessageType.Error:Ho.window.showErrorMessage(r.message);break;case Tt.MessageType.Warning:Ho.window.showWarningMessage(r.message);break;case Tt.MessageType.Info:Ho.window.showInformationMessage(r.message);break;default:Ho.window.showInformationMessage(r.message)}}),n.onRequest(Tt.ShowMessageRequest.type,r=>{let o;switch(r.type){case Tt.MessageType.Error:o=Ho.window.showErrorMessage;break;case Tt.MessageType.Warning:o=Ho.window.showWarningMessage;break;case Tt.MessageType.Info:o=Ho.window.showInformationMessage;break;default:o=Ho.window.showInformationMessage}let a=r.actions||[];return o(r.message,...a)}),n.onNotification(Tt.TelemetryEventNotification.type,r=>{this._telemetryEmitter.fire(r)}),n.onRequest(Tt.ShowDocumentRequest.type,async r=>{const o=async c=>{const l=this.protocol2CodeConverter.asUri(c.uri);try{if(c.external===!0)return{success:await Ho.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 Ho.window.showTextDocument(l,d),{success:!0}}}catch{return{success:!1}}},a=this._clientOptions.middleware.window?.showDocument;return a!==void 0?a(r,o):o(r)}),n.listen(),await this.initialize(n),t()}catch(n){this.$state=sr.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,r)=>{e=n,t=r}),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],r={processId:null,clientInfo:{name:Ho.env.appName,version:Ho.version},locale:this.getLocale(),rootPath:i||null,rootUri:i?this._c2p.asUri(Ho.Uri.file(i)):null,capabilities:this.computeClientCapabilities(),initializationOptions:Ov.func(t)?t():t,trace:Tt.Trace.toString(this._trace),workspaceFolders:n};if(this.fillInitializeParams(r),this._clientOptions.progressOnInitialization){const o=M6e.generateUuid(),a=new ili.ProgressPart(e,o);r.workDoneToken=o;try{const c=await this.doInitialize(e,r);return a.done(),c}catch(c){throw a.cancel(),c}}else return this.doInitialize(e,r)}async doInitialize(e,t){try{const i=await e.initialize(t);if(i.capabilities.positionEncoding!==void 0&&i.capabilities.positionEncoding!==Tt.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${i.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=i,this.$state=sr.Running;let n;Ov.number(i.capabilities.textDocumentSync)?i.capabilities.textDocumentSync===Tt.TextDocumentSyncKind.None?n={openClose:!1,change:Tt.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(Tt.PublishDiagnosticsNotification.type,r=>this.handleDiagnostics(r)),e.onRequest(Tt.RegistrationRequest.type,r=>this.handleRegistrationRequest(r)),e.onRequest("client/registerFeature",r=>this.handleRegistrationRequest(r)),e.onRequest(Tt.UnregistrationRequest.type,r=>this.handleUnregistrationRequest(r)),e.onRequest("client/unregisterFeature",r=>this.handleUnregistrationRequest(r)),e.onRequest(Tt.ApplyWorkspaceEditRequest.type,r=>this.handleApplyWorkspaceEdit(r));for(const[r,o]of this._pendingNotificationHandlers)this._notificationDisposables.set(r,e.onNotification(r,o));this._pendingNotificationHandlers.clear();for(const[r,o]of this._pendingRequestHandlers)this._requestDisposables.set(r,e.onRequest(r,o));this._pendingRequestHandlers.clear();for(const[r,o]of this._pendingProgressHandlers)this._progressDisposables.set(r,e.onProgress(o.type,r,o.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(Tt.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 Tt.ResponseError&&i.data&&i.data.retry?Ho.window.showErrorMessage(i.message,{title:"Retry",id:"retry"}).then(n=>{n&&n.id==="retry"?this.initialize(e):this.stop()}):(i&&i.message&&Ho.window.showErrorMessage(i.message),this.error("Server initialization failed.",i),this.stop()),i}}_clientGetRootPath(){let e=Ho.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===sr.Stopped||this.$state===sr.Initial)return;if(this.$state===sr.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!==sr.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=sr.Stopping,this.cleanUp(e);const n=new Promise(o=>{(0,Tt.RAL)().timer.setTimeout(o,t)}),r=(async o=>(await o.shutdown(),await o.exit(),o))(i);return this._onStop=Promise.race([n,r]).then(o=>{if(o!==void 0)o.end(),o.dispose();else throw this.error("Stopping server timed out",void 0,!1),new Error("Stopping the server timed out")},o=>{throw this.error("Stopping server failed",o,!1),o}).finally(()=>{this.$state=sr.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(r){return t._fileEvents.push(r),t._fileEventDelayer.trigger(async()=>{await t.sendNotification(Tt.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}const n=this.clientOptions.middleware?.workspace;(n?.didChangeWatchedFile?n.didChangeWatchedFile(e,i):i(e)).catch(r=>{t.error("Notify file events failed.",r)})}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(Tt.DidChangeTextDocumentNotification.type,n),this._didChangeTextDocumentFeature.notificationSent(i,Tt.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,Tt.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 Ho.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:n},this._p2c.asDiagnostics(i,n.token).then(r=>{if(!n.token.isCancellationRequested){const o=this._p2c.asUri(t),a=this.clientOptions.middleware;a.handleDiagnostics?a.handleDiagnostics(o,r,(c,l)=>this.setDiagnostics(c,l)):this.setDiagnostics(o,r)}}).finally(()=>{this._diagnosticQueueState={state:"idle"},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}getLocale(){return Ho.env.language}async $start(){if(this.$state===sr.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,r,o)=>{this.handleConnectionError(n,r,o).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=Pli(i.reader,i.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===sr.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:HD.DoNotRestart};if(this.$state!==sr.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===HD.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===sr.Starting?this.$state=sr.StartFailed:this.$state=sr.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===HD.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart.",!e.handled),this.cleanUp("restart"),this.$state=sr.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===y7.Shutdown?(this.error(n.message??`Client ${this._name}: connection to server is erroring. ${e.message} Shutting down server.`,void 0,n.handled===!0?!1:"force"),this.stop().catch(r=>{this.error("Stopping server failed",r,!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(Ho.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){const i=Ho.workspace.getConfiguration(this._id);let n=Tt.Trace.Off,r=Tt.TraceFormat.Text;if(i){const o=i.get("trace.server","off");typeof o=="string"?n=Tt.Trace.fromString(o):(n=Tt.Trace.fromString(i.get("trace.server.verbosity","off")),r=Tt.TraceFormat.fromString(i.get("trace.server.format","text")))}this._trace=n,this._traceFormat=r,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(o=>{this.error("Updating trace failed with error",o,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let i;Ov.array(t)?i=t:i=[t],i&&this._dynamicFeatures.get(Tt.DidChangeWatchedFilesNotification.type.method).registerRaw(M6e.generateUuid(),i)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),vv.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(Tt.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof N6e.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){const e=new Map;this.registerFeature(new P6e.ConfigurationFeature(this)),this.registerFeature(new NP.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new NP.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new NP.WillSaveFeature(this)),this.registerFeature(new NP.WillSaveWaitUntilFeature(this)),this.registerFeature(new NP.DidSaveTextDocumentFeature(this)),this.registerFeature(new NP.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new mli.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new nli.CompletionItemFeature(this)),this.registerFeature(new sli.HoverFeature(this)),this.registerFeature(new oli.SignatureHelpFeature(this)),this.registerFeature(new rli.DefinitionFeature(this)),this.registerFeature(new dli.ReferencesFeature(this)),this.registerFeature(new ali.DocumentHighlightFeature(this)),this.registerFeature(new cli.DocumentSymbolFeature(this)),this.registerFeature(new lli.WorkspaceSymbolFeature(this)),this.registerFeature(new hli.CodeActionFeature(this)),this.registerFeature(new uli.CodeLensFeature(this)),this.registerFeature(new cfe.DocumentFormattingFeature(this)),this.registerFeature(new cfe.DocumentRangeFormattingFeature(this)),this.registerFeature(new cfe.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new gli.RenameFeature(this)),this.registerFeature(new fli.DocumentLinkFeature(this)),this.registerFeature(new pli.ExecuteCommandFeature(this)),this.registerFeature(new P6e.SyncConfigurationFeature(this)),this.registerFeature(new bli.TypeDefinitionFeature(this)),this.registerFeature(new vli.ImplementationFeature(this)),this.registerFeature(new _li.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new wli.WorkspaceFoldersFeature(this)),this.registerFeature(new yli.FoldingRangeFeature(this)),this.registerFeature(new Cli.DeclarationFeature(this)),this.registerFeature(new Sli.SelectionRangeFeature(this)),this.registerFeature(new Ali.ProgressFeature(this)),this.registerFeature(new Eli.CallHierarchyFeature(this)),this.registerFeature(new xli.SemanticTokensFeature(this)),this.registerFeature(new Dli.LinkedEditingFeature(this)),this.registerFeature(new PP.DidCreateFilesFeature(this)),this.registerFeature(new PP.DidRenameFilesFeature(this)),this.registerFeature(new PP.DidDeleteFilesFeature(this)),this.registerFeature(new PP.WillCreateFilesFeature(this)),this.registerFeature(new PP.WillRenameFilesFeature(this)),this.registerFeature(new PP.WillDeleteFilesFeature(this)),this.registerFeature(new kli.TypeHierarchyFeature(this)),this.registerFeature(new Ili.InlineValueFeature(this)),this.registerFeature(new Tli.InlayHintsFeature(this)),this.registerFeature(new ili.DiagnosticFeature(this)),this.registerFeature(new N6e.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(J1e.createAll(this))}fillInitializeParams(e){for(let t of this._features)Ov.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){const e={};(0,vv.ensure)(e,"workspace").applyEdit=!0;const t=(0,vv.ensure)((0,vv.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[Tt.ResourceOperationKind.Create,Tt.ResourceOperationKind.Rename,Tt.ResourceOperationKind.Delete],t.failureHandling=Tt.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};const i=(0,vv.ensure)((0,vv.ensure)(e,"textDocument"),"publishDiagnostics");i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[Tt.DiagnosticTag.Unnecessary,Tt.DiagnosticTag.Deprecated]},i.codeDescriptionSupport=!0,i.dataSupport=!0;const n=(0,vv.ensure)(e,"window"),r=(0,vv.ensure)(n,"showMessage");r.messageActionItem={additionalPropertiesSupport:!0};const o=(0,vv.ensure)(n,"showDocument");o.support=!0;const a=(0,vv.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(gL.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)Ov.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 r={id:t.id,registerOptions:n};try{i.register(r)}catch(o){return Promise.reject(o)}}}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;Ho.workspace.textDocuments.forEach(o=>n.set(o.uri.toString(),o));let r=!1;if(t.documentChanges){for(const o of t.documentChanges)if(Tt.TextDocumentEdit.is(o)&&o.textDocument.version&&o.textDocument.version>=0){const a=this._p2c.asUri(o.textDocument.uri).toString(),c=n.get(a);if(c&&c.version!==o.textDocument.version){r=!0;break}}}return r?Promise.resolve({applied:!1}):Ov.asPromise(Ho.workspace.applyEdit(i).then(o=>({applied:o})))}handleFailedRequest(e,t,i,n,r=!0){if(i instanceof Tt.ResponseError){if(i.code===Tt.ErrorCodes.PendingResponseRejected||i.code===Tt.ErrorCodes.ConnectionInactive)return n;if(i.code===Tt.LSPErrorCodes.RequestCancelled||i.code===Tt.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return n;throw i.data!==void 0?new vv.LSPCancellationError(i.data):new Ho.CancellationError}else if(i.code===Tt.LSPErrorCodes.ContentModified){if(gL.RequestsToCancelOnContentModified.has(e.method)||gL.CancellableResolveCalls.has(e.method))throw new Ho.CancellationError;return n}}throw this.error(`Request ${e.method} failed.`,i,r),i}}var bat=wh.BaseLanguageClient=gL;gL.RequestsToCancelOnContentModified=new Set([Tt.SemanticTokensRequest.method,Tt.SemanticTokensRangeRequest.method,Tt.SemanticTokensDeltaRequest.method]);gL.CancellableResolveCalls=new Set([Tt.CompletionResolveRequest.method,Tt.CodeLensResolveRequest.method,Tt.CodeActionResolveRequest.method,Tt.InlayHintResolveRequest.method,Tt.DocumentLinkResolveRequest.method,Tt.WorkspaceSymbolResolveRequest.method]);class Mli{error(e){(0,Tt.RAL)().console.error(e)}warn(e){(0,Tt.RAL)().console.warn(e)}info(e){(0,Tt.RAL)().console.info(e)}log(e){(0,Tt.RAL)().console.log(e)}}function Nli(s,e,t,i,n){const r=new Mli,o=(0,Tt.createProtocolConnection)(s,e,r,n);return o.onError(c=>{t(c[0],c[1],c[2])}),o.onClose(i),{listen:()=>o.listen(),sendRequest:o.sendRequest,onRequest:o.onRequest,hasPendingResponse:o.hasPendingResponse,sendNotification:o.sendNotification,onNotification:o.onNotification,onProgress:o.onProgress,sendProgress:o.sendProgress,trace:(c,l,d)=>{const h={sendNotification:!1,traceFormat:Tt.TraceFormat.Text};return d===void 0?o.trace(c,l,h):(Ov.boolean(d),o.trace(c,l,d))},initialize:c=>o.sendRequest(Tt.InitializeRequest.type,c),shutdown:()=>o.sendRequest(Tt.ShutdownRequest.type,void 0),exit:()=>o.sendNotification(Tt.ExitNotification.type),end:()=>o.end(),dispose:()=>o.dispose()}}var J1e;(function(s){function e(t){return[new Lli.InlineCompletionItemFeature(t)]}s.createAll=e})(J1e||(wh.ProposedFeatures=J1e={}));(function(s){var e=cd&&cd.__createBinding||(Object.create?function(n,r,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(r,o);(!c||("get"in c?!r.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(n,a,c)}:function(n,r,o,a){a===void 0&&(a=o),n[a]=r[o]}),t=cd&&cd.__exportStar||function(n,r){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&e(r,n,o)};Object.defineProperty(s,"__esModule",{value:!0}),s.DiagnosticPullMode=s.vsdiag=void 0,t(ms,s),t(Nn,s);var i=SA;Object.defineProperty(s,"vsdiag",{enumerable:!0,get:function(){return i.vsdiag}}),Object.defineProperty(s,"DiagnosticPullMode",{enumerable:!0,get:function(){return i.DiagnosticPullMode}}),t(wh,s)})(R0e);var zne=ms;(function(s){var e=cd&&cd.__createBinding||(Object.create?function(o,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(o,l,d)}:function(o,a,c,l){l===void 0&&(l=c),o[l]=a[c]}),t=cd&&cd.__exportStar||function(o,a){for(var c in o)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&e(a,o,c)};Object.defineProperty(s,"__esModule",{value:!0}),s.LanguageClient=void 0;const i=R0e,n=zne;t(zne,s),t(R0e,s);class r 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=r})(L0e);class Pli extends bat{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)}}var B6e;(function(s){function e(t){return typeof t=="string"}s.is=e})(B6e||(B6e={}));var X1e;(function(s){function e(t){return typeof t=="string"}s.is=e})(X1e||(X1e={}));var W6e;(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})(W6e||(W6e={}));var $ne;(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})($ne||($ne={}));var eb;(function(s){function e(i,n){return i===Number.MAX_VALUE&&(i=$ne.MAX_VALUE),n===Number.MAX_VALUE&&(n=$ne.MAX_VALUE),{line:i,character:n}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Oe.uinteger(n.line)&&Oe.uinteger(n.character)}s.is=t})(eb||(eb={}));var Tl;(function(s){function e(i,n,r,o){if(Oe.uinteger(i)&&Oe.uinteger(n)&&Oe.uinteger(r)&&Oe.uinteger(o))return{start:eb.create(i,n),end:eb.create(r,o)};if(eb.is(i)&&eb.is(n))return{start:i,end:n};throw new Error("Range#create called with invalid arguments[".concat(i,", ").concat(n,", ").concat(r,", ").concat(o,"]"))}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&eb.is(n.start)&&eb.is(n.end)}s.is=t})(Tl||(Tl={}));var Gne;(function(s){function e(i,n){return{uri:i,range:n}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Tl.is(n.range)&&(Oe.string(n.uri)||Oe.undefined(n.uri))}s.is=t})(Gne||(Gne={}));var H6e;(function(s){function e(i,n,r,o){return{targetUri:i,targetRange:n,targetSelectionRange:r,originSelectionRange:o}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Tl.is(n.targetRange)&&Oe.string(n.targetUri)&&Tl.is(n.targetSelectionRange)&&(Tl.is(n.originSelectionRange)||Oe.undefined(n.originSelectionRange))}s.is=t})(H6e||(H6e={}));var Z1e;(function(s){function e(i,n,r,o){return{red:i,green:n,blue:r,alpha:o}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Oe.numberRange(n.red,0,1)&&Oe.numberRange(n.green,0,1)&&Oe.numberRange(n.blue,0,1)&&Oe.numberRange(n.alpha,0,1)}s.is=t})(Z1e||(Z1e={}));var U6e;(function(s){function e(i,n){return{range:i,color:n}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Tl.is(n.range)&&Z1e.is(n.color)}s.is=t})(U6e||(U6e={}));var V6e;(function(s){function e(i,n,r){return{label:i,textEdit:n,additionalTextEdits:r}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Oe.string(n.label)&&(Oe.undefined(n.textEdit)||xA.is(n))&&(Oe.undefined(n.additionalTextEdits)||Oe.typedArray(n.additionalTextEdits,xA.is))}s.is=t})(V6e||(V6e={}));var z6e;(function(s){s.Comment="comment",s.Imports="imports",s.Region="region"})(z6e||(z6e={}));var $6e;(function(s){function e(i,n,r,o,a,c){var l={startLine:i,endLine:n};return Oe.defined(r)&&(l.startCharacter=r),Oe.defined(o)&&(l.endCharacter=o),Oe.defined(a)&&(l.kind=a),Oe.defined(c)&&(l.collapsedText=c),l}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Oe.uinteger(n.startLine)&&Oe.uinteger(n.startLine)&&(Oe.undefined(n.startCharacter)||Oe.uinteger(n.startCharacter))&&(Oe.undefined(n.endCharacter)||Oe.uinteger(n.endCharacter))&&(Oe.undefined(n.kind)||Oe.string(n.kind))}s.is=t})($6e||($6e={}));var eTe;(function(s){function e(i,n){return{location:i,message:n}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Gne.is(n.location)&&Oe.string(n.message)}s.is=t})(eTe||(eTe={}));var G6e;(function(s){s.Error=1,s.Warning=2,s.Information=3,s.Hint=4})(G6e||(G6e={}));var K6e;(function(s){s.Unnecessary=1,s.Deprecated=2})(K6e||(K6e={}));var q6e;(function(s){function e(t){var i=t;return Oe.objectLiteral(i)&&Oe.string(i.href)}s.is=e})(q6e||(q6e={}));var Kne;(function(s){function e(i,n,r,o,a,c){var l={range:i,message:n};return Oe.defined(r)&&(l.severity=r),Oe.defined(o)&&(l.code=o),Oe.defined(a)&&(l.source=a),Oe.defined(c)&&(l.relatedInformation=c),l}s.create=e;function t(i){var n,r=i;return Oe.defined(r)&&Tl.is(r.range)&&Oe.string(r.message)&&(Oe.number(r.severity)||Oe.undefined(r.severity))&&(Oe.integer(r.code)||Oe.string(r.code)||Oe.undefined(r.code))&&(Oe.undefined(r.codeDescription)||Oe.string((n=r.codeDescription)===null||n===void 0?void 0:n.href))&&(Oe.string(r.source)||Oe.undefined(r.source))&&(Oe.undefined(r.relatedInformation)||Oe.typedArray(r.relatedInformation,eTe.is))}s.is=t})(Kne||(Kne={}));var bU;(function(s){function e(i,n){for(var r=[],o=2;o0&&(a.arguments=r),a}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Oe.string(n.title)&&Oe.string(n.command)}s.is=t})(bU||(bU={}));var xA;(function(s){function e(r,o){return{range:r,newText:o}}s.replace=e;function t(r,o){return{range:{start:r,end:r},newText:o}}s.insert=t;function i(r){return{range:r,newText:""}}s.del=i;function n(r){var o=r;return Oe.objectLiteral(o)&&Oe.string(o.newText)&&Tl.is(o.range)}s.is=n})(xA||(xA={}));var bB;(function(s){function e(i,n,r){var o={label:i};return n!==void 0&&(o.needsConfirmation=n),r!==void 0&&(o.description=r),o}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Oe.string(n.label)&&(Oe.boolean(n.needsConfirmation)||n.needsConfirmation===void 0)&&(Oe.string(n.description)||n.description===void 0)}s.is=t})(bB||(bB={}));var $u;(function(s){function e(t){var i=t;return Oe.string(i)}s.is=e})($u||($u={}));var qE;(function(s){function e(r,o,a){return{range:r,newText:o,annotationId:a}}s.replace=e;function t(r,o,a){return{range:{start:r,end:r},newText:o,annotationId:a}}s.insert=t;function i(r,o){return{range:r,newText:"",annotationId:o}}s.del=i;function n(r){var o=r;return xA.is(o)&&(bB.is(o.annotationId)||$u.is(o.annotationId))}s.is=n})(qE||(qE={}));var qne;(function(s){function e(i,n){return{textDocument:i,edits:n}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Qne.is(n.textDocument)&&Array.isArray(n.edits)}s.is=t})(qne||(qne={}));var C7;(function(s){function e(i,n,r){var o={kind:"create",uri:i};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(o.options=n),r!==void 0&&(o.annotationId=r),o}s.create=e;function t(i){var n=i;return n&&n.kind==="create"&&Oe.string(n.uri)&&(n.options===void 0||(n.options.overwrite===void 0||Oe.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||Oe.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||$u.is(n.annotationId))}s.is=t})(C7||(C7={}));var S7;(function(s){function e(i,n,r,o){var a={kind:"rename",oldUri:i,newUri:n};return r!==void 0&&(r.overwrite!==void 0||r.ignoreIfExists!==void 0)&&(a.options=r),o!==void 0&&(a.annotationId=o),a}s.create=e;function t(i){var n=i;return n&&n.kind==="rename"&&Oe.string(n.oldUri)&&Oe.string(n.newUri)&&(n.options===void 0||(n.options.overwrite===void 0||Oe.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||Oe.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||$u.is(n.annotationId))}s.is=t})(S7||(S7={}));var A7;(function(s){function e(i,n,r){var o={kind:"delete",uri:i};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(o.options=n),r!==void 0&&(o.annotationId=r),o}s.create=e;function t(i){var n=i;return n&&n.kind==="delete"&&Oe.string(n.uri)&&(n.options===void 0||(n.options.recursive===void 0||Oe.boolean(n.options.recursive))&&(n.options.ignoreIfNotExists===void 0||Oe.boolean(n.options.ignoreIfNotExists)))&&(n.annotationId===void 0||$u.is(n.annotationId))}s.is=t})(A7||(A7={}));var tTe;(function(s){function e(t){var i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(function(n){return Oe.string(n.kind)?C7.is(n)||S7.is(n)||A7.is(n):qne.is(n)}))}s.is=e})(tTe||(tTe={}));var _q=function(){function s(e,t){this.edits=e,this.changeAnnotations=t}return s.prototype.insert=function(e,t,i){var n,r;if(i===void 0?n=xA.insert(e,t):$u.is(i)?(r=i,n=qE.insert(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(i),n=qE.insert(e,t,r)),this.edits.push(n),r!==void 0)return r},s.prototype.replace=function(e,t,i){var n,r;if(i===void 0?n=xA.replace(e,t):$u.is(i)?(r=i,n=qE.replace(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(i),n=qE.replace(e,t,r)),this.edits.push(n),r!==void 0)return r},s.prototype.delete=function(e,t){var i,n;if(t===void 0?i=xA.del(e):$u.is(t)?(n=t,i=qE.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),i=qE.del(e,n)),this.edits.push(i),n!==void 0)return n},s.prototype.add=function(e){this.edits.push(e)},s.prototype.all=function(){return this.edits},s.prototype.clear=function(){this.edits.splice(0,this.edits.length)},s.prototype.assertChangeAnnotations=function(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},s}(),Q6e=function(){function s(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}return s.prototype.all=function(){return this._annotations},Object.defineProperty(s.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),s.prototype.manage=function(e,t){var i;if($u.is(e)?i=e:(i=this.nextId(),t=e),this._annotations[i]!==void 0)throw new Error("Id ".concat(i," is already in use."));if(t===void 0)throw new Error("No annotation provided for id ".concat(i));return this._annotations[i]=t,this._size++,i},s.prototype.nextId=function(){return this._counter++,this._counter.toString()},s}();(function(){function s(e){var t=this;this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Q6e(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(function(i){if(qne.is(i)){var n=new _q(i.edits,t._changeAnnotations);t._textEditChanges[i.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(function(i){var n=new _q(e.changes[i]);t._textEditChanges[i]=n})):this._workspaceEdit={}}return Object.defineProperty(s.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),s.prototype.getTextEditChange=function(e){if(Qne.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version},i=this._textEditChanges[t.uri];if(!i){var n=[],r={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(r),i=new _q(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.");var i=this._textEditChanges[e];if(!i){var n=[];this._workspaceEdit.changes[e]=n,i=new _q(n),this._textEditChanges[e]=i}return i}},s.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Q6e,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},s.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},s.prototype.createFile=function(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var n;bB.is(t)||$u.is(t)?n=t:i=t;var r,o;if(n===void 0?r=C7.create(e,i):(o=$u.is(n)?n:this._changeAnnotations.manage(n),r=C7.create(e,i,o)),this._workspaceEdit.documentChanges.push(r),o!==void 0)return o},s.prototype.renameFile=function(e,t,i,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var r;bB.is(i)||$u.is(i)?r=i:n=i;var o,a;if(r===void 0?o=S7.create(e,t,n):(a=$u.is(r)?r:this._changeAnnotations.manage(r),o=S7.create(e,t,n,a)),this._workspaceEdit.documentChanges.push(o),a!==void 0)return a},s.prototype.deleteFile=function(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var n;bB.is(t)||$u.is(t)?n=t:i=t;var r,o;if(n===void 0?r=A7.create(e,i):(o=$u.is(n)?n:this._changeAnnotations.manage(n),r=A7.create(e,i,o)),this._workspaceEdit.documentChanges.push(r),o!==void 0)return o},s})();var j6e;(function(s){function e(i){return{uri:i}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Oe.string(n.uri)}s.is=t})(j6e||(j6e={}));var Y6e;(function(s){function e(i,n){return{uri:i,version:n}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Oe.string(n.uri)&&Oe.integer(n.version)}s.is=t})(Y6e||(Y6e={}));var Qne;(function(s){function e(i,n){return{uri:i,version:n}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Oe.string(n.uri)&&(n.version===null||Oe.integer(n.version))}s.is=t})(Qne||(Qne={}));var J6e;(function(s){function e(i,n,r,o){return{uri:i,languageId:n,version:r,text:o}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Oe.string(n.uri)&&Oe.string(n.languageId)&&Oe.integer(n.version)&&Oe.string(n.text)}s.is=t})(J6e||(J6e={}));var iTe;(function(s){s.PlainText="plaintext",s.Markdown="markdown";function e(t){var i=t;return i===s.PlainText||i===s.Markdown}s.is=e})(iTe||(iTe={}));var E7;(function(s){function e(t){var i=t;return Oe.objectLiteral(t)&&iTe.is(i.kind)&&Oe.string(i.value)}s.is=e})(E7||(E7={}));var X6e;(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})(X6e||(X6e={}));var Z6e;(function(s){s.PlainText=1,s.Snippet=2})(Z6e||(Z6e={}));var eGe;(function(s){s.Deprecated=1})(eGe||(eGe={}));var tGe;(function(s){function e(i,n,r){return{newText:i,insert:n,replace:r}}s.create=e;function t(i){var n=i;return n&&Oe.string(n.newText)&&Tl.is(n.insert)&&Tl.is(n.replace)}s.is=t})(tGe||(tGe={}));var iGe;(function(s){s.asIs=1,s.adjustIndentation=2})(iGe||(iGe={}));var nGe;(function(s){function e(t){var i=t;return i&&(Oe.string(i.detail)||i.detail===void 0)&&(Oe.string(i.description)||i.description===void 0)}s.is=e})(nGe||(nGe={}));var sGe;(function(s){function e(t){return{label:t}}s.create=e})(sGe||(sGe={}));var rGe;(function(s){function e(t,i){return{items:t||[],isIncomplete:!!i}}s.create=e})(rGe||(rGe={}));var jne;(function(s){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}s.fromPlainText=e;function t(i){var n=i;return Oe.string(n)||Oe.objectLiteral(n)&&Oe.string(n.language)&&Oe.string(n.value)}s.is=t})(jne||(jne={}));var oGe;(function(s){function e(t){var i=t;return!!i&&Oe.objectLiteral(i)&&(E7.is(i.contents)||jne.is(i.contents)||Oe.typedArray(i.contents,jne.is))&&(t.range===void 0||Tl.is(t.range))}s.is=e})(oGe||(oGe={}));var aGe;(function(s){function e(t,i){return i?{label:t,documentation:i}:{label:t}}s.create=e})(aGe||(aGe={}));var cGe;(function(s){function e(t,i){for(var n=[],r=2;r=0;d--){var h=c[d],u=r.offsetAt(h.range.start),f=r.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(r,o){if(r.length<=1)return r;var a=r.length/2|0,c=r.slice(0,a),l=r.slice(a);n(c,o),n(l,o);for(var d=0,h=0,u=0;d{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){const i=Ho.workspace.getConfiguration(this._id);let n=Tt.Trace.Off,r=Tt.TraceFormat.Text;if(i){const o=i.get("trace.server","off");typeof o=="string"?n=Tt.Trace.fromString(o):(n=Tt.Trace.fromString(i.get("trace.server.verbosity","off")),r=Tt.TraceFormat.fromString(i.get("trace.server.format","text")))}this._trace=n,this._traceFormat=r,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(o=>{this.error("Updating trace failed with error",o,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let i;Ov.array(t)?i=t:i=[t],i&&this._dynamicFeatures.get(Tt.DidChangeWatchedFilesNotification.type.method).registerRaw(M6e.generateUuid(),i)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),vv.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(Tt.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof N6e.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){const e=new Map;this.registerFeature(new P6e.ConfigurationFeature(this)),this.registerFeature(new NP.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new NP.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new NP.WillSaveFeature(this)),this.registerFeature(new NP.WillSaveWaitUntilFeature(this)),this.registerFeature(new NP.DidSaveTextDocumentFeature(this)),this.registerFeature(new NP.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new _li.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new sli.CompletionItemFeature(this)),this.registerFeature(new rli.HoverFeature(this)),this.registerFeature(new ali.SignatureHelpFeature(this)),this.registerFeature(new oli.DefinitionFeature(this)),this.registerFeature(new hli.ReferencesFeature(this)),this.registerFeature(new cli.DocumentHighlightFeature(this)),this.registerFeature(new lli.DocumentSymbolFeature(this)),this.registerFeature(new dli.WorkspaceSymbolFeature(this)),this.registerFeature(new uli.CodeActionFeature(this)),this.registerFeature(new gli.CodeLensFeature(this)),this.registerFeature(new cfe.DocumentFormattingFeature(this)),this.registerFeature(new cfe.DocumentRangeFormattingFeature(this)),this.registerFeature(new cfe.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new fli.RenameFeature(this)),this.registerFeature(new pli.DocumentLinkFeature(this)),this.registerFeature(new mli.ExecuteCommandFeature(this)),this.registerFeature(new P6e.SyncConfigurationFeature(this)),this.registerFeature(new wli.TypeDefinitionFeature(this)),this.registerFeature(new bli.ImplementationFeature(this)),this.registerFeature(new vli.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new yli.WorkspaceFoldersFeature(this)),this.registerFeature(new Cli.FoldingRangeFeature(this)),this.registerFeature(new Sli.DeclarationFeature(this)),this.registerFeature(new Ali.SelectionRangeFeature(this)),this.registerFeature(new Eli.ProgressFeature(this)),this.registerFeature(new xli.CallHierarchyFeature(this)),this.registerFeature(new Dli.SemanticTokensFeature(this)),this.registerFeature(new kli.LinkedEditingFeature(this)),this.registerFeature(new PP.DidCreateFilesFeature(this)),this.registerFeature(new PP.DidRenameFilesFeature(this)),this.registerFeature(new PP.DidDeleteFilesFeature(this)),this.registerFeature(new PP.WillCreateFilesFeature(this)),this.registerFeature(new PP.WillRenameFilesFeature(this)),this.registerFeature(new PP.WillDeleteFilesFeature(this)),this.registerFeature(new Ili.TypeHierarchyFeature(this)),this.registerFeature(new Tli.InlineValueFeature(this)),this.registerFeature(new Lli.InlayHintsFeature(this)),this.registerFeature(new nli.DiagnosticFeature(this)),this.registerFeature(new N6e.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(J1e.createAll(this))}fillInitializeParams(e){for(let t of this._features)Ov.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){const e={};(0,vv.ensure)(e,"workspace").applyEdit=!0;const t=(0,vv.ensure)((0,vv.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[Tt.ResourceOperationKind.Create,Tt.ResourceOperationKind.Rename,Tt.ResourceOperationKind.Delete],t.failureHandling=Tt.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};const i=(0,vv.ensure)((0,vv.ensure)(e,"textDocument"),"publishDiagnostics");i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[Tt.DiagnosticTag.Unnecessary,Tt.DiagnosticTag.Deprecated]},i.codeDescriptionSupport=!0,i.dataSupport=!0;const n=(0,vv.ensure)(e,"window"),r=(0,vv.ensure)(n,"showMessage");r.messageActionItem={additionalPropertiesSupport:!0};const o=(0,vv.ensure)(n,"showDocument");o.support=!0;const a=(0,vv.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(gL.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)Ov.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 r={id:t.id,registerOptions:n};try{i.register(r)}catch(o){return Promise.reject(o)}}}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;Ho.workspace.textDocuments.forEach(o=>n.set(o.uri.toString(),o));let r=!1;if(t.documentChanges){for(const o of t.documentChanges)if(Tt.TextDocumentEdit.is(o)&&o.textDocument.version&&o.textDocument.version>=0){const a=this._p2c.asUri(o.textDocument.uri).toString(),c=n.get(a);if(c&&c.version!==o.textDocument.version){r=!0;break}}}return r?Promise.resolve({applied:!1}):Ov.asPromise(Ho.workspace.applyEdit(i).then(o=>({applied:o})))}handleFailedRequest(e,t,i,n,r=!0){if(i instanceof Tt.ResponseError){if(i.code===Tt.ErrorCodes.PendingResponseRejected||i.code===Tt.ErrorCodes.ConnectionInactive)return n;if(i.code===Tt.LSPErrorCodes.RequestCancelled||i.code===Tt.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return n;throw i.data!==void 0?new vv.LSPCancellationError(i.data):new Ho.CancellationError}else if(i.code===Tt.LSPErrorCodes.ContentModified){if(gL.RequestsToCancelOnContentModified.has(e.method)||gL.CancellableResolveCalls.has(e.method))throw new Ho.CancellationError;return n}}throw this.error(`Request ${e.method} failed.`,i,r),i}}var bat=wh.BaseLanguageClient=gL;gL.RequestsToCancelOnContentModified=new Set([Tt.SemanticTokensRequest.method,Tt.SemanticTokensRangeRequest.method,Tt.SemanticTokensDeltaRequest.method]);gL.CancellableResolveCalls=new Set([Tt.CompletionResolveRequest.method,Tt.CodeLensResolveRequest.method,Tt.CodeActionResolveRequest.method,Tt.InlayHintResolveRequest.method,Tt.DocumentLinkResolveRequest.method,Tt.WorkspaceSymbolResolveRequest.method]);class Nli{error(e){(0,Tt.RAL)().console.error(e)}warn(e){(0,Tt.RAL)().console.warn(e)}info(e){(0,Tt.RAL)().console.info(e)}log(e){(0,Tt.RAL)().console.log(e)}}function Pli(s,e,t,i,n){const r=new Nli,o=(0,Tt.createProtocolConnection)(s,e,r,n);return o.onError(c=>{t(c[0],c[1],c[2])}),o.onClose(i),{listen:()=>o.listen(),sendRequest:o.sendRequest,onRequest:o.onRequest,hasPendingResponse:o.hasPendingResponse,sendNotification:o.sendNotification,onNotification:o.onNotification,onProgress:o.onProgress,sendProgress:o.sendProgress,trace:(c,l,d)=>{const h={sendNotification:!1,traceFormat:Tt.TraceFormat.Text};return d===void 0?o.trace(c,l,h):(Ov.boolean(d),o.trace(c,l,d))},initialize:c=>o.sendRequest(Tt.InitializeRequest.type,c),shutdown:()=>o.sendRequest(Tt.ShutdownRequest.type,void 0),exit:()=>o.sendNotification(Tt.ExitNotification.type),end:()=>o.end(),dispose:()=>o.dispose()}}var J1e;(function(s){function e(t){return[new Rli.InlineCompletionItemFeature(t)]}s.createAll=e})(J1e||(wh.ProposedFeatures=J1e={}));(function(s){var e=cd&&cd.__createBinding||(Object.create?function(n,r,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(r,o);(!c||("get"in c?!r.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(n,a,c)}:function(n,r,o,a){a===void 0&&(a=o),n[a]=r[o]}),t=cd&&cd.__exportStar||function(n,r){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&e(r,n,o)};Object.defineProperty(s,"__esModule",{value:!0}),s.DiagnosticPullMode=s.vsdiag=void 0,t(ms,s),t(Nn,s);var i=SA;Object.defineProperty(s,"vsdiag",{enumerable:!0,get:function(){return i.vsdiag}}),Object.defineProperty(s,"DiagnosticPullMode",{enumerable:!0,get:function(){return i.DiagnosticPullMode}}),t(wh,s)})(R0e);var zne=ms;(function(s){var e=cd&&cd.__createBinding||(Object.create?function(o,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(o,l,d)}:function(o,a,c,l){l===void 0&&(l=c),o[l]=a[c]}),t=cd&&cd.__exportStar||function(o,a){for(var c in o)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&e(a,o,c)};Object.defineProperty(s,"__esModule",{value:!0}),s.LanguageClient=void 0;const i=R0e,n=zne;t(zne,s),t(R0e,s);class r 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=r})(L0e);class Fli extends bat{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)}}var B6e;(function(s){function e(t){return typeof t=="string"}s.is=e})(B6e||(B6e={}));var X1e;(function(s){function e(t){return typeof t=="string"}s.is=e})(X1e||(X1e={}));var W6e;(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})(W6e||(W6e={}));var $ne;(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})($ne||($ne={}));var eb;(function(s){function e(i,n){return i===Number.MAX_VALUE&&(i=$ne.MAX_VALUE),n===Number.MAX_VALUE&&(n=$ne.MAX_VALUE),{line:i,character:n}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Oe.uinteger(n.line)&&Oe.uinteger(n.character)}s.is=t})(eb||(eb={}));var Ll;(function(s){function e(i,n,r,o){if(Oe.uinteger(i)&&Oe.uinteger(n)&&Oe.uinteger(r)&&Oe.uinteger(o))return{start:eb.create(i,n),end:eb.create(r,o)};if(eb.is(i)&&eb.is(n))return{start:i,end:n};throw new Error("Range#create called with invalid arguments[".concat(i,", ").concat(n,", ").concat(r,", ").concat(o,"]"))}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&eb.is(n.start)&&eb.is(n.end)}s.is=t})(Ll||(Ll={}));var Gne;(function(s){function e(i,n){return{uri:i,range:n}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Ll.is(n.range)&&(Oe.string(n.uri)||Oe.undefined(n.uri))}s.is=t})(Gne||(Gne={}));var H6e;(function(s){function e(i,n,r,o){return{targetUri:i,targetRange:n,targetSelectionRange:r,originSelectionRange:o}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Ll.is(n.targetRange)&&Oe.string(n.targetUri)&&Ll.is(n.targetSelectionRange)&&(Ll.is(n.originSelectionRange)||Oe.undefined(n.originSelectionRange))}s.is=t})(H6e||(H6e={}));var Z1e;(function(s){function e(i,n,r,o){return{red:i,green:n,blue:r,alpha:o}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Oe.numberRange(n.red,0,1)&&Oe.numberRange(n.green,0,1)&&Oe.numberRange(n.blue,0,1)&&Oe.numberRange(n.alpha,0,1)}s.is=t})(Z1e||(Z1e={}));var U6e;(function(s){function e(i,n){return{range:i,color:n}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Ll.is(n.range)&&Z1e.is(n.color)}s.is=t})(U6e||(U6e={}));var V6e;(function(s){function e(i,n,r){return{label:i,textEdit:n,additionalTextEdits:r}}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Oe.string(n.label)&&(Oe.undefined(n.textEdit)||xA.is(n))&&(Oe.undefined(n.additionalTextEdits)||Oe.typedArray(n.additionalTextEdits,xA.is))}s.is=t})(V6e||(V6e={}));var z6e;(function(s){s.Comment="comment",s.Imports="imports",s.Region="region"})(z6e||(z6e={}));var $6e;(function(s){function e(i,n,r,o,a,c){var l={startLine:i,endLine:n};return Oe.defined(r)&&(l.startCharacter=r),Oe.defined(o)&&(l.endCharacter=o),Oe.defined(a)&&(l.kind=a),Oe.defined(c)&&(l.collapsedText=c),l}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Oe.uinteger(n.startLine)&&Oe.uinteger(n.startLine)&&(Oe.undefined(n.startCharacter)||Oe.uinteger(n.startCharacter))&&(Oe.undefined(n.endCharacter)||Oe.uinteger(n.endCharacter))&&(Oe.undefined(n.kind)||Oe.string(n.kind))}s.is=t})($6e||($6e={}));var eTe;(function(s){function e(i,n){return{location:i,message:n}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Gne.is(n.location)&&Oe.string(n.message)}s.is=t})(eTe||(eTe={}));var G6e;(function(s){s.Error=1,s.Warning=2,s.Information=3,s.Hint=4})(G6e||(G6e={}));var K6e;(function(s){s.Unnecessary=1,s.Deprecated=2})(K6e||(K6e={}));var q6e;(function(s){function e(t){var i=t;return Oe.objectLiteral(i)&&Oe.string(i.href)}s.is=e})(q6e||(q6e={}));var Kne;(function(s){function e(i,n,r,o,a,c){var l={range:i,message:n};return Oe.defined(r)&&(l.severity=r),Oe.defined(o)&&(l.code=o),Oe.defined(a)&&(l.source=a),Oe.defined(c)&&(l.relatedInformation=c),l}s.create=e;function t(i){var n,r=i;return Oe.defined(r)&&Ll.is(r.range)&&Oe.string(r.message)&&(Oe.number(r.severity)||Oe.undefined(r.severity))&&(Oe.integer(r.code)||Oe.string(r.code)||Oe.undefined(r.code))&&(Oe.undefined(r.codeDescription)||Oe.string((n=r.codeDescription)===null||n===void 0?void 0:n.href))&&(Oe.string(r.source)||Oe.undefined(r.source))&&(Oe.undefined(r.relatedInformation)||Oe.typedArray(r.relatedInformation,eTe.is))}s.is=t})(Kne||(Kne={}));var bU;(function(s){function e(i,n){for(var r=[],o=2;o0&&(a.arguments=r),a}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Oe.string(n.title)&&Oe.string(n.command)}s.is=t})(bU||(bU={}));var xA;(function(s){function e(r,o){return{range:r,newText:o}}s.replace=e;function t(r,o){return{range:{start:r,end:r},newText:o}}s.insert=t;function i(r){return{range:r,newText:""}}s.del=i;function n(r){var o=r;return Oe.objectLiteral(o)&&Oe.string(o.newText)&&Ll.is(o.range)}s.is=n})(xA||(xA={}));var bB;(function(s){function e(i,n,r){var o={label:i};return n!==void 0&&(o.needsConfirmation=n),r!==void 0&&(o.description=r),o}s.create=e;function t(i){var n=i;return Oe.objectLiteral(n)&&Oe.string(n.label)&&(Oe.boolean(n.needsConfirmation)||n.needsConfirmation===void 0)&&(Oe.string(n.description)||n.description===void 0)}s.is=t})(bB||(bB={}));var $u;(function(s){function e(t){var i=t;return Oe.string(i)}s.is=e})($u||($u={}));var qE;(function(s){function e(r,o,a){return{range:r,newText:o,annotationId:a}}s.replace=e;function t(r,o,a){return{range:{start:r,end:r},newText:o,annotationId:a}}s.insert=t;function i(r,o){return{range:r,newText:"",annotationId:o}}s.del=i;function n(r){var o=r;return xA.is(o)&&(bB.is(o.annotationId)||$u.is(o.annotationId))}s.is=n})(qE||(qE={}));var qne;(function(s){function e(i,n){return{textDocument:i,edits:n}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Qne.is(n.textDocument)&&Array.isArray(n.edits)}s.is=t})(qne||(qne={}));var C7;(function(s){function e(i,n,r){var o={kind:"create",uri:i};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(o.options=n),r!==void 0&&(o.annotationId=r),o}s.create=e;function t(i){var n=i;return n&&n.kind==="create"&&Oe.string(n.uri)&&(n.options===void 0||(n.options.overwrite===void 0||Oe.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||Oe.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||$u.is(n.annotationId))}s.is=t})(C7||(C7={}));var S7;(function(s){function e(i,n,r,o){var a={kind:"rename",oldUri:i,newUri:n};return r!==void 0&&(r.overwrite!==void 0||r.ignoreIfExists!==void 0)&&(a.options=r),o!==void 0&&(a.annotationId=o),a}s.create=e;function t(i){var n=i;return n&&n.kind==="rename"&&Oe.string(n.oldUri)&&Oe.string(n.newUri)&&(n.options===void 0||(n.options.overwrite===void 0||Oe.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||Oe.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||$u.is(n.annotationId))}s.is=t})(S7||(S7={}));var A7;(function(s){function e(i,n,r){var o={kind:"delete",uri:i};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(o.options=n),r!==void 0&&(o.annotationId=r),o}s.create=e;function t(i){var n=i;return n&&n.kind==="delete"&&Oe.string(n.uri)&&(n.options===void 0||(n.options.recursive===void 0||Oe.boolean(n.options.recursive))&&(n.options.ignoreIfNotExists===void 0||Oe.boolean(n.options.ignoreIfNotExists)))&&(n.annotationId===void 0||$u.is(n.annotationId))}s.is=t})(A7||(A7={}));var tTe;(function(s){function e(t){var i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(function(n){return Oe.string(n.kind)?C7.is(n)||S7.is(n)||A7.is(n):qne.is(n)}))}s.is=e})(tTe||(tTe={}));var _q=function(){function s(e,t){this.edits=e,this.changeAnnotations=t}return s.prototype.insert=function(e,t,i){var n,r;if(i===void 0?n=xA.insert(e,t):$u.is(i)?(r=i,n=qE.insert(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(i),n=qE.insert(e,t,r)),this.edits.push(n),r!==void 0)return r},s.prototype.replace=function(e,t,i){var n,r;if(i===void 0?n=xA.replace(e,t):$u.is(i)?(r=i,n=qE.replace(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(i),n=qE.replace(e,t,r)),this.edits.push(n),r!==void 0)return r},s.prototype.delete=function(e,t){var i,n;if(t===void 0?i=xA.del(e):$u.is(t)?(n=t,i=qE.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),i=qE.del(e,n)),this.edits.push(i),n!==void 0)return n},s.prototype.add=function(e){this.edits.push(e)},s.prototype.all=function(){return this.edits},s.prototype.clear=function(){this.edits.splice(0,this.edits.length)},s.prototype.assertChangeAnnotations=function(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},s}(),Q6e=function(){function s(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}return s.prototype.all=function(){return this._annotations},Object.defineProperty(s.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),s.prototype.manage=function(e,t){var i;if($u.is(e)?i=e:(i=this.nextId(),t=e),this._annotations[i]!==void 0)throw new Error("Id ".concat(i," is already in use."));if(t===void 0)throw new Error("No annotation provided for id ".concat(i));return this._annotations[i]=t,this._size++,i},s.prototype.nextId=function(){return this._counter++,this._counter.toString()},s}();(function(){function s(e){var t=this;this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Q6e(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(function(i){if(qne.is(i)){var n=new _q(i.edits,t._changeAnnotations);t._textEditChanges[i.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(function(i){var n=new _q(e.changes[i]);t._textEditChanges[i]=n})):this._workspaceEdit={}}return Object.defineProperty(s.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),s.prototype.getTextEditChange=function(e){if(Qne.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version},i=this._textEditChanges[t.uri];if(!i){var n=[],r={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(r),i=new _q(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.");var i=this._textEditChanges[e];if(!i){var n=[];this._workspaceEdit.changes[e]=n,i=new _q(n),this._textEditChanges[e]=i}return i}},s.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Q6e,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},s.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},s.prototype.createFile=function(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var n;bB.is(t)||$u.is(t)?n=t:i=t;var r,o;if(n===void 0?r=C7.create(e,i):(o=$u.is(n)?n:this._changeAnnotations.manage(n),r=C7.create(e,i,o)),this._workspaceEdit.documentChanges.push(r),o!==void 0)return o},s.prototype.renameFile=function(e,t,i,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var r;bB.is(i)||$u.is(i)?r=i:n=i;var o,a;if(r===void 0?o=S7.create(e,t,n):(a=$u.is(r)?r:this._changeAnnotations.manage(r),o=S7.create(e,t,n,a)),this._workspaceEdit.documentChanges.push(o),a!==void 0)return a},s.prototype.deleteFile=function(e,t,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var n;bB.is(t)||$u.is(t)?n=t:i=t;var r,o;if(n===void 0?r=A7.create(e,i):(o=$u.is(n)?n:this._changeAnnotations.manage(n),r=A7.create(e,i,o)),this._workspaceEdit.documentChanges.push(r),o!==void 0)return o},s})();var j6e;(function(s){function e(i){return{uri:i}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Oe.string(n.uri)}s.is=t})(j6e||(j6e={}));var Y6e;(function(s){function e(i,n){return{uri:i,version:n}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Oe.string(n.uri)&&Oe.integer(n.version)}s.is=t})(Y6e||(Y6e={}));var Qne;(function(s){function e(i,n){return{uri:i,version:n}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Oe.string(n.uri)&&(n.version===null||Oe.integer(n.version))}s.is=t})(Qne||(Qne={}));var J6e;(function(s){function e(i,n,r,o){return{uri:i,languageId:n,version:r,text:o}}s.create=e;function t(i){var n=i;return Oe.defined(n)&&Oe.string(n.uri)&&Oe.string(n.languageId)&&Oe.integer(n.version)&&Oe.string(n.text)}s.is=t})(J6e||(J6e={}));var iTe;(function(s){s.PlainText="plaintext",s.Markdown="markdown";function e(t){var i=t;return i===s.PlainText||i===s.Markdown}s.is=e})(iTe||(iTe={}));var E7;(function(s){function e(t){var i=t;return Oe.objectLiteral(t)&&iTe.is(i.kind)&&Oe.string(i.value)}s.is=e})(E7||(E7={}));var X6e;(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})(X6e||(X6e={}));var Z6e;(function(s){s.PlainText=1,s.Snippet=2})(Z6e||(Z6e={}));var eGe;(function(s){s.Deprecated=1})(eGe||(eGe={}));var tGe;(function(s){function e(i,n,r){return{newText:i,insert:n,replace:r}}s.create=e;function t(i){var n=i;return n&&Oe.string(n.newText)&&Ll.is(n.insert)&&Ll.is(n.replace)}s.is=t})(tGe||(tGe={}));var iGe;(function(s){s.asIs=1,s.adjustIndentation=2})(iGe||(iGe={}));var nGe;(function(s){function e(t){var i=t;return i&&(Oe.string(i.detail)||i.detail===void 0)&&(Oe.string(i.description)||i.description===void 0)}s.is=e})(nGe||(nGe={}));var sGe;(function(s){function e(t){return{label:t}}s.create=e})(sGe||(sGe={}));var rGe;(function(s){function e(t,i){return{items:t||[],isIncomplete:!!i}}s.create=e})(rGe||(rGe={}));var jne;(function(s){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}s.fromPlainText=e;function t(i){var n=i;return Oe.string(n)||Oe.objectLiteral(n)&&Oe.string(n.language)&&Oe.string(n.value)}s.is=t})(jne||(jne={}));var oGe;(function(s){function e(t){var i=t;return!!i&&Oe.objectLiteral(i)&&(E7.is(i.contents)||jne.is(i.contents)||Oe.typedArray(i.contents,jne.is))&&(t.range===void 0||Ll.is(t.range))}s.is=e})(oGe||(oGe={}));var aGe;(function(s){function e(t,i){return i?{label:t,documentation:i}:{label:t}}s.create=e})(aGe||(aGe={}));var cGe;(function(s){function e(t,i){for(var n=[],r=2;r=0;d--){var h=c[d],u=r.offsetAt(h.range.start),f=r.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(r,o){if(r.length<=1)return r;var a=r.length/2|0,c=r.slice(0,a),l=r.slice(a);n(c,o),n(l,o);for(var d=0,h=0,u=0;d0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},s.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return eb.create(0,e);for(;ie?n=r:i=r+1}var o=i-1;return eb.create(o,e-t[o])},s.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var i=t[e.line],n=e.line+1"u"}s.undefined=i;function n(f){return f===!0||f===!1}s.boolean=n;function r(f){return e.call(f)==="[object String]"}s.string=r;function o(f){return e.call(f)==="[object Number]"}s.number=o;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})(Oe||(Oe={}));let zt;const SS=new Array(128).fill(void 0);SS.push(void 0,null,!0,!1);function q(s){return SS[s]}let Hz=SS.length;function Oli(s){s<132||(SS[s]=Hz,Hz=s)}function Yp(s){const e=q(s);return Oli(s),e}let ha=0,e5=null;function Ij(){return(e5===null||e5.byteLength===0)&&(e5=new Uint8Array(zt.memory.buffer)),e5}const Tj=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Bli=typeof Tj.encodeInto=="function"?function(s,e){return Tj.encodeInto(s,e)}:function(s,e){const t=Tj.encode(s);return e.set(t),{read:s.length,written:t.length}};function za(s,e,t){if(t===void 0){const a=Tj.encode(s),c=e(a.length,1)>>>0;return Ij().subarray(c,c+a.length).set(a),ha=a.length,c}let i=s.length,n=e(i,1)>>>0;const r=Ij();let o=0;for(;o127)break;r[n+o]=a}if(o!==i){o!==0&&(s=s.slice(o)),n=t(n,i,i=o+s.length*3,1)>>>0;const a=Ij().subarray(n+o,n+i),c=Bli(s,a);o+=c.written,n=t(n,i,o,1)>>>0}return ha=o,n}function Ls(s){return s==null}let W0=null;function Li(){return(W0===null||W0.buffer.detached===!0||W0.buffer.detached===void 0&&W0.buffer!==zt.memory.buffer)&&(W0=new DataView(zt.memory.buffer)),W0}function Xe(s){Hz===SS.length&&SS.push(SS.length+1);const e=Hz;return Hz=SS[e],SS[e]=s,e}const wat=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&wat.decode();function qs(s,e){return s=s>>>0,wat.decode(Ij().subarray(s,s+e))}function rTe(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 r="[";n>0&&(r+=rTe(s[0]));for(let o=1;o1)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 Jne=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>{zt.__wbindgen_export_2.get(s.dtor)(s.a,s.b)});function sV(s,e,t,i){const n={a:s,b:e,cnt:1,dtor:t},r=(...o)=>{n.cnt++;try{return i(n.a,n.b,...o)}finally{--n.cnt===0&&(zt.__wbindgen_export_2.get(n.dtor)(n.a,n.b),n.a=0,Jne.unregister(n))}};return r.original=n,Jne.register(r,n,n),r}function rV(s,e,t){zt._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2077f37c88ebb6e4(s,e,Xe(t))}function bv(s,e,t,i){const n={a:s,b:e,cnt:1,dtor:t},r=(...o)=>{n.cnt++;const a=n.a;n.a=0;try{return i(a,n.b,...o)}finally{--n.cnt===0?(zt.__wbindgen_export_2.get(n.dtor)(a,n.b),Jne.unregister(n)):n.a=a}};return r.original=n,Jne.register(r,n,n),r}function MGe(s,e){zt._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9c0f9853d4a40097(s,e)}function SE(s,e,t){zt._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h433e4756c7fb54b4(s,e,Xe(t))}function NGe(s,e,t,i){zt._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h79f0c70f85f87f94(s,e,Xe(t),Xe(i))}function Zi(s,e){try{return s.apply(this,e)}catch(t){zt.__wbindgen_exn_store(Xe(t))}}function Wli(){try{const t=zt.__wbindgen_add_to_stack_pointer(-16);zt.run_event_loop(t);var s=Li().getInt32(t+4*0,!0),e=Li().getInt32(t+4*1,!0);if(e)throw Yp(s)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}let t5=null;function Hli(){return(t5===null||t5.byteLength===0)&&(t5=new Float32Array(zt.memory.buffer)),t5}function vq(s,e){return s=s>>>0,Hli().subarray(s/4,s/4+e)}const PGe=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>zt.__wbg_previewconnector_free(s>>>0,1));class Lde{static __wrap(e){e=e>>>0;const t=Object.create(Lde.prototype);return t.__wbg_ptr=e,PGe.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,PGe.unregister(this),e}free(){const e=this.__destroy_into_raw();zt.__wbg_previewconnector_free(e,0)}static create(e,t,i,n){try{const c=zt.__wbindgen_add_to_stack_pointer(-16),l=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),d=ha;zt.previewconnector_create(c,Xe(e),Xe(t),l,d,n);var r=Li().getInt32(c+4*0,!0),o=Li().getInt32(c+4*1,!0),a=Li().getInt32(c+4*2,!0);if(a)throw Yp(o);return Yp(r)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=zt.previewconnector_current_style(this.__wbg_ptr);return Yp(e)}show_ui(){try{const n=zt.__wbindgen_add_to_stack_pointer(-16);zt.previewconnector_show_ui(n,this.__wbg_ptr);var e=Li().getInt32(n+4*0,!0),t=Li().getInt32(n+4*1,!0),i=Li().getInt32(n+4*2,!0);if(i)throw Yp(t);return Yp(e)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const n=zt.__wbindgen_add_to_stack_pointer(-16);zt.previewconnector_process_lsp_to_preview_message(n,this.__wbg_ptr,Xe(e));var t=Li().getInt32(n+4*0,!0),i=Li().getInt32(n+4*1,!0);if(i)throw Yp(t)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(s=>zt.__wbg_slintserver_free(s>>>0,1));async function Uli(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 Vli(){const s={};return s.wbg={},s.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return Xe(e)},s.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const i=q(t).stack,n=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let i,n;try{i=e,n=t,console.error(qs(e,t))}finally{zt.__wbindgen_free(i,n,1)}},s.wbg.__wbindgen_object_drop_ref=function(e){Yp(e)},s.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=q(e).createProgram();return Ls(t)?0:Xe(t)},s.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=q(e).createProgram();return Ls(t)?0:Xe(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,r){q(e).bindAttribLocation(q(t),i>>>0,qs(n,r))},s.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,i,n,r){q(e).bindAttribLocation(q(t),i>>>0,qs(n,r))},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 Xe(n)},s.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,i){const n=q(e).getProgramParameter(q(t),i>>>0);return Xe(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 r=Ls(n)?0:za(n,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=ha;Li().setInt32(e+4*1,o,!0),Li().setInt32(e+4*0,r,!0)},s.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,i){const n=q(t).getProgramInfoLog(q(i));var r=Ls(n)?0:za(n,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=ha;Li().setInt32(e+4*1,o,!0),Li().setInt32(e+4*0,r,!0)},s.wbg.__wbg_createShader_af087106532661d9=function(e,t){const i=q(e).createShader(t>>>0);return Ls(i)?0:Xe(i)},s.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const i=q(e).createShader(t>>>0);return Ls(i)?0:Xe(i)},s.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,i,n){q(e).shaderSource(q(t),qs(i,n))},s.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,i,n){q(e).shaderSource(q(t),qs(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 Xe(n)},s.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,i){const n=q(e).getShaderParameter(q(t),i>>>0);return Xe(n)},s.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,i){const n=q(t).getShaderInfoLog(q(i));var r=Ls(n)?0:za(n,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=ha;Li().setInt32(e+4*1,o,!0),Li().setInt32(e+4*0,r,!0)},s.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,i){const n=q(t).getShaderInfoLog(q(i));var r=Ls(n)?0:za(n,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=ha;Li().setInt32(e+4*1,o,!0),Li().setInt32(e+4*0,r,!0)},s.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,i,n){q(e).uniform2fv(q(t),vq(i,n))},s.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,i,n){q(e).uniform2fv(q(t),vq(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_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 Ls(t)?0:Xe(t)},s.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=q(e).createTexture();return Ls(t)?0:Xe(t)},s.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return Xe(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 Zi(function(e,t,i,n){const r=q(e).getContext(qs(t,i),q(n));return Ls(r)?0:Xe(r)},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 Ls(t)?0:Xe(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 Xe(i)},s.wbg.__wbindgen_string_get=function(e,t){const i=q(t),n=typeof i=="string"?i:void 0;var r=Ls(n)?0:za(n,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=ha;Li().setInt32(e+4*1,o,!0),Li().setInt32(e+4*0,r,!0)},s.wbg.__wbg_getParameter_cfaed180705b9280=function(){return Zi(function(e,t){const i=q(e).getParameter(t>>>0);return Xe(i)},arguments)},s.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=q(e).createVertexArrayOES();return Ls(t)?0:Xe(t)},s.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=q(e).createVertexArray();return Ls(t)?0:Xe(t)},s.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=q(e).createBuffer();return Ls(t)?0:Xe(t)},s.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=q(e).createBuffer();return Ls(t)?0:Xe(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 Ls(t)?0:Xe(t)},s.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=q(e).createFramebuffer();return Ls(t)?0:Xe(t)},s.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,i,n,r,o){q(e).framebufferTexture2D(t>>>0,i>>>0,n>>>0,q(r),o)},s.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,i,n,r,o){q(e).framebufferTexture2D(t>>>0,i>>>0,n>>>0,q(r),o)},s.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=q(e).createRenderbuffer();return Ls(t)?0:Xe(t)},s.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=q(e).createRenderbuffer();return Ls(t)?0:Xe(t)},s.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,i,n,r){q(e).renderbufferStorage(t>>>0,i>>>0,n,r)},s.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,i,n,r){q(e).renderbufferStorage(t>>>0,i>>>0,n,r)},s.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,i,n,r){q(e).framebufferRenderbuffer(t>>>0,i>>>0,n>>>0,q(r))},s.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,i,n,r){q(e).framebufferRenderbuffer(t>>>0,i>>>0,n>>>0,q(r))},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,r){q(e).scissor(t,i,n,r)},s.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,i,n,r){q(e).scissor(t,i,n,r)},s.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,i,n,r){q(e).clearColor(t,i,n,r)},s.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,i,n,r){q(e).clearColor(t,i,n,r)},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),vq(i,n))},s.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,i,n){q(e).uniform4fv(q(t),vq(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 r=q(e).getUniformLocation(q(t),qs(i,n));return Ls(r)?0:Xe(r)},s.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,i,n){const r=q(e).getUniformLocation(q(t),qs(i,n));return Ls(r)?0:Xe(r)},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 Zi(function(e,t,i,n,r,o,a,c,l,d){q(e).texImage2D(t>>>0,i,n,r,o,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return Zi(function(e,t,i,n,r,o,a,c,l,d){q(e).texImage2D(t>>>0,i,n,r,o,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,r){q(e).colorMask(t!==0,i!==0,n!==0,r!==0)},s.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,i,n,r){q(e).colorMask(t!==0,i!==0,n!==0,r!==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 Zi(function(e,t,i,n,r,o,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,r,o,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return Zi(function(e,t,i,n,r,o,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,r,o,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return Zi(function(e,t,i,n,r,o,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,r,o,a,c>>>0,l>>>0,d)},arguments)},s.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,i,n,r,o,a){q(e).vertexAttribPointer(t>>>0,i,n>>>0,r!==0,o,a)},s.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,i,n,r,o,a){q(e).vertexAttribPointer(t>>>0,i,n>>>0,r!==0,o,a)},s.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,i,n,r){q(e).viewport(t,i,n,r)},s.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,i,n,r){q(e).viewport(t,i,n,r)},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,r){q(e).stencilOpSeparate(t>>>0,i>>>0,n>>>0,r>>>0)},s.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,i,n,r){q(e).stencilOpSeparate(t>>>0,i>>>0,n>>>0,r>>>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 Ls(t)?0:Xe(t)},s.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,i){const n=q(e).getElementById(qs(t,i));return Ls(n)?0:Xe(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 Xe(t)},s.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,i,n){const r=q(t)[qs(i,n)];var o=Ls(r)?0:za(r,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=ha;Li().setInt32(e+4*1,a,!0),Li().setInt32(e+4*0,o,!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 Xe(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 Zi(function(e,t){q(e).before(q(t))},arguments)},s.wbg.__wbindgen_object_clone_ref=function(e){const t=q(e);return Xe(t)},s.wbg.__wbg_setvalue_688819688274bec0=function(e,t,i){q(e).value=qs(t,i)},s.wbg.__wbg_data_edba00a6420faae3=function(e,t){const i=q(t).data;var n=Ls(i)?0:za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().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=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().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=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().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(qs(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 Ls(t)?0:Xe(t)},s.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return Zi(function(e,t,i,n){const r=q(t).getData(qs(i,n)),o=za(r,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=ha;Li().setInt32(e+4*1,a,!0),Li().setInt32(e+4*0,o,!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=qs(t,i)},s.wbg.__wbindgen_string_new=function(e,t){const i=qs(e,t);return Xe(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=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().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=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_log_2f54632e0e18c089=function(e,t){console.log(qs(e,t))},s.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const i=q(t).src,n=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new_0d5e77f348d88b87=function(){return Zi(function(){const e=new Image;return Xe(e)},arguments)},s.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,i){q(e).crossOrigin=t===0?void 0:qs(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=qs(t,i)},s.wbg.__wbg_new0_65387337a95cf44d=function(){return Xe(new Date)},s.wbg.__wbg_getTime_91058879093a1589=function(e){return q(e).getTime()},s.wbg.__wbindgen_number_new=function(e){return Xe(e)},s.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(q(e));return Xe(t)},s.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return q(e).getTimezoneOffset()},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,r){q(e).blendFuncSeparate(t>>>0,i>>>0,n>>>0,r>>>0)},s.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,i,n,r){q(e).blendFuncSeparate(t>>>0,i>>>0,n>>>0,r>>>0)},s.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return Zi(function(e,t,i,n,r,o,a,c){q(e).readPixels(t,i,n,r,o>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return Zi(function(e,t,i,n,r,o,a,c){q(e).readPixels(t,i,n,r,o>>>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_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_texSubImage2D_064e1b60f43bdb29=function(){return Zi(function(e,t,i,n,r,o,a,c){q(e).texSubImage2D(t>>>0,i,n,r,o>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return Zi(function(e,t,i,n,r,o,a,c){q(e).texSubImage2D(t>>>0,i,n,r,o>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_next_f9cb570345655b9a=function(){return Zi(function(e){const t=q(e).next();return Xe(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 Xe(t)},s.wbg.__wbg_iterator_888179a48810a9fe=function(){return Xe(Symbol.iterator)},s.wbg.__wbg_get_224d16597dbbfd96=function(){return Zi(function(e,t){const i=Reflect.get(q(e),q(t));return Xe(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 Xe(t)},s.wbg.__wbg_call_1084a111329e68ce=function(){return Zi(function(e,t){const i=q(e).call(q(t));return Xe(i)},arguments)},s.wbg.__wbg_call_89af060b4e1523f2=function(){return Zi(function(e,t,i){const n=q(e).call(q(t),q(i));return Xe(n)},arguments)},s.wbg.__wbg_call_c6fe275aaa60da79=function(){return Zi(function(e,t,i,n){const r=q(e).call(q(t),q(i),q(n));return Xe(r)},arguments)},s.wbg.__wbindgen_memory=function(){const e=zt.memory;return Xe(e)},s.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=q(e).buffer;return Xe(t)},s.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,i){const n=new Uint8Array(q(e),t>>>0,i>>>0);return Xe(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 Xe(t)},s.wbg.__wbg_set_d1e79e2388520f18=function(e,t,i){q(e).set(q(t),i>>>0)},s.wbg.__wbg_set_eacc7d73fefaafdf=function(){return Zi(function(e,t,i){return Reflect.set(q(e),q(t),q(i))},arguments)},s.wbg.__wbg_self_3093d5d1f7bcb682=function(){return Zi(function(){const e=self.self;return Xe(e)},arguments)},s.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return Zi(function(){const e=window.window;return Xe(e)},arguments)},s.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return Zi(function(){const e=globalThis.globalThis;return Xe(e)},arguments)},s.wbg.__wbg_global_e5a3fe56f8be9485=function(){return Zi(function(){const e=global.global;return Xe(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(qs(e,t));return Xe(i)},s.wbg.__wbindgen_error_new=function(e,t){const i=new Error(qs(e,t));return Xe(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;Li().setFloat64(e+8*1,Ls(n)?0:n,!0),Li().setInt32(e+4*0,!Ls(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 Xe(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=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(q(e))},s.wbg.__wbg_set_f975102236d3c502=function(e,t,i){q(e)[Yp(t)]=Yp(i)},s.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return Xe(e)},s.wbg.__wbg_set_673dda6c73d19609=function(e,t,i){q(e)[t>>>0]=Yp(i)},s.wbg.__wbg_new_8608a2b51a5f6737=function(){return Xe(new Map)},s.wbg.__wbg_set_49185437f0ab06f8=function(e,t,i){const n=q(e).set(q(t),q(i));return Xe(n)},s.wbg.__wbindgen_is_string=function(e){return typeof q(e)=="string"},s.wbg.__wbindgen_bigint_from_u64=function(e){const t=BigInt.asUintN(64,e);return Xe(t)},s.wbg.__wbindgen_bigint_from_i64=function(e){return Xe(e)},s.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,t){const i=q(e)[q(t)];return Xe(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=(o,a)=>{const c=i.a;i.a=0;try{return NGe(c,i.b,o,a)}finally{i.a=c}};const r=new Promise(n);return Xe(r)}finally{i.a=i.b=0}},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;Li().setBigInt64(e+8*1,Ls(n)?BigInt(0):n,!0),Li().setInt32(e+4*0,!Ls(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_previewconnector_new=function(e){const t=Lde.__wrap(e);return Xe(t)},s.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=q(e).navigator;return Xe(t)},s.wbg.__wbg_platform_509d898d9dce4c23=function(){return Zi(function(e,t){const i=q(t).platform,n=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbindgen_throw=function(e,t){throw new Error(qs(e,t))},s.wbg.__wbindgen_debug_string=function(e,t){const i=rTe(q(t)),n=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=q(e).queueMicrotask;return Xe(t)},s.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(q(e));return Xe(t)},s.wbg.__wbg_then_876bb3c633745cc6=function(e,t,i){const n=q(e).then(q(t),q(i));return Xe(n)},s.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const i=q(e).then(q(t));return Xe(i)},s.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(q(e))},s.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return Zi(function(e,t,i){const n=q(e).getExtension(qs(t,i));return Ls(n)?0:Xe(n)},arguments)},s.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return Zi(function(e,t,i){const n=q(e).matchMedia(qs(t,i));return Ls(n)?0:Xe(n)},arguments)},s.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return Zi(function(e,t){q(e).cancelAnimationFrame(t)},arguments)},s.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return Zi(function(e,t){return q(e).setTimeout(q(t))},arguments)},s.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return Zi(function(e,t,i){const n=q(e).createElement(qs(t,i));return Xe(n)},arguments)},s.wbg.__wbg_matches_212d57a200ff58f8=function(){return Zi(function(e,t,i){return q(e).matches(qs(t,i))},arguments)},s.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return Zi(function(e,t,i,n,r){q(e).setAttribute(qs(t,i),qs(n,r))},arguments)},s.wbg.__wbg_focus_06621101cc79f5d8=function(){return Zi(function(e){q(e).focus()},arguments)},s.wbg.__wbg_fillText_ae0445d1930428dd=function(){return Zi(function(e,t,i,n,r){q(e).fillText(qs(t,i),n,r)},arguments)},s.wbg.__wbg_getContext_69ec873410cbba3c=function(){return Zi(function(e,t,i){const n=q(e).getContext(qs(t,i));return Ls(n)?0:Xe(n)},arguments)},s.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return Zi(function(e,t){q(e).addListener(q(t))},arguments)},s.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return Zi(function(e,t,i,n,r){q(e).setProperty(qs(t,i),qs(n,r))},arguments)},s.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return Zi(function(e,t){URL.revokeObjectURL(qs(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 Zi(function(e,t,i,n,r){q(e).setData(qs(t,i),qs(n,r))},arguments)},s.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return Zi(function(e,t,i,n){q(e).addEventListener(qs(t,i),q(n))},arguments)},s.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return Zi(function(e,t,i,n){q(e).removeEventListener(qs(t,i),q(n))},arguments)},s.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return Zi(function(e,t){q(e).postMessage(q(t))},arguments)},s.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const i=q(t).data;var n=Ls(i)?0:za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new_ebf2727385ee825c=function(){return Zi(function(){const e=new AbortController;return Xe(e)},arguments)},s.wbg.__wbg_new_40ff2b042829bc58=function(){return Zi(function(){const e=new MessageChannel;return Xe(e)},arguments)},s.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=q(e).performance;return Xe(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 Xe(t)},s.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=q(e).signal;return Xe(t)},s.wbg.__wbg_postTask_99464245f349be5a=function(e,t,i){const n=q(e).postTask(q(t),q(i));return Xe(n)},s.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const i=q(e).catch(q(t));return Xe(i)},s.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=q(e).port1;return Xe(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 Xe(t)},s.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return Zi(function(e,t){return q(e).requestIdleCallback(q(t))},arguments)},s.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return Zi(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 Xe(i)},s.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(q(e));return Xe(t)},s.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return Zi(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=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return q(e).pointerId},s.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return Zi(function(e,t){q(e).setPointerCapture(t)},arguments)},s.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return q(e).pressure},s.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return q(e).persisted},s.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=q(e).contentRect;return Xe(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 Xe(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.__wbg_matches_42eb40a28a316d0e=function(e){return q(e).matches},s.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return q(e).isIntersecting},s.wbg.__wbg_buttons_a302533e27733599=function(e){return q(e).buttons},s.wbg.__wbindgen_cb_drop=function(e){const t=Yp(e).original;return t.cnt--==1?(t.a=0,!0):!1},s.wbg.__wbg_new_25d9d4e2932d816f=function(){return Zi(function(e,t){const i=new Worker(qs(e,t));return Xe(i)},arguments)},s.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,i){q(e).type=qs(t,i)},s.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return Zi(function(e,t){const i=new Blob(q(e),q(t));return Xe(i)},arguments)},s.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return Zi(function(e,t){const i=URL.createObjectURL(q(t)),n=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=q(e).Window;return Xe(t)},s.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return Xe(e)},s.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const i=Object.getOwnPropertyDescriptor(q(e),q(t));return Xe(i)},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 Ls(t)?0:Xe(t)},s.wbg.__wbg_brands_982de08b35281a98=function(e){const t=q(e).brands;return Xe(t)},s.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const i=q(t).brand,n=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return Zi(function(e,t){const i=q(t).userAgent,n=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(Yp(e))},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_webkitRequestFullscreen_42ba1c34171febc6=function(e){q(e).webkitRequestFullscreen()},s.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=q(e).requestFullscreen();return Xe(t)},s.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=q(e).webkitFullscreenElement;return Ls(t)?0:Xe(t)},s.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=q(e).fullscreenElement;return Ls(t)?0:Xe(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 Xe(n)},s.wbg.__wbg_play_5896e5851ba90aa2=function(e){q(e).play()},s.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return Zi(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 Zi(function(e,t,i,n){const r=q(t).getPropertyValue(qs(i,n)),o=za(r,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=ha;Li().setInt32(e+4*1,a,!0),Li().setInt32(e+4*0,o,!0)},arguments)},s.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return Zi(function(e,t,i,n){const r=q(t).removeProperty(qs(i,n)),o=za(r,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=ha;Li().setInt32(e+4*1,a,!0),Li().setInt32(e+4*0,o,!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 Ls(t)?0:Xe(t)},s.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return Zi(function(e,t){const i=q(e).appendChild(q(t));return Xe(i)},arguments)},s.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return Zi(function(e,t){const i=q(e).getComputedStyle(q(t));return Ls(i)?0:Xe(i)},arguments)},s.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=q(e).activeElement;return Ls(t)?0:Xe(t)},s.wbg.__wbg_new_42acb42ec2ace97c=function(){return Zi(function(e){const t=new ResizeObserver(q(e));return Xe(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 Zi(function(e){const t=new IntersectionObserver(q(e));return Xe(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 Xe(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 Zi(function(e,t){return q(e).requestAnimationFrame(q(t))},arguments)},s.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=q(e).scheduler;return Xe(t)},s.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=q(e).getCoalescedEvents;return Xe(t)},s.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=q(e).requestFullscreen;return Xe(t)},s.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=q(e).requestIdleCallback;return Xe(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=za(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().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 Xe(t)},s.wbg.__wbindgen_closure_wrapper4161=function(e,t,i){const n=sV(e,t,1618,rV);return Xe(n)},s.wbg.__wbindgen_closure_wrapper4163=function(e,t,i){const n=sV(e,t,1618,rV);return Xe(n)},s.wbg.__wbindgen_closure_wrapper4164=function(e,t,i){const n=sV(e,t,1618,rV);return Xe(n)},s.wbg.__wbindgen_closure_wrapper4165=function(e,t,i){const n=sV(e,t,1618,rV);return Xe(n)},s.wbg.__wbindgen_closure_wrapper4166=function(e,t,i){const n=sV(e,t,1618,rV);return Xe(n)},s.wbg.__wbindgen_closure_wrapper6434=function(e,t,i){const n=bv(e,t,1837,MGe);return Xe(n)},s.wbg.__wbindgen_closure_wrapper12164=function(e,t,i){const n=bv(e,t,1837,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13332=function(e,t,i){const n=bv(e,t,1837,MGe);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13366=function(e,t,i){const n=bv(e,t,1837,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13373=function(e,t,i){const n=bv(e,t,1837,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13377=function(e,t,i){const n=bv(e,t,1837,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13383=function(e,t,i){const n=bv(e,t,1837,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13388=function(e,t,i){const n=bv(e,t,1837,NGe);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13408=function(e,t,i){const n=bv(e,t,1837,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13423=function(e,t,i){const n=bv(e,t,1837,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13428=function(e,t,i){const n=bv(e,t,1837,SE);return Xe(n)},s}function zli(s,e){return zt=s.exports,yat.__wbindgen_wasm_module=e,W0=null,t5=null,e5=null,zt}async function yat(s){if(zt!==void 0)return zt;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-moVtmeIg.wasm",import.meta.url).href,import.meta.url));const e=Vli();(typeof s=="string"||typeof Request=="function"&&s instanceof Request||typeof URL=="function"&&s instanceof URL)&&(s=fetch(s));const{instance:t,module:i}=await Uli(await s,e);return zli(t,i)}function $li(s){return new Pli({name:"Slint Language Client",clientOptions:{documentSelector:[{language:"slint"}],errorHandler:{error:()=>({action:L0e.ErrorAction.Continue}),closed:()=>({action:L0e.CloseAction.DoNotRestart})}},connectionProvider:{get:t=>Promise.resolve(s)}})}var y2,C2;class Gli{constructor(){Ht(this,y2);Ht(this,C2);const e=new Worker(new URL(""+new URL("lsp_worker-uaVwuXuJ.js",import.meta.url).href,import.meta.url),{type:"module"});St(this,C2,new Promise(t=>{e.onmessage=i=>{i.data==="OK"&&t(e)}})),St(this,y2,yat({}))}async wait_for_lsp(){const e=Ce(this,C2);St(this,C2,null);const t=Ce(this,y2);St(this,y2,null);const[i,n]=await Promise.all([t,e]);return Promise.resolve(new qli(n))}}y2=new WeakMap,C2=new WeakMap;var S2;class Kli{constructor(e){Ht(this,S2);St(this,S2,e)}show_ui(){return Ce(this,S2).show_ui()}current_style(){return Ce(this,S2).current_style()}}S2=new WeakMap;var $7,G7,pT,mT,A2,_T;class qli{constructor(e){Ht(this,$7,null);Ht(this,G7,null);Ht(this,pT);Ht(this,mT);Ht(this,A2);Ht(this,_T,null);St(this,pT,e);const t=new ysi(new zne.BrowserMessageReader(Ce(this,pT)),n=>{if(n.method==="slint/lsp_to_preview"){const o=n.params;return Ce(this,_T)?.process_lsp_to_preview_message(o),!0}if(n.method==="slint/load_file"){const r=n,o=r.params[0];return this.read_url(o).then(a=>{i.write({jsonrpc:r.jsonrpc,id:r.id,result:a,error:void 0})}).catch(a=>{i.write({jsonrpc:r.jsonrpc,id:r.id,result:"",error:void 0})}),!0}return!1}),i=new zne.BrowserMessageWriter(Ce(this,pT));St(this,mT,t),St(this,A2,i)}get lsp_worker(){return Ce(this,pT)}get lsp_reader(){return Ce(this,mT)}get lsp_writer(){return Ce(this,A2)}set file_reader(e){St(this,G7,e)}read_url(e){var t;try{return((t=Ce(this,G7))==null?void 0:t.call(this,e))??Promise.reject()}catch{return Promise.reject("Failed to read file")}}get language_client(){let e=Ce(this,$7);if(e===null){const t=$li({reader:Ce(this,mT),writer:Ce(this,A2)});St(this,$7,t),t.start(),Ce(this,mT).onClose(()=>{t.stop()}),e=t}return e}async previewer(e,t){if(Ce(this,_T)===null){try{Wli()}catch{}const n=new URLSearchParams(window.location.search).get("SLINT_EXPERIMENTAL_FEATURES");St(this,_T,await Lde.create(r=>{this.language_client.sendNotification("slint/preview_to_lsp",r)},e,t,n==="1"))}return new Kli(Ce(this,_T))}}$7=new WeakMap,G7=new WeakMap,pT=new WeakMap,mT=new WeakMap,A2=new WeakMap,_T=new WeakMap;const bq="canvas";var vT;const HFe=class HFe extends st{constructor(t,i,n){super({node:HFe.createNode()});Ht(this,vT,null);this.setFlag(st.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(r=>{St(this,vT,r),Ce(this,vT).show_ui().then(()=>{console.info("UI should be up!");const o=document.getElementById(bq);o.style.width="100%",o.style.height="100%"})})}static createNode(){const t=document.createElement("div");t.className="preview-container";const i=document.createElement("canvas");return i.id=bq,i.className=bq,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,vT)?Ce(this,vT).current_style():""}onResize(t){super.onResize(t);const i=document.getElementById(bq);i.style.width="100%",i.style.height="100%"}onCloseRequest(t){super.onCloseRequest(t),this.dispose()}get contentNode(){return this.node.getElementsByClassName("preview-container")[0]}};vT=new WeakMap;let oTe=HFe;const Qli=new Gli,Xf=new gC;function jli(s){const e=new V_({commands:Xf});e.title.label="Open Demo";for(const t of s.known_demos()){const i="slint:set_demo_"+t[1];Xf.addCommand(i,{label:t[1],execute:()=>s.set_demo(t[0])}),e.addItem({command:i})}return e}function Yli(){const s=new V_({commands:Xf});return s.title.label="Settings",Xf.addCommand("slint:store_github_token",{label:"Manage Github login",iconClass:"fa-brands fa-github",execute:()=>{Jrt()}}),s.addItem({command:"slint:store_github_token"}),s}function Jli(s,e){const t=new V_({commands:Xf});return t.title.label="Project",Xf.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)}}),Xf.addKeyBinding({keys:["Accel O"],selector:"body",command:"slint:open_url"}),Xf.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))}}),Xf.addKeyBinding({keys:["Accel N"],selector:"body",command:"slint:add_file"}),t.addItem({command:"slint:open_url"}),t.addItem({type:"submenu",submenu:jli(s)}),t.addItem({type:"separator"}),t.addItem({command:"slint:add_file"}),t.addItem({type:"submenu",submenu:Xli(s,e)}),t.addItem({type:"separator"}),t.addItem({type:"submenu",submenu:Yli()}),t.addItem({type:"separator"}),Xf.addCommand("slint:about",{label:"About",iconClass:"fa-info-circle",execute:()=>QZt()}),t.addItem({command:"slint:about"}),t}function Xli(s,e){const t=new V_({commands:Xf});return t.title.label="Share",Xf.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(),S9e(n.toString())}}),Xf.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=ZDe();i||await Jrt(),i=ZDe(),i?await qZt((n,r)=>{JZt(s,n,r).then(o=>{const a=new URLSearchParams;a.set("load_url",o);const c=new URL(window.location.toString());c.search=a.toString(),S9e(o,c.toString())}).catch(o=>KZt(o))}):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 Zli=new URLSearchParams(window.location.search),edi=Zli.get("style");function tdi(s){const e=new wsi(s),t=new oTe(s,r=>e.map_url(r),edi??""),i=new s7;i.id="menuBar",i.addMenu(Jli(e,t));const n=new ZH({orientation:"horizontal"});n.id="main",n.addWidget(e),n.addWidget(t),window.onresize=()=>{n.update()},document.addEventListener("keydown",r=>{Xf.processKeydownEvent(r)}),st.attach(i,document.body),st.attach(n,document.body)}function idi(){psi().then(s=>{Qli.wait_for_lsp().then(e=>{tdi(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=idi;export{cd as c,cDi as g}; +`&&n++}i&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},s.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return eb.create(0,e);for(;ie?n=r:i=r+1}var o=i-1;return eb.create(o,e-t[o])},s.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var i=t[e.line],n=e.line+1"u"}s.undefined=i;function n(f){return f===!0||f===!1}s.boolean=n;function r(f){return e.call(f)==="[object String]"}s.string=r;function o(f){return e.call(f)==="[object Number]"}s.number=o;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})(Oe||(Oe={}));let zt;const SS=new Array(128).fill(void 0);SS.push(void 0,null,!0,!1);function q(s){return SS[s]}let Hz=SS.length;function Bli(s){s<132||(SS[s]=Hz,Hz=s)}function Yp(s){const e=q(s);return Bli(s),e}let ha=0,e5=null;function Ij(){return(e5===null||e5.byteLength===0)&&(e5=new Uint8Array(zt.memory.buffer)),e5}const Tj=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Wli=typeof Tj.encodeInto=="function"?function(s,e){return Tj.encodeInto(s,e)}:function(s,e){const t=Tj.encode(s);return e.set(t),{read:s.length,written:t.length}};function $a(s,e,t){if(t===void 0){const a=Tj.encode(s),c=e(a.length,1)>>>0;return Ij().subarray(c,c+a.length).set(a),ha=a.length,c}let i=s.length,n=e(i,1)>>>0;const r=Ij();let o=0;for(;o127)break;r[n+o]=a}if(o!==i){o!==0&&(s=s.slice(o)),n=t(n,i,i=o+s.length*3,1)>>>0;const a=Ij().subarray(n+o,n+i),c=Wli(s,a);o+=c.written,n=t(n,i,o,1)>>>0}return ha=o,n}function Ls(s){return s==null}let W0=null;function Li(){return(W0===null||W0.buffer.detached===!0||W0.buffer.detached===void 0&&W0.buffer!==zt.memory.buffer)&&(W0=new DataView(zt.memory.buffer)),W0}function Xe(s){Hz===SS.length&&SS.push(SS.length+1);const e=Hz;return Hz=SS[e],SS[e]=s,e}const wat=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&wat.decode();function qs(s,e){return s=s>>>0,wat.decode(Ij().subarray(s,s+e))}function rTe(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 r="[";n>0&&(r+=rTe(s[0]));for(let o=1;o1)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 Jne=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>{zt.__wbindgen_export_2.get(s.dtor)(s.a,s.b)});function sV(s,e,t,i){const n={a:s,b:e,cnt:1,dtor:t},r=(...o)=>{n.cnt++;try{return i(n.a,n.b,...o)}finally{--n.cnt===0&&(zt.__wbindgen_export_2.get(n.dtor)(n.a,n.b),n.a=0,Jne.unregister(n))}};return r.original=n,Jne.register(r,n,n),r}function rV(s,e,t){zt._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2077f37c88ebb6e4(s,e,Xe(t))}function bv(s,e,t,i){const n={a:s,b:e,cnt:1,dtor:t},r=(...o)=>{n.cnt++;const a=n.a;n.a=0;try{return i(a,n.b,...o)}finally{--n.cnt===0?(zt.__wbindgen_export_2.get(n.dtor)(a,n.b),Jne.unregister(n)):n.a=a}};return r.original=n,Jne.register(r,n,n),r}function MGe(s,e){zt._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9c0f9853d4a40097(s,e)}function SE(s,e,t){zt._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h433e4756c7fb54b4(s,e,Xe(t))}function NGe(s,e,t,i){zt._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h79f0c70f85f87f94(s,e,Xe(t),Xe(i))}function Zi(s,e){try{return s.apply(this,e)}catch(t){zt.__wbindgen_exn_store(Xe(t))}}function Hli(){try{const t=zt.__wbindgen_add_to_stack_pointer(-16);zt.run_event_loop(t);var s=Li().getInt32(t+4*0,!0),e=Li().getInt32(t+4*1,!0);if(e)throw Yp(s)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}let t5=null;function Uli(){return(t5===null||t5.byteLength===0)&&(t5=new Float32Array(zt.memory.buffer)),t5}function vq(s,e){return s=s>>>0,Uli().subarray(s/4,s/4+e)}const PGe=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>zt.__wbg_previewconnector_free(s>>>0,1));class Lde{static __wrap(e){e=e>>>0;const t=Object.create(Lde.prototype);return t.__wbg_ptr=e,PGe.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,PGe.unregister(this),e}free(){const e=this.__destroy_into_raw();zt.__wbg_previewconnector_free(e,0)}static create(e,t,i,n){try{const c=zt.__wbindgen_add_to_stack_pointer(-16),l=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),d=ha;zt.previewconnector_create(c,Xe(e),Xe(t),l,d,n);var r=Li().getInt32(c+4*0,!0),o=Li().getInt32(c+4*1,!0),a=Li().getInt32(c+4*2,!0);if(a)throw Yp(o);return Yp(r)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=zt.previewconnector_current_style(this.__wbg_ptr);return Yp(e)}show_ui(){try{const n=zt.__wbindgen_add_to_stack_pointer(-16);zt.previewconnector_show_ui(n,this.__wbg_ptr);var e=Li().getInt32(n+4*0,!0),t=Li().getInt32(n+4*1,!0),i=Li().getInt32(n+4*2,!0);if(i)throw Yp(t);return Yp(e)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const n=zt.__wbindgen_add_to_stack_pointer(-16);zt.previewconnector_process_lsp_to_preview_message(n,this.__wbg_ptr,Xe(e));var t=Li().getInt32(n+4*0,!0),i=Li().getInt32(n+4*1,!0);if(i)throw Yp(t)}finally{zt.__wbindgen_add_to_stack_pointer(16)}}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(s=>zt.__wbg_slintserver_free(s>>>0,1));async function Vli(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 zli(){const s={};return s.wbg={},s.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return Xe(e)},s.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const i=q(t).stack,n=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let i,n;try{i=e,n=t,console.error(qs(e,t))}finally{zt.__wbindgen_free(i,n,1)}},s.wbg.__wbindgen_object_drop_ref=function(e){Yp(e)},s.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=q(e).createProgram();return Ls(t)?0:Xe(t)},s.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=q(e).createProgram();return Ls(t)?0:Xe(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,r){q(e).bindAttribLocation(q(t),i>>>0,qs(n,r))},s.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,i,n,r){q(e).bindAttribLocation(q(t),i>>>0,qs(n,r))},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 Xe(n)},s.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,i){const n=q(e).getProgramParameter(q(t),i>>>0);return Xe(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 r=Ls(n)?0:$a(n,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=ha;Li().setInt32(e+4*1,o,!0),Li().setInt32(e+4*0,r,!0)},s.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,i){const n=q(t).getProgramInfoLog(q(i));var r=Ls(n)?0:$a(n,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=ha;Li().setInt32(e+4*1,o,!0),Li().setInt32(e+4*0,r,!0)},s.wbg.__wbg_createShader_af087106532661d9=function(e,t){const i=q(e).createShader(t>>>0);return Ls(i)?0:Xe(i)},s.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const i=q(e).createShader(t>>>0);return Ls(i)?0:Xe(i)},s.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,i,n){q(e).shaderSource(q(t),qs(i,n))},s.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,i,n){q(e).shaderSource(q(t),qs(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 Xe(n)},s.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,i){const n=q(e).getShaderParameter(q(t),i>>>0);return Xe(n)},s.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,i){const n=q(t).getShaderInfoLog(q(i));var r=Ls(n)?0:$a(n,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=ha;Li().setInt32(e+4*1,o,!0),Li().setInt32(e+4*0,r,!0)},s.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,i){const n=q(t).getShaderInfoLog(q(i));var r=Ls(n)?0:$a(n,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=ha;Li().setInt32(e+4*1,o,!0),Li().setInt32(e+4*0,r,!0)},s.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,i,n){q(e).uniform2fv(q(t),vq(i,n))},s.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,i,n){q(e).uniform2fv(q(t),vq(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_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 Ls(t)?0:Xe(t)},s.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=q(e).createTexture();return Ls(t)?0:Xe(t)},s.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return Xe(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 Zi(function(e,t,i,n){const r=q(e).getContext(qs(t,i),q(n));return Ls(r)?0:Xe(r)},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 Ls(t)?0:Xe(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 Xe(i)},s.wbg.__wbindgen_string_get=function(e,t){const i=q(t),n=typeof i=="string"?i:void 0;var r=Ls(n)?0:$a(n,zt.__wbindgen_malloc,zt.__wbindgen_realloc),o=ha;Li().setInt32(e+4*1,o,!0),Li().setInt32(e+4*0,r,!0)},s.wbg.__wbg_getParameter_cfaed180705b9280=function(){return Zi(function(e,t){const i=q(e).getParameter(t>>>0);return Xe(i)},arguments)},s.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=q(e).createVertexArrayOES();return Ls(t)?0:Xe(t)},s.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=q(e).createVertexArray();return Ls(t)?0:Xe(t)},s.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=q(e).createBuffer();return Ls(t)?0:Xe(t)},s.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=q(e).createBuffer();return Ls(t)?0:Xe(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 Ls(t)?0:Xe(t)},s.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=q(e).createFramebuffer();return Ls(t)?0:Xe(t)},s.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,i,n,r,o){q(e).framebufferTexture2D(t>>>0,i>>>0,n>>>0,q(r),o)},s.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,i,n,r,o){q(e).framebufferTexture2D(t>>>0,i>>>0,n>>>0,q(r),o)},s.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=q(e).createRenderbuffer();return Ls(t)?0:Xe(t)},s.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=q(e).createRenderbuffer();return Ls(t)?0:Xe(t)},s.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,i,n,r){q(e).renderbufferStorage(t>>>0,i>>>0,n,r)},s.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,i,n,r){q(e).renderbufferStorage(t>>>0,i>>>0,n,r)},s.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,i,n,r){q(e).framebufferRenderbuffer(t>>>0,i>>>0,n>>>0,q(r))},s.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,i,n,r){q(e).framebufferRenderbuffer(t>>>0,i>>>0,n>>>0,q(r))},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,r){q(e).scissor(t,i,n,r)},s.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,i,n,r){q(e).scissor(t,i,n,r)},s.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,i,n,r){q(e).clearColor(t,i,n,r)},s.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,i,n,r){q(e).clearColor(t,i,n,r)},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),vq(i,n))},s.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,i,n){q(e).uniform4fv(q(t),vq(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 r=q(e).getUniformLocation(q(t),qs(i,n));return Ls(r)?0:Xe(r)},s.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,i,n){const r=q(e).getUniformLocation(q(t),qs(i,n));return Ls(r)?0:Xe(r)},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 Zi(function(e,t,i,n,r,o,a,c,l,d){q(e).texImage2D(t>>>0,i,n,r,o,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return Zi(function(e,t,i,n,r,o,a,c,l,d){q(e).texImage2D(t>>>0,i,n,r,o,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,r){q(e).colorMask(t!==0,i!==0,n!==0,r!==0)},s.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,i,n,r){q(e).colorMask(t!==0,i!==0,n!==0,r!==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 Zi(function(e,t,i,n,r,o,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,r,o,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return Zi(function(e,t,i,n,r,o,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,r,o,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return Zi(function(e,t,i,n,r,o,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,r,o,a,c>>>0,l>>>0,d)},arguments)},s.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,i,n,r,o,a){q(e).vertexAttribPointer(t>>>0,i,n>>>0,r!==0,o,a)},s.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,i,n,r,o,a){q(e).vertexAttribPointer(t>>>0,i,n>>>0,r!==0,o,a)},s.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,i,n,r){q(e).viewport(t,i,n,r)},s.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,i,n,r){q(e).viewport(t,i,n,r)},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,r){q(e).stencilOpSeparate(t>>>0,i>>>0,n>>>0,r>>>0)},s.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,i,n,r){q(e).stencilOpSeparate(t>>>0,i>>>0,n>>>0,r>>>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 Ls(t)?0:Xe(t)},s.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,i){const n=q(e).getElementById(qs(t,i));return Ls(n)?0:Xe(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 Xe(t)},s.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,i,n){const r=q(t)[qs(i,n)];var o=Ls(r)?0:$a(r,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=ha;Li().setInt32(e+4*1,a,!0),Li().setInt32(e+4*0,o,!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 Xe(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 Zi(function(e,t){q(e).before(q(t))},arguments)},s.wbg.__wbindgen_object_clone_ref=function(e){const t=q(e);return Xe(t)},s.wbg.__wbg_setvalue_688819688274bec0=function(e,t,i){q(e).value=qs(t,i)},s.wbg.__wbg_data_edba00a6420faae3=function(e,t){const i=q(t).data;var n=Ls(i)?0:$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().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=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().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=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().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(qs(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 Ls(t)?0:Xe(t)},s.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return Zi(function(e,t,i,n){const r=q(t).getData(qs(i,n)),o=$a(r,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=ha;Li().setInt32(e+4*1,a,!0),Li().setInt32(e+4*0,o,!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=qs(t,i)},s.wbg.__wbindgen_string_new=function(e,t){const i=qs(e,t);return Xe(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=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().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=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new0_65387337a95cf44d=function(){return Xe(new Date)},s.wbg.__wbg_getTime_91058879093a1589=function(e){return q(e).getTime()},s.wbg.__wbindgen_number_new=function(e){return Xe(e)},s.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(q(e));return Xe(t)},s.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return q(e).getTimezoneOffset()},s.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const i=q(t).src,n=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new_0d5e77f348d88b87=function(){return Zi(function(){const e=new Image;return Xe(e)},arguments)},s.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,i){q(e).crossOrigin=t===0?void 0:qs(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=qs(t,i)},s.wbg.__wbg_log_2f54632e0e18c089=function(e,t){console.log(qs(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,r){q(e).blendFuncSeparate(t>>>0,i>>>0,n>>>0,r>>>0)},s.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,i,n,r){q(e).blendFuncSeparate(t>>>0,i>>>0,n>>>0,r>>>0)},s.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return Zi(function(e,t,i,n,r,o,a,c){q(e).readPixels(t,i,n,r,o>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return Zi(function(e,t,i,n,r,o,a,c){q(e).readPixels(t,i,n,r,o>>>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_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_texSubImage2D_064e1b60f43bdb29=function(){return Zi(function(e,t,i,n,r,o,a,c){q(e).texSubImage2D(t>>>0,i,n,r,o>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return Zi(function(e,t,i,n,r,o,a,c){q(e).texSubImage2D(t>>>0,i,n,r,o>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_next_f9cb570345655b9a=function(){return Zi(function(e){const t=q(e).next();return Xe(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 Xe(t)},s.wbg.__wbg_iterator_888179a48810a9fe=function(){return Xe(Symbol.iterator)},s.wbg.__wbg_get_224d16597dbbfd96=function(){return Zi(function(e,t){const i=Reflect.get(q(e),q(t));return Xe(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 Xe(t)},s.wbg.__wbg_call_1084a111329e68ce=function(){return Zi(function(e,t){const i=q(e).call(q(t));return Xe(i)},arguments)},s.wbg.__wbg_call_89af060b4e1523f2=function(){return Zi(function(e,t,i){const n=q(e).call(q(t),q(i));return Xe(n)},arguments)},s.wbg.__wbg_call_c6fe275aaa60da79=function(){return Zi(function(e,t,i,n){const r=q(e).call(q(t),q(i),q(n));return Xe(r)},arguments)},s.wbg.__wbindgen_memory=function(){const e=zt.memory;return Xe(e)},s.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=q(e).buffer;return Xe(t)},s.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,i){const n=new Uint8Array(q(e),t>>>0,i>>>0);return Xe(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 Xe(t)},s.wbg.__wbg_set_d1e79e2388520f18=function(e,t,i){q(e).set(q(t),i>>>0)},s.wbg.__wbg_set_eacc7d73fefaafdf=function(){return Zi(function(e,t,i){return Reflect.set(q(e),q(t),q(i))},arguments)},s.wbg.__wbg_self_3093d5d1f7bcb682=function(){return Zi(function(){const e=self.self;return Xe(e)},arguments)},s.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return Zi(function(){const e=window.window;return Xe(e)},arguments)},s.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return Zi(function(){const e=globalThis.globalThis;return Xe(e)},arguments)},s.wbg.__wbg_global_e5a3fe56f8be9485=function(){return Zi(function(){const e=global.global;return Xe(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(qs(e,t));return Xe(i)},s.wbg.__wbindgen_error_new=function(e,t){const i=new Error(qs(e,t));return Xe(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;Li().setFloat64(e+8*1,Ls(n)?0:n,!0),Li().setInt32(e+4*0,!Ls(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 Xe(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=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(q(e))},s.wbg.__wbg_set_f975102236d3c502=function(e,t,i){q(e)[Yp(t)]=Yp(i)},s.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return Xe(e)},s.wbg.__wbg_set_673dda6c73d19609=function(e,t,i){q(e)[t>>>0]=Yp(i)},s.wbg.__wbg_new_8608a2b51a5f6737=function(){return Xe(new Map)},s.wbg.__wbg_set_49185437f0ab06f8=function(e,t,i){const n=q(e).set(q(t),q(i));return Xe(n)},s.wbg.__wbindgen_is_string=function(e){return typeof q(e)=="string"},s.wbg.__wbindgen_bigint_from_u64=function(e){const t=BigInt.asUintN(64,e);return Xe(t)},s.wbg.__wbindgen_bigint_from_i64=function(e){return Xe(e)},s.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,t){const i=q(e)[q(t)];return Xe(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=(o,a)=>{const c=i.a;i.a=0;try{return NGe(c,i.b,o,a)}finally{i.a=c}};const r=new Promise(n);return Xe(r)}finally{i.a=i.b=0}},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;Li().setBigInt64(e+8*1,Ls(n)?BigInt(0):n,!0),Li().setInt32(e+4*0,!Ls(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_previewconnector_new=function(e){const t=Lde.__wrap(e);return Xe(t)},s.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=q(e).navigator;return Xe(t)},s.wbg.__wbg_platform_509d898d9dce4c23=function(){return Zi(function(e,t){const i=q(t).platform,n=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbindgen_throw=function(e,t){throw new Error(qs(e,t))},s.wbg.__wbindgen_debug_string=function(e,t){const i=rTe(q(t)),n=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=q(e).queueMicrotask;return Xe(t)},s.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(q(e));return Xe(t)},s.wbg.__wbg_then_876bb3c633745cc6=function(e,t,i){const n=q(e).then(q(t),q(i));return Xe(n)},s.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const i=q(e).then(q(t));return Xe(i)},s.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(q(e))},s.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return Zi(function(e,t,i){const n=q(e).getExtension(qs(t,i));return Ls(n)?0:Xe(n)},arguments)},s.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return Zi(function(e,t,i){const n=q(e).matchMedia(qs(t,i));return Ls(n)?0:Xe(n)},arguments)},s.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return Zi(function(e,t){q(e).cancelAnimationFrame(t)},arguments)},s.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return Zi(function(e,t){return q(e).setTimeout(q(t))},arguments)},s.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return Zi(function(e,t,i){const n=q(e).createElement(qs(t,i));return Xe(n)},arguments)},s.wbg.__wbg_matches_212d57a200ff58f8=function(){return Zi(function(e,t,i){return q(e).matches(qs(t,i))},arguments)},s.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return Zi(function(e,t,i,n,r){q(e).setAttribute(qs(t,i),qs(n,r))},arguments)},s.wbg.__wbg_focus_06621101cc79f5d8=function(){return Zi(function(e){q(e).focus()},arguments)},s.wbg.__wbg_fillText_ae0445d1930428dd=function(){return Zi(function(e,t,i,n,r){q(e).fillText(qs(t,i),n,r)},arguments)},s.wbg.__wbg_getContext_69ec873410cbba3c=function(){return Zi(function(e,t,i){const n=q(e).getContext(qs(t,i));return Ls(n)?0:Xe(n)},arguments)},s.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return Zi(function(e,t){q(e).addListener(q(t))},arguments)},s.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return Zi(function(e,t,i,n,r){q(e).setProperty(qs(t,i),qs(n,r))},arguments)},s.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return Zi(function(e,t){URL.revokeObjectURL(qs(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 Zi(function(e,t,i,n,r){q(e).setData(qs(t,i),qs(n,r))},arguments)},s.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return Zi(function(e,t,i,n){q(e).addEventListener(qs(t,i),q(n))},arguments)},s.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return Zi(function(e,t,i,n){q(e).removeEventListener(qs(t,i),q(n))},arguments)},s.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return Zi(function(e,t){q(e).postMessage(q(t))},arguments)},s.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const i=q(t).data;var n=Ls(i)?0:$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new_ebf2727385ee825c=function(){return Zi(function(){const e=new AbortController;return Xe(e)},arguments)},s.wbg.__wbg_new_40ff2b042829bc58=function(){return Zi(function(){const e=new MessageChannel;return Xe(e)},arguments)},s.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=q(e).performance;return Xe(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 Xe(t)},s.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=q(e).signal;return Xe(t)},s.wbg.__wbg_postTask_99464245f349be5a=function(e,t,i){const n=q(e).postTask(q(t),q(i));return Xe(n)},s.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const i=q(e).catch(q(t));return Xe(i)},s.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=q(e).port1;return Xe(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 Xe(t)},s.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return Zi(function(e,t){return q(e).requestIdleCallback(q(t))},arguments)},s.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return Zi(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 Xe(i)},s.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(q(e));return Xe(t)},s.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return Zi(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=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return q(e).pointerId},s.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return Zi(function(e,t){q(e).setPointerCapture(t)},arguments)},s.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return q(e).pressure},s.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return q(e).persisted},s.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=q(e).contentRect;return Xe(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 Xe(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.__wbg_matches_42eb40a28a316d0e=function(e){return q(e).matches},s.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return q(e).isIntersecting},s.wbg.__wbg_buttons_a302533e27733599=function(e){return q(e).buttons},s.wbg.__wbindgen_cb_drop=function(e){const t=Yp(e).original;return t.cnt--==1?(t.a=0,!0):!1},s.wbg.__wbg_new_25d9d4e2932d816f=function(){return Zi(function(e,t){const i=new Worker(qs(e,t));return Xe(i)},arguments)},s.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,i){q(e).type=qs(t,i)},s.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return Zi(function(e,t){const i=new Blob(q(e),q(t));return Xe(i)},arguments)},s.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return Zi(function(e,t){const i=URL.createObjectURL(q(t)),n=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=q(e).Window;return Xe(t)},s.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return Xe(e)},s.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const i=Object.getOwnPropertyDescriptor(q(e),q(t));return Xe(i)},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 Ls(t)?0:Xe(t)},s.wbg.__wbg_brands_982de08b35281a98=function(e){const t=q(e).brands;return Xe(t)},s.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const i=q(t).brand,n=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},s.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return Zi(function(e,t){const i=q(t).userAgent,n=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(Yp(e))},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_webkitRequestFullscreen_42ba1c34171febc6=function(e){q(e).webkitRequestFullscreen()},s.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=q(e).requestFullscreen();return Xe(t)},s.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=q(e).webkitFullscreenElement;return Ls(t)?0:Xe(t)},s.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=q(e).fullscreenElement;return Ls(t)?0:Xe(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 Xe(n)},s.wbg.__wbg_play_5896e5851ba90aa2=function(e){q(e).play()},s.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return Zi(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 Zi(function(e,t,i,n){const r=q(t).getPropertyValue(qs(i,n)),o=$a(r,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=ha;Li().setInt32(e+4*1,a,!0),Li().setInt32(e+4*0,o,!0)},arguments)},s.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return Zi(function(e,t,i,n){const r=q(t).removeProperty(qs(i,n)),o=$a(r,zt.__wbindgen_malloc,zt.__wbindgen_realloc),a=ha;Li().setInt32(e+4*1,a,!0),Li().setInt32(e+4*0,o,!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 Ls(t)?0:Xe(t)},s.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return Zi(function(e,t){const i=q(e).appendChild(q(t));return Xe(i)},arguments)},s.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return Zi(function(e,t){const i=q(e).getComputedStyle(q(t));return Ls(i)?0:Xe(i)},arguments)},s.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=q(e).activeElement;return Ls(t)?0:Xe(t)},s.wbg.__wbg_new_42acb42ec2ace97c=function(){return Zi(function(e){const t=new ResizeObserver(q(e));return Xe(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 Zi(function(e){const t=new IntersectionObserver(q(e));return Xe(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 Xe(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 Zi(function(e,t){return q(e).requestAnimationFrame(q(t))},arguments)},s.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=q(e).scheduler;return Xe(t)},s.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=q(e).getCoalescedEvents;return Xe(t)},s.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=q(e).requestFullscreen;return Xe(t)},s.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=q(e).requestIdleCallback;return Xe(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=$a(i,zt.__wbindgen_malloc,zt.__wbindgen_realloc),r=ha;Li().setInt32(e+4*1,r,!0),Li().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 Xe(t)},s.wbg.__wbindgen_closure_wrapper4360=function(e,t,i){const n=sV(e,t,1782,rV);return Xe(n)},s.wbg.__wbindgen_closure_wrapper4362=function(e,t,i){const n=sV(e,t,1782,rV);return Xe(n)},s.wbg.__wbindgen_closure_wrapper4363=function(e,t,i){const n=sV(e,t,1782,rV);return Xe(n)},s.wbg.__wbindgen_closure_wrapper4364=function(e,t,i){const n=sV(e,t,1782,rV);return Xe(n)},s.wbg.__wbindgen_closure_wrapper4365=function(e,t,i){const n=sV(e,t,1782,rV);return Xe(n)},s.wbg.__wbindgen_closure_wrapper6678=function(e,t,i){const n=bv(e,t,2011,MGe);return Xe(n)},s.wbg.__wbindgen_closure_wrapper12395=function(e,t,i){const n=bv(e,t,2011,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13563=function(e,t,i){const n=bv(e,t,2011,MGe);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13597=function(e,t,i){const n=bv(e,t,2011,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13604=function(e,t,i){const n=bv(e,t,2011,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13608=function(e,t,i){const n=bv(e,t,2011,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13614=function(e,t,i){const n=bv(e,t,2011,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13619=function(e,t,i){const n=bv(e,t,2011,NGe);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13639=function(e,t,i){const n=bv(e,t,2011,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13654=function(e,t,i){const n=bv(e,t,2011,SE);return Xe(n)},s.wbg.__wbindgen_closure_wrapper13659=function(e,t,i){const n=bv(e,t,2011,SE);return Xe(n)},s}function $li(s,e){return zt=s.exports,yat.__wbindgen_wasm_module=e,W0=null,t5=null,e5=null,zt}async function yat(s){if(zt!==void 0)return zt;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-wulIVBs_.wasm",import.meta.url).href,import.meta.url));const e=zli();(typeof s=="string"||typeof Request=="function"&&s instanceof Request||typeof URL=="function"&&s instanceof URL)&&(s=fetch(s));const{instance:t,module:i}=await Vli(await s,e);return $li(t,i)}function Gli(s){return new Fli({name:"Slint Language Client",clientOptions:{documentSelector:[{language:"slint"}],errorHandler:{error:()=>({action:L0e.ErrorAction.Continue}),closed:()=>({action:L0e.CloseAction.DoNotRestart})}},connectionProvider:{get:t=>Promise.resolve(s)}})}var y2,C2;class Kli{constructor(){Ht(this,y2);Ht(this,C2);const e=new Worker(new URL(""+new URL("lsp_worker-NDYIphP8.js",import.meta.url).href,import.meta.url),{type:"module"});St(this,C2,new Promise(t=>{e.onmessage=i=>{i.data==="OK"&&t(e)}})),St(this,y2,yat({}))}async wait_for_lsp(){const e=Ce(this,C2);St(this,C2,null);const t=Ce(this,y2);St(this,y2,null);const[i,n]=await Promise.all([t,e]);return Promise.resolve(new Qli(n))}}y2=new WeakMap,C2=new WeakMap;var S2;class qli{constructor(e){Ht(this,S2);St(this,S2,e)}show_ui(){return Ce(this,S2).show_ui()}current_style(){return Ce(this,S2).current_style()}}S2=new WeakMap;var $7,G7,pT,mT,A2,_T;class Qli{constructor(e){Ht(this,$7,null);Ht(this,G7,null);Ht(this,pT);Ht(this,mT);Ht(this,A2);Ht(this,_T,null);St(this,pT,e);const t=new Csi(new zne.BrowserMessageReader(Ce(this,pT)),n=>{if(n.method==="slint/lsp_to_preview"){const o=n.params;return Ce(this,_T)?.process_lsp_to_preview_message(o),!0}if(n.method==="slint/load_file"){const r=n,o=r.params[0];return this.read_url(o).then(a=>{i.write({jsonrpc:r.jsonrpc,id:r.id,result:a,error:void 0})}).catch(a=>{i.write({jsonrpc:r.jsonrpc,id:r.id,result:"",error:void 0})}),!0}return!1}),i=new zne.BrowserMessageWriter(Ce(this,pT));St(this,mT,t),St(this,A2,i)}get lsp_worker(){return Ce(this,pT)}get lsp_reader(){return Ce(this,mT)}get lsp_writer(){return Ce(this,A2)}set file_reader(e){St(this,G7,e)}read_url(e){var t;try{return((t=Ce(this,G7))==null?void 0:t.call(this,e))??Promise.reject()}catch{return Promise.reject("Failed to read file")}}get language_client(){let e=Ce(this,$7);if(e===null){const t=Gli({reader:Ce(this,mT),writer:Ce(this,A2)});St(this,$7,t),t.start(),Ce(this,mT).onClose(()=>{t.stop()}),e=t}return e}async previewer(e,t){if(Ce(this,_T)===null){try{Hli()}catch{}const n=new URLSearchParams(window.location.search).get("SLINT_EXPERIMENTAL_FEATURES");St(this,_T,await Lde.create(r=>{this.language_client.sendNotification("slint/preview_to_lsp",r)},e,t,n==="1"))}return new qli(Ce(this,_T))}}$7=new WeakMap,G7=new WeakMap,pT=new WeakMap,mT=new WeakMap,A2=new WeakMap,_T=new WeakMap;const bq="canvas";var vT;const HFe=class HFe extends st{constructor(t,i,n){super({node:HFe.createNode()});Ht(this,vT,null);this.setFlag(st.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(r=>{St(this,vT,r),Ce(this,vT).show_ui().then(()=>{console.info("UI should be up!");const o=document.getElementById(bq);o.style.width="100%",o.style.height="100%"})})}static createNode(){const t=document.createElement("div");t.className="preview-container";const i=document.createElement("canvas");return i.id=bq,i.className=bq,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,vT)?Ce(this,vT).current_style():""}onResize(t){super.onResize(t);const i=document.getElementById(bq);i.style.width="100%",i.style.height="100%"}onCloseRequest(t){super.onCloseRequest(t),this.dispose()}get contentNode(){return this.node.getElementsByClassName("preview-container")[0]}};vT=new WeakMap;let oTe=HFe;const jli=new Kli,Xf=new gC;function Yli(s){const e=new V_({commands:Xf});e.title.label="Open Demo";for(const t of s.known_demos()){const i="slint:set_demo_"+t[1];Xf.addCommand(i,{label:t[1],execute:()=>s.set_demo(t[0])}),e.addItem({command:i})}return e}function Jli(){const s=new V_({commands:Xf});return s.title.label="Settings",Xf.addCommand("slint:store_github_token",{label:"Manage Github login",iconClass:"fa-brands fa-github",execute:()=>{Jrt()}}),s.addItem({command:"slint:store_github_token"}),s}function Xli(s,e){const t=new V_({commands:Xf});return t.title.label="Project",Xf.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)}}),Xf.addKeyBinding({keys:["Accel O"],selector:"body",command:"slint:open_url"}),Xf.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))}}),Xf.addKeyBinding({keys:["Accel N"],selector:"body",command:"slint:add_file"}),t.addItem({command:"slint:open_url"}),t.addItem({type:"submenu",submenu:Yli(s)}),t.addItem({type:"separator"}),t.addItem({command:"slint:add_file"}),t.addItem({type:"submenu",submenu:Zli(s,e)}),t.addItem({type:"separator"}),t.addItem({type:"submenu",submenu:Jli()}),t.addItem({type:"separator"}),Xf.addCommand("slint:about",{label:"About",iconClass:"fa-info-circle",execute:()=>QZt()}),t.addItem({command:"slint:about"}),t}function Zli(s,e){const t=new V_({commands:Xf});return t.title.label="Share",Xf.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(),S9e(n.toString())}}),Xf.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=ZDe();i||await Jrt(),i=ZDe(),i?await qZt((n,r)=>{JZt(s,n,r).then(o=>{const a=new URLSearchParams;a.set("load_url",o);const c=new URL(window.location.toString());c.search=a.toString(),S9e(o,c.toString())}).catch(o=>KZt(o))}):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 edi=new URLSearchParams(window.location.search),tdi=edi.get("style");function idi(s){const e=new ysi(s),t=new oTe(s,r=>e.map_url(r),tdi??""),i=new s7;i.id="menuBar",i.addMenu(Xli(e,t));const n=new ZH({orientation:"horizontal"});n.id="main",n.addWidget(e),n.addWidget(t),window.onresize=()=>{n.update()},document.addEventListener("keydown",r=>{Xf.processKeydownEvent(r)}),st.attach(i,document.body),st.attach(n,document.body)}function ndi(){msi().then(s=>{jli.wait_for_lsp().then(e=>{idi(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=ndi;export{cd as c,lDi as g}; diff --git a/snapshots/master/editor/assets/lsp_worker-uaVwuXuJ.js b/snapshots/master/editor/assets/lsp_worker-NDYIphP8.js similarity index 98% rename from snapshots/master/editor/assets/lsp_worker-uaVwuXuJ.js rename to snapshots/master/editor/assets/lsp_worker-NDYIphP8.js index c3ba81945..304dbe88a 100644 --- a/snapshots/master/editor/assets/lsp_worker-uaVwuXuJ.js +++ b/snapshots/master/editor/assets/lsp_worker-NDYIphP8.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__h2077f37c88ebb6e4(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__h9c0f9853d4a40097(t,e)}function Ze(t,e,n){p._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h433e4756c7fb54b4(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__h79f0c70f85f87f94(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_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_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_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_log_2f54632e0e18c089=function(e,n){console.log(F(e,n))},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_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_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_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_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.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(s(e))},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_new_8608a2b51a5f6737=function(){return g(new Map)},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_bigint_from_u64=function(e){const n=BigInt.asUintN(64,e);return g(n)},t.wbg.__wbindgen_bigint_from_i64=function(e){return g(e)},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.__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_previewconnector_new=function(e){const n=Ur.__wrap(e);return g(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_persisted_6483200f25cdfed4=function(e){return s(e).persisted},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.__wbg_matches_42eb40a28a316d0e=function(e){return s(e).matches},t.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return s(e).isIntersecting},t.wbg.__wbg_buttons_a302533e27733599=function(e){return s(e).buttons},t.wbg.__wbindgen_cb_drop=function(e){const n=fe(e).original;return n.cnt--==1?(n.a=0,!0):!1},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_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_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_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_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(fe(e))},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_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_getCoalescedEvents_85701851c470c4e6=function(e){const n=s(e).getCoalescedEvents;return g(n)},t.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const n=s(e).requestFullscreen;return g(n)},t.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const n=s(e).requestIdleCallback;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_wrapper4161=function(e,n,r){const i=en(e,n,1618,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4163=function(e,n,r){const i=en(e,n,1618,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4164=function(e,n,r){const i=en(e,n,1618,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4165=function(e,n,r){const i=en(e,n,1618,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4166=function(e,n,r){const i=en(e,n,1618,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper6434=function(e,n,r){const i=Ee(e,n,1837,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper12164=function(e,n,r){const i=Ee(e,n,1837,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13332=function(e,n,r){const i=Ee(e,n,1837,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper13366=function(e,n,r){const i=Ee(e,n,1837,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13373=function(e,n,r){const i=Ee(e,n,1837,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13377=function(e,n,r){const i=Ee(e,n,1837,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13383=function(e,n,r){const i=Ee(e,n,1837,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13388=function(e,n,r){const i=Ee(e,n,1837,Ro);return g(i)},t.wbg.__wbindgen_closure_wrapper13408=function(e,n,r){const i=Ee(e,n,1837,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13423=function(e,n,r){const i=Ee(e,n,1837,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13428=function(e,n,r){const i=Ee(e,n,1837,Ze);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-moVtmeIg.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__h2077f37c88ebb6e4(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__h9c0f9853d4a40097(t,e)}function Ze(t,e,n){p._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h433e4756c7fb54b4(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__h79f0c70f85f87f94(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_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_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_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_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_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_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_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_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_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.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(s(e))},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_new_8608a2b51a5f6737=function(){return g(new Map)},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_bigint_from_u64=function(e){const n=BigInt.asUintN(64,e);return g(n)},t.wbg.__wbindgen_bigint_from_i64=function(e){return g(e)},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.__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_previewconnector_new=function(e){const n=Ur.__wrap(e);return g(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_persisted_6483200f25cdfed4=function(e){return s(e).persisted},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.__wbg_matches_42eb40a28a316d0e=function(e){return s(e).matches},t.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return s(e).isIntersecting},t.wbg.__wbg_buttons_a302533e27733599=function(e){return s(e).buttons},t.wbg.__wbindgen_cb_drop=function(e){const n=fe(e).original;return n.cnt--==1?(n.a=0,!0):!1},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_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_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_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_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(fe(e))},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_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_getCoalescedEvents_85701851c470c4e6=function(e){const n=s(e).getCoalescedEvents;return g(n)},t.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const n=s(e).requestFullscreen;return g(n)},t.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const n=s(e).requestIdleCallback;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_wrapper4360=function(e,n,r){const i=en(e,n,1782,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4362=function(e,n,r){const i=en(e,n,1782,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4363=function(e,n,r){const i=en(e,n,1782,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4364=function(e,n,r){const i=en(e,n,1782,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4365=function(e,n,r){const i=en(e,n,1782,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper6678=function(e,n,r){const i=Ee(e,n,2011,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper12395=function(e,n,r){const i=Ee(e,n,2011,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13563=function(e,n,r){const i=Ee(e,n,2011,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper13597=function(e,n,r){const i=Ee(e,n,2011,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13604=function(e,n,r){const i=Ee(e,n,2011,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13608=function(e,n,r){const i=Ee(e,n,2011,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13614=function(e,n,r){const i=Ee(e,n,2011,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13619=function(e,n,r){const i=Ee(e,n,2011,Ro);return g(i)},t.wbg.__wbindgen_closure_wrapper13639=function(e,n,r){const i=Ee(e,n,2011,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13654=function(e,n,r){const i=Ee(e,n,2011,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13659=function(e,n,r){const i=Ee(e,n,2011,Ze);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-wulIVBs_.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{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&J.decode();let T=null;function M(){return(T===null||T.byteLength===0)&&(T=new Uint8Array(a.memory.buffer)),T}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__h29a44748aab1512f(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__h5902283e1ca4e67f(n,e)}function S(n,e,t){a._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1ea22eda57db8c9f(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__h0890c0badcf47db0(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 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_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_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_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_log_2f54632e0e18c089=function(e,t){console.log(s(e,t))},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_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_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_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_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_pointerId_37ae0c4682f85248=function(e){return r(e).pointerId},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_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_setPointerCapture_16fb4f004fe3aaae=function(){return f(function(e,t){r(e).setPointerCapture(t)},arguments)},n.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return r(e).pressure},n.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return r(e).isIntersecting},n.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return r(e).matches},n.wbg.__wbindgen_cb_drop=function(e){const t=h(e).original;return t.cnt--==1?(t.a=0,!0):!1},n.wbg.__wbg_new_25d9d4e2932d816f=function(){return f(function(e,t){const _=new Worker(s(e,t));return b(_)},arguments)},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_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_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_getCoalescedEvents_85701851c470c4e6=function(e){const t=r(e).getCoalescedEvents;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_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_wrapper1193=function(e,t,_){const c=k(e,t,168,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1195=function(e,t,_){const c=k(e,t,168,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1196=function(e,t,_){const c=k(e,t,168,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1197=function(e,t,_){const c=k(e,t,168,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1198=function(e,t,_){const c=k(e,t,168,P);return b(c)},n.wbg.__wbindgen_closure_wrapper3331=function(e,t,_){const c=x(e,t,376,$);return b(c)},n.wbg.__wbindgen_closure_wrapper6358=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8492=function(e,t,_){const c=x(e,t,376,$);return b(c)},n.wbg.__wbindgen_closure_wrapper8526=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8547=function(e,t,_){const c=x(e,t,376,Y);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_wrapper8572=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8581=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8587=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8604=function(e,t,_){const c=x(e,t,376,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8627=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,R=null,T=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-DdthY1IE.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=` +${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__h29a44748aab1512f(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__h5902283e1ca4e67f(n,e)}function S(n,e,t){a._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1ea22eda57db8c9f(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__h0890c0badcf47db0(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_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_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_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_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_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_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_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_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_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 X(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_pointerId_37ae0c4682f85248=function(e){return r(e).pointerId},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_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_setPointerCapture_16fb4f004fe3aaae=function(){return f(function(e,t){r(e).setPointerCapture(t)},arguments)},n.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return r(e).pressure},n.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return r(e).isIntersecting},n.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return r(e).matches},n.wbg.__wbindgen_cb_drop=function(e){const t=h(e).original;return t.cnt--==1?(t.a=0,!0):!1},n.wbg.__wbg_new_25d9d4e2932d816f=function(){return f(function(e,t){const _=new Worker(s(e,t));return b(_)},arguments)},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_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_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_getCoalescedEvents_85701851c470c4e6=function(e){const t=r(e).getCoalescedEvents;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_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_wrapper1192=function(e,t,_){const c=k(e,t,168,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1194=function(e,t,_){const c=k(e,t,168,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1195=function(e,t,_){const c=k(e,t,168,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1196=function(e,t,_){const c=k(e,t,168,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1197=function(e,t,_){const c=k(e,t,168,P);return b(c)},n.wbg.__wbindgen_closure_wrapper3369=function(e,t,_){const c=x(e,t,380,$);return b(c)},n.wbg.__wbindgen_closure_wrapper6366=function(e,t,_){const c=x(e,t,380,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8500=function(e,t,_){const c=x(e,t,380,$);return b(c)},n.wbg.__wbindgen_closure_wrapper8534=function(e,t,_){const c=x(e,t,380,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8555=function(e,t,_){const c=x(e,t,380,X);return b(c)},n.wbg.__wbindgen_closure_wrapper8571=function(e,t,_){const c=x(e,t,380,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8580=function(e,t,_){const c=x(e,t,380,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8589=function(e,t,_){const c=x(e,t,380,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8595=function(e,t,_){const c=x(e,t,380,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8612=function(e,t,_){const c=x(e,t,380,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8635=function(e,t,_){const c=x(e,t,380,S);return b(c)},n}function oe(n,e){return a=n.exports,Q.__wbindgen_wasm_module=e,A=null,R=null,T=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-DmOdFMUv.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. diff --git a/snapshots/master/editor/assets/slint_lsp_wasm_bg-moVtmeIg.wasm b/snapshots/master/editor/assets/slint_lsp_wasm_bg-wulIVBs_.wasm similarity index 64% rename from snapshots/master/editor/assets/slint_lsp_wasm_bg-moVtmeIg.wasm rename to snapshots/master/editor/assets/slint_lsp_wasm_bg-wulIVBs_.wasm index 1fb40ef9a..af19afa55 100644 Binary files a/snapshots/master/editor/assets/slint_lsp_wasm_bg-moVtmeIg.wasm and b/snapshots/master/editor/assets/slint_lsp_wasm_bg-wulIVBs_.wasm differ diff --git a/snapshots/master/editor/assets/slint_wasm_interpreter_bg-DdthY1IE.wasm b/snapshots/master/editor/assets/slint_wasm_interpreter_bg-DmOdFMUv.wasm similarity index 71% rename from snapshots/master/editor/assets/slint_wasm_interpreter_bg-DdthY1IE.wasm rename to snapshots/master/editor/assets/slint_wasm_interpreter_bg-DmOdFMUv.wasm index 8c8dbf8c1..8d4a1e194 100644 Binary files a/snapshots/master/editor/assets/slint_wasm_interpreter_bg-DdthY1IE.wasm and b/snapshots/master/editor/assets/slint_wasm_interpreter_bg-DmOdFMUv.wasm differ diff --git a/snapshots/master/editor/index.html b/snapshots/master/editor/index.html index 767ee7ee5..82498cc9f 100644 --- a/snapshots/master/editor/index.html +++ b/snapshots/master/editor/index.html @@ -11,7 +11,7 @@ SlintPad - + diff --git a/snapshots/master/editor/preview.html b/snapshots/master/editor/preview.html index 6afecd880..b9ce5089b 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.js b/snapshots/master/wasm-interpreter/slint_wasm_interpreter.js index c23fd4a19..8297276db 100644 --- a/snapshots/master/wasm-interpreter/slint_wasm_interpreter.js +++ b/snapshots/master/wasm-interpreter/slint_wasm_interpreter.js @@ -1270,8 +1270,21 @@ function __wbg_get_imports() { getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }; - imports.wbg.__wbg_log_2f54632e0e18c089 = function(arg0, arg1) { - console.log(getStringFromWasm0(arg0, arg1)); + imports.wbg.__wbg_new0_65387337a95cf44d = function() { + const ret = new Date(); + return addHeapObject(ret); + }; + imports.wbg.__wbg_getTime_91058879093a1589 = function(arg0) { + const ret = getObject(arg0).getTime(); + return ret; + }; + imports.wbg.__wbg_new_7982fb43cfca37ae = function(arg0) { + const ret = new Date(getObject(arg0)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe = function(arg0) { + const ret = getObject(arg0).getTimezoneOffset(); + return ret; }; imports.wbg.__wbg_src_707c2de7cbb580c7 = function(arg0, arg1) { const ret = getObject(arg1).src; @@ -1293,21 +1306,8 @@ function __wbg_get_imports() { imports.wbg.__wbg_setsrc_129ba95151116b01 = function(arg0, arg1, arg2) { getObject(arg0).src = getStringFromWasm0(arg1, arg2); }; - imports.wbg.__wbg_new0_65387337a95cf44d = function() { - const ret = new Date(); - return addHeapObject(ret); - }; - imports.wbg.__wbg_getTime_91058879093a1589 = function(arg0) { - const ret = getObject(arg0).getTime(); - return ret; - }; - imports.wbg.__wbg_new_7982fb43cfca37ae = function(arg0) { - const ret = new Date(getObject(arg0)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe = function(arg0) { - const ret = getObject(arg0).getTimezoneOffset(); - return ret; + imports.wbg.__wbg_log_2f54632e0e18c089 = function(arg0, arg1) { + console.log(getStringFromWasm0(arg0, arg1)); }; imports.wbg.__wbg_cullFace_ccad99c645b704eb = function(arg0, arg1) { getObject(arg0).cullFace(arg1 >>> 0); @@ -1954,68 +1954,68 @@ function __wbg_get_imports() { const ret = getObject(arg0).getCoalescedEvents(); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1193 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1192 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 168, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1195 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1194 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 168, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1196 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1195 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 168, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1197 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1196 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 168, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1198 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1197 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 168, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper3331 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper3369 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6358 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper6366 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8492 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper8500 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8526 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8534 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8547 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_47); + imports.wbg.__wbindgen_closure_wrapper8555 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __wbg_adapter_47); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8563 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8571 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8572 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8580 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8581 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8589 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8587 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8595 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8604 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8612 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8627 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 376, __wbg_adapter_40); + imports.wbg.__wbindgen_closure_wrapper8635 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 380, __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 8c8dbf8c1..8d4a1e194 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